@chamn/render 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dev_/components.d.ts +1 -0
- package/dist/_dev_/dev.d.ts +1 -0
- package/dist/_dev_/page/DesignerRenderDemo.d.ts +5 -0
- package/dist/_dev_/page/RenderDemo.d.ts +5 -0
- package/dist/_dev_/router.d.ts +2 -0
- package/dist/core/adapter.d.ts +3 -0
- package/dist/core/type.d.ts +2 -0
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +4672 -11
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +8 -7
- package/dist/index.mjs +0 -4803
- package/dist/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,23 +1,3820 @@
|
|
|
1
|
-
"use strict";var va=Object.defineProperty;var ya=(t,e,r)=>e in t?va(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var y=(t,e,r)=>(ya(t,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),ba=require("react-dom");function _a(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const Sa=_a(ba),ja=t=>()=>{console.warn(`${t} need to be implement getComponent`)},Oa=["customPageRootRender"],Ur=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],Ln=t=>[...Ur,...Oa].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]=ja),r},{});var Ca=Object.defineProperty,wa=(t,e,r)=>e in t?Ca(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_=(t,e,r)=>(wa(t,typeof e!="symbol"?e+"":e,r),r),$a=typeof global=="object"&&global&&global.Object===Object&&global;const Fn=$a;var Ea=typeof self=="object"&&self&&self.Object===Object&&self,Na=Fn||Ea||Function("return this")();const K=Na;var Ta=K.Symbol;const G=Ta;var Bn=Object.prototype,xa=Bn.hasOwnProperty,Ma=Bn.toString,kt=G?G.toStringTag:void 0;function Aa(t){var e=xa.call(t,kt),r=t[kt];try{t[kt]=void 0;var n=!0}catch{}var o=Ma.call(t);return n&&(e?t[kt]=r:delete t[kt]),o}var Pa=Object.prototype,Ra=Pa.toString;function Da(t){return Ra.call(t)}var Ia="[object Null]",La="[object Undefined]",kr=G?G.toStringTag:void 0;function mt(t){return t==null?t===void 0?La:Ia:kr&&kr in Object(t)?Aa(t):Da(t)}function Y(t){return t!=null&&typeof t=="object"}var Fa="[object Symbol]";function ar(t){return typeof t=="symbol"||Y(t)&&mt(t)==Fa}function sr(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 Ba=Array.isArray;const R=Ba;var Ua=1/0,Vr=G?G.prototype:void 0,Gr=Vr?Vr.toString:void 0;function Un(t){if(typeof t=="string")return t;if(R(t))return sr(t,Un)+"";if(ar(t))return Gr?Gr.call(t):"";var e=t+"";return e=="0"&&1/t==-Ua?"-0":e}function Q(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ir(t){return t}var ka="[object AsyncFunction]",Va="[object Function]",Ga="[object GeneratorFunction]",za="[object Proxy]";function cr(t){if(!Q(t))return!1;var e=mt(t);return e==Va||e==Ga||e==ka||e==za}var Ha=K["__core-js_shared__"];const Me=Ha;var zr=function(){var t=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Wa(t){return!!zr&&zr in t}var Ja=Function.prototype,Qa=Ja.toString;function gt(t){if(t!=null){try{return Qa.call(t)}catch{}try{return t+""}catch{}}return""}var qa=/[\\^$.*+?()[\]{}|]/g,Ya=/^\[object .+?Constructor\]$/,Ka=Function.prototype,Xa=Object.prototype,Za=Ka.toString,ts=Xa.hasOwnProperty,es=RegExp("^"+Za.call(ts).replace(qa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rs(t){if(!Q(t)||Wa(t))return!1;var e=cr(t)?es:Ya;return e.test(gt(t))}function ns(t,e){return t==null?void 0:t[e]}function vt(t,e){var r=ns(t,e);return rs(r)?r:void 0}var os=vt(K,"WeakMap");const Ue=os;var Hr=Object.create,as=function(){function t(){}return function(e){if(!Q(e))return{};if(Hr)return Hr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const ss=as;function is(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function cs(){}function kn(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var us=800,ls=16,fs=Date.now;function ps(t){var e=0,r=0;return function(){var n=fs(),o=ls-(n-r);if(r=n,o>0){if(++e>=us)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function ds(t){return function(){return t}}var hs=function(){try{var t=vt(Object,"defineProperty");return t({},"",{}),t}catch{}}();const fe=hs;var ms=fe?function(t,e){return fe(t,"toString",{configurable:!0,enumerable:!1,value:ds(e),writable:!0})}:ir;const gs=ms;var vs=ps(gs);const Vn=vs;function ys(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function bs(t,e,r,n){for(var o=t.length,a=r+(n?1:-1);n?a--:++a<o;)if(e(t[a],a,t))return a;return-1}function _s(t){return t!==t}function Ss(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function js(t,e,r){return e===e?Ss(t,e,r):bs(t,_s,r)}function Os(t,e){var r=t==null?0:t.length;return!!r&&js(t,e,0)>-1}var Cs=9007199254740991,ws=/^(?:0|[1-9]\d*)$/;function ge(t,e){var r=typeof t;return e=e??Cs,!!e&&(r=="number"||r!="symbol"&&ws.test(t))&&t>-1&&t%1==0&&t<e}function ur(t,e,r){e=="__proto__"&&fe?fe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ee(t,e){return t===e||t!==t&&e!==e}var $s=Object.prototype,Es=$s.hasOwnProperty;function lr(t,e,r){var n=t[e];(!(Es.call(t,e)&&ee(n,r))||r===void 0&&!(e in t))&&ur(t,e,r)}function Nt(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;c===void 0&&(c=t[s]),o?ur(r,s,c):lr(r,s,c)}return r}var Wr=Math.max;function Gn(t,e,r){return e=Wr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Wr(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),is(t,this,s)}}function zn(t,e){return Vn(Gn(t,e,ir),t+"")}var Ns=9007199254740991;function fr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ns}function ve(t){return t!=null&&fr(t.length)&&!cr(t)}function Ts(t,e,r){if(!Q(r))return!1;var n=typeof e;return(n=="number"?ve(r)&&ge(e,r.length):n=="string"&&e in r)?ee(r[e],t):!1}function xs(t){return zn(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&&Ts(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 Ms=Object.prototype;function pr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ms;return t===r}function As(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ps="[object Arguments]";function Jr(t){return Y(t)&&mt(t)==Ps}var Hn=Object.prototype,Rs=Hn.hasOwnProperty,Ds=Hn.propertyIsEnumerable,Is=Jr(function(){return arguments}())?Jr:function(t){return Y(t)&&Rs.call(t,"callee")&&!Ds.call(t,"callee")};const Jt=Is;function Ls(){return!1}var Wn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qr=Wn&&typeof module=="object"&&module&&!module.nodeType&&module,Fs=Qr&&Qr.exports===Wn,qr=Fs?K.Buffer:void 0,Bs=qr?qr.isBuffer:void 0,Us=Bs||Ls;const Qt=Us;var ks="[object Arguments]",Vs="[object Array]",Gs="[object Boolean]",zs="[object Date]",Hs="[object Error]",Ws="[object Function]",Js="[object Map]",Qs="[object Number]",qs="[object Object]",Ys="[object RegExp]",Ks="[object Set]",Xs="[object String]",Zs="[object WeakMap]",ti="[object ArrayBuffer]",ei="[object DataView]",ri="[object Float32Array]",ni="[object Float64Array]",oi="[object Int8Array]",ai="[object Int16Array]",si="[object Int32Array]",ii="[object Uint8Array]",ci="[object Uint8ClampedArray]",ui="[object Uint16Array]",li="[object Uint32Array]",E={};E[ri]=E[ni]=E[oi]=E[ai]=E[si]=E[ii]=E[ci]=E[ui]=E[li]=!0;E[ks]=E[Vs]=E[ti]=E[Gs]=E[ei]=E[zs]=E[Hs]=E[Ws]=E[Js]=E[Qs]=E[qs]=E[Ys]=E[Ks]=E[Xs]=E[Zs]=!1;function fi(t){return Y(t)&&fr(t.length)&&!!E[mt(t)]}function dr(t){return function(e){return t(e)}}var Jn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gt=Jn&&typeof module=="object"&&module&&!module.nodeType&&module,pi=Gt&&Gt.exports===Jn,Ae=pi&&Fn.process,di=function(){try{var t=Gt&&Gt.require&&Gt.require("util").types;return t||Ae&&Ae.binding&&Ae.binding("util")}catch{}}();const St=di;var Yr=St&&St.isTypedArray,hi=Yr?dr(Yr):fi;const hr=hi;var mi=Object.prototype,gi=mi.hasOwnProperty;function Qn(t,e){var r=R(t),n=!r&&Jt(t),o=!r&&!n&&Qt(t),a=!r&&!n&&!o&&hr(t),i=r||n||o||a,s=i?As(t.length,String):[],c=s.length;for(var u in t)(e||gi.call(t,u))&&!(i&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ge(u,c)))&&s.push(u);return s}function qn(t,e){return function(r){return t(e(r))}}var vi=qn(Object.keys,Object);const yi=vi;var bi=Object.prototype,_i=bi.hasOwnProperty;function Si(t){if(!pr(t))return yi(t);var e=[];for(var r in Object(t))_i.call(t,r)&&r!="constructor"&&e.push(r);return e}function ye(t){return ve(t)?Qn(t):Si(t)}function ji(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Oi=Object.prototype,Ci=Oi.hasOwnProperty;function wi(t){if(!Q(t))return ji(t);var e=pr(t),r=[];for(var n in t)n=="constructor"&&(e||!Ci.call(t,n))||r.push(n);return r}function re(t){return ve(t)?Qn(t,!0):wi(t)}var $i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ei=/^\w*$/;function mr(t,e){if(R(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||ar(t)?!0:Ei.test(t)||!$i.test(t)||e!=null&&t in Object(e)}var Ni=vt(Object,"create");const qt=Ni;function Ti(){this.__data__=qt?qt(null):{},this.size=0}function xi(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Mi="__lodash_hash_undefined__",Ai=Object.prototype,Pi=Ai.hasOwnProperty;function Ri(t){var e=this.__data__;if(qt){var r=e[t];return r===Mi?void 0:r}return Pi.call(e,t)?e[t]:void 0}var Di=Object.prototype,Ii=Di.hasOwnProperty;function Li(t){var e=this.__data__;return qt?e[t]!==void 0:Ii.call(e,t)}var Fi="__lodash_hash_undefined__";function Bi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=qt&&e===void 0?Fi:e,this}function ft(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ft.prototype.clear=Ti;ft.prototype.delete=xi;ft.prototype.get=Ri;ft.prototype.has=Li;ft.prototype.set=Bi;function Ui(){this.__data__=[],this.size=0}function be(t,e){for(var r=t.length;r--;)if(ee(t[r][0],e))return r;return-1}var ki=Array.prototype,Vi=ki.splice;function Gi(t){var e=this.__data__,r=be(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Vi.call(e,r,1),--this.size,!0}function zi(t){var e=this.__data__,r=be(e,t);return r<0?void 0:e[r][1]}function Hi(t){return be(this.__data__,t)>-1}function Wi(t,e){var r=this.__data__,n=be(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function tt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}tt.prototype.clear=Ui;tt.prototype.delete=Gi;tt.prototype.get=zi;tt.prototype.has=Hi;tt.prototype.set=Wi;var Ji=vt(K,"Map");const Yt=Ji;function Qi(){this.size=0,this.__data__={hash:new ft,map:new(Yt||tt),string:new ft}}function qi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function _e(t,e){var r=t.__data__;return qi(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Yi(t){var e=_e(this,t).delete(t);return this.size-=e?1:0,e}function Ki(t){return _e(this,t).get(t)}function Xi(t){return _e(this,t).has(t)}function Zi(t,e){var r=_e(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=Qi;et.prototype.delete=Yi;et.prototype.get=Ki;et.prototype.has=Xi;et.prototype.set=Zi;var tc="Expected a function";function gr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(tc);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(gr.Cache||et),r}gr.Cache=et;var ec=500;function rc(t){var e=gr(t,function(n){return r.size===ec&&r.clear(),n}),r=e.cache;return e}var nc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oc=/\\(\\)?/g,ac=rc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(nc,function(r,n,o,a){e.push(o?a.replace(oc,"$1"):n||r)}),e});const sc=ac;function ic(t){return t==null?"":Un(t)}function Tt(t,e){return R(t)?t:mr(t,e)?[t]:sc(ic(t))}var cc=1/0;function xt(t){if(typeof t=="string"||ar(t))return t;var e=t+"";return e=="0"&&1/t==-cc?"-0":e}function Se(t,e){e=Tt(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 Yn(t,e,r){var n=t==null?void 0:Se(t,e);return n===void 0?r:n}function vr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var Kr=G?G.isConcatSpreadable:void 0;function uc(t){return R(t)||Jt(t)||!!(Kr&&t&&t[Kr])}function yr(t,e,r,n,o){var a=-1,i=t.length;for(r||(r=uc),o||(o=[]);++a<i;){var s=t[a];e>0&&r(s)?e>1?yr(s,e-1,r,n,o):vr(o,s):n||(o[o.length]=s)}return o}function lc(t){var e=t==null?0:t.length;return e?yr(t,1):[]}function fc(t){return Vn(Gn(t,void 0,lc),t+"")}var pc=qn(Object.getPrototypeOf,Object);const br=pc;var dc="[object Object]",hc=Function.prototype,mc=Object.prototype,Kn=hc.toString,gc=mc.hasOwnProperty,vc=Kn.call(Object);function B(t){if(!Y(t)||mt(t)!=dc)return!1;var e=br(t);if(e===null)return!0;var r=gc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Kn.call(r)==vc}function yc(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 bc(){this.__data__=new tt,this.size=0}function _c(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Sc(t){return this.__data__.get(t)}function jc(t){return this.__data__.has(t)}var Oc=200;function Cc(t,e){var r=this.__data__;if(r instanceof tt){var n=r.__data__;if(!Yt||n.length<Oc-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 W(t){var e=this.__data__=new tt(t);this.size=e.size}W.prototype.clear=bc;W.prototype.delete=_c;W.prototype.get=Sc;W.prototype.has=jc;W.prototype.set=Cc;function wc(t,e){return t&&Nt(e,ye(e),t)}function $c(t,e){return t&&Nt(e,re(e),t)}var Xn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xr=Xn&&typeof module=="object"&&module&&!module.nodeType&&module,Ec=Xr&&Xr.exports===Xn,Zr=Ec?K.Buffer:void 0,tn=Zr?Zr.allocUnsafe:void 0;function Zn(t,e){if(e)return t.slice();var r=t.length,n=tn?tn(r):new t.constructor(r);return t.copy(n),n}function Nc(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 to(){return[]}var Tc=Object.prototype,xc=Tc.propertyIsEnumerable,en=Object.getOwnPropertySymbols,Mc=en?function(t){return t==null?[]:(t=Object(t),Nc(en(t),function(e){return xc.call(t,e)}))}:to;const _r=Mc;function Ac(t,e){return Nt(t,_r(t),e)}var Pc=Object.getOwnPropertySymbols,Rc=Pc?function(t){for(var e=[];t;)vr(e,_r(t)),t=br(t);return e}:to;const eo=Rc;function Dc(t,e){return Nt(t,eo(t),e)}function ro(t,e,r){var n=e(t);return R(t)?n:vr(n,r(t))}function ke(t){return ro(t,ye,_r)}function Sr(t){return ro(t,re,eo)}var Ic=vt(K,"DataView");const Ve=Ic;var Lc=vt(K,"Promise");const Ge=Lc;var Fc=vt(K,"Set");const _t=Fc;var rn="[object Map]",Bc="[object Object]",nn="[object Promise]",on="[object Set]",an="[object WeakMap]",sn="[object DataView]",Uc=gt(Ve),kc=gt(Yt),Vc=gt(Ge),Gc=gt(_t),zc=gt(Ue),ut=mt;(Ve&&ut(new Ve(new ArrayBuffer(1)))!=sn||Yt&&ut(new Yt)!=rn||Ge&&ut(Ge.resolve())!=nn||_t&&ut(new _t)!=on||Ue&&ut(new Ue)!=an)&&(ut=function(t){var e=mt(t),r=e==Bc?t.constructor:void 0,n=r?gt(r):"";if(n)switch(n){case Uc:return sn;case kc:return rn;case Vc:return nn;case Gc:return on;case zc:return an}return e});const Kt=ut;var Hc=Object.prototype,Wc=Hc.hasOwnProperty;function Jc(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Wc.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Qc=K.Uint8Array;const pe=Qc;function jr(t){var e=new t.constructor(t.byteLength);return new pe(e).set(new pe(t)),e}function qc(t,e){var r=e?jr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Yc=/\w*$/;function Kc(t){var e=new t.constructor(t.source,Yc.exec(t));return e.lastIndex=t.lastIndex,e}var cn=G?G.prototype:void 0,un=cn?cn.valueOf:void 0;function Xc(t){return un?Object(un.call(t)):{}}function no(t,e){var r=e?jr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Zc="[object Boolean]",tu="[object Date]",eu="[object Map]",ru="[object Number]",nu="[object RegExp]",ou="[object Set]",au="[object String]",su="[object Symbol]",iu="[object ArrayBuffer]",cu="[object DataView]",uu="[object Float32Array]",lu="[object Float64Array]",fu="[object Int8Array]",pu="[object Int16Array]",du="[object Int32Array]",hu="[object Uint8Array]",mu="[object Uint8ClampedArray]",gu="[object Uint16Array]",vu="[object Uint32Array]";function yu(t,e,r){var n=t.constructor;switch(e){case iu:return jr(t);case Zc:case tu:return new n(+t);case cu:return qc(t,r);case uu:case lu:case fu:case pu:case du:case hu:case mu:case gu:case vu:return no(t,r);case eu:return new n;case ru:case au:return new n(t);case nu:return Kc(t);case ou:return new n;case su:return Xc(t)}}function oo(t){return typeof t.constructor=="function"&&!pr(t)?ss(br(t)):{}}var bu="[object Map]";function _u(t){return Y(t)&&Kt(t)==bu}var ln=St&&St.isMap,Su=ln?dr(ln):_u;const ju=Su;var Ou="[object Set]";function Cu(t){return Y(t)&&Kt(t)==Ou}var fn=St&&St.isSet,wu=fn?dr(fn):Cu;const $u=wu;var Eu=1,Nu=2,Tu=4,ao="[object Arguments]",xu="[object Array]",Mu="[object Boolean]",Au="[object Date]",Pu="[object Error]",so="[object Function]",Ru="[object GeneratorFunction]",Du="[object Map]",Iu="[object Number]",io="[object Object]",Lu="[object RegExp]",Fu="[object Set]",Bu="[object String]",Uu="[object Symbol]",ku="[object WeakMap]",Vu="[object ArrayBuffer]",Gu="[object DataView]",zu="[object Float32Array]",Hu="[object Float64Array]",Wu="[object Int8Array]",Ju="[object Int16Array]",Qu="[object Int32Array]",qu="[object Uint8Array]",Yu="[object Uint8ClampedArray]",Ku="[object Uint16Array]",Xu="[object Uint32Array]",$={};$[ao]=$[xu]=$[Vu]=$[Gu]=$[Mu]=$[Au]=$[zu]=$[Hu]=$[Wu]=$[Ju]=$[Qu]=$[Du]=$[Iu]=$[io]=$[Lu]=$[Fu]=$[Bu]=$[Uu]=$[qu]=$[Yu]=$[Ku]=$[Xu]=!0;$[Pu]=$[so]=$[ku]=!1;function zt(t,e,r,n,o,a){var i,s=e&Eu,c=e&Nu,u=e&Tu;if(r&&(i=o?r(t,n,o,a):r(t)),i!==void 0)return i;if(!Q(t))return t;var f=R(t);if(f){if(i=Jc(t),!s)return kn(t,i)}else{var p=Kt(t),l=p==so||p==Ru;if(Qt(t))return Zn(t,s);if(p==io||p==ao||l&&!o){if(i=c||l?{}:oo(t),!s)return c?Dc(t,$c(i,t)):Ac(t,wc(i,t))}else{if(!$[p])return o?t:{};i=yu(t,p,s)}}a||(a=new W);var d=a.get(t);if(d)return d;a.set(t,i),$u(t)?t.forEach(function(b){i.add(zt(b,e,r,b,t,a))}):ju(t)&&t.forEach(function(b,j){i.set(j,zt(b,e,r,j,t,a))});var h=u?c?Sr:ke:c?re:ye,v=f?void 0:h(t);return ys(v||t,function(b,j){v&&(j=b,b=t[j]),lr(i,j,zt(b,e,r,j,t,a))}),i}var Zu=1,tl=4;function co(t){return zt(t,Zu|tl)}var el="__lodash_hash_undefined__";function rl(t){return this.__data__.set(t,el),this}function nl(t){return this.__data__.has(t)}function Xt(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new et;++e<r;)this.add(t[e])}Xt.prototype.add=Xt.prototype.push=rl;Xt.prototype.has=nl;function ol(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 uo(t,e){return t.has(e)}var al=1,sl=2;function lo(t,e,r,n,o,a){var i=r&al,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 p=-1,l=!0,d=r&sl?new Xt:void 0;for(a.set(t,e),a.set(e,t);++p<s;){var h=t[p],v=e[p];if(n)var b=i?n(v,h,p,e,t,a):n(h,v,p,t,e,a);if(b!==void 0){if(b)continue;l=!1;break}if(d){if(!ol(e,function(j,O){if(!uo(d,O)&&(h===j||o(h,j,r,n,a)))return d.push(O)})){l=!1;break}}else if(!(h===v||o(h,v,r,n,a))){l=!1;break}}return a.delete(t),a.delete(e),l}function il(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Or(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var cl=1,ul=2,ll="[object Boolean]",fl="[object Date]",pl="[object Error]",dl="[object Map]",hl="[object Number]",ml="[object RegExp]",gl="[object Set]",vl="[object String]",yl="[object Symbol]",bl="[object ArrayBuffer]",_l="[object DataView]",pn=G?G.prototype:void 0,Pe=pn?pn.valueOf:void 0;function Sl(t,e,r,n,o,a,i){switch(r){case _l:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case bl:return!(t.byteLength!=e.byteLength||!a(new pe(t),new pe(e)));case ll:case fl:case hl:return ee(+t,+e);case pl:return t.name==e.name&&t.message==e.message;case ml:case vl:return t==e+"";case dl:var s=il;case gl:var c=n&cl;if(s||(s=Or),t.size!=e.size&&!c)return!1;var u=i.get(t);if(u)return u==e;n|=ul,i.set(t,e);var f=lo(s(t),s(e),n,o,a,i);return i.delete(t),f;case yl:if(Pe)return Pe.call(t)==Pe.call(e)}return!1}var jl=1,Ol=Object.prototype,Cl=Ol.hasOwnProperty;function wl(t,e,r,n,o,a){var i=r&jl,s=ke(t),c=s.length,u=ke(e),f=u.length;if(c!=f&&!i)return!1;for(var p=c;p--;){var l=s[p];if(!(i?l in e:Cl.call(e,l)))return!1}var d=a.get(t),h=a.get(e);if(d&&h)return d==e&&h==t;var v=!0;a.set(t,e),a.set(e,t);for(var b=i;++p<c;){l=s[p];var j=t[l],O=e[l];if(n)var T=i?n(O,j,l,e,t,a):n(j,O,l,t,e,a);if(!(T===void 0?j===O||o(j,O,r,n,a):T)){v=!1;break}b||(b=l=="constructor")}if(v&&!b){var A=t.constructor,I=e.constructor;A!=I&&"constructor"in t&&"constructor"in e&&!(typeof A=="function"&&A instanceof A&&typeof I=="function"&&I instanceof I)&&(v=!1)}return a.delete(t),a.delete(e),v}var $l=1,dn="[object Arguments]",hn="[object Array]",ce="[object Object]",El=Object.prototype,mn=El.hasOwnProperty;function Nl(t,e,r,n,o,a){var i=R(t),s=R(e),c=i?hn:Kt(t),u=s?hn:Kt(e);c=c==dn?ce:c,u=u==dn?ce:u;var f=c==ce,p=u==ce,l=c==u;if(l&&Qt(t)){if(!Qt(e))return!1;i=!0,f=!1}if(l&&!f)return a||(a=new W),i||hr(t)?lo(t,e,r,n,o,a):Sl(t,e,c,r,n,o,a);if(!(r&$l)){var d=f&&mn.call(t,"__wrapped__"),h=p&&mn.call(e,"__wrapped__");if(d||h){var v=d?t.value():t,b=h?e.value():e;return a||(a=new W),o(v,b,r,n,a)}}return l?(a||(a=new W),wl(t,e,r,n,o,a)):!1}function Cr(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:Nl(t,e,r,n,Cr,o)}var Tl=1,xl=2;function Ml(t,e,r,n){var o=r.length,a=o,i=!n;if(t==null)return!a;for(t=Object(t);o--;){var s=r[o];if(i&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=r[o];var c=s[0],u=t[c],f=s[1];if(i&&s[2]){if(u===void 0&&!(c in t))return!1}else{var p=new W;if(n)var l=n(u,f,c,t,e,p);if(!(l===void 0?Cr(f,u,Tl|xl,n,p):l))return!1}}return!0}function fo(t){return t===t&&!Q(t)}function Al(t){for(var e=ye(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,fo(o)]}return e}function po(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Pl(t){var e=Al(t);return e.length==1&&e[0][2]?po(e[0][0],e[0][1]):function(r){return r===t||Ml(r,t,e)}}function Rl(t,e){return t!=null&&e in Object(t)}function Dl(t,e,r){e=Tt(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&&fr(o)&&ge(i,o)&&(R(t)||Jt(t)))}function Il(t,e){return t!=null&&Dl(t,e,Rl)}var Ll=1,Fl=2;function Bl(t,e){return mr(t)&&fo(e)?po(xt(t),e):function(r){var n=Yn(r,t);return n===void 0&&n===e?Il(r,t):Cr(e,n,Ll|Fl)}}function Ul(t){return function(e){return e==null?void 0:e[t]}}function kl(t){return function(e){return Se(e,t)}}function Vl(t){return mr(t)?Ul(xt(t)):kl(t)}function wr(t){return typeof t=="function"?t:t==null?ir:typeof t=="object"?R(t)?Bl(t[0],t[1]):Pl(t):Vl(t)}function Gl(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),s=i.length;s--;){var c=i[t?s:++o];if(r(a[c],c,a)===!1)break}return e}}var zl=Gl();const Hl=zl;function ze(t,e,r){(r!==void 0&&!ee(t[e],r)||r===void 0&&!(e in t))&&ur(t,e,r)}function He(t){return Y(t)&&ve(t)}function We(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Wl(t){return Nt(t,re(t))}function Jl(t,e,r,n,o,a,i){var s=We(t,r),c=We(e,r),u=i.get(c);if(u){ze(t,r,u);return}var f=a?a(s,c,r+"",t,e,i):void 0,p=f===void 0;if(p){var l=R(c),d=!l&&Qt(c),h=!l&&!d&&hr(c);f=c,l||d||h?R(s)?f=s:He(s)?f=kn(s):d?(p=!1,f=Zn(c,!0)):h?(p=!1,f=no(c,!0)):f=[]:B(c)||Jt(c)?(f=s,Jt(s)?f=Wl(s):(!Q(s)||cr(s))&&(f=oo(c))):p=!1}p&&(i.set(c,f),o(f,c,n,a,i),i.delete(c)),ze(t,r,f)}function ho(t,e,r,n,o){t!==e&&Hl(e,function(a,i){if(o||(o=new W),Q(a))Jl(t,e,i,r,ho,n,o);else{var s=n?n(We(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),ze(t,i,s)}},re)}function Ql(t,e,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function mo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function ql(t,e){return e.length<2?t:Se(t,yc(e,0,-1))}var Yl=xs(function(t,e,r){ho(t,e,r)});const go=Yl;var Kl="Expected a function";function Xl(t){if(typeof t!="function")throw new TypeError(Kl);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Zl(t,e){return e=Tt(e,t),t=ql(t,e),t==null||delete t[xt(mo(e))]}function tf(t){return B(t)?void 0:t}var ef=1,rf=2,nf=4,of=fc(function(t,e){var r={};if(t==null)return r;var n=!1;e=sr(e,function(a){return a=Tt(a,t),n||(n=a.length>1),a}),Nt(t,Sr(t),r),n&&(r=zt(r,ef|rf|nf,tf));for(var o=e.length;o--;)Zl(r,e[o]);return r});const vo=of;function af(t,e,r,n){if(!Q(t))return t;e=Tt(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 f=s[c];u=n?n(f,c,s):void 0,u===void 0&&(u=Q(f)?f:ge(e[o+1])?[]:{})}lr(s,c,u),s=s[c]}return t}function sf(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var i=e[n],s=Se(t,i);r(s,i)&&af(a,Tt(i,t),s)}return a}function cf(t,e){if(t==null)return{};var r=sr(Sr(t),function(n){return[n]});return e=wr(e),sf(t,r,function(n,o){return e(n,o[0])})}function uf(t,e){return cf(t,Xl(wr(e)))}var lf=1/0,ff=_t&&1/Or(new _t([,-0]))[1]==lf?function(t){return new _t(t)}:cs;const pf=ff;var df=200;function hf(t,e,r){var n=-1,o=Os,a=t.length,i=!0,s=[],c=s;if(r)i=!1,o=Ql;else if(a>=df){var u=e?null:pf(t);if(u)return Or(u);i=!1,o=uo,c=new Xt}else c=e?[]:s;t:for(;++n<a;){var f=t[n],p=e?e(f):f;if(f=r||f!==0?f:0,i&&p===p){for(var l=c.length;l--;)if(c[l]===p)continue t;e&&c.push(p),s.push(f)}else o(c,p,r)||(c!==s&&c.push(p),s.push(f))}return s}var mf=zn(function(t){var e=mo(t);return He(e)&&(e=void 0),hf(yr(t,1,He,!0),wr(e))});const gf=mf;class yo 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 vf(t){return J(t)&&typeof t[Symbol.iterator]=="function"}function J(t){return typeof t=="object"&&t!=null}function U(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function yf(t){const{done:e,value:r}=t.next();return e?void 0:r}function bf(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: \`${U(n)}\``}=t;return{value:n,type:i,refinement:s,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*gn(t,e,r,n){vf(t)||(t=[t]);for(const o of t){const a=bf(o,e,r,n);a&&(yield a)}}function*$r(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:i=!1}=r,s={path:n,branch:o};if(a&&(t=e.coercer(t,s),i&&e.type!=="type"&&J(e.schema)&&J(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,p]of e.entries(t,s)){const l=$r(f,p,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,f],coerce:a,mask:i});for(const d of l)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):a&&(f=d[1],u===void 0?t=f:t instanceof Map?t.set(u,f):t instanceof Set?t.add(f):J(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 X{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer: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 gn(f,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const f=a(c,u);return gn(f,u,this,c)}:this.refiner=()=>[]}assert(e){return bo(e,this)}create(e){return _f(e,this)}is(e){return jf(e,this)}mask(e){return Sf(e,this)}validate(e,r){return r===void 0&&(r={}),Mt(e,this,r)}}function bo(t,e){const r=Mt(t,e);if(r[0])throw r[0]}function _f(t,e){const r=Mt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function Sf(t,e){const r=Mt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function jf(t,e){return!Mt(t,e)[0]}function Mt(t,e,r){r===void 0&&(r={});const n=$r(t,e,r),o=yf(n);return o[0]?[new yo(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function Er(){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?Oo(a):C(a)}function st(t,e){return new X({type:t,schema:null,validator:e})}function jt(t){return new X({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function _o(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Oo(n);default:return C(n)}}function x(){return st("any",()=>!0)}function P(t){return new X({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${U(e)}`}})}function pt(){return st("boolean",t=>typeof t=="boolean")}function Je(t){const e={},r=t.map(n=>U(n)).join();for(const n of t)e[n]=n;return new X({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${U(n)}`}})}function So(){return st("func",t=>typeof t=="function"||`Expected a function, but received: ${U(t)}`)}function L(t){const e=U(t),r=typeof t;return new X({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${U(n)}`}})}function Of(){return st("never",()=>!1)}function jo(){return st("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${U(t)}`)}function C(t){const e=t?Object.keys(t):[],r=Of();return new X({type:"object",schema:t||null,*entries(n){if(t&&J(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 J(n)||`Expected an object, but received: ${U(n)}`},coercer(n){return J(n)?{...n}:n}})}function m(t){return new X({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Ht(t,e){return new X({type:"record",schema:null,*entries(r){if(J(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return J(r)||`Expected an object, but received: ${U(r)}`}})}function g(){return st("string",t=>typeof t=="string"||`Expected a string, but received: ${U(t)}`)}function Oo(t){const e=Object.keys(t);return new X({type:"type",schema:t,*entries(r){if(J(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return J(r)||`Expected an object, but received: ${U(r)}`}})}function F(t){const e=t.map(r=>r.type).join(" | ");return new X({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||Cf()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...i]=$r(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: ${U(r)}`,...o]}})}function Cf(){return st("unknown",()=>!0)}const Nr=C({package:g(),version:g(),name:g(),exportName:m(g()),destructuring:m(pt()),subName:m(g()),main:m(g()),cssPaths:m(P(g()))}),wf=P(Nr),$f=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var V=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(V||{}),Tr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Tr||{}),Qe=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(Qe||{});const Ef=()=>st("normalObj",t=>!B(t)||[V.SLOT,V.EXPRESSION,V.FUNCTION].includes(t==null?void 0:t.type)?!1:(Mt(t,Ht(g(),xr)),!0)),xr=F([g(),jo(),pt(),C({type:L(V.SLOT),renderType:Je([Qe.FUNC,Qe.COMP]),params:m(P(g())),value:jt(()=>F([Ot,P(Ot)]))}),C({type:L(V.EXPRESSION),value:g()}),C({type:L(V.FUNCTION),value:g()}),Ef(),P(jt(()=>xr))]),vn=C({type:L(V.EXPRESSION),value:g()}),Ot=C({id:m(g()),title:m(g()),componentName:g(),props:m(Ht(g(),xr)),nodeName:m(g()),state:m(Ht(g(),x())),children:jt(()=>m(P(F([g(),Ot])))),configure:m(x()),css:m(x()),style:m(x()),classNames:m(P(x())),refId:m(g()),extra:m(Ht(x(),x())),condition:m(F([pt(),vn])),loop:m(C({open:pt(),data:F([P(x()),vn]),args:m(P(g())),forName:m(g()),forIndex:m(g()),key:m(x()),name:m(g())})),methods:m(P(x()))}),de=F([g(),C({label:g(),tip:m(g())})]),Nf=C({type:L("shape"),value:P(C({name:g(),title:de,valueType:jt(()=>je)}))}),Tf=C({type:L("enums"),value:P(g())});C({type:L("array"),value:jt(()=>je)});const xf=C({type:L("array"),value:jt(()=>P(je))}),je=F([Je(["array","boolean","number","object","string"]),Je(["component","expression","function"]),Nf,Tf,xf]),Mf=F([g(),C({componentName:g(),props:m(x()),initialValue:m(x()),component:m(x()),hiddenLabel:m(pt())})]),Re=C({name:g(),title:de,valueType:je,description:m(g()),defaultValue:x(),setters:m(P(Mf)),condition:m(So())});F([g(),So()]);var qe=(t=>(t.SINGLE="single",t.GROUP="group",t))(qe||{});F([g(),C({name:g(),describe:m(g()),params:m(C({name:g(),description:g()})),template:g()})]);const Af=C({id:m(g()),title:g(),snapshot:F([g(),x()]),snapshotText:m(g()),description:m(g()),tags:m(P(g())),groupName:m(g()),category:m(g()),schema:Er(_o(Ot,["id"]),C({componentName:m(g())}))}),Pf=C({componentName:g(),title:g(),screenshot:m(g()),icon:m(g()),tags:m(P(g())),groupName:m(g()),category:m(g()),priority:m(jo()),npm:m(Nr),snippets:P(Af),props:P(F([Re,C({title:m(de),type:L("single"),content:Re}),C({title:m(de),type:L("group"),content:P(Re)})])),fixedProps:m(x()),isContainer:m(F([pt(),C({placeholder:g(),width:g(),height:g()})])),disableEditorDragDom:m(x()),isLayout:m(pt()),rootSelector:m(g()),advanceCustom:m(x()),extra:m(Ht(x(),x()))}),Rf=t=>({data:e,message:r,throwError:n})=>{const o=t({data:e,message:r,throwError:n});if(o.isValidate)return o;if(n)throw o.message||r?new Error(`${o.message||r}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`)),{isValidate:!1,message:s,error:i}}})({data:e,message:r,throwError:n})};var At=(t=>(t.ROOT_CONTAINER="RootContainer",t))(At||{});const Df=C({type:L(V.FUNCTION),value:g()}),If=Er(_o(Ot,["componentName"]),C({componentName:L("RootContainer")}));function Lf(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=Lf(),Ff=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new dt([]);return e&&(o=e.materialsMode||new dt([])),n&&(R(n)?r.value=n.map(a=>new M(a,{parent:e,materials:o})):B(n)&&r.value.push(new M(n,{parent:e,materials:o}))),r};class Ct{constructor(e,r){_(this,"nodeType","SLOT"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",ne),_(this,"data"),_(this,"id"),_(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new dt([]);this.materialsMode=n,this.id=Z(),this.data=Ff(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof M)return o.export(e);if(B(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return R(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Co=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===qe.SINGLE?e.push(n.content):n.type===qe.GROUP&&(e=[...e,...Co(n.content)]):e.push(r)}),e},Ye=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new Ct(t,{parent:e,materials:r}):t;if(B(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Ke(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>Ye(n,e,r)):t},Ke=(t,e,r)=>B(t)?Ye(t,e,r):R(t)?t.map(n=>Ye(n,e,r)):t;class at{constructor(e,r,n){_(this,"nodeType","PROP"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",ne),_(this,"data"),_(this,"name"),_(this,"materialsMode");const o=(n==null?void 0:n.materials)||new dt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Ke(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Ke(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Ct)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof M){const r=e.material;return Co((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof at||o instanceof Ct||o instanceof M)return o.export(e);if(R(o))return o.map(a=>n(a));if(B(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return o};return n(r)}}const Bf=t=>{if(typeof t=="string")return!0;Mr({data:t,dataStruct:Ot,throwError:!1})},yn=(t,e,r=new dt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure:go(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 at){n.props[a]=s;return}n.props[a]=new at(a,s||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof M)return a;if(B(a)){const i=a;return new M(i,{parent:e,materials:r})}else return a}):(t.children instanceof M&&(n.children=[t.children]),n.children=[new M(t.children,{parent:e,materials:r})])),n};class M{constructor(e,r){_(this,"nodeType","NODE"),_(this,"rawData"),_(this,"data"),_(this,"emitter",ne),_(this,"parent"),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Bf(e);const n=(r==null?void 0:r.materials)||new dt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=yn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||Z()};return new M(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=yn(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 Pr(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(p=>{o[p]=n.props[p].export(e)});const a=(r=n.children)==null?void 0:r.map(p=>p instanceof M?p.export(e):p),i=n.configure||{},s=i.propsSetter||{},c={};Object.keys(s).forEach(p=>{const l=Yn(s,p,!1);l&&(c[p]=l)}),i.propsSetter=c;const u=this.materialsModel.usedMaterials.find(p=>{var l;return p.componentName===((l=this.material)==null?void 0:l.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 bn=(t,e,r)=>{const n={...t,id:Z(),props:{},componentName:At.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:go(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];R(t.children)?o=t.children.map(i=>i instanceof M?i:B(i)?new M(i,{parent:e,materials:r}):i):t.children instanceof M?o.push(t.children):t.children&&B(t.children)&&o.push(new M(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 at?n.props[i]=c:n.props[i]=new at(i,c||"",{parent:e,materials:r})}),n.children=o,n};class Zt{constructor(e,{parent:r,materials:n}){_(this,"rawData"),_(this,"data"),_(this,"nodeType",At.ROOT_CONTAINER),_(this,"emitter",ne),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),_(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=bn(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=bn(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 Pr(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=Tr.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=vo(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||Z()};return new Zt(r,{materials:this.materialsModel,parent:null})}}const ct=t=>(t==null?void 0:t.type)===V.EXPRESSION,Uf=t=>(t==null?void 0:t.type)===V.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),kf=t=>(t==null?void 0:t.nodeType)==="NODE",De=t=>(t==null?void 0:t.nodeType)==="PROP",Vf=t=>(t==null?void 0:t.nodeType)==="SLOT",Ar=t=>uf(t,e=>B(e)?!Object.keys(e).length:R(e)?!e.length:!e);function Gf(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 M){r.push(s);return}if(s instanceof Ct&&a(s.value.value),s instanceof at){a(s.value);return}if(B(s)){const c=s;Object.keys(c).forEach(u=>{a(c[u])});return}if(R(s)){s.forEach(c=>{a(c)});return}};a(o);const i=(n==null?void 0:n.value.children.filter(s=>s instanceof M))||[];r.push(...i)}}function Pr(t,e){return Gf(t,r=>r.id===e)}const zf=t=>{const e=co(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${Z()}`,title:n.title||t.title,category:n.category||t.category,tags:[...n.tags||[],...t.tags||[]],groupName:n.groupName||t.groupName,snapshot:n.snapshot||t.icon,snapshotText:n.snapshotText,schema:{...n.schema,componentName:n.schema.componentName||t.componentName}})),e};class Hf{constructor(e){_(this,"rawData"),_(this,"data"),this.rawData=e,this.data=zf(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 Ie=t=>{if(!R(t))throw new Error("Materials must be a array");return t.map(e=>new Hf(e))},Wf=t=>{t==null||t.forEach(e=>{Mr({data:e,dataStruct:Pf,throwError:!1})})};class dt{constructor(e){_(this,"rawData"),_(this,"data"),_(this,"usedMaterials",[]),this.rawData=e,Wf(e),this.data=Ie(e)}addMaterials(e){const r=Ie(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=Ie(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(p=>{const l=p.category||"default";i.includes(l)||(i.push(l),s[l]=[]),s[l].push(p)});const u=[];i.forEach(p=>{s[p].length&&u.push({name:p,list:s[p]})});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 Jf=C({version:g(),name:g(),css:m(g()),renderType:m(F([L("COMPONENT"),L("PAGE")])),loadType:m(x()),lifecycle:m(x()),props:m(x()),methods:m(P(Df)),componentsMeta:P(Er(C({componentName:g()}),Nr)),thirdLibs:m(wf),componentsTree:If,assets:m(P(x()))}),wo=t=>(Mr({data:t,dataStruct:Jf,throwError:!1}),t),Le=(t,e,r)=>({...t,componentsTree:new Zt(t.componentsTree,{parent:e,materials:r})});class he{constructor(e,r){_(this,"nodeType","PAGE"),_(this,"rawData"),_(this,"emitter",ne),_(this,"data"),_(this,"parent"),_(this,"materialsModel"),_(this,"assetPackagesList"),wo(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new dt((r==null?void 0:r.materials)||[]),this.data=Le(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=Le(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=Le(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 Pr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Zt)return console.warn("Not found parent node"),!1;if(a instanceof at)return console.warn("CProp can not add node"),!1;if(a instanceof Ct){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 he)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(B(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 M(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=Z();const n=new M(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 M?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 M&&a instanceof M?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 Ct){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 M||n instanceof Zt){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=Tr.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 p;return f.package===((p=c.value.npm)==null?void 0:p.package)});return u&&a.push(u),{componentName:c.componentName,...co(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${c} 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=gf(a,c=>c.package),s=vo(s,["id"]),JSON.parse(JSON.stringify(s))}getRootNode(){return this.data.componentsTree}}At.ROOT_CONTAINER;var Qf=typeof global=="object"&&global&&global.Object===Object&&global;const $o=Qf;var qf=typeof self=="object"&&self&&self.Object===Object&&self,Yf=$o||qf||Function("return this")();const Pt=Yf;var Kf=Pt.Symbol;const wt=Kf;var Eo=Object.prototype,Xf=Eo.hasOwnProperty,Zf=Eo.toString,Vt=wt?wt.toStringTag:void 0;function tp(t){var e=Xf.call(t,Vt),r=t[Vt];try{t[Vt]=void 0;var n=!0}catch{}var o=Zf.call(t);return n&&(e?t[Vt]=r:delete t[Vt]),o}var ep=Object.prototype,rp=ep.toString;function np(t){return rp.call(t)}var op="[object Null]",ap="[object Undefined]",_n=wt?wt.toStringTag:void 0;function oe(t){return t==null?t===void 0?ap:op:_n&&_n in Object(t)?tp(t):np(t)}function Rt(t){return t!=null&&typeof t=="object"}var sp="[object Symbol]";function ip(t){return typeof t=="symbol"||Rt(t)&&oe(t)==sp}function cp(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 up=Array.isArray;const $t=up;var lp=1/0,Sn=wt?wt.prototype:void 0,jn=Sn?Sn.toString:void 0;function No(t){if(typeof t=="string")return t;if($t(t))return cp(t,No)+"";if(ip(t))return jn?jn.call(t):"";var e=t+"";return e=="0"&&1/t==-lp?"-0":e}function yt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function To(t){return t}var fp="[object AsyncFunction]",pp="[object Function]",dp="[object GeneratorFunction]",hp="[object Proxy]";function Rr(t){if(!yt(t))return!1;var e=oe(t);return e==pp||e==dp||e==fp||e==hp}var mp=Pt["__core-js_shared__"];const Fe=mp;var On=function(){var t=/[^.]+$/.exec(Fe&&Fe.keys&&Fe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function gp(t){return!!On&&On in t}var vp=Function.prototype,yp=vp.toString;function bp(t){if(t!=null){try{return yp.call(t)}catch{}try{return t+""}catch{}}return""}var _p=/[\\^$.*+?()[\]{}|]/g,Sp=/^\[object .+?Constructor\]$/,jp=Function.prototype,Op=Object.prototype,Cp=jp.toString,wp=Op.hasOwnProperty,$p=RegExp("^"+Cp.call(wp).replace(_p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ep(t){if(!yt(t)||gp(t))return!1;var e=Rr(t)?$p:Sp;return e.test(bp(t))}function Np(t,e){return t==null?void 0:t[e]}function Dr(t,e){var r=Np(t,e);return Ep(r)?r:void 0}var Cn=Object.create,Tp=function(){function t(){}return function(e){if(!yt(e))return{};if(Cn)return Cn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const xp=Tp;function Mp(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ap(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Pp=800,Rp=16,Dp=Date.now;function Ip(t){var e=0,r=0;return function(){var n=Dp(),o=Rp-(n-r);if(r=n,o>0){if(++e>=Pp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Lp(t){return function(){return t}}var Fp=function(){try{var t=Dr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const me=Fp;var Bp=me?function(t,e){return me(t,"toString",{configurable:!0,enumerable:!1,value:Lp(e),writable:!0})}:To;const Up=Bp;var kp=Ip(Up);const Vp=kp;var Gp=9007199254740991,zp=/^(?:0|[1-9]\d*)$/;function xo(t,e){var r=typeof t;return e=e??Gp,!!e&&(r=="number"||r!="symbol"&&zp.test(t))&&t>-1&&t%1==0&&t<e}function Ir(t,e,r){e=="__proto__"&&me?me(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Oe(t,e){return t===e||t!==t&&e!==e}var Hp=Object.prototype,Wp=Hp.hasOwnProperty;function Jp(t,e,r){var n=t[e];(!(Wp.call(t,e)&&Oe(n,r))||r===void 0&&!(e in t))&&Ir(t,e,r)}function Qp(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;c===void 0&&(c=t[s]),o?Ir(r,s,c):Jp(r,s,c)}return r}var wn=Math.max;function qp(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),Mp(t,this,s)}}function Yp(t,e){return Vp(qp(t,e,To),t+"")}var Kp=9007199254740991;function Mo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Kp}function Lr(t){return t!=null&&Mo(t.length)&&!Rr(t)}function Xp(t,e,r){if(!yt(r))return!1;var n=typeof e;return(n=="number"?Lr(r)&&xo(e,r.length):n=="string"&&e in r)?Oe(r[e],t):!1}function Zp(t){return Yp(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&&Xp(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 td=Object.prototype;function Ao(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||td;return t===r}function ed(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var rd="[object Arguments]";function $n(t){return Rt(t)&&oe(t)==rd}var Po=Object.prototype,nd=Po.hasOwnProperty,od=Po.propertyIsEnumerable,ad=$n(function(){return arguments}())?$n:function(t){return Rt(t)&&nd.call(t,"callee")&&!od.call(t,"callee")};const Xe=ad;function sd(){return!1}var Ro=typeof exports=="object"&&exports&&!exports.nodeType&&exports,En=Ro&&typeof module=="object"&&module&&!module.nodeType&&module,id=En&&En.exports===Ro,Nn=id?Pt.Buffer:void 0,cd=Nn?Nn.isBuffer:void 0,ud=cd||sd;const Do=ud;var ld="[object Arguments]",fd="[object Array]",pd="[object Boolean]",dd="[object Date]",hd="[object Error]",md="[object Function]",gd="[object Map]",vd="[object Number]",yd="[object Object]",bd="[object RegExp]",_d="[object Set]",Sd="[object String]",jd="[object WeakMap]",Od="[object ArrayBuffer]",Cd="[object DataView]",wd="[object Float32Array]",$d="[object Float64Array]",Ed="[object Int8Array]",Nd="[object Int16Array]",Td="[object Int32Array]",xd="[object Uint8Array]",Md="[object Uint8ClampedArray]",Ad="[object Uint16Array]",Pd="[object Uint32Array]",N={};N[wd]=N[$d]=N[Ed]=N[Nd]=N[Td]=N[xd]=N[Md]=N[Ad]=N[Pd]=!0;N[ld]=N[fd]=N[Od]=N[pd]=N[Cd]=N[dd]=N[hd]=N[md]=N[gd]=N[vd]=N[yd]=N[bd]=N[_d]=N[Sd]=N[jd]=!1;function Rd(t){return Rt(t)&&Mo(t.length)&&!!N[oe(t)]}function Dd(t){return function(e){return t(e)}}var Io=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Io&&typeof module=="object"&&module&&!module.nodeType&&module,Id=Wt&&Wt.exports===Io,Be=Id&&$o.process,Ld=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Be&&Be.binding&&Be.binding("util")}catch{}}();const Tn=Ld;var xn=Tn&&Tn.isTypedArray,Fd=xn?Dd(xn):Rd;const Lo=Fd;var Bd=Object.prototype,Ud=Bd.hasOwnProperty;function kd(t,e){var r=$t(t),n=!r&&Xe(t),o=!r&&!n&&Do(t),a=!r&&!n&&!o&&Lo(t),i=r||n||o||a,s=i?ed(t.length,String):[],c=s.length;for(var u in t)(e||Ud.call(t,u))&&!(i&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||xo(u,c)))&&s.push(u);return s}function Vd(t,e){return function(r){return t(e(r))}}function Gd(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var zd=Object.prototype,Hd=zd.hasOwnProperty;function Wd(t){if(!yt(t))return Gd(t);var e=Ao(t),r=[];for(var n in t)n=="constructor"&&(e||!Hd.call(t,n))||r.push(n);return r}function Fo(t){return Lr(t)?kd(t,!0):Wd(t)}var Jd=Dr(Object,"create");const te=Jd;function Qd(){this.__data__=te?te(null):{},this.size=0}function qd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Yd="__lodash_hash_undefined__",Kd=Object.prototype,Xd=Kd.hasOwnProperty;function Zd(t){var e=this.__data__;if(te){var r=e[t];return r===Yd?void 0:r}return Xd.call(e,t)?e[t]:void 0}var th=Object.prototype,eh=th.hasOwnProperty;function rh(t){var e=this.__data__;return te?e[t]!==void 0:eh.call(e,t)}var nh="__lodash_hash_undefined__";function oh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=te&&e===void 0?nh: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=Qd;ht.prototype.delete=qd;ht.prototype.get=Zd;ht.prototype.has=rh;ht.prototype.set=oh;function ah(){this.__data__=[],this.size=0}function Ce(t,e){for(var r=t.length;r--;)if(Oe(t[r][0],e))return r;return-1}var sh=Array.prototype,ih=sh.splice;function ch(t){var e=this.__data__,r=Ce(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ih.call(e,r,1),--this.size,!0}function uh(t){var e=this.__data__,r=Ce(e,t);return r<0?void 0:e[r][1]}function lh(t){return Ce(this.__data__,t)>-1}function fh(t,e){var r=this.__data__,n=Ce(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=ah;rt.prototype.delete=ch;rt.prototype.get=uh;rt.prototype.has=lh;rt.prototype.set=fh;var ph=Dr(Pt,"Map");const Bo=ph;function dh(){this.size=0,this.__data__={hash:new ht,map:new(Bo||rt),string:new ht}}function hh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function we(t,e){var r=t.__data__;return hh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function mh(t){var e=we(this,t).delete(t);return this.size-=e?1:0,e}function gh(t){return we(this,t).get(t)}function vh(t){return we(this,t).has(t)}function yh(t,e){var r=we(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Dt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Dt.prototype.clear=dh;Dt.prototype.delete=mh;Dt.prototype.get=gh;Dt.prototype.has=vh;Dt.prototype.set=yh;function Uo(t){return t==null?"":No(t)}var bh=Vd(Object.getPrototypeOf,Object);const ko=bh;var _h="[object Object]",Sh=Function.prototype,jh=Object.prototype,Vo=Sh.toString,Oh=jh.hasOwnProperty,Ch=Vo.call(Object);function Et(t){if(!Rt(t)||oe(t)!=_h)return!1;var e=ko(t);if(e===null)return!0;var r=Oh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Vo.call(r)==Ch}function wh(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 $h(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:wh(t,e,r)}var Eh="\\ud800-\\udfff",Nh="\\u0300-\\u036f",Th="\\ufe20-\\ufe2f",xh="\\u20d0-\\u20ff",Mh=Nh+Th+xh,Ah="\\ufe0e\\ufe0f",Ph="\\u200d",Rh=RegExp("["+Ph+Eh+Mh+Ah+"]");function Go(t){return Rh.test(t)}function Dh(t){return t.split("")}var zo="\\ud800-\\udfff",Ih="\\u0300-\\u036f",Lh="\\ufe20-\\ufe2f",Fh="\\u20d0-\\u20ff",Bh=Ih+Lh+Fh,Uh="\\ufe0e\\ufe0f",kh="["+zo+"]",Ze="["+Bh+"]",tr="\\ud83c[\\udffb-\\udfff]",Vh="(?:"+Ze+"|"+tr+")",Ho="[^"+zo+"]",Wo="(?:\\ud83c[\\udde6-\\uddff]){2}",Jo="[\\ud800-\\udbff][\\udc00-\\udfff]",Gh="\\u200d",Qo=Vh+"?",qo="["+Uh+"]?",zh="(?:"+Gh+"(?:"+[Ho,Wo,Jo].join("|")+")"+qo+Qo+")*",Hh=qo+Qo+zh,Wh="(?:"+[Ho+Ze+"?",Ze,Wo,Jo,kh].join("|")+")",Jh=RegExp(tr+"(?="+tr+")|"+Wh+Hh,"g");function Qh(t){return t.match(Jh)||[]}function qh(t){return Go(t)?Qh(t):Dh(t)}function Yh(t){return function(e){e=Uo(e);var r=Go(e)?qh(e):void 0,n=r?r[0]:e.charAt(0),o=r?$h(r,1).join(""):e.slice(1);return n[t]()+o}}var Kh=Yh("toUpperCase");const Xh=Kh;function Zh(t){return Xh(Uo(t).toLowerCase())}function tm(){this.__data__=new rt,this.size=0}function em(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function rm(t){return this.__data__.get(t)}function nm(t){return this.__data__.has(t)}var om=200;function am(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!Bo||n.length<om-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}function It(t){var e=this.__data__=new rt(t);this.size=e.size}It.prototype.clear=tm;It.prototype.delete=em;It.prototype.get=rm;It.prototype.has=nm;It.prototype.set=am;var Yo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=Yo&&typeof module=="object"&&module&&!module.nodeType&&module,sm=Mn&&Mn.exports===Yo,An=sm?Pt.Buffer:void 0,Pn=An?An.allocUnsafe:void 0;function im(t,e){if(e)return t.slice();var r=t.length,n=Pn?Pn(r):new t.constructor(r);return t.copy(n),n}var cm=Pt.Uint8Array;const Rn=cm;function um(t){var e=new t.constructor(t.byteLength);return new Rn(e).set(new Rn(t)),e}function lm(t,e){var r=e?um(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function fm(t){return typeof t.constructor=="function"&&!Ao(t)?xp(ko(t)):{}}function pm(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),s=i.length;s--;){var c=i[t?s:++o];if(r(a[c],c,a)===!1)break}return e}}var dm=pm();const hm=dm;function er(t,e,r){(r!==void 0&&!Oe(t[e],r)||r===void 0&&!(e in t))&&Ir(t,e,r)}function mm(t){return Rt(t)&&Lr(t)}function rr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function gm(t){return Qp(t,Fo(t))}function vm(t,e,r,n,o,a,i){var s=rr(t,r),c=rr(e,r),u=i.get(c);if(u){er(t,r,u);return}var f=a?a(s,c,r+"",t,e,i):void 0,p=f===void 0;if(p){var l=$t(c),d=!l&&Do(c),h=!l&&!d&&Lo(c);f=c,l||d||h?$t(s)?f=s:mm(s)?f=Ap(s):d?(p=!1,f=im(c,!0)):h?(p=!1,f=lm(c,!0)):f=[]:Et(c)||Xe(c)?(f=s,Xe(s)?f=gm(s):(!yt(s)||Rr(s))&&(f=fm(c))):p=!1}p&&(i.set(c,f),o(f,c,n,a,i),i.delete(c)),er(t,r,f)}function Ko(t,e,r,n,o){t!==e&&hm(e,function(a,i){if(o||(o=new It),yt(a))vm(t,e,i,r,Ko,n,o);else{var s=n?n(rr(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),er(t,i,s)}},Fo)}var ym=Zp(function(t,e,r){Ko(t,e,r)});const bm=ym,_m=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Xo(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function Zo(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 ta(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const lt=(t,e)=>{const r=n=>{const a=`
|
|
7
|
-
|
|
1
|
+
var ua = Object.defineProperty;
|
|
2
|
+
var la = (t, e, r) => e in t ? ua(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var y = (t, e, r) => la(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import O, { Component as fa, createElement as pa, useEffect as Fn, useRef as kn, useMemo as Un } from "react";
|
|
5
|
+
const da = (t) => () => {
|
|
6
|
+
console.warn(`${t} need to be implement getComponent`);
|
|
7
|
+
}, ha = ["customPageRootRender"], Br = [
|
|
8
|
+
// 页面渲染
|
|
9
|
+
"pageRender",
|
|
10
|
+
// 渲染一个组件
|
|
11
|
+
"render",
|
|
12
|
+
// 将一个 组件 model 节点 转换为一个可被运行的渲染函数
|
|
13
|
+
"convertModelToComponent",
|
|
14
|
+
"getComponent",
|
|
15
|
+
"getContext",
|
|
16
|
+
"getUtils",
|
|
17
|
+
"getDataLink",
|
|
18
|
+
"createDataLink",
|
|
19
|
+
"transformProps",
|
|
20
|
+
"transformData",
|
|
21
|
+
"transformGlobalData",
|
|
22
|
+
"errorCatch",
|
|
23
|
+
"clear"
|
|
24
|
+
], ma = (t) => [...Br, ...ha].reduce((r, n) => {
|
|
25
|
+
var o;
|
|
26
|
+
return t != null && t[n] ? r[n] = (o = t[n]) == null ? void 0 : o.bind(t) : Br.includes(n) && (r[n] = da), r;
|
|
27
|
+
}, {});
|
|
28
|
+
var ga = Object.defineProperty, va = (t, e, r) => e in t ? ga(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, _ = (t, e, r) => va(t, typeof e != "symbol" ? e + "" : e, r), Vn = typeof global == "object" && global && global.Object === Object && global, ya = typeof self == "object" && self && self.Object === Object && self, K = Vn || ya || Function("return this")(), G = K.Symbol, Gn = Object.prototype, ba = Gn.hasOwnProperty, _a = Gn.toString, Ut = G ? G.toStringTag : void 0;
|
|
29
|
+
function Sa(t) {
|
|
30
|
+
var e = ba.call(t, Ut), r = t[Ut];
|
|
31
|
+
try {
|
|
32
|
+
t[Ut] = void 0;
|
|
33
|
+
var n = !0;
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
var o = _a.call(t);
|
|
37
|
+
return n && (e ? t[Ut] = r : delete t[Ut]), o;
|
|
38
|
+
}
|
|
39
|
+
var ja = Object.prototype, Oa = ja.toString;
|
|
40
|
+
function wa(t) {
|
|
41
|
+
return Oa.call(t);
|
|
42
|
+
}
|
|
43
|
+
var Ca = "[object Null]", Ea = "[object Undefined]", Fr = G ? G.toStringTag : void 0;
|
|
44
|
+
function ht(t) {
|
|
45
|
+
return t == null ? t === void 0 ? Ea : Ca : Fr && Fr in Object(t) ? Sa(t) : wa(t);
|
|
46
|
+
}
|
|
47
|
+
function X(t) {
|
|
48
|
+
return t != null && typeof t == "object";
|
|
49
|
+
}
|
|
50
|
+
var Na = "[object Symbol]";
|
|
51
|
+
function or(t) {
|
|
52
|
+
return typeof t == "symbol" || X(t) && ht(t) == Na;
|
|
53
|
+
}
|
|
54
|
+
function ar(t, e) {
|
|
55
|
+
for (var r = -1, n = t == null ? 0 : t.length, o = Array(n); ++r < n; )
|
|
56
|
+
o[r] = e(t[r], r, t);
|
|
57
|
+
return o;
|
|
58
|
+
}
|
|
59
|
+
var R = Array.isArray, $a = 1 / 0, kr = G ? G.prototype : void 0, Ur = kr ? kr.toString : void 0;
|
|
60
|
+
function zn(t) {
|
|
61
|
+
if (typeof t == "string")
|
|
62
|
+
return t;
|
|
63
|
+
if (R(t))
|
|
64
|
+
return ar(t, zn) + "";
|
|
65
|
+
if (or(t))
|
|
66
|
+
return Ur ? Ur.call(t) : "";
|
|
67
|
+
var e = t + "";
|
|
68
|
+
return e == "0" && 1 / t == -$a ? "-0" : e;
|
|
69
|
+
}
|
|
70
|
+
function Q(t) {
|
|
71
|
+
var e = typeof t;
|
|
72
|
+
return t != null && (e == "object" || e == "function");
|
|
73
|
+
}
|
|
74
|
+
function ir(t) {
|
|
75
|
+
return t;
|
|
76
|
+
}
|
|
77
|
+
var xa = "[object AsyncFunction]", Ta = "[object Function]", Aa = "[object GeneratorFunction]", Ma = "[object Proxy]";
|
|
78
|
+
function sr(t) {
|
|
79
|
+
if (!Q(t))
|
|
80
|
+
return !1;
|
|
81
|
+
var e = ht(t);
|
|
82
|
+
return e == Ta || e == Aa || e == xa || e == Ma;
|
|
83
|
+
}
|
|
84
|
+
var Te = K["__core-js_shared__"], Vr = function() {
|
|
85
|
+
var t = /[^.]+$/.exec(Te && Te.keys && Te.keys.IE_PROTO || "");
|
|
86
|
+
return t ? "Symbol(src)_1." + t : "";
|
|
87
|
+
}();
|
|
88
|
+
function Pa(t) {
|
|
89
|
+
return !!Vr && Vr in t;
|
|
90
|
+
}
|
|
91
|
+
var Ra = Function.prototype, Ia = Ra.toString;
|
|
92
|
+
function mt(t) {
|
|
93
|
+
if (t != null) {
|
|
94
|
+
try {
|
|
95
|
+
return Ia.call(t);
|
|
96
|
+
} catch {
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
return t + "";
|
|
100
|
+
} catch {
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return "";
|
|
104
|
+
}
|
|
105
|
+
var Da = /[\\^$.*+?()[\]{}|]/g, La = /^\[object .+?Constructor\]$/, Ba = Function.prototype, Fa = Object.prototype, ka = Ba.toString, Ua = Fa.hasOwnProperty, Va = RegExp(
|
|
106
|
+
"^" + ka.call(Ua).replace(Da, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
107
|
+
);
|
|
108
|
+
function Ga(t) {
|
|
109
|
+
if (!Q(t) || Pa(t))
|
|
110
|
+
return !1;
|
|
111
|
+
var e = sr(t) ? Va : La;
|
|
112
|
+
return e.test(mt(t));
|
|
113
|
+
}
|
|
114
|
+
function za(t, e) {
|
|
115
|
+
return t == null ? void 0 : t[e];
|
|
116
|
+
}
|
|
117
|
+
function gt(t, e) {
|
|
118
|
+
var r = za(t, e);
|
|
119
|
+
return Ga(r) ? r : void 0;
|
|
120
|
+
}
|
|
121
|
+
var Ue = gt(K, "WeakMap"), Gr = Object.create, Ha = /* @__PURE__ */ function() {
|
|
122
|
+
function t() {
|
|
123
|
+
}
|
|
124
|
+
return function(e) {
|
|
125
|
+
if (!Q(e))
|
|
126
|
+
return {};
|
|
127
|
+
if (Gr)
|
|
128
|
+
return Gr(e);
|
|
129
|
+
t.prototype = e;
|
|
130
|
+
var r = new t();
|
|
131
|
+
return t.prototype = void 0, r;
|
|
132
|
+
};
|
|
133
|
+
}();
|
|
134
|
+
function Ja(t, e, r) {
|
|
135
|
+
switch (r.length) {
|
|
136
|
+
case 0:
|
|
137
|
+
return t.call(e);
|
|
138
|
+
case 1:
|
|
139
|
+
return t.call(e, r[0]);
|
|
140
|
+
case 2:
|
|
141
|
+
return t.call(e, r[0], r[1]);
|
|
142
|
+
case 3:
|
|
143
|
+
return t.call(e, r[0], r[1], r[2]);
|
|
144
|
+
}
|
|
145
|
+
return t.apply(e, r);
|
|
146
|
+
}
|
|
147
|
+
function Wa() {
|
|
148
|
+
}
|
|
149
|
+
function Hn(t, e) {
|
|
150
|
+
var r = -1, n = t.length;
|
|
151
|
+
for (e || (e = Array(n)); ++r < n; )
|
|
152
|
+
e[r] = t[r];
|
|
153
|
+
return e;
|
|
154
|
+
}
|
|
155
|
+
var qa = 800, Qa = 16, Ya = Date.now;
|
|
156
|
+
function Xa(t) {
|
|
157
|
+
var e = 0, r = 0;
|
|
158
|
+
return function() {
|
|
159
|
+
var n = Ya(), o = Qa - (n - r);
|
|
160
|
+
if (r = n, o > 0) {
|
|
161
|
+
if (++e >= qa)
|
|
162
|
+
return arguments[0];
|
|
163
|
+
} else
|
|
164
|
+
e = 0;
|
|
165
|
+
return t.apply(void 0, arguments);
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function Ka(t) {
|
|
169
|
+
return function() {
|
|
170
|
+
return t;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
var fe = function() {
|
|
174
|
+
try {
|
|
175
|
+
var t = gt(Object, "defineProperty");
|
|
176
|
+
return t({}, "", {}), t;
|
|
177
|
+
} catch {
|
|
178
|
+
}
|
|
179
|
+
}(), Za = fe ? function(t, e) {
|
|
180
|
+
return fe(t, "toString", {
|
|
181
|
+
configurable: !0,
|
|
182
|
+
enumerable: !1,
|
|
183
|
+
value: Ka(e),
|
|
184
|
+
writable: !0
|
|
185
|
+
});
|
|
186
|
+
} : ir, Jn = Xa(Za);
|
|
187
|
+
function ti(t, e) {
|
|
188
|
+
for (var r = -1, n = t == null ? 0 : t.length; ++r < n && e(t[r], r, t) !== !1; )
|
|
189
|
+
;
|
|
190
|
+
return t;
|
|
191
|
+
}
|
|
192
|
+
function ei(t, e, r, n) {
|
|
193
|
+
for (var o = t.length, a = r + -1; ++a < o; )
|
|
194
|
+
if (e(t[a], a, t))
|
|
195
|
+
return a;
|
|
196
|
+
return -1;
|
|
197
|
+
}
|
|
198
|
+
function ri(t) {
|
|
199
|
+
return t !== t;
|
|
200
|
+
}
|
|
201
|
+
function ni(t, e, r) {
|
|
202
|
+
for (var n = r - 1, o = t.length; ++n < o; )
|
|
203
|
+
if (t[n] === e)
|
|
204
|
+
return n;
|
|
205
|
+
return -1;
|
|
206
|
+
}
|
|
207
|
+
function oi(t, e, r) {
|
|
208
|
+
return e === e ? ni(t, e, r) : ei(t, ri, r);
|
|
209
|
+
}
|
|
210
|
+
function ai(t, e) {
|
|
211
|
+
var r = t == null ? 0 : t.length;
|
|
212
|
+
return !!r && oi(t, e, 0) > -1;
|
|
213
|
+
}
|
|
214
|
+
var ii = 9007199254740991, si = /^(?:0|[1-9]\d*)$/;
|
|
215
|
+
function ge(t, e) {
|
|
216
|
+
var r = typeof t;
|
|
217
|
+
return e = e ?? ii, !!e && (r == "number" || r != "symbol" && si.test(t)) && t > -1 && t % 1 == 0 && t < e;
|
|
218
|
+
}
|
|
219
|
+
function cr(t, e, r) {
|
|
220
|
+
e == "__proto__" && fe ? fe(t, e, {
|
|
221
|
+
configurable: !0,
|
|
222
|
+
enumerable: !0,
|
|
223
|
+
value: r,
|
|
224
|
+
writable: !0
|
|
225
|
+
}) : t[e] = r;
|
|
226
|
+
}
|
|
227
|
+
function ee(t, e) {
|
|
228
|
+
return t === e || t !== t && e !== e;
|
|
229
|
+
}
|
|
230
|
+
var ci = Object.prototype, ui = ci.hasOwnProperty;
|
|
231
|
+
function ur(t, e, r) {
|
|
232
|
+
var n = t[e];
|
|
233
|
+
(!(ui.call(t, e) && ee(n, r)) || r === void 0 && !(e in t)) && cr(t, e, r);
|
|
234
|
+
}
|
|
235
|
+
function $t(t, e, r, n) {
|
|
236
|
+
var o = !r;
|
|
237
|
+
r || (r = {});
|
|
238
|
+
for (var a = -1, s = e.length; ++a < s; ) {
|
|
239
|
+
var i = e[a], c = void 0;
|
|
240
|
+
c === void 0 && (c = t[i]), o ? cr(r, i, c) : ur(r, i, c);
|
|
241
|
+
}
|
|
242
|
+
return r;
|
|
243
|
+
}
|
|
244
|
+
var zr = Math.max;
|
|
245
|
+
function Wn(t, e, r) {
|
|
246
|
+
return e = zr(e === void 0 ? t.length - 1 : e, 0), function() {
|
|
247
|
+
for (var n = arguments, o = -1, a = zr(n.length - e, 0), s = Array(a); ++o < a; )
|
|
248
|
+
s[o] = n[e + o];
|
|
249
|
+
o = -1;
|
|
250
|
+
for (var i = Array(e + 1); ++o < e; )
|
|
251
|
+
i[o] = n[o];
|
|
252
|
+
return i[e] = r(s), Ja(t, this, i);
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function qn(t, e) {
|
|
256
|
+
return Jn(Wn(t, e, ir), t + "");
|
|
257
|
+
}
|
|
258
|
+
var li = 9007199254740991;
|
|
259
|
+
function lr(t) {
|
|
260
|
+
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= li;
|
|
261
|
+
}
|
|
262
|
+
function ve(t) {
|
|
263
|
+
return t != null && lr(t.length) && !sr(t);
|
|
264
|
+
}
|
|
265
|
+
function fi(t, e, r) {
|
|
266
|
+
if (!Q(r))
|
|
267
|
+
return !1;
|
|
268
|
+
var n = typeof e;
|
|
269
|
+
return (n == "number" ? ve(r) && ge(e, r.length) : n == "string" && e in r) ? ee(r[e], t) : !1;
|
|
270
|
+
}
|
|
271
|
+
function pi(t) {
|
|
272
|
+
return qn(function(e, r) {
|
|
273
|
+
var n = -1, o = r.length, a = o > 1 ? r[o - 1] : void 0, s = o > 2 ? r[2] : void 0;
|
|
274
|
+
for (a = t.length > 3 && typeof a == "function" ? (o--, a) : void 0, s && fi(r[0], r[1], s) && (a = o < 3 ? void 0 : a, o = 1), e = Object(e); ++n < o; ) {
|
|
275
|
+
var i = r[n];
|
|
276
|
+
i && t(e, i, n, a);
|
|
277
|
+
}
|
|
278
|
+
return e;
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
var di = Object.prototype;
|
|
282
|
+
function fr(t) {
|
|
283
|
+
var e = t && t.constructor, r = typeof e == "function" && e.prototype || di;
|
|
284
|
+
return t === r;
|
|
285
|
+
}
|
|
286
|
+
function hi(t, e) {
|
|
287
|
+
for (var r = -1, n = Array(t); ++r < t; )
|
|
288
|
+
n[r] = e(r);
|
|
289
|
+
return n;
|
|
290
|
+
}
|
|
291
|
+
var mi = "[object Arguments]";
|
|
292
|
+
function Hr(t) {
|
|
293
|
+
return X(t) && ht(t) == mi;
|
|
294
|
+
}
|
|
295
|
+
var Qn = Object.prototype, gi = Qn.hasOwnProperty, vi = Qn.propertyIsEnumerable, qt = Hr(/* @__PURE__ */ function() {
|
|
296
|
+
return arguments;
|
|
297
|
+
}()) ? Hr : function(t) {
|
|
298
|
+
return X(t) && gi.call(t, "callee") && !vi.call(t, "callee");
|
|
299
|
+
};
|
|
300
|
+
function yi() {
|
|
301
|
+
return !1;
|
|
302
|
+
}
|
|
303
|
+
var Yn = typeof exports == "object" && exports && !exports.nodeType && exports, Jr = Yn && typeof module == "object" && module && !module.nodeType && module, bi = Jr && Jr.exports === Yn, Wr = bi ? K.Buffer : void 0, _i = Wr ? Wr.isBuffer : void 0, Qt = _i || yi, Si = "[object Arguments]", ji = "[object Array]", Oi = "[object Boolean]", wi = "[object Date]", Ci = "[object Error]", Ei = "[object Function]", Ni = "[object Map]", $i = "[object Number]", xi = "[object Object]", Ti = "[object RegExp]", Ai = "[object Set]", Mi = "[object String]", Pi = "[object WeakMap]", Ri = "[object ArrayBuffer]", Ii = "[object DataView]", Di = "[object Float32Array]", Li = "[object Float64Array]", Bi = "[object Int8Array]", Fi = "[object Int16Array]", ki = "[object Int32Array]", Ui = "[object Uint8Array]", Vi = "[object Uint8ClampedArray]", Gi = "[object Uint16Array]", zi = "[object Uint32Array]", x = {};
|
|
304
|
+
x[Di] = x[Li] = x[Bi] = x[Fi] = x[ki] = x[Ui] = x[Vi] = x[Gi] = x[zi] = !0;
|
|
305
|
+
x[Si] = x[ji] = x[Ri] = x[Oi] = x[Ii] = x[wi] = x[Ci] = x[Ei] = x[Ni] = x[$i] = x[xi] = x[Ti] = x[Ai] = x[Mi] = x[Pi] = !1;
|
|
306
|
+
function Hi(t) {
|
|
307
|
+
return X(t) && lr(t.length) && !!x[ht(t)];
|
|
308
|
+
}
|
|
309
|
+
function pr(t) {
|
|
310
|
+
return function(e) {
|
|
311
|
+
return t(e);
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
var Xn = typeof exports == "object" && exports && !exports.nodeType && exports, zt = Xn && typeof module == "object" && module && !module.nodeType && module, Ji = zt && zt.exports === Xn, Ae = Ji && Vn.process, St = function() {
|
|
315
|
+
try {
|
|
316
|
+
var t = zt && zt.require && zt.require("util").types;
|
|
317
|
+
return t || Ae && Ae.binding && Ae.binding("util");
|
|
318
|
+
} catch {
|
|
319
|
+
}
|
|
320
|
+
}(), qr = St && St.isTypedArray, dr = qr ? pr(qr) : Hi, Wi = Object.prototype, qi = Wi.hasOwnProperty;
|
|
321
|
+
function Kn(t, e) {
|
|
322
|
+
var r = R(t), n = !r && qt(t), o = !r && !n && Qt(t), a = !r && !n && !o && dr(t), s = r || n || o || a, i = s ? hi(t.length, String) : [], c = i.length;
|
|
323
|
+
for (var u in t)
|
|
324
|
+
(e || qi.call(t, u)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
325
|
+
(u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
326
|
+
o && (u == "offset" || u == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
327
|
+
a && (u == "buffer" || u == "byteLength" || u == "byteOffset") || // Skip index properties.
|
|
328
|
+
ge(u, c))) && i.push(u);
|
|
329
|
+
return i;
|
|
330
|
+
}
|
|
331
|
+
function Zn(t, e) {
|
|
332
|
+
return function(r) {
|
|
333
|
+
return t(e(r));
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
var Qi = Zn(Object.keys, Object), Yi = Object.prototype, Xi = Yi.hasOwnProperty;
|
|
337
|
+
function Ki(t) {
|
|
338
|
+
if (!fr(t))
|
|
339
|
+
return Qi(t);
|
|
340
|
+
var e = [];
|
|
341
|
+
for (var r in Object(t))
|
|
342
|
+
Xi.call(t, r) && r != "constructor" && e.push(r);
|
|
343
|
+
return e;
|
|
344
|
+
}
|
|
345
|
+
function ye(t) {
|
|
346
|
+
return ve(t) ? Kn(t) : Ki(t);
|
|
347
|
+
}
|
|
348
|
+
function Zi(t) {
|
|
349
|
+
var e = [];
|
|
350
|
+
if (t != null)
|
|
351
|
+
for (var r in Object(t))
|
|
352
|
+
e.push(r);
|
|
353
|
+
return e;
|
|
354
|
+
}
|
|
355
|
+
var ts = Object.prototype, es = ts.hasOwnProperty;
|
|
356
|
+
function rs(t) {
|
|
357
|
+
if (!Q(t))
|
|
358
|
+
return Zi(t);
|
|
359
|
+
var e = fr(t), r = [];
|
|
360
|
+
for (var n in t)
|
|
361
|
+
n == "constructor" && (e || !es.call(t, n)) || r.push(n);
|
|
362
|
+
return r;
|
|
363
|
+
}
|
|
364
|
+
function re(t) {
|
|
365
|
+
return ve(t) ? Kn(t, !0) : rs(t);
|
|
366
|
+
}
|
|
367
|
+
var ns = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, os = /^\w*$/;
|
|
368
|
+
function hr(t, e) {
|
|
369
|
+
if (R(t))
|
|
370
|
+
return !1;
|
|
371
|
+
var r = typeof t;
|
|
372
|
+
return r == "number" || r == "symbol" || r == "boolean" || t == null || or(t) ? !0 : os.test(t) || !ns.test(t) || e != null && t in Object(e);
|
|
373
|
+
}
|
|
374
|
+
var Yt = gt(Object, "create");
|
|
375
|
+
function as() {
|
|
376
|
+
this.__data__ = Yt ? Yt(null) : {}, this.size = 0;
|
|
377
|
+
}
|
|
378
|
+
function is(t) {
|
|
379
|
+
var e = this.has(t) && delete this.__data__[t];
|
|
380
|
+
return this.size -= e ? 1 : 0, e;
|
|
381
|
+
}
|
|
382
|
+
var ss = "__lodash_hash_undefined__", cs = Object.prototype, us = cs.hasOwnProperty;
|
|
383
|
+
function ls(t) {
|
|
384
|
+
var e = this.__data__;
|
|
385
|
+
if (Yt) {
|
|
386
|
+
var r = e[t];
|
|
387
|
+
return r === ss ? void 0 : r;
|
|
388
|
+
}
|
|
389
|
+
return us.call(e, t) ? e[t] : void 0;
|
|
390
|
+
}
|
|
391
|
+
var fs = Object.prototype, ps = fs.hasOwnProperty;
|
|
392
|
+
function ds(t) {
|
|
393
|
+
var e = this.__data__;
|
|
394
|
+
return Yt ? e[t] !== void 0 : ps.call(e, t);
|
|
395
|
+
}
|
|
396
|
+
var hs = "__lodash_hash_undefined__";
|
|
397
|
+
function ms(t, e) {
|
|
398
|
+
var r = this.__data__;
|
|
399
|
+
return this.size += this.has(t) ? 0 : 1, r[t] = Yt && e === void 0 ? hs : e, this;
|
|
400
|
+
}
|
|
401
|
+
function lt(t) {
|
|
402
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
403
|
+
for (this.clear(); ++e < r; ) {
|
|
404
|
+
var n = t[e];
|
|
405
|
+
this.set(n[0], n[1]);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
lt.prototype.clear = as;
|
|
409
|
+
lt.prototype.delete = is;
|
|
410
|
+
lt.prototype.get = ls;
|
|
411
|
+
lt.prototype.has = ds;
|
|
412
|
+
lt.prototype.set = ms;
|
|
413
|
+
function gs() {
|
|
414
|
+
this.__data__ = [], this.size = 0;
|
|
415
|
+
}
|
|
416
|
+
function be(t, e) {
|
|
417
|
+
for (var r = t.length; r--; )
|
|
418
|
+
if (ee(t[r][0], e))
|
|
419
|
+
return r;
|
|
420
|
+
return -1;
|
|
421
|
+
}
|
|
422
|
+
var vs = Array.prototype, ys = vs.splice;
|
|
423
|
+
function bs(t) {
|
|
424
|
+
var e = this.__data__, r = be(e, t);
|
|
425
|
+
if (r < 0)
|
|
426
|
+
return !1;
|
|
427
|
+
var n = e.length - 1;
|
|
428
|
+
return r == n ? e.pop() : ys.call(e, r, 1), --this.size, !0;
|
|
429
|
+
}
|
|
430
|
+
function _s(t) {
|
|
431
|
+
var e = this.__data__, r = be(e, t);
|
|
432
|
+
return r < 0 ? void 0 : e[r][1];
|
|
433
|
+
}
|
|
434
|
+
function Ss(t) {
|
|
435
|
+
return be(this.__data__, t) > -1;
|
|
436
|
+
}
|
|
437
|
+
function js(t, e) {
|
|
438
|
+
var r = this.__data__, n = be(r, t);
|
|
439
|
+
return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
|
|
440
|
+
}
|
|
441
|
+
function et(t) {
|
|
442
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
443
|
+
for (this.clear(); ++e < r; ) {
|
|
444
|
+
var n = t[e];
|
|
445
|
+
this.set(n[0], n[1]);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
et.prototype.clear = gs;
|
|
449
|
+
et.prototype.delete = bs;
|
|
450
|
+
et.prototype.get = _s;
|
|
451
|
+
et.prototype.has = Ss;
|
|
452
|
+
et.prototype.set = js;
|
|
453
|
+
var Xt = gt(K, "Map");
|
|
454
|
+
function Os() {
|
|
455
|
+
this.size = 0, this.__data__ = {
|
|
456
|
+
hash: new lt(),
|
|
457
|
+
map: new (Xt || et)(),
|
|
458
|
+
string: new lt()
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
function ws(t) {
|
|
462
|
+
var e = typeof t;
|
|
463
|
+
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
464
|
+
}
|
|
465
|
+
function _e(t, e) {
|
|
466
|
+
var r = t.__data__;
|
|
467
|
+
return ws(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
|
|
468
|
+
}
|
|
469
|
+
function Cs(t) {
|
|
470
|
+
var e = _e(this, t).delete(t);
|
|
471
|
+
return this.size -= e ? 1 : 0, e;
|
|
472
|
+
}
|
|
473
|
+
function Es(t) {
|
|
474
|
+
return _e(this, t).get(t);
|
|
475
|
+
}
|
|
476
|
+
function Ns(t) {
|
|
477
|
+
return _e(this, t).has(t);
|
|
478
|
+
}
|
|
479
|
+
function $s(t, e) {
|
|
480
|
+
var r = _e(this, t), n = r.size;
|
|
481
|
+
return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
|
|
482
|
+
}
|
|
483
|
+
function rt(t) {
|
|
484
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
485
|
+
for (this.clear(); ++e < r; ) {
|
|
486
|
+
var n = t[e];
|
|
487
|
+
this.set(n[0], n[1]);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
rt.prototype.clear = Os;
|
|
491
|
+
rt.prototype.delete = Cs;
|
|
492
|
+
rt.prototype.get = Es;
|
|
493
|
+
rt.prototype.has = Ns;
|
|
494
|
+
rt.prototype.set = $s;
|
|
495
|
+
var xs = "Expected a function";
|
|
496
|
+
function mr(t, e) {
|
|
497
|
+
if (typeof t != "function" || e != null && typeof e != "function")
|
|
498
|
+
throw new TypeError(xs);
|
|
499
|
+
var r = function() {
|
|
500
|
+
var n = arguments, o = e ? e.apply(this, n) : n[0], a = r.cache;
|
|
501
|
+
if (a.has(o))
|
|
502
|
+
return a.get(o);
|
|
503
|
+
var s = t.apply(this, n);
|
|
504
|
+
return r.cache = a.set(o, s) || a, s;
|
|
505
|
+
};
|
|
506
|
+
return r.cache = new (mr.Cache || rt)(), r;
|
|
507
|
+
}
|
|
508
|
+
mr.Cache = rt;
|
|
509
|
+
var Ts = 500;
|
|
510
|
+
function As(t) {
|
|
511
|
+
var e = mr(t, function(n) {
|
|
512
|
+
return r.size === Ts && r.clear(), n;
|
|
513
|
+
}), r = e.cache;
|
|
514
|
+
return e;
|
|
515
|
+
}
|
|
516
|
+
var Ms = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Ps = /\\(\\)?/g, Rs = As(function(t) {
|
|
517
|
+
var e = [];
|
|
518
|
+
return t.charCodeAt(0) === 46 && e.push(""), t.replace(Ms, function(r, n, o, a) {
|
|
519
|
+
e.push(o ? a.replace(Ps, "$1") : n || r);
|
|
520
|
+
}), e;
|
|
521
|
+
});
|
|
522
|
+
function Is(t) {
|
|
523
|
+
return t == null ? "" : zn(t);
|
|
524
|
+
}
|
|
525
|
+
function xt(t, e) {
|
|
526
|
+
return R(t) ? t : hr(t, e) ? [t] : Rs(Is(t));
|
|
527
|
+
}
|
|
528
|
+
var Ds = 1 / 0;
|
|
529
|
+
function Tt(t) {
|
|
530
|
+
if (typeof t == "string" || or(t))
|
|
531
|
+
return t;
|
|
532
|
+
var e = t + "";
|
|
533
|
+
return e == "0" && 1 / t == -Ds ? "-0" : e;
|
|
534
|
+
}
|
|
535
|
+
function Se(t, e) {
|
|
536
|
+
e = xt(e, t);
|
|
537
|
+
for (var r = 0, n = e.length; t != null && r < n; )
|
|
538
|
+
t = t[Tt(e[r++])];
|
|
539
|
+
return r && r == n ? t : void 0;
|
|
540
|
+
}
|
|
541
|
+
function to(t, e, r) {
|
|
542
|
+
var n = t == null ? void 0 : Se(t, e);
|
|
543
|
+
return n === void 0 ? r : n;
|
|
544
|
+
}
|
|
545
|
+
function gr(t, e) {
|
|
546
|
+
for (var r = -1, n = e.length, o = t.length; ++r < n; )
|
|
547
|
+
t[o + r] = e[r];
|
|
548
|
+
return t;
|
|
549
|
+
}
|
|
550
|
+
var Qr = G ? G.isConcatSpreadable : void 0;
|
|
551
|
+
function Ls(t) {
|
|
552
|
+
return R(t) || qt(t) || !!(Qr && t && t[Qr]);
|
|
553
|
+
}
|
|
554
|
+
function eo(t, e, r, n, o) {
|
|
555
|
+
var a = -1, s = t.length;
|
|
556
|
+
for (r || (r = Ls), o || (o = []); ++a < s; ) {
|
|
557
|
+
var i = t[a];
|
|
558
|
+
r(i) ? gr(o, i) : n || (o[o.length] = i);
|
|
559
|
+
}
|
|
560
|
+
return o;
|
|
561
|
+
}
|
|
562
|
+
function Bs(t) {
|
|
563
|
+
var e = t == null ? 0 : t.length;
|
|
564
|
+
return e ? eo(t) : [];
|
|
565
|
+
}
|
|
566
|
+
function Fs(t) {
|
|
567
|
+
return Jn(Wn(t, void 0, Bs), t + "");
|
|
568
|
+
}
|
|
569
|
+
var vr = Zn(Object.getPrototypeOf, Object), ks = "[object Object]", Us = Function.prototype, Vs = Object.prototype, ro = Us.toString, Gs = Vs.hasOwnProperty, zs = ro.call(Object);
|
|
570
|
+
function F(t) {
|
|
571
|
+
if (!X(t) || ht(t) != ks)
|
|
572
|
+
return !1;
|
|
573
|
+
var e = vr(t);
|
|
574
|
+
if (e === null)
|
|
575
|
+
return !0;
|
|
576
|
+
var r = Gs.call(e, "constructor") && e.constructor;
|
|
577
|
+
return typeof r == "function" && r instanceof r && ro.call(r) == zs;
|
|
578
|
+
}
|
|
579
|
+
function Hs(t, e, r) {
|
|
580
|
+
var n = -1, o = t.length;
|
|
581
|
+
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;
|
|
582
|
+
for (var a = Array(o); ++n < o; )
|
|
583
|
+
a[n] = t[n + e];
|
|
584
|
+
return a;
|
|
585
|
+
}
|
|
586
|
+
function Js() {
|
|
587
|
+
this.__data__ = new et(), this.size = 0;
|
|
588
|
+
}
|
|
589
|
+
function Ws(t) {
|
|
590
|
+
var e = this.__data__, r = e.delete(t);
|
|
591
|
+
return this.size = e.size, r;
|
|
592
|
+
}
|
|
593
|
+
function qs(t) {
|
|
594
|
+
return this.__data__.get(t);
|
|
595
|
+
}
|
|
596
|
+
function Qs(t) {
|
|
597
|
+
return this.__data__.has(t);
|
|
598
|
+
}
|
|
599
|
+
var Ys = 200;
|
|
600
|
+
function Xs(t, e) {
|
|
601
|
+
var r = this.__data__;
|
|
602
|
+
if (r instanceof et) {
|
|
603
|
+
var n = r.__data__;
|
|
604
|
+
if (!Xt || n.length < Ys - 1)
|
|
605
|
+
return n.push([t, e]), this.size = ++r.size, this;
|
|
606
|
+
r = this.__data__ = new rt(n);
|
|
607
|
+
}
|
|
608
|
+
return r.set(t, e), this.size = r.size, this;
|
|
609
|
+
}
|
|
610
|
+
function W(t) {
|
|
611
|
+
var e = this.__data__ = new et(t);
|
|
612
|
+
this.size = e.size;
|
|
613
|
+
}
|
|
614
|
+
W.prototype.clear = Js;
|
|
615
|
+
W.prototype.delete = Ws;
|
|
616
|
+
W.prototype.get = qs;
|
|
617
|
+
W.prototype.has = Qs;
|
|
618
|
+
W.prototype.set = Xs;
|
|
619
|
+
function Ks(t, e) {
|
|
620
|
+
return t && $t(e, ye(e), t);
|
|
621
|
+
}
|
|
622
|
+
function Zs(t, e) {
|
|
623
|
+
return t && $t(e, re(e), t);
|
|
624
|
+
}
|
|
625
|
+
var no = typeof exports == "object" && exports && !exports.nodeType && exports, Yr = no && typeof module == "object" && module && !module.nodeType && module, tc = Yr && Yr.exports === no, Xr = tc ? K.Buffer : void 0, Kr = Xr ? Xr.allocUnsafe : void 0;
|
|
626
|
+
function oo(t, e) {
|
|
627
|
+
if (e)
|
|
628
|
+
return t.slice();
|
|
629
|
+
var r = t.length, n = Kr ? Kr(r) : new t.constructor(r);
|
|
630
|
+
return t.copy(n), n;
|
|
631
|
+
}
|
|
632
|
+
function ec(t, e) {
|
|
633
|
+
for (var r = -1, n = t == null ? 0 : t.length, o = 0, a = []; ++r < n; ) {
|
|
634
|
+
var s = t[r];
|
|
635
|
+
e(s, r, t) && (a[o++] = s);
|
|
636
|
+
}
|
|
637
|
+
return a;
|
|
638
|
+
}
|
|
639
|
+
function ao() {
|
|
640
|
+
return [];
|
|
641
|
+
}
|
|
642
|
+
var rc = Object.prototype, nc = rc.propertyIsEnumerable, Zr = Object.getOwnPropertySymbols, yr = Zr ? function(t) {
|
|
643
|
+
return t == null ? [] : (t = Object(t), ec(Zr(t), function(e) {
|
|
644
|
+
return nc.call(t, e);
|
|
645
|
+
}));
|
|
646
|
+
} : ao;
|
|
647
|
+
function oc(t, e) {
|
|
648
|
+
return $t(t, yr(t), e);
|
|
649
|
+
}
|
|
650
|
+
var ac = Object.getOwnPropertySymbols, io = ac ? function(t) {
|
|
651
|
+
for (var e = []; t; )
|
|
652
|
+
gr(e, yr(t)), t = vr(t);
|
|
653
|
+
return e;
|
|
654
|
+
} : ao;
|
|
655
|
+
function ic(t, e) {
|
|
656
|
+
return $t(t, io(t), e);
|
|
657
|
+
}
|
|
658
|
+
function so(t, e, r) {
|
|
659
|
+
var n = e(t);
|
|
660
|
+
return R(t) ? n : gr(n, r(t));
|
|
661
|
+
}
|
|
662
|
+
function Ve(t) {
|
|
663
|
+
return so(t, ye, yr);
|
|
664
|
+
}
|
|
665
|
+
function br(t) {
|
|
666
|
+
return so(t, re, io);
|
|
667
|
+
}
|
|
668
|
+
var Ge = gt(K, "DataView"), ze = gt(K, "Promise"), _t = gt(K, "Set"), tn = "[object Map]", sc = "[object Object]", en = "[object Promise]", rn = "[object Set]", nn = "[object WeakMap]", on = "[object DataView]", cc = mt(Ge), uc = mt(Xt), lc = mt(ze), fc = mt(_t), pc = mt(Ue), J = ht;
|
|
669
|
+
(Ge && J(new Ge(new ArrayBuffer(1))) != on || Xt && J(new Xt()) != tn || ze && J(ze.resolve()) != en || _t && J(new _t()) != rn || Ue && J(new Ue()) != nn) && (J = function(t) {
|
|
670
|
+
var e = ht(t), r = e == sc ? t.constructor : void 0, n = r ? mt(r) : "";
|
|
671
|
+
if (n)
|
|
672
|
+
switch (n) {
|
|
673
|
+
case cc:
|
|
674
|
+
return on;
|
|
675
|
+
case uc:
|
|
676
|
+
return tn;
|
|
677
|
+
case lc:
|
|
678
|
+
return en;
|
|
679
|
+
case fc:
|
|
680
|
+
return rn;
|
|
681
|
+
case pc:
|
|
682
|
+
return nn;
|
|
683
|
+
}
|
|
684
|
+
return e;
|
|
685
|
+
});
|
|
686
|
+
var dc = Object.prototype, hc = dc.hasOwnProperty;
|
|
687
|
+
function mc(t) {
|
|
688
|
+
var e = t.length, r = new t.constructor(e);
|
|
689
|
+
return e && typeof t[0] == "string" && hc.call(t, "index") && (r.index = t.index, r.input = t.input), r;
|
|
690
|
+
}
|
|
691
|
+
var pe = K.Uint8Array;
|
|
692
|
+
function _r(t) {
|
|
693
|
+
var e = new t.constructor(t.byteLength);
|
|
694
|
+
return new pe(e).set(new pe(t)), e;
|
|
695
|
+
}
|
|
696
|
+
function gc(t, e) {
|
|
697
|
+
var r = e ? _r(t.buffer) : t.buffer;
|
|
698
|
+
return new t.constructor(r, t.byteOffset, t.byteLength);
|
|
699
|
+
}
|
|
700
|
+
var vc = /\w*$/;
|
|
701
|
+
function yc(t) {
|
|
702
|
+
var e = new t.constructor(t.source, vc.exec(t));
|
|
703
|
+
return e.lastIndex = t.lastIndex, e;
|
|
704
|
+
}
|
|
705
|
+
var an = G ? G.prototype : void 0, sn = an ? an.valueOf : void 0;
|
|
706
|
+
function bc(t) {
|
|
707
|
+
return sn ? Object(sn.call(t)) : {};
|
|
708
|
+
}
|
|
709
|
+
function co(t, e) {
|
|
710
|
+
var r = e ? _r(t.buffer) : t.buffer;
|
|
711
|
+
return new t.constructor(r, t.byteOffset, t.length);
|
|
712
|
+
}
|
|
713
|
+
var _c = "[object Boolean]", Sc = "[object Date]", jc = "[object Map]", Oc = "[object Number]", wc = "[object RegExp]", Cc = "[object Set]", Ec = "[object String]", Nc = "[object Symbol]", $c = "[object ArrayBuffer]", xc = "[object DataView]", Tc = "[object Float32Array]", Ac = "[object Float64Array]", Mc = "[object Int8Array]", Pc = "[object Int16Array]", Rc = "[object Int32Array]", Ic = "[object Uint8Array]", Dc = "[object Uint8ClampedArray]", Lc = "[object Uint16Array]", Bc = "[object Uint32Array]";
|
|
714
|
+
function Fc(t, e, r) {
|
|
715
|
+
var n = t.constructor;
|
|
716
|
+
switch (e) {
|
|
717
|
+
case $c:
|
|
718
|
+
return _r(t);
|
|
719
|
+
case _c:
|
|
720
|
+
case Sc:
|
|
721
|
+
return new n(+t);
|
|
722
|
+
case xc:
|
|
723
|
+
return gc(t, r);
|
|
724
|
+
case Tc:
|
|
725
|
+
case Ac:
|
|
726
|
+
case Mc:
|
|
727
|
+
case Pc:
|
|
728
|
+
case Rc:
|
|
729
|
+
case Ic:
|
|
730
|
+
case Dc:
|
|
731
|
+
case Lc:
|
|
732
|
+
case Bc:
|
|
733
|
+
return co(t, r);
|
|
734
|
+
case jc:
|
|
735
|
+
return new n();
|
|
736
|
+
case Oc:
|
|
737
|
+
case Ec:
|
|
738
|
+
return new n(t);
|
|
739
|
+
case wc:
|
|
740
|
+
return yc(t);
|
|
741
|
+
case Cc:
|
|
742
|
+
return new n();
|
|
743
|
+
case Nc:
|
|
744
|
+
return bc(t);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
function uo(t) {
|
|
748
|
+
return typeof t.constructor == "function" && !fr(t) ? Ha(vr(t)) : {};
|
|
749
|
+
}
|
|
750
|
+
var kc = "[object Map]";
|
|
751
|
+
function Uc(t) {
|
|
752
|
+
return X(t) && J(t) == kc;
|
|
753
|
+
}
|
|
754
|
+
var cn = St && St.isMap, Vc = cn ? pr(cn) : Uc, Gc = "[object Set]";
|
|
755
|
+
function zc(t) {
|
|
756
|
+
return X(t) && J(t) == Gc;
|
|
757
|
+
}
|
|
758
|
+
var un = St && St.isSet, Hc = un ? pr(un) : zc, Jc = 1, Wc = 2, qc = 4, lo = "[object Arguments]", Qc = "[object Array]", Yc = "[object Boolean]", Xc = "[object Date]", Kc = "[object Error]", fo = "[object Function]", Zc = "[object GeneratorFunction]", tu = "[object Map]", eu = "[object Number]", po = "[object Object]", ru = "[object RegExp]", nu = "[object Set]", ou = "[object String]", au = "[object Symbol]", iu = "[object WeakMap]", su = "[object ArrayBuffer]", cu = "[object DataView]", uu = "[object Float32Array]", lu = "[object Float64Array]", fu = "[object Int8Array]", pu = "[object Int16Array]", du = "[object Int32Array]", hu = "[object Uint8Array]", mu = "[object Uint8ClampedArray]", gu = "[object Uint16Array]", vu = "[object Uint32Array]", N = {};
|
|
759
|
+
N[lo] = N[Qc] = N[su] = N[cu] = N[Yc] = N[Xc] = N[uu] = N[lu] = N[fu] = N[pu] = N[du] = N[tu] = N[eu] = N[po] = N[ru] = N[nu] = N[ou] = N[au] = N[hu] = N[mu] = N[gu] = N[vu] = !0;
|
|
760
|
+
N[Kc] = N[fo] = N[iu] = !1;
|
|
761
|
+
function Ht(t, e, r, n, o, a) {
|
|
762
|
+
var s, i = e & Jc, c = e & Wc, u = e & qc;
|
|
763
|
+
if (r && (s = o ? r(t, n, o, a) : r(t)), s !== void 0)
|
|
764
|
+
return s;
|
|
765
|
+
if (!Q(t))
|
|
766
|
+
return t;
|
|
767
|
+
var l = R(t);
|
|
768
|
+
if (l) {
|
|
769
|
+
if (s = mc(t), !i)
|
|
770
|
+
return Hn(t, s);
|
|
771
|
+
} else {
|
|
772
|
+
var p = J(t), f = p == fo || p == Zc;
|
|
773
|
+
if (Qt(t))
|
|
774
|
+
return oo(t, i);
|
|
775
|
+
if (p == po || p == lo || f && !o) {
|
|
776
|
+
if (s = c || f ? {} : uo(t), !i)
|
|
777
|
+
return c ? ic(t, Zs(s, t)) : oc(t, Ks(s, t));
|
|
778
|
+
} else {
|
|
779
|
+
if (!N[p])
|
|
780
|
+
return o ? t : {};
|
|
781
|
+
s = Fc(t, p, i);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
a || (a = new W());
|
|
785
|
+
var d = a.get(t);
|
|
786
|
+
if (d)
|
|
787
|
+
return d;
|
|
788
|
+
a.set(t, s), Hc(t) ? t.forEach(function(b) {
|
|
789
|
+
s.add(Ht(b, e, r, b, t, a));
|
|
790
|
+
}) : Vc(t) && t.forEach(function(b, S) {
|
|
791
|
+
s.set(S, Ht(b, e, r, S, t, a));
|
|
792
|
+
});
|
|
793
|
+
var h = u ? c ? br : Ve : c ? re : ye, v = l ? void 0 : h(t);
|
|
794
|
+
return ti(v || t, function(b, S) {
|
|
795
|
+
v && (S = b, b = t[S]), ur(s, S, Ht(b, e, r, S, t, a));
|
|
796
|
+
}), s;
|
|
797
|
+
}
|
|
798
|
+
var yu = 1, bu = 4;
|
|
799
|
+
function ho(t) {
|
|
800
|
+
return Ht(t, yu | bu);
|
|
801
|
+
}
|
|
802
|
+
var _u = "__lodash_hash_undefined__";
|
|
803
|
+
function Su(t) {
|
|
804
|
+
return this.__data__.set(t, _u), this;
|
|
805
|
+
}
|
|
806
|
+
function ju(t) {
|
|
807
|
+
return this.__data__.has(t);
|
|
808
|
+
}
|
|
809
|
+
function Kt(t) {
|
|
810
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
811
|
+
for (this.__data__ = new rt(); ++e < r; )
|
|
812
|
+
this.add(t[e]);
|
|
813
|
+
}
|
|
814
|
+
Kt.prototype.add = Kt.prototype.push = Su;
|
|
815
|
+
Kt.prototype.has = ju;
|
|
816
|
+
function Ou(t, e) {
|
|
817
|
+
for (var r = -1, n = t == null ? 0 : t.length; ++r < n; )
|
|
818
|
+
if (e(t[r], r, t))
|
|
819
|
+
return !0;
|
|
820
|
+
return !1;
|
|
821
|
+
}
|
|
822
|
+
function mo(t, e) {
|
|
823
|
+
return t.has(e);
|
|
824
|
+
}
|
|
825
|
+
var wu = 1, Cu = 2;
|
|
826
|
+
function go(t, e, r, n, o, a) {
|
|
827
|
+
var s = r & wu, i = t.length, c = e.length;
|
|
828
|
+
if (i != c && !(s && c > i))
|
|
829
|
+
return !1;
|
|
830
|
+
var u = a.get(t), l = a.get(e);
|
|
831
|
+
if (u && l)
|
|
832
|
+
return u == e && l == t;
|
|
833
|
+
var p = -1, f = !0, d = r & Cu ? new Kt() : void 0;
|
|
834
|
+
for (a.set(t, e), a.set(e, t); ++p < i; ) {
|
|
835
|
+
var h = t[p], v = e[p];
|
|
836
|
+
if (n)
|
|
837
|
+
var b = s ? n(v, h, p, e, t, a) : n(h, v, p, t, e, a);
|
|
838
|
+
if (b !== void 0) {
|
|
839
|
+
if (b)
|
|
840
|
+
continue;
|
|
841
|
+
f = !1;
|
|
842
|
+
break;
|
|
843
|
+
}
|
|
844
|
+
if (d) {
|
|
845
|
+
if (!Ou(e, function(S, j) {
|
|
846
|
+
if (!mo(d, j) && (h === S || o(h, S, r, n, a)))
|
|
847
|
+
return d.push(j);
|
|
848
|
+
})) {
|
|
849
|
+
f = !1;
|
|
850
|
+
break;
|
|
851
|
+
}
|
|
852
|
+
} else if (!(h === v || o(h, v, r, n, a))) {
|
|
853
|
+
f = !1;
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
return a.delete(t), a.delete(e), f;
|
|
858
|
+
}
|
|
859
|
+
function Eu(t) {
|
|
860
|
+
var e = -1, r = Array(t.size);
|
|
861
|
+
return t.forEach(function(n, o) {
|
|
862
|
+
r[++e] = [o, n];
|
|
863
|
+
}), r;
|
|
864
|
+
}
|
|
865
|
+
function Sr(t) {
|
|
866
|
+
var e = -1, r = Array(t.size);
|
|
867
|
+
return t.forEach(function(n) {
|
|
868
|
+
r[++e] = n;
|
|
869
|
+
}), r;
|
|
870
|
+
}
|
|
871
|
+
var Nu = 1, $u = 2, xu = "[object Boolean]", Tu = "[object Date]", Au = "[object Error]", Mu = "[object Map]", Pu = "[object Number]", Ru = "[object RegExp]", Iu = "[object Set]", Du = "[object String]", Lu = "[object Symbol]", Bu = "[object ArrayBuffer]", Fu = "[object DataView]", ln = G ? G.prototype : void 0, Me = ln ? ln.valueOf : void 0;
|
|
872
|
+
function ku(t, e, r, n, o, a, s) {
|
|
873
|
+
switch (r) {
|
|
874
|
+
case Fu:
|
|
875
|
+
if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset)
|
|
876
|
+
return !1;
|
|
877
|
+
t = t.buffer, e = e.buffer;
|
|
878
|
+
case Bu:
|
|
879
|
+
return !(t.byteLength != e.byteLength || !a(new pe(t), new pe(e)));
|
|
880
|
+
case xu:
|
|
881
|
+
case Tu:
|
|
882
|
+
case Pu:
|
|
883
|
+
return ee(+t, +e);
|
|
884
|
+
case Au:
|
|
885
|
+
return t.name == e.name && t.message == e.message;
|
|
886
|
+
case Ru:
|
|
887
|
+
case Du:
|
|
888
|
+
return t == e + "";
|
|
889
|
+
case Mu:
|
|
890
|
+
var i = Eu;
|
|
891
|
+
case Iu:
|
|
892
|
+
var c = n & Nu;
|
|
893
|
+
if (i || (i = Sr), t.size != e.size && !c)
|
|
894
|
+
return !1;
|
|
895
|
+
var u = s.get(t);
|
|
896
|
+
if (u)
|
|
897
|
+
return u == e;
|
|
898
|
+
n |= $u, s.set(t, e);
|
|
899
|
+
var l = go(i(t), i(e), n, o, a, s);
|
|
900
|
+
return s.delete(t), l;
|
|
901
|
+
case Lu:
|
|
902
|
+
if (Me)
|
|
903
|
+
return Me.call(t) == Me.call(e);
|
|
904
|
+
}
|
|
905
|
+
return !1;
|
|
906
|
+
}
|
|
907
|
+
var Uu = 1, Vu = Object.prototype, Gu = Vu.hasOwnProperty;
|
|
908
|
+
function zu(t, e, r, n, o, a) {
|
|
909
|
+
var s = r & Uu, i = Ve(t), c = i.length, u = Ve(e), l = u.length;
|
|
910
|
+
if (c != l && !s)
|
|
911
|
+
return !1;
|
|
912
|
+
for (var p = c; p--; ) {
|
|
913
|
+
var f = i[p];
|
|
914
|
+
if (!(s ? f in e : Gu.call(e, f)))
|
|
915
|
+
return !1;
|
|
916
|
+
}
|
|
917
|
+
var d = a.get(t), h = a.get(e);
|
|
918
|
+
if (d && h)
|
|
919
|
+
return d == e && h == t;
|
|
920
|
+
var v = !0;
|
|
921
|
+
a.set(t, e), a.set(e, t);
|
|
922
|
+
for (var b = s; ++p < c; ) {
|
|
923
|
+
f = i[p];
|
|
924
|
+
var S = t[f], j = e[f];
|
|
925
|
+
if (n)
|
|
926
|
+
var $ = s ? n(j, S, f, e, t, a) : n(S, j, f, t, e, a);
|
|
927
|
+
if (!($ === void 0 ? S === j || o(S, j, r, n, a) : $)) {
|
|
928
|
+
v = !1;
|
|
929
|
+
break;
|
|
930
|
+
}
|
|
931
|
+
b || (b = f == "constructor");
|
|
932
|
+
}
|
|
933
|
+
if (v && !b) {
|
|
934
|
+
var E = t.constructor, D = e.constructor;
|
|
935
|
+
E != D && "constructor" in t && "constructor" in e && !(typeof E == "function" && E instanceof E && typeof D == "function" && D instanceof D) && (v = !1);
|
|
936
|
+
}
|
|
937
|
+
return a.delete(t), a.delete(e), v;
|
|
938
|
+
}
|
|
939
|
+
var Hu = 1, fn = "[object Arguments]", pn = "[object Array]", ce = "[object Object]", Ju = Object.prototype, dn = Ju.hasOwnProperty;
|
|
940
|
+
function Wu(t, e, r, n, o, a) {
|
|
941
|
+
var s = R(t), i = R(e), c = s ? pn : J(t), u = i ? pn : J(e);
|
|
942
|
+
c = c == fn ? ce : c, u = u == fn ? ce : u;
|
|
943
|
+
var l = c == ce, p = u == ce, f = c == u;
|
|
944
|
+
if (f && Qt(t)) {
|
|
945
|
+
if (!Qt(e))
|
|
946
|
+
return !1;
|
|
947
|
+
s = !0, l = !1;
|
|
948
|
+
}
|
|
949
|
+
if (f && !l)
|
|
950
|
+
return a || (a = new W()), s || dr(t) ? go(t, e, r, n, o, a) : ku(t, e, c, r, n, o, a);
|
|
951
|
+
if (!(r & Hu)) {
|
|
952
|
+
var d = l && dn.call(t, "__wrapped__"), h = p && dn.call(e, "__wrapped__");
|
|
953
|
+
if (d || h) {
|
|
954
|
+
var v = d ? t.value() : t, b = h ? e.value() : e;
|
|
955
|
+
return a || (a = new W()), o(v, b, r, n, a);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
return f ? (a || (a = new W()), zu(t, e, r, n, o, a)) : !1;
|
|
959
|
+
}
|
|
960
|
+
function jr(t, e, r, n, o) {
|
|
961
|
+
return t === e ? !0 : t == null || e == null || !X(t) && !X(e) ? t !== t && e !== e : Wu(t, e, r, n, jr, o);
|
|
962
|
+
}
|
|
963
|
+
var qu = 1, Qu = 2;
|
|
964
|
+
function Yu(t, e, r, n) {
|
|
965
|
+
var o = r.length, a = o;
|
|
966
|
+
if (t == null)
|
|
967
|
+
return !a;
|
|
968
|
+
for (t = Object(t); o--; ) {
|
|
969
|
+
var s = r[o];
|
|
970
|
+
if (s[2] ? s[1] !== t[s[0]] : !(s[0] in t))
|
|
971
|
+
return !1;
|
|
972
|
+
}
|
|
973
|
+
for (; ++o < a; ) {
|
|
974
|
+
s = r[o];
|
|
975
|
+
var i = s[0], c = t[i], u = s[1];
|
|
976
|
+
if (s[2]) {
|
|
977
|
+
if (c === void 0 && !(i in t))
|
|
978
|
+
return !1;
|
|
979
|
+
} else {
|
|
980
|
+
var l = new W(), p;
|
|
981
|
+
if (!(p === void 0 ? jr(u, c, qu | Qu, n, l) : p))
|
|
982
|
+
return !1;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
return !0;
|
|
986
|
+
}
|
|
987
|
+
function vo(t) {
|
|
988
|
+
return t === t && !Q(t);
|
|
989
|
+
}
|
|
990
|
+
function Xu(t) {
|
|
991
|
+
for (var e = ye(t), r = e.length; r--; ) {
|
|
992
|
+
var n = e[r], o = t[n];
|
|
993
|
+
e[r] = [n, o, vo(o)];
|
|
994
|
+
}
|
|
995
|
+
return e;
|
|
996
|
+
}
|
|
997
|
+
function yo(t, e) {
|
|
998
|
+
return function(r) {
|
|
999
|
+
return r == null ? !1 : r[t] === e && (e !== void 0 || t in Object(r));
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
function Ku(t) {
|
|
1003
|
+
var e = Xu(t);
|
|
1004
|
+
return e.length == 1 && e[0][2] ? yo(e[0][0], e[0][1]) : function(r) {
|
|
1005
|
+
return r === t || Yu(r, t, e);
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
function Zu(t, e) {
|
|
1009
|
+
return t != null && e in Object(t);
|
|
1010
|
+
}
|
|
1011
|
+
function tl(t, e, r) {
|
|
1012
|
+
e = xt(e, t);
|
|
1013
|
+
for (var n = -1, o = e.length, a = !1; ++n < o; ) {
|
|
1014
|
+
var s = Tt(e[n]);
|
|
1015
|
+
if (!(a = t != null && r(t, s)))
|
|
1016
|
+
break;
|
|
1017
|
+
t = t[s];
|
|
1018
|
+
}
|
|
1019
|
+
return a || ++n != o ? a : (o = t == null ? 0 : t.length, !!o && lr(o) && ge(s, o) && (R(t) || qt(t)));
|
|
1020
|
+
}
|
|
1021
|
+
function el(t, e) {
|
|
1022
|
+
return t != null && tl(t, e, Zu);
|
|
1023
|
+
}
|
|
1024
|
+
var rl = 1, nl = 2;
|
|
1025
|
+
function ol(t, e) {
|
|
1026
|
+
return hr(t) && vo(e) ? yo(Tt(t), e) : function(r) {
|
|
1027
|
+
var n = to(r, t);
|
|
1028
|
+
return n === void 0 && n === e ? el(r, t) : jr(e, n, rl | nl);
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
function al(t) {
|
|
1032
|
+
return function(e) {
|
|
1033
|
+
return e == null ? void 0 : e[t];
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
function il(t) {
|
|
1037
|
+
return function(e) {
|
|
1038
|
+
return Se(e, t);
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
function sl(t) {
|
|
1042
|
+
return hr(t) ? al(Tt(t)) : il(t);
|
|
1043
|
+
}
|
|
1044
|
+
function Or(t) {
|
|
1045
|
+
return typeof t == "function" ? t : t == null ? ir : typeof t == "object" ? R(t) ? ol(t[0], t[1]) : Ku(t) : sl(t);
|
|
1046
|
+
}
|
|
1047
|
+
function cl(t) {
|
|
1048
|
+
return function(e, r, n) {
|
|
1049
|
+
for (var o = -1, a = Object(e), s = n(e), i = s.length; i--; ) {
|
|
1050
|
+
var c = s[++o];
|
|
1051
|
+
if (r(a[c], c, a) === !1)
|
|
1052
|
+
break;
|
|
1053
|
+
}
|
|
1054
|
+
return e;
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
var ul = cl();
|
|
1058
|
+
function He(t, e, r) {
|
|
1059
|
+
(r !== void 0 && !ee(t[e], r) || r === void 0 && !(e in t)) && cr(t, e, r);
|
|
1060
|
+
}
|
|
1061
|
+
function Je(t) {
|
|
1062
|
+
return X(t) && ve(t);
|
|
1063
|
+
}
|
|
1064
|
+
function We(t, e) {
|
|
1065
|
+
if (!(e === "constructor" && typeof t[e] == "function") && e != "__proto__")
|
|
1066
|
+
return t[e];
|
|
1067
|
+
}
|
|
1068
|
+
function ll(t) {
|
|
1069
|
+
return $t(t, re(t));
|
|
1070
|
+
}
|
|
1071
|
+
function fl(t, e, r, n, o, a, s) {
|
|
1072
|
+
var i = We(t, r), c = We(e, r), u = s.get(c);
|
|
1073
|
+
if (u) {
|
|
1074
|
+
He(t, r, u);
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
var l = a ? a(i, c, r + "", t, e, s) : void 0, p = l === void 0;
|
|
1078
|
+
if (p) {
|
|
1079
|
+
var f = R(c), d = !f && Qt(c), h = !f && !d && dr(c);
|
|
1080
|
+
l = c, f || d || h ? R(i) ? l = i : Je(i) ? l = Hn(i) : d ? (p = !1, l = oo(c, !0)) : h ? (p = !1, l = co(c, !0)) : l = [] : F(c) || qt(c) ? (l = i, qt(i) ? l = ll(i) : (!Q(i) || sr(i)) && (l = uo(c))) : p = !1;
|
|
1081
|
+
}
|
|
1082
|
+
p && (s.set(c, l), o(l, c, n, a, s), s.delete(c)), He(t, r, l);
|
|
1083
|
+
}
|
|
1084
|
+
function bo(t, e, r, n, o) {
|
|
1085
|
+
t !== e && ul(e, function(a, s) {
|
|
1086
|
+
if (o || (o = new W()), Q(a))
|
|
1087
|
+
fl(t, e, s, r, bo, n, o);
|
|
1088
|
+
else {
|
|
1089
|
+
var i = n ? n(We(t, s), a, s + "", t, e, o) : void 0;
|
|
1090
|
+
i === void 0 && (i = a), He(t, s, i);
|
|
1091
|
+
}
|
|
1092
|
+
}, re);
|
|
1093
|
+
}
|
|
1094
|
+
function _o(t) {
|
|
1095
|
+
var e = t == null ? 0 : t.length;
|
|
1096
|
+
return e ? t[e - 1] : void 0;
|
|
1097
|
+
}
|
|
1098
|
+
function pl(t, e) {
|
|
1099
|
+
return e.length < 2 ? t : Se(t, Hs(e, 0, -1));
|
|
1100
|
+
}
|
|
1101
|
+
var So = pi(function(t, e, r) {
|
|
1102
|
+
bo(t, e, r);
|
|
1103
|
+
}), dl = "Expected a function";
|
|
1104
|
+
function hl(t) {
|
|
1105
|
+
if (typeof t != "function")
|
|
1106
|
+
throw new TypeError(dl);
|
|
1107
|
+
return function() {
|
|
1108
|
+
var e = arguments;
|
|
1109
|
+
switch (e.length) {
|
|
1110
|
+
case 0:
|
|
1111
|
+
return !t.call(this);
|
|
1112
|
+
case 1:
|
|
1113
|
+
return !t.call(this, e[0]);
|
|
1114
|
+
case 2:
|
|
1115
|
+
return !t.call(this, e[0], e[1]);
|
|
1116
|
+
case 3:
|
|
1117
|
+
return !t.call(this, e[0], e[1], e[2]);
|
|
1118
|
+
}
|
|
1119
|
+
return !t.apply(this, e);
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function ml(t, e) {
|
|
1123
|
+
return e = xt(e, t), t = pl(t, e), t == null || delete t[Tt(_o(e))];
|
|
1124
|
+
}
|
|
1125
|
+
function gl(t) {
|
|
1126
|
+
return F(t) ? void 0 : t;
|
|
1127
|
+
}
|
|
1128
|
+
var vl = 1, yl = 2, bl = 4, jo = Fs(function(t, e) {
|
|
1129
|
+
var r = {};
|
|
1130
|
+
if (t == null)
|
|
1131
|
+
return r;
|
|
1132
|
+
var n = !1;
|
|
1133
|
+
e = ar(e, function(a) {
|
|
1134
|
+
return a = xt(a, t), n || (n = a.length > 1), a;
|
|
1135
|
+
}), $t(t, br(t), r), n && (r = Ht(r, vl | yl | bl, gl));
|
|
1136
|
+
for (var o = e.length; o--; )
|
|
1137
|
+
ml(r, e[o]);
|
|
1138
|
+
return r;
|
|
1139
|
+
});
|
|
1140
|
+
function _l(t, e, r, n) {
|
|
1141
|
+
if (!Q(t))
|
|
1142
|
+
return t;
|
|
1143
|
+
e = xt(e, t);
|
|
1144
|
+
for (var o = -1, a = e.length, s = a - 1, i = t; i != null && ++o < a; ) {
|
|
1145
|
+
var c = Tt(e[o]), u = r;
|
|
1146
|
+
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
1147
|
+
return t;
|
|
1148
|
+
if (o != s) {
|
|
1149
|
+
var l = i[c];
|
|
1150
|
+
u = void 0, u === void 0 && (u = Q(l) ? l : ge(e[o + 1]) ? [] : {});
|
|
1151
|
+
}
|
|
1152
|
+
ur(i, c, u), i = i[c];
|
|
1153
|
+
}
|
|
1154
|
+
return t;
|
|
1155
|
+
}
|
|
1156
|
+
function Sl(t, e, r) {
|
|
1157
|
+
for (var n = -1, o = e.length, a = {}; ++n < o; ) {
|
|
1158
|
+
var s = e[n], i = Se(t, s);
|
|
1159
|
+
r(i, s) && _l(a, xt(s, t), i);
|
|
1160
|
+
}
|
|
1161
|
+
return a;
|
|
1162
|
+
}
|
|
1163
|
+
function jl(t, e) {
|
|
1164
|
+
if (t == null)
|
|
1165
|
+
return {};
|
|
1166
|
+
var r = ar(br(t), function(n) {
|
|
1167
|
+
return [n];
|
|
1168
|
+
});
|
|
1169
|
+
return e = Or(e), Sl(t, r, function(n, o) {
|
|
1170
|
+
return e(n, o[0]);
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
function Ol(t, e) {
|
|
1174
|
+
return jl(t, hl(Or(e)));
|
|
1175
|
+
}
|
|
1176
|
+
var wl = 1 / 0, Cl = _t && 1 / Sr(new _t([, -0]))[1] == wl ? function(t) {
|
|
1177
|
+
return new _t(t);
|
|
1178
|
+
} : Wa, El = 200;
|
|
1179
|
+
function Nl(t, e, r) {
|
|
1180
|
+
var n = -1, o = ai, a = t.length, s = !0, i = [], c = i;
|
|
1181
|
+
if (a >= El) {
|
|
1182
|
+
var u = e ? null : Cl(t);
|
|
1183
|
+
if (u)
|
|
1184
|
+
return Sr(u);
|
|
1185
|
+
s = !1, o = mo, c = new Kt();
|
|
1186
|
+
} else
|
|
1187
|
+
c = e ? [] : i;
|
|
1188
|
+
t:
|
|
1189
|
+
for (; ++n < a; ) {
|
|
1190
|
+
var l = t[n], p = e ? e(l) : l;
|
|
1191
|
+
if (l = l !== 0 ? l : 0, s && p === p) {
|
|
1192
|
+
for (var f = c.length; f--; )
|
|
1193
|
+
if (c[f] === p)
|
|
1194
|
+
continue t;
|
|
1195
|
+
e && c.push(p), i.push(l);
|
|
1196
|
+
} else o(c, p, r) || (c !== i && c.push(p), i.push(l));
|
|
1197
|
+
}
|
|
1198
|
+
return i;
|
|
1199
|
+
}
|
|
1200
|
+
var $l = qn(function(t) {
|
|
1201
|
+
var e = _o(t);
|
|
1202
|
+
return Je(e) && (e = void 0), Nl(eo(t, 1, Je, !0), Or(e));
|
|
1203
|
+
});
|
|
1204
|
+
class Oo extends TypeError {
|
|
1205
|
+
constructor(e, r) {
|
|
1206
|
+
let n;
|
|
1207
|
+
const {
|
|
1208
|
+
message: o,
|
|
1209
|
+
...a
|
|
1210
|
+
} = e, {
|
|
1211
|
+
path: s
|
|
1212
|
+
} = e, i = s.length === 0 ? o : `At path: ${s.join(".")} -- ${o}`;
|
|
1213
|
+
super(i), this.value = void 0, this.key = void 0, this.type = void 0, this.refinement = void 0, this.path = void 0, this.branch = void 0, this.failures = void 0, Object.assign(this, a), this.name = this.constructor.name, this.failures = () => n ?? (n = [e, ...r()]);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
function xl(t) {
|
|
1217
|
+
return q(t) && typeof t[Symbol.iterator] == "function";
|
|
1218
|
+
}
|
|
1219
|
+
function q(t) {
|
|
1220
|
+
return typeof t == "object" && t != null;
|
|
1221
|
+
}
|
|
1222
|
+
function k(t) {
|
|
1223
|
+
return typeof t == "symbol" ? t.toString() : typeof t == "string" ? JSON.stringify(t) : `${t}`;
|
|
1224
|
+
}
|
|
1225
|
+
function Tl(t) {
|
|
1226
|
+
const {
|
|
1227
|
+
done: e,
|
|
1228
|
+
value: r
|
|
1229
|
+
} = t.next();
|
|
1230
|
+
return e ? void 0 : r;
|
|
1231
|
+
}
|
|
1232
|
+
function Al(t, e, r, n) {
|
|
1233
|
+
if (t === !0)
|
|
1234
|
+
return;
|
|
1235
|
+
t === !1 ? t = {} : typeof t == "string" && (t = {
|
|
1236
|
+
message: t
|
|
1237
|
+
});
|
|
1238
|
+
const {
|
|
1239
|
+
path: o,
|
|
1240
|
+
branch: a
|
|
1241
|
+
} = e, {
|
|
1242
|
+
type: s
|
|
1243
|
+
} = r, {
|
|
1244
|
+
refinement: i,
|
|
1245
|
+
message: c = `Expected a value of type \`${s}\`${i ? ` with refinement \`${i}\`` : ""}, but received: \`${k(n)}\``
|
|
1246
|
+
} = t;
|
|
1247
|
+
return {
|
|
1248
|
+
value: n,
|
|
1249
|
+
type: s,
|
|
1250
|
+
refinement: i,
|
|
1251
|
+
key: o[o.length - 1],
|
|
1252
|
+
path: o,
|
|
1253
|
+
branch: a,
|
|
1254
|
+
...t,
|
|
1255
|
+
message: c
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
function* hn(t, e, r, n) {
|
|
1259
|
+
xl(t) || (t = [t]);
|
|
1260
|
+
for (const o of t) {
|
|
1261
|
+
const a = Al(o, e, r, n);
|
|
1262
|
+
a && (yield a);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
function* wr(t, e, r) {
|
|
1266
|
+
r === void 0 && (r = {});
|
|
1267
|
+
const {
|
|
1268
|
+
path: n = [],
|
|
1269
|
+
branch: o = [t],
|
|
1270
|
+
coerce: a = !1,
|
|
1271
|
+
mask: s = !1
|
|
1272
|
+
} = r, i = {
|
|
1273
|
+
path: n,
|
|
1274
|
+
branch: o
|
|
1275
|
+
};
|
|
1276
|
+
if (a && (t = e.coercer(t, i), s && e.type !== "type" && q(e.schema) && q(t) && !Array.isArray(t)))
|
|
1277
|
+
for (const u in t)
|
|
1278
|
+
e.schema[u] === void 0 && delete t[u];
|
|
1279
|
+
let c = "valid";
|
|
1280
|
+
for (const u of e.validator(t, i))
|
|
1281
|
+
c = "not_valid", yield [u, void 0];
|
|
1282
|
+
for (let [u, l, p] of e.entries(t, i)) {
|
|
1283
|
+
const f = wr(l, p, {
|
|
1284
|
+
path: u === void 0 ? n : [...n, u],
|
|
1285
|
+
branch: u === void 0 ? o : [...o, l],
|
|
1286
|
+
coerce: a,
|
|
1287
|
+
mask: s
|
|
1288
|
+
});
|
|
1289
|
+
for (const d of f)
|
|
1290
|
+
d[0] ? (c = d[0].refinement != null ? "not_refined" : "not_valid", yield [d[0], void 0]) : a && (l = d[1], u === void 0 ? t = l : t instanceof Map ? t.set(u, l) : t instanceof Set ? t.add(l) : q(t) && (l !== void 0 || u in t) && (t[u] = l));
|
|
1291
|
+
}
|
|
1292
|
+
if (c !== "not_valid")
|
|
1293
|
+
for (const u of e.refiner(t, i))
|
|
1294
|
+
c = "not_refined", yield [u, void 0];
|
|
1295
|
+
c === "valid" && (yield [void 0, t]);
|
|
1296
|
+
}
|
|
1297
|
+
class Z {
|
|
1298
|
+
constructor(e) {
|
|
1299
|
+
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;
|
|
1300
|
+
const {
|
|
1301
|
+
type: r,
|
|
1302
|
+
schema: n,
|
|
1303
|
+
validator: o,
|
|
1304
|
+
refiner: a,
|
|
1305
|
+
coercer: s = (c) => c,
|
|
1306
|
+
entries: i = function* () {
|
|
1307
|
+
}
|
|
1308
|
+
} = e;
|
|
1309
|
+
this.type = r, this.schema = n, this.entries = i, this.coercer = s, o ? this.validator = (c, u) => {
|
|
1310
|
+
const l = o(c, u);
|
|
1311
|
+
return hn(l, u, this, c);
|
|
1312
|
+
} : this.validator = () => [], a ? this.refiner = (c, u) => {
|
|
1313
|
+
const l = a(c, u);
|
|
1314
|
+
return hn(l, u, this, c);
|
|
1315
|
+
} : this.refiner = () => [];
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Assert that a value passes the struct's validation, throwing if it doesn't.
|
|
1319
|
+
*/
|
|
1320
|
+
assert(e) {
|
|
1321
|
+
return wo(e, this);
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Create a value with the struct's coercion logic, then validate it.
|
|
1325
|
+
*/
|
|
1326
|
+
create(e) {
|
|
1327
|
+
return Ml(e, this);
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Check if a value passes the struct's validation.
|
|
1331
|
+
*/
|
|
1332
|
+
is(e) {
|
|
1333
|
+
return Rl(e, this);
|
|
1334
|
+
}
|
|
1335
|
+
/**
|
|
1336
|
+
* Mask a value, coercing and validating it, but returning only the subset of
|
|
1337
|
+
* properties defined by the struct's schema.
|
|
1338
|
+
*/
|
|
1339
|
+
mask(e) {
|
|
1340
|
+
return Pl(e, this);
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Validate a value with the struct's validation logic, returning a tuple
|
|
1344
|
+
* representing the result.
|
|
1345
|
+
*
|
|
1346
|
+
* You may optionally pass `true` for the `withCoercion` argument to coerce
|
|
1347
|
+
* the value before attempting to validate it. If you do, the result will
|
|
1348
|
+
* contain the coerced result when successful.
|
|
1349
|
+
*/
|
|
1350
|
+
validate(e, r) {
|
|
1351
|
+
return r === void 0 && (r = {}), At(e, this, r);
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
function wo(t, e) {
|
|
1355
|
+
const r = At(t, e);
|
|
1356
|
+
if (r[0])
|
|
1357
|
+
throw r[0];
|
|
1358
|
+
}
|
|
1359
|
+
function Ml(t, e) {
|
|
1360
|
+
const r = At(t, e, {
|
|
1361
|
+
coerce: !0
|
|
1362
|
+
});
|
|
1363
|
+
if (r[0])
|
|
1364
|
+
throw r[0];
|
|
1365
|
+
return r[1];
|
|
1366
|
+
}
|
|
1367
|
+
function Pl(t, e) {
|
|
1368
|
+
const r = At(t, e, {
|
|
1369
|
+
coerce: !0,
|
|
1370
|
+
mask: !0
|
|
1371
|
+
});
|
|
1372
|
+
if (r[0])
|
|
1373
|
+
throw r[0];
|
|
1374
|
+
return r[1];
|
|
1375
|
+
}
|
|
1376
|
+
function Rl(t, e) {
|
|
1377
|
+
return !At(t, e)[0];
|
|
1378
|
+
}
|
|
1379
|
+
function At(t, e, r) {
|
|
1380
|
+
r === void 0 && (r = {});
|
|
1381
|
+
const n = wr(t, e, r), o = Tl(n);
|
|
1382
|
+
return o[0] ? [new Oo(o[0], function* () {
|
|
1383
|
+
for (const a of n)
|
|
1384
|
+
a[0] && (yield a[0]);
|
|
1385
|
+
}), void 0] : [void 0, o[1]];
|
|
1386
|
+
}
|
|
1387
|
+
function Cr() {
|
|
1388
|
+
for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)
|
|
1389
|
+
e[r] = arguments[r];
|
|
1390
|
+
const n = e[0].type === "type", o = e.map((s) => s.schema), a = Object.assign({}, ...o);
|
|
1391
|
+
return n ? $o(a) : w(a);
|
|
1392
|
+
}
|
|
1393
|
+
function st(t, e) {
|
|
1394
|
+
return new Z({
|
|
1395
|
+
type: t,
|
|
1396
|
+
schema: null,
|
|
1397
|
+
validator: e
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
function jt(t) {
|
|
1401
|
+
return new Z({
|
|
1402
|
+
type: "dynamic",
|
|
1403
|
+
schema: null,
|
|
1404
|
+
*entries(e, r) {
|
|
1405
|
+
yield* t(e, r).entries(e, r);
|
|
1406
|
+
},
|
|
1407
|
+
validator(e, r) {
|
|
1408
|
+
return t(e, r).validator(e, r);
|
|
1409
|
+
},
|
|
1410
|
+
coercer(e, r) {
|
|
1411
|
+
return t(e, r).coercer(e, r);
|
|
1412
|
+
},
|
|
1413
|
+
refiner(e, r) {
|
|
1414
|
+
return t(e, r).refiner(e, r);
|
|
1415
|
+
}
|
|
1416
|
+
});
|
|
1417
|
+
}
|
|
1418
|
+
function Co(t, e) {
|
|
1419
|
+
const {
|
|
1420
|
+
schema: r
|
|
1421
|
+
} = t, n = {
|
|
1422
|
+
...r
|
|
1423
|
+
};
|
|
1424
|
+
for (const o of e)
|
|
1425
|
+
delete n[o];
|
|
1426
|
+
switch (t.type) {
|
|
1427
|
+
case "type":
|
|
1428
|
+
return $o(n);
|
|
1429
|
+
default:
|
|
1430
|
+
return w(n);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
function A() {
|
|
1434
|
+
return st("any", () => !0);
|
|
1435
|
+
}
|
|
1436
|
+
function P(t) {
|
|
1437
|
+
return new Z({
|
|
1438
|
+
type: "array",
|
|
1439
|
+
schema: t,
|
|
1440
|
+
*entries(e) {
|
|
1441
|
+
if (t && Array.isArray(e))
|
|
1442
|
+
for (const [r, n] of e.entries())
|
|
1443
|
+
yield [r, n, t];
|
|
1444
|
+
},
|
|
1445
|
+
coercer(e) {
|
|
1446
|
+
return Array.isArray(e) ? e.slice() : e;
|
|
1447
|
+
},
|
|
1448
|
+
validator(e) {
|
|
1449
|
+
return Array.isArray(e) || `Expected an array value, but received: ${k(e)}`;
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
function ft() {
|
|
1454
|
+
return st("boolean", (t) => typeof t == "boolean");
|
|
1455
|
+
}
|
|
1456
|
+
function qe(t) {
|
|
1457
|
+
const e = {}, r = t.map((n) => k(n)).join();
|
|
1458
|
+
for (const n of t)
|
|
1459
|
+
e[n] = n;
|
|
1460
|
+
return new Z({
|
|
1461
|
+
type: "enums",
|
|
1462
|
+
schema: e,
|
|
1463
|
+
validator(n) {
|
|
1464
|
+
return t.includes(n) || `Expected one of \`${r}\`, but received: ${k(n)}`;
|
|
1465
|
+
}
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
function Eo() {
|
|
1469
|
+
return st("func", (t) => typeof t == "function" || `Expected a function, but received: ${k(t)}`);
|
|
1470
|
+
}
|
|
1471
|
+
function L(t) {
|
|
1472
|
+
const e = k(t), r = typeof t;
|
|
1473
|
+
return new Z({
|
|
1474
|
+
type: "literal",
|
|
1475
|
+
schema: r === "string" || r === "number" || r === "boolean" ? t : null,
|
|
1476
|
+
validator(n) {
|
|
1477
|
+
return n === t || `Expected the literal \`${e}\`, but received: ${k(n)}`;
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
function Il() {
|
|
1482
|
+
return st("never", () => !1);
|
|
1483
|
+
}
|
|
1484
|
+
function No() {
|
|
1485
|
+
return st("number", (t) => typeof t == "number" && !isNaN(t) || `Expected a number, but received: ${k(t)}`);
|
|
1486
|
+
}
|
|
1487
|
+
function w(t) {
|
|
1488
|
+
const e = t ? Object.keys(t) : [], r = Il();
|
|
1489
|
+
return new Z({
|
|
1490
|
+
type: "object",
|
|
1491
|
+
schema: t || null,
|
|
1492
|
+
*entries(n) {
|
|
1493
|
+
if (t && q(n)) {
|
|
1494
|
+
const o = new Set(Object.keys(n));
|
|
1495
|
+
for (const a of e)
|
|
1496
|
+
o.delete(a), yield [a, n[a], t[a]];
|
|
1497
|
+
for (const a of o)
|
|
1498
|
+
yield [a, n[a], r];
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
validator(n) {
|
|
1502
|
+
return q(n) || `Expected an object, but received: ${k(n)}`;
|
|
1503
|
+
},
|
|
1504
|
+
coercer(n) {
|
|
1505
|
+
return q(n) ? {
|
|
1506
|
+
...n
|
|
1507
|
+
} : n;
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
function m(t) {
|
|
1512
|
+
return new Z({
|
|
1513
|
+
...t,
|
|
1514
|
+
validator: (e, r) => e === void 0 || t.validator(e, r),
|
|
1515
|
+
refiner: (e, r) => e === void 0 || t.refiner(e, r)
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
function Jt(t, e) {
|
|
1519
|
+
return new Z({
|
|
1520
|
+
type: "record",
|
|
1521
|
+
schema: null,
|
|
1522
|
+
*entries(r) {
|
|
1523
|
+
if (q(r))
|
|
1524
|
+
for (const n in r) {
|
|
1525
|
+
const o = r[n];
|
|
1526
|
+
yield [n, n, t], yield [n, o, e];
|
|
1527
|
+
}
|
|
1528
|
+
},
|
|
1529
|
+
validator(r) {
|
|
1530
|
+
return q(r) || `Expected an object, but received: ${k(r)}`;
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
function g() {
|
|
1535
|
+
return st("string", (t) => typeof t == "string" || `Expected a string, but received: ${k(t)}`);
|
|
1536
|
+
}
|
|
1537
|
+
function $o(t) {
|
|
1538
|
+
const e = Object.keys(t);
|
|
1539
|
+
return new Z({
|
|
1540
|
+
type: "type",
|
|
1541
|
+
schema: t,
|
|
1542
|
+
*entries(r) {
|
|
1543
|
+
if (q(r))
|
|
1544
|
+
for (const n of e)
|
|
1545
|
+
yield [n, r[n], t[n]];
|
|
1546
|
+
},
|
|
1547
|
+
validator(r) {
|
|
1548
|
+
return q(r) || `Expected an object, but received: ${k(r)}`;
|
|
1549
|
+
}
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1552
|
+
function B(t) {
|
|
1553
|
+
const e = t.map((r) => r.type).join(" | ");
|
|
1554
|
+
return new Z({
|
|
1555
|
+
type: "union",
|
|
1556
|
+
schema: null,
|
|
1557
|
+
coercer(r, n) {
|
|
1558
|
+
return (t.find((o) => {
|
|
1559
|
+
const [a] = o.validate(r, {
|
|
1560
|
+
coerce: !0
|
|
1561
|
+
});
|
|
1562
|
+
return !a;
|
|
1563
|
+
}) || Dl()).coercer(r, n);
|
|
1564
|
+
},
|
|
1565
|
+
validator(r, n) {
|
|
1566
|
+
const o = [];
|
|
1567
|
+
for (const a of t) {
|
|
1568
|
+
const [...s] = wr(r, a, n), [i] = s;
|
|
1569
|
+
if (i[0])
|
|
1570
|
+
for (const [c] of s)
|
|
1571
|
+
c && o.push(c);
|
|
1572
|
+
else
|
|
1573
|
+
return [];
|
|
1574
|
+
}
|
|
1575
|
+
return [`Expected the value to satisfy a union of \`${e}\`, but received: ${k(r)}`, ...o];
|
|
1576
|
+
}
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
function Dl() {
|
|
1580
|
+
return st("unknown", () => !0);
|
|
1581
|
+
}
|
|
1582
|
+
const Er = w({
|
|
1583
|
+
package: g(),
|
|
1584
|
+
version: g(),
|
|
1585
|
+
name: g(),
|
|
1586
|
+
exportName: m(g()),
|
|
1587
|
+
destructuring: m(ft()),
|
|
1588
|
+
subName: m(g()),
|
|
1589
|
+
main: m(g()),
|
|
1590
|
+
cssPaths: m(P(g()))
|
|
1591
|
+
}), Ll = P(Er), Bl = [
|
|
1592
|
+
"CBlock",
|
|
1593
|
+
"CContainer",
|
|
1594
|
+
"CImage",
|
|
1595
|
+
"CCanvas",
|
|
1596
|
+
"CVideo",
|
|
1597
|
+
"CAudio",
|
|
1598
|
+
"CText",
|
|
1599
|
+
"CNativeTag"
|
|
1600
|
+
];
|
|
1601
|
+
var V = /* @__PURE__ */ ((t) => (t.SLOT = "SLOT", t.FUNCTION = "FUNCTION", t.EXPRESSION = "EXPRESSION", t))(V || {}), Nr = /* @__PURE__ */ ((t) => (t.DESIGN = "design", t.SAVE = "save", t))(Nr || {}), Qe = /* @__PURE__ */ ((t) => (t.FUNC = "FUNC", t.COMP = "COMP", t))(Qe || {});
|
|
1602
|
+
const Fl = () => st("normalObj", (t) => !F(t) || [V.SLOT, V.EXPRESSION, V.FUNCTION].includes(t == null ? void 0 : t.type) ? !1 : (At(t, Jt(g(), $r)), !0)), $r = B([
|
|
1603
|
+
g(),
|
|
1604
|
+
No(),
|
|
1605
|
+
ft(),
|
|
1606
|
+
w({
|
|
1607
|
+
type: L(V.SLOT),
|
|
1608
|
+
renderType: qe([Qe.FUNC, Qe.COMP]),
|
|
1609
|
+
// if renderType is Func, params will be useful
|
|
1610
|
+
params: m(P(g())),
|
|
1611
|
+
// here can't use PropsDataStructDescribe, it will caused "Maximum call stack size exceeded" error
|
|
1612
|
+
value: jt(() => B([Ot, P(Ot)]))
|
|
1613
|
+
}),
|
|
1614
|
+
w({
|
|
1615
|
+
type: L(V.EXPRESSION),
|
|
1616
|
+
value: g()
|
|
1617
|
+
}),
|
|
1618
|
+
w({
|
|
1619
|
+
type: L(V.FUNCTION),
|
|
1620
|
+
value: g()
|
|
1621
|
+
}),
|
|
1622
|
+
Fl(),
|
|
1623
|
+
P(
|
|
1624
|
+
jt(() => $r)
|
|
1625
|
+
)
|
|
1626
|
+
]), mn = w({
|
|
1627
|
+
type: L(V.EXPRESSION),
|
|
1628
|
+
value: g()
|
|
1629
|
+
}), Ot = w({
|
|
1630
|
+
id: m(g()),
|
|
1631
|
+
title: m(g()),
|
|
1632
|
+
componentName: g(),
|
|
1633
|
+
props: m(Jt(g(), $r)),
|
|
1634
|
+
nodeName: m(g()),
|
|
1635
|
+
state: m(Jt(g(), A())),
|
|
1636
|
+
children: jt(() => m(P(B([g(), Ot])))),
|
|
1637
|
+
configure: m(A()),
|
|
1638
|
+
css: m(A()),
|
|
1639
|
+
style: m(A()),
|
|
1640
|
+
classNames: m(P(A())),
|
|
1641
|
+
refId: m(g()),
|
|
1642
|
+
extra: m(Jt(A(), A())),
|
|
1643
|
+
condition: m(B([ft(), mn])),
|
|
1644
|
+
loop: m(
|
|
1645
|
+
w({
|
|
1646
|
+
open: ft(),
|
|
1647
|
+
data: B([P(A()), mn]),
|
|
1648
|
+
args: m(P(g())),
|
|
1649
|
+
forName: m(g()),
|
|
1650
|
+
forIndex: m(g()),
|
|
1651
|
+
key: m(A()),
|
|
1652
|
+
name: m(g())
|
|
1653
|
+
})
|
|
1654
|
+
),
|
|
1655
|
+
methods: m(P(A()))
|
|
1656
|
+
}), de = B([
|
|
1657
|
+
g(),
|
|
1658
|
+
w({
|
|
1659
|
+
label: g(),
|
|
1660
|
+
tip: m(g())
|
|
1661
|
+
})
|
|
1662
|
+
]), kl = w({
|
|
1663
|
+
type: L(
|
|
1664
|
+
"shape"
|
|
1665
|
+
/* SHAPE */
|
|
1666
|
+
),
|
|
1667
|
+
value: P(
|
|
1668
|
+
w({
|
|
1669
|
+
name: g(),
|
|
1670
|
+
title: de,
|
|
1671
|
+
valueType: jt(() => je)
|
|
1672
|
+
})
|
|
1673
|
+
)
|
|
1674
|
+
}), Ul = w({
|
|
1675
|
+
type: L(
|
|
1676
|
+
"enums"
|
|
1677
|
+
/* ENUMS */
|
|
1678
|
+
),
|
|
1679
|
+
value: P(g())
|
|
1680
|
+
});
|
|
1681
|
+
w({
|
|
1682
|
+
type: L(
|
|
1683
|
+
"array"
|
|
1684
|
+
/* ARRAY */
|
|
1685
|
+
),
|
|
1686
|
+
value: jt(() => je)
|
|
1687
|
+
});
|
|
1688
|
+
const Vl = w({
|
|
1689
|
+
type: L(
|
|
1690
|
+
"array"
|
|
1691
|
+
/* ARRAY */
|
|
1692
|
+
),
|
|
1693
|
+
value: jt(() => P(je))
|
|
1694
|
+
}), je = B([
|
|
1695
|
+
qe([
|
|
1696
|
+
"array",
|
|
1697
|
+
"boolean",
|
|
1698
|
+
"number",
|
|
1699
|
+
"object",
|
|
1700
|
+
"string"
|
|
1701
|
+
/* STRING */
|
|
1702
|
+
]),
|
|
1703
|
+
qe([
|
|
1704
|
+
"component",
|
|
1705
|
+
"expression",
|
|
1706
|
+
"function"
|
|
1707
|
+
/* FUNCTION */
|
|
1708
|
+
]),
|
|
1709
|
+
kl,
|
|
1710
|
+
Ul,
|
|
1711
|
+
Vl
|
|
1712
|
+
]), Gl = B([
|
|
1713
|
+
g(),
|
|
1714
|
+
w({
|
|
1715
|
+
componentName: g(),
|
|
1716
|
+
props: m(A()),
|
|
1717
|
+
/** 用于标记当前数据的初始值,如添加一个数组元素可以使用该值填充 */
|
|
1718
|
+
initialValue: m(A()),
|
|
1719
|
+
component: m(A()),
|
|
1720
|
+
hiddenLabel: m(ft())
|
|
1721
|
+
})
|
|
1722
|
+
]), Pe = w({
|
|
1723
|
+
name: g(),
|
|
1724
|
+
title: de,
|
|
1725
|
+
// 描述 name 对应值的类型
|
|
1726
|
+
valueType: je,
|
|
1727
|
+
description: m(g()),
|
|
1728
|
+
defaultValue: A(),
|
|
1729
|
+
//用于产生 valueType 类型的值
|
|
1730
|
+
setters: m(P(Gl)),
|
|
1731
|
+
condition: m(Eo())
|
|
1732
|
+
});
|
|
1733
|
+
B([g(), Eo()]);
|
|
1734
|
+
var Ye = /* @__PURE__ */ ((t) => (t.SINGLE = "single", t.GROUP = "group", t))(Ye || {});
|
|
1735
|
+
B([
|
|
1736
|
+
g(),
|
|
1737
|
+
w({
|
|
1738
|
+
name: g(),
|
|
1739
|
+
describe: m(g()),
|
|
1740
|
+
params: m(
|
|
1741
|
+
w({
|
|
1742
|
+
name: g(),
|
|
1743
|
+
description: g()
|
|
1744
|
+
})
|
|
1745
|
+
),
|
|
1746
|
+
template: g()
|
|
1747
|
+
})
|
|
1748
|
+
]);
|
|
1749
|
+
const zl = w({
|
|
1750
|
+
id: m(g()),
|
|
1751
|
+
title: g(),
|
|
1752
|
+
snapshot: B([g(), A()]),
|
|
1753
|
+
snapshotText: m(g()),
|
|
1754
|
+
description: m(g()),
|
|
1755
|
+
// 组件分类,用于搜索
|
|
1756
|
+
tags: m(P(g())),
|
|
1757
|
+
// 分 tab 面板
|
|
1758
|
+
groupName: m(g()),
|
|
1759
|
+
// 分类
|
|
1760
|
+
category: m(g()),
|
|
1761
|
+
schema: Cr(Co(Ot, ["id"]), w({ componentName: m(g()) }))
|
|
1762
|
+
}), Hl = w({
|
|
1763
|
+
componentName: g(),
|
|
1764
|
+
title: g(),
|
|
1765
|
+
screenshot: m(g()),
|
|
1766
|
+
icon: m(g()),
|
|
1767
|
+
// 组件分类,用于搜索
|
|
1768
|
+
tags: m(P(g())),
|
|
1769
|
+
// 分 tab 面板
|
|
1770
|
+
groupName: m(g()),
|
|
1771
|
+
// 分类
|
|
1772
|
+
category: m(g()),
|
|
1773
|
+
// 排序
|
|
1774
|
+
priority: m(No()),
|
|
1775
|
+
npm: m(Er),
|
|
1776
|
+
snippets: P(zl),
|
|
1777
|
+
props: P(
|
|
1778
|
+
B([
|
|
1779
|
+
Pe,
|
|
1780
|
+
w({
|
|
1781
|
+
title: m(de),
|
|
1782
|
+
type: L(
|
|
1783
|
+
"single"
|
|
1784
|
+
/* SINGLE */
|
|
1785
|
+
),
|
|
1786
|
+
content: Pe
|
|
1787
|
+
}),
|
|
1788
|
+
w({
|
|
1789
|
+
title: m(de),
|
|
1790
|
+
type: L(
|
|
1791
|
+
"group"
|
|
1792
|
+
/* GROUP */
|
|
1793
|
+
),
|
|
1794
|
+
content: P(Pe)
|
|
1795
|
+
})
|
|
1796
|
+
])
|
|
1797
|
+
),
|
|
1798
|
+
fixedProps: m(A()),
|
|
1799
|
+
// 可以拖入组件
|
|
1800
|
+
isContainer: m(
|
|
1801
|
+
B([
|
|
1802
|
+
ft(),
|
|
1803
|
+
w({
|
|
1804
|
+
placeholder: g(),
|
|
1805
|
+
width: g(),
|
|
1806
|
+
height: g()
|
|
1807
|
+
})
|
|
1808
|
+
])
|
|
1809
|
+
),
|
|
1810
|
+
disableEditorDragDom: m(A()),
|
|
1811
|
+
// 如果是布局组件,可以考虑将拖拽控制权转移 or 实现 resize
|
|
1812
|
+
isLayout: m(ft()),
|
|
1813
|
+
rootSelector: m(g()),
|
|
1814
|
+
// selectionToolBarView: optional(func()),
|
|
1815
|
+
advanceCustom: m(A()),
|
|
1816
|
+
// 扩展配置
|
|
1817
|
+
extra: m(Jt(A(), A()))
|
|
1818
|
+
}), Jl = (t) => ({ data: e, message: r, throwError: n }) => {
|
|
1819
|
+
const o = t({ data: e, message: r, throwError: n });
|
|
1820
|
+
if (o.isValidate)
|
|
1821
|
+
return o;
|
|
1822
|
+
if (n)
|
|
1823
|
+
throw o.message || r ? new Error(`${o.message || r}
|
|
1824
|
+
originData: ${JSON.stringify(e)}`) : new Error(`${JSON.stringify(e)}
|
|
1825
|
+
data struct format is invalidate`);
|
|
1826
|
+
return o.message || r ? console.warn(`${o.message || r}
|
|
1827
|
+
originData: ${JSON.stringify(e)}`) : console.warn(`${JSON.stringify(e)}
|
|
1828
|
+
data struct format is invalidate`), o;
|
|
1829
|
+
}, xr = (t) => {
|
|
1830
|
+
const { data: e, message: r, throwError: n, dataStruct: o } = t;
|
|
1831
|
+
return Jl(({ data: a }) => {
|
|
1832
|
+
try {
|
|
1833
|
+
return wo(a, o), {
|
|
1834
|
+
isValidate: !0
|
|
1835
|
+
};
|
|
1836
|
+
} catch (s) {
|
|
1837
|
+
let i = s;
|
|
1838
|
+
return s instanceof Oo && (i = s.failures().map((c) => `【${c.path.join(".")}】: ${c.message}
|
|
1839
|
+
`)), {
|
|
1840
|
+
isValidate: !1,
|
|
1841
|
+
message: i,
|
|
1842
|
+
error: s
|
|
1843
|
+
};
|
|
1844
|
+
}
|
|
1845
|
+
})({ data: e, message: r, throwError: n });
|
|
1846
|
+
};
|
|
1847
|
+
var Mt = /* @__PURE__ */ ((t) => (t.ROOT_CONTAINER = "RootContainer", t))(Mt || {});
|
|
1848
|
+
const Wl = w({
|
|
1849
|
+
type: L(V.FUNCTION),
|
|
1850
|
+
value: g()
|
|
1851
|
+
}), ql = Cr(
|
|
1852
|
+
Co(Ot, ["componentName"]),
|
|
1853
|
+
w({
|
|
1854
|
+
componentName: L(
|
|
1855
|
+
"RootContainer"
|
|
1856
|
+
/* ROOT_CONTAINER */
|
|
1857
|
+
)
|
|
1858
|
+
})
|
|
1859
|
+
);
|
|
1860
|
+
function Ql(t) {
|
|
1861
|
+
return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
|
|
1862
|
+
var n = t.get(e);
|
|
1863
|
+
n ? n.push(r) : t.set(e, [r]);
|
|
1864
|
+
}, off: function(e, r) {
|
|
1865
|
+
var n = t.get(e);
|
|
1866
|
+
n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t.set(e, []));
|
|
1867
|
+
}, emit: function(e, r) {
|
|
1868
|
+
var n = t.get(e);
|
|
1869
|
+
n && n.slice().map(function(o) {
|
|
1870
|
+
o(r);
|
|
1871
|
+
}), (n = t.get("*")) && n.slice().map(function(o) {
|
|
1872
|
+
o(e, r);
|
|
1873
|
+
});
|
|
1874
|
+
} };
|
|
1875
|
+
}
|
|
1876
|
+
const ne = Ql(), Yl = (t, e) => {
|
|
1877
|
+
const r = {
|
|
1878
|
+
...t,
|
|
1879
|
+
value: []
|
|
1880
|
+
}, n = t.value;
|
|
1881
|
+
let o = new pt([]);
|
|
1882
|
+
return e && (o = e.materialsMode || new pt([])), n && (R(n) ? r.value = n.map(
|
|
1883
|
+
(a) => new M(a, {
|
|
1884
|
+
parent: e,
|
|
1885
|
+
materials: o
|
|
1886
|
+
})
|
|
1887
|
+
) : F(n) && r.value.push(
|
|
1888
|
+
new M(n, {
|
|
1889
|
+
parent: e,
|
|
1890
|
+
materials: o
|
|
1891
|
+
})
|
|
1892
|
+
)), r;
|
|
1893
|
+
};
|
|
1894
|
+
class wt {
|
|
1895
|
+
constructor(e, r) {
|
|
1896
|
+
_(this, "nodeType", "SLOT"), _(this, "rawData"), _(this, "parent"), _(this, "emitter", ne), _(this, "data"), _(this, "id"), _(this, "materialsMode"), this.parent = (r == null ? void 0 : r.parent) || null, this.rawData = e;
|
|
1897
|
+
const n = (r == null ? void 0 : r.materials) || new pt([]);
|
|
1898
|
+
this.materialsMode = n, this.id = tt(), this.data = Yl(e, this);
|
|
1899
|
+
}
|
|
1900
|
+
get value() {
|
|
1901
|
+
return this.data;
|
|
1902
|
+
}
|
|
1903
|
+
export(e) {
|
|
1904
|
+
const r = this.data, n = (o) => {
|
|
1905
|
+
if (o instanceof M)
|
|
1906
|
+
return o.export(e);
|
|
1907
|
+
if (F(o)) {
|
|
1908
|
+
const a = {};
|
|
1909
|
+
return Object.keys(o || {}).forEach((s) => {
|
|
1910
|
+
a[s] = n(o[s]);
|
|
1911
|
+
}), a;
|
|
1912
|
+
}
|
|
1913
|
+
return R(o) ? o.map((a) => n(a)) : (e === "design" && delete o.id, o);
|
|
1914
|
+
};
|
|
1915
|
+
return n(r);
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
const xo = (t) => {
|
|
1919
|
+
let e = [];
|
|
1920
|
+
return t.forEach((r) => {
|
|
1921
|
+
const n = r;
|
|
1922
|
+
n.type ? n.type === Ye.SINGLE ? e.push(n.content) : n.type === Ye.GROUP && (e = [...e, ...xo(n.content)]) : e.push(r);
|
|
1923
|
+
}), e;
|
|
1924
|
+
}, Xe = (t, e, r) => {
|
|
1925
|
+
if (t.type)
|
|
1926
|
+
return t.type === V.SLOT ? new wt(t, { parent: e, materials: r }) : t;
|
|
1927
|
+
if (F(t)) {
|
|
1928
|
+
const n = {};
|
|
1929
|
+
return Object.keys(t).forEach((o) => {
|
|
1930
|
+
n[o] = Ke(t[o], e, r);
|
|
1931
|
+
}), n;
|
|
1932
|
+
} else return Array.isArray(t) ? t.map((n) => Xe(n, e, r)) : t;
|
|
1933
|
+
}, Ke = (t, e, r) => F(t) ? Xe(t, e, r) : R(t) ? t.map((n) => Xe(n, e, r)) : t;
|
|
1934
|
+
class it {
|
|
1935
|
+
constructor(e, r, n) {
|
|
1936
|
+
_(this, "nodeType", "PROP"), _(this, "rawData"), _(this, "parent"), _(this, "emitter", ne), _(this, "data"), _(this, "name"), _(this, "materialsMode");
|
|
1937
|
+
const o = (n == null ? void 0 : n.materials) || new pt([]);
|
|
1938
|
+
this.materialsMode = o, this.parent = n == null ? void 0 : n.parent, this.rawData = r, this.name = e, this.data = Ke(r, this, o);
|
|
1939
|
+
}
|
|
1940
|
+
// TODO:
|
|
1941
|
+
isIncludeSlot() {
|
|
1942
|
+
return !1;
|
|
1943
|
+
}
|
|
1944
|
+
// TODO:
|
|
1945
|
+
isIncludeExpression() {
|
|
1946
|
+
return !1;
|
|
1947
|
+
}
|
|
1948
|
+
get value() {
|
|
1949
|
+
return this.data;
|
|
1950
|
+
}
|
|
1951
|
+
updateValue(e) {
|
|
1952
|
+
const r = this.data;
|
|
1953
|
+
this.data = Ke(e ?? r, this, this.materialsMode), this.emitter.emit("onPropChange", {
|
|
1954
|
+
value: this.data,
|
|
1955
|
+
preValue: r,
|
|
1956
|
+
node: this
|
|
1957
|
+
}), this.parent && !(this.parent instanceof wt) && this.emitter.emit("onNodeChange", {
|
|
1958
|
+
value: this.parent.value,
|
|
1959
|
+
preValue: this.parent.value,
|
|
1960
|
+
node: this.parent
|
|
1961
|
+
});
|
|
1962
|
+
}
|
|
1963
|
+
get material() {
|
|
1964
|
+
const e = this.parent;
|
|
1965
|
+
if (e instanceof M) {
|
|
1966
|
+
const r = e.material;
|
|
1967
|
+
return xo((r == null ? void 0 : r.value.props) || []).find((n) => n.name === this.name);
|
|
1968
|
+
} else
|
|
1969
|
+
return null;
|
|
1970
|
+
}
|
|
1971
|
+
export(e) {
|
|
1972
|
+
const r = this.data, n = (o) => {
|
|
1973
|
+
if (o instanceof it || o instanceof wt || o instanceof M)
|
|
1974
|
+
return o.export(e);
|
|
1975
|
+
if (R(o))
|
|
1976
|
+
return o.map((a) => n(a));
|
|
1977
|
+
if (F(o)) {
|
|
1978
|
+
const a = {};
|
|
1979
|
+
return Object.keys(o || {}).forEach((s) => {
|
|
1980
|
+
a[s] = n(o[s]);
|
|
1981
|
+
}), a;
|
|
1982
|
+
}
|
|
1983
|
+
return o;
|
|
1984
|
+
};
|
|
1985
|
+
return n(r);
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
const Xl = (t) => {
|
|
1989
|
+
if (typeof t == "string")
|
|
1990
|
+
return !0;
|
|
1991
|
+
xr({
|
|
1992
|
+
data: t,
|
|
1993
|
+
dataStruct: Ot,
|
|
1994
|
+
throwError: !1
|
|
1995
|
+
});
|
|
1996
|
+
}, gn = (t, e, r = new pt([])) => {
|
|
1997
|
+
if (typeof t == "string")
|
|
1998
|
+
return t;
|
|
1999
|
+
const n = {
|
|
2000
|
+
...t,
|
|
2001
|
+
id: t.id ?? tt(),
|
|
2002
|
+
children: [],
|
|
2003
|
+
props: {},
|
|
2004
|
+
methods: t.methods || [],
|
|
2005
|
+
configure: So(t.configure || {}, {
|
|
2006
|
+
propsSetter: {},
|
|
2007
|
+
advanceSetter: {}
|
|
2008
|
+
})
|
|
2009
|
+
}, o = Object.keys(t.props || {});
|
|
2010
|
+
return o.length && o.forEach((a) => {
|
|
2011
|
+
var s;
|
|
2012
|
+
const i = (s = t.props) == null ? void 0 : s[a];
|
|
2013
|
+
if (i instanceof it) {
|
|
2014
|
+
n.props[a] = i;
|
|
2015
|
+
return;
|
|
2016
|
+
}
|
|
2017
|
+
n.props[a] = new it(a, i || "", {
|
|
2018
|
+
parent: e,
|
|
2019
|
+
materials: r
|
|
2020
|
+
});
|
|
2021
|
+
}), t.children && (Array.isArray(t.children) ? n.children = t.children.map((a) => {
|
|
2022
|
+
if (a instanceof M)
|
|
2023
|
+
return a;
|
|
2024
|
+
if (F(a)) {
|
|
2025
|
+
const s = a;
|
|
2026
|
+
return new M(s, {
|
|
2027
|
+
parent: e,
|
|
2028
|
+
materials: r
|
|
2029
|
+
});
|
|
2030
|
+
} else
|
|
2031
|
+
return a;
|
|
2032
|
+
}) : (t.children instanceof M && (n.children = [t.children]), n.children = [
|
|
2033
|
+
new M(t.children, {
|
|
2034
|
+
parent: e,
|
|
2035
|
+
materials: r
|
|
2036
|
+
})
|
|
2037
|
+
])), n;
|
|
2038
|
+
};
|
|
2039
|
+
class M {
|
|
2040
|
+
constructor(e, r) {
|
|
2041
|
+
_(this, "nodeType", "NODE"), _(this, "rawData"), _(this, "data"), _(this, "emitter", ne), _(this, "parent"), _(this, "materialsModel"), _(this, "listenerHandle"), _(this, "onChangeCbQueue"), this.rawData = JSON.parse(JSON.stringify(e)), Xl(e);
|
|
2042
|
+
const n = (r == null ? void 0 : r.materials) || new pt([]);
|
|
2043
|
+
this.parent = (r == null ? void 0 : r.parent) || null, this.materialsModel = n, this.data = gn(e, this, n), this.listenerHandle = [], this.onChangeCbQueue = [], this.registerListener();
|
|
2044
|
+
}
|
|
2045
|
+
registerListener() {
|
|
2046
|
+
const e = (r) => {
|
|
2047
|
+
const { node: n } = r;
|
|
2048
|
+
n === this && n.id === this.id && this.onChangeCbQueue.forEach((o) => o(r));
|
|
2049
|
+
};
|
|
2050
|
+
this.emitter.on("onNodeChange", e), this.listenerHandle.push(() => {
|
|
2051
|
+
this.emitter.off("onNodeChange", e);
|
|
2052
|
+
});
|
|
2053
|
+
}
|
|
2054
|
+
onChange(e) {
|
|
2055
|
+
return this.onChangeCbQueue.push(e), () => {
|
|
2056
|
+
this.onChangeCbQueue = this.onChangeCbQueue.filter((r) => r !== e);
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
2059
|
+
destroy() {
|
|
2060
|
+
this.listenerHandle.forEach((e) => e());
|
|
2061
|
+
}
|
|
2062
|
+
get id() {
|
|
2063
|
+
return this.data.id;
|
|
2064
|
+
}
|
|
2065
|
+
get value() {
|
|
2066
|
+
return this.data;
|
|
2067
|
+
}
|
|
2068
|
+
clone(e) {
|
|
2069
|
+
const r = {
|
|
2070
|
+
...this.export("design"),
|
|
2071
|
+
id: e || tt()
|
|
2072
|
+
};
|
|
2073
|
+
return new M(r, {
|
|
2074
|
+
materials: this.materialsModel
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2077
|
+
updateWithPlainObj(e) {
|
|
2078
|
+
const r = {
|
|
2079
|
+
...this.data,
|
|
2080
|
+
...e
|
|
2081
|
+
};
|
|
2082
|
+
return this.data = gn(r, this), r;
|
|
2083
|
+
}
|
|
2084
|
+
updateValue(e) {
|
|
2085
|
+
const r = this.data, n = this.updateWithPlainObj(e);
|
|
2086
|
+
this.emitter.emit("onNodeChange", {
|
|
2087
|
+
value: n,
|
|
2088
|
+
preValue: r,
|
|
2089
|
+
node: this
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
contains(e) {
|
|
2093
|
+
return Ar(this, e);
|
|
2094
|
+
}
|
|
2095
|
+
get props() {
|
|
2096
|
+
return this.data.props;
|
|
2097
|
+
}
|
|
2098
|
+
get material() {
|
|
2099
|
+
const e = this.materialsModel;
|
|
2100
|
+
return e == null ? void 0 : e.findByComponentName(this.data.componentName);
|
|
2101
|
+
}
|
|
2102
|
+
getPlainProps() {
|
|
2103
|
+
const e = this.data, r = {};
|
|
2104
|
+
return Object.keys(e.props || {}).forEach((n) => {
|
|
2105
|
+
r[n] = e.props[n].export("design");
|
|
2106
|
+
}), r;
|
|
2107
|
+
}
|
|
2108
|
+
// 节点物料中的配置信息
|
|
2109
|
+
getMaterialConfig(e) {
|
|
2110
|
+
var r;
|
|
2111
|
+
return this.data.configure[e] !== void 0 ? this.data.configure.isContainer : (r = this.material) == null ? void 0 : r.value.isContainer;
|
|
2112
|
+
}
|
|
2113
|
+
isContainer() {
|
|
2114
|
+
return this.getMaterialConfig("isContainer");
|
|
2115
|
+
}
|
|
2116
|
+
export(e) {
|
|
2117
|
+
var r;
|
|
2118
|
+
const n = this.data;
|
|
2119
|
+
if (typeof n == "string")
|
|
2120
|
+
return n;
|
|
2121
|
+
const o = {};
|
|
2122
|
+
Object.keys(n.props || {}).forEach((p) => {
|
|
2123
|
+
o[p] = n.props[p].export(e);
|
|
2124
|
+
});
|
|
2125
|
+
const a = (r = n.children) == null ? void 0 : r.map((p) => p instanceof M ? p.export(e) : p), s = n.configure || {}, i = s.propsSetter || {}, c = {};
|
|
2126
|
+
Object.keys(i).forEach((p) => {
|
|
2127
|
+
const f = to(i, p, !1);
|
|
2128
|
+
f && (c[p] = f);
|
|
2129
|
+
}), s.propsSetter = c;
|
|
2130
|
+
const u = this.materialsModel.usedMaterials.find(
|
|
2131
|
+
(p) => {
|
|
2132
|
+
var f;
|
|
2133
|
+
return p.componentName === ((f = this.material) == null ? void 0 : f.componentName);
|
|
2134
|
+
}
|
|
2135
|
+
);
|
|
2136
|
+
this.material && !u && this.materialsModel.usedMaterials.push(this.material);
|
|
2137
|
+
let l = {
|
|
2138
|
+
...n,
|
|
2139
|
+
configure: s,
|
|
2140
|
+
props: o,
|
|
2141
|
+
children: a,
|
|
2142
|
+
condition: n.condition
|
|
2143
|
+
};
|
|
2144
|
+
return e === "design" && delete l.id, l = Tr(l), l;
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
const vn = (t, e, r) => {
|
|
2148
|
+
const n = {
|
|
2149
|
+
...t,
|
|
2150
|
+
id: tt(),
|
|
2151
|
+
props: {},
|
|
2152
|
+
componentName: Mt.ROOT_CONTAINER,
|
|
2153
|
+
children: [],
|
|
2154
|
+
methods: t.methods || [],
|
|
2155
|
+
configure: So(t.configure || {}, {
|
|
2156
|
+
propsSetter: {},
|
|
2157
|
+
advanceSetter: {}
|
|
2158
|
+
})
|
|
2159
|
+
};
|
|
2160
|
+
let o = [];
|
|
2161
|
+
R(t.children) ? o = t.children.map((s) => s instanceof M ? s : F(s) ? new M(s, { parent: e, materials: r }) : s) : t.children instanceof M ? o.push(t.children) : t.children && F(t.children) && o.push(new M(t.children, { parent: e, materials: r }));
|
|
2162
|
+
const a = Object.keys(t.props || {});
|
|
2163
|
+
return a.length && a.forEach((s) => {
|
|
2164
|
+
var i;
|
|
2165
|
+
const c = (i = t.props) == null ? void 0 : i[s];
|
|
2166
|
+
c instanceof it ? n.props[s] = c : n.props[s] = new it(s, c || "", {
|
|
2167
|
+
parent: e,
|
|
2168
|
+
materials: r
|
|
2169
|
+
});
|
|
2170
|
+
}), n.children = o, n;
|
|
2171
|
+
};
|
|
2172
|
+
class Zt {
|
|
2173
|
+
constructor(e, { parent: r, materials: n }) {
|
|
2174
|
+
_(this, "rawData"), _(this, "data"), _(this, "nodeType", Mt.ROOT_CONTAINER), _(this, "emitter", ne), _(this, "materialsModel"), _(this, "listenerHandle"), _(this, "onChangeCbQueue"), _(this, "parent"), this.materialsModel = n, this.rawData = JSON.parse(JSON.stringify(e)), this.data = vn(e, this, n), this.listenerHandle = [], this.onChangeCbQueue = [], this.registerListener(), this.parent = r;
|
|
2175
|
+
}
|
|
2176
|
+
registerListener() {
|
|
2177
|
+
const e = (r) => {
|
|
2178
|
+
const { node: n } = r;
|
|
2179
|
+
n === this && n.id === this.id && this.onChangeCbQueue.forEach((o) => o(r));
|
|
2180
|
+
};
|
|
2181
|
+
this.emitter.on("onNodeChange", e), this.listenerHandle.push(() => {
|
|
2182
|
+
this.emitter.off("onNodeChange", e);
|
|
2183
|
+
});
|
|
2184
|
+
}
|
|
2185
|
+
onChange(e) {
|
|
2186
|
+
return this.onChangeCbQueue.push(e), () => {
|
|
2187
|
+
this.onChangeCbQueue = this.onChangeCbQueue.filter((r) => r !== e);
|
|
2188
|
+
};
|
|
2189
|
+
}
|
|
2190
|
+
get id() {
|
|
2191
|
+
return this.data.id;
|
|
2192
|
+
}
|
|
2193
|
+
get value() {
|
|
2194
|
+
return this.data;
|
|
2195
|
+
}
|
|
2196
|
+
get props() {
|
|
2197
|
+
return this.data.props;
|
|
2198
|
+
}
|
|
2199
|
+
get material() {
|
|
2200
|
+
const e = this.materialsModel;
|
|
2201
|
+
return e == null ? void 0 : e.findByComponentName(this.data.componentName);
|
|
2202
|
+
}
|
|
2203
|
+
updateWithPlainObj(e) {
|
|
2204
|
+
const r = {
|
|
2205
|
+
...this.data,
|
|
2206
|
+
...e
|
|
2207
|
+
};
|
|
2208
|
+
return this.data = vn(r, this, this.materialsModel), r;
|
|
2209
|
+
}
|
|
2210
|
+
updateValue(e) {
|
|
2211
|
+
const r = this.data;
|
|
2212
|
+
this.updateWithPlainObj(e), this.emitter.emit("onNodeChange", {
|
|
2213
|
+
value: this.data,
|
|
2214
|
+
preValue: r,
|
|
2215
|
+
node: this
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
contains(e) {
|
|
2219
|
+
return Ar(this, e);
|
|
2220
|
+
}
|
|
2221
|
+
/**
|
|
2222
|
+
* 从物料 和 node config 中获取合并后的属性,node 中的配置优先级更高
|
|
2223
|
+
* @param key 目前只支持 isContainer 属性
|
|
2224
|
+
* @returns
|
|
2225
|
+
*/
|
|
2226
|
+
getMaterialConfig(e) {
|
|
2227
|
+
var r;
|
|
2228
|
+
return this.data.configure[e] !== void 0 ? this.data.configure.isContainer : (r = this.material) == null ? void 0 : r.value.isContainer;
|
|
2229
|
+
}
|
|
2230
|
+
isContainer() {
|
|
2231
|
+
return this.getMaterialConfig("isContainer");
|
|
2232
|
+
}
|
|
2233
|
+
export(e = Nr.SAVE) {
|
|
2234
|
+
var r;
|
|
2235
|
+
const n = this.data, o = {};
|
|
2236
|
+
Object.keys(n.props || {}).forEach((c) => {
|
|
2237
|
+
o[c] = n.props[c].export(e);
|
|
2238
|
+
});
|
|
2239
|
+
const a = ((r = n.children) == null ? void 0 : r.map((c) => {
|
|
2240
|
+
var u;
|
|
2241
|
+
return (u = c == null ? void 0 : c.export) == null ? void 0 : u.call(c, e);
|
|
2242
|
+
})) || [], s = {
|
|
2243
|
+
...n,
|
|
2244
|
+
props: o,
|
|
2245
|
+
children: a.filter((c) => c),
|
|
2246
|
+
condition: n.condition
|
|
2247
|
+
};
|
|
2248
|
+
let i = jo(s, ["id"]);
|
|
2249
|
+
return i = Tr(i), i;
|
|
2250
|
+
}
|
|
2251
|
+
getPlainProps() {
|
|
2252
|
+
const e = this.data, r = {};
|
|
2253
|
+
return Object.keys(e.props || {}).forEach((n) => {
|
|
2254
|
+
r[n] = e.props[n].export("design");
|
|
2255
|
+
}), r;
|
|
2256
|
+
}
|
|
2257
|
+
destroy() {
|
|
2258
|
+
this.listenerHandle.forEach((e) => e());
|
|
2259
|
+
}
|
|
2260
|
+
clone(e) {
|
|
2261
|
+
const r = {
|
|
2262
|
+
...this.export("design"),
|
|
2263
|
+
id: e || tt()
|
|
2264
|
+
};
|
|
2265
|
+
return new Zt(r, {
|
|
2266
|
+
materials: this.materialsModel,
|
|
2267
|
+
parent: null
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
const ut = (t) => (t == null ? void 0 : t.type) === V.EXPRESSION, Kl = (t) => (t == null ? void 0 : t.type) === V.FUNCTION, tt = () => Math.random().toString(32).slice(3, 9), Zl = (t) => (t == null ? void 0 : t.nodeType) === "NODE", Re = (t) => (t == null ? void 0 : t.nodeType) === "PROP", tf = (t) => (t == null ? void 0 : t.nodeType) === "SLOT", Tr = (t) => Ol(t, (e) => F(e) ? !Object.keys(e).length : R(e) ? !e.length : !e);
|
|
2272
|
+
function ef(t, e) {
|
|
2273
|
+
const r = [t];
|
|
2274
|
+
for (; r.length; ) {
|
|
2275
|
+
const n = r.shift();
|
|
2276
|
+
if (n && e(n))
|
|
2277
|
+
return n;
|
|
2278
|
+
const o = (n == null ? void 0 : n.props) || {}, a = (i) => {
|
|
2279
|
+
if (i instanceof M) {
|
|
2280
|
+
r.push(i);
|
|
2281
|
+
return;
|
|
2282
|
+
}
|
|
2283
|
+
if (i instanceof wt && a(i.value.value), i instanceof it) {
|
|
2284
|
+
a(i.value);
|
|
2285
|
+
return;
|
|
2286
|
+
}
|
|
2287
|
+
if (F(i)) {
|
|
2288
|
+
const c = i;
|
|
2289
|
+
Object.keys(c).forEach((u) => {
|
|
2290
|
+
a(c[u]);
|
|
2291
|
+
});
|
|
2292
|
+
return;
|
|
2293
|
+
}
|
|
2294
|
+
if (R(i)) {
|
|
2295
|
+
i.forEach((c) => {
|
|
2296
|
+
a(c);
|
|
2297
|
+
});
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
};
|
|
2301
|
+
a(o);
|
|
2302
|
+
const s = (n == null ? void 0 : n.value.children.filter((i) => i instanceof M)) || [];
|
|
2303
|
+
r.push(...s);
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
function Ar(t, e) {
|
|
2307
|
+
return ef(t, (r) => r.id === e);
|
|
2308
|
+
}
|
|
2309
|
+
const rf = (t) => {
|
|
2310
|
+
const e = ho(t), r = e.snippets;
|
|
2311
|
+
return delete e.snippets, e.snippets = r.map((n) => ({
|
|
2312
|
+
...e,
|
|
2313
|
+
...n,
|
|
2314
|
+
id: n.id || `${t.componentName}-${tt()}`,
|
|
2315
|
+
title: n.title || t.title,
|
|
2316
|
+
category: n.category || t.category,
|
|
2317
|
+
tags: [...n.tags || [], ...t.tags || []],
|
|
2318
|
+
groupName: n.groupName || t.groupName,
|
|
2319
|
+
snapshot: n.snapshot || t.icon,
|
|
2320
|
+
snapshotText: n.snapshotText,
|
|
2321
|
+
schema: {
|
|
2322
|
+
...n.schema,
|
|
2323
|
+
componentName: n.schema.componentName || t.componentName
|
|
2324
|
+
}
|
|
2325
|
+
})), e;
|
|
2326
|
+
};
|
|
2327
|
+
class nf {
|
|
2328
|
+
constructor(e) {
|
|
2329
|
+
_(this, "rawData"), _(this, "data"), this.rawData = e, this.data = rf(e);
|
|
2330
|
+
}
|
|
2331
|
+
get value() {
|
|
2332
|
+
return this.data;
|
|
2333
|
+
}
|
|
2334
|
+
get rawValue() {
|
|
2335
|
+
return this.rawData;
|
|
2336
|
+
}
|
|
2337
|
+
get componentName() {
|
|
2338
|
+
return this.data.componentName;
|
|
2339
|
+
}
|
|
2340
|
+
get snippets() {
|
|
2341
|
+
return this.data.snippets;
|
|
2342
|
+
}
|
|
2343
|
+
getSnippetById(e) {
|
|
2344
|
+
return this.data.snippets.find((r) => r.id === e);
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
const Ie = (t) => {
|
|
2348
|
+
if (!R(t))
|
|
2349
|
+
throw new Error("Materials must be a array");
|
|
2350
|
+
return t.map((e) => new nf(e));
|
|
2351
|
+
}, of = (t) => {
|
|
2352
|
+
t == null || t.forEach((e) => {
|
|
2353
|
+
xr({
|
|
2354
|
+
data: e,
|
|
2355
|
+
dataStruct: Hl,
|
|
2356
|
+
throwError: !1
|
|
2357
|
+
});
|
|
2358
|
+
});
|
|
2359
|
+
};
|
|
2360
|
+
class pt {
|
|
2361
|
+
constructor(e) {
|
|
2362
|
+
_(this, "rawData"), _(this, "data"), _(this, "usedMaterials", []), this.rawData = e, of(e), this.data = Ie(e);
|
|
2363
|
+
}
|
|
2364
|
+
addMaterials(e) {
|
|
2365
|
+
const r = Ie(e), n = [], o = this.data.map((s) => {
|
|
2366
|
+
const i = r.findIndex((c) => c.componentName === s.componentName);
|
|
2367
|
+
return i >= 0 ? (n.push(i), r[i]) : s;
|
|
2368
|
+
}), a = r.filter((s, i) => !n.includes(i));
|
|
2369
|
+
this.data = [...o, ...a];
|
|
2370
|
+
}
|
|
2371
|
+
// 使用新的物料整个替换现有的物料列表
|
|
2372
|
+
replaceMaterials(e) {
|
|
2373
|
+
const r = Ie(e);
|
|
2374
|
+
this.data = [...r];
|
|
2375
|
+
}
|
|
2376
|
+
removeMaterial(e) {
|
|
2377
|
+
const r = this.data.filter((n) => !e.includes(n.componentName));
|
|
2378
|
+
this.data = r;
|
|
2379
|
+
}
|
|
2380
|
+
findByComponentName(e) {
|
|
2381
|
+
return this.data.find((r) => r.componentName === e);
|
|
2382
|
+
}
|
|
2383
|
+
findSnippetById(e) {
|
|
2384
|
+
const r = [...this.data];
|
|
2385
|
+
let n = null;
|
|
2386
|
+
for (; !n && r.length; ) {
|
|
2387
|
+
const o = r.pop();
|
|
2388
|
+
n = o == null ? void 0 : o.getSnippetById(e);
|
|
2389
|
+
}
|
|
2390
|
+
return n;
|
|
2391
|
+
}
|
|
2392
|
+
getAllSnippets() {
|
|
2393
|
+
const e = this.data.reduce((a, s) => (a.push(...s.snippets), a), []), r = [], n = {
|
|
2394
|
+
default: []
|
|
2395
|
+
};
|
|
2396
|
+
e.forEach((a) => {
|
|
2397
|
+
const s = a.groupName || "default";
|
|
2398
|
+
r.includes(s) || (r.push(s), n[s] = []), n[s].push(a);
|
|
2399
|
+
});
|
|
2400
|
+
let o = [];
|
|
2401
|
+
return r.forEach((a) => {
|
|
2402
|
+
const s = ["default"], i = {
|
|
2403
|
+
default: []
|
|
2404
|
+
}, c = n[a];
|
|
2405
|
+
if (c.length !== 0) {
|
|
2406
|
+
c.forEach((p) => {
|
|
2407
|
+
const f = p.category || "default";
|
|
2408
|
+
s.includes(f) || (s.push(f), i[f] = []), i[f].push(p);
|
|
2409
|
+
});
|
|
2410
|
+
const u = [];
|
|
2411
|
+
s.forEach((p) => {
|
|
2412
|
+
i[p].length && u.push({
|
|
2413
|
+
name: p,
|
|
2414
|
+
list: i[p]
|
|
2415
|
+
});
|
|
2416
|
+
});
|
|
2417
|
+
const l = {
|
|
2418
|
+
name: a,
|
|
2419
|
+
list: u
|
|
2420
|
+
};
|
|
2421
|
+
o.push(l);
|
|
2422
|
+
}
|
|
2423
|
+
}), o = o.sort((a, s) => (a.name || "") > (s.name || "") ? 1 : -1), o;
|
|
2424
|
+
}
|
|
2425
|
+
get value() {
|
|
2426
|
+
return this.data;
|
|
2427
|
+
}
|
|
2428
|
+
get rawValue() {
|
|
2429
|
+
return this.rawData;
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
const af = w({
|
|
2433
|
+
version: g(),
|
|
2434
|
+
name: g(),
|
|
2435
|
+
css: m(g()),
|
|
2436
|
+
renderType: m(B([L(
|
|
2437
|
+
"COMPONENT"
|
|
2438
|
+
/* COMPONENT */
|
|
2439
|
+
), L(
|
|
2440
|
+
"PAGE"
|
|
2441
|
+
/* PAGE */
|
|
2442
|
+
)])),
|
|
2443
|
+
loadType: m(A()),
|
|
2444
|
+
lifecycle: m(A()),
|
|
2445
|
+
props: m(A()),
|
|
2446
|
+
methods: m(P(Wl)),
|
|
2447
|
+
componentsMeta: P(
|
|
2448
|
+
Cr(
|
|
2449
|
+
w({
|
|
2450
|
+
componentName: g()
|
|
2451
|
+
}),
|
|
2452
|
+
Er
|
|
2453
|
+
)
|
|
2454
|
+
),
|
|
2455
|
+
thirdLibs: m(Ll),
|
|
2456
|
+
componentsTree: ql,
|
|
2457
|
+
assets: m(P(A()))
|
|
2458
|
+
}), To = (t) => (xr({
|
|
2459
|
+
data: t,
|
|
2460
|
+
dataStruct: af,
|
|
2461
|
+
throwError: !1
|
|
2462
|
+
}), t), De = (t, e, r) => ({
|
|
2463
|
+
...t,
|
|
2464
|
+
componentsTree: new Zt(t.componentsTree, {
|
|
2465
|
+
parent: e,
|
|
2466
|
+
materials: r
|
|
2467
|
+
})
|
|
2468
|
+
});
|
|
2469
|
+
class he {
|
|
2470
|
+
constructor(e, r) {
|
|
2471
|
+
_(this, "nodeType", "PAGE"), _(this, "rawData"), _(this, "emitter", ne), _(this, "data"), _(this, "parent"), _(this, "materialsModel"), _(this, "assetPackagesList"), To(e), this.rawData = JSON.parse(JSON.stringify(e)), this.materialsModel = new pt((r == null ? void 0 : r.materials) || []), this.data = De(e, this, this.materialsModel), this.assetPackagesList = [...(r == null ? void 0 : r.assetPackagesList) || [], ...this.data.assets || []];
|
|
2472
|
+
}
|
|
2473
|
+
updatePage(e) {
|
|
2474
|
+
const r = this.data;
|
|
2475
|
+
this.rawData = JSON.parse(JSON.stringify(e)), this.data = De(e, this, this.materialsModel), this.emitter.emit("onPageChange", {
|
|
2476
|
+
value: this.data,
|
|
2477
|
+
preValue: r,
|
|
2478
|
+
node: this
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2481
|
+
reloadPage(e) {
|
|
2482
|
+
const r = this.data;
|
|
2483
|
+
e && (this.rawData = JSON.parse(JSON.stringify(e)), this.data = De(e, this, this.materialsModel)), this.emitter.emit("onReloadPage", {
|
|
2484
|
+
value: this.data,
|
|
2485
|
+
preValue: r,
|
|
2486
|
+
node: this
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
get value() {
|
|
2490
|
+
return this.data;
|
|
2491
|
+
}
|
|
2492
|
+
// moveNode(from, to, pos) {}
|
|
2493
|
+
getNode(e) {
|
|
2494
|
+
if (!e) return;
|
|
2495
|
+
const r = this.data.componentsTree;
|
|
2496
|
+
return Ar(r, e);
|
|
2497
|
+
}
|
|
2498
|
+
addNode(e, r, n = "AFTER") {
|
|
2499
|
+
var o;
|
|
2500
|
+
if (n === "AFTER" || n === "BEFORE") {
|
|
2501
|
+
const a = r.parent;
|
|
2502
|
+
if (a === null && r instanceof Zt)
|
|
2503
|
+
return console.warn("Not found parent node"), !1;
|
|
2504
|
+
if (a instanceof it)
|
|
2505
|
+
return console.warn("CProp can not add node"), !1;
|
|
2506
|
+
if (a instanceof wt) {
|
|
2507
|
+
const i = a.value.value, c = i.findIndex((u) => u === r) ?? -1;
|
|
2508
|
+
return c >= 0 ? (n === "BEFORE" ? i.splice(c, 0, e) : i.splice(c + 1, 0, e), e.parent = a, (o = a.parent) == null || o.updateValue(), !0) : !1;
|
|
2509
|
+
}
|
|
2510
|
+
if (a instanceof he)
|
|
2511
|
+
return !1;
|
|
2512
|
+
const s = (a == null ? void 0 : a.value.children.findIndex((i) => i === r)) ?? -1;
|
|
2513
|
+
return s >= 0 ? (n === "BEFORE" ? a == null || a.value.children.splice(s, 0, e) : a == null || a.value.children.splice(s + 1, 0, e), e.parent = a, a == null || a.updateValue(), !0) : (console.warn("Not found target node"), !1);
|
|
2514
|
+
}
|
|
2515
|
+
if (n === "CHILD_START")
|
|
2516
|
+
return r.value.children.unshift(e), e.parent = r, r.updateValue(), !0;
|
|
2517
|
+
if (n === "CHILD_END")
|
|
2518
|
+
return r.value.children.push(e), e.parent = r, r.updateValue(), !0;
|
|
2519
|
+
if (F(n)) {
|
|
2520
|
+
const a = n;
|
|
2521
|
+
if (a.type === "CHILD") {
|
|
2522
|
+
const s = a.pos, i = a.index || 0;
|
|
2523
|
+
return s === "BEFORE" ? r == null || r.value.children.splice(i, 0, e) : r == null || r.value.children.splice(i + 1, 0, e), e.parent = r, r.updateValue(), !0;
|
|
2524
|
+
} else
|
|
2525
|
+
console.warn("Can not parse pos obj");
|
|
2526
|
+
}
|
|
2527
|
+
return !1;
|
|
2528
|
+
}
|
|
2529
|
+
createNode(e) {
|
|
2530
|
+
return delete e.id, new M(e, {
|
|
2531
|
+
parent: null,
|
|
2532
|
+
materials: this.materialsModel
|
|
2533
|
+
});
|
|
2534
|
+
}
|
|
2535
|
+
addNodeById(e, r, n = "AFTER") {
|
|
2536
|
+
const o = this.getNode(r);
|
|
2537
|
+
return o ? this.addNode(e, o, n) : (console.warn(`Not find a node by ${r}, pls check it`), !1);
|
|
2538
|
+
}
|
|
2539
|
+
copyNode(e) {
|
|
2540
|
+
const r = e.export("design");
|
|
2541
|
+
r.id = tt();
|
|
2542
|
+
const n = new M(r, {
|
|
2543
|
+
parent: e.parent,
|
|
2544
|
+
materials: this.materialsModel
|
|
2545
|
+
});
|
|
2546
|
+
return this.addNode(n, e, "AFTER"), n;
|
|
2547
|
+
}
|
|
2548
|
+
copyNodeById(e) {
|
|
2549
|
+
const r = this.getNode(e);
|
|
2550
|
+
return r && r instanceof M ? this.copyNode(r) : !1;
|
|
2551
|
+
}
|
|
2552
|
+
moveNode(e, r, n) {
|
|
2553
|
+
this.deleteNode(e);
|
|
2554
|
+
let o = r;
|
|
2555
|
+
return ["AFTER", "BEFORE"].includes(n) && (o = r.parent), e.parent = o, this.addNode(e, r, n);
|
|
2556
|
+
}
|
|
2557
|
+
moveNodeById(e, r, n) {
|
|
2558
|
+
const o = this.getNode(e), a = this.getNode(r);
|
|
2559
|
+
return o && a && o instanceof M && a instanceof M ? this.moveNode(o, a, n) : !1;
|
|
2560
|
+
}
|
|
2561
|
+
// replaceNode(targetNode, node) {}
|
|
2562
|
+
deleteNode(e) {
|
|
2563
|
+
var r;
|
|
2564
|
+
const n = e.parent;
|
|
2565
|
+
if (!n)
|
|
2566
|
+
throw new Error("parent node is null or undefined, pls check it");
|
|
2567
|
+
if (n instanceof wt) {
|
|
2568
|
+
const o = n.value.value, a = o.findIndex((i) => i === e), s = o[a];
|
|
2569
|
+
return o.splice(a, 1), (r = n.parent) == null || r.updateValue(), s;
|
|
2570
|
+
}
|
|
2571
|
+
if (n instanceof M || n instanceof Zt) {
|
|
2572
|
+
const o = n.value.children, a = o.findIndex((i) => i === e), s = o[a];
|
|
2573
|
+
return o.splice(a, 1), n.updateValue(), s;
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
deleteNodeById(e) {
|
|
2577
|
+
const r = this.getNode(e);
|
|
2578
|
+
if (r)
|
|
2579
|
+
return this.deleteNode(r);
|
|
2580
|
+
}
|
|
2581
|
+
export(e = Nr.SAVE) {
|
|
2582
|
+
var r;
|
|
2583
|
+
const n = this.data.componentsTree.export(e), o = this.assetPackagesList, a = [], s = this.materialsModel.usedMaterials.map((c) => {
|
|
2584
|
+
const u = o.find((l) => {
|
|
2585
|
+
var p;
|
|
2586
|
+
return l.package === ((p = c.value.npm) == null ? void 0 : p.package);
|
|
2587
|
+
});
|
|
2588
|
+
return u && a.push(u), {
|
|
2589
|
+
componentName: c.componentName,
|
|
2590
|
+
...ho(c.value.npm || {})
|
|
2591
|
+
};
|
|
2592
|
+
}).filter((c) => c.componentName && c.package && c.version ? !0 : (console.warn(`${c} not a valid material info`), !1));
|
|
2593
|
+
this.materialsModel.usedMaterials = [];
|
|
2594
|
+
let i = {
|
|
2595
|
+
...this.data,
|
|
2596
|
+
componentsTree: Tr(n),
|
|
2597
|
+
componentsMeta: s,
|
|
2598
|
+
thirdLibs: this.data.thirdLibs,
|
|
2599
|
+
assets: []
|
|
2600
|
+
};
|
|
2601
|
+
return (r = this.data.thirdLibs) == null || r.forEach((c) => {
|
|
2602
|
+
const u = o.find((l) => c.package === l.package);
|
|
2603
|
+
u && a.push(u);
|
|
2604
|
+
}), i.assets = $l(a, (c) => c.package), i = jo(i, ["id"]), JSON.parse(JSON.stringify(i));
|
|
2605
|
+
}
|
|
2606
|
+
getRootNode() {
|
|
2607
|
+
return this.data.componentsTree;
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
Mt.ROOT_CONTAINER;
|
|
2611
|
+
var Ao = typeof global == "object" && global && global.Object === Object && global, sf = typeof self == "object" && self && self.Object === Object && self, Pt = Ao || sf || Function("return this")(), Ct = Pt.Symbol, Mo = Object.prototype, cf = Mo.hasOwnProperty, uf = Mo.toString, Vt = Ct ? Ct.toStringTag : void 0;
|
|
2612
|
+
function lf(t) {
|
|
2613
|
+
var e = cf.call(t, Vt), r = t[Vt];
|
|
2614
|
+
try {
|
|
2615
|
+
t[Vt] = void 0;
|
|
2616
|
+
var n = !0;
|
|
2617
|
+
} catch {
|
|
2618
|
+
}
|
|
2619
|
+
var o = uf.call(t);
|
|
2620
|
+
return n && (e ? t[Vt] = r : delete t[Vt]), o;
|
|
2621
|
+
}
|
|
2622
|
+
var ff = Object.prototype, pf = ff.toString;
|
|
2623
|
+
function df(t) {
|
|
2624
|
+
return pf.call(t);
|
|
2625
|
+
}
|
|
2626
|
+
var hf = "[object Null]", mf = "[object Undefined]", yn = Ct ? Ct.toStringTag : void 0;
|
|
2627
|
+
function oe(t) {
|
|
2628
|
+
return t == null ? t === void 0 ? mf : hf : yn && yn in Object(t) ? lf(t) : df(t);
|
|
2629
|
+
}
|
|
2630
|
+
function Rt(t) {
|
|
2631
|
+
return t != null && typeof t == "object";
|
|
2632
|
+
}
|
|
2633
|
+
var gf = "[object Symbol]";
|
|
2634
|
+
function vf(t) {
|
|
2635
|
+
return typeof t == "symbol" || Rt(t) && oe(t) == gf;
|
|
2636
|
+
}
|
|
2637
|
+
function yf(t, e) {
|
|
2638
|
+
for (var r = -1, n = t == null ? 0 : t.length, o = Array(n); ++r < n; )
|
|
2639
|
+
o[r] = e(t[r], r, t);
|
|
2640
|
+
return o;
|
|
2641
|
+
}
|
|
2642
|
+
var Et = Array.isArray, bf = 1 / 0, bn = Ct ? Ct.prototype : void 0, _n = bn ? bn.toString : void 0;
|
|
2643
|
+
function Po(t) {
|
|
2644
|
+
if (typeof t == "string")
|
|
2645
|
+
return t;
|
|
2646
|
+
if (Et(t))
|
|
2647
|
+
return yf(t, Po) + "";
|
|
2648
|
+
if (vf(t))
|
|
2649
|
+
return _n ? _n.call(t) : "";
|
|
2650
|
+
var e = t + "";
|
|
2651
|
+
return e == "0" && 1 / t == -bf ? "-0" : e;
|
|
2652
|
+
}
|
|
2653
|
+
function vt(t) {
|
|
2654
|
+
var e = typeof t;
|
|
2655
|
+
return t != null && (e == "object" || e == "function");
|
|
2656
|
+
}
|
|
2657
|
+
function Ro(t) {
|
|
2658
|
+
return t;
|
|
2659
|
+
}
|
|
2660
|
+
var _f = "[object AsyncFunction]", Sf = "[object Function]", jf = "[object GeneratorFunction]", Of = "[object Proxy]";
|
|
2661
|
+
function Mr(t) {
|
|
2662
|
+
if (!vt(t))
|
|
2663
|
+
return !1;
|
|
2664
|
+
var e = oe(t);
|
|
2665
|
+
return e == Sf || e == jf || e == _f || e == Of;
|
|
2666
|
+
}
|
|
2667
|
+
var Le = Pt["__core-js_shared__"], Sn = function() {
|
|
2668
|
+
var t = /[^.]+$/.exec(Le && Le.keys && Le.keys.IE_PROTO || "");
|
|
2669
|
+
return t ? "Symbol(src)_1." + t : "";
|
|
2670
|
+
}();
|
|
2671
|
+
function wf(t) {
|
|
2672
|
+
return !!Sn && Sn in t;
|
|
2673
|
+
}
|
|
2674
|
+
var Cf = Function.prototype, Ef = Cf.toString;
|
|
2675
|
+
function Nf(t) {
|
|
2676
|
+
if (t != null) {
|
|
2677
|
+
try {
|
|
2678
|
+
return Ef.call(t);
|
|
2679
|
+
} catch {
|
|
2680
|
+
}
|
|
2681
|
+
try {
|
|
2682
|
+
return t + "";
|
|
2683
|
+
} catch {
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
return "";
|
|
2687
|
+
}
|
|
2688
|
+
var $f = /[\\^$.*+?()[\]{}|]/g, xf = /^\[object .+?Constructor\]$/, Tf = Function.prototype, Af = Object.prototype, Mf = Tf.toString, Pf = Af.hasOwnProperty, Rf = RegExp(
|
|
2689
|
+
"^" + Mf.call(Pf).replace($f, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2690
|
+
);
|
|
2691
|
+
function If(t) {
|
|
2692
|
+
if (!vt(t) || wf(t))
|
|
2693
|
+
return !1;
|
|
2694
|
+
var e = Mr(t) ? Rf : xf;
|
|
2695
|
+
return e.test(Nf(t));
|
|
2696
|
+
}
|
|
2697
|
+
function Df(t, e) {
|
|
2698
|
+
return t == null ? void 0 : t[e];
|
|
2699
|
+
}
|
|
2700
|
+
function Pr(t, e) {
|
|
2701
|
+
var r = Df(t, e);
|
|
2702
|
+
return If(r) ? r : void 0;
|
|
2703
|
+
}
|
|
2704
|
+
var jn = Object.create, Lf = /* @__PURE__ */ function() {
|
|
2705
|
+
function t() {
|
|
2706
|
+
}
|
|
2707
|
+
return function(e) {
|
|
2708
|
+
if (!vt(e))
|
|
2709
|
+
return {};
|
|
2710
|
+
if (jn)
|
|
2711
|
+
return jn(e);
|
|
2712
|
+
t.prototype = e;
|
|
2713
|
+
var r = new t();
|
|
2714
|
+
return t.prototype = void 0, r;
|
|
2715
|
+
};
|
|
2716
|
+
}();
|
|
2717
|
+
function Bf(t, e, r) {
|
|
2718
|
+
switch (r.length) {
|
|
2719
|
+
case 0:
|
|
2720
|
+
return t.call(e);
|
|
2721
|
+
case 1:
|
|
2722
|
+
return t.call(e, r[0]);
|
|
2723
|
+
case 2:
|
|
2724
|
+
return t.call(e, r[0], r[1]);
|
|
2725
|
+
case 3:
|
|
2726
|
+
return t.call(e, r[0], r[1], r[2]);
|
|
2727
|
+
}
|
|
2728
|
+
return t.apply(e, r);
|
|
2729
|
+
}
|
|
2730
|
+
function Ff(t, e) {
|
|
2731
|
+
var r = -1, n = t.length;
|
|
2732
|
+
for (e || (e = Array(n)); ++r < n; )
|
|
2733
|
+
e[r] = t[r];
|
|
2734
|
+
return e;
|
|
2735
|
+
}
|
|
2736
|
+
var kf = 800, Uf = 16, Vf = Date.now;
|
|
2737
|
+
function Gf(t) {
|
|
2738
|
+
var e = 0, r = 0;
|
|
2739
|
+
return function() {
|
|
2740
|
+
var n = Vf(), o = Uf - (n - r);
|
|
2741
|
+
if (r = n, o > 0) {
|
|
2742
|
+
if (++e >= kf)
|
|
2743
|
+
return arguments[0];
|
|
2744
|
+
} else
|
|
2745
|
+
e = 0;
|
|
2746
|
+
return t.apply(void 0, arguments);
|
|
2747
|
+
};
|
|
2748
|
+
}
|
|
2749
|
+
function zf(t) {
|
|
2750
|
+
return function() {
|
|
2751
|
+
return t;
|
|
2752
|
+
};
|
|
2753
|
+
}
|
|
2754
|
+
var me = function() {
|
|
2755
|
+
try {
|
|
2756
|
+
var t = Pr(Object, "defineProperty");
|
|
2757
|
+
return t({}, "", {}), t;
|
|
2758
|
+
} catch {
|
|
2759
|
+
}
|
|
2760
|
+
}(), Hf = me ? function(t, e) {
|
|
2761
|
+
return me(t, "toString", {
|
|
2762
|
+
configurable: !0,
|
|
2763
|
+
enumerable: !1,
|
|
2764
|
+
value: zf(e),
|
|
2765
|
+
writable: !0
|
|
2766
|
+
});
|
|
2767
|
+
} : Ro, Jf = Gf(Hf), Wf = 9007199254740991, qf = /^(?:0|[1-9]\d*)$/;
|
|
2768
|
+
function Io(t, e) {
|
|
2769
|
+
var r = typeof t;
|
|
2770
|
+
return e = e ?? Wf, !!e && (r == "number" || r != "symbol" && qf.test(t)) && t > -1 && t % 1 == 0 && t < e;
|
|
2771
|
+
}
|
|
2772
|
+
function Rr(t, e, r) {
|
|
2773
|
+
e == "__proto__" && me ? me(t, e, {
|
|
2774
|
+
configurable: !0,
|
|
2775
|
+
enumerable: !0,
|
|
2776
|
+
value: r,
|
|
2777
|
+
writable: !0
|
|
2778
|
+
}) : t[e] = r;
|
|
2779
|
+
}
|
|
2780
|
+
function Oe(t, e) {
|
|
2781
|
+
return t === e || t !== t && e !== e;
|
|
2782
|
+
}
|
|
2783
|
+
var Qf = Object.prototype, Yf = Qf.hasOwnProperty;
|
|
2784
|
+
function Xf(t, e, r) {
|
|
2785
|
+
var n = t[e];
|
|
2786
|
+
(!(Yf.call(t, e) && Oe(n, r)) || r === void 0 && !(e in t)) && Rr(t, e, r);
|
|
2787
|
+
}
|
|
2788
|
+
function Kf(t, e, r, n) {
|
|
2789
|
+
var o = !r;
|
|
2790
|
+
r || (r = {});
|
|
2791
|
+
for (var a = -1, s = e.length; ++a < s; ) {
|
|
2792
|
+
var i = e[a], c = void 0;
|
|
2793
|
+
c === void 0 && (c = t[i]), o ? Rr(r, i, c) : Xf(r, i, c);
|
|
2794
|
+
}
|
|
2795
|
+
return r;
|
|
2796
|
+
}
|
|
2797
|
+
var On = Math.max;
|
|
2798
|
+
function Zf(t, e, r) {
|
|
2799
|
+
return e = On(e === void 0 ? t.length - 1 : e, 0), function() {
|
|
2800
|
+
for (var n = arguments, o = -1, a = On(n.length - e, 0), s = Array(a); ++o < a; )
|
|
2801
|
+
s[o] = n[e + o];
|
|
2802
|
+
o = -1;
|
|
2803
|
+
for (var i = Array(e + 1); ++o < e; )
|
|
2804
|
+
i[o] = n[o];
|
|
2805
|
+
return i[e] = r(s), Bf(t, this, i);
|
|
2806
|
+
};
|
|
2807
|
+
}
|
|
2808
|
+
function tp(t, e) {
|
|
2809
|
+
return Jf(Zf(t, e, Ro), t + "");
|
|
2810
|
+
}
|
|
2811
|
+
var ep = 9007199254740991;
|
|
2812
|
+
function Do(t) {
|
|
2813
|
+
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= ep;
|
|
2814
|
+
}
|
|
2815
|
+
function Ir(t) {
|
|
2816
|
+
return t != null && Do(t.length) && !Mr(t);
|
|
2817
|
+
}
|
|
2818
|
+
function rp(t, e, r) {
|
|
2819
|
+
if (!vt(r))
|
|
2820
|
+
return !1;
|
|
2821
|
+
var n = typeof e;
|
|
2822
|
+
return (n == "number" ? Ir(r) && Io(e, r.length) : n == "string" && e in r) ? Oe(r[e], t) : !1;
|
|
2823
|
+
}
|
|
2824
|
+
function np(t) {
|
|
2825
|
+
return tp(function(e, r) {
|
|
2826
|
+
var n = -1, o = r.length, a = o > 1 ? r[o - 1] : void 0, s = o > 2 ? r[2] : void 0;
|
|
2827
|
+
for (a = t.length > 3 && typeof a == "function" ? (o--, a) : void 0, s && rp(r[0], r[1], s) && (a = o < 3 ? void 0 : a, o = 1), e = Object(e); ++n < o; ) {
|
|
2828
|
+
var i = r[n];
|
|
2829
|
+
i && t(e, i, n, a);
|
|
2830
|
+
}
|
|
2831
|
+
return e;
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
var op = Object.prototype;
|
|
2835
|
+
function Lo(t) {
|
|
2836
|
+
var e = t && t.constructor, r = typeof e == "function" && e.prototype || op;
|
|
2837
|
+
return t === r;
|
|
2838
|
+
}
|
|
2839
|
+
function ap(t, e) {
|
|
2840
|
+
for (var r = -1, n = Array(t); ++r < t; )
|
|
2841
|
+
n[r] = e(r);
|
|
2842
|
+
return n;
|
|
2843
|
+
}
|
|
2844
|
+
var ip = "[object Arguments]";
|
|
2845
|
+
function wn(t) {
|
|
2846
|
+
return Rt(t) && oe(t) == ip;
|
|
2847
|
+
}
|
|
2848
|
+
var Bo = Object.prototype, sp = Bo.hasOwnProperty, cp = Bo.propertyIsEnumerable, Ze = wn(/* @__PURE__ */ function() {
|
|
2849
|
+
return arguments;
|
|
2850
|
+
}()) ? wn : function(t) {
|
|
2851
|
+
return Rt(t) && sp.call(t, "callee") && !cp.call(t, "callee");
|
|
2852
|
+
};
|
|
2853
|
+
function up() {
|
|
2854
|
+
return !1;
|
|
2855
|
+
}
|
|
2856
|
+
var Fo = typeof exports == "object" && exports && !exports.nodeType && exports, Cn = Fo && typeof module == "object" && module && !module.nodeType && module, lp = Cn && Cn.exports === Fo, En = lp ? Pt.Buffer : void 0, fp = En ? En.isBuffer : void 0, ko = fp || up, pp = "[object Arguments]", dp = "[object Array]", hp = "[object Boolean]", mp = "[object Date]", gp = "[object Error]", vp = "[object Function]", yp = "[object Map]", bp = "[object Number]", _p = "[object Object]", Sp = "[object RegExp]", jp = "[object Set]", Op = "[object String]", wp = "[object WeakMap]", Cp = "[object ArrayBuffer]", Ep = "[object DataView]", Np = "[object Float32Array]", $p = "[object Float64Array]", xp = "[object Int8Array]", Tp = "[object Int16Array]", Ap = "[object Int32Array]", Mp = "[object Uint8Array]", Pp = "[object Uint8ClampedArray]", Rp = "[object Uint16Array]", Ip = "[object Uint32Array]", T = {};
|
|
2857
|
+
T[Np] = T[$p] = T[xp] = T[Tp] = T[Ap] = T[Mp] = T[Pp] = T[Rp] = T[Ip] = !0;
|
|
2858
|
+
T[pp] = T[dp] = T[Cp] = T[hp] = T[Ep] = T[mp] = T[gp] = T[vp] = T[yp] = T[bp] = T[_p] = T[Sp] = T[jp] = T[Op] = T[wp] = !1;
|
|
2859
|
+
function Dp(t) {
|
|
2860
|
+
return Rt(t) && Do(t.length) && !!T[oe(t)];
|
|
2861
|
+
}
|
|
2862
|
+
function Lp(t) {
|
|
2863
|
+
return function(e) {
|
|
2864
|
+
return t(e);
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
var Uo = typeof exports == "object" && exports && !exports.nodeType && exports, Wt = Uo && typeof module == "object" && module && !module.nodeType && module, Bp = Wt && Wt.exports === Uo, Be = Bp && Ao.process, Nn = function() {
|
|
2868
|
+
try {
|
|
2869
|
+
var t = Wt && Wt.require && Wt.require("util").types;
|
|
2870
|
+
return t || Be && Be.binding && Be.binding("util");
|
|
2871
|
+
} catch {
|
|
2872
|
+
}
|
|
2873
|
+
}(), $n = Nn && Nn.isTypedArray, Vo = $n ? Lp($n) : Dp;
|
|
2874
|
+
function Fp(t, e) {
|
|
2875
|
+
var r = Et(t), n = !r && Ze(t), o = !r && !n && ko(t), a = !r && !n && !o && Vo(t), s = r || n || o || a, i = s ? ap(t.length, String) : [], c = i.length;
|
|
2876
|
+
for (var u in t)
|
|
2877
|
+
s && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2878
|
+
(u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
2879
|
+
o && (u == "offset" || u == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
2880
|
+
a && (u == "buffer" || u == "byteLength" || u == "byteOffset") || // Skip index properties.
|
|
2881
|
+
Io(u, c)) || i.push(u);
|
|
2882
|
+
return i;
|
|
2883
|
+
}
|
|
2884
|
+
function kp(t, e) {
|
|
2885
|
+
return function(r) {
|
|
2886
|
+
return t(e(r));
|
|
2887
|
+
};
|
|
2888
|
+
}
|
|
2889
|
+
function Up(t) {
|
|
2890
|
+
var e = [];
|
|
2891
|
+
if (t != null)
|
|
2892
|
+
for (var r in Object(t))
|
|
2893
|
+
e.push(r);
|
|
2894
|
+
return e;
|
|
2895
|
+
}
|
|
2896
|
+
var Vp = Object.prototype, Gp = Vp.hasOwnProperty;
|
|
2897
|
+
function zp(t) {
|
|
2898
|
+
if (!vt(t))
|
|
2899
|
+
return Up(t);
|
|
2900
|
+
var e = Lo(t), r = [];
|
|
2901
|
+
for (var n in t)
|
|
2902
|
+
n == "constructor" && (e || !Gp.call(t, n)) || r.push(n);
|
|
2903
|
+
return r;
|
|
2904
|
+
}
|
|
2905
|
+
function Go(t) {
|
|
2906
|
+
return Ir(t) ? Fp(t) : zp(t);
|
|
2907
|
+
}
|
|
2908
|
+
var te = Pr(Object, "create");
|
|
2909
|
+
function Hp() {
|
|
2910
|
+
this.__data__ = te ? te(null) : {}, this.size = 0;
|
|
2911
|
+
}
|
|
2912
|
+
function Jp(t) {
|
|
2913
|
+
var e = this.has(t) && delete this.__data__[t];
|
|
2914
|
+
return this.size -= e ? 1 : 0, e;
|
|
2915
|
+
}
|
|
2916
|
+
var Wp = "__lodash_hash_undefined__", qp = Object.prototype, Qp = qp.hasOwnProperty;
|
|
2917
|
+
function Yp(t) {
|
|
2918
|
+
var e = this.__data__;
|
|
2919
|
+
if (te) {
|
|
2920
|
+
var r = e[t];
|
|
2921
|
+
return r === Wp ? void 0 : r;
|
|
2922
|
+
}
|
|
2923
|
+
return Qp.call(e, t) ? e[t] : void 0;
|
|
2924
|
+
}
|
|
2925
|
+
var Xp = Object.prototype, Kp = Xp.hasOwnProperty;
|
|
2926
|
+
function Zp(t) {
|
|
2927
|
+
var e = this.__data__;
|
|
2928
|
+
return te ? e[t] !== void 0 : Kp.call(e, t);
|
|
2929
|
+
}
|
|
2930
|
+
var td = "__lodash_hash_undefined__";
|
|
2931
|
+
function ed(t, e) {
|
|
2932
|
+
var r = this.__data__;
|
|
2933
|
+
return this.size += this.has(t) ? 0 : 1, r[t] = te && e === void 0 ? td : e, this;
|
|
2934
|
+
}
|
|
2935
|
+
function dt(t) {
|
|
2936
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
2937
|
+
for (this.clear(); ++e < r; ) {
|
|
2938
|
+
var n = t[e];
|
|
2939
|
+
this.set(n[0], n[1]);
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
dt.prototype.clear = Hp;
|
|
2943
|
+
dt.prototype.delete = Jp;
|
|
2944
|
+
dt.prototype.get = Yp;
|
|
2945
|
+
dt.prototype.has = Zp;
|
|
2946
|
+
dt.prototype.set = ed;
|
|
2947
|
+
function rd() {
|
|
2948
|
+
this.__data__ = [], this.size = 0;
|
|
2949
|
+
}
|
|
2950
|
+
function we(t, e) {
|
|
2951
|
+
for (var r = t.length; r--; )
|
|
2952
|
+
if (Oe(t[r][0], e))
|
|
2953
|
+
return r;
|
|
2954
|
+
return -1;
|
|
2955
|
+
}
|
|
2956
|
+
var nd = Array.prototype, od = nd.splice;
|
|
2957
|
+
function ad(t) {
|
|
2958
|
+
var e = this.__data__, r = we(e, t);
|
|
2959
|
+
if (r < 0)
|
|
2960
|
+
return !1;
|
|
2961
|
+
var n = e.length - 1;
|
|
2962
|
+
return r == n ? e.pop() : od.call(e, r, 1), --this.size, !0;
|
|
2963
|
+
}
|
|
2964
|
+
function id(t) {
|
|
2965
|
+
var e = this.__data__, r = we(e, t);
|
|
2966
|
+
return r < 0 ? void 0 : e[r][1];
|
|
2967
|
+
}
|
|
2968
|
+
function sd(t) {
|
|
2969
|
+
return we(this.__data__, t) > -1;
|
|
2970
|
+
}
|
|
2971
|
+
function cd(t, e) {
|
|
2972
|
+
var r = this.__data__, n = we(r, t);
|
|
2973
|
+
return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
|
|
2974
|
+
}
|
|
2975
|
+
function nt(t) {
|
|
2976
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
2977
|
+
for (this.clear(); ++e < r; ) {
|
|
2978
|
+
var n = t[e];
|
|
2979
|
+
this.set(n[0], n[1]);
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
nt.prototype.clear = rd;
|
|
2983
|
+
nt.prototype.delete = ad;
|
|
2984
|
+
nt.prototype.get = id;
|
|
2985
|
+
nt.prototype.has = sd;
|
|
2986
|
+
nt.prototype.set = cd;
|
|
2987
|
+
var zo = Pr(Pt, "Map");
|
|
2988
|
+
function ud() {
|
|
2989
|
+
this.size = 0, this.__data__ = {
|
|
2990
|
+
hash: new dt(),
|
|
2991
|
+
map: new (zo || nt)(),
|
|
2992
|
+
string: new dt()
|
|
2993
|
+
};
|
|
2994
|
+
}
|
|
2995
|
+
function ld(t) {
|
|
2996
|
+
var e = typeof t;
|
|
2997
|
+
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
2998
|
+
}
|
|
2999
|
+
function Ce(t, e) {
|
|
3000
|
+
var r = t.__data__;
|
|
3001
|
+
return ld(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
|
|
3002
|
+
}
|
|
3003
|
+
function fd(t) {
|
|
3004
|
+
var e = Ce(this, t).delete(t);
|
|
3005
|
+
return this.size -= e ? 1 : 0, e;
|
|
3006
|
+
}
|
|
3007
|
+
function pd(t) {
|
|
3008
|
+
return Ce(this, t).get(t);
|
|
3009
|
+
}
|
|
3010
|
+
function dd(t) {
|
|
3011
|
+
return Ce(this, t).has(t);
|
|
3012
|
+
}
|
|
3013
|
+
function hd(t, e) {
|
|
3014
|
+
var r = Ce(this, t), n = r.size;
|
|
3015
|
+
return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
|
|
3016
|
+
}
|
|
3017
|
+
function It(t) {
|
|
3018
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
3019
|
+
for (this.clear(); ++e < r; ) {
|
|
3020
|
+
var n = t[e];
|
|
3021
|
+
this.set(n[0], n[1]);
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
It.prototype.clear = ud;
|
|
3025
|
+
It.prototype.delete = fd;
|
|
3026
|
+
It.prototype.get = pd;
|
|
3027
|
+
It.prototype.has = dd;
|
|
3028
|
+
It.prototype.set = hd;
|
|
3029
|
+
function Ho(t) {
|
|
3030
|
+
return t == null ? "" : Po(t);
|
|
3031
|
+
}
|
|
3032
|
+
var Jo = kp(Object.getPrototypeOf, Object), md = "[object Object]", gd = Function.prototype, vd = Object.prototype, Wo = gd.toString, yd = vd.hasOwnProperty, bd = Wo.call(Object);
|
|
3033
|
+
function Nt(t) {
|
|
3034
|
+
if (!Rt(t) || oe(t) != md)
|
|
3035
|
+
return !1;
|
|
3036
|
+
var e = Jo(t);
|
|
3037
|
+
if (e === null)
|
|
3038
|
+
return !0;
|
|
3039
|
+
var r = yd.call(e, "constructor") && e.constructor;
|
|
3040
|
+
return typeof r == "function" && r instanceof r && Wo.call(r) == bd;
|
|
3041
|
+
}
|
|
3042
|
+
function _d(t, e, r) {
|
|
3043
|
+
var n = -1, o = t.length;
|
|
3044
|
+
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;
|
|
3045
|
+
for (var a = Array(o); ++n < o; )
|
|
3046
|
+
a[n] = t[n + e];
|
|
3047
|
+
return a;
|
|
3048
|
+
}
|
|
3049
|
+
function Sd(t, e, r) {
|
|
3050
|
+
var n = t.length;
|
|
3051
|
+
return r = r === void 0 ? n : r, !e && r >= n ? t : _d(t, e, r);
|
|
3052
|
+
}
|
|
3053
|
+
var jd = "\\ud800-\\udfff", Od = "\\u0300-\\u036f", wd = "\\ufe20-\\ufe2f", Cd = "\\u20d0-\\u20ff", Ed = Od + wd + Cd, Nd = "\\ufe0e\\ufe0f", $d = "\\u200d", xd = RegExp("[" + $d + jd + Ed + Nd + "]");
|
|
3054
|
+
function qo(t) {
|
|
3055
|
+
return xd.test(t);
|
|
3056
|
+
}
|
|
3057
|
+
function Td(t) {
|
|
3058
|
+
return t.split("");
|
|
3059
|
+
}
|
|
3060
|
+
var Qo = "\\ud800-\\udfff", Ad = "\\u0300-\\u036f", Md = "\\ufe20-\\ufe2f", Pd = "\\u20d0-\\u20ff", Rd = Ad + Md + Pd, Id = "\\ufe0e\\ufe0f", Dd = "[" + Qo + "]", tr = "[" + Rd + "]", er = "\\ud83c[\\udffb-\\udfff]", Ld = "(?:" + tr + "|" + er + ")", Yo = "[^" + Qo + "]", Xo = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ko = "[\\ud800-\\udbff][\\udc00-\\udfff]", Bd = "\\u200d", Zo = Ld + "?", ta = "[" + Id + "]?", Fd = "(?:" + Bd + "(?:" + [Yo, Xo, Ko].join("|") + ")" + ta + Zo + ")*", kd = ta + Zo + Fd, Ud = "(?:" + [Yo + tr + "?", tr, Xo, Ko, Dd].join("|") + ")", Vd = RegExp(er + "(?=" + er + ")|" + Ud + kd, "g");
|
|
3061
|
+
function Gd(t) {
|
|
3062
|
+
return t.match(Vd) || [];
|
|
3063
|
+
}
|
|
3064
|
+
function zd(t) {
|
|
3065
|
+
return qo(t) ? Gd(t) : Td(t);
|
|
3066
|
+
}
|
|
3067
|
+
function Hd(t) {
|
|
3068
|
+
return function(e) {
|
|
3069
|
+
e = Ho(e);
|
|
3070
|
+
var r = qo(e) ? zd(e) : void 0, n = r ? r[0] : e.charAt(0), o = r ? Sd(r, 1).join("") : e.slice(1);
|
|
3071
|
+
return n[t]() + o;
|
|
3072
|
+
};
|
|
3073
|
+
}
|
|
3074
|
+
var Jd = Hd("toUpperCase");
|
|
3075
|
+
function Wd(t) {
|
|
3076
|
+
return Jd(Ho(t).toLowerCase());
|
|
3077
|
+
}
|
|
3078
|
+
function qd() {
|
|
3079
|
+
this.__data__ = new nt(), this.size = 0;
|
|
3080
|
+
}
|
|
3081
|
+
function Qd(t) {
|
|
3082
|
+
var e = this.__data__, r = e.delete(t);
|
|
3083
|
+
return this.size = e.size, r;
|
|
3084
|
+
}
|
|
3085
|
+
function Yd(t) {
|
|
3086
|
+
return this.__data__.get(t);
|
|
3087
|
+
}
|
|
3088
|
+
function Xd(t) {
|
|
3089
|
+
return this.__data__.has(t);
|
|
3090
|
+
}
|
|
3091
|
+
var Kd = 200;
|
|
3092
|
+
function Zd(t, e) {
|
|
3093
|
+
var r = this.__data__;
|
|
3094
|
+
if (r instanceof nt) {
|
|
3095
|
+
var n = r.__data__;
|
|
3096
|
+
if (!zo || n.length < Kd - 1)
|
|
3097
|
+
return n.push([t, e]), this.size = ++r.size, this;
|
|
3098
|
+
r = this.__data__ = new It(n);
|
|
3099
|
+
}
|
|
3100
|
+
return r.set(t, e), this.size = r.size, this;
|
|
3101
|
+
}
|
|
3102
|
+
function Dt(t) {
|
|
3103
|
+
var e = this.__data__ = new nt(t);
|
|
3104
|
+
this.size = e.size;
|
|
3105
|
+
}
|
|
3106
|
+
Dt.prototype.clear = qd;
|
|
3107
|
+
Dt.prototype.delete = Qd;
|
|
3108
|
+
Dt.prototype.get = Yd;
|
|
3109
|
+
Dt.prototype.has = Xd;
|
|
3110
|
+
Dt.prototype.set = Zd;
|
|
3111
|
+
var ea = typeof exports == "object" && exports && !exports.nodeType && exports, xn = ea && typeof module == "object" && module && !module.nodeType && module, th = xn && xn.exports === ea, Tn = th ? Pt.Buffer : void 0;
|
|
3112
|
+
Tn && Tn.allocUnsafe;
|
|
3113
|
+
function eh(t, e) {
|
|
3114
|
+
return t.slice();
|
|
3115
|
+
}
|
|
3116
|
+
var An = Pt.Uint8Array;
|
|
3117
|
+
function rh(t) {
|
|
3118
|
+
var e = new t.constructor(t.byteLength);
|
|
3119
|
+
return new An(e).set(new An(t)), e;
|
|
3120
|
+
}
|
|
3121
|
+
function nh(t, e) {
|
|
3122
|
+
var r = rh(t.buffer);
|
|
3123
|
+
return new t.constructor(r, t.byteOffset, t.length);
|
|
3124
|
+
}
|
|
3125
|
+
function oh(t) {
|
|
3126
|
+
return typeof t.constructor == "function" && !Lo(t) ? Lf(Jo(t)) : {};
|
|
3127
|
+
}
|
|
3128
|
+
function ah(t) {
|
|
3129
|
+
return function(e, r, n) {
|
|
3130
|
+
for (var o = -1, a = Object(e), s = n(e), i = s.length; i--; ) {
|
|
3131
|
+
var c = s[++o];
|
|
3132
|
+
if (r(a[c], c, a) === !1)
|
|
3133
|
+
break;
|
|
3134
|
+
}
|
|
3135
|
+
return e;
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3138
|
+
var ih = ah();
|
|
3139
|
+
function rr(t, e, r) {
|
|
3140
|
+
(r !== void 0 && !Oe(t[e], r) || r === void 0 && !(e in t)) && Rr(t, e, r);
|
|
3141
|
+
}
|
|
3142
|
+
function sh(t) {
|
|
3143
|
+
return Rt(t) && Ir(t);
|
|
3144
|
+
}
|
|
3145
|
+
function nr(t, e) {
|
|
3146
|
+
if (!(e === "constructor" && typeof t[e] == "function") && e != "__proto__")
|
|
3147
|
+
return t[e];
|
|
3148
|
+
}
|
|
3149
|
+
function ch(t) {
|
|
3150
|
+
return Kf(t, Go(t));
|
|
3151
|
+
}
|
|
3152
|
+
function uh(t, e, r, n, o, a, s) {
|
|
3153
|
+
var i = nr(t, r), c = nr(e, r), u = s.get(c);
|
|
3154
|
+
if (u) {
|
|
3155
|
+
rr(t, r, u);
|
|
3156
|
+
return;
|
|
3157
|
+
}
|
|
3158
|
+
var l = a ? a(i, c, r + "", t, e, s) : void 0, p = l === void 0;
|
|
3159
|
+
if (p) {
|
|
3160
|
+
var f = Et(c), d = !f && ko(c), h = !f && !d && Vo(c);
|
|
3161
|
+
l = c, f || d || h ? Et(i) ? l = i : sh(i) ? l = Ff(i) : d ? (p = !1, l = eh(c)) : h ? (p = !1, l = nh(c)) : l = [] : Nt(c) || Ze(c) ? (l = i, Ze(i) ? l = ch(i) : (!vt(i) || Mr(i)) && (l = oh(c))) : p = !1;
|
|
3162
|
+
}
|
|
3163
|
+
p && (s.set(c, l), o(l, c, n, a, s), s.delete(c)), rr(t, r, l);
|
|
3164
|
+
}
|
|
3165
|
+
function ra(t, e, r, n, o) {
|
|
3166
|
+
t !== e && ih(e, function(a, s) {
|
|
3167
|
+
if (o || (o = new Dt()), vt(a))
|
|
3168
|
+
uh(t, e, s, r, ra, n, o);
|
|
3169
|
+
else {
|
|
3170
|
+
var i = n ? n(nr(t, s), a, s + "", t, e, o) : void 0;
|
|
3171
|
+
i === void 0 && (i = a), rr(t, s, i);
|
|
3172
|
+
}
|
|
3173
|
+
}, Go);
|
|
3174
|
+
}
|
|
3175
|
+
var lh = np(function(t, e, r) {
|
|
3176
|
+
ra(t, e, r);
|
|
3177
|
+
});
|
|
3178
|
+
const Qh = function(t) {
|
|
3179
|
+
return !(!t || typeof t != "function" || !t.prototype);
|
|
3180
|
+
};
|
|
3181
|
+
function fh(t) {
|
|
3182
|
+
const e = t == null ? void 0 : t.prototype;
|
|
3183
|
+
return !!(e && e.isReactComponent);
|
|
3184
|
+
}
|
|
3185
|
+
function ph(t) {
|
|
3186
|
+
var n, o;
|
|
3187
|
+
const r = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.forward_ref") : 60112;
|
|
3188
|
+
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;
|
|
3189
|
+
}
|
|
3190
|
+
function dh(t) {
|
|
3191
|
+
class e extends fa {
|
|
3192
|
+
render() {
|
|
3193
|
+
return pa(t, this.props);
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
return e.displayName = t.displayName, e;
|
|
3197
|
+
}
|
|
3198
|
+
const bt = (t, e) => {
|
|
3199
|
+
const r = (n) => {
|
|
3200
|
+
const a = `
|
|
3201
|
+
${Object.keys(e).map((s) => `const ${s} = $$context['${s}'];`).join(`
|
|
8
3202
|
`)}
|
|
9
3203
|
return ${n};
|
|
10
|
-
`;
|
|
3204
|
+
`;
|
|
3205
|
+
return new Function("$$context", a)(e);
|
|
3206
|
+
};
|
|
3207
|
+
try {
|
|
3208
|
+
return r(t);
|
|
3209
|
+
} catch (n) {
|
|
3210
|
+
console.warn(n);
|
|
3211
|
+
const o = `[${t}] expression run failed`;
|
|
3212
|
+
return console.warn(o), null;
|
|
3213
|
+
}
|
|
3214
|
+
}, hh = (t, e, r) => function(...o) {
|
|
3215
|
+
let a;
|
|
3216
|
+
try {
|
|
3217
|
+
a = `
|
|
11
3218
|
var $$$__args__$$$ = Array.from(arguments);
|
|
12
3219
|
function $$_run_$$() {
|
|
13
|
-
var $$_f_$$ = ${t||"function () {}"};
|
|
3220
|
+
var $$_f_$$ = ${t || "function () {}"};
|
|
14
3221
|
var __$$storeManager__ = $$$__args__$$$.pop();
|
|
15
3222
|
var $$context = $$$__args__$$$.pop();
|
|
16
3223
|
$$context.stateManager = __$$storeManager__.getStateSnapshot();
|
|
17
3224
|
return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
|
|
18
3225
|
}
|
|
19
3226
|
return $$_run_$$();
|
|
20
|
-
`,new Function(a)(...o,e,r)}catch(i){console.log(a),console.warn(i)}},nr=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},or=(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?Zh(i):i)),e[a.join("")]=n}),e},Sm=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},jm=(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},Om=(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},ra=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},na=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},Cm=(t,e)=>na(t,e),wm=(t,e)=>na(t,e),le=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},oa=(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`)},ue="DYNAMIC",$m=["$$context","$$nodeModel"],Dn=t=>{let e;const r=new Set,n=(f,p)=>{const l=typeof f=="function"?f(e):f;if(!Object.is(l,e)){const d=e;e=p??(typeof l!="object"||l===null)?l:Object.assign({},e,l),r.forEach(h=>h(e,d))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>u,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{r.clear()}},u=e=t(n,o,c);return c},Em=t=>t?Dn(t):Dn;class Nm{constructor(){y(this,"storeMap",new Map)}addStore(e,r){const n=Em(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 Tm{constructor(){y(this,"varSpace",new Map)}get(e){return this.varSpace.get(e)}add(e,r){this.varSpace.set(e,r)}remove(e){this.varSpace.delete(e)}destroy(){this.varSpace.clear()}getStateSnapshot(){const e={};return this.varSpace.forEach((r,n)=>{e[n]=r}),e}}class aa{constructor(){y(this,"renderMode","normal");y(this,"components",{});y(this,"storeManager",new Nm);y(this,"variableManager",new Tm);y(this,"runtimeComponentCache",new Map);y(this,"onGetRef");y(this,"onGetComponent");y(this,"onComponentMount");y(this,"onComponentDestroy");y(this,"processNodeConfigHook")}getComponent(e){var o;const r=e.value.componentName;let n=oa(r,this.components);return Zo(n)||(n=ta(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}getContext(e={},r){let n=e;return r&&(n={...e},n.__proto__=r||null),n}pageRender(e,{components:r,onGetRef:n,$$context:o={},onGetComponent:a,onComponentMount:i,onComponentDestroy:s,renderMode:c,processNodeConfigHook:u}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=a,this.onComponentMount=i,this.onComponentDestroy=s,this.processNodeConfigHook=u;const f=e.value.componentsTree,p=this.getComponent(f),l=this.convertModelToComponent(p,e.value.componentsTree),d={},h=f.props;return Object.keys(h).forEach(v=>{d[v]=h[v].value}),d.$$context=o,this.render(l,d)}transformProps(e={},{$$context:r}){const n=e,o=i=>{if(Array.isArray(i))return i.map(s=>o(s));if(De(i))return o(i.value);if(Vf(i)){const s=i.value,c=s.value;if(!c)return console.warn("slot value is null, this maybe cause some error, pls check it",e),()=>{};const u=f=>{const p=`${f.id}-${ue}`;if(this.runtimeComponentCache.get(f.id))return{key:p,component:this.runtimeComponentCache.get(f.id)};const l=this.getComponent(f),d=this.convertModelToComponent(l,f),h=s.params||[];return{component:(...j)=>{const O=nr(j,h),T=this.getContext({params:O},r);return this.render(d,{$$context:T,key:p})},key:p}};if(Array.isArray(c)){const f=c==null?void 0:c.map(p=>u(p));return(...p)=>f.map(l=>{if(Xo(l.component)){const h=l.component;return S.createElement(h,{$$context:r,key:l.key})}else{const h=l.component;return h==null?void 0:h(...p)}})}else return u(c).component}else{if(ct(i))return lt(i.value,r||{});if(Uf(i))return ea(i.value,r,this.storeManager);if(Et(i)){let s=i;De(i)&&(s=i.value);const c=s,u={};return Object.keys(s).forEach(f=>{u[f]=o(c[f])}),u}else return i}},a={};return Object.keys(n).forEach(i=>{const s=n[i];a[i]=o(s)}),a}collectSpecialProps(e={},r){const n=[],o=(a,i)=>{let s=i;De(i)&&(s=i.value),r(s)?n.push({keyPath:a,val:s}):$t(s)?s.forEach((c,u)=>{o([...a,String(u)],c)}):Et(s)&&Object.keys(s).forEach(c=>{o([...a,c],s[c])})};return o(["$root"],e),n}convertModelToComponent(e,r){const n=this;class o extends S.Component{constructor(s){super(s);y(this,"_CONDITION",!0);y(this,"_DESIGN_BOX",!1);y(this,"_NODE_MODEL",r);y(this,"_NODE_ID",r.id);y(this,"UNIQUE_ID",`${r.id}_${Z()}`);y(this,"targetComponentRef");y(this,"listenerHandle",[]);y(this,"storeState");y(this,"storeListenDisposeList",[]);y(this,"domHeader");y(this,"mediaStyleDomMap",{});y(this,"variableSpace");y(this,"nodeName");y(this,"updateState",s=>{this.storeState.setState(s)});y(this,"getStyleDomById",s=>{const c=this.mediaStyleDomMap;let u=c[s];return u||(u=document.createElement("style"),c[s]=u),u.id=s,u});y(this,"addMediaCSS",()=>{var u;let s=this.domHeader;if(s||(s=(u=document.getElementsByTagName("head"))==null?void 0:u[0],this.domHeader=s),!this.domHeader)return;const c=this._NODE_MODEL.value.css;c&&c.value.forEach(f=>{var d;const p=`${this.UNIQUE_ID}_${f.state}`;let l=le(this._NODE_MODEL);if(f.state!=="normal"&&(l=`${l}:${f.state}`),f.text){const h=this.getStyleDomById(p);h.innerText=`.${l} { ${f.text} }`,s==null||s.appendChild(h)}(d=f.media)!=null&&d.length&&f.media.forEach(h=>{const v=`${p}_${h.type}_${h.value}`,b=this.getStyleDomById(v);b.media=`screen and (${h.type}:${h.value}px)`,b.innerHTML=`.${l} { ${h.text} }`,s==null||s.appendChild(b)})})});y(this,"removeMediaCSS",()=>{const s=this.mediaStyleDomMap;Object.keys(s).forEach(c=>{var u;(u=this.domHeader)==null||u.removeChild(s[c])}),this.mediaStyleDomMap={}});y(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(s=>s()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=S.createRef(),this.state=r.value.state||{};const c=r.value.nodeName||r.id;this.nodeName=c;const u=n.storeManager.getStore(c);u?(this.storeState=u,u.setState({...r.value.state||{}})):this.storeState=n.storeManager.addStore(c,()=>({...r.value.state||{}})),this.storeState.subscribe(p=>{this.setState({...p})}),this.connectStore();const f=n.variableManager.get(c);f?this.variableSpace=f:(this.variableSpace={staticVar:{},methods:{}},n.variableManager.add(c,this.variableSpace))}connectStore(){const s=n.collectSpecialProps(r.props,l=>!!ct(l)),c=n.collectSpecialProps({css:r.value.css,class:r.value.classNames},l=>!!ct(l));let u=[];[...s,...c].map(l=>{const d=l.val,h=[/\$\$context.stateManager\.(.+?)\./gim,/\$\$context.stateManager\["(.+?)"\]/gim,/\$\$context.stateManager\['(.+?)'\]/gim,/getStateObj\('(.+?)'\)/gim,/getStateObj\("(.+?)"\)/gim,/getStateById\('(.+?)'\)/gim,/getStateById\("(.+?)"\)/gim],v=ra(d.value,h);u=[...u,...v]}).filter(Boolean);const f=Array.from(new Set(u)),p=[];f.length&&f.forEach(l=>{n.storeManager.getStore(l)||(n.storeManager.addStore(l,()=>({})),console.warn(n.storeManager,l,"not exits"));const h=n.storeManager.connect(l,v=>{this.setState({...v})});p.push(h)}),this.storeListenDisposeList=p}componentDidMount(){var c;this.addMediaCSS(),n.onGetRef&&n.onGetRef(this.targetComponentRef,r,this),(c=n.onComponentMount)==null||c.call(n,this,r);const s=()=>{n.storeManager.setStore(r.value.nodeName||r.id,this.storeState),this.storeState.setState({...this.state,...r.value.state||{}}),this.rebuildNode()};r.onChange(s)}componentWillUnmount(){var s;this.storeListenDisposeList.forEach(c=>c()),this.removeMediaCSS(),(s=n.onComponentDestroy)==null||s.call(n,this,r)}render(){var ae;const{$$context:s,...c}=this.props,u=r.value.nodeName||r.id,f={key:r.id,...r.props,...c},p={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n.storeManager,getState:()=>n.storeManager.getStateObj(u),getStateObj:()=>n.storeManager.getStateObj(u),getStateObjById:D=>n.storeManager.getStateObj(D),stateManager:n.storeManager.getStateSnapshot(),getMethods:()=>n.variableManager.get(u).methods,getMethodsById:D=>n.variableManager.get(D).methods,getStaticVar:()=>n.variableManager.get(u).staticVar,getStaticVarById:D=>n.variableManager.get(D).staticVar};r.value.componentName===At.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState,p.getGlobalState=()=>this.state);const l=n.getContext(p,s),v=n.transformProps({methods:r.value.methods},{$$context:l}).methods.reduce((D,z)=>(D[z.name]=z.define,D),{});l.methods=v,this.variableSpace.methods=Object.assign(this.variableSpace.methods,v);const b=r.value.loop;let j=[];if(b&&b.open){this.targetComponentRef.current=[];let D=b.data||[];if(ct(b.data)){const z=b.data;D=lt(z.value,l||{})}return j=D.map((...z)=>{var Fr;const Ft=z[1],bt=[b.forName||"item",b.forIndex||"index"],Ee=nr(z,bt);let Ne="loopData";b.name&&(Ne=`${Ne}${b.name}`);const Bt=n.getContext({[Ne]:Ee},l),q=n.transformProps(f,{$$context:Bt}),ha=((Fr=r.value.classNames)==null?void 0:Fr.map(H=>{var ie;const Ut=H.name;return(ct(H.status)?lt(String(((ie=H.status)==null?void 0:ie.value)||""),Bt):!1)?Ut:""}))||[];let Te=`${q.className??""} ${ha.join(" ")}`.trim();r.value.css&&(Te=`${le(r)} ${Te}`.trim()),q.className=Te;const ma=n.transformProps({style:r.value.style},{$$context:Bt});r.value.style&&(q.style=or(ma.style||[]));const{children:se}=q;let xe=[];if(se!==void 0)delete q.children,xe=Array.isArray(se)?se:[se];else{const H=[];r.value.children.forEach((Br,ie)=>{const ga=n.buildComponent(Br,{$$context:Bt,idx:ie});H.push(ga)}),xe=H}if(q.key=`${q.key}-${Ft}`,ct(b.key)){const H=b.key,Ut=lt(H.value,Bt||{});q.key+=`-${Ut}`}return q.ref=H=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[Ft]=H},n.render(e,q,...xe)}),j}const O=n.transformProps(f,{$$context:l}),{children:T}=O;let A=[];if(T!==void 0)delete O.children,A=Array.isArray(T)?T:[T];else{const D=[];r.value.children.forEach((Ft,bt)=>{const Ee=n.buildComponent(Ft,{$$context:l,idx:bt});D.push(Ee)}),A=D}O.ref=this.targetComponentRef;const I=((ae=r.value.classNames)==null?void 0:ae.map(D=>{var bt;const z=D.name;return(ct(D.status)?lt(((bt=D.status)==null?void 0:bt.value)||"",l):!1)?z:""}))||[];let k=`${O.className??""} ${I.join(" ")}`.trim();r.value.css&&(k=`${le(r)} ${k}`.trim()),O.className=k;const Lt=n.transformProps({style:r.value.style},{$$context:l});r.value.style&&(O.style=or(Lt.style||[]));let w=r.value.condition??!0;typeof w!="boolean"&&(w=lt(w.value,l||{}));let ot={condition:w,props:O};n.processNodeConfigHook&&(ot=n.processNodeConfigHook(ot,r));const it=n.render(e,ot.props,...A);return this._CONDITION=ot.condition,ot.condition?it:S.createElement("div",{style:{display:"none"}},it)}}return y(o,"__CP_TYPE__",ue),o.displayName=`${r.value.componentName}Dynamic`,o}buildComponent(e,{$$context:r={}}){const n=this.runtimeComponentCache;return typeof e=="string"?this.render(e):kf(e)?(({currentNode:a})=>{const i=a.value.id;let s=null;if(n.get(i)){const f=n.get(i);s=f==null?void 0:f.component}else{const f=this.getComponent(a);s=this.convertModelToComponent(f,a),!n.get(i)&&this.renderMode!=="design"&&n.set(i,{component:s})}const c=`${i}-${ue}`,u={$$context:r,$$nodeModel:e,key:c};return this.render(s,u)})({currentNode:e}):void 0}render(e,r={},...n){return typeof e=="string"||typeof e=="number"?String(e):($m.forEach(a=>{a in r&&e.__CP_TYPE__!==ue&&delete r[a]}),S.createElement(e,r,...n))}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const xm=Ln(new aa),Mm=["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"];var Am=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sa={exports:{}},$e={};/**
|
|
3227
|
+
`, new Function(a)(...o, e, r);
|
|
3228
|
+
} catch (s) {
|
|
3229
|
+
console.log(a), console.warn(s);
|
|
3230
|
+
}
|
|
3231
|
+
}, Mn = (t, e) => {
|
|
3232
|
+
const r = {};
|
|
3233
|
+
return e.forEach((n, o) => {
|
|
3234
|
+
r[n] = t[o];
|
|
3235
|
+
}), r;
|
|
3236
|
+
}, Pn = (t = []) => {
|
|
3237
|
+
const e = {};
|
|
3238
|
+
return t.forEach(({ property: r, value: n }) => {
|
|
3239
|
+
let o = r.replace("-webkit", "Webkit");
|
|
3240
|
+
o = o.replace("-ms", "ms"), o = o.replace("-moz", "Moz"), o = o.replace("-o", "O");
|
|
3241
|
+
let a = o.split("-");
|
|
3242
|
+
a.length >= 2 && (a = a.map((s, i) => i !== 0 ? Wd(s) : s)), e[a.join("")] = n;
|
|
3243
|
+
}), e;
|
|
3244
|
+
}, Yh = (t) => {
|
|
3245
|
+
let e = "";
|
|
3246
|
+
return Object.keys(t || {}).forEach((r) => {
|
|
3247
|
+
e += `${r}:${t[r]};`;
|
|
3248
|
+
}), e;
|
|
3249
|
+
}, Xh = (t, e) => {
|
|
3250
|
+
const r = {};
|
|
3251
|
+
return t.forEach((n) => {
|
|
3252
|
+
if (n.globalName) {
|
|
3253
|
+
const o = e[n.globalName];
|
|
3254
|
+
o && (r[n.globalName] = o, o.__esModule && o.default && (r[n.globalName] = o.default));
|
|
3255
|
+
}
|
|
3256
|
+
}), r;
|
|
3257
|
+
}, Kh = (t, e = 1) => {
|
|
3258
|
+
let r = 0, n = t, o = {}, a = {};
|
|
3259
|
+
for (; r < e; )
|
|
3260
|
+
Object.keys(n).forEach((s) => {
|
|
3261
|
+
o = {
|
|
3262
|
+
...o,
|
|
3263
|
+
...n[s]
|
|
3264
|
+
};
|
|
3265
|
+
}), a = o, n = o, o = {}, r += 1;
|
|
3266
|
+
return a;
|
|
3267
|
+
}, mh = (t, e) => {
|
|
3268
|
+
const r = [];
|
|
3269
|
+
return e.forEach((n) => {
|
|
3270
|
+
const a = n.exec(t);
|
|
3271
|
+
a != null && a.length && r.push(a[1]);
|
|
3272
|
+
}), r;
|
|
3273
|
+
}, na = (t, e) => {
|
|
3274
|
+
const r = {};
|
|
3275
|
+
return e.forEach((n) => {
|
|
3276
|
+
t[n.name] && (r[n.name] = t[n.name]);
|
|
3277
|
+
}), r;
|
|
3278
|
+
}, Zh = (t, e) => na(t, e), tm = (t, e) => na(t, e), Fe = (t) => {
|
|
3279
|
+
var r;
|
|
3280
|
+
return ((r = t.value.css) == null ? void 0 : r.class) || `c_${t.id}`;
|
|
3281
|
+
}, gh = (t, e) => {
|
|
3282
|
+
const r = t.split(".");
|
|
3283
|
+
let n, o = e;
|
|
3284
|
+
return r.forEach((a) => {
|
|
3285
|
+
n = o == null ? void 0 : o[a], o = n;
|
|
3286
|
+
}), n || (() => `Component [${t}] not found`);
|
|
3287
|
+
}, ue = "DYNAMIC", vh = ["$$context", "$$nodeModel"], yh = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_CJS_TRACE: "true" }, Rn = (t) => {
|
|
3288
|
+
let e;
|
|
3289
|
+
const r = /* @__PURE__ */ new Set(), n = (l, p) => {
|
|
3290
|
+
const f = typeof l == "function" ? l(e) : l;
|
|
3291
|
+
if (!Object.is(f, e)) {
|
|
3292
|
+
const d = e;
|
|
3293
|
+
e = p ?? (typeof f != "object" || f === null) ? f : Object.assign({}, e, f), r.forEach((h) => h(e, d));
|
|
3294
|
+
}
|
|
3295
|
+
}, o = () => e, c = { setState: n, getState: o, getInitialState: () => u, subscribe: (l) => (r.add(l), () => r.delete(l)), destroy: () => {
|
|
3296
|
+
(yh ? "production" : void 0) !== "production" && console.warn(
|
|
3297
|
+
"[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."
|
|
3298
|
+
), r.clear();
|
|
3299
|
+
} }, u = e = t(n, o, c);
|
|
3300
|
+
return c;
|
|
3301
|
+
}, bh = (t) => t ? Rn(t) : Rn;
|
|
3302
|
+
class _h {
|
|
3303
|
+
constructor() {
|
|
3304
|
+
y(this, "storeMap", /* @__PURE__ */ new Map());
|
|
3305
|
+
}
|
|
3306
|
+
addStore(e, r) {
|
|
3307
|
+
const n = bh(r);
|
|
3308
|
+
return this.storeMap.set(e, n), n.name = e, n;
|
|
3309
|
+
}
|
|
3310
|
+
setStore(e, r) {
|
|
3311
|
+
this.storeMap.set(e, r);
|
|
3312
|
+
}
|
|
3313
|
+
removeStore(e) {
|
|
3314
|
+
this.storeMap.delete(e);
|
|
3315
|
+
}
|
|
3316
|
+
getStore(e) {
|
|
3317
|
+
return this.storeMap.get(e);
|
|
3318
|
+
}
|
|
3319
|
+
getState(e) {
|
|
3320
|
+
var r;
|
|
3321
|
+
return (r = this.storeMap.get(e)) == null ? void 0 : r.getState();
|
|
3322
|
+
}
|
|
3323
|
+
getStateObj(e) {
|
|
3324
|
+
return {
|
|
3325
|
+
state: this.getState(e),
|
|
3326
|
+
updateState: (r) => {
|
|
3327
|
+
this.setState(e, r);
|
|
3328
|
+
}
|
|
3329
|
+
};
|
|
3330
|
+
}
|
|
3331
|
+
setState(e, r) {
|
|
3332
|
+
var n;
|
|
3333
|
+
return (n = this.storeMap.get(e)) == null ? void 0 : n.setState(r);
|
|
3334
|
+
}
|
|
3335
|
+
connect(e, r) {
|
|
3336
|
+
const n = this.storeMap.get(e);
|
|
3337
|
+
return n ? n.subscribe(r) : (console.warn("store not exits"), () => {
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3340
|
+
/**
|
|
3341
|
+
* storeManger 赋值以及 获取需要做转换
|
|
3342
|
+
*/
|
|
3343
|
+
getStateSnapshot() {
|
|
3344
|
+
const e = {};
|
|
3345
|
+
return this.storeMap.forEach((r, n) => {
|
|
3346
|
+
e[n] = this.getStateObj(n);
|
|
3347
|
+
}), e;
|
|
3348
|
+
}
|
|
3349
|
+
destroy() {
|
|
3350
|
+
this.storeMap = /* @__PURE__ */ new Map();
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3353
|
+
class Sh {
|
|
3354
|
+
constructor() {
|
|
3355
|
+
y(this, "varSpace", /* @__PURE__ */ new Map());
|
|
3356
|
+
}
|
|
3357
|
+
get(e) {
|
|
3358
|
+
return this.varSpace.get(e);
|
|
3359
|
+
}
|
|
3360
|
+
add(e, r) {
|
|
3361
|
+
this.varSpace.set(e, r);
|
|
3362
|
+
}
|
|
3363
|
+
remove(e) {
|
|
3364
|
+
this.varSpace.delete(e);
|
|
3365
|
+
}
|
|
3366
|
+
destroy() {
|
|
3367
|
+
this.varSpace.clear();
|
|
3368
|
+
}
|
|
3369
|
+
getStateSnapshot() {
|
|
3370
|
+
const e = {};
|
|
3371
|
+
return this.varSpace.forEach((r, n) => {
|
|
3372
|
+
e[n] = r;
|
|
3373
|
+
}), e;
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
class jh {
|
|
3377
|
+
constructor() {
|
|
3378
|
+
y(this, "renderMode", "normal");
|
|
3379
|
+
y(this, "components", {});
|
|
3380
|
+
y(this, "storeManager", new _h());
|
|
3381
|
+
// 存储节点的变量或者方法
|
|
3382
|
+
y(this, "variableManager", new Sh());
|
|
3383
|
+
y(this, "runtimeComponentCache", /* @__PURE__ */ new Map());
|
|
3384
|
+
y(this, "onGetRef");
|
|
3385
|
+
y(this, "onGetComponent");
|
|
3386
|
+
y(this, "onComponentMount");
|
|
3387
|
+
y(this, "onComponentDestroy");
|
|
3388
|
+
/**
|
|
3389
|
+
* 处理 props 钩子, 可以统一拦截 node 的处理,并修改其值
|
|
3390
|
+
*/
|
|
3391
|
+
y(this, "processNodeConfigHook");
|
|
3392
|
+
}
|
|
3393
|
+
getComponent(e) {
|
|
3394
|
+
var o;
|
|
3395
|
+
const r = e.value.componentName;
|
|
3396
|
+
let n = gh(r, this.components);
|
|
3397
|
+
return ph(n) || (n = dh(n), this.components[r] = n), this.onGetComponent && (n = (o = this.onGetComponent) == null ? void 0 : o.call(this, n, e)), n;
|
|
3398
|
+
}
|
|
3399
|
+
getContext(e = {}, r) {
|
|
3400
|
+
let n = e;
|
|
3401
|
+
return r && (n = {
|
|
3402
|
+
...e
|
|
3403
|
+
}, n.__proto__ = r || null), n;
|
|
3404
|
+
}
|
|
3405
|
+
pageRender(e, {
|
|
3406
|
+
components: r,
|
|
3407
|
+
onGetRef: n,
|
|
3408
|
+
$$context: o = {},
|
|
3409
|
+
onGetComponent: a,
|
|
3410
|
+
onComponentMount: s,
|
|
3411
|
+
onComponentDestroy: i,
|
|
3412
|
+
renderMode: c,
|
|
3413
|
+
processNodeConfigHook: u
|
|
3414
|
+
}) {
|
|
3415
|
+
this.renderMode = c, this.components = r, this.onGetRef = n, this.onGetComponent = a, this.onComponentMount = s, this.onComponentDestroy = i, this.processNodeConfigHook = u;
|
|
3416
|
+
const l = e.value.componentsTree, p = this.getComponent(l), f = this.convertModelToComponent(p, e.value.componentsTree), d = {}, h = l.props;
|
|
3417
|
+
return Object.keys(h).forEach((v) => {
|
|
3418
|
+
d[v] = h[v].value;
|
|
3419
|
+
}), d.$$context = o, this.render(f, d);
|
|
3420
|
+
}
|
|
3421
|
+
transformProps(e = {}, {
|
|
3422
|
+
$$context: r
|
|
3423
|
+
}) {
|
|
3424
|
+
const n = e, o = (s) => {
|
|
3425
|
+
if (Array.isArray(s))
|
|
3426
|
+
return s.map((i) => o(i));
|
|
3427
|
+
if (Re(s))
|
|
3428
|
+
return o(s.value);
|
|
3429
|
+
if (tf(s)) {
|
|
3430
|
+
const i = s.value, c = i.value;
|
|
3431
|
+
if (!c)
|
|
3432
|
+
return console.warn("slot value is null, this maybe cause some error, pls check it", e), () => {
|
|
3433
|
+
};
|
|
3434
|
+
const u = (l) => {
|
|
3435
|
+
const p = `${l.id}-${ue}`;
|
|
3436
|
+
if (this.runtimeComponentCache.get(l.id))
|
|
3437
|
+
return {
|
|
3438
|
+
key: p,
|
|
3439
|
+
component: this.runtimeComponentCache.get(l.id)
|
|
3440
|
+
};
|
|
3441
|
+
const f = this.getComponent(l), d = this.convertModelToComponent(f, l), h = i.params || [];
|
|
3442
|
+
return {
|
|
3443
|
+
component: (...S) => {
|
|
3444
|
+
const j = Mn(S, h), $ = this.getContext(
|
|
3445
|
+
{
|
|
3446
|
+
params: j
|
|
3447
|
+
},
|
|
3448
|
+
r
|
|
3449
|
+
);
|
|
3450
|
+
return this.render(d, {
|
|
3451
|
+
$$context: $,
|
|
3452
|
+
key: p
|
|
3453
|
+
});
|
|
3454
|
+
},
|
|
3455
|
+
key: p
|
|
3456
|
+
};
|
|
3457
|
+
};
|
|
3458
|
+
if (Array.isArray(c)) {
|
|
3459
|
+
const l = c == null ? void 0 : c.map((p) => u(p));
|
|
3460
|
+
return (...p) => l.map((f) => {
|
|
3461
|
+
if (fh(f.component)) {
|
|
3462
|
+
const h = f.component;
|
|
3463
|
+
return O.createElement(h, {
|
|
3464
|
+
$$context: r,
|
|
3465
|
+
key: f.key
|
|
3466
|
+
});
|
|
3467
|
+
} else {
|
|
3468
|
+
const h = f.component;
|
|
3469
|
+
return h == null ? void 0 : h(...p);
|
|
3470
|
+
}
|
|
3471
|
+
});
|
|
3472
|
+
} else
|
|
3473
|
+
return u(c).component;
|
|
3474
|
+
} else {
|
|
3475
|
+
if (ut(s))
|
|
3476
|
+
return bt(s.value, r || {});
|
|
3477
|
+
if (Kl(s))
|
|
3478
|
+
return hh(s.value, r, this.storeManager);
|
|
3479
|
+
if (Nt(s)) {
|
|
3480
|
+
let i = s;
|
|
3481
|
+
Re(s) && (i = s.value);
|
|
3482
|
+
const c = i, u = {};
|
|
3483
|
+
return Object.keys(i).forEach((l) => {
|
|
3484
|
+
u[l] = o(c[l]);
|
|
3485
|
+
}), u;
|
|
3486
|
+
} else
|
|
3487
|
+
return s;
|
|
3488
|
+
}
|
|
3489
|
+
}, a = {};
|
|
3490
|
+
return Object.keys(n).forEach((s) => {
|
|
3491
|
+
const i = n[s];
|
|
3492
|
+
a[s] = o(i);
|
|
3493
|
+
}), a;
|
|
3494
|
+
}
|
|
3495
|
+
collectSpecialProps(e = {}, r) {
|
|
3496
|
+
const n = [], o = (a, s) => {
|
|
3497
|
+
let i = s;
|
|
3498
|
+
Re(s) && (i = s.value), r(i) ? n.push({
|
|
3499
|
+
keyPath: a,
|
|
3500
|
+
val: i
|
|
3501
|
+
}) : Et(i) ? i.forEach((c, u) => {
|
|
3502
|
+
o([...a, String(u)], c);
|
|
3503
|
+
}) : Nt(i) && Object.keys(i).forEach((c) => {
|
|
3504
|
+
o([...a, c], i[c]);
|
|
3505
|
+
});
|
|
3506
|
+
};
|
|
3507
|
+
return o(["$root"], e), n;
|
|
3508
|
+
}
|
|
3509
|
+
convertModelToComponent(e, r) {
|
|
3510
|
+
const n = this;
|
|
3511
|
+
class o extends O.Component {
|
|
3512
|
+
constructor(i) {
|
|
3513
|
+
super(i);
|
|
3514
|
+
y(this, "_CONDITION", !0);
|
|
3515
|
+
y(this, "_DESIGN_BOX", !1);
|
|
3516
|
+
y(this, "_NODE_MODEL", r);
|
|
3517
|
+
y(this, "_NODE_ID", r.id);
|
|
3518
|
+
y(this, "UNIQUE_ID", `${r.id}_${tt()}`);
|
|
3519
|
+
y(this, "targetComponentRef");
|
|
3520
|
+
y(this, "listenerHandle", []);
|
|
3521
|
+
y(this, "storeState");
|
|
3522
|
+
y(this, "storeListenDisposeList", []);
|
|
3523
|
+
/** save dom and media css */
|
|
3524
|
+
y(this, "domHeader");
|
|
3525
|
+
y(this, "mediaStyleDomMap", {});
|
|
3526
|
+
/** 存储当前节点的一些变量和方法,不具有响应性 */
|
|
3527
|
+
y(this, "variableSpace");
|
|
3528
|
+
y(this, "nodeName");
|
|
3529
|
+
y(this, "updateState", (i) => {
|
|
3530
|
+
this.storeState.setState(i);
|
|
3531
|
+
});
|
|
3532
|
+
y(this, "getStyleDomById", (i) => {
|
|
3533
|
+
const c = this.mediaStyleDomMap;
|
|
3534
|
+
let u = c[i];
|
|
3535
|
+
return u || (u = document.createElement("style"), c[i] = u), u.id = i, u;
|
|
3536
|
+
});
|
|
3537
|
+
y(this, "addMediaCSS", () => {
|
|
3538
|
+
var u;
|
|
3539
|
+
let i = this.domHeader;
|
|
3540
|
+
if (i || (i = (u = document.getElementsByTagName("head")) == null ? void 0 : u[0], this.domHeader = i), !this.domHeader)
|
|
3541
|
+
return;
|
|
3542
|
+
const c = this._NODE_MODEL.value.css;
|
|
3543
|
+
c && c.value.forEach((l) => {
|
|
3544
|
+
var d;
|
|
3545
|
+
const p = `${this.UNIQUE_ID}_${l.state}`;
|
|
3546
|
+
let f = Fe(this._NODE_MODEL);
|
|
3547
|
+
if (l.state !== "normal" && (f = `${f}:${l.state}`), l.text) {
|
|
3548
|
+
const h = this.getStyleDomById(p);
|
|
3549
|
+
h.innerText = `.${f} { ${l.text} }`, i == null || i.appendChild(h);
|
|
3550
|
+
}
|
|
3551
|
+
(d = l.media) != null && d.length && l.media.forEach((h) => {
|
|
3552
|
+
const v = `${p}_${h.type}_${h.value}`, b = this.getStyleDomById(v);
|
|
3553
|
+
b.media = `screen and (${h.type}:${h.value}px)`, b.innerHTML = `.${f} { ${h.text} }`, i == null || i.appendChild(b);
|
|
3554
|
+
});
|
|
3555
|
+
});
|
|
3556
|
+
});
|
|
3557
|
+
y(this, "removeMediaCSS", () => {
|
|
3558
|
+
const i = this.mediaStyleDomMap;
|
|
3559
|
+
Object.keys(i).forEach((c) => {
|
|
3560
|
+
var u;
|
|
3561
|
+
(u = this.domHeader) == null || u.removeChild(i[c]);
|
|
3562
|
+
}), this.mediaStyleDomMap = {};
|
|
3563
|
+
});
|
|
3564
|
+
y(this, "rebuildNode", () => {
|
|
3565
|
+
this.storeListenDisposeList.forEach((i) => i()), this.removeMediaCSS(), this.connectStore(), this.addMediaCSS(), this.forceUpdate();
|
|
3566
|
+
});
|
|
3567
|
+
this.targetComponentRef = O.createRef(), this.state = r.value.state || {};
|
|
3568
|
+
const c = r.value.nodeName || r.id;
|
|
3569
|
+
this.nodeName = c;
|
|
3570
|
+
const u = n.storeManager.getStore(c);
|
|
3571
|
+
u ? (this.storeState = u, u.setState({
|
|
3572
|
+
...r.value.state || {}
|
|
3573
|
+
})) : this.storeState = n.storeManager.addStore(c, () => ({
|
|
3574
|
+
...r.value.state || {}
|
|
3575
|
+
})), this.storeState.subscribe((p) => {
|
|
3576
|
+
this.setState({
|
|
3577
|
+
...p
|
|
3578
|
+
});
|
|
3579
|
+
}), this.connectStore();
|
|
3580
|
+
const l = n.variableManager.get(c);
|
|
3581
|
+
l ? this.variableSpace = l : (this.variableSpace = {
|
|
3582
|
+
staticVar: {},
|
|
3583
|
+
methods: {}
|
|
3584
|
+
}, n.variableManager.add(c, this.variableSpace));
|
|
3585
|
+
}
|
|
3586
|
+
connectStore() {
|
|
3587
|
+
const i = n.collectSpecialProps(r.props, (f) => !!ut(f)), c = n.collectSpecialProps(
|
|
3588
|
+
{
|
|
3589
|
+
css: r.value.css,
|
|
3590
|
+
class: r.value.classNames
|
|
3591
|
+
},
|
|
3592
|
+
(f) => !!ut(f)
|
|
3593
|
+
);
|
|
3594
|
+
let u = [];
|
|
3595
|
+
[...i, ...c].map((f) => {
|
|
3596
|
+
const d = f.val, h = [
|
|
3597
|
+
/\$\$context.stateManager\.(.+?)\./gim,
|
|
3598
|
+
/\$\$context.stateManager\["(.+?)"\]/gim,
|
|
3599
|
+
/\$\$context.stateManager\['(.+?)'\]/gim,
|
|
3600
|
+
/getStateObj\('(.+?)'\)/gim,
|
|
3601
|
+
/getStateObj\("(.+?)"\)/gim,
|
|
3602
|
+
/getStateById\('(.+?)'\)/gim,
|
|
3603
|
+
/getStateById\("(.+?)"\)/gim
|
|
3604
|
+
], v = mh(d.value, h);
|
|
3605
|
+
u = [...u, ...v];
|
|
3606
|
+
}).filter(Boolean);
|
|
3607
|
+
const l = Array.from(new Set(u)), p = [];
|
|
3608
|
+
l.length && l.forEach((f) => {
|
|
3609
|
+
n.storeManager.getStore(f) || (n.storeManager.addStore(f, () => ({})), console.warn(n.storeManager, f, "not exits"));
|
|
3610
|
+
const h = n.storeManager.connect(f, (v) => {
|
|
3611
|
+
this.setState({
|
|
3612
|
+
...v
|
|
3613
|
+
});
|
|
3614
|
+
});
|
|
3615
|
+
p.push(h);
|
|
3616
|
+
}), this.storeListenDisposeList = p;
|
|
3617
|
+
}
|
|
3618
|
+
componentDidMount() {
|
|
3619
|
+
var c;
|
|
3620
|
+
this.addMediaCSS(), n.onGetRef && n.onGetRef(this.targetComponentRef, r, this), (c = n.onComponentMount) == null || c.call(n, this, r);
|
|
3621
|
+
const i = () => {
|
|
3622
|
+
n.storeManager.setStore(r.value.nodeName || r.id, this.storeState), this.storeState.setState({
|
|
3623
|
+
...this.state,
|
|
3624
|
+
...r.value.state || {}
|
|
3625
|
+
}), this.rebuildNode();
|
|
3626
|
+
};
|
|
3627
|
+
r.onChange(i);
|
|
3628
|
+
}
|
|
3629
|
+
componentWillUnmount() {
|
|
3630
|
+
var i;
|
|
3631
|
+
this.storeListenDisposeList.forEach((c) => c()), this.removeMediaCSS(), (i = n.onComponentDestroy) == null || i.call(n, this, r);
|
|
3632
|
+
}
|
|
3633
|
+
render() {
|
|
3634
|
+
var ae;
|
|
3635
|
+
const { $$context: i, ...c } = this.props, u = r.value.nodeName || r.id, l = {
|
|
3636
|
+
key: r.id,
|
|
3637
|
+
...r.props,
|
|
3638
|
+
...c
|
|
3639
|
+
}, p = {
|
|
3640
|
+
state: this.state || {},
|
|
3641
|
+
staticVar: this.variableSpace.staticVar,
|
|
3642
|
+
updateState: this.updateState,
|
|
3643
|
+
storeManager: n.storeManager,
|
|
3644
|
+
getState: () => n.storeManager.getStateObj(u),
|
|
3645
|
+
getStateObj: () => n.storeManager.getStateObj(u),
|
|
3646
|
+
getStateObjById: (I) => n.storeManager.getStateObj(I),
|
|
3647
|
+
stateManager: n.storeManager.getStateSnapshot(),
|
|
3648
|
+
getMethods: () => n.variableManager.get(u).methods,
|
|
3649
|
+
getMethodsById: (I) => n.variableManager.get(I).methods,
|
|
3650
|
+
getStaticVar: () => n.variableManager.get(u).staticVar,
|
|
3651
|
+
getStaticVarById: (I) => n.variableManager.get(I).staticVar
|
|
3652
|
+
};
|
|
3653
|
+
r.value.componentName === Mt.ROOT_CONTAINER && (p.globalState = this.state, p.updateGlobalState = this.updateState, p.getGlobalState = () => this.state);
|
|
3654
|
+
const f = n.getContext(p, i), v = n.transformProps(
|
|
3655
|
+
{
|
|
3656
|
+
methods: r.value.methods
|
|
3657
|
+
},
|
|
3658
|
+
{
|
|
3659
|
+
$$context: f
|
|
3660
|
+
}
|
|
3661
|
+
).methods.reduce((I, z) => (I[z.name] = z.define, I), {});
|
|
3662
|
+
f.methods = v, this.variableSpace.methods = Object.assign(this.variableSpace.methods, v);
|
|
3663
|
+
const b = r.value.loop;
|
|
3664
|
+
let S = [];
|
|
3665
|
+
if (b && b.open) {
|
|
3666
|
+
this.targetComponentRef.current = [];
|
|
3667
|
+
let I = b.data || [];
|
|
3668
|
+
if (ut(b.data)) {
|
|
3669
|
+
const z = b.data;
|
|
3670
|
+
I = bt(z.value, f || {});
|
|
3671
|
+
}
|
|
3672
|
+
return S = I.map((...z) => {
|
|
3673
|
+
var Dr;
|
|
3674
|
+
const Bt = z[1], yt = [b.forName || "item", b.forIndex || "index"], Ee = Mn(z, yt);
|
|
3675
|
+
let Ne = "loopData";
|
|
3676
|
+
b.name && (Ne = `${Ne}${b.name}`);
|
|
3677
|
+
const Ft = n.getContext(
|
|
3678
|
+
{
|
|
3679
|
+
[Ne]: Ee
|
|
3680
|
+
},
|
|
3681
|
+
f
|
|
3682
|
+
), Y = n.transformProps(l, {
|
|
3683
|
+
$$context: Ft
|
|
3684
|
+
}), ia = ((Dr = r.value.classNames) == null ? void 0 : Dr.map((H) => {
|
|
3685
|
+
var se;
|
|
3686
|
+
const kt = H.name;
|
|
3687
|
+
return (ut(H.status) ? bt(String(((se = H.status) == null ? void 0 : se.value) || ""), Ft) : !1) ? kt : "";
|
|
3688
|
+
})) || [];
|
|
3689
|
+
let $e = `${Y.className ?? ""} ${ia.join(" ")}`.trim();
|
|
3690
|
+
r.value.css && ($e = `${Fe(r)} ${$e}`.trim()), Y.className = $e;
|
|
3691
|
+
const sa = n.transformProps(
|
|
3692
|
+
{
|
|
3693
|
+
style: r.value.style
|
|
3694
|
+
},
|
|
3695
|
+
{
|
|
3696
|
+
$$context: Ft
|
|
3697
|
+
}
|
|
3698
|
+
);
|
|
3699
|
+
r.value.style && (Y.style = Pn(sa.style || []));
|
|
3700
|
+
const { children: ie } = Y;
|
|
3701
|
+
let xe = [];
|
|
3702
|
+
if (ie !== void 0)
|
|
3703
|
+
delete Y.children, xe = Array.isArray(ie) ? ie : [ie];
|
|
3704
|
+
else {
|
|
3705
|
+
const H = [];
|
|
3706
|
+
r.value.children.forEach((Lr, se) => {
|
|
3707
|
+
const ca = n.buildComponent(Lr, {
|
|
3708
|
+
$$context: Ft,
|
|
3709
|
+
idx: se
|
|
3710
|
+
});
|
|
3711
|
+
H.push(ca);
|
|
3712
|
+
}), xe = H;
|
|
3713
|
+
}
|
|
3714
|
+
if (Y.key = `${Y.key}-${Bt}`, ut(b.key)) {
|
|
3715
|
+
const H = b.key, kt = bt(H.value, Ft || {});
|
|
3716
|
+
Y.key += `-${kt}`;
|
|
3717
|
+
}
|
|
3718
|
+
return Y.ref = (H) => {
|
|
3719
|
+
this.targetComponentRef.current = this.targetComponentRef.current || [], this.targetComponentRef.current[Bt] = H;
|
|
3720
|
+
}, n.render(e, Y, ...xe);
|
|
3721
|
+
}), S;
|
|
3722
|
+
}
|
|
3723
|
+
const j = n.transformProps(l, {
|
|
3724
|
+
$$context: f
|
|
3725
|
+
}), { children: $ } = j;
|
|
3726
|
+
let E = [];
|
|
3727
|
+
if ($ !== void 0)
|
|
3728
|
+
delete j.children, E = Array.isArray($) ? $ : [$];
|
|
3729
|
+
else {
|
|
3730
|
+
const I = [];
|
|
3731
|
+
r.value.children.forEach((Bt, yt) => {
|
|
3732
|
+
const Ee = n.buildComponent(Bt, {
|
|
3733
|
+
$$context: f,
|
|
3734
|
+
idx: yt
|
|
3735
|
+
});
|
|
3736
|
+
I.push(Ee);
|
|
3737
|
+
}), E = I;
|
|
3738
|
+
}
|
|
3739
|
+
j.ref = this.targetComponentRef;
|
|
3740
|
+
const D = ((ae = r.value.classNames) == null ? void 0 : ae.map((I) => {
|
|
3741
|
+
var yt;
|
|
3742
|
+
const z = I.name;
|
|
3743
|
+
return (ut(I.status) ? bt(((yt = I.status) == null ? void 0 : yt.value) || "", f) : !1) ? z : "";
|
|
3744
|
+
})) || [];
|
|
3745
|
+
let U = `${j.className ?? ""} ${D.join(" ")}`.trim();
|
|
3746
|
+
r.value.css && (U = `${Fe(r)} ${U}`.trim()), j.className = U;
|
|
3747
|
+
const Lt = n.transformProps(
|
|
3748
|
+
{ style: r.value.style },
|
|
3749
|
+
{
|
|
3750
|
+
$$context: f
|
|
3751
|
+
}
|
|
3752
|
+
);
|
|
3753
|
+
r.value.style && (j.style = Pn(Lt.style || []));
|
|
3754
|
+
let C = r.value.condition ?? !0;
|
|
3755
|
+
typeof C != "boolean" && (C = bt(C.value, f || {}));
|
|
3756
|
+
let at = {
|
|
3757
|
+
condition: C,
|
|
3758
|
+
props: j
|
|
3759
|
+
};
|
|
3760
|
+
n.processNodeConfigHook && (at = n.processNodeConfigHook(at, r));
|
|
3761
|
+
const ct = n.render(e, at.props, ...E);
|
|
3762
|
+
return this._CONDITION = at.condition, at.condition ? ct : O.createElement(
|
|
3763
|
+
"div",
|
|
3764
|
+
{
|
|
3765
|
+
style: {
|
|
3766
|
+
display: "none"
|
|
3767
|
+
}
|
|
3768
|
+
},
|
|
3769
|
+
ct
|
|
3770
|
+
);
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
return y(o, "__CP_TYPE__", ue), o.displayName = `${r.value.componentName}Dynamic`, o;
|
|
3774
|
+
}
|
|
3775
|
+
// 递归建页面组件结构
|
|
3776
|
+
buildComponent(e, {
|
|
3777
|
+
$$context: r = {}
|
|
3778
|
+
}) {
|
|
3779
|
+
const n = this.runtimeComponentCache;
|
|
3780
|
+
return typeof e == "string" ? this.render(e) : Zl(e) ? (({ currentNode: a }) => {
|
|
3781
|
+
const s = a.value.id;
|
|
3782
|
+
let i = null;
|
|
3783
|
+
if (n.get(s)) {
|
|
3784
|
+
const l = n.get(s);
|
|
3785
|
+
i = l == null ? void 0 : l.component;
|
|
3786
|
+
} else {
|
|
3787
|
+
const l = this.getComponent(a);
|
|
3788
|
+
i = this.convertModelToComponent(l, a), !n.get(s) && this.renderMode !== "design" && n.set(s, {
|
|
3789
|
+
component: i
|
|
3790
|
+
});
|
|
3791
|
+
}
|
|
3792
|
+
const c = `${s}-${ue}`, u = {
|
|
3793
|
+
$$context: r,
|
|
3794
|
+
$$nodeModel: e,
|
|
3795
|
+
key: c
|
|
3796
|
+
};
|
|
3797
|
+
return this.render(i, u);
|
|
3798
|
+
})({
|
|
3799
|
+
currentNode: e
|
|
3800
|
+
}) : void 0;
|
|
3801
|
+
}
|
|
3802
|
+
// 真实渲染
|
|
3803
|
+
render(e, r = {}, ...n) {
|
|
3804
|
+
return typeof e == "string" || typeof e == "number" ? String(e) : (vh.forEach((a) => {
|
|
3805
|
+
a in r && e.__CP_TYPE__ !== ue && delete r[a];
|
|
3806
|
+
}), O.createElement(e, r, ...n));
|
|
3807
|
+
}
|
|
3808
|
+
clear() {
|
|
3809
|
+
this.runtimeComponentCache.clear(), this.storeManager.destroy();
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
const em = ma(new jh());
|
|
3813
|
+
function Oh(t) {
|
|
3814
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
3815
|
+
}
|
|
3816
|
+
var ke = { exports: {} }, Gt = {};
|
|
3817
|
+
/**
|
|
21
3818
|
* @license React
|
|
22
3819
|
* react-jsx-runtime.production.min.js
|
|
23
3820
|
*
|
|
@@ -25,5 +3822,869 @@ return $$_run_$$();
|
|
|
25
3822
|
*
|
|
26
3823
|
* This source code is licensed under the MIT license found in the
|
|
27
3824
|
* LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/var Rm=S,Dm=Symbol.for("react.element"),Im=Symbol.for("react.fragment"),Lm=Object.prototype.hasOwnProperty,Fm=Rm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Bm={key:!0,ref:!0,__self:!0,__source:!0};function ia(t,e,r){var n,o={},a=null,i=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(i=e.ref);for(n in e)Lm.call(e,n)&&!Bm.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:Dm,type:t,key:a,ref:i,props:o,_owner:Fm.current}}$e.Fragment=Im;$e.jsx=ia;$e.jsxs=ia;sa.exports=$e;var Um=sa.exports;const km=Um.jsx,nt=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},Vm=[...Mm,...$f],Gm=Vm.reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),S.createElement(e,{...o,...nt(n)},...a)},t),{}),zm=({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}=nt(n),c={height:r,width:e,...i,...o.style||{}};return S.createElement("div",{...o,...s,style:c},...a)},Hm=({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(S.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),S.createElement("canvas",{...n,...nt(r)})),Wm=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("img",{...r,...nt(e)},...n)},Jm=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("video",{...r,...nt(e)},...n)},Qm=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("audio",{...r,...nt(e)},...n)},qm=({$$attributes:t=[],content:e,...r})=>S.createElement("span",{...r,...nt(t)},e),Ym=({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),S.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),km("div",{...o,...nt(e),children:a})},Km=({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...i}=nt(e),s={...a,...n.style||{}};return S.createElement(r,{...n,...i,style:s},...o)},Xm={RootContainer:({children:t})=>t,...Gm,CContainer:Ym,CVideo:Jm,CAudio:Qm,CBlock:zm,CImage:Wm,CText:qm,CCanvas:Hm,CNativeTag:Km};class Zm{constructor(){y(this,"refMap",new Map)}get(e){return this.refMap.get(e)}add(e,r){this.refMap.set(e,r)}remove(e){this.refMap.delete(e)}destroy(){this.refMap.clear()}}class ca extends S.Component{constructor(r){super(r);y(this,"refManager");y(this,"dynamicComponentInstanceMap",new Map);y(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)});y(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(Et(r)&&wo(r)){const n=r;this.setState({pageModel:new he(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new he(r.page)},this.refManager=new Zm}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:i}=r,{pageModel:s}=this.state;if(!s)return console.warn("pageModel is null"),null;const c={...Xm,...r.components},u=this.props.$$context??{};return u.refs=this.refManager,n.pageRender(s,{libs:{},components:c,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:i,onComponentDestroy:a,$$context:u,renderMode:r.renderMode,processNodeConfigHook:r.processNodeConfigHook})}}const tg=()=>{const t=S.useRef(null);return S.useMemo(()=>({ref:t,rerender:function(...r){t.current&&t.current.rerender(...r)}}),[])};class eg extends S.Component{constructor(r){super(r);y(this,"onDoubleClick",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:""}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var o,a;(a=(o=this.props).onError)==null||a.call(o,n)}render(){if(this.state.hasError){const{onDoubleClick:r}=this,n=this.props.node.value;console.error(this.props.node,this.props.children);const o=S.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,S.createElement("p",null,"msg: ",String(this.state.error)),S.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"),S.createElement("div",{style:{display:"none"}}));return S.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}class ua{constructor(){y(this,"instanceMap",new Map)}get(e){return this.instanceMap.get(e)}add(e,r){const n=this.instanceMap.get(e);n?n.push(r):this.instanceMap.set(e,[r])}remove(e,r){const n=this.instanceMap.get(e);if(r!==void 0&&Array.isArray(n)){const o=n.filter(a=>a!==r);this.instanceMap.set(e,o)}else this.instanceMap.delete(e)}destroy(){this.instanceMap.clear()}}const la=t=>{const{node:e}=t,r=S.useMemo(()=>{const s=e.isContainer();return Et(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 S.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,...i}},n)};class rg extends S.Component{constructor(r){super(r);y(this,"instanceManager",new ua);y(this,"renderRef");y(this,"dropPlaceholder",la);y(this,"_components",{});y(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 S.Component{constructor(){super(...arguments);y(this,"_DESIGN_BOX",!0);y(this,"_NODE_MODEL",n);y(this,"_NODE_ID",n.id);y(this,"_UNIQUE_ID",`${n.id}_${Z()}`);y(this,"_STATUS");y(this,"_design_target_component")}componentDidMount(){o.instanceManager.add(n.id,this)}getTargetComponentRef(){return this._design_target_component}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}render(){var j,O;const{children:l=[],onlyRenderChild:d,...h}=this.props;let v=l;if($t(l)||(v=[l]),!!!v.filter(Boolean).length&&(n.isContainer()||n.value.componentName===At.ROOT_CONTAINER)){const T=(O=(j=n.material)==null?void 0:j.value.advanceCustom)==null?void 0:O.dropPlaceholder;v.push(S.createElement(T||o.dropPlaceholder,{node:n}))}return d?v:S.createElement(a,{...h},...v)}}return S.forwardRef(function(p,l){return S.createElement(eg,{node:n,targetComponent:s},S.createElement(s,{ref:l,...p}))})});this.updateComponents(this.props.components),this.renderRef=S.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=fa(r);if(!n)return null;const o=pa(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=Sa.findDOMNode(i);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),S.createElement(ca,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(i,s)=>{var h,v;if(s.nodeType!=="NODE")return i;const{props:c,condition:u}=i;let f={...c};const p=((h=s.value.configure)==null?void 0:h.devState)||{},l=(v=s.material)==null?void 0:v.value.fixedProps;if(l!==void 0){if(Et(l))f={...f,...l};else if(typeof l=="function"){const b=l(f);f={...f,...b}}}let d=u;return p.condition===!1&&(d=p.condition),{props:bm(f,p.props||{}),condition:d}},ref:this.renderRef})}}const fa=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:fa(t.parentElement)},pa=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:pa(t.return):null},ng=()=>{const t=S.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 da={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Am,function(){var r=function(){},n={},o={},a={};function i(l,d){l=l.push?l:[l];var h=[],v=l.length,b=v,j,O,T,A;for(j=function(I,k){k.length&&h.push(I),b--,b||d(h)};v--;){if(O=l[v],T=o[O],T){j(O,T);continue}A=a[O]=a[O]||[],A.push(j)}}function s(l,d){if(l){var h=a[l];if(o[l]=d,!!h)for(;h.length;)h[0](l,d),h.splice(0,1)}}function c(l,d){l.call&&(l={success:l}),d.length?(l.error||r)(d):(l.success||r)(l)}function u(l,d,h,v){var b=document,j=h.async,O=(h.numRetries||0)+1,T=h.before||r,A=l.replace(/[\?|#].*$/,""),I=l.replace(/^(css|img|module|nomodule)!/,""),k,Lt,w;if(v=v||0,/(^css!|\.css$)/.test(A))w=b.createElement("link"),w.rel="stylesheet",w.href=I,k="hideFocus"in w,k&&w.relList&&(k=0,w.rel="preload",w.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(A))w=b.createElement("img"),w.src=I;else if(w=b.createElement("script"),w.src=I,w.async=j===void 0?!0:j,Lt="noModule"in w,/^module!/.test(A)){if(!Lt)return d(l,"l");w.type="module"}else if(/^nomodule!/.test(A)&&Lt)return d(l,"l");w.onload=w.onerror=w.onbeforeload=function(ot){var it=ot.type[0];if(k)try{w.sheet.cssText.length||(it="e")}catch(ae){ae.code!=18&&(it="e")}if(it=="e"){if(v+=1,v<O)return u(l,d,h,v)}else if(w.rel=="preload"&&w.as=="style")return w.rel="stylesheet";d(l,it,ot.defaultPrevented)},T(l,w)!==!1&&b.head.appendChild(w)}function f(l,d,h){l=l.push?l:[l];var v=l.length,b=v,j=[],O,T;for(O=function(A,I,k){if(I=="e"&&j.push(A),I=="b")if(k)j.push(A);else return;v--,v||d(j)},T=0;T<b;T++)u(l[T],O,h)}function p(l,d,h){var v,b;if(d&&d.trim&&(v=d),b=(v?h:d)||{},v){if(v in n)throw"LoadJS";n[v]=!0}function j(O,T){f(l,function(A){c(b,A),O&&c({success:O,error:T},A),s(v,A)},b)}if(b.returnPromise)return new Promise(j);j()}return p.ready=function(d,h){return i(d,function(v){c(h,v)}),p},p.done=function(d){s(d,[])},p.reset=function(){n={},o={},a={}},p.isDefined=function(d){return d in n},p})})(da);var og=da.exports;const In=Pm(og);class ag{constructor(e,r){y(this,"assets");y(this,"loadStatus");y(this,"win",window);y(this,"_onSuccessList",[]);y(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=Z()),n.push(a.id);const i=a.resources.map(s=>s.src);i.length&&In(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}In.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}}exports.AssetLoader=ag;exports.ComponentInstanceManager=ua;exports.DefaultDropPlaceholder=la;exports.DefineReactAdapter=aa;exports.DesignRender=rg;exports.ReactAdapter=xm;exports.Render=ca;exports.canAcceptsRef=Zo;exports.collectVariable=jm;exports.compWrapper=ta;exports.convertCodeStringToFunction=ea;exports.findComponentByChainRefer=oa;exports.flatObject=Om;exports.formatSourceStylePropertyName=or;exports.getAdapter=Ln;exports.getCSSTextValue=Sm;exports.getComponentsLibs=Cm;exports.getMatchVal=ra;exports.getNodeCssClassName=le;exports.getObjFromArrayMap=nr;exports.getThirdLibs=wm;exports.isClass=_m;exports.runExpression=lt;exports.shouldConstruct=Xo;exports.useDesignRender=ng;exports.useRender=tg;
|
|
3825
|
+
*/
|
|
3826
|
+
var In;
|
|
3827
|
+
function wh() {
|
|
3828
|
+
if (In) return Gt;
|
|
3829
|
+
In = 1;
|
|
3830
|
+
var t = O, 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 };
|
|
3831
|
+
function s(i, c, u) {
|
|
3832
|
+
var l, p = {}, f = null, d = null;
|
|
3833
|
+
u !== void 0 && (f = "" + u), c.key !== void 0 && (f = "" + c.key), c.ref !== void 0 && (d = c.ref);
|
|
3834
|
+
for (l in c) n.call(c, l) && !a.hasOwnProperty(l) && (p[l] = c[l]);
|
|
3835
|
+
if (i && i.defaultProps) for (l in c = i.defaultProps, c) p[l] === void 0 && (p[l] = c[l]);
|
|
3836
|
+
return { $$typeof: e, type: i, key: f, ref: d, props: p, _owner: o.current };
|
|
3837
|
+
}
|
|
3838
|
+
return Gt.Fragment = r, Gt.jsx = s, Gt.jsxs = s, Gt;
|
|
3839
|
+
}
|
|
3840
|
+
var Dn;
|
|
3841
|
+
function Ch() {
|
|
3842
|
+
return Dn || (Dn = 1, ke.exports = wh()), ke.exports;
|
|
3843
|
+
}
|
|
3844
|
+
var Eh = Ch();
|
|
3845
|
+
const Nh = [
|
|
3846
|
+
"a",
|
|
3847
|
+
"abbr",
|
|
3848
|
+
"acronym",
|
|
3849
|
+
"address",
|
|
3850
|
+
"applet",
|
|
3851
|
+
"area",
|
|
3852
|
+
"article",
|
|
3853
|
+
"aside",
|
|
3854
|
+
"audio",
|
|
3855
|
+
"b",
|
|
3856
|
+
"base",
|
|
3857
|
+
"basefont",
|
|
3858
|
+
"bdi",
|
|
3859
|
+
"bdo",
|
|
3860
|
+
"bgsound",
|
|
3861
|
+
"big",
|
|
3862
|
+
"blink",
|
|
3863
|
+
"blockquote",
|
|
3864
|
+
"body",
|
|
3865
|
+
"br",
|
|
3866
|
+
"button",
|
|
3867
|
+
"canvas",
|
|
3868
|
+
"caption",
|
|
3869
|
+
"center",
|
|
3870
|
+
"cite",
|
|
3871
|
+
"code",
|
|
3872
|
+
"col",
|
|
3873
|
+
"colgroup",
|
|
3874
|
+
"command",
|
|
3875
|
+
"content",
|
|
3876
|
+
"data",
|
|
3877
|
+
"datalist",
|
|
3878
|
+
"dd",
|
|
3879
|
+
"del",
|
|
3880
|
+
"details",
|
|
3881
|
+
"dfn",
|
|
3882
|
+
"dialog",
|
|
3883
|
+
"dir",
|
|
3884
|
+
"div",
|
|
3885
|
+
"dl",
|
|
3886
|
+
"dt",
|
|
3887
|
+
"element",
|
|
3888
|
+
"em",
|
|
3889
|
+
"embed",
|
|
3890
|
+
"fieldset",
|
|
3891
|
+
"figcaption",
|
|
3892
|
+
"figure",
|
|
3893
|
+
"font",
|
|
3894
|
+
"footer",
|
|
3895
|
+
"form",
|
|
3896
|
+
"frame",
|
|
3897
|
+
"frameset",
|
|
3898
|
+
"h1",
|
|
3899
|
+
"h2",
|
|
3900
|
+
"h3",
|
|
3901
|
+
"h4",
|
|
3902
|
+
"h5",
|
|
3903
|
+
"h6",
|
|
3904
|
+
"head",
|
|
3905
|
+
"header",
|
|
3906
|
+
"hgroup",
|
|
3907
|
+
"hr",
|
|
3908
|
+
"html",
|
|
3909
|
+
"i",
|
|
3910
|
+
"iframe",
|
|
3911
|
+
"image",
|
|
3912
|
+
"img",
|
|
3913
|
+
"input",
|
|
3914
|
+
"ins",
|
|
3915
|
+
"isindex",
|
|
3916
|
+
"kbd",
|
|
3917
|
+
"keygen",
|
|
3918
|
+
"label",
|
|
3919
|
+
"legend",
|
|
3920
|
+
"li",
|
|
3921
|
+
"link",
|
|
3922
|
+
"listing",
|
|
3923
|
+
"main",
|
|
3924
|
+
"map",
|
|
3925
|
+
"mark",
|
|
3926
|
+
"marquee",
|
|
3927
|
+
"math",
|
|
3928
|
+
"menu",
|
|
3929
|
+
"menuitem",
|
|
3930
|
+
"meta",
|
|
3931
|
+
"meter",
|
|
3932
|
+
"multicol",
|
|
3933
|
+
"nav",
|
|
3934
|
+
"nextid",
|
|
3935
|
+
"nobr",
|
|
3936
|
+
"noembed",
|
|
3937
|
+
"noframes",
|
|
3938
|
+
"noscript",
|
|
3939
|
+
"object",
|
|
3940
|
+
"ol",
|
|
3941
|
+
"optgroup",
|
|
3942
|
+
"option",
|
|
3943
|
+
"output",
|
|
3944
|
+
"p",
|
|
3945
|
+
"param",
|
|
3946
|
+
"picture",
|
|
3947
|
+
"plaintext",
|
|
3948
|
+
"pre",
|
|
3949
|
+
"progress",
|
|
3950
|
+
"q",
|
|
3951
|
+
"rb",
|
|
3952
|
+
"rbc",
|
|
3953
|
+
"rp",
|
|
3954
|
+
"rt",
|
|
3955
|
+
"rtc",
|
|
3956
|
+
"ruby",
|
|
3957
|
+
"s",
|
|
3958
|
+
"samp",
|
|
3959
|
+
"script",
|
|
3960
|
+
"search",
|
|
3961
|
+
"section",
|
|
3962
|
+
"select",
|
|
3963
|
+
"shadow",
|
|
3964
|
+
"slot",
|
|
3965
|
+
"small",
|
|
3966
|
+
"source",
|
|
3967
|
+
"spacer",
|
|
3968
|
+
"span",
|
|
3969
|
+
"strike",
|
|
3970
|
+
"strong",
|
|
3971
|
+
"style",
|
|
3972
|
+
"sub",
|
|
3973
|
+
"summary",
|
|
3974
|
+
"sup",
|
|
3975
|
+
"svg",
|
|
3976
|
+
"table",
|
|
3977
|
+
"tbody",
|
|
3978
|
+
"td",
|
|
3979
|
+
"template",
|
|
3980
|
+
"textarea",
|
|
3981
|
+
"tfoot",
|
|
3982
|
+
"th",
|
|
3983
|
+
"thead",
|
|
3984
|
+
"time",
|
|
3985
|
+
"title",
|
|
3986
|
+
"tr",
|
|
3987
|
+
"track",
|
|
3988
|
+
"tt",
|
|
3989
|
+
"u",
|
|
3990
|
+
"ul",
|
|
3991
|
+
"var",
|
|
3992
|
+
"video",
|
|
3993
|
+
"wbr",
|
|
3994
|
+
"xmp"
|
|
3995
|
+
], ot = (t) => {
|
|
3996
|
+
const e = {};
|
|
3997
|
+
return t.forEach((r) => {
|
|
3998
|
+
e[r.key] = r.value;
|
|
3999
|
+
}), e;
|
|
4000
|
+
}, $h = [...Nh, ...Bl], xh = $h.reduce((t, e) => (t[e] = ({ children: r, $$attributes: n = [], ...o }) => {
|
|
4001
|
+
let a = r;
|
|
4002
|
+
return Array.isArray(r) || (a = [r]), O.createElement(
|
|
4003
|
+
e,
|
|
4004
|
+
{
|
|
4005
|
+
...o,
|
|
4006
|
+
...ot(n)
|
|
4007
|
+
},
|
|
4008
|
+
...a
|
|
4009
|
+
);
|
|
4010
|
+
}, t), {}), Th = ({ children: t, width: e, height: r, $$attributes: n = [], ...o }) => {
|
|
4011
|
+
let a = t;
|
|
4012
|
+
Array.isArray(t) || (a = [t]), a = a.filter((u) => u !== void 0);
|
|
4013
|
+
const { style: s = {}, ...i } = ot(n), c = {
|
|
4014
|
+
height: r,
|
|
4015
|
+
width: e,
|
|
4016
|
+
...s,
|
|
4017
|
+
...o.style || {}
|
|
4018
|
+
};
|
|
4019
|
+
return O.createElement(
|
|
4020
|
+
"div",
|
|
4021
|
+
{
|
|
4022
|
+
...o,
|
|
4023
|
+
...i,
|
|
4024
|
+
style: c
|
|
4025
|
+
},
|
|
4026
|
+
...a
|
|
4027
|
+
);
|
|
4028
|
+
}, Ah = ({ afterMount: t, beforeDestroy: e, $$attributes: r = [], ...n }) => (Fn(() => (t == null || t(n), () => {
|
|
4029
|
+
e == null || e(n);
|
|
4030
|
+
}), []), O.createElement("canvas", {
|
|
4031
|
+
...n,
|
|
4032
|
+
...ot(r)
|
|
4033
|
+
})), Mh = ({ children: t, $$attributes: e = [], ...r }) => {
|
|
4034
|
+
let n = t;
|
|
4035
|
+
return Array.isArray(t) || (n = [t]), O.createElement(
|
|
4036
|
+
"img",
|
|
4037
|
+
{
|
|
4038
|
+
...r,
|
|
4039
|
+
...ot(e)
|
|
4040
|
+
},
|
|
4041
|
+
...n
|
|
4042
|
+
);
|
|
4043
|
+
}, Ph = ({ children: t, $$attributes: e = [], ...r }) => {
|
|
4044
|
+
let n = t;
|
|
4045
|
+
return Array.isArray(t) || (n = [t]), O.createElement(
|
|
4046
|
+
"video",
|
|
4047
|
+
{
|
|
4048
|
+
...r,
|
|
4049
|
+
...ot(e)
|
|
4050
|
+
},
|
|
4051
|
+
...n
|
|
4052
|
+
);
|
|
4053
|
+
}, Rh = ({ children: t, $$attributes: e = [], ...r }) => {
|
|
4054
|
+
let n = t;
|
|
4055
|
+
return Array.isArray(t) || (n = [t]), O.createElement(
|
|
4056
|
+
"audio",
|
|
4057
|
+
{
|
|
4058
|
+
...r,
|
|
4059
|
+
...ot(e)
|
|
4060
|
+
},
|
|
4061
|
+
...n
|
|
4062
|
+
);
|
|
4063
|
+
}, Ih = ({ $$attributes: t = [], content: e, ...r }) => O.createElement(
|
|
4064
|
+
"span",
|
|
4065
|
+
{
|
|
4066
|
+
...r,
|
|
4067
|
+
...ot(t)
|
|
4068
|
+
},
|
|
4069
|
+
e
|
|
4070
|
+
), Dh = ({ children: t, $$attributes: e = [], afterMount: r, beforeDestroy: n, ...o }) => {
|
|
4071
|
+
let a = t;
|
|
4072
|
+
return Array.isArray(t) || (a = [t]), Fn(() => (r == null || r(o), () => {
|
|
4073
|
+
n == null || n(o);
|
|
4074
|
+
}), []), /* @__PURE__ */ Eh.jsx("div", { ...o, ...ot(e), children: a });
|
|
4075
|
+
}, Lh = ({ children: t, $$attributes: e = [], htmlTag: r = "div", ...n }) => {
|
|
4076
|
+
let o = t;
|
|
4077
|
+
Array.isArray(t) || (o = [t]);
|
|
4078
|
+
const { style: a = {}, ...s } = ot(e), i = {
|
|
4079
|
+
...a,
|
|
4080
|
+
...n.style || {}
|
|
4081
|
+
};
|
|
4082
|
+
return O.createElement(
|
|
4083
|
+
r,
|
|
4084
|
+
{
|
|
4085
|
+
...n,
|
|
4086
|
+
...s,
|
|
4087
|
+
style: i
|
|
4088
|
+
},
|
|
4089
|
+
...o
|
|
4090
|
+
);
|
|
4091
|
+
}, Bh = {
|
|
4092
|
+
RootContainer: ({ children: t }) => t,
|
|
4093
|
+
...xh,
|
|
4094
|
+
CContainer: Dh,
|
|
4095
|
+
CVideo: Ph,
|
|
4096
|
+
CAudio: Rh,
|
|
4097
|
+
CBlock: Th,
|
|
4098
|
+
CImage: Mh,
|
|
4099
|
+
CText: Ih,
|
|
4100
|
+
CCanvas: Ah,
|
|
4101
|
+
CNativeTag: Lh
|
|
4102
|
+
};
|
|
4103
|
+
class Fh {
|
|
4104
|
+
constructor() {
|
|
4105
|
+
y(this, "refMap", /* @__PURE__ */ new Map());
|
|
4106
|
+
}
|
|
4107
|
+
get(e) {
|
|
4108
|
+
return this.refMap.get(e);
|
|
4109
|
+
}
|
|
4110
|
+
add(e, r) {
|
|
4111
|
+
this.refMap.set(e, r);
|
|
4112
|
+
}
|
|
4113
|
+
remove(e) {
|
|
4114
|
+
this.refMap.delete(e);
|
|
4115
|
+
}
|
|
4116
|
+
destroy() {
|
|
4117
|
+
this.refMap.clear();
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
class kh extends O.Component {
|
|
4121
|
+
constructor(r) {
|
|
4122
|
+
super(r);
|
|
4123
|
+
y(this, "refManager");
|
|
4124
|
+
// save component instance
|
|
4125
|
+
y(this, "dynamicComponentInstanceMap", /* @__PURE__ */ new Map());
|
|
4126
|
+
y(this, "onGetRef", (r, n, o) => {
|
|
4127
|
+
var a, s;
|
|
4128
|
+
(s = (a = this.props).onGetRef) == null || s.call(a, r, n, o), this.dynamicComponentInstanceMap.set(n.id, o), this.refManager.add(n.value.refId || n.id, r);
|
|
4129
|
+
});
|
|
4130
|
+
y(this, "rerender", (r) => {
|
|
4131
|
+
if (this.props.adapter.clear(), (r == null ? void 0 : r.nodeType) === "PAGE" && r)
|
|
4132
|
+
this.setState({
|
|
4133
|
+
pageModel: r
|
|
4134
|
+
});
|
|
4135
|
+
else if (Nt(r) && To(r)) {
|
|
4136
|
+
const n = r;
|
|
4137
|
+
this.setState({
|
|
4138
|
+
pageModel: new he(n, {
|
|
4139
|
+
materials: this.state.pageModel.materialsModel.rawValue
|
|
4140
|
+
})
|
|
4141
|
+
});
|
|
4142
|
+
}
|
|
4143
|
+
});
|
|
4144
|
+
this.state = {
|
|
4145
|
+
pageModel: r.pageModel || new he(r.page)
|
|
4146
|
+
}, this.refManager = new Fh();
|
|
4147
|
+
}
|
|
4148
|
+
getPageModel() {
|
|
4149
|
+
return this.state.pageModel;
|
|
4150
|
+
}
|
|
4151
|
+
componentDidMount() {
|
|
4152
|
+
const { render: r } = this.props;
|
|
4153
|
+
r && (r.ref.current = this);
|
|
4154
|
+
}
|
|
4155
|
+
componentWillUnmount() {
|
|
4156
|
+
this.refManager.destroy();
|
|
4157
|
+
}
|
|
4158
|
+
render() {
|
|
4159
|
+
const { props: r } = this, { adapter: n, onGetComponent: o, onComponentDestroy: a, onComponentMount: s } = r, { pageModel: i } = this.state;
|
|
4160
|
+
if (!i)
|
|
4161
|
+
return console.warn("pageModel is null"), null;
|
|
4162
|
+
const c = {
|
|
4163
|
+
...Bh,
|
|
4164
|
+
...r.components
|
|
4165
|
+
}, u = this.props.$$context ?? {};
|
|
4166
|
+
return u.refs = this.refManager, n.pageRender(i, {
|
|
4167
|
+
libs: {},
|
|
4168
|
+
components: c,
|
|
4169
|
+
onGetRef: this.onGetRef,
|
|
4170
|
+
onGetComponent: o,
|
|
4171
|
+
onComponentMount: s,
|
|
4172
|
+
onComponentDestroy: a,
|
|
4173
|
+
$$context: u,
|
|
4174
|
+
renderMode: r.renderMode,
|
|
4175
|
+
processNodeConfigHook: r.processNodeConfigHook
|
|
4176
|
+
});
|
|
4177
|
+
}
|
|
4178
|
+
}
|
|
4179
|
+
const rm = () => {
|
|
4180
|
+
const t = kn(null);
|
|
4181
|
+
return Un(() => ({
|
|
4182
|
+
ref: t,
|
|
4183
|
+
rerender: function(...r) {
|
|
4184
|
+
t.current && t.current.rerender(...r);
|
|
4185
|
+
}
|
|
4186
|
+
}), []);
|
|
4187
|
+
};
|
|
4188
|
+
class Uh extends O.Component {
|
|
4189
|
+
constructor(r) {
|
|
4190
|
+
super(r);
|
|
4191
|
+
y(this, "onDoubleClick", () => {
|
|
4192
|
+
this.setState({
|
|
4193
|
+
hasError: !1,
|
|
4194
|
+
error: null
|
|
4195
|
+
});
|
|
4196
|
+
});
|
|
4197
|
+
this.state = { hasError: !1, error: "" };
|
|
4198
|
+
}
|
|
4199
|
+
static getDerivedStateFromError(r) {
|
|
4200
|
+
return { hasError: !0, error: r };
|
|
4201
|
+
}
|
|
4202
|
+
componentDidCatch(r, n) {
|
|
4203
|
+
var o, a;
|
|
4204
|
+
(a = (o = this.props).onError) == null || a.call(o, n);
|
|
4205
|
+
}
|
|
4206
|
+
render() {
|
|
4207
|
+
if (this.state.hasError) {
|
|
4208
|
+
const { onDoubleClick: r } = this, n = this.props.node.value;
|
|
4209
|
+
console.error(this.props.node, this.props.children);
|
|
4210
|
+
const o = O.createElement(
|
|
4211
|
+
"div",
|
|
4212
|
+
{
|
|
4213
|
+
style: {
|
|
4214
|
+
backgroundColor: "rgb(255 206 215 / 13%)",
|
|
4215
|
+
padding: "5px",
|
|
4216
|
+
color: "#ff0000b0",
|
|
4217
|
+
textAlign: "center",
|
|
4218
|
+
fontSize: "12px"
|
|
4219
|
+
}
|
|
4220
|
+
},
|
|
4221
|
+
"Render error, node id: ",
|
|
4222
|
+
n.id,
|
|
4223
|
+
", node name:",
|
|
4224
|
+
n.title,
|
|
4225
|
+
" component name:",
|
|
4226
|
+
n.title || n.componentName,
|
|
4227
|
+
O.createElement("p", null, "msg: ", String(this.state.error)),
|
|
4228
|
+
O.createElement(
|
|
4229
|
+
"button",
|
|
4230
|
+
{
|
|
4231
|
+
onDoubleClick: r,
|
|
4232
|
+
style: {
|
|
4233
|
+
border: "1px solid rgba(100,100,100,0.1)",
|
|
4234
|
+
backgroundColor: "#fff",
|
|
4235
|
+
padding: "5px 10px",
|
|
4236
|
+
borderRadius: "2px",
|
|
4237
|
+
color: "gray",
|
|
4238
|
+
cursor: "pointer",
|
|
4239
|
+
marginTop: "5px"
|
|
4240
|
+
}
|
|
4241
|
+
},
|
|
4242
|
+
"double click to refresh"
|
|
4243
|
+
),
|
|
4244
|
+
O.createElement("div", {
|
|
4245
|
+
style: {
|
|
4246
|
+
display: "none"
|
|
4247
|
+
}
|
|
4248
|
+
})
|
|
4249
|
+
);
|
|
4250
|
+
return O.createElement(this.props.targetComponent, { onlyRenderChild: !0 }, o);
|
|
4251
|
+
}
|
|
4252
|
+
return this.props.children;
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
class Vh {
|
|
4256
|
+
constructor() {
|
|
4257
|
+
y(this, "instanceMap", /* @__PURE__ */ new Map());
|
|
4258
|
+
}
|
|
4259
|
+
get(e) {
|
|
4260
|
+
return this.instanceMap.get(e);
|
|
4261
|
+
}
|
|
4262
|
+
add(e, r) {
|
|
4263
|
+
const n = this.instanceMap.get(e);
|
|
4264
|
+
n ? n.push(r) : this.instanceMap.set(e, [r]);
|
|
4265
|
+
}
|
|
4266
|
+
remove(e, r) {
|
|
4267
|
+
const n = this.instanceMap.get(e);
|
|
4268
|
+
if (r !== void 0 && Array.isArray(n)) {
|
|
4269
|
+
const o = n.filter((a) => a !== r);
|
|
4270
|
+
this.instanceMap.set(e, o);
|
|
4271
|
+
} else
|
|
4272
|
+
this.instanceMap.delete(e);
|
|
4273
|
+
}
|
|
4274
|
+
destroy() {
|
|
4275
|
+
this.instanceMap.clear();
|
|
4276
|
+
}
|
|
4277
|
+
}
|
|
4278
|
+
const Gh = (t) => {
|
|
4279
|
+
const { node: e } = t, r = Un(() => {
|
|
4280
|
+
const i = e.isContainer();
|
|
4281
|
+
return Nt(i) ? i : {
|
|
4282
|
+
placeholder: "Drag the component to place it",
|
|
4283
|
+
width: "100%",
|
|
4284
|
+
height: "100%",
|
|
4285
|
+
style: {}
|
|
4286
|
+
};
|
|
4287
|
+
}, [t.node]), { placeholder: n, height: o, width: a, style: s } = r;
|
|
4288
|
+
return O.createElement(
|
|
4289
|
+
"div",
|
|
4290
|
+
{
|
|
4291
|
+
style: {
|
|
4292
|
+
margin: 0,
|
|
4293
|
+
padding: 0,
|
|
4294
|
+
display: "flex",
|
|
4295
|
+
alignItems: "center",
|
|
4296
|
+
justifyContent: "center",
|
|
4297
|
+
backgroundColor: "rgba(200,200,200,0.1)",
|
|
4298
|
+
border: "1px solid rgba(0,0,0,0.1)",
|
|
4299
|
+
borderRadius: "2px",
|
|
4300
|
+
fontSize: "14px",
|
|
4301
|
+
color: "gray",
|
|
4302
|
+
cursor: "default",
|
|
4303
|
+
minHeight: "50px",
|
|
4304
|
+
width: a,
|
|
4305
|
+
height: o,
|
|
4306
|
+
...s
|
|
4307
|
+
}
|
|
4308
|
+
},
|
|
4309
|
+
n
|
|
4310
|
+
);
|
|
4311
|
+
};
|
|
4312
|
+
class nm extends O.Component {
|
|
4313
|
+
constructor(r) {
|
|
4314
|
+
super(r);
|
|
4315
|
+
y(this, "instanceManager", new Vh());
|
|
4316
|
+
y(this, "renderRef");
|
|
4317
|
+
y(this, "dropPlaceholder", Gh);
|
|
4318
|
+
y(this, "_components", {});
|
|
4319
|
+
y(this, "onGetComponent", (r, n) => {
|
|
4320
|
+
var c, u;
|
|
4321
|
+
const o = this;
|
|
4322
|
+
let a = r;
|
|
4323
|
+
const s = (u = (c = n.material) == null ? void 0 : c.value.advanceCustom) == null ? void 0 : u.wrapComponent;
|
|
4324
|
+
s && (a = s(r, {
|
|
4325
|
+
node: n,
|
|
4326
|
+
ctx: window.__C_ENGINE_DESIGNER_PLUGIN_CTX__
|
|
4327
|
+
}));
|
|
4328
|
+
class i extends O.Component {
|
|
4329
|
+
constructor() {
|
|
4330
|
+
super(...arguments);
|
|
4331
|
+
y(this, "_DESIGN_BOX", !0);
|
|
4332
|
+
y(this, "_NODE_MODEL", n);
|
|
4333
|
+
y(this, "_NODE_ID", n.id);
|
|
4334
|
+
y(this, "_UNIQUE_ID", `${n.id}_${tt()}`);
|
|
4335
|
+
y(this, "_STATUS");
|
|
4336
|
+
y(this, "_design_target_component");
|
|
4337
|
+
y(this, "_dom");
|
|
4338
|
+
}
|
|
4339
|
+
componentDidMount() {
|
|
4340
|
+
o.instanceManager.add(n.id, this);
|
|
4341
|
+
}
|
|
4342
|
+
getTargetComponentRef() {
|
|
4343
|
+
return this._design_target_component;
|
|
4344
|
+
}
|
|
4345
|
+
componentWillUnmount() {
|
|
4346
|
+
this._STATUS = "DESTROY", o.instanceManager.remove(n.id, this);
|
|
4347
|
+
}
|
|
4348
|
+
getDom() {
|
|
4349
|
+
var f, d;
|
|
4350
|
+
return (d = (f = this._dom) == null ? void 0 : f.children) == null ? void 0 : d[0];
|
|
4351
|
+
}
|
|
4352
|
+
render() {
|
|
4353
|
+
var j, $;
|
|
4354
|
+
const { children: f = [], onlyRenderChild: d, ...h } = this.props;
|
|
4355
|
+
let v = f;
|
|
4356
|
+
if (Et(f) || (v = [f]), !!!v.filter(Boolean).length && (n.isContainer() || n.value.componentName === Mt.ROOT_CONTAINER)) {
|
|
4357
|
+
const E = ($ = (j = n.material) == null ? void 0 : j.value.advanceCustom) == null ? void 0 : $.dropPlaceholder;
|
|
4358
|
+
v.push(
|
|
4359
|
+
O.createElement(E || o.dropPlaceholder, {
|
|
4360
|
+
node: n
|
|
4361
|
+
})
|
|
4362
|
+
);
|
|
4363
|
+
}
|
|
4364
|
+
if (d)
|
|
4365
|
+
return v;
|
|
4366
|
+
const S = O.createElement(a, h, ...v);
|
|
4367
|
+
return O.createElement(
|
|
4368
|
+
"div",
|
|
4369
|
+
{
|
|
4370
|
+
style: {
|
|
4371
|
+
display: "contents"
|
|
4372
|
+
},
|
|
4373
|
+
ref: (E) => {
|
|
4374
|
+
this._dom = E;
|
|
4375
|
+
}
|
|
4376
|
+
},
|
|
4377
|
+
S
|
|
4378
|
+
);
|
|
4379
|
+
}
|
|
4380
|
+
}
|
|
4381
|
+
return O.forwardRef(function(p, f) {
|
|
4382
|
+
return O.createElement(
|
|
4383
|
+
Uh,
|
|
4384
|
+
{
|
|
4385
|
+
node: n,
|
|
4386
|
+
targetComponent: i
|
|
4387
|
+
},
|
|
4388
|
+
O.createElement(i, {
|
|
4389
|
+
ref: f,
|
|
4390
|
+
...p
|
|
4391
|
+
})
|
|
4392
|
+
);
|
|
4393
|
+
});
|
|
4394
|
+
});
|
|
4395
|
+
this._components = Object.assign(this._components, this.props.components), this.renderRef = O.createRef(), r.dropPlaceholder && (this.dropPlaceholder = r.dropPlaceholder);
|
|
4396
|
+
}
|
|
4397
|
+
updateComponents(r = {}) {
|
|
4398
|
+
this._components = Object.assign(this._components, r), this.forceUpdate();
|
|
4399
|
+
}
|
|
4400
|
+
componentDidMount() {
|
|
4401
|
+
var r, n;
|
|
4402
|
+
window.__CHAMN_RENDER_MODE = "DESIGN", this.updateComponents(this.props.components), (n = (r = this.props).onMount) == null || n.call(r, this);
|
|
4403
|
+
}
|
|
4404
|
+
getPageModel() {
|
|
4405
|
+
var r;
|
|
4406
|
+
return (r = this.renderRef.current) == null ? void 0 : r.state.pageModel;
|
|
4407
|
+
}
|
|
4408
|
+
rerender(r) {
|
|
4409
|
+
var n;
|
|
4410
|
+
return (n = this.renderRef.current) == null ? void 0 : n.rerender(r);
|
|
4411
|
+
}
|
|
4412
|
+
getInstancesById(r, n) {
|
|
4413
|
+
let o = [...this.instanceManager.get(r) || []];
|
|
4414
|
+
return n !== void 0 && (o = o.filter((a) => n === (a == null ? void 0 : a._UNIQUE_ID))), o;
|
|
4415
|
+
}
|
|
4416
|
+
getInstanceByDom(r) {
|
|
4417
|
+
const n = oa(r);
|
|
4418
|
+
if (!n)
|
|
4419
|
+
return null;
|
|
4420
|
+
const o = aa(n);
|
|
4421
|
+
return (o == null ? void 0 : o.stateNode) || null;
|
|
4422
|
+
}
|
|
4423
|
+
getDomsById(r, n) {
|
|
4424
|
+
const o = this.getInstancesById(r), a = [];
|
|
4425
|
+
return o == null || o.forEach((s) => {
|
|
4426
|
+
var c;
|
|
4427
|
+
if ((s == null ? void 0 : s._STATUS) === "DESTROY")
|
|
4428
|
+
return;
|
|
4429
|
+
const i = s.getDom();
|
|
4430
|
+
if (i && !(i instanceof Text))
|
|
4431
|
+
if (n) {
|
|
4432
|
+
const u = Array.from(((c = i.querySelectorAll) == null ? void 0 : c.call(i, n)) || []);
|
|
4433
|
+
a.push(...u);
|
|
4434
|
+
} else
|
|
4435
|
+
a.push(i);
|
|
4436
|
+
}), a;
|
|
4437
|
+
}
|
|
4438
|
+
getDomRectById(r, n) {
|
|
4439
|
+
return this.getDomsById(r, n).map((s) => s == null ? void 0 : s.getBoundingClientRect()).filter(Boolean);
|
|
4440
|
+
}
|
|
4441
|
+
render() {
|
|
4442
|
+
const { props: r, onGetComponent: n } = this, { render: o, ...a } = r;
|
|
4443
|
+
return o && (o.ref.current = this), O.createElement(kh, {
|
|
4444
|
+
onGetComponent: n,
|
|
4445
|
+
...a,
|
|
4446
|
+
components: this._components,
|
|
4447
|
+
// 拦截特殊属性配置, 配合设计模式使用
|
|
4448
|
+
/**
|
|
4449
|
+
* 可以对节点的一些配置数据做统一处理
|
|
4450
|
+
* 比如: fixedProps 强制将 fixedProps 内的值覆盖 node 本省的配置
|
|
4451
|
+
* 比如: 统一处理节点的 Condition 属性,控制节点是否显示
|
|
4452
|
+
* @param config
|
|
4453
|
+
* @param node
|
|
4454
|
+
* @returns
|
|
4455
|
+
*/
|
|
4456
|
+
processNodeConfigHook: (s, i) => {
|
|
4457
|
+
var h, v;
|
|
4458
|
+
if (i.nodeType !== "NODE")
|
|
4459
|
+
return s;
|
|
4460
|
+
const { props: c, condition: u } = s;
|
|
4461
|
+
let l = { ...c };
|
|
4462
|
+
const p = ((h = i.value.configure) == null ? void 0 : h.devState) || {}, f = (v = i.material) == null ? void 0 : v.value.fixedProps;
|
|
4463
|
+
if (f !== void 0) {
|
|
4464
|
+
if (Nt(f))
|
|
4465
|
+
l = {
|
|
4466
|
+
...l,
|
|
4467
|
+
...f
|
|
4468
|
+
};
|
|
4469
|
+
else if (typeof f == "function") {
|
|
4470
|
+
const b = f(l);
|
|
4471
|
+
l = {
|
|
4472
|
+
...l,
|
|
4473
|
+
...b
|
|
4474
|
+
};
|
|
4475
|
+
}
|
|
4476
|
+
}
|
|
4477
|
+
let d = u;
|
|
4478
|
+
return p.condition === !1 && (d = p.condition), {
|
|
4479
|
+
props: lh(l, p.props || {}),
|
|
4480
|
+
condition: d
|
|
4481
|
+
};
|
|
4482
|
+
},
|
|
4483
|
+
// renderMode: 'design',
|
|
4484
|
+
ref: this.renderRef
|
|
4485
|
+
});
|
|
4486
|
+
}
|
|
4487
|
+
}
|
|
4488
|
+
const oa = (t) => {
|
|
4489
|
+
if (!t)
|
|
4490
|
+
return null;
|
|
4491
|
+
const e = Object.keys(t).find((r) => r.startsWith("__reactInternalInstance$") || r.startsWith("__reactFiber$")) || "";
|
|
4492
|
+
return e ? t[e] : oa(t.parentElement);
|
|
4493
|
+
}, aa = (t) => {
|
|
4494
|
+
var e;
|
|
4495
|
+
return t ? (e = t == null ? void 0 : t.stateNode) != null && e._DESIGN_BOX ? t : aa(t.return) : null;
|
|
4496
|
+
}, om = () => {
|
|
4497
|
+
const t = kn(null);
|
|
4498
|
+
return {
|
|
4499
|
+
ref: t,
|
|
4500
|
+
rerender: function(...e) {
|
|
4501
|
+
t.current && t.current.rerender(...e);
|
|
4502
|
+
},
|
|
4503
|
+
getInstancesById(e, r) {
|
|
4504
|
+
var n;
|
|
4505
|
+
return ((n = t.current) == null ? void 0 : n.getInstancesById(e, r)) || [];
|
|
4506
|
+
},
|
|
4507
|
+
getInstanceByDom(e) {
|
|
4508
|
+
var r;
|
|
4509
|
+
return ((r = t.current) == null ? void 0 : r.getInstanceByDom(e)) || null;
|
|
4510
|
+
},
|
|
4511
|
+
getDomsById(e, r) {
|
|
4512
|
+
var n;
|
|
4513
|
+
return ((n = t.current) == null ? void 0 : n.getDomsById(e, r)) || [];
|
|
4514
|
+
},
|
|
4515
|
+
getDomRectById(e, r) {
|
|
4516
|
+
var n;
|
|
4517
|
+
return ((n = t.current) == null ? void 0 : n.getDomRectById(e, r)) || [];
|
|
4518
|
+
}
|
|
4519
|
+
};
|
|
4520
|
+
};
|
|
4521
|
+
var le = { exports: {} }, zh = le.exports, Ln;
|
|
4522
|
+
function Hh() {
|
|
4523
|
+
return Ln || (Ln = 1, function(t, e) {
|
|
4524
|
+
(function(r, n) {
|
|
4525
|
+
t.exports = n();
|
|
4526
|
+
})(zh, function() {
|
|
4527
|
+
var r = function() {
|
|
4528
|
+
}, n = {}, o = {}, a = {};
|
|
4529
|
+
function s(f, d) {
|
|
4530
|
+
f = f.push ? f : [f];
|
|
4531
|
+
var h = [], v = f.length, b = v, S, j, $, E;
|
|
4532
|
+
for (S = function(D, U) {
|
|
4533
|
+
U.length && h.push(D), b--, b || d(h);
|
|
4534
|
+
}; v--; ) {
|
|
4535
|
+
if (j = f[v], $ = o[j], $) {
|
|
4536
|
+
S(j, $);
|
|
4537
|
+
continue;
|
|
4538
|
+
}
|
|
4539
|
+
E = a[j] = a[j] || [], E.push(S);
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
function i(f, d) {
|
|
4543
|
+
if (f) {
|
|
4544
|
+
var h = a[f];
|
|
4545
|
+
if (o[f] = d, !!h)
|
|
4546
|
+
for (; h.length; )
|
|
4547
|
+
h[0](f, d), h.splice(0, 1);
|
|
4548
|
+
}
|
|
4549
|
+
}
|
|
4550
|
+
function c(f, d) {
|
|
4551
|
+
f.call && (f = { success: f }), d.length ? (f.error || r)(d) : (f.success || r)(f);
|
|
4552
|
+
}
|
|
4553
|
+
function u(f, d, h, v) {
|
|
4554
|
+
var b = document, S = h.async, j = (h.numRetries || 0) + 1, $ = h.before || r, E = f.replace(/[\?|#].*$/, ""), D = f.replace(/^(css|img|module|nomodule)!/, ""), U, Lt, C;
|
|
4555
|
+
if (v = v || 0, /(^css!|\.css$)/.test(E))
|
|
4556
|
+
C = b.createElement("link"), C.rel = "stylesheet", C.href = D, U = "hideFocus" in C, U && C.relList && (U = 0, C.rel = "preload", C.as = "style");
|
|
4557
|
+
else if (/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(E))
|
|
4558
|
+
C = b.createElement("img"), C.src = D;
|
|
4559
|
+
else if (C = b.createElement("script"), C.src = D, C.async = S === void 0 ? !0 : S, Lt = "noModule" in C, /^module!/.test(E)) {
|
|
4560
|
+
if (!Lt) return d(f, "l");
|
|
4561
|
+
C.type = "module";
|
|
4562
|
+
} else if (/^nomodule!/.test(E) && Lt) return d(f, "l");
|
|
4563
|
+
C.onload = C.onerror = C.onbeforeload = function(at) {
|
|
4564
|
+
var ct = at.type[0];
|
|
4565
|
+
if (U)
|
|
4566
|
+
try {
|
|
4567
|
+
C.sheet.cssText.length || (ct = "e");
|
|
4568
|
+
} catch (ae) {
|
|
4569
|
+
ae.code != 18 && (ct = "e");
|
|
4570
|
+
}
|
|
4571
|
+
if (ct == "e") {
|
|
4572
|
+
if (v += 1, v < j)
|
|
4573
|
+
return u(f, d, h, v);
|
|
4574
|
+
} else if (C.rel == "preload" && C.as == "style")
|
|
4575
|
+
return C.rel = "stylesheet";
|
|
4576
|
+
d(f, ct, at.defaultPrevented);
|
|
4577
|
+
}, $(f, C) !== !1 && b.head.appendChild(C);
|
|
4578
|
+
}
|
|
4579
|
+
function l(f, d, h) {
|
|
4580
|
+
f = f.push ? f : [f];
|
|
4581
|
+
var v = f.length, b = v, S = [], j, $;
|
|
4582
|
+
for (j = function(E, D, U) {
|
|
4583
|
+
if (D == "e" && S.push(E), D == "b")
|
|
4584
|
+
if (U) S.push(E);
|
|
4585
|
+
else return;
|
|
4586
|
+
v--, v || d(S);
|
|
4587
|
+
}, $ = 0; $ < b; $++) u(f[$], j, h);
|
|
4588
|
+
}
|
|
4589
|
+
function p(f, d, h) {
|
|
4590
|
+
var v, b;
|
|
4591
|
+
if (d && d.trim && (v = d), b = (v ? h : d) || {}, v) {
|
|
4592
|
+
if (v in n)
|
|
4593
|
+
throw "LoadJS";
|
|
4594
|
+
n[v] = !0;
|
|
4595
|
+
}
|
|
4596
|
+
function S(j, $) {
|
|
4597
|
+
l(f, function(E) {
|
|
4598
|
+
c(b, E), j && c({ success: j, error: $ }, E), i(v, E);
|
|
4599
|
+
}, b);
|
|
4600
|
+
}
|
|
4601
|
+
if (b.returnPromise) return new Promise(S);
|
|
4602
|
+
S();
|
|
4603
|
+
}
|
|
4604
|
+
return p.ready = function(d, h) {
|
|
4605
|
+
return s(d, function(v) {
|
|
4606
|
+
c(h, v);
|
|
4607
|
+
}), p;
|
|
4608
|
+
}, p.done = function(d) {
|
|
4609
|
+
i(d, []);
|
|
4610
|
+
}, p.reset = function() {
|
|
4611
|
+
n = {}, o = {}, a = {};
|
|
4612
|
+
}, p.isDefined = function(d) {
|
|
4613
|
+
return d in n;
|
|
4614
|
+
}, p;
|
|
4615
|
+
});
|
|
4616
|
+
}(le)), le.exports;
|
|
4617
|
+
}
|
|
4618
|
+
var Jh = Hh();
|
|
4619
|
+
const Bn = /* @__PURE__ */ Oh(Jh);
|
|
4620
|
+
class am {
|
|
4621
|
+
constructor(e, r) {
|
|
4622
|
+
y(this, "assets");
|
|
4623
|
+
y(this, "loadStatus");
|
|
4624
|
+
y(this, "win", window);
|
|
4625
|
+
y(this, "_onSuccessList", []);
|
|
4626
|
+
y(this, "_onErrorList", []);
|
|
4627
|
+
this.assets = JSON.parse(JSON.stringify(e || [])), this.loadStatus = "INIT", r != null && r.window && (this.win = r.window);
|
|
4628
|
+
}
|
|
4629
|
+
load(e) {
|
|
4630
|
+
const r = this.assets || [], n = [];
|
|
4631
|
+
for (let o = 0; o < r.length; o++) {
|
|
4632
|
+
const a = r[o];
|
|
4633
|
+
a.id || (a.id = tt()), n.push(a.id);
|
|
4634
|
+
const s = a.resources.map((i) => i.src);
|
|
4635
|
+
s.length && Bn(s, a.id, {
|
|
4636
|
+
async: (e == null ? void 0 : e.async) ?? !1,
|
|
4637
|
+
before: (i, c) => (this.win.document.body.appendChild(c), !1)
|
|
4638
|
+
});
|
|
4639
|
+
}
|
|
4640
|
+
return new Promise((o, a) => {
|
|
4641
|
+
if (r.length === 0) {
|
|
4642
|
+
this._onSuccessList.forEach((s) => s()), o("");
|
|
4643
|
+
return;
|
|
4644
|
+
}
|
|
4645
|
+
Bn.ready(n, {
|
|
4646
|
+
success: () => {
|
|
4647
|
+
this._onSuccessList.forEach((s) => s()), o("");
|
|
4648
|
+
},
|
|
4649
|
+
error: (s) => {
|
|
4650
|
+
this._onErrorList.forEach((i) => i(s)), a(s);
|
|
4651
|
+
}
|
|
4652
|
+
});
|
|
4653
|
+
});
|
|
4654
|
+
}
|
|
4655
|
+
onSuccess(e) {
|
|
4656
|
+
return this._onSuccessList.push(e), this;
|
|
4657
|
+
}
|
|
4658
|
+
onError(e) {
|
|
4659
|
+
return this._onErrorList.push(e), this;
|
|
4660
|
+
}
|
|
4661
|
+
}
|
|
4662
|
+
export {
|
|
4663
|
+
am as AssetLoader,
|
|
4664
|
+
Vh as ComponentInstanceManager,
|
|
4665
|
+
Gh as DefaultDropPlaceholder,
|
|
4666
|
+
jh as DefineReactAdapter,
|
|
4667
|
+
nm as DesignRender,
|
|
4668
|
+
em as ReactAdapter,
|
|
4669
|
+
kh as Render,
|
|
4670
|
+
ph as canAcceptsRef,
|
|
4671
|
+
Xh as collectVariable,
|
|
4672
|
+
dh as compWrapper,
|
|
4673
|
+
hh as convertCodeStringToFunction,
|
|
4674
|
+
gh as findComponentByChainRefer,
|
|
4675
|
+
Kh as flatObject,
|
|
4676
|
+
Pn as formatSourceStylePropertyName,
|
|
4677
|
+
ma as getAdapter,
|
|
4678
|
+
Yh as getCSSTextValue,
|
|
4679
|
+
Zh as getComponentsLibs,
|
|
4680
|
+
mh as getMatchVal,
|
|
4681
|
+
Fe as getNodeCssClassName,
|
|
4682
|
+
Mn as getObjFromArrayMap,
|
|
4683
|
+
tm as getThirdLibs,
|
|
4684
|
+
Qh as isClass,
|
|
4685
|
+
bt as runExpression,
|
|
4686
|
+
fh as shouldConstruct,
|
|
4687
|
+
om as useDesignRender,
|
|
4688
|
+
rm as useRender
|
|
4689
|
+
};
|
|
29
4690
|
//# sourceMappingURL=index.js.map
|