archgine 2.0.2 → 2.0.5

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.
@@ -12,5 +12,4 @@ var e;const i=1001,n="srgb",s="srgb-linear",r="linear",a="srgb",o=2e3;let h=clas
12
12
  * Released under MIT license <https://lodash.com/license>
13
13
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
14
14
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
15
- */ci=pi,di=pi.exports,function(){var t,e="Expected a function",i="__lodash_hash_undefined__",n="__lodash_placeholder__",s=32,r=128,a=256,o=1/0,h=9007199254740991,l=NaN,u=4294967295,c=[["ary",r],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",a]],d="[object Arguments]",p="[object Array]",f="[object Boolean]",m="[object Date]",y="[object Error]",g="[object Function]",v="[object GeneratorFunction]",x="[object Map]",b="[object Number]",_="[object Object]",w="[object Promise]",S="[object RegExp]",M="[object Set]",E="[object String]",A="[object Symbol]",T="[object WeakMap]",I="[object ArrayBuffer]",C="[object DataView]",D="[object Float32Array]",N="[object Float64Array]",B="[object Int8Array]",k="[object Int16Array]",O="[object Int32Array]",P="[object Uint8Array]",L="[object Uint8ClampedArray]",R="[object Uint16Array]",z="[object Uint32Array]",U=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,V=RegExp(q.source),j=RegExp(H.source),Y=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,K=RegExp(Q.source),tt=/^\s+/,et=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nt=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,at=/[()=,{}\[\]\/\s]/,ot=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lt=/\w*$/,ut=/^[-+]0x[0-9a-f]+$/i,ct=/^0b[01]+$/i,dt=/^\[object .+?Constructor\]$/,pt=/^0o[0-7]+$/i,ft=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,gt=/['\n\r\u2028\u2029\\]/g,vt="\\ud800-\\udfff",xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",bt="\\u2700-\\u27bf",_t="a-z\\xdf-\\xf6\\xf8-\\xff",wt="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",Mt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Et="['’]",At="["+vt+"]",Tt="["+Mt+"]",It="["+xt+"]",Ct="\\d+",Dt="["+bt+"]",Nt="["+_t+"]",Bt="[^"+vt+Mt+Ct+bt+_t+wt+"]",kt="\\ud83c[\\udffb-\\udfff]",Ot="[^"+vt+"]",Pt="(?:\\ud83c[\\udde6-\\uddff]){2}",Lt="[\\ud800-\\udbff][\\udc00-\\udfff]",Rt="["+wt+"]",zt="\\u200d",Ut="(?:"+Nt+"|"+Bt+")",Ft="(?:"+Rt+"|"+Bt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+It+"|"+kt+")?",Vt="["+St+"]?",jt=Vt+Ht+"(?:"+zt+"(?:"+[Ot,Pt,Lt].join("|")+")"+Vt+Ht+")*",Yt="(?:"+[Dt,Pt,Lt].join("|")+")"+jt,Gt="(?:"+[Ot+It+"?",It,Pt,Lt,At].join("|")+")",Xt=RegExp(Et,"g"),Zt=RegExp(It,"g"),$t=RegExp(kt+"(?="+kt+")|"+Gt+jt,"g"),Jt=RegExp([Rt+"?"+Nt+"+"+Wt+"(?="+[Tt,Rt,"$"].join("|")+")",Ft+"+"+qt+"(?="+[Tt,Rt+Ut,"$"].join("|")+")",Rt+"?"+Ut+"+"+Wt,Rt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ct,Yt].join("|"),"g"),Qt=RegExp("["+zt+vt+xt+St+"]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,te=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ee=-1,ie={};ie[D]=ie[N]=ie[B]=ie[k]=ie[O]=ie[P]=ie[L]=ie[R]=ie[z]=!0,ie[d]=ie[p]=ie[I]=ie[f]=ie[C]=ie[m]=ie[y]=ie[g]=ie[x]=ie[b]=ie[_]=ie[S]=ie[M]=ie[E]=ie[T]=!1;var ne={};ne[d]=ne[p]=ne[I]=ne[C]=ne[f]=ne[m]=ne[D]=ne[N]=ne[B]=ne[k]=ne[O]=ne[x]=ne[b]=ne[_]=ne[S]=ne[M]=ne[E]=ne[A]=ne[P]=ne[L]=ne[R]=ne[z]=!0,ne[y]=ne[g]=ne[T]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},re=parseFloat,ae=parseInt,oe="object"==typeof li&&li&&li.Object===Object&&li,he="object"==typeof self&&self&&self.Object===Object&&self,le=oe||he||Function("return this")(),ue=di&&!di.nodeType&&di,ce=ue&&ci&&!ci.nodeType&&ci,de=ce&&ce.exports===ue,pe=de&&oe.process,fe=function(){try{var t=ce&&ce.require&&ce.require("util").types;return t||pe&&pe.binding&&pe.binding("util")}catch(t){}}(),me=fe&&fe.isArrayBuffer,ye=fe&&fe.isDate,ge=fe&&fe.isMap,ve=fe&&fe.isRegExp,xe=fe&&fe.isSet,be=fe&&fe.isTypedArray;function _e(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function we(t,e,i,n){for(var s=-1,r=null==t?0:t.length;++s<r;){var a=t[s];e(n,a,i(a),t)}return n}function Se(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}function Me(t,e){for(var i=null==t?0:t.length;i--&&!1!==e(t[i],i,t););return t}function Ee(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(!e(t[i],i,t))return!1;return!0}function Ae(t,e){for(var i=-1,n=null==t?0:t.length,s=0,r=[];++i<n;){var a=t[i];e(a,i,t)&&(r[s++]=a)}return r}function Te(t,e){return!(null==t||!t.length)&&Re(t,e,0)>-1}function Ie(t,e,i){for(var n=-1,s=null==t?0:t.length;++n<s;)if(i(e,t[n]))return!0;return!1}function Ce(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s}function De(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t}function Ne(t,e,i,n){var s=-1,r=null==t?0:t.length;for(n&&r&&(i=t[++s]);++s<r;)i=e(i,t[s],s,t);return i}function Be(t,e,i,n){var s=null==t?0:t.length;for(n&&s&&(i=t[--s]);s--;)i=e(i,t[s],s,t);return i}function ke(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}var Oe=We("length");function Pe(t,e,i){var n;return i(t,(function(t,i,s){if(e(t,i,s))return n=i,!1})),n}function Le(t,e,i,n){for(var s=t.length,r=i+(n?1:-1);n?r--:++r<s;)if(e(t[r],r,t))return r;return-1}function Re(t,e,i){return e==e?function(t,e,i){for(var n=i-1,s=t.length;++n<s;)if(t[n]===e)return n;return-1}(t,e,i):Le(t,Ue,i)}function ze(t,e,i,n){for(var s=i-1,r=t.length;++s<r;)if(n(t[s],e))return s;return-1}function Ue(t){return t!=t}function Fe(t,e){var i=null==t?0:t.length;return i?Ve(t,e)/i:l}function We(e){return function(i){return null==i?t:i[e]}}function qe(e){return function(i){return null==e?t:e[i]}}function He(t,e,i,n,s){return s(t,(function(t,s,r){i=n?(n=!1,t):e(i,t,s,r)})),i}function Ve(e,i){for(var n,s=-1,r=e.length;++s<r;){var a=i(e[s]);a!==t&&(n=n===t?a:n+a)}return n}function je(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}function Ye(t){return t?t.slice(0,hi(t)+1).replace(tt,""):t}function Ge(t){return function(e){return t(e)}}function Xe(t,e){return Ce(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function $e(t,e){for(var i=-1,n=t.length;++i<n&&Re(e,t[i],0)>-1;);return i}function Je(t,e){for(var i=t.length;i--&&Re(e,t[i],0)>-1;);return i}var Qe=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ke=qe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ti(t){return"\\"+se[t]}function ei(t){return Qt.test(t)}function ii(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function ni(t,e){return function(i){return t(e(i))}}function si(t,e){for(var i=-1,s=t.length,r=0,a=[];++i<s;){var o=t[i];o!==e&&o!==n||(t[i]=n,a[r++]=i)}return a}function ri(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}function ai(t){return ei(t)?function(t){for(var e=$t.lastIndex=0;$t.test(t);)++e;return e}(t):Oe(t)}function oi(t){return ei(t)?function(t){return t.match($t)||[]}(t):function(t){return t.split("")}(t)}function hi(t){for(var e=t.length;e--&&et.test(t.charAt(e)););return e}var ui=qe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pi=function et(vt){var xt,bt=(vt=null==vt?le:pi.defaults(le.Object(),vt,pi.pick(le,te))).Array,_t=vt.Date,wt=vt.Error,St=vt.Function,Mt=vt.Math,Et=vt.Object,At=vt.RegExp,Tt=vt.String,It=vt.TypeError,Ct=bt.prototype,Dt=St.prototype,Nt=Et.prototype,Bt=vt["__core-js_shared__"],kt=Dt.toString,Ot=Nt.hasOwnProperty,Pt=0,Lt=(xt=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+xt:"",Rt=Nt.toString,zt=kt.call(Et),Ut=le._,Ft=At("^"+kt.call(Ot).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wt=de?vt.Buffer:t,qt=vt.Symbol,Ht=vt.Uint8Array,Vt=Wt?Wt.allocUnsafe:t,jt=ni(Et.getPrototypeOf,Et),Yt=Et.create,Gt=Nt.propertyIsEnumerable,$t=Ct.splice,Qt=qt?qt.isConcatSpreadable:t,se=qt?qt.iterator:t,oe=qt?qt.toStringTag:t,he=function(){try{var t=lr(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=vt.clearTimeout!==le.clearTimeout&&vt.clearTimeout,ce=_t&&_t.now!==le.Date.now&&_t.now,pe=vt.setTimeout!==le.setTimeout&&vt.setTimeout,fe=Mt.ceil,Oe=Mt.floor,qe=Et.getOwnPropertySymbols,li=Wt?Wt.isBuffer:t,ci=vt.isFinite,di=Ct.join,fi=ni(Et.keys,Et),mi=Mt.max,yi=Mt.min,gi=_t.now,vi=vt.parseInt,xi=Mt.random,bi=Ct.reverse,_i=lr(vt,"DataView"),wi=lr(vt,"Map"),Si=lr(vt,"Promise"),Mi=lr(vt,"Set"),Ei=lr(vt,"WeakMap"),Ai=lr(Et,"create"),Ti=Ei&&new Ei,Ii={},Ci=zr(_i),Di=zr(wi),Ni=zr(Si),Bi=zr(Mi),ki=zr(Ei),Oi=qt?qt.prototype:t,Pi=Oi?Oi.valueOf:t,Li=Oi?Oi.toString:t;function Ri(t){if(eo(t)&&!Va(t)&&!(t instanceof Wi)){if(t instanceof Fi)return t;if(Ot.call(t,"__wrapped__"))return Ur(t)}return new Fi(t)}var zi=function(){function e(){}return function(i){if(!to(i))return{};if(Yt)return Yt(i);e.prototype=i;var n=new e;return e.prototype=t,n}}();function Ui(){}function Fi(e,i){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=t}function Wi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=u,this.__views__=[]}function qi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Hi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Vi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function ji(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new Vi;++e<i;)this.add(t[e])}function Yi(t){var e=this.__data__=new Hi(t);this.size=e.size}function Gi(t,e){var i=Va(t),n=!i&&Ha(t),s=!i&&!n&&Xa(t),r=!i&&!n&&!s&&lo(t),a=i||n||s||r,o=a?je(t.length,Tt):[],h=o.length;for(var l in t)!e&&!Ot.call(t,l)||a&&("length"==l||s&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||yr(l,h))||o.push(l);return o}function Xi(e){var i=e.length;return i?e[Yn(0,i-1)]:t}function Zi(t,e){return Br(Ts(t),rn(e,0,t.length))}function $i(t){return Br(Ts(t))}function Ji(e,i,n){(n!==t&&!Fa(e[i],n)||n===t&&!(i in e))&&nn(e,i,n)}function Qi(e,i,n){var s=e[i];Ot.call(e,i)&&Fa(s,n)&&(n!==t||i in e)||nn(e,i,n)}function Ki(t,e){for(var i=t.length;i--;)if(Fa(t[i][0],e))return i;return-1}function tn(t,e,i,n){return un(t,(function(t,s,r){e(n,t,i(t),r)})),n}function en(t,e){return t&&Is(e,Bo(e),t)}function nn(t,e,i){"__proto__"==e&&he?he(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function sn(e,i){for(var n=-1,s=i.length,r=bt(s),a=null==e;++n<s;)r[n]=a?t:To(e,i[n]);return r}function rn(e,i,n){return e==e&&(n!==t&&(e=e<=n?e:n),i!==t&&(e=e>=i?e:i)),e}function an(e,i,n,s,r,a){var o,h=1&i,l=2&i,u=4&i;if(n&&(o=r?n(e,s,r,a):n(e)),o!==t)return o;if(!to(e))return e;var c=Va(e);if(c){if(o=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&Ot.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(e),!h)return Ts(e,o)}else{var p=dr(e),y=p==g||p==v;if(Xa(e))return _s(e,h);if(p==_||p==d||y&&!r){if(o=l||y?{}:fr(e),!h)return l?function(t,e){return Is(t,cr(t),e)}(e,function(t,e){return t&&Is(e,ko(e),t)}(o,e)):function(t,e){return Is(t,ur(t),e)}(e,en(o,e))}else{if(!ne[p])return r?e:{};o=function(t,e,i){var n,s=t.constructor;switch(e){case I:return ws(t);case f:case m:return new s(+t);case C:return function(t,e){var i=e?ws(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,i);case D:case N:case B:case k:case O:case P:case L:case R:case z:return Ss(t,i);case x:return new s;case b:case E:return new s(t);case S:return function(t){var e=new t.constructor(t.source,lt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new s;case A:return n=t,Pi?Et(Pi.call(n)):{}}}(e,p,h)}}a||(a=new Yi);var w=a.get(e);if(w)return w;a.set(e,o),ao(e)?e.forEach((function(t){o.add(an(t,i,n,t,e,a))})):io(e)&&e.forEach((function(t,s){o.set(s,an(t,i,n,s,e,a))}));var T=c?t:(u?l?ir:er:l?ko:Bo)(e);return Se(T||e,(function(t,s){T&&(t=e[s=t]),Qi(o,s,an(t,i,n,s,e,a))})),o}function on(e,i,n){var s=n.length;if(null==e)return!s;for(e=Et(e);s--;){var r=n[s],a=i[r],o=e[r];if(o===t&&!(r in e)||!a(o))return!1}return!0}function hn(i,n,s){if("function"!=typeof i)throw new It(e);return Ir((function(){i.apply(t,s)}),n)}function ln(t,e,i,n){var s=-1,r=Te,a=!0,o=t.length,h=[],l=e.length;if(!o)return h;i&&(e=Ce(e,Ge(i))),n?(r=Ie,a=!1):e.length>=200&&(r=Ze,a=!1,e=new ji(e));t:for(;++s<o;){var u=t[s],c=null==i?u:i(u);if(u=n||0!==u?u:0,a&&c==c){for(var d=l;d--;)if(e[d]===c)continue t;h.push(u)}else r(e,c,n)||h.push(u)}return h}Ri.templateSettings={escape:Y,evaluate:G,interpolate:X,variable:"",imports:{_:Ri}},Ri.prototype=Ui.prototype,Ri.prototype.constructor=Ri,Fi.prototype=zi(Ui.prototype),Fi.prototype.constructor=Fi,Wi.prototype=zi(Ui.prototype),Wi.prototype.constructor=Wi,qi.prototype.clear=function(){this.__data__=Ai?Ai(null):{},this.size=0},qi.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qi.prototype.get=function(e){var n=this.__data__;if(Ai){var s=n[e];return s===i?t:s}return Ot.call(n,e)?n[e]:t},qi.prototype.has=function(e){var i=this.__data__;return Ai?i[e]!==t:Ot.call(i,e)},qi.prototype.set=function(e,n){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Ai&&n===t?i:n,this},Hi.prototype.clear=function(){this.__data__=[],this.size=0},Hi.prototype.delete=function(t){var e=this.__data__,i=Ki(e,t);return!(i<0||(i==e.length-1?e.pop():$t.call(e,i,1),--this.size,0))},Hi.prototype.get=function(e){var i=this.__data__,n=Ki(i,e);return n<0?t:i[n][1]},Hi.prototype.has=function(t){return Ki(this.__data__,t)>-1},Hi.prototype.set=function(t,e){var i=this.__data__,n=Ki(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},Vi.prototype.clear=function(){this.size=0,this.__data__={hash:new qi,map:new(wi||Hi),string:new qi}},Vi.prototype.delete=function(t){var e=or(this,t).delete(t);return this.size-=e?1:0,e},Vi.prototype.get=function(t){return or(this,t).get(t)},Vi.prototype.has=function(t){return or(this,t).has(t)},Vi.prototype.set=function(t,e){var i=or(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},ji.prototype.add=ji.prototype.push=function(t){return this.__data__.set(t,i),this},ji.prototype.has=function(t){return this.__data__.has(t)},Yi.prototype.clear=function(){this.__data__=new Hi,this.size=0},Yi.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Yi.prototype.get=function(t){return this.__data__.get(t)},Yi.prototype.has=function(t){return this.__data__.has(t)},Yi.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Hi){var n=i.__data__;if(!wi||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new Vi(n)}return i.set(t,e),this.size=i.size,this};var un=Ns(vn),cn=Ns(xn,!0);function dn(t,e){var i=!0;return un(t,(function(t,n,s){return i=!!e(t,n,s)})),i}function pn(e,i,n){for(var s=-1,r=e.length;++s<r;){var a=e[s],o=i(a);if(null!=o&&(h===t?o==o&&!ho(o):n(o,h)))var h=o,l=a}return l}function fn(t,e){var i=[];return un(t,(function(t,n,s){e(t,n,s)&&i.push(t)})),i}function mn(t,e,i,n,s){var r=-1,a=t.length;for(i||(i=mr),s||(s=[]);++r<a;){var o=t[r];e>0&&i(o)?e>1?mn(o,e-1,i,n,s):De(s,o):n||(s[s.length]=o)}return s}var yn=Bs(),gn=Bs(!0);function vn(t,e){return t&&yn(t,e,Bo)}function xn(t,e){return t&&gn(t,e,Bo)}function bn(t,e){return Ae(e,(function(e){return Ja(t[e])}))}function _n(e,i){for(var n=0,s=(i=gs(i,e)).length;null!=e&&n<s;)e=e[Rr(i[n++])];return n&&n==s?e:t}function wn(t,e,i){var n=e(t);return Va(t)?n:De(n,i(t))}function Sn(e){return null==e?e===t?"[object Undefined]":"[object Null]":oe&&oe in Et(e)?function(e){var i=Ot.call(e,oe),n=e[oe];try{e[oe]=t;var s=!0}catch(t){}var r=Rt.call(e);return s&&(i?e[oe]=n:delete e[oe]),r}(e):function(t){return Rt.call(t)}(e)}function Mn(t,e){return t>e}function En(t,e){return null!=t&&Ot.call(t,e)}function An(t,e){return null!=t&&e in Et(t)}function Tn(e,i,n){for(var s=n?Ie:Te,r=e[0].length,a=e.length,o=a,h=bt(a),l=1/0,u=[];o--;){var c=e[o];o&&i&&(c=Ce(c,Ge(i))),l=yi(c.length,l),h[o]=!n&&(i||r>=120&&c.length>=120)?new ji(o&&c):t}c=e[0];var d=-1,p=h[0];t:for(;++d<r&&u.length<l;){var f=c[d],m=i?i(f):f;if(f=n||0!==f?f:0,!(p?Ze(p,m):s(u,m,n))){for(o=a;--o;){var y=h[o];if(!(y?Ze(y,m):s(e[o],m,n)))continue t}p&&p.push(m),u.push(f)}}return u}function In(e,i,n){var s=null==(e=Er(e,i=gs(i,e)))?e:e[Rr($r(i))];return null==s?t:_e(s,e,n)}function Cn(t){return eo(t)&&Sn(t)==d}function Dn(e,i,n,s,r){return e===i||(null==e||null==i||!eo(e)&&!eo(i)?e!=e&&i!=i:function(e,i,n,s,r,a){var o=Va(e),h=Va(i),l=o?p:dr(e),u=h?p:dr(i),c=(l=l==d?_:l)==_,g=(u=u==d?_:u)==_,v=l==u;if(v&&Xa(e)){if(!Xa(i))return!1;o=!0,c=!1}if(v&&!c)return a||(a=new Yi),o||lo(e)?Ks(e,i,n,s,r,a):function(t,e,i,n,s,r,a){switch(i){case C:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case I:return!(t.byteLength!=e.byteLength||!r(new Ht(t),new Ht(e)));case f:case m:case b:return Fa(+t,+e);case y:return t.name==e.name&&t.message==e.message;case S:case E:return t==e+"";case x:var o=ii;case M:var h=1&n;if(o||(o=ri),t.size!=e.size&&!h)return!1;var l=a.get(t);if(l)return l==e;n|=2,a.set(t,e);var u=Ks(o(t),o(e),n,s,r,a);return a.delete(t),u;case A:if(Pi)return Pi.call(t)==Pi.call(e)}return!1}(e,i,l,n,s,r,a);if(!(1&n)){var w=c&&Ot.call(e,"__wrapped__"),T=g&&Ot.call(i,"__wrapped__");if(w||T){var D=w?e.value():e,N=T?i.value():i;return a||(a=new Yi),r(D,N,n,s,a)}}return!!v&&(a||(a=new Yi),function(e,i,n,s,r,a){var o=1&n,h=er(e),l=h.length,u=er(i),c=u.length;if(l!=c&&!o)return!1;for(var d=l;d--;){var p=h[d];if(!(o?p in i:Ot.call(i,p)))return!1}var f=a.get(e),m=a.get(i);if(f&&m)return f==i&&m==e;var y=!0;a.set(e,i),a.set(i,e);for(var g=o;++d<l;){var v=e[p=h[d]],x=i[p];if(s)var b=o?s(x,v,p,i,e,a):s(v,x,p,e,i,a);if(!(b===t?v===x||r(v,x,n,s,a):b)){y=!1;break}g||(g="constructor"==p)}if(y&&!g){var _=e.constructor,w=i.constructor;_==w||!("constructor"in e)||!("constructor"in i)||"function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w||(y=!1)}return a.delete(e),a.delete(i),y}(e,i,n,s,r,a))}(e,i,n,s,Dn,r))}function Nn(e,i,n,s){var r=n.length,a=r,o=!s;if(null==e)return!a;for(e=Et(e);r--;){var h=n[r];if(o&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++r<a;){var l=(h=n[r])[0],u=e[l],c=h[1];if(o&&h[2]){if(u===t&&!(l in e))return!1}else{var d=new Yi;if(s)var p=s(u,c,l,e,i,d);if(!(p===t?Dn(c,u,3,s,d):p))return!1}}return!0}function Bn(t){return!(!to(t)||(e=t,Lt&&Lt in e))&&(Ja(t)?Ft:dt).test(zr(t));var e}function kn(t){return"function"==typeof t?t:null==t?sh:"object"==typeof t?Va(t)?Un(t[0],t[1]):zn(t):ph(t)}function On(t){if(!_r(t))return fi(t);var e=[];for(var i in Et(t))Ot.call(t,i)&&"constructor"!=i&&e.push(i);return e}function Pn(t){if(!to(t))return function(t){var e=[];if(null!=t)for(var i in Et(t))e.push(i);return e}(t);var e=_r(t),i=[];for(var n in t)("constructor"!=n||!e&&Ot.call(t,n))&&i.push(n);return i}function Ln(t,e){return t<e}function Rn(t,e){var i=-1,n=Ya(t)?bt(t.length):[];return un(t,(function(t,s,r){n[++i]=e(t,s,r)})),n}function zn(t){var e=hr(t);return 1==e.length&&e[0][2]?Sr(e[0][0],e[0][1]):function(i){return i===t||Nn(i,t,e)}}function Un(e,i){return vr(e)&&wr(i)?Sr(Rr(e),i):function(n){var s=To(n,e);return s===t&&s===i?Io(n,e):Dn(i,s,3)}}function Fn(e,i,n,s,r){e!==i&&yn(i,(function(a,o){if(r||(r=new Yi),to(a))!function(e,i,n,s,r,a,o){var h=Ar(e,n),l=Ar(i,n),u=o.get(l);if(u)Ji(e,n,u);else{var c=a?a(h,l,n+"",e,i,o):t,d=c===t;if(d){var p=Va(l),f=!p&&Xa(l),m=!p&&!f&&lo(l);c=l,p||f||m?Va(h)?c=h:Ga(h)?c=Ts(h):f?(d=!1,c=_s(l,!0)):m?(d=!1,c=Ss(l,!0)):c=[]:so(l)||Ha(l)?(c=h,Ha(h)?c=vo(h):to(h)&&!Ja(h)||(c=fr(l))):d=!1}d&&(o.set(l,c),r(c,l,s,a,o),o.delete(l)),Ji(e,n,c)}}(e,i,o,n,Fn,s,r);else{var h=s?s(Ar(e,o),a,o+"",e,i,r):t;h===t&&(h=a),Ji(e,o,h)}}),ko)}function Wn(e,i){var n=e.length;if(n)return yr(i+=i<0?n:0,n)?e[i]:t}function qn(t,e,i){e=e.length?Ce(e,(function(t){return Va(t)?function(e){return _n(e,1===t.length?t[0]:t)}:t})):[sh];var n=-1;return e=Ce(e,Ge(ar())),function(t,e){var i=t.length;for(t.sort(e);i--;)t[i]=t[i].value;return t}(Rn(t,(function(t,i,s){return{criteria:Ce(e,(function(e){return e(t)})),index:++n,value:t}})),(function(t,e){return function(t,e,i){for(var n=-1,s=t.criteria,r=e.criteria,a=s.length,o=i.length;++n<a;){var h=Ms(s[n],r[n]);if(h)return n>=o?h:h*("desc"==i[n]?-1:1)}return t.index-e.index}(t,e,i)}))}function Hn(t,e,i){for(var n=-1,s=e.length,r={};++n<s;){var a=e[n],o=_n(t,a);i(o,a)&&Jn(r,gs(a,t),o)}return r}function Vn(t,e,i,n){var s=n?ze:Re,r=-1,a=e.length,o=t;for(t===e&&(e=Ts(e)),i&&(o=Ce(t,Ge(i)));++r<a;)for(var h=0,l=e[r],u=i?i(l):l;(h=s(o,u,h,n))>-1;)o!==t&&$t.call(o,h,1),$t.call(t,h,1);return t}function jn(t,e){for(var i=t?e.length:0,n=i-1;i--;){var s=e[i];if(i==n||s!==r){var r=s;yr(s)?$t.call(t,s,1):ls(t,s)}}return t}function Yn(t,e){return t+Oe(xi()*(e-t+1))}function Gn(t,e){var i="";if(!t||e<1||e>h)return i;do{e%2&&(i+=t),(e=Oe(e/2))&&(t+=t)}while(e);return i}function Xn(t,e){return Cr(Mr(t,e,sh),t+"")}function Zn(t){return Xi(Wo(t))}function $n(t,e){var i=Wo(t);return Br(i,rn(e,0,i.length))}function Jn(e,i,n,s){if(!to(e))return e;for(var r=-1,a=(i=gs(i,e)).length,o=a-1,h=e;null!=h&&++r<a;){var l=Rr(i[r]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(r!=o){var c=h[l];(u=s?s(c,l,h):t)===t&&(u=to(c)?c:yr(i[r+1])?[]:{})}Qi(h,l,u),h=h[l]}return e}var Qn=Ti?function(t,e){return Ti.set(t,e),t}:sh,Kn=he?function(t,e){return he(t,"toString",{configurable:!0,enumerable:!1,value:eh(e),writable:!0})}:sh;function ts(t){return Br(Wo(t))}function es(t,e,i){var n=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var r=bt(s);++n<s;)r[n]=t[n+e];return r}function is(t,e){var i;return un(t,(function(t,n,s){return!(i=e(t,n,s))})),!!i}function ns(t,e,i){var n=0,s=null==t?n:t.length;if("number"==typeof e&&e==e&&s<=2147483647){for(;n<s;){var r=n+s>>>1,a=t[r];null!==a&&!ho(a)&&(i?a<=e:a<e)?n=r+1:s=r}return s}return ss(t,e,sh,i)}function ss(e,i,n,s){var r=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(i=n(i))!=i,h=null===i,l=ho(i),u=i===t;r<a;){var c=Oe((r+a)/2),d=n(e[c]),p=d!==t,f=null===d,m=d==d,y=ho(d);if(o)var g=s||m;else g=u?m&&(s||p):h?m&&p&&(s||!f):l?m&&p&&!f&&(s||!y):!f&&!y&&(s?d<=i:d<i);g?r=c+1:a=c}return yi(a,4294967294)}function rs(t,e){for(var i=-1,n=t.length,s=0,r=[];++i<n;){var a=t[i],o=e?e(a):a;if(!i||!Fa(o,h)){var h=o;r[s++]=0===a?0:a}}return r}function as(t){return"number"==typeof t?t:ho(t)?l:+t}function os(t){if("string"==typeof t)return t;if(Va(t))return Ce(t,os)+"";if(ho(t))return Li?Li.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function hs(t,e,i){var n=-1,s=Te,r=t.length,a=!0,o=[],h=o;if(i)a=!1,s=Ie;else if(r>=200){var l=e?null:Gs(t);if(l)return ri(l);a=!1,s=Ze,h=new ji}else h=e?[]:o;t:for(;++n<r;){var u=t[n],c=e?e(u):u;if(u=i||0!==u?u:0,a&&c==c){for(var d=h.length;d--;)if(h[d]===c)continue t;e&&h.push(c),o.push(u)}else s(h,c,i)||(h!==o&&h.push(c),o.push(u))}return o}function ls(t,e){return null==(t=Er(t,e=gs(e,t)))||delete t[Rr($r(e))]}function us(t,e,i,n){return Jn(t,e,i(_n(t,e)),n)}function cs(t,e,i,n){for(var s=t.length,r=n?s:-1;(n?r--:++r<s)&&e(t[r],r,t););return i?es(t,n?0:r,n?r+1:s):es(t,n?r+1:0,n?s:r)}function ds(t,e){var i=t;return i instanceof Wi&&(i=i.value()),Ne(e,(function(t,e){return e.func.apply(e.thisArg,De([t],e.args))}),i)}function ps(t,e,i){var n=t.length;if(n<2)return n?hs(t[0]):[];for(var s=-1,r=bt(n);++s<n;)for(var a=t[s],o=-1;++o<n;)o!=s&&(r[s]=ln(r[s]||a,t[o],e,i));return hs(mn(r,1),e,i)}function fs(e,i,n){for(var s=-1,r=e.length,a=i.length,o={};++s<r;){var h=s<a?i[s]:t;n(o,e[s],h)}return o}function ms(t){return Ga(t)?t:[]}function ys(t){return"function"==typeof t?t:sh}function gs(t,e){return Va(t)?t:vr(t,e)?[t]:Lr(xo(t))}var vs=Xn;function xs(e,i,n){var s=e.length;return n=n===t?s:n,!i&&n>=s?e:es(e,i,n)}var bs=ue||function(t){return le.clearTimeout(t)};function _s(t,e){if(e)return t.slice();var i=t.length,n=Vt?Vt(i):new t.constructor(i);return t.copy(n),n}function ws(t){var e=new t.constructor(t.byteLength);return new Ht(e).set(new Ht(t)),e}function Ss(t,e){var i=e?ws(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Ms(e,i){if(e!==i){var n=e!==t,s=null===e,r=e==e,a=ho(e),o=i!==t,h=null===i,l=i==i,u=ho(i);if(!h&&!u&&!a&&e>i||a&&o&&l&&!h&&!u||s&&o&&l||!n&&l||!r)return 1;if(!s&&!a&&!u&&e<i||u&&n&&r&&!s&&!a||h&&n&&r||!o&&r||!l)return-1}return 0}function Es(t,e,i,n){for(var s=-1,r=t.length,a=i.length,o=-1,h=e.length,l=mi(r-a,0),u=bt(h+l),c=!n;++o<h;)u[o]=e[o];for(;++s<a;)(c||s<r)&&(u[i[s]]=t[s]);for(;l--;)u[o++]=t[s++];return u}function As(t,e,i,n){for(var s=-1,r=t.length,a=-1,o=i.length,h=-1,l=e.length,u=mi(r-o,0),c=bt(u+l),d=!n;++s<u;)c[s]=t[s];for(var p=s;++h<l;)c[p+h]=e[h];for(;++a<o;)(d||s<r)&&(c[p+i[a]]=t[s++]);return c}function Ts(t,e){var i=-1,n=t.length;for(e||(e=bt(n));++i<n;)e[i]=t[i];return e}function Is(e,i,n,s){var r=!n;n||(n={});for(var a=-1,o=i.length;++a<o;){var h=i[a],l=s?s(n[h],e[h],h,n,e):t;l===t&&(l=e[h]),r?nn(n,h,l):Qi(n,h,l)}return n}function Cs(t,e){return function(i,n){var s=Va(i)?we:tn,r=e?e():{};return s(i,t,ar(n,2),r)}}function Ds(e){return Xn((function(i,n){var s=-1,r=n.length,a=r>1?n[r-1]:t,o=r>2?n[2]:t;for(a=e.length>3&&"function"==typeof a?(r--,a):t,o&&gr(n[0],n[1],o)&&(a=r<3?t:a,r=1),i=Et(i);++s<r;){var h=n[s];h&&e(i,h,s,a)}return i}))}function Ns(t,e){return function(i,n){if(null==i)return i;if(!Ya(i))return t(i,n);for(var s=i.length,r=e?s:-1,a=Et(i);(e?r--:++r<s)&&!1!==n(a[r],r,a););return i}}function Bs(t){return function(e,i,n){for(var s=-1,r=Et(e),a=n(e),o=a.length;o--;){var h=a[t?o:++s];if(!1===i(r[h],h,r))break}return e}}function ks(e){return function(i){var n=ei(i=xo(i))?oi(i):t,s=n?n[0]:i.charAt(0),r=n?xs(n,1).join(""):i.slice(1);return s[e]()+r}}function Os(t){return function(e){return Ne(Qo(Vo(e).replace(Xt,"")),t,"")}}function Ps(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var i=zi(t.prototype),n=t.apply(i,e);return to(n)?n:i}}function Ls(e){return function(i,n,s){var r=Et(i);if(!Ya(i)){var a=ar(n,3);i=Bo(i),n=function(t){return a(r[t],t,r)}}var o=e(i,n,s);return o>-1?r[a?i[o]:o]:t}}function Rs(i){return tr((function(n){var s=n.length,r=s,a=Fi.prototype.thru;for(i&&n.reverse();r--;){var o=n[r];if("function"!=typeof o)throw new It(e);if(a&&!h&&"wrapper"==sr(o))var h=new Fi([],!0)}for(r=h?r:s;++r<s;){var l=sr(o=n[r]),u="wrapper"==l?nr(o):t;h=u&&xr(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?h[sr(u[0])].apply(h,u[3]):1==o.length&&xr(o)?h[l]():h.thru(o)}return function(){var t=arguments,e=t[0];if(h&&1==t.length&&Va(e))return h.plant(e).value();for(var i=0,r=s?n[i].apply(this,t):e;++i<s;)r=n[i].call(this,r);return r}}))}function zs(e,i,n,s,a,o,h,l,u,c){var d=i&r,p=1&i,f=2&i,m=24&i,y=512&i,g=f?t:Ps(e);return function r(){for(var v=arguments.length,x=bt(v),b=v;b--;)x[b]=arguments[b];if(m)var _=rr(r),w=function(t,e){for(var i=t.length,n=0;i--;)t[i]===e&&++n;return n}(x,_);if(s&&(x=Es(x,s,a,m)),o&&(x=As(x,o,h,m)),v-=w,m&&v<c){var S=si(x,_);return js(e,i,zs,r.placeholder,n,x,S,l,u,c-v)}var M=p?n:this,E=f?M[e]:e;return v=x.length,l?x=function(e,i){for(var n=e.length,s=yi(i.length,n),r=Ts(e);s--;){var a=i[s];e[s]=yr(a,n)?r[a]:t}return e}(x,l):y&&v>1&&x.reverse(),d&&u<v&&(x.length=u),this&&this!==le&&this instanceof r&&(E=g||Ps(E)),E.apply(M,x)}}function Us(t,e){return function(i,n){return function(t,e,i,n){return vn(t,(function(t,s,r){e(n,i(t),s,r)})),n}(i,t,e(n),{})}}function Fs(e,i){return function(n,s){var r;if(n===t&&s===t)return i;if(n!==t&&(r=n),s!==t){if(r===t)return s;"string"==typeof n||"string"==typeof s?(n=os(n),s=os(s)):(n=as(n),s=as(s)),r=e(n,s)}return r}}function Ws(t){return tr((function(e){return e=Ce(e,Ge(ar())),Xn((function(i){var n=this;return t(e,(function(t){return _e(t,n,i)}))}))}))}function qs(e,i){var n=(i=i===t?" ":os(i)).length;if(n<2)return n?Gn(i,e):i;var s=Gn(i,fe(e/ai(i)));return ei(i)?xs(oi(s),0,e).join(""):s.slice(0,e)}function Hs(e){return function(i,n,s){return s&&"number"!=typeof s&&gr(i,n,s)&&(n=s=t),i=fo(i),n===t?(n=i,i=0):n=fo(n),function(t,e,i,n){for(var s=-1,r=mi(fe((e-t)/(i||1)),0),a=bt(r);r--;)a[n?r:++s]=t,t+=i;return a}(i,n,s=s===t?i<n?1:-1:fo(s),e)}}function Vs(t){return function(e,i){return"string"==typeof e&&"string"==typeof i||(e=go(e),i=go(i)),t(e,i)}}function js(e,i,n,r,a,o,h,l,u,c){var d=8&i;i|=d?s:64,4&(i&=~(d?64:s))||(i&=-4);var p=[e,i,a,d?o:t,d?h:t,d?t:o,d?t:h,l,u,c],f=n.apply(t,p);return xr(e)&&Tr(f,p),f.placeholder=r,Dr(f,e,i)}function Ys(t){var e=Mt[t];return function(t,i){if(t=go(t),(i=null==i?0:yi(mo(i),292))&&ci(t)){var n=(xo(t)+"e").split("e");return+((n=(xo(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}var Gs=Mi&&1/ri(new Mi([,-0]))[1]==o?function(t){return new Mi(t)}:lh;function Xs(t){return function(e){var i=dr(e);return i==x?ii(e):i==M?function(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=[t,t]})),i}(e):function(t,e){return Ce(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Zs(i,o,h,l,u,c,d,p){var f=2&o;if(!f&&"function"!=typeof i)throw new It(e);var m=l?l.length:0;if(m||(o&=-97,l=u=t),d=d===t?d:mi(mo(d),0),p=p===t?p:mo(p),m-=u?u.length:0,64&o){var y=l,g=u;l=u=t}var v=f?t:nr(i),x=[i,o,h,l,u,y,g,c,d,p];if(v&&function(t,e){var i=t[1],s=e[1],o=i|s,h=o<131,l=s==r&&8==i||s==r&&i==a&&t[7].length<=e[8]||384==s&&e[7].length<=e[8]&&8==i;if(!h&&!l)return t;1&s&&(t[2]=e[2],o|=1&i?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?Es(c,u,e[4]):u,t[4]=c?si(t[3],n):e[4]}(u=e[5])&&(c=t[5],t[5]=c?As(c,u,e[6]):u,t[6]=c?si(t[5],n):e[6]),(u=e[7])&&(t[7]=u),s&r&&(t[8]=null==t[8]?e[8]:yi(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(x,v),i=x[0],o=x[1],h=x[2],l=x[3],u=x[4],!(p=x[9]=x[9]===t?f?0:i.length:mi(x[9]-m,0))&&24&o&&(o&=-25),o&&1!=o)b=8==o||16==o?function(e,i,n){var s=Ps(e);return function r(){for(var a=arguments.length,o=bt(a),h=a,l=rr(r);h--;)o[h]=arguments[h];var u=a<3&&o[0]!==l&&o[a-1]!==l?[]:si(o,l);return(a-=u.length)<n?js(e,i,zs,r.placeholder,t,o,u,t,t,n-a):_e(this&&this!==le&&this instanceof r?s:e,this,o)}}(i,o,p):o!=s&&33!=o||u.length?zs.apply(t,x):function(t,e,i,n){var s=1&e,r=Ps(t);return function e(){for(var a=-1,o=arguments.length,h=-1,l=n.length,u=bt(l+o),c=this&&this!==le&&this instanceof e?r:t;++h<l;)u[h]=n[h];for(;o--;)u[h++]=arguments[++a];return _e(c,s?i:this,u)}}(i,o,h,l);else var b=function(t,e,i){var n=1&e,s=Ps(t);return function e(){return(this&&this!==le&&this instanceof e?s:t).apply(n?i:this,arguments)}}(i,o,h);return Dr((v?Qn:Tr)(b,x),i,o)}function $s(e,i,n,s){return e===t||Fa(e,Nt[n])&&!Ot.call(s,n)?i:e}function Js(e,i,n,s,r,a){return to(e)&&to(i)&&(a.set(i,e),Fn(e,i,t,Js,a),a.delete(i)),e}function Qs(e){return so(e)?t:e}function Ks(e,i,n,s,r,a){var o=1&n,h=e.length,l=i.length;if(h!=l&&!(o&&l>h))return!1;var u=a.get(e),c=a.get(i);if(u&&c)return u==i&&c==e;var d=-1,p=!0,f=2&n?new ji:t;for(a.set(e,i),a.set(i,e);++d<h;){var m=e[d],y=i[d];if(s)var g=o?s(y,m,d,i,e,a):s(m,y,d,e,i,a);if(g!==t){if(g)continue;p=!1;break}if(f){if(!ke(i,(function(t,e){if(!Ze(f,e)&&(m===t||r(m,t,n,s,a)))return f.push(e)}))){p=!1;break}}else if(m!==y&&!r(m,y,n,s,a)){p=!1;break}}return a.delete(e),a.delete(i),p}function tr(e){return Cr(Mr(e,t,jr),e+"")}function er(t){return wn(t,Bo,ur)}function ir(t){return wn(t,ko,cr)}var nr=Ti?function(t){return Ti.get(t)}:lh;function sr(t){for(var e=t.name+"",i=Ii[e],n=Ot.call(Ii,e)?i.length:0;n--;){var s=i[n],r=s.func;if(null==r||r==t)return s.name}return e}function rr(t){return(Ot.call(Ri,"placeholder")?Ri:t).placeholder}function ar(){var t=Ri.iteratee||rh;return t=t===rh?kn:t,arguments.length?t(arguments[0],arguments[1]):t}function or(t,e){var i,n,s=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof e?"string":"hash"]:s.map}function hr(t){for(var e=Bo(t),i=e.length;i--;){var n=e[i],s=t[n];e[i]=[n,s,wr(s)]}return e}function lr(e,i){var n=function(e,i){return null==e?t:e[i]}(e,i);return Bn(n)?n:t}var ur=qe?function(t){return null==t?[]:(t=Et(t),Ae(qe(t),(function(e){return Gt.call(t,e)})))}:yh,cr=qe?function(t){for(var e=[];t;)De(e,ur(t)),t=jt(t);return e}:yh,dr=Sn;function pr(t,e,i){for(var n=-1,s=(e=gs(e,t)).length,r=!1;++n<s;){var a=Rr(e[n]);if(!(r=null!=t&&i(t,a)))break;t=t[a]}return r||++n!=s?r:!!(s=null==t?0:t.length)&&Ka(s)&&yr(a,s)&&(Va(t)||Ha(t))}function fr(t){return"function"!=typeof t.constructor||_r(t)?{}:zi(jt(t))}function mr(t){return Va(t)||Ha(t)||!!(Qt&&t&&t[Qt])}function yr(t,e){var i=typeof t;return!!(e=null==e?h:e)&&("number"==i||"symbol"!=i&&ft.test(t))&&t>-1&&t%1==0&&t<e}function gr(t,e,i){if(!to(i))return!1;var n=typeof e;return!!("number"==n?Ya(i)&&yr(e,i.length):"string"==n&&e in i)&&Fa(i[e],t)}function vr(t,e){if(Va(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!ho(t))||$.test(t)||!Z.test(t)||null!=e&&t in Et(e)}function xr(t){var e=sr(t),i=Ri[e];if("function"!=typeof i||!(e in Wi.prototype))return!1;if(t===i)return!0;var n=nr(i);return!!n&&t===n[0]}(_i&&dr(new _i(new ArrayBuffer(1)))!=C||wi&&dr(new wi)!=x||Si&&dr(Si.resolve())!=w||Mi&&dr(new Mi)!=M||Ei&&dr(new Ei)!=T)&&(dr=function(e){var i=Sn(e),n=i==_?e.constructor:t,s=n?zr(n):"";if(s)switch(s){case Ci:return C;case Di:return x;case Ni:return w;case Bi:return M;case ki:return T}return i});var br=Bt?Ja:gh;function _r(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Nt)}function wr(t){return t==t&&!to(t)}function Sr(e,i){return function(n){return null!=n&&n[e]===i&&(i!==t||e in Et(n))}}function Mr(e,i,n){return i=mi(i===t?e.length-1:i,0),function(){for(var t=arguments,s=-1,r=mi(t.length-i,0),a=bt(r);++s<r;)a[s]=t[i+s];s=-1;for(var o=bt(i+1);++s<i;)o[s]=t[s];return o[i]=n(a),_e(e,this,o)}}function Er(t,e){return e.length<2?t:_n(t,es(e,0,-1))}function Ar(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Tr=Nr(Qn),Ir=pe||function(t,e){return le.setTimeout(t,e)},Cr=Nr(Kn);function Dr(t,e,i){var n=e+"";return Cr(t,function(t,e){var i=e.length;if(!i)return t;var n=i-1;return e[n]=(i>1?"& ":"")+e[n],e=e.join(i>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Se(c,(function(i){var n="_."+i[0];e&i[1]&&!Te(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(nt);return e?e[1].split(st):[]}(n),i)))}function Nr(e){var i=0,n=0;return function(){var s=gi(),r=16-(s-n);if(n=s,r>0){if(++i>=800)return arguments[0]}else i=0;return e.apply(t,arguments)}}function Br(e,i){var n=-1,s=e.length,r=s-1;for(i=i===t?s:i;++n<i;){var a=Yn(n,r),o=e[a];e[a]=e[n],e[n]=o}return e.length=i,e}var kr,Or,Pr,Lr=(kr=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(J,(function(t,i,n,s){e.push(n?s.replace(ot,"$1"):i||t)})),e},Or=Oa(kr,(function(t){return 500===Pr.size&&Pr.clear(),t})),Pr=Or.cache,Or);function Rr(t){if("string"==typeof t||ho(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function zr(t){if(null!=t){try{return kt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ur(t){if(t instanceof Wi)return t.clone();var e=new Fi(t.__wrapped__,t.__chain__);return e.__actions__=Ts(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Fr=Xn((function(t,e){return Ga(t)?ln(t,mn(e,1,Ga,!0)):[]})),Wr=Xn((function(e,i){var n=$r(i);return Ga(n)&&(n=t),Ga(e)?ln(e,mn(i,1,Ga,!0),ar(n,2)):[]})),qr=Xn((function(e,i){var n=$r(i);return Ga(n)&&(n=t),Ga(e)?ln(e,mn(i,1,Ga,!0),t,n):[]}));function Hr(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=null==i?0:mo(i);return s<0&&(s=mi(n+s,0)),Le(t,ar(e,3),s)}function Vr(e,i,n){var s=null==e?0:e.length;if(!s)return-1;var r=s-1;return n!==t&&(r=mo(n),r=n<0?mi(s+r,0):yi(r,s-1)),Le(e,ar(i,3),r,!0)}function jr(t){return null!=t&&t.length?mn(t,1):[]}function Yr(e){return e&&e.length?e[0]:t}var Gr=Xn((function(t){var e=Ce(t,ms);return e.length&&e[0]===t[0]?Tn(e):[]})),Xr=Xn((function(e){var i=$r(e),n=Ce(e,ms);return i===$r(n)?i=t:n.pop(),n.length&&n[0]===e[0]?Tn(n,ar(i,2)):[]})),Zr=Xn((function(e){var i=$r(e),n=Ce(e,ms);return(i="function"==typeof i?i:t)&&n.pop(),n.length&&n[0]===e[0]?Tn(n,t,i):[]}));function $r(e){var i=null==e?0:e.length;return i?e[i-1]:t}var Jr=Xn(Qr);function Qr(t,e){return t&&t.length&&e&&e.length?Vn(t,e):t}var Kr=tr((function(t,e){var i=null==t?0:t.length,n=sn(t,e);return jn(t,Ce(e,(function(t){return yr(t,i)?+t:t})).sort(Ms)),n}));function ta(t){return null==t?t:bi.call(t)}var ea=Xn((function(t){return hs(mn(t,1,Ga,!0))})),ia=Xn((function(e){var i=$r(e);return Ga(i)&&(i=t),hs(mn(e,1,Ga,!0),ar(i,2))})),na=Xn((function(e){var i=$r(e);return i="function"==typeof i?i:t,hs(mn(e,1,Ga,!0),t,i)}));function sa(t){if(!t||!t.length)return[];var e=0;return t=Ae(t,(function(t){if(Ga(t))return e=mi(t.length,e),!0})),je(e,(function(e){return Ce(t,We(e))}))}function ra(e,i){if(!e||!e.length)return[];var n=sa(e);return null==i?n:Ce(n,(function(e){return _e(i,t,e)}))}var aa=Xn((function(t,e){return Ga(t)?ln(t,e):[]})),oa=Xn((function(t){return ps(Ae(t,Ga))})),ha=Xn((function(e){var i=$r(e);return Ga(i)&&(i=t),ps(Ae(e,Ga),ar(i,2))})),la=Xn((function(e){var i=$r(e);return i="function"==typeof i?i:t,ps(Ae(e,Ga),t,i)})),ua=Xn(sa),ca=Xn((function(e){var i=e.length,n=i>1?e[i-1]:t;return n="function"==typeof n?(e.pop(),n):t,ra(e,n)}));function da(t){var e=Ri(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var fa=tr((function(e){var i=e.length,n=i?e[0]:0,s=this.__wrapped__,r=function(t){return sn(t,e)};return!(i>1||this.__actions__.length)&&s instanceof Wi&&yr(n)?((s=s.slice(n,+n+(i?1:0))).__actions__.push({func:pa,args:[r],thisArg:t}),new Fi(s,this.__chain__).thru((function(e){return i&&!e.length&&e.push(t),e}))):this.thru(r)})),ma=Cs((function(t,e,i){Ot.call(t,i)?++t[i]:nn(t,i,1)})),ya=Ls(Hr),ga=Ls(Vr);function va(t,e){return(Va(t)?Se:un)(t,ar(e,3))}function xa(t,e){return(Va(t)?Me:cn)(t,ar(e,3))}var ba=Cs((function(t,e,i){Ot.call(t,i)?t[i].push(e):nn(t,i,[e])})),_a=Xn((function(t,e,i){var n=-1,s="function"==typeof e,r=Ya(t)?bt(t.length):[];return un(t,(function(t){r[++n]=s?_e(e,t,i):In(t,e,i)})),r})),wa=Cs((function(t,e,i){nn(t,i,e)}));function Sa(t,e){return(Va(t)?Ce:Rn)(t,ar(e,3))}var Ma=Cs((function(t,e,i){t[i?0:1].push(e)}),(function(){return[[],[]]})),Ea=Xn((function(t,e){if(null==t)return[];var i=e.length;return i>1&&gr(t,e[0],e[1])?e=[]:i>2&&gr(e[0],e[1],e[2])&&(e=[e[0]]),qn(t,mn(e,1),[])})),Aa=ce||function(){return le.Date.now()};function Ta(e,i,n){return i=n?t:i,i=e&&null==i?e.length:i,Zs(e,r,t,t,t,t,i)}function Ia(i,n){var s;if("function"!=typeof n)throw new It(e);return i=mo(i),function(){return--i>0&&(s=n.apply(this,arguments)),i<=1&&(n=t),s}}var Ca=Xn((function(t,e,i){var n=1;if(i.length){var r=si(i,rr(Ca));n|=s}return Zs(t,n,e,i,r)})),Da=Xn((function(t,e,i){var n=3;if(i.length){var r=si(i,rr(Da));n|=s}return Zs(e,n,t,i,r)}));function Na(i,n,s){var r,a,o,h,l,u,c=0,d=!1,p=!1,f=!0;if("function"!=typeof i)throw new It(e);function m(e){var n=r,s=a;return r=a=t,c=e,h=i.apply(s,n)}function y(e){var i=e-u;return u===t||i>=n||i<0||p&&e-c>=o}function g(){var t=Aa();if(y(t))return v(t);l=Ir(g,function(t){var e=n-(t-u);return p?yi(e,o-(t-c)):e}(t))}function v(e){return l=t,f&&r?m(e):(r=a=t,h)}function x(){var e=Aa(),i=y(e);if(r=arguments,a=this,u=e,i){if(l===t)return function(t){return c=t,l=Ir(g,n),d?m(t):h}(u);if(p)return bs(l),l=Ir(g,n),m(u)}return l===t&&(l=Ir(g,n)),h}return n=go(n)||0,to(s)&&(d=!!s.leading,o=(p="maxWait"in s)?mi(go(s.maxWait)||0,n):o,f="trailing"in s?!!s.trailing:f),x.cancel=function(){l!==t&&bs(l),c=0,r=u=a=l=t},x.flush=function(){return l===t?h:v(Aa())},x}var Ba=Xn((function(t,e){return hn(t,1,e)})),ka=Xn((function(t,e,i){return hn(t,go(e)||0,i)}));function Oa(t,i){if("function"!=typeof t||null!=i&&"function"!=typeof i)throw new It(e);var n=function(){var e=arguments,s=i?i.apply(this,e):e[0],r=n.cache;if(r.has(s))return r.get(s);var a=t.apply(this,e);return n.cache=r.set(s,a)||r,a};return n.cache=new(Oa.Cache||Vi),n}function Pa(t){if("function"!=typeof t)throw new It(e);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)}}Oa.Cache=Vi;var La=vs((function(t,e){var i=(e=1==e.length&&Va(e[0])?Ce(e[0],Ge(ar())):Ce(mn(e,1),Ge(ar()))).length;return Xn((function(n){for(var s=-1,r=yi(n.length,i);++s<r;)n[s]=e[s].call(this,n[s]);return _e(t,this,n)}))})),Ra=Xn((function(e,i){var n=si(i,rr(Ra));return Zs(e,s,t,i,n)})),za=Xn((function(e,i){var n=si(i,rr(za));return Zs(e,64,t,i,n)})),Ua=tr((function(e,i){return Zs(e,a,t,t,t,i)}));function Fa(t,e){return t===e||t!=t&&e!=e}var Wa=Vs(Mn),qa=Vs((function(t,e){return t>=e})),Ha=Cn(function(){return arguments}())?Cn:function(t){return eo(t)&&Ot.call(t,"callee")&&!Gt.call(t,"callee")},Va=bt.isArray,ja=me?Ge(me):function(t){return eo(t)&&Sn(t)==I};function Ya(t){return null!=t&&Ka(t.length)&&!Ja(t)}function Ga(t){return eo(t)&&Ya(t)}var Xa=li||gh,Za=ye?Ge(ye):function(t){return eo(t)&&Sn(t)==m};function $a(t){if(!eo(t))return!1;var e=Sn(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!so(t)}function Ja(t){if(!to(t))return!1;var e=Sn(t);return e==g||e==v||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qa(t){return"number"==typeof t&&t==mo(t)}function Ka(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function to(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function eo(t){return null!=t&&"object"==typeof t}var io=ge?Ge(ge):function(t){return eo(t)&&dr(t)==x};function no(t){return"number"==typeof t||eo(t)&&Sn(t)==b}function so(t){if(!eo(t)||Sn(t)!=_)return!1;var e=jt(t);if(null===e)return!0;var i=Ot.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&kt.call(i)==zt}var ro=ve?Ge(ve):function(t){return eo(t)&&Sn(t)==S},ao=xe?Ge(xe):function(t){return eo(t)&&dr(t)==M};function oo(t){return"string"==typeof t||!Va(t)&&eo(t)&&Sn(t)==E}function ho(t){return"symbol"==typeof t||eo(t)&&Sn(t)==A}var lo=be?Ge(be):function(t){return eo(t)&&Ka(t.length)&&!!ie[Sn(t)]},uo=Vs(Ln),co=Vs((function(t,e){return t<=e}));function po(t){if(!t)return[];if(Ya(t))return oo(t)?oi(t):Ts(t);if(se&&t[se])return function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}(t[se]());var e=dr(t);return(e==x?ii:e==M?ri:Wo)(t)}function fo(t){return t?(t=go(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function mo(t){var e=fo(t),i=e%1;return e==e?i?e-i:e:0}function yo(t){return t?rn(mo(t),0,u):0}function go(t){if("number"==typeof t)return t;if(ho(t))return l;if(to(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=to(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var i=ct.test(t);return i||pt.test(t)?ae(t.slice(2),i?2:8):ut.test(t)?l:+t}function vo(t){return Is(t,ko(t))}function xo(t){return null==t?"":os(t)}var bo=Ds((function(t,e){if(_r(e)||Ya(e))Is(e,Bo(e),t);else for(var i in e)Ot.call(e,i)&&Qi(t,i,e[i])})),_o=Ds((function(t,e){Is(e,ko(e),t)})),wo=Ds((function(t,e,i,n){Is(e,ko(e),t,n)})),So=Ds((function(t,e,i,n){Is(e,Bo(e),t,n)})),Mo=tr(sn),Eo=Xn((function(e,i){e=Et(e);var n=-1,s=i.length,r=s>2?i[2]:t;for(r&&gr(i[0],i[1],r)&&(s=1);++n<s;)for(var a=i[n],o=ko(a),h=-1,l=o.length;++h<l;){var u=o[h],c=e[u];(c===t||Fa(c,Nt[u])&&!Ot.call(e,u))&&(e[u]=a[u])}return e})),Ao=Xn((function(e){return e.push(t,Js),_e(Po,t,e)}));function To(e,i,n){var s=null==e?t:_n(e,i);return s===t?n:s}function Io(t,e){return null!=t&&pr(t,e,An)}var Co=Us((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),t[e]=i}),eh(sh)),Do=Us((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),Ot.call(t,e)?t[e].push(i):t[e]=[i]}),ar),No=Xn(In);function Bo(t){return Ya(t)?Gi(t):On(t)}function ko(t){return Ya(t)?Gi(t,!0):Pn(t)}var Oo=Ds((function(t,e,i){Fn(t,e,i)})),Po=Ds((function(t,e,i,n){Fn(t,e,i,n)})),Lo=tr((function(t,e){var i={};if(null==t)return i;var n=!1;e=Ce(e,(function(e){return e=gs(e,t),n||(n=e.length>1),e})),Is(t,ir(t),i),n&&(i=an(i,7,Qs));for(var s=e.length;s--;)ls(i,e[s]);return i})),Ro=tr((function(t,e){return null==t?{}:function(t,e){return Hn(t,e,(function(e,i){return Io(t,i)}))}(t,e)}));function zo(t,e){if(null==t)return{};var i=Ce(ir(t),(function(t){return[t]}));return e=ar(e),Hn(t,i,(function(t,i){return e(t,i[0])}))}var Uo=Xs(Bo),Fo=Xs(ko);function Wo(t){return null==t?[]:Xe(t,Bo(t))}var qo=Os((function(t,e,i){return e=e.toLowerCase(),t+(i?Ho(e):e)}));function Ho(t){return Jo(xo(t).toLowerCase())}function Vo(t){return(t=xo(t))&&t.replace(mt,Qe).replace(Zt,"")}var jo=Os((function(t,e,i){return t+(i?"-":"")+e.toLowerCase()})),Yo=Os((function(t,e,i){return t+(i?" ":"")+e.toLowerCase()})),Go=ks("toLowerCase"),Xo=Os((function(t,e,i){return t+(i?"_":"")+e.toLowerCase()})),Zo=Os((function(t,e,i){return t+(i?" ":"")+Jo(e)})),$o=Os((function(t,e,i){return t+(i?" ":"")+e.toUpperCase()})),Jo=ks("toUpperCase");function Qo(e,i,n){return e=xo(e),(i=n?t:i)===t?function(t){return Kt.test(t)}(e)?function(t){return t.match(Jt)||[]}(e):function(t){return t.match(rt)||[]}(e):e.match(i)||[]}var Ko=Xn((function(e,i){try{return _e(e,t,i)}catch(t){return $a(t)?t:new wt(t)}})),th=tr((function(t,e){return Se(e,(function(e){e=Rr(e),nn(t,e,Ca(t[e],t))})),t}));function eh(t){return function(){return t}}var ih=Rs(),nh=Rs(!0);function sh(t){return t}function rh(t){return kn("function"==typeof t?t:an(t,1))}var ah=Xn((function(t,e){return function(i){return In(i,t,e)}})),oh=Xn((function(t,e){return function(i){return In(t,i,e)}}));function hh(t,e,i){var n=Bo(e),s=bn(e,n);null!=i||to(e)&&(s.length||!n.length)||(i=e,e=t,t=this,s=bn(e,Bo(e)));var r=!(to(i)&&"chain"in i&&!i.chain),a=Ja(t);return Se(s,(function(i){var n=e[i];t[i]=n,a&&(t.prototype[i]=function(){var e=this.__chain__;if(r||e){var i=t(this.__wrapped__);return(i.__actions__=Ts(this.__actions__)).push({func:n,args:arguments,thisArg:t}),i.__chain__=e,i}return n.apply(t,De([this.value()],arguments))})})),t}function lh(){}var uh=Ws(Ce),ch=Ws(Ee),dh=Ws(ke);function ph(t){return vr(t)?We(Rr(t)):function(t){return function(e){return _n(e,t)}}(t)}var fh=Hs(),mh=Hs(!0);function yh(){return[]}function gh(){return!1}var vh,xh=Fs((function(t,e){return t+e}),0),bh=Ys("ceil"),_h=Fs((function(t,e){return t/e}),1),wh=Ys("floor"),Sh=Fs((function(t,e){return t*e}),1),Mh=Ys("round"),Eh=Fs((function(t,e){return t-e}),0);return Ri.after=function(t,i){if("function"!=typeof i)throw new It(e);return t=mo(t),function(){if(--t<1)return i.apply(this,arguments)}},Ri.ary=Ta,Ri.assign=bo,Ri.assignIn=_o,Ri.assignInWith=wo,Ri.assignWith=So,Ri.at=Mo,Ri.before=Ia,Ri.bind=Ca,Ri.bindAll=th,Ri.bindKey=Da,Ri.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Va(t)?t:[t]},Ri.chain=da,Ri.chunk=function(e,i,n){i=(n?gr(e,i,n):i===t)?1:mi(mo(i),0);var s=null==e?0:e.length;if(!s||i<1)return[];for(var r=0,a=0,o=bt(fe(s/i));r<s;)o[a++]=es(e,r,r+=i);return o},Ri.compact=function(t){for(var e=-1,i=null==t?0:t.length,n=0,s=[];++e<i;){var r=t[e];r&&(s[n++]=r)}return s},Ri.concat=function(){var t=arguments.length;if(!t)return[];for(var e=bt(t-1),i=arguments[0],n=t;n--;)e[n-1]=arguments[n];return De(Va(i)?Ts(i):[i],mn(e,1))},Ri.cond=function(t){var i=null==t?0:t.length,n=ar();return t=i?Ce(t,(function(t){if("function"!=typeof t[1])throw new It(e);return[n(t[0]),t[1]]})):[],Xn((function(e){for(var n=-1;++n<i;){var s=t[n];if(_e(s[0],this,e))return _e(s[1],this,e)}}))},Ri.conforms=function(t){return function(t){var e=Bo(t);return function(i){return on(i,t,e)}}(an(t,1))},Ri.constant=eh,Ri.countBy=ma,Ri.create=function(t,e){var i=zi(t);return null==e?i:en(i,e)},Ri.curry=function e(i,n,s){var r=Zs(i,8,t,t,t,t,t,n=s?t:n);return r.placeholder=e.placeholder,r},Ri.curryRight=function e(i,n,s){var r=Zs(i,16,t,t,t,t,t,n=s?t:n);return r.placeholder=e.placeholder,r},Ri.debounce=Na,Ri.defaults=Eo,Ri.defaultsDeep=Ao,Ri.defer=Ba,Ri.delay=ka,Ri.difference=Fr,Ri.differenceBy=Wr,Ri.differenceWith=qr,Ri.drop=function(e,i,n){var s=null==e?0:e.length;return s?es(e,(i=n||i===t?1:mo(i))<0?0:i,s):[]},Ri.dropRight=function(e,i,n){var s=null==e?0:e.length;return s?es(e,0,(i=s-(i=n||i===t?1:mo(i)))<0?0:i):[]},Ri.dropRightWhile=function(t,e){return t&&t.length?cs(t,ar(e,3),!0,!0):[]},Ri.dropWhile=function(t,e){return t&&t.length?cs(t,ar(e,3),!0):[]},Ri.fill=function(e,i,n,s){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&gr(e,i,n)&&(n=0,s=r),function(e,i,n,s){var r=e.length;for((n=mo(n))<0&&(n=-n>r?0:r+n),(s=s===t||s>r?r:mo(s))<0&&(s+=r),s=n>s?0:yo(s);n<s;)e[n++]=i;return e}(e,i,n,s)):[]},Ri.filter=function(t,e){return(Va(t)?Ae:fn)(t,ar(e,3))},Ri.flatMap=function(t,e){return mn(Sa(t,e),1)},Ri.flatMapDeep=function(t,e){return mn(Sa(t,e),o)},Ri.flatMapDepth=function(e,i,n){return n=n===t?1:mo(n),mn(Sa(e,i),n)},Ri.flatten=jr,Ri.flattenDeep=function(t){return null!=t&&t.length?mn(t,o):[]},Ri.flattenDepth=function(e,i){return null!=e&&e.length?mn(e,i=i===t?1:mo(i)):[]},Ri.flip=function(t){return Zs(t,512)},Ri.flow=ih,Ri.flowRight=nh,Ri.fromPairs=function(t){for(var e=-1,i=null==t?0:t.length,n={};++e<i;){var s=t[e];n[s[0]]=s[1]}return n},Ri.functions=function(t){return null==t?[]:bn(t,Bo(t))},Ri.functionsIn=function(t){return null==t?[]:bn(t,ko(t))},Ri.groupBy=ba,Ri.initial=function(t){return null!=t&&t.length?es(t,0,-1):[]},Ri.intersection=Gr,Ri.intersectionBy=Xr,Ri.intersectionWith=Zr,Ri.invert=Co,Ri.invertBy=Do,Ri.invokeMap=_a,Ri.iteratee=rh,Ri.keyBy=wa,Ri.keys=Bo,Ri.keysIn=ko,Ri.map=Sa,Ri.mapKeys=function(t,e){var i={};return e=ar(e,3),vn(t,(function(t,n,s){nn(i,e(t,n,s),t)})),i},Ri.mapValues=function(t,e){var i={};return e=ar(e,3),vn(t,(function(t,n,s){nn(i,n,e(t,n,s))})),i},Ri.matches=function(t){return zn(an(t,1))},Ri.matchesProperty=function(t,e){return Un(t,an(e,1))},Ri.memoize=Oa,Ri.merge=Oo,Ri.mergeWith=Po,Ri.method=ah,Ri.methodOf=oh,Ri.mixin=hh,Ri.negate=Pa,Ri.nthArg=function(t){return t=mo(t),Xn((function(e){return Wn(e,t)}))},Ri.omit=Lo,Ri.omitBy=function(t,e){return zo(t,Pa(ar(e)))},Ri.once=function(t){return Ia(2,t)},Ri.orderBy=function(e,i,n,s){return null==e?[]:(Va(i)||(i=null==i?[]:[i]),Va(n=s?t:n)||(n=null==n?[]:[n]),qn(e,i,n))},Ri.over=uh,Ri.overArgs=La,Ri.overEvery=ch,Ri.overSome=dh,Ri.partial=Ra,Ri.partialRight=za,Ri.partition=Ma,Ri.pick=Ro,Ri.pickBy=zo,Ri.property=ph,Ri.propertyOf=function(e){return function(i){return null==e?t:_n(e,i)}},Ri.pull=Jr,Ri.pullAll=Qr,Ri.pullAllBy=function(t,e,i){return t&&t.length&&e&&e.length?Vn(t,e,ar(i,2)):t},Ri.pullAllWith=function(e,i,n){return e&&e.length&&i&&i.length?Vn(e,i,t,n):e},Ri.pullAt=Kr,Ri.range=fh,Ri.rangeRight=mh,Ri.rearg=Ua,Ri.reject=function(t,e){return(Va(t)?Ae:fn)(t,Pa(ar(e,3)))},Ri.remove=function(t,e){var i=[];if(!t||!t.length)return i;var n=-1,s=[],r=t.length;for(e=ar(e,3);++n<r;){var a=t[n];e(a,n,t)&&(i.push(a),s.push(n))}return jn(t,s),i},Ri.rest=function(i,n){if("function"!=typeof i)throw new It(e);return Xn(i,n=n===t?n:mo(n))},Ri.reverse=ta,Ri.sampleSize=function(e,i,n){return i=(n?gr(e,i,n):i===t)?1:mo(i),(Va(e)?Zi:$n)(e,i)},Ri.set=function(t,e,i){return null==t?t:Jn(t,e,i)},Ri.setWith=function(e,i,n,s){return s="function"==typeof s?s:t,null==e?e:Jn(e,i,n,s)},Ri.shuffle=function(t){return(Va(t)?$i:ts)(t)},Ri.slice=function(e,i,n){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&gr(e,i,n)?(i=0,n=s):(i=null==i?0:mo(i),n=n===t?s:mo(n)),es(e,i,n)):[]},Ri.sortBy=Ea,Ri.sortedUniq=function(t){return t&&t.length?rs(t):[]},Ri.sortedUniqBy=function(t,e){return t&&t.length?rs(t,ar(e,2)):[]},Ri.split=function(e,i,n){return n&&"number"!=typeof n&&gr(e,i,n)&&(i=n=t),(n=n===t?u:n>>>0)?(e=xo(e))&&("string"==typeof i||null!=i&&!ro(i))&&!(i=os(i))&&ei(e)?xs(oi(e),0,n):e.split(i,n):[]},Ri.spread=function(t,i){if("function"!=typeof t)throw new It(e);return i=null==i?0:mi(mo(i),0),Xn((function(e){var n=e[i],s=xs(e,0,i);return n&&De(s,n),_e(t,this,s)}))},Ri.tail=function(t){var e=null==t?0:t.length;return e?es(t,1,e):[]},Ri.take=function(e,i,n){return e&&e.length?es(e,0,(i=n||i===t?1:mo(i))<0?0:i):[]},Ri.takeRight=function(e,i,n){var s=null==e?0:e.length;return s?es(e,(i=s-(i=n||i===t?1:mo(i)))<0?0:i,s):[]},Ri.takeRightWhile=function(t,e){return t&&t.length?cs(t,ar(e,3),!1,!0):[]},Ri.takeWhile=function(t,e){return t&&t.length?cs(t,ar(e,3)):[]},Ri.tap=function(t,e){return e(t),t},Ri.throttle=function(t,i,n){var s=!0,r=!0;if("function"!=typeof t)throw new It(e);return to(n)&&(s="leading"in n?!!n.leading:s,r="trailing"in n?!!n.trailing:r),Na(t,i,{leading:s,maxWait:i,trailing:r})},Ri.thru=pa,Ri.toArray=po,Ri.toPairs=Uo,Ri.toPairsIn=Fo,Ri.toPath=function(t){return Va(t)?Ce(t,Rr):ho(t)?[t]:Ts(Lr(xo(t)))},Ri.toPlainObject=vo,Ri.transform=function(t,e,i){var n=Va(t),s=n||Xa(t)||lo(t);if(e=ar(e,4),null==i){var r=t&&t.constructor;i=s?n?new r:[]:to(t)&&Ja(r)?zi(jt(t)):{}}return(s?Se:vn)(t,(function(t,n,s){return e(i,t,n,s)})),i},Ri.unary=function(t){return Ta(t,1)},Ri.union=ea,Ri.unionBy=ia,Ri.unionWith=na,Ri.uniq=function(t){return t&&t.length?hs(t):[]},Ri.uniqBy=function(t,e){return t&&t.length?hs(t,ar(e,2)):[]},Ri.uniqWith=function(e,i){return i="function"==typeof i?i:t,e&&e.length?hs(e,t,i):[]},Ri.unset=function(t,e){return null==t||ls(t,e)},Ri.unzip=sa,Ri.unzipWith=ra,Ri.update=function(t,e,i){return null==t?t:us(t,e,ys(i))},Ri.updateWith=function(e,i,n,s){return s="function"==typeof s?s:t,null==e?e:us(e,i,ys(n),s)},Ri.values=Wo,Ri.valuesIn=function(t){return null==t?[]:Xe(t,ko(t))},Ri.without=aa,Ri.words=Qo,Ri.wrap=function(t,e){return Ra(ys(e),t)},Ri.xor=oa,Ri.xorBy=ha,Ri.xorWith=la,Ri.zip=ua,Ri.zipObject=function(t,e){return fs(t||[],e||[],Qi)},Ri.zipObjectDeep=function(t,e){return fs(t||[],e||[],Jn)},Ri.zipWith=ca,Ri.entries=Uo,Ri.entriesIn=Fo,Ri.extend=_o,Ri.extendWith=wo,hh(Ri,Ri),Ri.add=xh,Ri.attempt=Ko,Ri.camelCase=qo,Ri.capitalize=Ho,Ri.ceil=bh,Ri.clamp=function(e,i,n){return n===t&&(n=i,i=t),n!==t&&(n=(n=go(n))==n?n:0),i!==t&&(i=(i=go(i))==i?i:0),rn(go(e),i,n)},Ri.clone=function(t){return an(t,4)},Ri.cloneDeep=function(t){return an(t,5)},Ri.cloneDeepWith=function(e,i){return an(e,5,i="function"==typeof i?i:t)},Ri.cloneWith=function(e,i){return an(e,4,i="function"==typeof i?i:t)},Ri.conformsTo=function(t,e){return null==e||on(t,e,Bo(e))},Ri.deburr=Vo,Ri.defaultTo=function(t,e){return null==t||t!=t?e:t},Ri.divide=_h,Ri.endsWith=function(e,i,n){e=xo(e),i=os(i);var s=e.length,r=n=n===t?s:rn(mo(n),0,s);return(n-=i.length)>=0&&e.slice(n,r)==i},Ri.eq=Fa,Ri.escape=function(t){return(t=xo(t))&&j.test(t)?t.replace(H,Ke):t},Ri.escapeRegExp=function(t){return(t=xo(t))&&K.test(t)?t.replace(Q,"\\$&"):t},Ri.every=function(e,i,n){var s=Va(e)?Ee:dn;return n&&gr(e,i,n)&&(i=t),s(e,ar(i,3))},Ri.find=ya,Ri.findIndex=Hr,Ri.findKey=function(t,e){return Pe(t,ar(e,3),vn)},Ri.findLast=ga,Ri.findLastIndex=Vr,Ri.findLastKey=function(t,e){return Pe(t,ar(e,3),xn)},Ri.floor=wh,Ri.forEach=va,Ri.forEachRight=xa,Ri.forIn=function(t,e){return null==t?t:yn(t,ar(e,3),ko)},Ri.forInRight=function(t,e){return null==t?t:gn(t,ar(e,3),ko)},Ri.forOwn=function(t,e){return t&&vn(t,ar(e,3))},Ri.forOwnRight=function(t,e){return t&&xn(t,ar(e,3))},Ri.get=To,Ri.gt=Wa,Ri.gte=qa,Ri.has=function(t,e){return null!=t&&pr(t,e,En)},Ri.hasIn=Io,Ri.head=Yr,Ri.identity=sh,Ri.includes=function(t,e,i,n){t=Ya(t)?t:Wo(t),i=i&&!n?mo(i):0;var s=t.length;return i<0&&(i=mi(s+i,0)),oo(t)?i<=s&&t.indexOf(e,i)>-1:!!s&&Re(t,e,i)>-1},Ri.indexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=null==i?0:mo(i);return s<0&&(s=mi(n+s,0)),Re(t,e,s)},Ri.inRange=function(e,i,n){return i=fo(i),n===t?(n=i,i=0):n=fo(n),function(t,e,i){return t>=yi(e,i)&&t<mi(e,i)}(e=go(e),i,n)},Ri.invoke=No,Ri.isArguments=Ha,Ri.isArray=Va,Ri.isArrayBuffer=ja,Ri.isArrayLike=Ya,Ri.isArrayLikeObject=Ga,Ri.isBoolean=function(t){return!0===t||!1===t||eo(t)&&Sn(t)==f},Ri.isBuffer=Xa,Ri.isDate=Za,Ri.isElement=function(t){return eo(t)&&1===t.nodeType&&!so(t)},Ri.isEmpty=function(t){if(null==t)return!0;if(Ya(t)&&(Va(t)||"string"==typeof t||"function"==typeof t.splice||Xa(t)||lo(t)||Ha(t)))return!t.length;var e=dr(t);if(e==x||e==M)return!t.size;if(_r(t))return!On(t).length;for(var i in t)if(Ot.call(t,i))return!1;return!0},Ri.isEqual=function(t,e){return Dn(t,e)},Ri.isEqualWith=function(e,i,n){var s=(n="function"==typeof n?n:t)?n(e,i):t;return s===t?Dn(e,i,t,n):!!s},Ri.isError=$a,Ri.isFinite=function(t){return"number"==typeof t&&ci(t)},Ri.isFunction=Ja,Ri.isInteger=Qa,Ri.isLength=Ka,Ri.isMap=io,Ri.isMatch=function(t,e){return t===e||Nn(t,e,hr(e))},Ri.isMatchWith=function(e,i,n){return n="function"==typeof n?n:t,Nn(e,i,hr(i),n)},Ri.isNaN=function(t){return no(t)&&t!=+t},Ri.isNative=function(t){if(br(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Bn(t)},Ri.isNil=function(t){return null==t},Ri.isNull=function(t){return null===t},Ri.isNumber=no,Ri.isObject=to,Ri.isObjectLike=eo,Ri.isPlainObject=so,Ri.isRegExp=ro,Ri.isSafeInteger=function(t){return Qa(t)&&t>=-9007199254740991&&t<=h},Ri.isSet=ao,Ri.isString=oo,Ri.isSymbol=ho,Ri.isTypedArray=lo,Ri.isUndefined=function(e){return e===t},Ri.isWeakMap=function(t){return eo(t)&&dr(t)==T},Ri.isWeakSet=function(t){return eo(t)&&"[object WeakSet]"==Sn(t)},Ri.join=function(t,e){return null==t?"":di.call(t,e)},Ri.kebabCase=jo,Ri.last=$r,Ri.lastIndexOf=function(e,i,n){var s=null==e?0:e.length;if(!s)return-1;var r=s;return n!==t&&(r=(r=mo(n))<0?mi(s+r,0):yi(r,s-1)),i==i?function(t,e,i){for(var n=i+1;n--;)if(t[n]===e)return n;return n}(e,i,r):Le(e,Ue,r,!0)},Ri.lowerCase=Yo,Ri.lowerFirst=Go,Ri.lt=uo,Ri.lte=co,Ri.max=function(e){return e&&e.length?pn(e,sh,Mn):t},Ri.maxBy=function(e,i){return e&&e.length?pn(e,ar(i,2),Mn):t},Ri.mean=function(t){return Fe(t,sh)},Ri.meanBy=function(t,e){return Fe(t,ar(e,2))},Ri.min=function(e){return e&&e.length?pn(e,sh,Ln):t},Ri.minBy=function(e,i){return e&&e.length?pn(e,ar(i,2),Ln):t},Ri.stubArray=yh,Ri.stubFalse=gh,Ri.stubObject=function(){return{}},Ri.stubString=function(){return""},Ri.stubTrue=function(){return!0},Ri.multiply=Sh,Ri.nth=function(e,i){return e&&e.length?Wn(e,mo(i)):t},Ri.noConflict=function(){return le._===this&&(le._=Ut),this},Ri.noop=lh,Ri.now=Aa,Ri.pad=function(t,e,i){t=xo(t);var n=(e=mo(e))?ai(t):0;if(!e||n>=e)return t;var s=(e-n)/2;return qs(Oe(s),i)+t+qs(fe(s),i)},Ri.padEnd=function(t,e,i){t=xo(t);var n=(e=mo(e))?ai(t):0;return e&&n<e?t+qs(e-n,i):t},Ri.padStart=function(t,e,i){t=xo(t);var n=(e=mo(e))?ai(t):0;return e&&n<e?qs(e-n,i)+t:t},Ri.parseInt=function(t,e,i){return i||null==e?e=0:e&&(e=+e),vi(xo(t).replace(tt,""),e||0)},Ri.random=function(e,i,n){if(n&&"boolean"!=typeof n&&gr(e,i,n)&&(i=n=t),n===t&&("boolean"==typeof i?(n=i,i=t):"boolean"==typeof e&&(n=e,e=t)),e===t&&i===t?(e=0,i=1):(e=fo(e),i===t?(i=e,e=0):i=fo(i)),e>i){var s=e;e=i,i=s}if(n||e%1||i%1){var r=xi();return yi(e+r*(i-e+re("1e-"+((r+"").length-1))),i)}return Yn(e,i)},Ri.reduce=function(t,e,i){var n=Va(t)?Ne:He,s=arguments.length<3;return n(t,ar(e,4),i,s,un)},Ri.reduceRight=function(t,e,i){var n=Va(t)?Be:He,s=arguments.length<3;return n(t,ar(e,4),i,s,cn)},Ri.repeat=function(e,i,n){return i=(n?gr(e,i,n):i===t)?1:mo(i),Gn(xo(e),i)},Ri.replace=function(){var t=arguments,e=xo(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Ri.result=function(e,i,n){var s=-1,r=(i=gs(i,e)).length;for(r||(r=1,e=t);++s<r;){var a=null==e?t:e[Rr(i[s])];a===t&&(s=r,a=n),e=Ja(a)?a.call(e):a}return e},Ri.round=Mh,Ri.runInContext=et,Ri.sample=function(t){return(Va(t)?Xi:Zn)(t)},Ri.size=function(t){if(null==t)return 0;if(Ya(t))return oo(t)?ai(t):t.length;var e=dr(t);return e==x||e==M?t.size:On(t).length},Ri.snakeCase=Xo,Ri.some=function(e,i,n){var s=Va(e)?ke:is;return n&&gr(e,i,n)&&(i=t),s(e,ar(i,3))},Ri.sortedIndex=function(t,e){return ns(t,e)},Ri.sortedIndexBy=function(t,e,i){return ss(t,e,ar(i,2))},Ri.sortedIndexOf=function(t,e){var i=null==t?0:t.length;if(i){var n=ns(t,e);if(n<i&&Fa(t[n],e))return n}return-1},Ri.sortedLastIndex=function(t,e){return ns(t,e,!0)},Ri.sortedLastIndexBy=function(t,e,i){return ss(t,e,ar(i,2),!0)},Ri.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var i=ns(t,e,!0)-1;if(Fa(t[i],e))return i}return-1},Ri.startCase=Zo,Ri.startsWith=function(t,e,i){return t=xo(t),i=null==i?0:rn(mo(i),0,t.length),e=os(e),t.slice(i,i+e.length)==e},Ri.subtract=Eh,Ri.sum=function(t){return t&&t.length?Ve(t,sh):0},Ri.sumBy=function(t,e){return t&&t.length?Ve(t,ar(e,2)):0},Ri.template=function(e,i,n){var s=Ri.templateSettings;n&&gr(e,i,n)&&(i=t),e=xo(e),i=wo({},i,s,$s);var r,a,o=wo({},i.imports,s.imports,$s),h=Bo(o),l=Xe(o,h),u=0,c=i.interpolate||yt,d="__p += '",p=At((i.escape||yt).source+"|"+c.source+"|"+(c===X?ht:yt).source+"|"+(i.evaluate||yt).source+"|$","g"),f="//# sourceURL="+(Ot.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ee+"]")+"\n";e.replace(p,(function(t,i,n,s,o,h){return n||(n=s),d+=e.slice(u,h).replace(gt,ti),i&&(r=!0,d+="' +\n__e("+i+") +\n'"),o&&(a=!0,d+="';\n"+o+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=h+t.length,t})),d+="';\n";var m=Ot.call(i,"variable")&&i.variable;if(m){if(at.test(m))throw new wt("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(U,""):d).replace(F,"$1").replace(W,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var y=Ko((function(){return St(h,f+"return "+d).apply(t,l)}));if(y.source=d,$a(y))throw y;return y},Ri.times=function(t,e){if((t=mo(t))<1||t>h)return[];var i=u,n=yi(t,u);e=ar(e),t-=u;for(var s=je(n,e);++i<t;)e(i);return s},Ri.toFinite=fo,Ri.toInteger=mo,Ri.toLength=yo,Ri.toLower=function(t){return xo(t).toLowerCase()},Ri.toNumber=go,Ri.toSafeInteger=function(t){return t?rn(mo(t),-9007199254740991,h):0===t?t:0},Ri.toString=xo,Ri.toUpper=function(t){return xo(t).toUpperCase()},Ri.trim=function(e,i,n){if((e=xo(e))&&(n||i===t))return Ye(e);if(!e||!(i=os(i)))return e;var s=oi(e),r=oi(i);return xs(s,$e(s,r),Je(s,r)+1).join("")},Ri.trimEnd=function(e,i,n){if((e=xo(e))&&(n||i===t))return e.slice(0,hi(e)+1);if(!e||!(i=os(i)))return e;var s=oi(e);return xs(s,0,Je(s,oi(i))+1).join("")},Ri.trimStart=function(e,i,n){if((e=xo(e))&&(n||i===t))return e.replace(tt,"");if(!e||!(i=os(i)))return e;var s=oi(e);return xs(s,$e(s,oi(i))).join("")},Ri.truncate=function(e,i){var n=30,s="...";if(to(i)){var r="separator"in i?i.separator:r;n="length"in i?mo(i.length):n,s="omission"in i?os(i.omission):s}var a=(e=xo(e)).length;if(ei(e)){var o=oi(e);a=o.length}if(n>=a)return e;var h=n-ai(s);if(h<1)return s;var l=o?xs(o,0,h).join(""):e.slice(0,h);if(r===t)return l+s;if(o&&(h+=l.length-h),ro(r)){if(e.slice(h).search(r)){var u,c=l;for(r.global||(r=At(r.source,xo(lt.exec(r))+"g")),r.lastIndex=0;u=r.exec(c);)var d=u.index;l=l.slice(0,d===t?h:d)}}else if(e.indexOf(os(r),h)!=h){var p=l.lastIndexOf(r);p>-1&&(l=l.slice(0,p))}return l+s},Ri.unescape=function(t){return(t=xo(t))&&V.test(t)?t.replace(q,ui):t},Ri.uniqueId=function(t){var e=++Pt;return xo(t)+e},Ri.upperCase=$o,Ri.upperFirst=Jo,Ri.each=va,Ri.eachRight=xa,Ri.first=Yr,hh(Ri,(vh={},vn(Ri,(function(t,e){Ot.call(Ri.prototype,e)||(vh[e]=t)})),vh),{chain:!1}),Ri.VERSION="4.17.21",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Ri[t].placeholder=Ri})),Se(["drop","take"],(function(e,i){Wi.prototype[e]=function(n){n=n===t?1:mi(mo(n),0);var s=this.__filtered__&&!i?new Wi(this):this.clone();return s.__filtered__?s.__takeCount__=yi(n,s.__takeCount__):s.__views__.push({size:yi(n,u),type:e+(s.__dir__<0?"Right":"")}),s},Wi.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Se(["filter","map","takeWhile"],(function(t,e){var i=e+1,n=1==i||3==i;Wi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ar(t,3),type:i}),e.__filtered__=e.__filtered__||n,e}})),Se(["head","last"],(function(t,e){var i="take"+(e?"Right":"");Wi.prototype[t]=function(){return this[i](1).value()[0]}})),Se(["initial","tail"],(function(t,e){var i="drop"+(e?"":"Right");Wi.prototype[t]=function(){return this.__filtered__?new Wi(this):this[i](1)}})),Wi.prototype.compact=function(){return this.filter(sh)},Wi.prototype.find=function(t){return this.filter(t).head()},Wi.prototype.findLast=function(t){return this.reverse().find(t)},Wi.prototype.invokeMap=Xn((function(t,e){return"function"==typeof t?new Wi(this):this.map((function(i){return In(i,t,e)}))})),Wi.prototype.reject=function(t){return this.filter(Pa(ar(t)))},Wi.prototype.slice=function(e,i){e=mo(e);var n=this;return n.__filtered__&&(e>0||i<0)?new Wi(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),i!==t&&(n=(i=mo(i))<0?n.dropRight(-i):n.take(i-e)),n)},Wi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wi.prototype.toArray=function(){return this.take(u)},vn(Wi.prototype,(function(e,i){var n=/^(?:filter|find|map|reject)|While$/.test(i),s=/^(?:head|last)$/.test(i),r=Ri[s?"take"+("last"==i?"Right":""):i],a=s||/^find/.test(i);r&&(Ri.prototype[i]=function(){var i=this.__wrapped__,o=s?[1]:arguments,h=i instanceof Wi,l=o[0],u=h||Va(i),c=function(t){var e=r.apply(Ri,De([t],o));return s&&d?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(h=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,m=h&&!p;if(!a&&u){i=m?i:new Wi(this);var y=e.apply(i,o);return y.__actions__.push({func:pa,args:[c],thisArg:t}),new Fi(y,d)}return f&&m?e.apply(this,o):(y=this.thru(c),f?s?y.value()[0]:y.value():y)})})),Se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Ri.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var s=this.value();return e.apply(Va(s)?s:[],t)}return this[i]((function(i){return e.apply(Va(i)?i:[],t)}))}})),vn(Wi.prototype,(function(t,e){var i=Ri[e];if(i){var n=i.name+"";Ot.call(Ii,n)||(Ii[n]=[]),Ii[n].push({name:e,func:i})}})),Ii[zs(t,2).name]=[{name:"wrapper",func:t}],Wi.prototype.clone=function(){var t=new Wi(this.__wrapped__);return t.__actions__=Ts(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ts(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ts(this.__views__),t},Wi.prototype.reverse=function(){if(this.__filtered__){var t=new Wi(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wi.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,i=Va(t),n=e<0,s=i?t.length:0,r=function(t,e,i){for(var n=-1,s=i.length;++n<s;){var r=i[n],a=r.size;switch(r.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=yi(e,t+a);break;case"takeRight":t=mi(t,e-a)}}return{start:t,end:e}}(0,s,this.__views__),a=r.start,o=r.end,h=o-a,l=n?o:a-1,u=this.__iteratees__,c=u.length,d=0,p=yi(h,this.__takeCount__);if(!i||!n&&s==h&&p==h)return ds(t,this.__actions__);var f=[];t:for(;h--&&d<p;){for(var m=-1,y=t[l+=e];++m<c;){var g=u[m],v=g.iteratee,x=g.type,b=v(y);if(2==x)y=b;else if(!b){if(1==x)continue t;break t}}f[d++]=y}return f},Ri.prototype.at=fa,Ri.prototype.chain=function(){return da(this)},Ri.prototype.commit=function(){return new Fi(this.value(),this.__chain__)},Ri.prototype.next=function(){this.__values__===t&&(this.__values__=po(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Ri.prototype.plant=function(e){for(var i,n=this;n instanceof Ui;){var s=Ur(n);s.__index__=0,s.__values__=t,i?r.__wrapped__=s:i=s;var r=s;n=n.__wrapped__}return r.__wrapped__=e,i},Ri.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wi){var i=e;return this.__actions__.length&&(i=new Wi(this)),(i=i.reverse()).__actions__.push({func:pa,args:[ta],thisArg:t}),new Fi(i,this.__chain__)}return this.thru(ta)},Ri.prototype.toJSON=Ri.prototype.valueOf=Ri.prototype.value=function(){return ds(this.__wrapped__,this.__actions__)},Ri.prototype.first=Ri.prototype.head,se&&(Ri.prototype[se]=function(){return this}),Ri}();ce?((ce.exports=pi)._=pi,ue._=pi):le._=pi}.call(li);var fi=pi.exports,mi=ui(fi);function yi(t){return t>-1e-8&&t<1e-8}function gi(t,e,i,n,s){const r=1-s;return r*r*(r*t+3*s*e)+s*s*(s*n+3*r*i)}function vi(t,e,i,n,s){const r=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let h=0;if(yi(a)){if((l=r)>1e-8||l<-1e-8){const t=-o/r;t>=0&&t<=1&&(s[h++]=t)}}else{const t=r*r-4*a*o;if(yi(t))s[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),n=(-r-e)/(2*a);i>=0&&i<=1&&(s[h++]=i),n>=0&&n<=1&&(s[h++]=n)}}var l;return h}function xi(t,e,i,n,s,r,a,o,h){let l=t,u=e,c=0;const d=1/h;for(let p=1;p<=h;p++){let h=p*d;const f=gi(t,i,s,a,h),m=gi(e,n,r,o,h),y=f-l,g=m-u;c+=Math.sqrt(y*y+g*g),l=f,u=m}return c}function bi(t,e,i,n,s,r){const a=(e-t)*s+t,o=(i-e)*s+e,h=(n-i)*s+i,l=(o-a)*s+a,u=(h-o)*s+o,c=(u-l)*s+l;r[0]=t,r[1]=a,r[2]=l,r[3]=c,r[4]=c,r[5]=u,r[6]=h,r[7]=n}function _i(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}function wi(t,e,i,n){const s=1-n;return s*(s*t+2*n*e)+n*n*i}function Si(t,e,i,n,s,r,a){let o=t,h=e,l=0;const u=1/a;for(let c=1;c<=a;c++){let a=c*u;const d=wi(t,i,s,a),p=wi(e,n,r,a),f=d-o,m=p-h;l+=Math.sqrt(f*f+m*m),o=d,h=p}return l}function Mi(t,e,i,n,s){const r=(e-t)*n+t,a=(i-e)*n+e,o=(a-r)*n+r;s[0]=t,s[1]=r,s[2]=o,s[3]=o,s[4]=a,s[5]=i}const Ei=Math.PI,Ai=2*Ei;function Ti(t){return(t%=Ai)<0&&(t+=Ai),t}function Ii(t,e){let i=Ti(t[0]),n=Ti(t[1]);e?i<n&&(i+=Ai):n<i&&(n+=Ai),t[0]=i,t[1]=n}function Ci(t,e,i,n){if(yi(e-i))return!0;const s=1e-8;return t=Ti(t),e=Ti(e),i=Ti(i),n?i<=e?t-s>=i&&t+s<=e:t-s>=i||t+s<=e:e<=i?t+s>=e&&t-s<=i:t+s>=e||t-s<=i}const Di=(t,e,i)=>Math.max(e,Math.min(i,t)),Ni=(t,e=1e-6)=>Math.abs(t)<e?0:t<0?-1:1,Bi=t=>t*(Math.PI/180),ki=(t,e,i)=>(1-i)*t+i*e;class Oi{constructor(t=0,e=0,i){d(this,"isVector2",!0),d(this,"x",0),d(this,"y",0),d(this,"z"),this.x=t,this.y=e,this.z=i||0}static isZero(t){return 0===t.x&&0===t.y}static isEmpty(t){return!Number.isFinite(t.x)&&!Number.isFinite(t.y)}static equals(t,e,i=!0){return i?t.x===e.x&&t.y===e.y:Math.abs(t.x-e.x)<Li&&Math.abs(t.y-e.y)<Li}static getInt32Array(t,e=2){const i=new ArrayBuffer(t.length*e*4),n=new Int32Array(i);for(let e=0,i=t.length;e<i;e++)n[2*e]=t[e].x,n[2*e+1]=t[e].y;return n}static getFloat64Array(t,e=2){const i=new ArrayBuffer(t.length*e*8),n=new Float64Array(i);for(let e=0,i=t.length;e<i;e++)n[2*e]=t[e].x,n[2*e+1]=t[e].y;return n}static getVectors(t){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(new Oi(t[i].x,t[i].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let i=0,n=t.length;i<n;i++)e.push(Oi.getString(t[i]));return e.join(",")}static getString(t){return`${t.x},${t.y}`}static getLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}static getDistance(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}static distanceToPolygon(t,e){let i=1/0;for(let n=0,s=e.length-1;n<e.length;s=n++){const r=e[n].x,a=e[n].y,o=e[s].x-r,h=e[s].y-a,l=Math.sqrt(o*o+h*h);if(l>0){const e=Math.max(0,Math.min(1,((t.x-r)*o+(t.y-a)*h)/(l*l))),n=r+e*o,s=a+e*h,u=Math.sqrt((t.x-n)*(t.x-n)+(t.y-s)*(t.y-s));i=Math.min(i,u)}}return i}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return(new Oi).subVectors(t,e)}static isPointOnSegment(t,e,i){return 0===Ni(this.sub(t,i).cross(this.sub(e,i)))&&Ni(this.sub(t,i).dot(this.sub(e,i)))<=0}static angle(t,e,i){return i?Math.atan2(t.y-e.y,t.x-e.x):(t=>{let e=t*(180/Math.PI);return e<0&&(e+=360),e>360&&(e-=360),e})(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let i=this.getClothoidPoints(t,e),n=0;for(let t=0,e=i.length;t<e;t++){let e=Math.max(0,t-1);t>0?n+=this.getDistance(i[e],i[e+1]):n=0,i[t].l=Math.round(n);let s=this.angle(i[e+1],i[e]);i[t].a=Math.round(100*s)/100}return i}static getClothoidPoints(t,e=100){let i=[],n=t.concat([]);if(!n||n.length<2)return i;2===n.length?(n.push(n[1]),n.unshift(n[0])):3===n.length&&n.splice(2,0,n[1]);for(let t=0;t<n.length-3;t+=3){let s=new Oi(n[t].x,n[t].y),r=new Oi(n[t+1].x,n[t+1].y),a=new Oi(n[t+2].x,n[t+2].y),o=new Oi(n[t+3].x,n[t+3].y),h=0;h+=s.distanceTo(r),h+=r.distanceTo(a),h+=a.distanceTo(o);let l=Math.min(.5,1/(h/e));for(let t=l;t<1;t+=l){let e=3*(r.x-s.x),n=3*(a.x-r.x)-e,h=o.x-s.x-e-n,l=3*(r.y-s.y),u=3*(a.y-r.y)-l,c=o.y-s.y-l-u,d=h*Math.pow(t,3)+n*Math.pow(t,2)+e*t+s.x,p=c*Math.pow(t,3)+u*Math.pow(t,2)+l*t+s.y;i.push({x:Math.round(d),y:Math.round(p),a:0,l:0})}}return i.unshift({x:n[0].x,y:n[0].y,a:0,l:0}),i.push({x:n[n.length-1].x,y:n[n.length-1].y,a:0,l:0}),i}static getClothoidLength(t){let e=0;if(t.length>2)for(let i=0;i<t.length;i++){let n=Math.max(0,i-1);i>0&&(e+=this.getDistance(t[n],t[n+1]))}return e}static getCircleCenterByChord(t,e,i,n=!0,s=new Oi){const r=this.getDistance(t,e);if(0===r)return s.x=1/0,s.y=1/0,s;Pi.set((t.x+e.x)/2,(t.y+e.y)/2);const a=Math.sqrt(i*i-r*r/4),o=n?-1:1;return s.x=Pi.x+o*a*(e.y-t.y)/r,s.y=Pi.y-o*a*(e.x-t.x)/r,s}static isPointInCircle(t,e,i){return this.getDistance(i,t)<e}static isPointInConvexHull(t,e){let i=!1;const n=e.length;for(let s=0,r=n-1;s<n;r=s++){const n=e[s],a=e[r];if(Math.min(n.x,a.x)<=t.x&&t.x<=Math.max(n.x,a.x)&&Math.min(n.y,a.y)<=t.y&&t.y<=Math.max(n.y,a.y)){const e=(a.x-n.x)*(t.y-n.y)-(a.y-n.y)*(t.x-n.x);if(Math.abs(e)<1e-12)return!0}n.y>t.y!=a.y>t.y&&t.x<(a.x-n.x)*(t.y-n.y)/(a.y-n.y)+n.x&&(i=!i)}return i}static isPointInPolygon(t,e){let i=!1;for(let n=0,s=e.length-1;n<e.length;s=n++){const r=e[n].x,a=e[n].y,o=e[s].x,h=e[s].y;a>t.y!=h>t.y&&t.x<(o-r)*(t.y-a)/(h-a)+r&&(i=!i)}return i}static isPointInPolygonByRay(t,e){let i=0;const n=(new Oi).copy(t),s=new Oi,r=new Oi;for(let t=0;t<e.length;t++){t===e.length-1?(s.copy(e[t]),r.copy(e[0])):(s.copy(e[t]),r.copy(e[t+1]));let a=[s.y,r.y].sort(((t,e)=>t-e));a[0]<n.y&&a[1]>n.y&&(s.x<n.x||r.x<n.x)&&i++}return i%2==1}static getIntersectionOfSegments(t,e,i,n,s=!1,r=new Oi){const a=(n.y-i.y)*(e.x-t.x)-(n.x-i.x)*(e.y-t.y);if(0===a)return r.makeEmpty();const o=((n.x-i.x)*(t.y-i.y)-(n.y-i.y)*(t.x-i.x))/a,h=((e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x))/a;return s&&(o<0||o>1||h<0||h>1)?r.makeEmpty():(r.x=t.x+o*(e.x-t.x),r.y=t.y+o*(e.y-t.y),r)}static getConvexHullByGrahamScan(t,e=!1,i=[]){if(!t||!t.length)return i;const n=t.length;let s=0;for(let e=0;e<n;e++)t[e].x<t[s].x&&(s=e);let r,a=s;do{i.push(t[a]),r=(a+1)%n;for(let e=0;e<n;e++)this.whichSideOfSegment(t[a],t[e],t[r])>0&&(r=e);a=r}while(a!==s);return e&&i.push(t[s]),i}static whichSideOfSegment(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)}static getPointsWithMatrix3(t,e){const i=[];if(!t)return i;for(let n=0,s=t.length;n<s;n++)i.push({x:e.elements[0]*t[n].x+e.elements[3]*t[n].y+e.elements[6],y:e.elements[1]*t[n].x+e.elements[4]*t[n].y+e.elements[7]});return i}static getPointsApplyMatrix3(t,e=[]){for(let i=0,n=e.length;i<n;i++){const n=t.elements[0]*e[i].x+t.elements[3]*e[i].y+t.elements[6],s=t.elements[1]*e[i].x+t.elements[4]*e[i].y+t.elements[7];e[i].x=n,e[i].y=s}return e}static getCentral(t,e=new Oi){let i=0,n=0;for(let e=0,s=t.length;e<s;e++)i+=t[e].x,n+=t[e].y;return e.set(i/t.length,n/t.length)}static getCentralByNumbers2(t,e=new Oi){let i=0,n=0;for(let e=0,s=t.length;e<s;e+=2)i+=t[e],n+=t[e+1];const s=t.length/2;return e.set(i/s,n/s)}static getCentroidByNumbers2(t,e=new Oi){if(!t||0===t.length)return e.set(0,0);if(t.length<6)return this.getCentralByNumbers2(t,e);let i=0,n=0,s=0;for(let e=0;e<t.length;e+=2){const r=(e+2)%t.length,a=t[e]*t[r+1]-t[r]*t[e+1];i+=a,n+=(t[e]+t[r])*a,s+=(t[e+1]+t[r+1])*a}return i/=2,Math.abs(i)<1e-10?this.getCentralByNumbers2(t,e):(n/=6*i,s/=6*i,e.set(n,s))}static getPoleOfInaccessibility(t,e=new Oi,i=1){const n=new Oi;Oi.getCentroidByNumbers2(t,n);const s=[];for(let e=0;e<t.length;e+=2)s.push({x:t[e],y:t[e+1]});let r={x:n.x,y:n.y},a=this.distanceToPolygon(r,s);for(let t=0;t<20;t++){const e=2*Math.PI*t/20,i=20*Math.random(),o={x:n.x+i*Math.cos(e),y:n.y+i*Math.sin(e)};if(this.isPointInPolygon(o,s)){const t=this.distanceToPolygon(o,s);t>a&&(a=t,r=o)}}return e.set(r.x,r.y),e.z=a,e}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clone(){return new Oi(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}cross(t){return this.x*t.y-this.y*t.x}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}dot(t){return this.x*t.x+this.y*t.y}equals(t,e=!0){return e?t.x===this.x&&t.y===this.y:Math.abs(t.x-this.x)<Li&&Math.abs(t.y-this.y)<Li}equalsXY(){return Math.abs(this.x-this.y)<Li}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+t)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}length(){return Math.sqrt(this.dot(this))}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}maxXY(t,e){return this.x=Math.max(this.x,t),this.y=Math.max(this.y,e),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}minXY(t,e){return this.x=Math.min(this.x,t),this.y=Math.min(this.y,e),this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t,e){return this.x*=t,this.y*=e||t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(t){return this.applyMatrix3(t.matrixWorldInverse).applyMatrix3(t.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.x,s=this.y;return this.x=n*e-s*i,this.y=n*i+s*e,this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),s=this.x-t.x,r=this.y-t.y;return this.x=s*i-r*n+t.x,this.y=s*n+r*i+t.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(t,e,i){return this.x=t,this.y=e,i&&(this.z=i),this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("out of range: "+t)}return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,3*e)}setLength(t){return this.normalize().multiplyScalar(t)}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(t,e=!1){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const Pi=new Oi,Li=1e-8;class Ri{constructor(t=new Oi(1/0,1/0),e=new Oi(-1/0,-1/0)){d(this,"isBox2",!0),d(this,"min"),d(this,"max"),this.min=t,this.max=e}applyMatrix3(t){return this.isEmpty()||(zi[0].set(this.min.x,this.min.y).applyMatrix3(t),zi[1].set(this.min.x,this.max.y).applyMatrix3(t),zi[3].set(this.max.x,this.max.y).applyMatrix3(t),zi[2].set(this.max.x,this.min.y).applyMatrix3(t),this.setFromPoints(zi)),this}clone(){return(new Ri).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}ceil(){return this.min.ceilToZero(),this.max.ceilToZero(),this}distanceToPoint(t){return Ui.copy(t).clamp(this.min,this.max).sub(t).length()}expandByXY(t,e){return this.min.minXY(t,e),this.max.maxXY(t,e),this}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByPoints(t){if(!t||!t.length)return this;for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){var e;this.union(t.boundingBoxWorld);for(let i=0,n=(null==(e=t.children)?void 0:e.length)||0;i<n;i++)this.expandByObject(t.children[i]);return this}expandByObjects(t){for(let e=0,i=t.length;e<i;e++)this.expandByObject(t[e]);return this}expandByBox(t){t.isEmpty()||(this.expandByPoint(t.min),this.expandByPoint(t.max))}expandByCubic(t,e,i,n,s,r,a,o){this.makeEmpty();let h=vi(t,i,s,a,Wi);for(let e=0;e<h;e++){const n=gi(t,i,s,a,Wi[e]);this.min.x=Math.min(n,this.min.x),this.max.x=Math.max(n,this.max.x)}h=vi(e,n,r,o,qi);for(let t=0;t<h;t++){const i=gi(e,n,r,o,qi[t]);this.min.y=Math.min(i,this.min.y),this.max.y=Math.max(i,this.max.y)}return this.expandByXY(t,e),this.expandByXY(a,o),this}expandByQuadratic(t,e,i,n,s,r){const a=Math.max(0,Math.min(1,_i(t,i,s))),o=Math.max(0,Math.min(1,_i(e,n,r))),h=wi(t,i,s,a),l=wi(e,n,r,o);return this.expandByXY(t,e),this.expandByXY(s,r),this.expandByXY(h,l),this}expandByArc(t,e,i,n,s,r,a){let o=s%(2*Math.PI);o<0&&(o+=2*Math.PI);let h=r%(2*Math.PI);if(h<0&&(h+=2*Math.PI),o===h)return this.expandByXY(t-i,e-n),this.expandByXY(t+i,e+n),this;if(a){const t=o;o=h,h=t}return h<o&&(h+=2*Math.PI),this.expandByXY(t+i*Math.cos(o),e+n*Math.sin(o)),this.expandByXY(t+i*Math.cos(h),e+n*Math.sin(h)),o>.5*Math.PI&&h<2*Math.PI+.5*Math.PI&&this.expandByXY(t,e+n),o>Math.PI&&h<2*Math.PI+Math.PI&&this.expandByXY(t-i,e),o>1.5*Math.PI&&h<2*Math.PI+1.5*Math.PI&&this.expandByXY(t,e-n),o>0&&h<2*Math.PI&&this.expandByXY(t+i,e),this}expandByEllipse(t,e,i,n,s,r,a,o){Hi[0]=r,Hi[1]=a,Ii(Hi,o),r=Hi[0],a=Hi[1];const h=t+i*Math.cos(r),l=e+n*Math.sin(r),u=t+i*Math.cos(a),c=e+n*Math.sin(a);this.expandByXY(h,l),this.expandByXY(u,c);const d=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const h of d)if(Ci(h,r,a,o)){const r=t+i*Math.cos(h),a=e+n*Math.sin(h),o=t+(r-t)*Math.cos(s)-(a-e)*Math.sin(s),l=e+(r-t)*Math.sin(s)+(a-e)*Math.cos(s);this.expandByXY(o,l)}return this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}floor(){return this.min.floorToZero(),this.max.floorToZero(),this}getCenter(t=new Oi){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t=new Oi){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}getPoints(t=[]){return t.length=0,t[0]={x:this.min.x,y:this.min.y},t[1]={x:this.min.x,y:this.max.y},t[2]={x:this.max.x,y:this.max.y},t[3]={x:this.max.x,y:this.min.y},t}getNumbersArray(t=[]){return[this.min.x,this.min.y,this.min.x,this.max.y,this.max.x,this.max.y,this.max.x,this.min.y]}getArea(){return this.getSize(Ui),Ui.x*Ui.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}intersectsBox(t){return!!t&&!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}intersectsObject(t){return!(!t||!t.geometry)&&this.intersectsBox(t.geometry.boundingBox)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}round(){return this.min.roundToZero(),this.max.roundToZero(),this}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(Ui.fromArray(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Ui.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromProjectionMatrix(t){return this.min.set(t.elements[6],t.elements[7]),this.max.set(t.elements[6],t.elements[7]),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}setFromMinMaxString(t,e=" "){if(this.makeEmpty(),!(null==t?void 0:t.length))return this;let i=t.split(e),n=mi.map(i,(t=>parseFloat(t)));for(let t=0,e=n.length;t<e;t+=2)this.expandByPoint(Ui.fromArray(n,t));return this}setFromXYXY(t,e,i,n){return this.makeEmpty(),this.expandByXY(t,e),this.expandByXY(i,n),this}translate(t){return this.min.add(t),this.max.add(t),this}toString(){return`{"min":${this.min.toString()},"max":${this.max.toString()}}`}fromString(t){return t?(this.copy(JSON.parse(t)),this):this}union(t){return t.validate()?(this.min.min(t.min),this.max.max(t.max),this):this}validate(){return this.min.validate()&&this.max.validate()}unproject(t){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}centralArrange(t=1,e=20,i=10,n){const s=e+i;n?Ui.copy(n):this.getCenter(Ui),this.getSize(Fi),Fi.subScalar(e);const r=Math.floor(Fi.x/s),a=r*s,o=Math.ceil(t/r)*s;if(Fi.x<s||Fi.y<s||a>=Fi.x||o>=Fi.y)return Ui.clone();let h=[],l=0,u=0;for(let e=0;e<t;e++){const e=r>t?t*s:a,i=Ui.x-e/2+u*s+s/2,n=Ui.y-o/2+l*s+s/2;h.push(new Oi(i,n)),u++,u>=r&&(u=0,l++)}return h}flipY(){return Ui.copy(this.min).multiplyScalar(1,-1),Fi.copy(this.max).multiplyScalar(1,-1),this.min.set(Ui.x,Fi.y),this.max.set(Fi.x,Ui.y),this}}const zi=[new Oi,new Oi,new Oi,new Oi],Ui=new Oi,Fi=new Oi,Wi=[],qi=[],Hi=[],Vi=n;class ji extends $e{constructor(t){super(t),this.defaultDPI=90,this.defaultUnit="px"}load(t,e,i,n){const s=this,r=new Ke(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(t,(function(i){try{e(s.parse(i))}catch(e){n&&n(e),s.manager.itemError(t)}}),i,n)}parse(t){const e=this;function i(t,e,i,s,r,a,o,h){if(0==e||0==i)return void t.lineTo(h.x,h.y);s=s*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const l=(o.x-h.x)/2,u=(o.y-h.y)/2,c=Math.cos(s)*l+Math.sin(s)*u,d=-Math.sin(s)*l+Math.cos(s)*u;let p=e*e,f=i*i;const m=c*c,y=d*d,g=m/p+y/f;if(g>1){const t=Math.sqrt(g);p=(e*=t)*e,f=(i*=t)*i}const v=p*y+f*m,x=(p*f-v)/v;let b=Math.sqrt(Math.max(0,x));r===a&&(b=-b);const _=b*e*d/i,w=-b*i*c/e,S=Math.cos(s)*_-Math.sin(s)*w+(o.x+h.x)/2,M=Math.sin(s)*_+Math.cos(s)*w+(o.y+h.y)/2,E=n(1,0,(c-_)/e,(d-w)/i),A=n((c-_)/e,(d-w)/i,(-c-_)/e,(-d-w)/i)%(2*Math.PI);t.currentPath.absellipse(S,M,e,i,E,E+A,0===a,s)}function n(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}function s(t,e){e=Object.assign({},e);let i={};if(t.hasAttribute("class")){const e=t.getAttribute("class").split(/\s/).filter(Boolean).map((t=>t.trim()));for(let t=0;t<e.length;t++)i=Object.assign(i,m["."+e[t]])}function n(n,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(n)&&(e[s]=r(t.getAttribute(n))),i[n]&&(e[s]=r(i[n])),t.style&&""!==t.style[n]&&(e[s]=r(t.style[n]))}function s(t){return Math.max(0,Math.min(1,l(t)))}function r(t){return Math.max(0,l(t))}return t.hasAttribute("id")&&(i=Object.assign(i,m["#"+t.getAttribute("id")])),n("fill","fill"),n("fill-opacity","fillOpacity",s),n("fill-rule","fillRule"),n("opacity","opacity",s),n("stroke","stroke"),n("stroke-opacity","strokeOpacity",s),n("stroke-width","strokeWidth",r),n("stroke-linejoin","strokeLineJoin"),n("stroke-linecap","strokeLineCap"),n("stroke-miterlimit","strokeMiterLimit",r),n("visibility","visibility"),e}function r(t,e){return t-(e-t)}function a(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%i)&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}const o=["mm","cm","in","pt","pc","px"],h={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function l(t){let i,n="px";if("string"==typeof t||t instanceof String)for(let e=0,i=o.length;e<i;e++){const i=o[e];if(t.endsWith(i)){n=i,t=t.substring(0,t.length-i.length);break}}return"px"===n&&"px"!==e.defaultUnit?i=h.in[e.defaultUnit]/e.defaultDPI:(i=h[n][e.defaultUnit],i<0&&(i=h[n].in*e.defaultDPI)),i*parseFloat(t)}function u(t){const e=t.elements;return e[0]*e[4]-e[1]*e[3]<0}function c(t){const e=t.elements,i=e[0]*e[3]+e[1]*e[4];if(0===i)return!1;const n=d(t),s=p(t);return Math.abs(i/(n*s))>Number.EPSILON}function d(t){const e=t.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function p(t){const e=t.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}const f=[],m={},y=[],g=new b,v=new b,_=new b,w=new b,S=new x,M=new R,E=new b,A=(new DOMParser).parseFromString(t,"image/svg+xml");return function t(e,n){if(1!==e.nodeType)return;const o=function(t){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))))return null;const e=function(t){const e=new b,i=g;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){const i=l(t.getAttribute("x")),n=l(t.getAttribute("y"));e.translate(i,n)}if(t.hasAttribute("transform")){const n=t.getAttribute("transform").split(")");for(let t=n.length-1;t>=0;t--){const s=n[t].trim();if(""===s)continue;const r=s.indexOf("("),o=s.length;if(r>0&&r<o){const t=s.slice(0,r),e=a(s.slice(r+1));switch(i.identity(),t){case"translate":if(e.length>=1){const t=e[0];let n=0;e.length>=2&&(n=e[1]),i.translate(t,n)}break;case"rotate":if(e.length>=1){let t=0,n=0,s=0;t=e[0]*Math.PI/180,e.length>=3&&(n=e[1],s=e[2]),v.makeTranslation(-n,-s),_.makeRotation(t),w.multiplyMatrices(_,v),v.makeTranslation(n,s),i.multiplyMatrices(v,w)}break;case"scale":if(e.length>=1){const t=e[0];let n=t;e.length>=2&&(n=e[1]),i.scale(t,n)}break;case"skewX":1===e.length&&i.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&i.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&i.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}e.premultiply(i)}}return e}(t);return y.length>0&&e.premultiply(y[y.length-1]),E.copy(e),y.push(e),e}(e);let h=!1,A=null;switch(e.nodeName){case"svg":case"g":n=s(e,n);break;case"style":!function(t){if(t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length)for(let e=0;e<t.sheet.cssRules.length;e++){const i=t.sheet.cssRules[e];if(1!==i.type)continue;const n=i.selectorText.split(/,/gm).filter(Boolean).map((t=>t.trim()));for(let t=0;t<n.length;t++){const e=Object.fromEntries(Object.entries(i.style).filter((([,t])=>""!==t)));m[n[t]]=Object.assign(m[n[t]]||{},e)}}}(e);break;case"path":n=s(e,n),e.hasAttribute("d")&&(A=function(t){const e=new ii,n=new x,s=new x,o=new x;let h=!0,l=!1;const u=t.getAttribute("d");if(""===u||"none"===u)return null;const c=u.match(/[a-df-z][^a-df-z]*/gi);for(let t=0,u=c.length;t<u;t++){const u=c[t],d=u.charAt(0),p=u.slice(1).trim();let f;switch(!0===h&&(l=!0,h=!1),d){case"M":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x=f[t+0],n.y=f[t+1],s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&o.copy(n);break;case"H":f=a(p);for(let t=0,i=f.length;t<i;t++)n.x=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"V":f=a(p);for(let t=0,i=f.length;t<i;t++)n.y=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"L":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x=f[t+0],n.y=f[t+1],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"C":f=a(p);for(let t=0,i=f.length;t<i;t+=6)e.bezierCurveTo(f[t+0],f[t+1],f[t+2],f[t+3],f[t+4],f[t+5]),s.x=f[t+2],s.y=f[t+3],n.x=f[t+4],n.y=f[t+5],0===t&&!0===l&&o.copy(n);break;case"S":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.bezierCurveTo(r(n.x,s.x),r(n.y,s.y),f[t+0],f[t+1],f[t+2],f[t+3]),s.x=f[t+0],s.y=f[t+1],n.x=f[t+2],n.y=f[t+3],0===t&&!0===l&&o.copy(n);break;case"Q":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.quadraticCurveTo(f[t+0],f[t+1],f[t+2],f[t+3]),s.x=f[t+0],s.y=f[t+1],n.x=f[t+2],n.y=f[t+3],0===t&&!0===l&&o.copy(n);break;case"T":f=a(p);for(let t=0,i=f.length;t<i;t+=2){const i=r(n.x,s.x),a=r(n.y,s.y);e.quadraticCurveTo(i,a,f[t+0],f[t+1]),s.x=i,s.y=a,n.x=f[t+0],n.y=f[t+1],0===t&&!0===l&&o.copy(n)}break;case"A":f=a(p,[3,4],7);for(let t=0,r=f.length;t<r;t+=7){if(f[t+5]==n.x&&f[t+6]==n.y)continue;const r=n.clone();n.x=f[t+5],n.y=f[t+6],s.x=n.x,s.y=n.y,i(e,f[t],f[t+1],f[t+2],f[t+3],f[t+4],r,n),0===t&&!0===l&&o.copy(n)}break;case"m":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x+=f[t+0],n.y+=f[t+1],s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&o.copy(n);break;case"h":f=a(p);for(let t=0,i=f.length;t<i;t++)n.x+=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"v":f=a(p);for(let t=0,i=f.length;t<i;t++)n.y+=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"l":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x+=f[t+0],n.y+=f[t+1],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"c":f=a(p);for(let t=0,i=f.length;t<i;t+=6)e.bezierCurveTo(n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3],n.x+f[t+4],n.y+f[t+5]),s.x=n.x+f[t+2],s.y=n.y+f[t+3],n.x+=f[t+4],n.y+=f[t+5],0===t&&!0===l&&o.copy(n);break;case"s":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.bezierCurveTo(r(n.x,s.x),r(n.y,s.y),n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3]),s.x=n.x+f[t+0],s.y=n.y+f[t+1],n.x+=f[t+2],n.y+=f[t+3],0===t&&!0===l&&o.copy(n);break;case"q":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.quadraticCurveTo(n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3]),s.x=n.x+f[t+0],s.y=n.y+f[t+1],n.x+=f[t+2],n.y+=f[t+3],0===t&&!0===l&&o.copy(n);break;case"t":f=a(p);for(let t=0,i=f.length;t<i;t+=2){const i=r(n.x,s.x),a=r(n.y,s.y);e.quadraticCurveTo(i,a,n.x+f[t+0],n.y+f[t+1]),s.x=i,s.y=a,n.x=n.x+f[t+0],n.y=n.y+f[t+1],0===t&&!0===l&&o.copy(n)}break;case"a":f=a(p,[3,4],7);for(let t=0,r=f.length;t<r;t+=7){if(0==f[t+5]&&0==f[t+6])continue;const r=n.clone();n.x+=f[t+5],n.y+=f[t+6],s.x=n.x,s.y=n.y,i(e,f[t],f[t+1],f[t+2],f[t+3],f[t+4],r,n),0===t&&!0===l&&o.copy(n)}break;case"Z":case"z":e.currentPath.autoClose=!0,e.currentPath.curves.length>0&&(n.copy(o),e.currentPath.currentPoint.copy(n),h=!0)}l=!1}return e}(e));break;case"rect":n=s(e,n),A=function(t){const e=l(t.getAttribute("x")||0),i=l(t.getAttribute("y")||0),n=l(t.getAttribute("rx")||t.getAttribute("ry")||0),s=l(t.getAttribute("ry")||t.getAttribute("rx")||0),r=l(t.getAttribute("width")),a=l(t.getAttribute("height")),o=.448084975506,h=new ii;return h.moveTo(e+n,i),h.lineTo(e+r-n,i),(0!==n||0!==s)&&h.bezierCurveTo(e+r-n*o,i,e+r,i+s*o,e+r,i+s),h.lineTo(e+r,i+a-s),(0!==n||0!==s)&&h.bezierCurveTo(e+r,i+a-s*o,e+r-n*o,i+a,e+r-n,i+a),h.lineTo(e+n,i+a),(0!==n||0!==s)&&h.bezierCurveTo(e+n*o,i+a,e,i+a-s*o,e,i+a-s),h.lineTo(e,i+s),(0!==n||0!==s)&&h.bezierCurveTo(e,i+s*o,e+n*o,i,e+n,i),h}(e);break;case"polygon":n=s(e,n),A=function(t){function e(t,e,i){const r=l(e),a=l(i);0===s?n.moveTo(r,a):n.lineTo(r,a),s++}const i=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,n=new ii;let s=0;return t.getAttribute("points").replace(i,e),n.currentPath.autoClose=!0,n}(e);break;case"polyline":n=s(e,n),A=function(t){function e(t,e,i){const r=l(e),a=l(i);0===s?n.moveTo(r,a):n.lineTo(r,a),s++}const i=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,n=new ii;let s=0;return t.getAttribute("points").replace(i,e),n.currentPath.autoClose=!1,n}(e);break;case"circle":n=s(e,n),A=function(t){const e=l(t.getAttribute("cx")||0),i=l(t.getAttribute("cy")||0),n=l(t.getAttribute("r")||0),s=new ye;s.absarc(e,i,n,0,2*Math.PI);const r=new ii;return r.subPaths.push(s),r}(e);break;case"ellipse":n=s(e,n),A=function(t){const e=l(t.getAttribute("cx")||0),i=l(t.getAttribute("cy")||0),n=l(t.getAttribute("rx")||0),s=l(t.getAttribute("ry")||0),r=new ye;r.absellipse(e,i,n,s,0,2*Math.PI);const a=new ii;return a.subPaths.push(r),a}(e);break;case"line":n=s(e,n),A=function(t){const e=l(t.getAttribute("x1")||0),i=l(t.getAttribute("y1")||0),n=l(t.getAttribute("x2")||0),s=l(t.getAttribute("y2")||0),r=new ii;return r.moveTo(e,i),r.lineTo(n,s),r.currentPath.autoClose=!1,r}(e);break;case"defs":h=!0;break;case"use":n=s(e,n);const o=(e.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),u=e.viewportElement.getElementById(o);u&&t(u,n)}A&&(void 0!==n.fill&&"none"!==n.fill&&A.color.setStyle(n.fill,Vi),function(t,e){function i(t){M.set(t.x,t.y,1).applyMatrix3(e),t.set(M.x,M.y)}function n(t){const i=t.xRadius,n=t.yRadius,s=Math.cos(t.aRotation),r=Math.sin(t.aRotation),a=new R(i*s,i*r,0),o=new R(-n*r,n*s,0),h=a.applyMatrix3(e),l=o.applyMatrix3(e),c=g.set(h.x,l.x,0,h.y,l.y,0,0,0,1),d=v.copy(c).invert(),p=_.copy(d).transpose().multiply(d).elements,f=function(t,e,i){let n,s,r,a,o;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(n=.5*(h+u),o=1/n,s=t*o*i-e*o*e):h<0?s=.5*(h-u):(n=.5*u,s=-.5*u),r=l>0?l+u:l-u,Math.abs(r)>2*Math.abs(e)?(o=-2*e/r,a=1/Math.sqrt(1+o*o),r=o*a):0===Math.abs(e)?(r=1,a=0):(o=-.5*r/e,r=1/Math.sqrt(1+o*o),a=o*r),l>0&&(o=r,r=-a,a=o),{rt1:n,rt2:s,cs:r,sn:a}}(p[0],p[1],p[4]),m=Math.sqrt(f.rt1),y=Math.sqrt(f.rt2);if(t.xRadius=1/m,t.yRadius=1/y,t.aRotation=Math.atan2(f.sn,f.cs),!((t.aEndAngle-t.aStartAngle)%(2*Math.PI)<Number.EPSILON)){const i=v.set(m,0,0,0,y,0,0,0,1),n=_.set(f.cs,f.sn,0,-f.sn,f.cs,0,0,0,1),s=i.multiply(n).multiply(c),r=t=>{const{x:e,y:i}=new R(Math.cos(t),Math.sin(t),0).applyMatrix3(s);return Math.atan2(i,e)};t.aStartAngle=r(t.aStartAngle),t.aEndAngle=r(t.aEndAngle),u(e)&&(t.aClockwise=!t.aClockwise)}}function s(t){const i=d(e),n=p(e);t.xRadius*=i,t.yRadius*=n;const s=i>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);t.aRotation+=s,u(e)&&(t.aStartAngle*=-1,t.aEndAngle*=-1,t.aClockwise=!t.aClockwise)}const r=t.subPaths;for(let t=0,a=r.length;t<a;t++){const a=r[t].curves;for(let t=0;t<a.length;t++){const r=a[t];r.isLineCurve?(i(r.v1),i(r.v2)):r.isCubicBezierCurve?(i(r.v0),i(r.v1),i(r.v2),i(r.v3)):r.isQuadraticBezierCurve?(i(r.v0),i(r.v1),i(r.v2)):r.isEllipseCurve&&(S.set(r.aX,r.aY),i(S),r.aX=S.x,r.aY=S.y,c(e)?n(r):s(r))}}}(A,E),f.push(A),A.userData={node:e,style:n});const T=e.childNodes;for(let e=0;e<T.length;e++){const i=T[e];h&&"style"!==i.nodeName&&"defs"!==i.nodeName||t(i,n)}o&&(y.pop(),y.length>0?E.copy(y[y.length-1]):E.identity())}(A.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:f,xml:A.documentElement}}static createShapes(t){const e=999999999,i=0,n=1,s=2,r=3,a=4,o=5,h=6,l={loc:i,t:0};function u(t,e,n,r){const a=t.x,o=e.x,h=n.x,u=r.x,d=t.y,p=e.y,f=n.y,m=r.y,y=(u-h)*(d-f)-(m-f)*(a-h),g=(m-f)*(o-a)-(u-h)*(p-d),v=y/g,x=((o-a)*(d-f)-(p-d)*(a-h))/g;if(0===g&&0!==y||v<=0||v>=1||x<0||x>1)return null;if(0===y&&0===g){for(let h=0;h<2;h++){if(c(0===h?n:r,t,e),l.loc==i){const t=0===h?n:r;return{x:t.x,y:t.y,t:l.t}}if(l.loc==s)return{x:+(a+l.t*(o-a)).toPrecision(10),y:+(d+l.t*(p-d)).toPrecision(10),t:l.t}}return null}for(let s=0;s<2;s++)if(c(0===s?n:r,t,e),l.loc==i){const t=0===s?n:r;return{x:t.x,y:t.y,t:l.t}}return{x:+(a+v*(o-a)).toPrecision(10),y:+(d+v*(p-d)).toPrecision(10),t:v}}function c(t,e,u){const c=u.x-e.x,d=u.y-e.y,p=t.x-e.x,f=t.y-e.y,m=c*f-p*d;if(t.x===e.x&&t.y===e.y)return l.loc=i,void(l.t=0);if(t.x===u.x&&t.y===u.y)return l.loc=n,void(l.t=1);if(m<-Number.EPSILON)return void(l.loc=r);if(m>Number.EPSILON)return void(l.loc=a);if(c*p<0||d*f<0)return void(l.loc=o);if(Math.sqrt(c*c+d*d)<Math.sqrt(p*p+f*f))return void(l.loc=h);let y;y=0!==c?p/c:f/d,l.loc=s,l.t=y}function d(t,e,i){const n=new x;e.getCenter(n);const s=[];return i.forEach((e=>{e.boundingBox.containsPoint(n)&&function(t,e){const i=[],n=[];for(let s=1;s<t.length;s++){const r=t[s-1],a=t[s];for(let t=1;t<e.length;t++){const s=u(r,a,e[t-1],e[t]);null!==s&&void 0===i.find((t=>t.t<=s.t+Number.EPSILON&&t.t>=s.t-Number.EPSILON))&&(i.push(s),n.push(new x(s.x,s.y)))}}return n}(t,e.points).forEach((t=>{s.push({identifier:e.identifier,isCW:e.isCW,point:t})}))})),s.sort(((t,e)=>t.point.x-e.point.x)),s}let p=e,f=-999999999,m=t.subPaths.map((t=>{const i=t.getPoints();let n=-999999999,s=e,r=-999999999,a=e;for(let t=0;t<i.length;t++){const e=i[t];e.y>n&&(n=e.y),e.y<s&&(s=e.y),e.x>r&&(r=e.x),e.x<a&&(a=e.x)}return f<=r&&(f=r+1),p>=a&&(p=a-1),{curves:t.curves,points:i,isCW:je.isClockWise(i),identifier:-1,boundingBox:new ei(new x(a,s),new x(r,n))}}));m=m.filter((t=>t.points.length>1));for(let t=0;t<m.length;t++)m[t].identifier=t;const y=m.map((e=>function(t,e,i,n,s){null!=s&&""!==s||(s="nonzero");const r=new x;t.boundingBox.getCenter(r);const a=d([new x(i,r.y),new x(n,r.y)],t.boundingBox,e);a.sort(((t,e)=>t.point.x-e.point.x));const o=[],h=[];a.forEach((e=>{e.identifier===t.identifier?o.push(e):h.push(e)}));const l=o[0].point.x,u=[];let c=0;for(;c<h.length&&h[c].point.x<l;)u.length>0&&u[u.length-1]===h[c].identifier?u.pop():u.push(h[c].identifier),c++;if(u.push(t.identifier),"evenodd"===s){const e=u.length%2==0,i=u[u.length-2];return{identifier:t.identifier,isHole:e,for:i}}if("nonzero"===s){let i=!0,n=null,s=null;for(let t=0;t<u.length;t++){const r=u[t];i?(s=e[r].isCW,i=!1,n=r):s!==e[r].isCW&&(s=e[r].isCW,i=!0)}return{identifier:t.identifier,isHole:i,for:n}}}(e,m,p,f,t.userData?t.userData.style.fillRule:void 0))),g=[];return m.forEach((t=>{if(!y[t.identifier].isHole){const e=new ge;e.curves=t.curves,y.filter((e=>e.isHole&&e.for===t.identifier)).forEach((t=>{const i=m[t.identifier],n=new ye;n.curves=i.curves,e.holes.push(n)})),g.push(e)}})),g}static getStrokeStyle(t,e,i,n,s){return{strokeColor:e=void 0!==e?e:"#000",strokeWidth:t=void 0!==t?t:1,strokeLineJoin:i=void 0!==i?i:"miter",strokeLineCap:n=void 0!==n?n:"butt",strokeMiterLimit:s=void 0!==s?s:4}}static pointsToStroke(t,e,i,n){const s=[],r=[],a=[];if(0===ji.pointsToStrokeWithBuffers(t,e,i,n,s,r,a))return null;const o=new Kt;return o.setAttribute("position",new jt(s,3)),o.setAttribute("normal",new jt(r,3)),o.setAttribute("uv",new jt(a,2)),o}static pointsToStrokeWithBuffers(t,e,i,n,s,r,a,o){const h=new x,l=new x,u=new x,c=new x,d=new x,p=new x,f=new x,m=new x,y=new x,g=new x,v=new x,b=new x,_=new x,w=new x,S=new x,M=new x,E=new x;i=void 0!==i?i:12,n=void 0!==n?n:.001,o=void 0!==o?o:0;const A=(t=function(t){let e=!1;for(let i=1,s=t.length-1;i<s;i++)if(t[i].distanceTo(t[i+1])<n){e=!0;break}if(!e)return t;const i=[];i.push(t[0]);for(let e=1,s=t.length-1;e<s;e++)t[e].distanceTo(t[e+1])>=n&&i.push(t[e]);return i.push(t[t.length-1]),i}(t)).length;if(A<2)return 0;const T=t[0].equals(t[A-1]);let I,C,D=t[0];const N=e.strokeWidth/2,B=1/(A-1);let k,O,P,L,R=0,z=!1,U=0,F=3*o,W=2*o;q(t[0],t[1],h).multiplyScalar(N),m.copy(t[0]).sub(h),y.copy(t[0]).add(h),g.copy(m),v.copy(y);for(let i=1;i<A;i++){I=t[i],C=i===A-1?T?t[1]:void 0:t[i+1];const n=h;if(q(D,I,n),u.copy(n).multiplyScalar(N),b.copy(I).sub(u),_.copy(I).add(u),k=R+B,O=!1,void 0!==C){q(I,C,l),u.copy(l).multiplyScalar(N),w.copy(I).sub(u),S.copy(I).add(u),P=!0,u.subVectors(C,D),n.dot(u)<0&&(P=!1),1===i&&(z=P),u.subVectors(C,I),u.normalize();const t=Math.abs(n.dot(u));if(t>Number.EPSILON){const i=N/t;u.multiplyScalar(-i),c.subVectors(I,D),d.copy(c).setLength(i).add(u),M.copy(d).negate();const n=d.length(),s=c.length();c.divideScalar(s),p.subVectors(C,I);const r=p.length();switch(p.divideScalar(r),c.dot(M)<s&&p.dot(M)<r&&(O=!0),E.copy(d).add(I),M.add(I),L=!1,O?P?(S.copy(M),_.copy(M)):(w.copy(M),b.copy(M)):j(),e.strokeLineJoin){case"bevel":Y(P,O,k);break;case"round":G(P,O),P?V(I,b,w,k,0):V(I,S,_,k,1);break;default:const t=N*e.strokeMiterLimit/n;if(t<1){if("miter-clip"!==e.strokeLineJoin){Y(P,O,k);break}G(P,O),P?(p.subVectors(E,b).multiplyScalar(t).add(b),f.subVectors(E,w).multiplyScalar(t).add(w),H(b,k,0),H(p,k,0),H(I,k,.5),H(I,k,.5),H(p,k,0),H(f,k,0),H(I,k,.5),H(f,k,0),H(w,k,0)):(p.subVectors(E,_).multiplyScalar(t).add(_),f.subVectors(E,S).multiplyScalar(t).add(S),H(_,k,1),H(p,k,1),H(I,k,.5),H(I,k,.5),H(p,k,1),H(f,k,1),H(I,k,.5),H(f,k,1),H(S,k,1))}else O?(P?(H(y,R,1),H(m,R,0),H(E,k,0),H(y,R,1),H(E,k,0),H(M,k,1)):(H(y,R,1),H(m,R,0),H(E,k,1),H(m,R,0),H(M,k,0),H(E,k,1)),P?w.copy(E):S.copy(E)):P?(H(b,k,0),H(E,k,0),H(I,k,.5),H(I,k,.5),H(E,k,0),H(w,k,0)):(H(_,k,1),H(E,k,1),H(I,k,.5),H(I,k,.5),H(E,k,1),H(S,k,1)),L=!0}}else j()}else j();T||i!==A-1||X(t[0],g,v,P,!0,R),R=k,D=I,m.copy(w),y.copy(S)}if(T){if(O&&s){let t=E,e=M;z!==P&&(t=M,e=E),P?(L||z)&&(e.toArray(s,0),e.toArray(s,9),L&&t.toArray(s,3)):!L&&z||(e.toArray(s,3),e.toArray(s,9),L&&t.toArray(s,0))}}else X(I,b,_,P,!1,k);return U;function q(t,e,i){return i.subVectors(e,t),i.set(-i.y,i.x).normalize()}function H(t,e,i){s&&(s[F]=t.x,s[F+1]=t.y,s[F+2]=0,r&&(r[F]=0,r[F+1]=0,r[F+2]=1),F+=3,a&&(a[W]=e,a[W+1]=i,W+=2)),U+=3}function V(t,e,n,s,r){h.copy(e).sub(t).normalize(),l.copy(n).sub(t).normalize();let a=Math.PI;const o=h.dot(l);Math.abs(o)<1&&(a=Math.abs(Math.acos(o))),a/=i,u.copy(e);for(let e=0,n=i-1;e<n;e++)c.copy(u).rotateAround(t,a),H(u,s,r),H(c,s,r),H(t,s,.5),u.copy(c);H(c,s,r),H(n,s,r),H(t,s,.5)}function j(){H(y,R,1),H(m,R,0),H(b,k,0),H(y,R,1),H(b,k,0),H(_,k,1)}function Y(t,e,i){e?t?(H(y,R,1),H(m,R,0),H(b,k,0),H(y,R,1),H(b,k,0),H(M,k,1),H(b,i,0),H(w,i,0),H(M,i,.5)):(H(y,R,1),H(m,R,0),H(_,k,1),H(m,R,0),H(M,k,0),H(_,k,1),H(_,i,1),H(M,i,0),H(S,i,1)):t?(H(b,i,0),H(w,i,0),H(I,i,.5)):(H(_,i,1),H(S,i,0),H(I,i,.5))}function G(t,e){e&&(t?(H(y,R,1),H(m,R,0),H(b,k,0),H(y,R,1),H(b,k,0),H(M,k,1),H(b,R,0),H(I,k,.5),H(M,k,1),H(I,k,.5),H(w,R,0),H(M,k,1)):(H(y,R,1),H(m,R,0),H(_,k,1),H(m,R,0),H(M,k,0),H(_,k,1),H(_,R,1),H(M,k,0),H(I,k,.5),H(I,k,.5),H(M,k,0),H(S,R,1)))}function X(t,i,n,r,o,d){switch(e.strokeLineCap){case"round":o?V(t,n,i,d,.5):V(t,i,n,d,.5);break;case"square":if(o)h.subVectors(i,t),l.set(h.y,-h.x),u.addVectors(h,l).add(t),c.subVectors(l,h).add(t),r?(u.toArray(s,3),c.toArray(s,0),c.toArray(s,9)):(u.toArray(s,3),1===a[7]?c.toArray(s,9):u.toArray(s,9),c.toArray(s,0));else{h.subVectors(n,t),l.set(h.y,-h.x),u.addVectors(h,l).add(t),c.subVectors(l,h).add(t);const e=s.length;r?(u.toArray(s,e-3),c.toArray(s,e-6),c.toArray(s,e-12)):(c.toArray(s,e-6),u.toArray(s,e-3),c.toArray(s,e-12))}}}}}class Yi extends R{constructor(t,e,i){super(t,e,i)}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}floorToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this.z=this.z<0?Math.floor(this.z):Math.ceil(this.z),this}roundToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this.z=this.z<0?Math.floor(this.z):Math.ceil(this.z),this}toString(){return`{x: ${this.x}, y: ${this.y}}`}}class Gi{constructor(){d(this,"isMatrix3",!0),d(this,"elements",[1,0,0,0,1,0,0,0,1])}static equals(t,e,i=1e-6){if(t.elements.length!=e.elements.length)return!1;for(let n=0,s=t.elements.length;n<s;n++){const s=t.elements[n]-e.elements[n];if(Math.abs(s)>i)return!1}return!0}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}clone(){return(new Gi).fromArray(this.elements)}compose(t,e,i){const n=Math.sin(e.x),s=Math.cos(e.x);return this.set(i.x*s,i.y*n*-1,t.x,i.x*n,i.y*s,t.y,0,0,1)}composeWithCenter(t,e,i,n){return Qi.identity(),Ki.makeTranslation(t.x,t.y),tn.makeRotation(e.x),en.makeScale(i.x,i.y),$i.copy(n).applyMatrix3(en),Qi.multiply(nn.makeTranslation(-$i.x,-$i.y)).multiply(Ki).multiply(nn.makeTranslation($i.x,$i.y)).multiply(tn).multiply(nn.makeTranslation(-$i.x,-$i.y)).multiply(en),this.copy(Qi)}decompose(t,e,i){const n=Qi.copy(this).elements,s=Math.sqrt(n[0]*n[0]+n[3]*n[3]),r=Math.sqrt(n[1]*n[1]+n[4]*n[4]),a=n[0]*n[4]-n[3]*n[1];n[0]||n[3]?i.set(s,a/s):n[1]||n[4]?i.set(a/r,r):i.set(0,0);let o=0;o=n[0]||n[3]?n[3]>0?-Math.acos(n[0]/s):Math.acos(n[0]/s):n[1]||n[4]?Math.PI/2-(n[4]>0?Math.acos(-n[1]/r):-Math.acos(n[1]/r)):0,0!==o&&i.y<0&&(o*=-1),e.set(o,o),t.set(n[6],n[7])}compose2(t,e,i){return this.identity().translate(t.x,t.y).rotate(e.x).scale(i.x,i.y),this}decompose2(t,e,i){const n=this.clone();n.scale(-1,1);const s=n.elements[0],r=n.elements[1],a=n.elements[3],o=n.elements[4];let h=0,l=0,u=0;if(0!==s||0!==a){const t=Math.hypot(s,a);h=t,l=(s*o-r*a)/t;const e=Math.acos(s/t);u=a>0?-e:e}else if(0!==r||0!==o){const t=Math.hypot(r,o);h=(s*o-r*a)/t,l=t;const e=Math.acos(r/t);u=Math.PI/2+(o>0?-e:e)}else h=0,l=0,u=0;h=-h,t.x=n.elements[6],t.y=n.elements[7],e.x=e.y=u/Math.PI/180,i.x=h,i.y=l}composeSvgTransform(t=0,e=0,i,n=!1){if(!i&&!t&&!e)return this;this.identity(),Qi.identity();let s=i.split(") ").map((t=>t.trim()+")")).filter((t=>")"!==t));return s||(s=[]),(t||e)&&s.push(`translate(${t},${e})`),s.forEach((t=>{const e=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(t),i=/rotate\(\s*(-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+))?)?\s*\)/.exec(t),n=/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(t);if(e){const t=Number(e[1])||1,i=Number(e[2])||t;Qi.multiply(en.makeScale(t,i))}else if(i){const t=Bi(Number(i[1])||0);Number(i[2])||Number(i[3])?(Zi.set(Number(i[2]||"0"),Number(i[3]||"0")),Qi.multiply(tn.makeRotationByPoint(t,Zi))):Qi.multiply(tn.makeRotation(t))}else n&&Qi.multiply(Ki.makeTranslation(Number(n[1])||0,Number(n[2])||0))})),this.copy(Qi),n&&this.premultiply(en.makeScale(1,-1)),this}decomposeSvgMatrix(t,e,i){const n=Qi.copy(this).elements;Zi.set(n[0],n[1]),$i.set(n[3],n[4]);let s=Zi.length();Zi.normalize();let r=Zi.dot($i);Ji.copy(Zi).multiplyScalar(-r),$i.add(Ji);const a=$i.length()||0;$i.normalize(),Zi.x*$i.y<$i.x*Zi.y&&(Zi.x=-Zi.x,Zi.y=-Zi.y,s=-s,r=-r);const o=s?Math.atan2(Zi.y,Zi.x):Math.atan2(-Zi.x,$i.y);t.set(n[6],n[7]),e.set(o,o),i.set(s,a)}determinant(){const t=this.elements,e=t[0],i=t[3],n=t[6],s=t[1],r=t[4],a=t[7],o=t[2],h=t[5],l=t[8];return e*r*l-e*h*a-s*i*l+s*h*n+o*i*a-o*r*n}equals(t,e=0){const i=this.elements,n=t.elements;for(let t=0;t<9;t++)if(Math.abs(i[t]-n[t])>e)return!1;return!0}extractBasis2(t,e){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),this}flipY(){return this.premultiply(en.makeScale(1,-1))}flipSvgY(){return this.elements[1]*=-1,this.elements[3]*=-1,this.elements[7]*=-1,this}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}getComponents(t=[1,0,0,1,0,0]){return t[0]=this.elements[0],t[1]=this.elements[1],t[2]=this.elements[3],t[3]=this.elements[4],t[4]=this.elements[6],t[5]=this.elements[7],t}fromComponents(t){return this}getNormalMatrix(t){return this.setFromMatrix(t).invert().transpose()}getRotation(t){let e=this.elements;const i=Math.sqrt(e[0]*e[0]+e[3]*e[3]),n=Math.sqrt(e[1]*e[1]+e[4]*e[4]);let s=0;s=e[0]||e[3]?e[3]>0?-Math.acos(e[0]/i):Math.acos(e[0]/i):e[1]||e[4]?Math.PI/2-(e[4]>0?Math.acos(-e[1]/n):-Math.acos(e[1]/n)):0,this.getScale($i),0!==s&&$i.x<0&&(s*=-1),t.set(s,s)}getScale(t){let e=this.elements,i=Math.sqrt(e[0]*e[0]+e[1]*e[1]),n=Math.sqrt(e[3]*e[3]+e[4]*e[4]),s=e[0]*e[4]-e[3]*e[1];e[0]||e[1]?t.set(s/n,n):e[3]||e[4]?t.set(i,s/i):t.set(0,0)}getTransition(t){t.set(this.elements[6],this.elements[7])}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}hasChange(){for(let t=0,e=this.elements.length;t<e;t++)if(Math.abs(this.elements[t]-Xi[t])>Number.EPSILON)return!0;return!1}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*r-a*h,c=a*o-l*s,d=h*s-r*o,p=e*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=u*f,t[1]=(n*h-l*i)*f,t[2]=(a*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(n*s-a*e)*f,t[6]=d*f,t[7]=(i*o-h*e)*f,t[8]=(r*e-i*s)*f,this}lookAt(t,e,i){return this.identity().rotate(e.angle()-t.angle()+i.angle())}makeProjection(t,e,i,n,s,r){const a=s/(e-t),o=r/(i-n),h=s/2-(e+t)*a,l=r/2+(i+n)*o;return this.elements[0]=a,this.elements[3]=0,this.elements[6]=h,this.elements[1]=0,this.elements[4]=-o,this.elements[7]=l,this.elements[2]=0,this.elements[5]=0,this.elements[8]=1,this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeRotationByPoint(t,e){const i=Math.cos(t),n=Math.sin(t),s=-e.x*i+e.y*n+e.x,r=-e.x*n-e.y*i+e.y;return this.set(i,-n,s,n,i,r,0,0,1),this}makeRotationFromQuaternion(t){return this.compose(sn,t,rn)}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}multiply(t){return this.multiplyMatrices(this,t)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,s=this.elements,r=i[0],a=i[3],o=i[6],h=i[1],l=i[4],u=i[7],c=i[2],d=i[5],p=i[8],f=n[0],m=n[3],y=n[6],g=n[1],v=n[4],x=n[7],b=n[2],_=n[5],w=n[8];return s[0]=r*f+a*g+o*b,s[3]=r*m+a*v+o*_,s[6]=r*y+a*x+o*w,s[1]=h*f+l*g+u*b,s[4]=h*m+l*v+u*_,s[7]=h*y+l*x+u*w,s[2]=c*f+d*g+p*b,s[5]=c*m+d*v+p*_,s[8]=c*y+d*x+p*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}premultiply(t){return this.multiplyMatrices(t,this)}rotate(t){return this.premultiply(tn.makeRotation(-t))}scale(t,e){return this.premultiply(en.makeScale(t,e))}set(t,e,i,n,s,r,a,o,h){return this.elements[0]=t,this.elements[3]=e,this.elements[6]=i,this.elements[1]=n,this.elements[4]=s,this.elements[7]=r,this.elements[2]=a,this.elements[5]=o,this.elements[8]=h,this}setFromDomMatrix(t){return void 0!==t.m11&&void 0!==t.m21&&void 0!==t.m41&&void 0!==t.m12&&void 0!==t.m22&&void 0!==t.m42&&void 0!==t.m14&&void 0!==t.m24&&void 0!==t.m44?this.set(t.m11,t.m21,t.m41,t.m12,t.m22,t.m42,t.m14,t.m24,t.m44):void 0!==t.a&&void 0!==t.b&&void 0!==t.c&&void 0!==t.d&&void 0!==t.e&&void 0!==t.f&&this.set(t.a,t.c,t.e,t.b,t.d,t.f,0,0,1),this}setFromMatrix(t){const e=t.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this}setUvTransform(t,e,i,n,s,r,a){const o=Math.cos(s),h=Math.sin(s);return this.set(i*o,i*h,-i*(o*r+h*a)+r+t,-n*h,n*o,-n*(-h*r+o*a)+a+e,0,0,1),this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}toString(){return`[${this.elements[0]},${this.elements[1]}, ${this.elements[3]},${this.elements[4]}, ${this.elements[6]},${this.elements[7]}]`}translate(t,e){return this.premultiply(Ki.makeTranslation(t,e))}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}getTransformScaleX(){return Math.sqrt(this.elements[0]*this.elements[0]+this.elements[1]*this.elements[1])}getTransformScaleY(){return Math.sqrt(this.elements[3]*this.elements[3]+this.elements[4]*this.elements[4])}isTransformSkewed(){const t=this.elements[0]*this.elements[3]+this.elements[1]*this.elements[4];return 0!==t&&Math.abs(t/(this.getTransformScaleX()*this.getTransformScaleY()))>Number.EPSILON}isTransformFlipped(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]<0}hasMirror(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]<0}hasMirrorY(){return this.elements[0]<0&&this.elements[4]>0}hasMirrorX(){return this.elements[4]<0&&this.elements[0]>0}}const Xi=[1,0,0,0,1,0,0,0,1],Zi=new Oi,$i=new Oi,Ji=new Oi,Qi=new Gi,Ki=new Gi,tn=new Gi,en=new Gi,nn=new Gi,sn=new Oi(0,0,0),rn=new Oi(1,1,1),an=["view"],on=["viewer","mirror"];let hn=0;function ln(t,e=0,i=0,n=[]){var s,r;if(!t)return n;const a=function(t,e,i){if(!t)return i;let n=i;return"function"==typeof t.getAttribute?n=null==t?void 0:t.getAttribute(e):Object.hasOwnProperty.call(t,"attributes")&&(n=t.attributes[e]),n||i}(t,"id","");if(an.includes(t.nodeName)||"defs"===t.nodeName)return hn--,n;if(e&&hn>e)return n;let o;a&&!on.includes(a)&&(o={label:a,value:a,children:[]},n.push(o)),hn++;for(let i=0,r=null==(s=t.childNodes)?void 0:s.length;i<r;i++)ln(t.childNodes[i],e,hn,o?o.children:n);return 0===(null==(r=null==o?void 0:o.children)?void 0:r.length)&&delete o.children,hn=i,n}function un(t,e){var i;if(Array.isArray(t))for(let i=0,n=t.length||0;i<n;i++)un(t[i],e);else if(e(t),null==(i=t.children)?void 0:i.length)for(let i=0,n=t.children.length;i<n;i++)un(t.children[i],e)}function cn(t){var e,i,n;const s=[];if(!(null==(e=null==t?void 0:t.children)?void 0:e.length))return s;for(let e,r=0,a=(null==(i=null==t?void 0:t.children)?void 0:i.length)||0;r<a;r++)e=t.children[r],s.push(e),(null==(n=e.children)?void 0:n.length)&&s.push(...cn(e));return s}var dn=(t=>(t.GROS="gros",t.RM="rm",t.WS="ws",t.SU="su",t.EQ="eq",t.FN="fn",t.GL="gl",t.IP="ip",t))(dn||{});const pn="dummy";var fn=(t=>(t.BACKGROUND="background",t.BACKGROUND_LABELS="background-labels",t.ASSETS="assets",t.ANNOTATIONS="annotations",t.TEXT="text",t.ASSET_LABELS="asset-labels",t.LABELS="labels",t))(fn||{});class mn extends ji{constructor(t=void 0){super(t),d(this,"viewportElement"),d(this,"instancedMesh",!1),d(this,"dpr",1)}setRequestHeader(t){return this.requestHeader=t,this}setInstancedMesh(t=!1){return this.instancedMesh=t,this}setPixelRatio(t){return this.dpr=t,this}parse(t,e=!0){const i=this;function n(t,e,i,n,r,a,o,h){var l;if(0==e||0==i)return void t.lineTo(h.x,h.y);n=n*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const u=(o.x-h.x)/2,c=(o.y-h.y)/2,d=Math.cos(n)*u+Math.sin(n)*c,p=-Math.sin(n)*u+Math.cos(n)*c;let f=e*e,m=i*i;const y=d*d,g=p*p,v=y/f+g/m;if(v>1){const t=Math.sqrt(v);f=(e*=t)*e,m=(i*=t)*i}const x=f*g+m*y,b=(f*m-x)/x;let _=Math.sqrt(Math.max(0,b));r===a&&(_=-_);const w=_*e*p/i,S=-_*i*d/e,M=Math.cos(n)*w-Math.sin(n)*S+(o.x+h.x)/2,E=Math.sin(n)*w+Math.cos(n)*S+(o.y+h.y)/2,A=s(1,0,(d-w)/e,(p-S)/i),T=s((d-w)/e,(p-S)/i,(-d-w)/e,(-p-S)/i)%(2*Math.PI);null==(l=t.currentPath)||l.absellipse(M,E,e,i,A,A+T,0===a,n)}function s(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}function r(t,e){var i;e=Object.assign({},e);let n={};if(t.hasAttribute("class")){const e=null==(i=t.getAttribute("class"))?void 0:i.split(/\s/).filter(Boolean).map((t=>t.trim()));for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++)n=Object.assign(n,I["."+e[t]])}function s(i,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(i)&&(e[s]=r(t.getAttribute(i))),n[i]&&(e[s]=r(n[i])),t.style&&""!==t.style[i]&&(e[s]=r(t.style[i]))}t.hasAttribute("id")&&(n=Object.assign(n,I["#"+t.getAttribute("id")]));const{fontSize:r,strokeWidth:a}=e;function o(t){return Math.max(0,Math.min(1,c(t)))}function h(t){return Math.max(0,c(t,{fontSize:r}))}s("font-size","fontSize",h),s("fill","fill"),s("fill-opacity","fillOpacity",o),s("fill-rule","fillRule"),s("opacity","opacity",o),s("stroke","stroke"),s("stroke-opacity","strokeOpacity",o),s("stroke-width","strokeWidth",(function(t){return Math.max(0,c(t,{}))})),s("stroke-linejoin","strokeLineJoin"),s("stroke-linecap","strokeLineCap"),s("stroke-miterlimit","strokeMiterLimit",h),s("visibility","visibility");const l=t.getAttribute("stroke-width")||e.strokeWidth;return mi.endsWith(l,"%")&&(e.thinLine=!0),e}function a(t,e){return t-(e-t)}function o(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%(i||0))&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}const h=["mm","cm","in","pt","pc","px","em","%"],l={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1},"%":{"%":1,px:-1}};function c(t,e){let n,s="px";if("string"==typeof t||t instanceof String){t=null==t?void 0:t.trim();for(let e=0,i=h.length;e<i;e++){const i=h[e];if(t.endsWith(i)){s=i,t=t.substring(0,t.length-i.length);break}}}if("px"===s&&"px"!==i.defaultUnit)n=l.in[i.defaultUnit]/i.defaultDPI;else if("%"===s){W.getSize(vn),gn.copy(L).getScale(xn);const t=Math.abs(xn.x||1);n=vn.x/100*t}else"em"===s?n=(null==e?void 0:e.fontSize)||V:(n=l[s][i.defaultUnit],n<0&&(n=l[s].in*i.defaultDPI));return n*parseFloat(t)}function d(t){const e=t.elements;return e[0]*e[4]-e[1]*e[3]<0}function p(t){const e=t.elements,i=e[0]*e[3]+e[1]*e[4];if(0===i)return!1;const n=f(t),s=m(t);return Math.abs(i/(n*s))>Number.EPSILON}function f(t){const e=t.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function m(t){const e=t.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}function y(t){return Math.round(t*H*100)/100}function g(t){return Math.round(t*H*100)/100}function v(t){return Math.round(t*H*100)/100}function _(t){return Math.round(t*H*100)/100}function w(t,e="asset"){let i;const n="function"==typeof t.getAttribute?t.getAttribute("id"):"";if(!n&&t.parentNode)return w(t.parentNode,e);if(!n)return i;if("layer"===e)i=Q.find((t=>n===t));else{const t=null==n?void 0:n.replace(/-assets/g,"");i=J.find((e=>t===e))}return!i&&t.parentNode&&(i=w(t.parentNode,e)),i}function S(t){let e;const i="function"==typeof t.getAttribute?t.getAttribute("id"):"";return e=!i&&t.parentNode?S(t.parentNode):i,e}function M(t,e){let i;const n=S(t);return i=t.parentNode&&S(t.parentNode),i&&n!==e||(i=M(t.parentNode,e)),i||n||""}function E(t){let e;return S(t),e="function"==typeof t.getAttribute?t.getAttribute("aid"):"",!e&&t.parentNode&&(e=E(t.parentNode)),e}const A=[],T=[],I={},C=[],D=new b,N=new b,B=new b,k=new b,O=new x,P=new R,L=new b,z={},U={},F=[],W=new Ri,q=new Oi,H=1,V=16,j=(new DOMParser).parseFromString(t,"image/svg+xml");i.viewportElement=j.documentElement,function(t,e=new Ri){if(!t)return e;let i=t.split(" "),n=mi.map(i,(t=>parseFloat(t)));4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3]))}(i.viewportElement.getAttribute("viewBox")||"",W);const Y=j.getElementsByTagName("view"),G=(null==Y?void 0:Y.length)?Y[0]:null,X=(null==G?void 0:G.getAttribute("units"))||"";W.getCenter(q);const Z=ln(j.documentElement);let $=[];un(Z||[],(t=>{var e;if("assets"===t.label&&(null==(e=t.children)?void 0:e.length))for(let e,i=0,n=t.children.length;i<n;i++)e=t.children[i],e.label&&$.push(mi.head(mi.split(e.label,"-"))||"")})),$=mi.uniq(mi.compact($));const J=mi.uniq(mi.compact([...$,...Object.values(dn)])),Q=Object.values(fn);!function t(e,i,s,h=!1){var l;if(1!==e.nodeType)return;const x=function(t,e){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))||"text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))))return null;const i=function(t,e){var i;const n=new b,s=D;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){let e=c(t.getAttribute("x")),i=c(t.getAttribute("y"));n.translate(e,i)}else if("text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))){let i=0,s=0;i=t.hasAttribute("dx")?c(t.getAttribute("dx")||0,{fontSize:null==e?void 0:e.fontSize}):0,s=t.hasAttribute("dy")?c(t.getAttribute("dy")||0,{fontSize:null==e?void 0:e.fontSize}):0,n.translate(i,s)}if(t.hasAttribute("transform")){const e=null==(i=t.getAttribute("transform"))?void 0:i.split(")");for(let t=((null==e?void 0:e.length)||0)-1;t>=0;t--){const i=e[t].trim();if(""===i)continue;const r=i.indexOf("("),a=i.length;if(r>0&&r<a){const t=i.slice(0,r),e=o(i.slice(r+1));switch(s.identity(),t){case"translate":if(e.length>=1){const t=e[0];let i=0;e.length>=2&&(i=e[1]),s.translate(t,i)}break;case"rotate":if(e.length>=1){let t=0,i=0,n=0;t=e[0]*Math.PI/180,e.length>=3&&(i=e[1],n=e[2]),N.makeTranslation(-i,-n),B.makeRotation(t),k.multiplyMatrices(B,N),N.makeTranslation(i,n),s.multiplyMatrices(N,k)}break;case"scale":if(e.length>=1){const t=e[0];let i=t;e.length>=2&&(i=e[1]),s.scale(t,i)}break;case"skewX":1===e.length&&s.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&s.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&s.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}n.premultiply(s)}}return n}(t,e);return C.length>0&&i.premultiply(C[C.length-1]),L.copy(i),C.push(i),i}(e,i);let R=!1,z=null,F=[];const W="function"==typeof e.getAttribute?e.getAttribute("id"):null;switch(e.nodeName){case"svg":case"g":i=r(e,i);break;case"style":!function(t){const e=t.textContent,i=null==e?void 0:e.replace(/\/\*[\s\S]*?\*\//g,""),n=null==i?void 0:i.replace(/([^;])}/g,"$1;}");if(!n)return;const s=[];let r="",a=0;for(const t of n)"{"===t?a++:"}"===t&&a--,r+=t,"}"===t&&0===a&&(s.push(r.trim()),r="");for(const t of s){if(!t.includes("{"))continue;const[e,i]=t.split(/\s*\{\s*/);if(!e||!i)continue;const n=e.split(",").map((t=>t.trim())).filter(Boolean),s={};i.replace(/}\s*$/,"").split(";").map((t=>t.trim())).filter(Boolean).forEach((t=>{const[e,i]=t.split(/:\s*/);if(e&&i){const t=i.replace(/\s*!important\s*$/,"").trim();s[e.trim()]=t}})),n.forEach((t=>{t&&(I[t]=u(u({},I[t]||{}),s))}))}}(e);break;case"path":i=r(e,i),e.hasAttribute("d")&&(z=function(t,e=!1){const i=new ii,s=new Oi,r=new Oi,h=new Oi;let l=!0,u=!1;const c=t.getAttribute("d");if(!c||""===c||"none"===c)return null;const d=c.match(/[a-df-z][^a-df-z]*/gi);if(!(null==d?void 0:d.length))return null;for(let t=0,c=(null==d?void 0:d.length)||0;t<c;t++){const c=d[t],p=c.charAt(0),f=c.slice(1).trim();let m;switch(!0===l&&(u=!0,l=!1),p){case"M":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x=e?m[t]:y(m[t]),s.y=e?m[t+1]:g(m[t+1]),r.x=s.x,r.y=s.y,0===t?i.moveTo(s.x,s.y):i.lineTo(s.x,s.y),0===t&&h.copy(s);break;case"H":m=o(f);for(let t=0,n=m.length;t<n;t++)s.x=e?m[t]:y(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"V":m=o(f);for(let t=0,n=m.length;t<n;t++)s.y=e?m[t]:g(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"L":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x=e?m[t]:y(m[t]),s.y=e?m[t+1]:g(m[t+1]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"C":m=o(f);for(let t,n=0,a=m.length;n<a;n+=6)t=e?[m[n],m[n+1],m[n+2],m[n+3],m[n+4],m[n+5]]:[y(m[n]),g(m[n+1]),y(m[n+2]),g(m[n+3]),y(m[n+4]),g(m[n+5])],i.bezierCurveTo(...t),r.x=t[2],r.y=t[3],s.x=t[4],s.y=t[5],0===n&&!0===u&&h.copy(s);break;case"S":m=o(f);for(let t,n=0,o=m.length;n<o;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[y(m[n]),g(m[n+1]),y(m[n+2]),g(m[n+3])],i.bezierCurveTo(a(s.x,r.x),a(s.y,r.y),t[0],t[1],t[2],t[3]),r.x=t[0],r.y=t[1],s.x=t[2],s.y=t[3],0===n&&!0===u&&h.copy(s);break;case"Q":m=o(f);for(let t,n=0,a=m.length;n<a;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[y(m[n]),g(m[n+1]),y(m[n+2]),g(m[n+3])],i.quadraticCurveTo(t[0],t[1],t[2],t[3]),r.x=t[0],r.y=t[1],s.x=t[2],s.y=t[3],0===n&&!0===u&&h.copy(s);break;case"T":m=o(f);for(let t,n=0,o=m.length;n<o;n+=2){const o=a(s.x,r.x),l=a(s.y,r.y);t=e?[m[n],m[n+1]]:[y(m[n]),g(m[n+1])],i.quadraticCurveTo(o,l,t[0],t[1]),r.x=o,r.y=l,s.x=t[0],s.y=t[1],0===n&&!0===u&&h.copy(s)}break;case"A":m=o(f,[3,4],7);for(let t,a=0,o=m.length;a<o;a+=7){if(t=e?[m[a],m[a+1],m[a+2],m[a+3],m[a+4],m[a+5],m[a+6]]:[y(m[a]),g(m[a+1]),m[a+2],m[a+3],m[a+4],v(m[a+5]),_(m[a+6])],t[5]==s.x&&t[6]==s.y)continue;const o=s.clone();s.x=t[5],s.y=t[6],r.x=s.x,r.y=s.y,n(i,t[a],t[1],t[2],t[3],t[4],o,s),0===a&&!0===u&&h.copy(s)}break;case"m":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x+=e?m[t]:v(m[t]),s.y+=e?m[t+1]:_(m[t+1]),r.x=s.x,r.y=s.y,0===t?i.moveTo(s.x,s.y):i.lineTo(s.x,s.y),0===t&&h.copy(s);break;case"h":m=o(f);for(let t=0,n=m.length;t<n;t++)s.x+=e?m[t]:v(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"v":m=o(f);for(let t=0,n=m.length;t<n;t++)s.y+=e?m[t]:_(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"l":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x+=e?m[t]:v(m[t]),s.y+=e?m[t+1]:_(m[t+1]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"c":m=o(f);for(let t,n=0,a=m.length;n<a;n+=6)t=e?[m[n],m[n+1],m[n+2],m[n+3],m[n+4],m[n+5]]:[v(m[n]),_(m[n+1]),v(m[n+2]),_(m[n+3]),v(m[n+4]),_(m[n+5])],i.bezierCurveTo(s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3],s.x+t[4],s.y+t[5]),r.x=s.x+t[2],r.y=s.y+t[3],s.x+=t[4],s.y+=t[5],0===n&&!0===u&&h.copy(s);break;case"s":m=o(f);for(let t,n=0,o=m.length;n<o;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[v(m[n]),_(m[n+1]),v(m[n+2]),_(m[n+3])],i.bezierCurveTo(a(s.x,r.x),a(s.y,r.y),s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3]),r.x=s.x+t[0],r.y=s.y+t[1],s.x+=t[2],s.y+=t[3],0===n&&!0===u&&h.copy(s);break;case"q":m=o(f);for(let t,n=0,a=m.length;n<a;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[v(m[n]),_(m[n+1]),v(m[n+2]),_(m[n+3])],i.quadraticCurveTo(s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3]),r.x=s.x+t[0],r.y=s.y+t[1],s.x+=t[2],s.y+=t[3],0===n&&!0===u&&h.copy(s);break;case"t":m=o(f);for(let t,n=0,o=m.length;n<o;n+=2){const o=a(s.x,r.x),l=a(s.y,r.y);t=e?[m[n],m[n+1]]:[v(m[n]),_(m[n+1])],i.quadraticCurveTo(o,l,s.x+t[0],s.y+t[1]),r.x=o,r.y=l,s.x=s.x+t[0],s.y=s.y+t[1],0===n&&!0===u&&h.copy(s)}break;case"a":m=o(f,[3,4],7);for(let t,a=0,o=m.length;a<o;a+=7){if(t=e?[m[a],m[a+1],m[a+2],m[a+3],m[a+4],m[a+5],m[a+6]]:[v(m[a]),_(m[a+1]),m[a+2],m[a+3],m[a+4],v(m[a+5]),_(m[a+6])],0==t[5]&&0==t[6])continue;const o=s.clone();s.x+=t[5],s.y+=t[6],r.x=s.x,r.y=s.y,n(i,t[0],t[1],t[2],t[3],t[4],o,s),0===a&&!0===u&&h.copy(s)}break;case"Z":case"z":i.currentPath.autoClose=!0,i.currentPath.curves.length>0&&(s.copy(h),i.currentPath.currentPoint.copy(s),l=!0)}u=!1}return i}(e,h));break;case"rect":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("x")||0),n=c(t.getAttribute("y")||0),s=c(t.getAttribute("rx")||t.getAttribute("ry")||0),r=c(t.getAttribute("ry")||t.getAttribute("rx")||0),a=c(t.getAttribute("width")),o=c(t.getAttribute("height"));e||(i=y(i),n=g(n),s=v(s),r=_(r),a=v(a),o=_(o));const h=.448084975506,l=new ii;return l.moveTo(i+s,n),l.lineTo(i+a-s,n),(0!==s||0!==r)&&l.bezierCurveTo(i+a-s*h,n,i+a,n+r*h,i+a,n+r),l.lineTo(i+a,n+o-r),(0!==s||0!==r)&&l.bezierCurveTo(i+a,n+o-r*h,i+a-s*h,n+o,i+a-s,n+o),l.lineTo(i+s,n+o),(0!==s||0!==r)&&l.bezierCurveTo(i+s*h,n+o,i,n+o-r*h,i,n+o-r),l.lineTo(i,n+r),(0!==s||0!==r)&&l.bezierCurveTo(i,n+r*h,i+s*h,n,i+s,n),l}(e,h);break;case"polygon":i=r(e,i),z=function(t,e=!1){var i;function n(t,i,n){const s=e?c(i):y(c(i)),o=e?c(n):g(c(n));return 0===a?r.moveTo(s,o):r.lineTo(s,o),a++,t}const s=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new ii;let a=0;return null==(i=t.getAttribute("points"))||i.replace(s,n),r.currentPath.autoClose=!0,r}(e,h);break;case"polyline":i=r(e,i),z=function(t,e=!1){var i;function n(t,i,n){const s=e?c(i):y(c(i)),o=e?c(n):g(c(n));return 0===a?r.moveTo(s,o):r.lineTo(s,o),a++,t}const s=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new ii;let a=0;return null==(i=t.getAttribute("points"))||i.replace(s,n),r.currentPath.autoClose=!1,r}(e,h);break;case"circle":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("cx")||0),n=c(t.getAttribute("cy")||0),s=c(t.getAttribute("r")||0);e||(i=y(i),n=g(n),s=v(s));const r=new ye;r.absarc(i,n,s,0,2*Math.PI);const a=new ii;return a.subPaths.push(r),a}(e,h);break;case"ellipse":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("cx")||0),n=c(t.getAttribute("cy")||0),s=c(t.getAttribute("rx")||0),r=c(t.getAttribute("ry")||0);e||(i=y(i),n=g(n),s=v(s),r=_(r));const a=new ye;a.absellipse(i,n,s,r,0,2*Math.PI);const o=new ii;return o.subPaths.push(a),o}(e,h);break;case"line":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("x1")||0),n=c(t.getAttribute("y1")||0),s=c(t.getAttribute("x2")||0),r=c(t.getAttribute("y2")||0);e||(i=y(i),n=g(n),s=y(s),r=g(r));const a=new ii;return a.moveTo(i,n),a.lineTo(s,r),a.currentPath.autoClose=!1,a}(e,h);break;case"defs":R=!0;break;case"use":const l=(e.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),d=U[l];d&&(i=r(e,i),void 0===(i=r(d,i)).assetType&&(i.assetType=w(e)),void 0===i.layerType&&(i.layerType=w(e,"layer")),t(d,i,W||s,h));break;case"text":i=r(e,i),z=function(t,e){parseFloat(t.getAttribute("x")||"0"),parseFloat(t.getAttribute("y")||"0");const i=t.textContent;if(!i||!e.fontSize)return;const n=Object.assign({},e);return n.fill=t.getAttribute("fill")||e.fill||"#000",n.fontSize=parseFloat(t.getAttribute("font-size")||e.fontSize||"72"),n.fontFamily=t.getAttribute("font-family")||e.fontFamily||"Arial",{type:"text",textContent:i,style:n,color:new Rt,subPaths:[],userData:{}}}(e,i)}if(z){void 0!==i.fill&&"transparent"===i.fill||void 0!==i.fill&&"none"!==i.fill&&z.color.setStyle(i.fill,yn);const t=i.assetType||w(e),n=i.layerType||w(e,"layer");if(z.userData={pid:s,id:W||s,nodeName:e.nodeName,layerType:n,assetType:t,style:i},"text"===e.nodeName){s||mi.set(z,"userData.pid",S(e)),z.userData.textContent=e.textContent,z.transform=mi.cloneDeep(L),z.userData.id=mi.get(z,"userData.pid"),mi.set(z,"userData.pid",M(e,s));const t=E(e);t?mi.set(z,"userData.aid",t):mi.set(z,"userData.aid",mi.split(null==(l=z.userData)?void 0:l.id,"-").splice(2).join("-")),A.find((t=>t.userData.id===z.userData.aid))}else!function(t,e){function i(t){P.set(t.x,t.y,1).applyMatrix3(e),t.set(P.x,P.y)}function n(t){const i=t.xRadius,n=t.yRadius,s=Math.cos(t.aRotation),r=Math.sin(t.aRotation),a=new Yi(i*s,i*r,0),o=new Yi(-n*r,n*s,0),h=a.applyMatrix3(e),l=o.applyMatrix3(e),u=D.set(h.x,l.x,0,h.y,l.y,0,0,0,1),c=N.copy(u).invert(),p=B.copy(c).transpose().multiply(c).elements,f=function(t,e,i){let n,s,r,a,o;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(n=.5*(h+u),o=1/n,s=t*o*i-e*o*e):h<0?s=.5*(h-u):(n=.5*u,s=-.5*u),r=l>0?l+u:l-u,Math.abs(r)>2*Math.abs(e)?(o=-2*e/r,a=1/Math.sqrt(1+o*o),r=o*a):0===Math.abs(e)?(r=1,a=0):(o=-.5*r/e,r=1/Math.sqrt(1+o*o),a=o*r),l>0&&(o=r,r=-a,a=o),{rt1:n,rt2:s,cs:r,sn:a}}(p[0],p[1],p[4]),m=Math.sqrt(f.rt1),y=Math.sqrt(f.rt2);if(t.xRadius=1/m,t.yRadius=1/y,t.aRotation=Math.atan2(f.sn,f.cs),!((t.aEndAngle-t.aStartAngle)%(2*Math.PI)<Number.EPSILON)){const i=N.set(m,0,0,0,y,0,0,0,1),n=B.set(f.cs,f.sn,0,-f.sn,f.cs,0,0,0,1),s=i.multiply(n).multiply(u),r=t=>{const{x:e,y:i}=new Yi(Math.cos(t),Math.sin(t),0).applyMatrix3(s);return Math.atan2(i,e)};t.aStartAngle=r(t.aStartAngle),t.aEndAngle=r(t.aEndAngle),d(e)&&(t.aClockwise=!t.aClockwise)}}function s(t){const i=f(e),n=m(e);t.xRadius*=i,t.yRadius*=n;const s=i>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);t.aRotation+=s,d(e)&&(t.aStartAngle*=-1,t.aEndAngle*=-1,t.aClockwise=!t.aClockwise)}const r=t.subPaths;for(let t=0,a=(null==r?void 0:r.length)||0;t<a;t++){const a=r[t].curves;for(let t=0;t<a.length;t++){const r=a[t];r.isLineCurve?(i(r.v1),i(r.v2)):r.isCubicBezierCurve?(i(r.v0),i(r.v1),i(r.v2),i(r.v3)):r.isQuadraticBezierCurve?(i(r.v0),i(r.v1),i(r.v2)):r.isEllipseCurve&&(O.set(r.aX,r.aY),i(O),r.aX=O.x,r.aY=O.y,p(e)?n(r):s(r))}}}(z,L);"text"!==e.nodeName?A.push(z):"text"===e.nodeName&&T.push(z)}const q=e.childNodes,H="symbol"===e.nodeName?s:W;for(let e=0,n=(null==q?void 0:q.length)||0;e<n;e++){const n=q[e];if(R){const t="function"==typeof n.getAttribute?n.getAttribute("id"):null;"symbol"===n.nodeName&&t&&(U[t]=n)}if(R&&"style"!==n.nodeName&&"defs"!==n.nodeName)continue;let s=t(n,i,H,h);s&&F.push(s)}return x&&(C.pop(),C.length>0?L.copy(C[C.length-1]):L.identity()),z||((null==F?void 0:F.length)?F:void 0)}(j.documentElement,{fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4,fontSize:V});for(let t in z)z[t].len=mi.sumBy(F,(e=>e.symbolId===t?1:0));return F.forEach((t=>{var e;return t.len=null==(e=z[t.symbolId])?void 0:e.len})),{xml:j.documentElement,viewBox:W,paths:A,labels:T,idsTree:Z,assetTypes:$,symbolsMap:z,uses:F,units:X}}}const yn=n,gn=new Gi;new b,new class extends rt{constructor(t=1,e=0,i=0,n=0,s=0,r=1,a=0,o=0,h=0,l=0,u=1,c=0,d=0,p=0,f=0,m=1){super(t,e,i,n,s,r,a,o,h,l,u,c,d,p,f,m)}setByMatrix3(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[4]=i[3],e[8]=0,e[12]=i[6],e[1]=i[1],e[5]=i[4],e[9]=0,e[13]=i[7],e[2]=0,e[6]=0,e[10]=1,e[14]=0,e[3]=0,e[7]=0,e[11]=0,e[15]=1,this}getMatrix3Array(t=[]){const e=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[4],t[4]=e[5],t[5]=0,t[6]=e[12],t[7]=e[13],t[8]=1,t}};const vn=new Oi,xn=new x;new Yi,new Yi,new Yi,new Yi;const bn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],_n=()=>{const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(bn[255&t]+bn[t>>8&255]+bn[t>>16&255]+bn[t>>24&255]+"-"+bn[255&e]+bn[e>>8&255]+"-"+bn[e>>16&15|64]+bn[e>>24&255]+"-"+bn[63&i|128]+bn[i>>8&255]+"-"+bn[i>>16&255]+bn[i>>24&255]+bn[255&n]+bn[n>>8&255]+bn[n>>16&255]+bn[n>>24&255]).toLowerCase()};class wn extends hi{constructor(t={}){super(),d(this,"isObject2",!0),d(this,"id",Sn++),d(this,"uuid",_n()),d(this,"name"),d(this,"type","Object2"),d(this,"featureKey","Object2_"+this.id),d(this,"parent"),d(this,"children",[]),d(this,"up",new Oi(0,1)),d(this,"position",new Oi),d(this,"rotation",new Oi),d(this,"scaled",new Oi(1,1)),d(this,"flipY",!1),d(this,"selectable",!1),d(this,"matrix",new Gi),d(this,"matrixWorld",new Gi),d(this,"matrixWorldInverse",new Gi),d(this,"modelViewMatrix",new Gi),d(this,"normalMatrix",new Gi),d(this,"fixed",!1),d(this,"dynamically",!1),d(this,"matrixAutoUpdate",!1),d(this,"matrixWorldNeedsUpdate",!1),d(this,"matrixWorldAutoUpdate",!1),d(this,"composeNode",!1),d(this,"isInComposeNode",!1),d(this,"alignCenter",!1),d(this,"boundingBox",new Ri),d(this,"boundingBoxWorld",new Ri),d(this,"boundingBoxNeedsUpdate",!1),d(this,"centerPoint",new Oi),d(this,"visible",!0),d(this,"castShadow",!1),d(this,"receiveShadow",!1),d(this,"renderOrder",0),d(this,"animations",[]),d(this,"finalSize"),d(this,"userData",{}),d(this,"DefaultUp",new Oi(0,1)),d(this,"_autoSort",!0),d(this,"_version",0),void 0!==t.name?this.name=t.name:this.name="Object2",void 0!==t.flipY&&(this.flipY=t.flipY),void 0!==t.selectable&&(this.selectable=t.selectable),void 0!==t.finalSize&&(this.finalSize=t.finalSize),this.setAttrs(t)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}destroy(){super.destroy(),this.clear(),this.removeFromParent(),this.dispatchEvent(kn)}setVisible(t){return this.visible=t,this}setPosition(t){return this.position.set(t.x,t.y),this}translate(t,e){this.position.x+=t,this.position.y+=e}setScale(t,e){return this.scaled.set(t,e),this}setRotationFromMatrix(t){t.decompose(In,this.rotation,Cn)}setRotation(t){return this.rotation.set(t,t),this}rotate(t){this.rotation.x+=t}scale(t,e){e?(this.scaled.x*=t,this.scaled.y*=e):this.scaled.multiplyScalar(t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(En.copy(this.matrixWorld).invert())}lookAt(t){An.copy(t),this.updateWorldMatrix(!0,!1),this.matrixWorld.getTransition(In),En.lookAt(In,An,Nn),En.getRotation(Dn),this.rotation.set(Dn.x,Dn.x),this.parent&&(this.parent.matrixWorld.getRotation(Dn),this.rotate(Dn.x))}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){Mn.copy(this.scaled),this.flipY&&(Mn.y*=-1),this.matrix.compose(this.position,this.rotation,Mn),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.matrixWorldNeedsUpdate=!1,t=!0,this.boundingBoxNeedsUpdate=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t);this.boundingBoxNeedsUpdate&&(this.updateBoundingBox(),this.boundingBoxNeedsUpdate=!1)}updateWorldMatrix(t=!1,e=!1){const i=this.parent;if(t&&i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),e){const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}updateModelViewMatrix(t){En.copy(this.matrixWorld),t&&this.fixed?this.modelViewMatrix.copy(t.projectionMatrix):t?this.modelViewMatrix.multiplyMatrices(t.viewMatrix,En):this.modelViewMatrix.copy(En);for(let e=0,i=this.children.length;e<i;e++)this.children[e].updateModelViewMatrix(t)}computeBoundingBox(){this.boundingBox.makeEmpty(),this.centerPoint.set(0,0);for(let t=0,e=this.children.length;t<e;t++)this.children[t].updateMatrixWorld(),Tn.copy(this.children[t].computeBoundingBox()),Tn.applyMatrix3(En.copy(this.children[t].matrixWorld)),this.boundingBox.union(Tn);return this.boundingBox.applyMatrix3(this.matrixWorldInverse),this.boundingBox}updateBoundingBox(){this.boundingBox.isEmpty()||this.boundingBoxWorld.copy(this.boundingBox).applyMatrix3(this.matrixWorld)}setAttrs(t){if(!t)return this;for(const e in t)"children"!==e&&void 0!==t[e]&&("userData"===e&&t[e]?Object.keys(t[e]).forEach((i=>this.userData[i]=t[e][i])):this.userData[e]=t[e]);return this}add(t){return t&&t.isObject2&&t!==this?(t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.isInComposeNode=this.composeNode||this.isInComposeNode,t.selectable&&t.parent.setSelectable(t.selectable),this._autoSort&&this.children.sort(((t,e)=>t.renderOrder-e.renderOrder)),t.dispatchEvent(Bn),this.matrixAutoUpdate||(this.matrixWorldNeedsUpdate=!0),this.visible&&(this.needsUpdate=!0),this):this}adds(t){if(!t||!t.length)return this;this._autoSort=!1;for(let e=0,i=t.length;e<i;e++)e===t.length-1&&(this._autoSort=!0),this.add(t[e]);return this}remove(t){const e=this.children.indexOf(t);return-1!==e&&(t.parent=void 0,this.children.splice(e,1),t.dispatchEvent(kn)),this}removes(t){for(let e=0,i=t.length;e<i;e++)this.remove(t[e]);return this}removeFromParent(){const t=this.parent;return t&&t.remove(this),this.parent=void 0,this}moveToLast(){const t=this.parent;t&&(this.removeFromParent(),t.add(this))}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=void 0,e.destroy(),e.dispatchEvent(kn)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),En.copy(this.matrixWorld).invert(),t.parent&&(t.parent.updateWorldMatrix(!0,!1),En.multiply(t.parent.matrixWorld)),t.applyMatrix3(En),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(t,Dn,Cn),t}getWorldRotation(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(In,t,Cn),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(In,Dn,t),t}getWorldDirection(t){return this.updateWorldMatrix(!0,!1),t.set(this.matrixWorld.elements[6],this.matrixWorld.elements[7]).normalize()}traverse(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e&&(t(e),e.traverseAncestors(t))}traverseSome(t){if(t(this))return!0;const e=this.children;for(let i=0,n=e.length;i<n;i++)if(e[i].traverseSome(t))return!0;return!1}onBeforeRender(t,e,i,n){}render(t){}onAfterRender(t,e,i){}setSelectable(t){this.selectable=t,this.parent&&this.parent.setSelectable(t)}raycast(t,e=[]){}getByRange(t,e=!1,i=[]){if(Tn.copy(t),Tn.containsBox(this.boundingBoxWorld)&&i.push(this),!e||this.composeNode)return i;for(let n=0,s=this.children.length;n<s;n++)this.children[n].getByRange(t,e,i);return i}clone(t=!0,e=!1){return new(0,this.constructor)(this.userData).copy(this,t,e)}copy(t,e=!0,i=!1){if(this.name=t.name,this.type=t.type,this.featureKey=t.featureKey,this._version=0,this.parent=t.parent,this.up.copy(t.up),this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.selectable=t.selectable,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.modelViewMatrix.copy(t.modelViewMatrix),this.normalMatrix.copy(t.normalMatrix),this.fixed=t.fixed,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.composeNode=t.composeNode,this.alignCenter=t.alignCenter,this.boundingBox.copy(t.boundingBox),this.boundingBoxWorld.copy(t.boundingBoxWorld),this.boundingBoxNeedsUpdate=t.boundingBoxNeedsUpdate,this.centerPoint.copy(t.centerPoint),this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e)for(let n=0;n<t.children.length;n++){const s=t.children[n];this.add(s.clone(e,i))}return this}}let Sn=0;const Mn=new Oi,En=new Gi,An=new Oi,Tn=new Ri,In=new Oi,Cn=new Oi,Dn=new Oi,Nn=new Oi(0,1),Bn={type:"added"},kn={type:"removed"};class On extends wn{constructor(t={}){super(t),d(this,"type","Group2"),d(this,"isGroup",!0),d(this,"versions",[]),d(this,"params"),d(this,"alignCenter",!1),d(this,"dynamically",!1),d(this,"usedCache",!1),d(this,"wireframe",!1),d(this,"showPoints",!1),this.params=t,void 0!==t.usedCache&&(this.usedCache=t.usedCache),void 0!==t.wireframe&&(this.wireframe=t.wireframe),void 0!==t.showPoints&&(this.showPoints=t.showPoints),void 0!==t.alignCenter&&(this.alignCenter=t.alignCenter),void 0!==t.dynamically&&(this.dynamically=t.dynamically)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}clone(t=!0,e=!1){return new(0,this.constructor)(this.params).copy(this,t,e)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.params=t.params,this.alignCenter=t.alignCenter,this.dynamically=t.dynamically,this.usedCache=t.usedCache,this.wireframe=t.wireframe,this.showPoints=t.showPoints,this}composeWireframeGeometryPath(t){return this.traverse((e=>{e.isShape&&e.geometry&&e.geometry.path&&t.addPath(e.geometry.path)})),t}raycast(t,e=[]){var i;if(!this.boundingBox||this.boundingBox.isEmpty())return e;if(!this.boundingBoxWorld.containsPoint(t.worldCoords))return e;let n=[];for(let e=0,s=null==(i=this.children)?void 0:i.length;e<s;e++)this.children[e].raycast(t,n);return n.length&&e.push(this),e}}const Pn=1,Ln=2,Rn=3,zn=4,Un=5,Fn=-1,Wn=51,qn=52;function Hn(t,e){const i=t.x*Math.cos(e)-t.y*Math.sin(e),n=t.y*Math.cos(e)+t.x*Math.sin(e);t.x=i,t.y=n}function Vn(t,e){t.x*=e,t.y*=e}let jn=class t{constructor(e){d(this,"commands"),this.commands=[],e&&e instanceof t?this.commands.push(...e.commands):e&&(this.commands=function(t){const e=[],i=String(t).trim();return"M"!==i[0]&&"m"!==i[0]||i.replace(Xn,((t,i,n)=>{const s=function(t){const e=t.match(Zn);return e?e.map(Number):[]}(n);let r=i.toLowerCase(),a=i;if("m"===r&&s.length>2&&(e.push([a,...s.splice(0,2)]),r="l",a="m"===a?"l":"L"),s.length<Gn[r])return"";for(e.push([a,...s.splice(0,Gn[r])]);s.length>=Gn[r]&&s.length&&Gn[r];)e.push([a,...s.splice(0,Gn[r])]);return""})),e}(e))}addPath(e){e&&e instanceof t&&this.commands.push(...e.commands)}moveTo(t,e){this.commands.push(["M",t,e])}lineTo(t,e){this.commands.push(["L",t,e])}arc(t,e,i,n,s,r){this.commands.push(["AC",t,e,i,n,s,!!r])}arcTo(t,e,i,n,s){this.commands.push(["AT",t,e,i,n,s])}ellipse(t,e,i,n,s,r,a,o){this.commands.push(["E",t,e,i,n,s,r,a,!!o])}closePath(){this.commands.push(["Z"])}bezierCurveTo(t,e,i,n,s,r){this.commands.push(["C",t,e,i,n,s,r])}quadraticCurveTo(t,e,i,n){this.commands.push(["Q",t,e,i,n])}rect(t,e,i,n){this.commands.push(["R",t,e,i,n])}roundRect(t,e,i,n,s){void 0===s?this.commands.push(["RR",t,e,i,n,0]):this.commands.push(["RR",t,e,i,n,s])}};function Yn(t,e){let i,n,s,r,a,o,h,l,u,c,d,p,f,m,y,g,v,x,b,_,w,S=0,M=0,E=null,A=null,T=null,I=null,C=null,D=null;t.beginPath();for(let O=0;O<e.length;++O){let P;switch(x=e[O][0],"S"!==x&&"s"!==x&&"C"!==x&&"c"!==x&&(E=null,A=null),"T"!==x&&"t"!==x&&"Q"!==x&&"q"!==x&&(T=null,I=null),x){case"m":case"M":P=e[O],"m"===x?(S+=P[1],M+=P[2]):(S=P[1],M=P[2]),"M"!==x&&C||(C={x:S,y:M}),t.moveTo(S,M);break;case"l":P=e[O],S+=P[1],M+=P[2],t.lineTo(S,M);break;case"L":P=e[O],S=P[1],M=P[2],t.lineTo(S,M);break;case"H":P=e[O],S=P[1],t.lineTo(S,M);break;case"h":P=e[O],S+=P[1],t.lineTo(S,M);break;case"V":P=e[O],M=P[1],t.lineTo(S,M);break;case"v":P=e[O],M+=P[1],t.lineTo(S,M);break;case"a":case"A":if(P=e[O],null===D)throw new Error("This should never happen");"a"===x?(S+=P[6],M+=P[7]):(S=P[6],M=P[7]),m=P[1],y=P[2],h=P[3]*Math.PI/180,s=!!P[4],r=!!P[5],a={x:S,y:M},o={x:(D.x-a.x)/2,y:(D.y-a.y)/2},Hn(o,-h),l=o.x*o.x/(m*m)+o.y*o.y/(y*y),l>1&&(l=Math.sqrt(l),m*=l,y*=l),b={x:m*o.y/y,y:-y*o.x/m},u=m*m*y*y,c=m*m*o.y*o.y+y*y*o.x*o.x,Vn(b,r!==s?Math.sqrt((u-c)/c)||0:-Math.sqrt((u-c)/c)||0),n=Math.atan2((o.y-b.y)/y,(o.x-b.x)/m),i=Math.atan2(-(o.y+b.y)/y,-(o.x+b.x)/m),Hn(b,h),N=b,B=(a.x+D.x)/2,k=(a.y+D.y)/2,N.x+=B,N.y+=k,t.save(),t.translate(b.x,b.y),t.rotate(h),t.scale(m,y),t.arc(0,0,1,n,i,!r),t.restore();break;case"C":P=e[O],E=P[3],A=P[4],S=P[5],M=P[6],t.bezierCurveTo(P[1],P[2],E,A,S,M);break;case"c":P=e[O],t.bezierCurveTo(P[1]+S,P[2]+M,P[3]+S,P[4]+M,P[5]+S,P[6]+M),E=P[3]+S,A=P[4]+M,S+=P[5],M+=P[6];break;case"S":P=e[O],null!==E&&null!==A||(E=S,A=M),t.bezierCurveTo(2*S-E,2*M-A,P[1],P[2],P[3],P[4]),E=P[1],A=P[2],S=P[3],M=P[4];break;case"s":P=e[O],null!==E&&null!==A||(E=S,A=M),t.bezierCurveTo(2*S-E,2*M-A,P[1]+S,P[2]+M,P[3]+S,P[4]+M),E=P[1]+S,A=P[2]+M,S+=P[3],M+=P[4];break;case"Q":P=e[O],T=P[1],I=P[2],S=P[3],M=P[4],t.quadraticCurveTo(T,I,S,M);break;case"q":P=e[O],T=P[1]+S,I=P[2]+M,S+=P[3],M+=P[4],t.quadraticCurveTo(T,I,S,M);break;case"T":P=e[O],null!==T&&null!==I||(T=S,I=M),T=2*S-T,I=2*M-I,S=P[1],M=P[2],t.quadraticCurveTo(T,I,S,M);break;case"t":P=e[O],null!==T&&null!==I||(T=S,I=M),T=2*S-T,I=2*M-I,S+=P[1],M+=P[2],t.quadraticCurveTo(T,I,S,M);break;case"z":case"Z":C&&(S=C.x,M=C.y),C=null,t.closePath();break;case"AC":P=e[O],S=P[1],M=P[2],f=P[3],n=P[4],i=P[5],_=P[6],t.arc(S,M,f,n,i,_);break;case"AT":P=e[O],d=P[1],p=P[2],S=P[3],M=P[4],f=P[5],t.arcTo(d,p,S,M,f);break;case"E":P=e[O],S=P[1],M=P[2],m=P[3],y=P[4],h=P[5],n=P[6],i=P[7],_=P[8],t.save(),t.translate(S,M),t.rotate(h),t.scale(m,y),t.arc(0,0,1,n,i,_),t.restore();break;case"R":P=e[O],S=P[1],M=P[2],g=P[3],v=P[4],C={x:S,y:M},t.rect(S,M,g,v);break;case"RR":P=e[O],S=P[1],M=P[2],g=P[3],v=P[4],w=P[5],C={x:S,y:M},t.roundRect(S,M,g,v,w)}D?(D.x=S,D.y=M):D={x:S,y:M}}var N,B,k}const Gn={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Xn=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Zn=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var $n={},Jn={};function Qn(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}var Kn=Qn({HTML:"text/html",isHTML:function(t){return t===Kn.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),ts=Qn({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===ts.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Jn.assign=function(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Jn.find=function(t,e,i){if(void 0===i&&(i=Array.prototype),t&&"function"==typeof i.find)return i.find.call(t,e);for(var n=0;n<t.length;n++)if(Object.prototype.hasOwnProperty.call(t,n)){var s=t[n];if(e.call(void 0,s,n,t))return s}},Jn.freeze=Qn,Jn.MIME_TYPE=Kn,Jn.NAMESPACE=ts;var es=Jn,is=es.find,ns=es.NAMESPACE;function ss(t){return""!==t}function rs(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function as(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(ss):[]}(t);return Object.keys(e.reduce(rs,{}))}function os(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function hs(t,e){var i=t.prototype;if(!(i instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,os(i,n),t.prototype=i=n}i.constructor!=t&&(i.constructor=t)}var ls={},us=ls.ELEMENT_NODE=1,cs=ls.ATTRIBUTE_NODE=2,ds=ls.TEXT_NODE=3,ps=ls.CDATA_SECTION_NODE=4,fs=ls.ENTITY_REFERENCE_NODE=5,ms=ls.ENTITY_NODE=6,ys=ls.PROCESSING_INSTRUCTION_NODE=7,gs=ls.COMMENT_NODE=8,vs=ls.DOCUMENT_NODE=9,xs=ls.DOCUMENT_TYPE_NODE=10,bs=ls.DOCUMENT_FRAGMENT_NODE=11,_s=ls.NOTATION_NODE=12,ws={},Ss={};ws.INDEX_SIZE_ERR=(Ss[1]="Index size error",1),ws.DOMSTRING_SIZE_ERR=(Ss[2]="DOMString size error",2);var Ms=ws.HIERARCHY_REQUEST_ERR=(Ss[3]="Hierarchy request error",3);ws.WRONG_DOCUMENT_ERR=(Ss[4]="Wrong document",4),ws.INVALID_CHARACTER_ERR=(Ss[5]="Invalid character",5),ws.NO_DATA_ALLOWED_ERR=(Ss[6]="No data allowed",6),ws.NO_MODIFICATION_ALLOWED_ERR=(Ss[7]="No modification allowed",7);var Es=ws.NOT_FOUND_ERR=(Ss[8]="Not found",8);ws.NOT_SUPPORTED_ERR=(Ss[9]="Not supported",9);var As=ws.INUSE_ATTRIBUTE_ERR=(Ss[10]="Attribute in use",10);function Ts(t,e){if(e instanceof Error)var i=e;else i=this,Error.call(this,Ss[t]),this.message=Ss[t],Error.captureStackTrace&&Error.captureStackTrace(this,Ts);return i.code=t,e&&(this.message=this.message+": "+e),i}function Is(){}function Cs(t,e){this._node=t,this._refresh=e,Ds(this)}function Ds(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var i=t._refresh(t._node);if(gr(t,"length",i.length),!t.$$length||i.length<t.$$length)for(var n=i.length;n in t;n++)Object.prototype.hasOwnProperty.call(t,n)&&delete t[n];os(i,t),t._inc=e}}function Ns(){}function Bs(t,e){for(var i=t.length;i--;)if(t[i]===e)return i}function ks(t,e,i,n){if(n?e[Bs(e,n)]=i:e[e.length++]=i,t){i.ownerElement=t;var s=t.ownerDocument;s&&(n&&Fs(s,t,n),function(t,e,i){t&&t._inc++;var n=i.namespaceURI;n===ns.XMLNS&&(e._nsMap[i.prefix?i.localName:""]=i.value)}(s,t,i))}}function Os(t,e,i){var n=Bs(e,i);if(!(n>=0))throw new Ts(Es,new Error(t.tagName+"@"+i));for(var s=e.length-1;n<s;)e[n]=e[++n];if(e.length=s,t){var r=t.ownerDocument;r&&(Fs(r,t,i),i.ownerElement=null)}}function Ps(){}function Ls(){}function Rs(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function zs(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(zs(t,e))return!0}while(t=t.nextSibling)}function Us(){this.ownerDocument=this}function Fs(t,e,i,n){t&&t._inc++,i.namespaceURI===ns.XMLNS&&delete e._nsMap[i.prefix?i.localName:""]}function Ws(t,e,i){if(t&&t._inc){t._inc++;var n=e.childNodes;if(i)n[n.length++]=i;else{for(var s=e.firstChild,r=0;s;)n[r++]=s,s=s.nextSibling;n.length=r,delete n[n.length]}}}function qs(t,e){var i=e.previousSibling,n=e.nextSibling;return i?i.nextSibling=n:t.firstChild=n,n?n.previousSibling=i:t.lastChild=i,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Ws(t.ownerDocument,t),e}function Hs(t){return t&&t.nodeType===Ls.DOCUMENT_TYPE_NODE}function Vs(t){return t&&t.nodeType===Ls.ELEMENT_NODE}function js(t){return t&&t.nodeType===Ls.TEXT_NODE}function Ys(t,e){var i=t.childNodes||[];if(is(i,Vs)||Hs(e))return!1;var n=is(i,Hs);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function Gs(t,e){var i=t.childNodes||[];if(is(i,(function(t){return Vs(t)&&t!==e})))return!1;var n=is(i,Hs);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function Xs(t,e,i){if(!function(t){return t&&(t.nodeType===Ls.DOCUMENT_NODE||t.nodeType===Ls.DOCUMENT_FRAGMENT_NODE||t.nodeType===Ls.ELEMENT_NODE)}(t))throw new Ts(Ms,"Unexpected parent node type "+t.nodeType);if(i&&i.parentNode!==t)throw new Ts(Es,"child not in parent");if(!function(t){return t&&(Vs(t)||js(t)||Hs(t)||t.nodeType===Ls.DOCUMENT_FRAGMENT_NODE||t.nodeType===Ls.COMMENT_NODE||t.nodeType===Ls.PROCESSING_INSTRUCTION_NODE)}(e)||Hs(e)&&t.nodeType!==Ls.DOCUMENT_NODE)throw new Ts(Ms,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function Zs(t,e,i){var n=t.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ls.DOCUMENT_FRAGMENT_NODE){var r=s.filter(Vs);if(r.length>1||is(s,js))throw new Ts(Ms,"More than one element or text in fragment");if(1===r.length&&!Ys(t,i))throw new Ts(Ms,"Element in fragment can not be inserted before doctype")}if(Vs(e)&&!Ys(t,i))throw new Ts(Ms,"Only one element can be added and only after doctype");if(Hs(e)){if(is(n,Hs))throw new Ts(Ms,"Only one doctype is allowed");var a=is(n,Vs);if(i&&n.indexOf(a)<n.indexOf(i))throw new Ts(Ms,"Doctype can only be inserted before an element");if(!i&&a)throw new Ts(Ms,"Doctype can not be appended since element is present")}}function $s(t,e,i){var n=t.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ls.DOCUMENT_FRAGMENT_NODE){var r=s.filter(Vs);if(r.length>1||is(s,js))throw new Ts(Ms,"More than one element or text in fragment");if(1===r.length&&!Gs(t,i))throw new Ts(Ms,"Element in fragment can not be inserted before doctype")}if(Vs(e)&&!Gs(t,i))throw new Ts(Ms,"Only one element can be added and only after doctype");if(Hs(e)){let t=function(t){return Hs(t)&&t!==i};if(is(n,t))throw new Ts(Ms,"Only one doctype is allowed");var a=is(n,Vs);if(i&&n.indexOf(a)<n.indexOf(i))throw new Ts(Ms,"Doctype can only be inserted before an element")}}function Js(t,e,i,n){Xs(t,e,i),t.nodeType===Ls.DOCUMENT_NODE&&(n||Zs)(t,e,i);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===bs){var r=e.firstChild;if(null==r)return e;var a=e.lastChild}else r=a=e;var o=i?i.previousSibling:t.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:t.firstChild=r,null==i?t.lastChild=a:i.previousSibling=a;do{r.parentNode=t}while(r!==a&&(r=r.nextSibling));return Ws(t.ownerDocument||t,t),e.nodeType==bs&&(e.firstChild=e.lastChild=null),e}function Qs(){this._nsMap={}}function Ks(){}function tr(){}function er(){}function ir(){}function nr(){}function sr(){}function rr(){}function ar(){}function or(){}function hr(){}function lr(){}function ur(){}function cr(t,e){var i=[],n=9==this.nodeType&&this.documentElement||this,s=n.prefix,r=n.namespaceURI;if(r&&null==s&&null==(s=n.lookupPrefix(r)))var a=[{namespace:r,prefix:null}];return fr(this,i,t,e,a),i.join("")}function dr(t,e,i){var n=t.prefix||"",s=t.namespaceURI;if(!s)return!1;if("xml"===n&&s===ns.XML||s===ns.XMLNS)return!1;for(var r=i.length;r--;){var a=i[r];if(a.prefix===n)return a.namespace!==s}return!0}function pr(t,e,i){t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,Rs),'"')}function fr(t,e,i,n,s){if(s||(s=[]),n){if(!(t=n(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case us:var r=t.attributes,a=r.length,o=t.firstChild,h=t.tagName,l=h;if(!(i=ns.isHTML(t.namespaceURI)||i)&&!t.prefix&&t.namespaceURI){for(var u,c=0;c<r.length;c++)if("xmlns"===r.item(c).name){u=r.item(c).value;break}if(!u)for(var d=s.length-1;d>=0;d--)if(""===(p=s[d]).prefix&&p.namespace===t.namespaceURI){u=p.namespace;break}if(u!==t.namespaceURI)for(d=s.length-1;d>=0;d--){var p;if((p=s[d]).namespace===t.namespaceURI){p.prefix&&(l=p.prefix+":"+h);break}}}e.push("<",l);for(var f=0;f<a;f++)"xmlns"==(m=r.item(f)).prefix?s.push({prefix:m.localName,namespace:m.value}):"xmlns"==m.nodeName&&s.push({prefix:"",namespace:m.value});for(f=0;f<a;f++){var m,y,g;dr(m=r.item(f),0,s)&&(pr(e,(y=m.prefix||"")?"xmlns:"+y:"xmlns",g=m.namespaceURI),s.push({prefix:y,namespace:g})),fr(m,e,i,n,s)}if(h===l&&dr(t,0,s)&&(pr(e,(y=t.prefix||"")?"xmlns:"+y:"xmlns",g=t.namespaceURI),s.push({prefix:y,namespace:g})),o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(h)){if(e.push(">"),i&&/^script$/i.test(h))for(;o;)o.data?e.push(o.data):fr(o,e,i,n,s.slice()),o=o.nextSibling;else for(;o;)fr(o,e,i,n,s.slice()),o=o.nextSibling;e.push("</",l,">")}else e.push("/>");return;case vs:case bs:for(o=t.firstChild;o;)fr(o,e,i,n,s.slice()),o=o.nextSibling;return;case cs:return pr(e,t.name,t.value);case ds:return e.push(t.data.replace(/[<&>]/g,Rs));case ps:return e.push("<![CDATA[",t.data,"]]>");case gs:return e.push("\x3c!--",t.data,"--\x3e");case xs:var v=t.publicId,x=t.systemId;if(e.push("<!DOCTYPE ",t.name),v)e.push(" PUBLIC ",v),x&&"."!=x&&e.push(" ",x),e.push(">");else if(x&&"."!=x)e.push(" SYSTEM ",x,">");else{var b=t.internalSubset;b&&e.push(" [",b,"]"),e.push(">")}return;case ys:return e.push("<?",t.target," ",t.data,"?>");case fs:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function mr(t,e,i){var n;switch(e.nodeType){case us:(n=e.cloneNode(!1)).ownerDocument=t;case bs:break;case cs:i=!0}if(n||(n=e.cloneNode(!1)),n.ownerDocument=t,n.parentNode=null,i)for(var s=e.firstChild;s;)n.appendChild(mr(t,s,i)),s=s.nextSibling;return n}function yr(t,e,i){var n=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var r=e[s];"object"!=typeof r&&r!=n[s]&&(n[s]=r)}switch(e.childNodes&&(n.childNodes=new Is),n.ownerDocument=t,n.nodeType){case us:var a=e.attributes,o=n.attributes=new Ns,h=a.length;o._ownerElement=n;for(var l=0;l<h;l++)n.setAttributeNode(yr(t,a.item(l),!0));break;case cs:i=!0}if(i)for(var u=e.firstChild;u;)n.appendChild(yr(t,u,i)),u=u.nextSibling;return n}function gr(t,e,i){t[e]=i}ws.INVALID_STATE_ERR=(Ss[11]="Invalid state",11),ws.SYNTAX_ERR=(Ss[12]="Syntax error",12),ws.INVALID_MODIFICATION_ERR=(Ss[13]="Invalid modification",13),ws.NAMESPACE_ERR=(Ss[14]="Invalid namespace",14),ws.INVALID_ACCESS_ERR=(Ss[15]="Invalid access",15),Ts.prototype=Error.prototype,os(ws,Ts),Is.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t,e){for(var i=[],n=0;n<this.length;n++)fr(this[n],i,t,e);return i.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},Cs.prototype.item=function(t){return Ds(this),this[t]||null},hs(Cs,Is),Ns.prototype={length:0,item:Is.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var i=this[e];if(i.nodeName==t)return i}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new Ts(As);var i=this.getNamedItem(t.nodeName);return ks(this._ownerElement,this,t,i),i},setNamedItemNS:function(t){var e,i=t.ownerElement;if(i&&i!=this._ownerElement)throw new Ts(As);return e=this.getNamedItemNS(t.namespaceURI,t.localName),ks(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return Os(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);return Os(this._ownerElement,this,i),i},getNamedItemNS:function(t,e){for(var i=this.length;i--;){var n=this[i];if(n.localName==e&&n.namespaceURI==t)return n}return null}},Ps.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,i){var n=new Us;if(n.implementation=this,n.childNodes=new Is,n.doctype=i||null,i&&n.appendChild(i),e){var s=n.createElementNS(t,e);n.appendChild(s)}return n},createDocumentType:function(t,e,i){var n=new sr;return n.name=t,n.nodeName=t,n.publicId=e||"",n.systemId=i||"",n}},Ls.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return Js(this,t,e)},replaceChild:function(t,e){Js(this,t,e,$s),e&&this.removeChild(e)},removeChild:function(t){return qs(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return yr(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==ds&&t.nodeType==ds?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var i=e._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===t)return n;e=e.nodeType==cs?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var i=e._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,t))return i[t];e=e.nodeType==cs?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},os(ls,Ls),os(ls,Ls.prototype),Us.prototype={nodeName:"#document",nodeType:vs,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==bs){for(var i=t.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,e),i=n}return t}return Js(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===us&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),qs(this,t)},replaceChild:function(t,e){Js(this,t,e,$s),t.ownerDocument=this,e&&this.removeChild(e),Vs(t)&&(this.documentElement=t)},importNode:function(t,e){return mr(this,t,e)},getElementById:function(t){var e=null;return zs(this.documentElement,(function(i){if(i.nodeType==us&&i.getAttribute("id")==t)return e=i,!0})),e},getElementsByClassName:function(t){var e=as(t);return new Cs(this,(function(i){var n=[];return e.length>0&&zs(i.documentElement,(function(s){if(s!==i&&s.nodeType===us){var r=s.getAttribute("class");if(r){var a=t===r;if(!a){var o=as(r);a=e.every((h=o,function(t){return h&&-1!==h.indexOf(t)}))}a&&n.push(s)}}var h})),n}))},createElement:function(t){var e=new Qs;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new Is,(e.attributes=new Ns)._ownerElement=e,e},createDocumentFragment:function(){var t=new hr;return t.ownerDocument=this,t.childNodes=new Is,t},createTextNode:function(t){var e=new er;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new ir;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new nr;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var i=new lr;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=t,i.nodeValue=i.data=e,i},createAttribute:function(t){var e=new Ks;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new or;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var i=new Qs,n=e.split(":"),s=i.attributes=new Ns;return i.childNodes=new Is,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=t,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,s._ownerElement=i,i},createAttributeNS:function(t,e){var i=new Ks,n=e.split(":");return i.ownerDocument=this,i.nodeName=e,i.name=e,i.namespaceURI=t,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,i}},hs(Us,Ls),Qs.prototype={nodeType:us,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var i=this.ownerDocument.createAttribute(t);i.value=i.nodeValue=""+e,this.setAttributeNode(i)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===bs?this.insertBefore(t,null):function(t,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.lastChild=e,Ws(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i&&i.value||""},setAttributeNS:function(t,e,i){var n=this.ownerDocument.createAttributeNS(t,e);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new Cs(this,(function(e){var i=[];return zs(e,(function(n){n===e||n.nodeType!=us||"*"!==t&&n.tagName!=t||i.push(n)})),i}))},getElementsByTagNameNS:function(t,e){return new Cs(this,(function(i){var n=[];return zs(i,(function(s){s===i||s.nodeType!==us||"*"!==t&&s.namespaceURI!==t||"*"!==e&&s.localName!=e||n.push(s)})),n}))}},Us.prototype.getElementsByTagName=Qs.prototype.getElementsByTagName,Us.prototype.getElementsByTagNameNS=Qs.prototype.getElementsByTagNameNS,hs(Qs,Ls),Ks.prototype.nodeType=cs,hs(Ks,Ls),tr.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(Ss[Ms])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){i=this.data.substring(0,t)+i+this.data.substring(t+e),this.nodeValue=this.data=i,this.length=i.length}},hs(tr,Ls),er.prototype={nodeName:"#text",nodeType:ds,splitText:function(t){var e=this.data,i=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},hs(er,tr),ir.prototype={nodeName:"#comment",nodeType:gs},hs(ir,tr),nr.prototype={nodeName:"#cdata-section",nodeType:ps},hs(nr,tr),sr.prototype.nodeType=xs,hs(sr,Ls),rr.prototype.nodeType=_s,hs(rr,Ls),ar.prototype.nodeType=ms,hs(ar,Ls),or.prototype.nodeType=fs,hs(or,Ls),hr.prototype.nodeName="#document-fragment",hr.prototype.nodeType=bs,hs(hr,Ls),lr.prototype.nodeType=ys,hs(lr,Ls),ur.prototype.serializeToString=function(t,e,i){return cr.call(t,e,i)},Ls.prototype.toString=cr;try{if(Object.defineProperty){let t=function(e){switch(e.nodeType){case us:case bs:var i=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&i.push(t(e)),e=e.nextSibling;return i.join("");default:return e.nodeValue}};Object.defineProperty(Cs.prototype,"length",{get:function(){return Ds(this),this.$$length}}),Object.defineProperty(Ls.prototype,"textContent",{get:function(){return t(this)},set:function(t){switch(this.nodeType){case us:case bs:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),gr=function(t,e,i){t["$$"+e]=i}}}catch(t){}$n.DocumentType=sr,$n.DOMException=Ts,$n.DOMImplementation=Ps,$n.Element=Qs,$n.Node=Ls,$n.NodeList=Is,$n.XMLSerializer=ur;var vr={},xr={};!function(t){var e=Jn.freeze;t.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES}(xr);var br={},_r=Jn.NAMESPACE,wr=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Sr=new RegExp("[\\-\\.0-9"+wr.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Mr=new RegExp("^"+wr.source+Sr.source+"*(?::"+wr.source+Sr.source+"*)?$");function Er(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Er)}function Ar(){}function Tr(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function Ir(t,e,i,n,s,r){function a(t,e,n){i.attributeNames.hasOwnProperty(t)&&r.fatalError("Attribute "+t+" redefined"),i.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),n)}for(var o,h=++e,l=0;;){var u=t.charAt(h);switch(u){case"=":if(1===l)o=t.slice(e,h),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(r.warning('attribute value must after "="'),o=t.slice(e,h)),e=h+1,!((h=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");a(o,c=t.slice(e,h),e-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');a(o,c=t.slice(e,h),e),r.warning('attribute "'+o+'" missed start quot('+u+")!!"),e=h+1,l=5}break;case"/":switch(l){case 0:i.setTagName(t.slice(e,h));case 5:case 6:case 7:l=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return r.error("unexpected end of input"),0==l&&i.setTagName(t.slice(e,h)),h;case">":switch(l){case 0:i.setTagName(t.slice(e,h));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=t.slice(e,h)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case 2:2===l&&(c=o),4==l?(r.warning('attribute "'+c+'" missed quot(")!'),a(o,c,e)):(_r.isHTML(n[""])&&c.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),a(c,c,e));break;case 3:throw new Error("attribute value missed!!")}return h;case"€":u=" ";default:if(u<=" ")switch(l){case 0:i.setTagName(t.slice(e,h)),l=6;break;case 1:o=t.slice(e,h),l=2;break;case 4:var c=t.slice(e,h);r.warning('attribute "'+c+'" missed quot(")!!'),a(o,c,e);case 5:l=6}else switch(l){case 2:i.tagName,_r.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=h,l=1;break;case 5:r.warning('attribute space is required"'+o+'"!!');case 6:l=1,e=h;break;case 3:l=4,e=h;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function Cr(t,e,i){for(var n=t.tagName,s=null,r=t.length;r--;){var a=t[r],o=a.qName,h=a.value;if((d=o.indexOf(":"))>0)var l=a.prefix=o.slice(0,d),u=o.slice(d+1),c="xmlns"===l&&u;else u=o,l=null,c="xmlns"===o&&"";a.localName=u,!1!==c&&(null==s&&(s={},Br(i,i={})),i[c]=s[c]=h,a.uri=_r.XMLNS,e.startPrefixMapping(c,h))}for(r=t.length;r--;)(l=(a=t[r]).prefix)&&("xml"===l&&(a.uri=_r.XML),"xmlns"!==l&&(a.uri=i[l||""]));var d;(d=n.indexOf(":"))>0?(l=t.prefix=n.slice(0,d),u=t.localName=n.slice(d+1)):(l=null,u=t.localName=n);var p=t.uri=i[l||""];if(e.startElement(p,u,n,t),!t.closed)return t.currentNSMap=i,t.localNSMap=s,!0;if(e.endElement(p,u,n),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}function Dr(t,e,i,n,s){if(/^(?:script|textarea)$/i.test(i)){var r=t.indexOf("</"+i+">",e),a=t.substring(e+1,r);if(/[&<]/.test(a))return/^script$/i.test(i)?(s.characters(a,0,a.length),r):(a=a.replace(/&#?\w+;/g,n),s.characters(a,0,a.length),r)}return e+1}function Nr(t,e,i,n){var s=n[i];return null==s&&((s=t.lastIndexOf("</"+i+">"))<e&&(s=t.lastIndexOf("</"+i)),n[i]=s),s<e}function Br(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function kr(t,e,i,n){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(s=t.indexOf("--\x3e",e+4))>e?(i.comment(t,e+4,s-e-4),s+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var s=t.indexOf("]]>",e+9);return i.startCDATA(),i.characters(t,e+9,s-e-9),i.endCDATA(),s+3}var r=function(t,e){var i,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(t);i=s.exec(t);)if(n.push(i),i[1])return n}(t,e),a=r.length;if(a>1&&/!doctype/i.test(r[0][0])){var o=r[1][0],h=!1,l=!1;a>3&&(/^public$/i.test(r[2][0])?(h=r[3][0],l=a>4&&r[4][0]):/^system$/i.test(r[2][0])&&(l=r[3][0]));var u=r[a-1];return i.startDTD(o,h,l),i.endDTD(),u.index+u[0].length}return-1}function Or(t,e,i){var n=t.indexOf("?>",e);if(n){var s=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return s?(s[0].length,i.processingInstruction(s[1],s[2]),n+2):-1}return-1}function Pr(){this.attributeNames={}}Er.prototype=new Error,Er.prototype.name=Er.name,Ar.prototype={parse:function(t,e,i){var n=this.domBuilder;n.startDocument(),Br(e,e={}),function(t,e,i,n,s){function r(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}function a(t){var e=t.slice(1,-1);return Object.hasOwnProperty.call(i,e)?i[e]:"#"===e.charAt(0)?r(parseInt(e.substr(1).replace("x","0x"))):(s.error("entity not found:"+t),t)}function o(e){if(e>m){var i=t.substring(m,e).replace(/&#?\w+;/g,a);d&&h(m),n.characters(i,0,e-m),m=e}}function h(e,i){for(;e>=u&&(i=c.exec(t));)l=i.index,u=l+i[0].length,d.lineNumber++;d.columnNumber=e-l+1}for(var l=0,u=0,c=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,p=[{currentNSMap:e}],f={},m=0;;){try{var y=t.indexOf("<",m);if(y<0){if(!t.substr(m).match(/^\s*$/)){var g=n.doc,v=g.createTextNode(t.substr(m));g.appendChild(v),n.currentElement=v}return}switch(y>m&&o(y),t.charAt(y+1)){case"/":var x=t.indexOf(">",y+3),b=t.substring(y+2,x).replace(/[ \t\n\r]+$/g,""),_=p.pop();x<0?(b=t.substring(y+2).replace(/[\s<].*/,""),s.error("end tag name: "+b+" is not complete:"+_.tagName),x=y+1+b.length):b.match(/\s</)&&(b=b.replace(/[\s<].*/,""),s.error("end tag name: "+b+" maybe not complete"),x=y+1+b.length);var w=_.localNSMap,S=_.tagName==b;if(S||_.tagName&&_.tagName.toLowerCase()==b.toLowerCase()){if(n.endElement(_.uri,_.localName,b),w)for(var M in w)Object.prototype.hasOwnProperty.call(w,M)&&n.endPrefixMapping(M);S||s.fatalError("end tag name: "+b+" is not match the current start tagName:"+_.tagName)}else p.push(_);x++;break;case"?":d&&h(y),x=Or(t,y,n);break;case"!":d&&h(y),x=kr(t,y,n,s);break;default:d&&h(y);var E=new Pr,A=p[p.length-1].currentNSMap,T=(x=Ir(t,y,E,A,a,s),E.length);if(!E.closed&&Nr(t,x,E.tagName,f)&&(E.closed=!0,i.nbsp||s.warning("unclosed xml attribute")),d&&T){for(var I=Tr(d,{}),C=0;C<T;C++){var D=E[C];h(D.offset),D.locator=Tr(d,{})}n.locator=I,Cr(E,n,A)&&p.push(E),n.locator=d}else Cr(E,n,A)&&p.push(E);_r.isHTML(E.uri)&&!E.closed?x=Dr(t,x,E.tagName,a,n):x++}}catch(t){if(t instanceof Er)throw t;s.error("element parse error: "+t),x=-1}x>m?m=x:o(Math.max(y,m)+1)}}(t,e,i,n,this.errorHandler),n.endDocument()}},Pr.prototype={setTagName:function(t){if(!Mr.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,i){if(!Mr.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},br.XMLReader=Ar,br.ParseError=Er;var Lr=Jn,Rr=xr,zr=br,Ur=$n.DOMImplementation,Fr=Lr.NAMESPACE,Wr=zr.ParseError,qr=zr.XMLReader;function Hr(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Vr(t){this.options=t||{locator:{}}}function jr(){this.cdata=!1}function Yr(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function Gr(t,e,i){return"string"==typeof t?t.substr(e,i):t.length>=e+i||e?new java.lang.String(t,e,i)+"":t}function Xr(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}Vr.prototype.parseFromString=function(t,e){var i=this.options,n=new qr,s=i.domBuilder||new jr,r=i.errorHandler,a=i.locator,o=i.xmlns||{},h=/\/x?html?$/.test(e),l=h?Rr.HTML_ENTITIES:Rr.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=function(t,e,i){if(!t){if(e instanceof jr)return e;t=e}var n={},s=t instanceof Function;function r(e){var r=t[e];!r&&s&&(r=2==t.length?function(i){t(e,i)}:t),n[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+function(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(i))}||function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),n}(r,s,a),n.domBuilder=i.domBuilder||s,h&&(o[""]=Fr.HTML),o.xml=o.xml||Fr.XML;var u=i.normalizeLineEndings||Hr;return t&&"string"==typeof t?n.parse(u(t),o,l):n.errorHandler.error("invalid doc source"),s.doc},jr.prototype={startDocument:function(){this.doc=(new Ur).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,i,n){var s=this.doc,r=s.createElementNS(t,i||e),a=n.length;Xr(this,r),this.currentElement=r,this.locator&&Yr(this.locator,r);for(var o=0;o<a;o++){t=n.getURI(o);var h=n.getValue(o),l=(i=n.getQName(o),s.createAttributeNS(t,i));this.locator&&Yr(n.getLocator(o),l),l.value=l.nodeValue=h,r.setAttributeNode(l)}},endElement:function(t,e,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var i=this.doc.createProcessingInstruction(t,e);this.locator&&Yr(this.locator,i),Xr(this,i)},ignorableWhitespace:function(t,e,i){},characters:function(t,e,i){if(t=Gr.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(t);else n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&Yr(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,i){t=Gr.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&Yr(this.locator,n),Xr(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(t,e,i);this.locator&&Yr(this.locator,s),Xr(this,s),this.doc.doctype=s}},warning:function(t){},error:function(t){},fatalError:function(t){throw new Wr(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){jr.prototype[t]=function(){return null}})),vr.__DOMHandler=jr,vr.normalizeLineEndings=Hr,vr.DOMParser=Vr;var Zr=vr.DOMParser;const $r="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{document:void 0,tinyEngine:void 0};$r.Path2D||function(t){if(!t||!t.CanvasRenderingContext2D||t.Path2D)return;const{CanvasRenderingContext2D:e}=t,i=null==e?void 0:e.prototype.fill,n=null==e?void 0:e.prototype.stroke,s=null==e?void 0:e.prototype.isPointInPath;e.prototype.fill=function(...t){if(!(t[0]instanceof jn)){const e=t[0]||"nonzero";return i.apply(this,[e])}{const e=t[0],n=t[1]||"nonzero";Yn(this,e.commands),i.apply(this,[n])}},e.prototype.stroke=function(t){t&&Yn(this,t.commands),n.apply(this)},e.prototype.isPointInPath=function(...t){if(t[0]instanceof jn){const e=t[0],i=t[1],n=t[2],r=t[3]||"nonzero";return Yn(this,e.commands),s.apply(this,[i,n,r])}return s.apply(this,t)},t.Path2D=jn}($r),$r.DOMParser||($r.DOMParser=Zr);const Jr={window:$r,isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),document:$r.document,config:{width:0,height:0,dpr:1,fnEnable:!1,editorMode:0,debounceCache:!0,instancedMesh:!0,controls:{enableHover:!0},assetType:"rm",selectEnable:!1,multiSelectEnable:!1,dummy:{radius:15}}};class Qr{constructor(t=!0){d(this,"dpr",1),d(this,"data"),d(this,"userData",{}),d(this,"autoClose",!1),d(this,"_saveData",!0),d(this,"_len",0),d(this,"_x0",0),d(this,"_y0",0),d(this,"_xi",0),d(this,"_yi",0),d(this,"_version",0),d(this,"_ctx"),d(this,"_ppx",0),d(this,"_ppy",0),d(this,"_ppl",0),d(this,"_ux",0),d(this,"_uy",0),d(this,"_pathSegLen"),d(this,"_pathLen",0),this._saveData=!!t,this._saveData&&(this.data=[])}dispose(){return this.reset(),this.data=[],this._len=0,this.userData={},this._ctx=void 0,this._version=0,this._ppx=0,this._ppy=0,this._ppl=0,this._ux=0,this._uy=0,this}reset(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=void 0,this._pathLen=0),this.needsUpdate=!0}set needsUpdate(t){!0===t&&this._version++}get version(){return this._version}clone(){const t=new Qr(this._saveData),e=this.data;return t.data=(null==e?void 0:e.slice)?e.slice():Array.prototype.slice.call(e),t._len=this._len,t._ux=this._ux,t._uy=this._uy,t._ppx=this._ppx,t._ppy=this._ppy,t._ppl=this._ppl,t.autoClose=this.autoClose,t.userData=mi.cloneDeep(this.userData),t}setDpr(t){return this.dpr=t||1,this}setScale(t,e,i){return i&&(this._ux=Math.abs(i/(Jr.config.dpr||1)/(t||1)),this._uy=Math.abs(i/(Jr.config.dpr||1)/(e||1))),this}setContext(t){return this._ctx=t,this}getContext(){return this._ctx}len(){return this._len}setData(t){if(!this._saveData)return;const e=(null==t?void 0:t.length)||0;this.data&&this.data.length===e||(this.data=new Float32Array(e));for(let i=0;i<e;i++)this.data[i]=t[i];this._len=e}addData(...t){if(!this._saveData)return;let e=this.data;this._len+(null==t?void 0:t.length)>((null==e?void 0:e.length)||0)&&(this._expandData(),e=this.data);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)e[this._len++]=t[i]}insertData(t,...e){if(!this._saveData||!e||0===e.length)return;const i=this.getCmds();t<0&&(t=0),t>i.length&&(t=i.length),e.length>0&&i.splice(t,0,[...e]);const n=mi.flatten(i);this.setData(n),this.needsUpdate=!0}removeData(t){if(!this._saveData||!this.data||this._len<=0)return;const e=this.getCmds();if(t<0||t>=e.length)return;e.splice(t,1);const i=mi.flatten(e);this.setData(i),this.needsUpdate=!0}_expandData(){if(!(this.data instanceof Array)){const t=[];for(let e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}}appendPath(t){if(!this._saveData||!t)return;t instanceof Array||(t=[t]);const e=t.length;let i=0,n=this._len;for(let n=0;n<e;n++)i+=t[n].len()||0;const s=this.data;if((s instanceof Float32Array||!s)&&(this.data=new Float32Array(n+i),n>0&&s))for(let t=0;t<n;t++)this.data[t]=s[t];for(let i=0;i<e;i++){const e=t[i].data;for(let i=0,s=(null==t?void 0:t.length)||0;i<s;i++)this.data[n++]=e[i]}this._len=n}toStatic(){this._saveData&&(this._pendingLine(),this.data instanceof Array&&(this.data.length=this._len,this._len>11&&(this.data=new Float32Array(this.data))))}rebuildPath(t,e){if(!this.data||!this._len||e<=0)return;const i=this.data,n=this._ux,s=this._uy,r=this._len;let a=0,o=0,h=0,l=0,u=0,c=0;const d=e<1;let p,f,m,y,g=0,v=0,x=0,b=0;if(!d||(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,f=this._pathLen,x=f*e,x))t:for(let e=0;e<r;){const r=i[e++],f=1===e;switch(f&&(a=h=i[e],o=l=i[e+1]),r!==Ln&&b>0&&(t.lineTo(m,y),b=0),r){case Pn:a=h=i[e++],o=l=i[e++],t.moveTo(h,l);break;case Ln:{u=i[e++],c=i[e++];const r=Math.abs(u-h),a=Math.abs(c-l);if(r>n||a>s){if(d){const e=p[v++];if(g+e>x){const i=(x-g)/e;t.lineTo(h*(1-i)+u*i,l*(1-i)+c*i);break t}g+=e}t.lineTo(u,c),h=u,l=c,b=0}else{const t=r*r+a*a;t>b&&(m=u,y=c,b=t)}break}case Rn:{const n=i[e++],s=i[e++],r=i[e++],a=i[e++],o=i[e++],u=i[e++];if(d){const e=p[v++];if(g+e>x){const i=(x-g)/e;bi(h,n,r,o,i,ta),bi(l,s,a,u,i,ea),t.bezierCurveTo(ta[1],ea[1],ta[2],ea[2],ta[3],ea[3]);break t}g+=e}t.bezierCurveTo(n,s,r,a,o,u),h=o,l=u;break}case zn:{const n=i[e++],s=i[e++],r=i[e++],a=i[e++];if(d){const e=p[v++];if(g+e>x){const i=(x-g)/e;Mi(h,n,r,i,ta),Mi(l,s,a,i,ea),t.quadraticCurveTo(ta[1],ea[1],ta[2],ea[2]);break t}g+=e}t.quadraticCurveTo(n,s,r,a),h=r,l=a;break}case Un:const r=i[e++],_=i[e++],w=i[e++],S=i[e++];let M=i[e++],E=i[e++];const A=i[e++],T=!i[e++],I=w>S?w:S,C=Math.abs(w-S)>.001;let D=M+E,N=!1;if(d){const t=p[v++];g+t>x&&(D=M+E*(x-g)/t,N=!0),g+=t}if(C&&"function"==typeof t.ellipse?t.ellipse(r,_,w,S,A,M,D,T):t.arc(r,_,I,M,D,T),N)break t;f&&(a=r+Math.cos(M)*w,o=_+Math.sin(M)*S),h=Math.cos(D)*w+r,l=Math.sin(D)*S+_;break;case Wn:a=h=i[e],o=l=i[e+1],u=i[e++],c=i[e++];const B=i[e++],k=i[e++];if(d){const e=p[v++];if(g+e>x){let e=x-g;t.moveTo(u,c),t.lineTo(u+Math.min(B,e),c),e-=B,e>0&&t.lineTo(u+B,c+Math.min(k,e)),e-=k,e>0&&t.lineTo(u+Math.max(B-e,0),c+k),e-=B,e>0&&t.lineTo(u,c+Math.max(k-e,0));break t}g+=e}t.rect(u,c,B,k);break;case Fn:if(d){const e=p[v++];if(g+e>x){const i=(x-g)/e;t.lineTo(h*(1-i)+a*i,l*(1-i)+o*i);break t}g+=e}t.closePath(),h=a,l=o}}}_calculateLength(){let t=0;if(!this.data||!this._len)return t;const e=this.data,i=this._len,n=this._ux,s=this._uy;let r=0,a=0,o=0,h=0;this._pathSegLen||(this._pathSegLen=[]);const l=this._pathSegLen;let u=0;for(let c=0;c<i;){const d=e[c++],p=1===c;p&&(r=o=e[c],a=h=e[c+1]);let f=-1;switch(d){case Pn:r=o=e[c++],a=h=e[c++];break;case Ln:{const t=e[c++],r=e[c++],a=t-o,l=r-h;(Math.abs(a)>n||Math.abs(l)>s||c==i-1)&&(f=Math.sqrt(a*a+l*l),o=t,h=r);break}case Rn:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++],r=e[c++],a=e[c++];f=xi(o,h,t,i,n,s,r,a,10),o=r,h=a;break}case zn:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++];f=Si(o,h,t,i,n,s,10),o=n,h=s;break}case Un:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++],l=e[c++];let u=e[c++];const d=l+u;c+=1,p&&(r=t+Math.cos(l)*n,a=i+Math.sin(l)*s),f=Math.max(n,s)*Math.min(Math.abs(u),2*Ei),o=Math.cos(d)*n+t,h=Math.sin(d)*s+i;break}case Wn:r=o=e[c++],a=h=e[c++],f=2*(e[c++]+e[c++]);break;case Fn:{const t=r-o,e=a-h;f=Math.sqrt(t*t+e*e),o=r,h=a;break}}f>=0&&(l[u++]=f,t+=1)}return this._pathLen=t,t}computeBoundingBox(t=new Ri){if(t.makeEmpty(),Kr.makeEmpty(),!this.data||!this._len)return t;const e=this.data;let i=0,n=0,s=0,r=0,a=0;for(a=0;a<this._len;){const o=e[a++],h=1===a;switch(h&&(i=s=e[a],n=r=e[a+1]),o){case Pn:i=s=e[a++],n=r=e[a++],Kr.setFromXYXY(i,n,i,n);break;case Ln:t.expandByXY(s,r),t.expandByXY(e[a],e[a+1]),s=e[a++],r=e[a++];break;case Rn:t.expandByCubic(s,r,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1]),s=e[a++],r=e[a++];break;case zn:t.expandByQuadratic(s,r,e[a++],e[a++],e[a],e[a+1]),s=e[a++],r=e[a++];break;case Un:const o=e[a++],l=e[a++],u=Math.abs(e[a++]),c=Math.abs(e[a++]);let d=e[a++],p=e[a++]+d;a+=1;const f=!e[a++];h&&(i=o+Math.cos(d)*u,n=l+Math.sin(d)*c),t.expandByArc(o,l,u,c,d,p,f),s=Math.cos(p)*u+o,r=Math.sin(p)*c+l;break;case Wn:i=s=e[a++],n=r=e[a++];const m=e[a++],y=e[a++];t.expandByXY(i,n),t.expandByXY(i+m,n+y);break;case qn:{const i=e[a++],n=e[a++],s=Math.abs(e[a++]),r=Math.abs(e[a++]),o=e[a++];let h=e[a++],l=e[a++];const u=!!e[a++];t.expandByEllipse(i,n,s,r,o,h,l,u);break}case Fn:s=i,r=n}t.expandByBox(Kr)}return t}applyMatrix3(t){if(!this.data||!this._len)return this;const e=this.data,i=this._len;let n=0;for(t.getScale(aa);n<i;)switch(e[n++]){case Pn:case Ln:ra.set(e[n],e[n+1]).applyMatrix3(t),e[n]=ra.x,e[n+1]=ra.y,n+=2;break;case Rn:for(let i=0;i<3;i++)ra.set(e[n+2*i],e[n+2*i+1]).applyMatrix3(t),e[n+2*i]=ra.x,e[n+2*i+1]=ra.y;n+=6;break;case zn:for(let i=0;i<2;i++)ra.set(e[n+2*i],e[n+2*i+1]).applyMatrix3(t),e[n+2*i]=ra.x,e[n+2*i+1]=ra.y;n+=4;break;case Un:ra.set(e[n],e[n+1]).applyMatrix3(t),e[n+5]=ra.x,e[n+6]=ra.y,e[n]*=aa.x,e[n+1]*=aa.y,n+=7;break;case Wn:ra.set(e[n],e[n+1]).applyMatrix3(t),e[n]=ra.x,e[n+1]=ra.y,e[n+2]*=aa.x,e[n+3]*=aa.y,n+=4;break;case qn:ra.set(e[n],e[n+1]).applyMatrix3(t);let i=[e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]];t.isTransformSkewed()?da([e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]],t,i):pa([e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]],t,i),e[n]=ra.x,e[n+1]=ra.y,e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],n+=8}return this.needsUpdate=!0,this}_pendingLine(){var t;this._ppl>0&&(null==(t=this._ctx)||t.lineTo(this._ppx,this._ppy),this._ppl=0)}beginPath(){var t;return null==(t=this._ctx)||t.beginPath(),this.reset(),this}moveTo(t,e){var i;return this._pendingLine(),this.addData(Pn,t,e),null==(i=this._ctx)||i.moveTo(t,e),this._x0=this._xi=t,this._y0=this._yi=e,this}lineTo(t,e){var i;const n=Math.abs(t-this._xi),s=Math.abs(e-this._yi);if(this.addData(Ln,t,e),n>this._ux||s>this._uy)null==(i=this._ctx)||i.lineTo(t,e),this._xi=t,this._yi=e,this._ppl=0;else{const i=n*n+s*s;i>this._ppl&&(this._ppx=t,this._ppy=e,this._ppl=i)}return this}bezierCurveTo(t,e,i,n,s,r){var a;return this._pendingLine(),this.addData(Rn,t,e,i,n,s,r),null==(a=this._ctx)||a.bezierCurveTo(t,e,i,n,s,r),this._xi=s,this._yi=r,this}quadraticCurveTo(t,e,i,n){var s;return this._pendingLine(),this.addData(zn,t,e,i,n),null==(s=this._ctx)||s.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this}arc(t,e,i,n,s,r){var a;this._pendingLine(),ia[0]=n,ia[1]=s,Ii(ia,!!r),n=ia[0];const o=(s=ia[1])-n;return this.addData(Un,t,e,i,i,n,o,0,r?0:1),null==(a=this._ctx)||a.arc(t,e,i,n,s,r),this._xi=t+Math.cos(s)*i,this._yi=e+Math.sin(s)*i,this}arcTo(t,e,i,n,s){var r;return this._pendingLine(),null==(r=this._ctx)||r.arcTo(t,e,i,n,s),this}rect(t,e,i,n){var s;return this._pendingLine(),this.addData(Wn,t,e,i,n),null==(s=this._ctx)||s.rect(t,e,i,n),this}closePath(){var t;return this._pendingLine(),this.addData(Fn),null==(t=this._ctx)||t.closePath(),this._xi=this._x0,this._yi=this._y0,this}ellipse(t,e,i,n,s,r,a,o){var h;return this._pendingLine(),this.addData(qn,t,e,i,n,s,r,a,o?1:0),null==(h=this._ctx)||h.ellipse(t,e,i,n,s,r,a,o),this}absellipse(t,e,i,n,s,r,a,o=!1){return this._pendingLine(),this.addData(qn,t,e,i,n,s,r,a,o?1:0),this}absarc(t,e,i,n,s,r=!1){return this.absellipse(t,e,i,i,0,n,s,r),this}fill(t){t.fill(),this.toStatic()}stroke(t){this._pendingLine(),t.stroke(),this.toStatic()}addArrow(t,e,i=30){if(!t||!e)return this;const n=this.getVertices();return!(null==n?void 0:n.length)||n.length<4||(t>0?(na.set(n[2],n[3]),ra.set(n[0],n[1]),sa.subVectors(na,ra),aa.lerpVectors(ra,na,e/sa.length()),oa.copy(aa).rotateAround(ra,Bi(i)),ha.copy(aa).rotateAround(ra,-Bi(i)),this.moveTo(oa.x,oa.y),this.lineTo(ra.x,ra.y),this.lineTo(ha.x,ha.y)):(na.set(n[n.length-4],n[n.length-3]),ra.set(n[n.length-2],n[n.length-1]),sa.subVectors(na,ra),aa.lerpVectors(ra,na,e/sa.length()),oa.copy(aa).rotateAround(ra,Bi(i)),ha.copy(aa).rotateAround(ra,-Bi(i)),this.moveTo(oa.x,oa.y),this.lineTo(ra.x,ra.y),this.lineTo(ha.x,ha.y))),this}getVertices(t=[]){if(!this.data||!this._len)return t;const e=this.data;for(let i=0;i<this._len;){const n=e[i++];switch(n){case Pn:case Ln:t.push(e[i++],e[i++]);break;case Rn:i+=4,t.push(e[i++],e[i++]);break;case zn:i+=2,t.push(e[i++],e[i++]);break;case Un:const s=e[i++],r=e[i++],a=e[i++],o=e[i++],h=e[i++],l=e[i++]+h;i+=2;const u=s+Math.cos(h)*a,c=r+Math.sin(h)*o;t.push(u,c);const d=s+Math.cos(l)*a,p=r+Math.sin(l)*o;t.push(d,p);break;case Wn:const f=e[i++],m=e[i++],y=e[i++],g=e[i++];t.push(f,m,f+y,m,f+y,m+g,f,m+g);break;case qn:const v=e[i++],x=e[i++],b=e[i++],_=e[i++];e[i++];const w=e[i++],S=e[i++];e[i++];const M=v+b*Math.cos(w),E=x+_*Math.sin(w);t.push(M,E);const A=v+b*Math.cos(S),T=x+_*Math.sin(S);t.push(A,T);break;case Fn:break;default:throw new Error("Invalid command "+n)}}return t}getCmds(){var t;if(!(null==(t=this.data)?void 0:t.length))throw new Error("PathProxy.getCmds: empty path.data.");const e=this.data,i=[];let n=0;for(n=0;n<e.length;)switch(e[n++]){case Pn:i.push([Pn,e[n++],e[n++]]);break;case Ln:i.push([Ln,e[n++],e[n++]]);break;case Rn:i.push([Rn,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case zn:i.push([zn,e[n++],e[n++],e[n++],e[n++]]);break;case Un:i.push([Un,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case Wn:i.push([Wn,e[n++],e[n++],e[n++],e[n++]]);break;case qn:i.push([qn,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case Fn:i.push([Fn])}return i}getControlPoints(t=[]){if(t.length=0,!this.data||!this._len)return t;const e=this.data;let i=0,n=0,s=0;for(i=0;i<this._len;)switch(e[i++]){case Pn:n=e[i],s=e[i+1],i+=2,t.push(new Oi(n,s));break;case Ln:{const r=e[i++],a=e[i++];t.push(new Oi(r,a)),n=r,s=a;break}case Rn:{const r=n,a=s,o=e[i++],h=e[i++],l=e[i++],u=e[i++],c=e[i++],d=e[i++];t.push(new Oi(r,a)),t.push(new Oi(o,h)),t.push(new Oi(l,u)),t.push(new Oi(c,d)),n=c,s=d;break}case zn:{const r=n,a=s,o=e[i++],h=e[i++],l=e[i++],u=e[i++];t.push(new Oi(r,a)),t.push(new Oi(o,h)),t.push(new Oi(l,u)),n=l,s=u;break}case Un:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++],l=e[i++],u=e[i++];e[i++],e[i++];const c=l+u,d=r+Math.cos(l)*o,p=a+Math.sin(l)*h;t.push(new Oi(d,p));const f=r+Math.cos(c)*o,m=a+Math.sin(c)*h;t.push(new Oi(f,m)),t.push(new Oi(r,a)),n=f,s=m;break}case Wn:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++];t.push(new Oi(r,a)),t.push(new Oi(r+o,a)),t.push(new Oi(r+o,a+h)),t.push(new Oi(r,a+h)),n=r,s=a;break}case qn:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++];t.push(new Oi(r,a)),o>h?(t.push(new Oi(r+o,a)),t.push(new Oi(r,a+h)),o!==h&&(t.push(new Oi(r-o,a)),t.push(new Oi(r,a-h)))):h>o?(t.push(new Oi(r+o,a)),t.push(new Oi(r,a+h)),t.push(new Oi(r-o,a)),t.push(new Oi(r,a-h))):t.push(new Oi(r+o,a)),n=r,s=a;break}}return t}getStartPoint(t=new Oi){return t.set(this._x0,this._y0)}getEndPoint(t=new Oi){return t.set(this._xi,this._yi)}}const Kr=new Ri,ta=[],ea=[],ia=[],na=new Oi,sa=new Oi,ra=new Oi,aa=new Oi,oa=new Oi,ha=new Oi,la=new Gi,ua=new Gi,ca=new Gi;function da(t,e,i=[0,0,0,0,0,0,0,0]){const[n,s,r,a,o,h,l,u]=t;i[0]=n,i[1]=s;const c=Math.cos(o),d=Math.sin(o);ra.set(r*c,r*d).applyMatrix3(e),aa.set(-a*d,a*c).applyMatrix3(e);const p=la.set(ra.x,aa.x,0,ra.y,aa.y,0,0,0,1),f=ua.copy(p).invert(),m=ca.copy(f).transpose().multiply(f).elements,y=function(t,e,i){let n,s,r,a,o=0;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(o=.5*(h+u),a=1/o,n=t*a*i-e*a*e):h<0?n=.5*(h-u):(o=.5*u,n=-.5*u),s=l>0?l+u:l-u,Math.abs(s)>2*Math.abs(e)?(a=-2*e/s,r=1/Math.sqrt(1+a*a),s=a*r):0===Math.abs(e)?(s=1,r=0):(a=-.5*s/e,s=1/Math.sqrt(1+a*a),r=a*s),l>0&&(a=s,s=-r,r=a),{rt1:o,rt2:n,cs:s,sn:r}}(m[0],m[1],m[4]),g=Math.sqrt(y.rt1),v=Math.sqrt(y.rt2);if(i[2]=1/g,i[3]=1/v,i[4]=Math.atan2(y.sn,y.cs),!((l-h)%(2*Math.PI)<Number.EPSILON)){const t=ua.set(g,0,0,0,v,0,0,0,1),n=ca.set(y.cs,y.sn,0,-y.sn,y.cs,0,0,0,1),s=t.multiply(n).multiply(p),r=t=>{const{x:e,y:i}=new Oi(Math.cos(t),Math.sin(t)).applyMatrix3(s);return Math.atan2(i,e)};i[5]=r(h),i[6]=r(l),e.isTransformFlipped()&&(i[7]=u?0:1)}return i}function pa(t,e,i=[0,0,0,0,0,0,0,0]){const[n,s,r,a,o,h,l,u]=t;i[0]=n,i[1]=s;const c=e.getTransformScaleX(),d=e.getTransformScaleY();i[2]=r*c,i[3]=a*d;const p=c>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);return i[4]=o+p,e.isTransformFlipped()&&(i[5]=-1*h,i[6]=-1*l,i[7]=u?0:1),i}class fa{static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(t){var e;if(!(null==(e=Jr.window)?void 0:e.document))throw new Error("environment not support");let i,n;if(t.containerId&&(i=Jr.window.document.getElementById(t.containerId)),i||(i=Jr.window.document.getElementsByTagName("body")[0]),t.canvasId&&(n=Jr.window.document.getElementById(t.canvasId)||void 0),t.width||(t.width=(null==i?void 0:i.offsetWidth)||100),t.height||(t.height=(null==i?void 0:i.offsetHeight)||100),t.dpr||(t.dpr=Jr.config.dpr),n)this.resizeCanvas(n,t.width,t.height,t.dpr);else{if(n=this.createHtmlCanvas(t.width,t.height,t.dpr),!n)throw new Error("error environment");t.canvasId&&n.setAttribute("id",t.canvasId),null==i||i.appendChild(n)}return n.style.background=t.background||"transparent",n}static getContext2D(t,e={}){const i={alpha:!0,willReadFrequently:!!e.willReadFrequently},n=t.getContext("2d",i);if(!n)throw new Error("getContext2D error");return n.scale(e.dpr||1,e.dpr||1),n}static resizeCanvas(t,e,i,n=1){t instanceof OffscreenCanvas?(t.width=e,t.height=i):t instanceof HTMLCanvasElement&&(t.setAttribute("width",(e*n).toString()),t.setAttribute("height",(i*n).toString()),t.style.width=e+"px",t.style.height=i+"px",t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.imageRendering="pixelated",t.style.transform="translateZ(0)")}static getImageBitmapByCanvasAsync(t){return p(this,null,(function*(){if(t)return t instanceof OffscreenCanvas?t.transferToImageBitmap():t instanceof HTMLCanvasElement?yield createImageBitmap(t):void 0}))}static get(t,e,i,n=1){let s=this.cached.get(t);return s||(s=this.create(e,i,n),this.set(t,s)),this.resizeCanvas(s,e,i,n),s}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e)}static remove(t){this.cached.has(t)&&this.cached.delete(t)}static create(t,e,i=1){var n;if(null==(n=Jr.window)?void 0:n.OffscreenCanvas)return new OffscreenCanvas(t,e);throw new Error("environment does not support")}static createHtmlCanvas(t,e,i=1){if(!Jr.window.document)throw new Error("environment does not support");const n=Jr.window.document.createElement("canvas");return this.resizeCanvas(n,t,e,i),n}static measureText(t,e,i=new Oi){if(!t)throw new Error("input error");const n=this.get("measureText",1,1).getContext("2d");if(!n)throw new Error("bufferCtx not found");e.render(n);const s=n.measureText(t);if(!s)throw new Error("measureText error");const r=s.actualBoundingBoxRight+s.actualBoundingBoxLeft,a=s.actualBoundingBoxAscent+s.actualBoundingBoxDescent;return i.set(r,a),i}static measureText2(t,e=12,i=new Oi){if(!t)throw new Error("input error");const n=this.get("measureText",1,1).getContext("2d");if(!n)throw new Error("bufferCtx not found");n.font=`${e}px sans-serif`;const s=n.measureText(t);if(!s)throw new Error("measureText error");const r=s.actualBoundingBoxRight+s.actualBoundingBoxLeft,a=s.actualBoundingBoxAscent+s.actualBoundingBoxDescent;return i.set(r,a),i}static getCtx(t,e,i,n=1){if(!ma[t]){const s=this.create(e,i,n);ma[t]={cvs:s,ctx:s.getContext("2d")},this.resizeCanvas(s,e,i,n)}return ma[t].ctx}}d(fa,"cached",new Map),d(fa,"cachedCanvas",new Map);const ma={};class ya{constructor(t){d(this,"params"),d(this,"percent"),d(this,"path"),d(this,"boundingBox",new Ri),this.params=t,this.percent=null==t?void 0:t.percent}_init(t){return this.attr(t),this}attr(t,e){if(!t)return this;if("string"==typeof t)this.attrKV(t,e);else if("object"==typeof t){let e=Object.keys(t);for(let i,n=0,s=e.length;n<s;n++)i=e[n],this.attrKV(i,t[i])}return this}attrKV(t,e){return this[t]=e,this}buildPath(t,e,i){}setPoints(t){return t&&t.length?(this.points=t,this):this}computeBoundingBox(t=new Ri){return this.boundingBox.makeEmpty(),this.path||(this.path=new Qr),this.path.reset(),this.buildPath(this.path,this),this.path.computeBoundingBox(this.boundingBox),t.copy(this.boundingBox),t}isPointInBoundingBox(t){return!!this.boundingBox&&this.boundingBox.containsPoint(t)}isPointInPath(t){return!!this.isPointInBoundingBox(t)&&("function"==typeof Path2D?this.isPointInPathByPath2D(t):this.isPointInPathByCtx(t))}isPointInPathByCtx(t){let e=!1;return ga.save(),this.buildPath(ga,this),e=ga.isPointInPath(t.x,t.y),ga.restore(),e}isPointInPathByPath2D(t){if(!Path2D)return!1;const e=new Path2D;return this.buildPath(e,this),ga.isPointInPath(e,t.x,t.y)}isBoxIntersectsBoundingBox(t){return!!this.boundingBox&&this.boundingBox.intersectsBox(t)}isBoxIntersectsPath(t){return!!this.isBoxIntersectsBoundingBox(t)}}const ga=fa.get("RAY_CASTER",10,10).getContext("2d");class va extends ya{constructor(t){super(t),this._init(t),this.flipY&&this.scale(1,-1)}initByPathProxy(t){var e;if(!t||!(null==(e=t.data)?void 0:e.length))throw new Error("GeoShape.initByPathProxy: path is required.");this.path=t;const i=t.data,n=[];let s=0;for(s=0;s<i.length;)switch(i[s++]){case Pn:n.push([Pn,i[s++],i[s++]]);break;case Ln:n.push([Ln,i[s++],i[s++]]);break;case Rn:n.push([Rn,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case zn:n.push([zn,i[s++],i[s++],i[s++],i[s++]]);break;case Un:n.push([Un,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case Wn:n.push([Wn,i[s++],i[s++],i[s++],i[s++]]);break;case qn:n.push([qn,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case Fn:n.push([Fn])}return this.cmds=n,this}computeBoundingBox(t=new Ri){return super.computeBoundingBox(t),this.boundingBox}buildPath(t,e,i){if(0===this.percent)return;const{cmds:n}=this;for(let e=0,i=(null==n?void 0:n.length)||0;e<i;e++){const[i,...s]=n[e];switch(i){case Pn:t.moveTo(...s);break;case Ln:t.lineTo(...s);break;case Rn:t.bezierCurveTo(...s);break;case zn:t.quadraticCurveTo(...s);break;case Un:t.arc(s[0],s[1],s[2],s[3],s[4],!!s[5]);break;case Fn:t.closePath();break;case Wn:t.rect(...s);break;case qn:t.ellipse(s[0],s[1],s[2],s[3],s[4],s[5],s[6],!!s[7])}}}scale(t,e){this.transform(xa.makeScale(t,e))}transform(t){const e=[],{cmds:i}=this;for(let n=0,s=(null==i?void 0:i.length)||0;n<s;n++){const[s,...r]=i[n];switch(s){case Pn:case Ln:case Wn:ba.set(r[0],r[1]).applyMatrix3(t),e[n]=[s,ba.x,ba.y];break;case Rn:ba.set(r[0],r[1]).applyMatrix3(t),_a.set(r[2],r[3]).applyMatrix3(t),wa.set(r[4],r[5]).applyMatrix3(t),e[n]=[s,ba.x,ba.y,_a.x,_a.y,wa.x,wa.y];break;case zn:ba.set(r[0],r[1]).applyMatrix3(t),_a.set(r[2],r[3]).applyMatrix3(t),e[n]=[s,ba.x,ba.y,_a.x,_a.y];break;case Un:ba.set(r[0],r[1]).applyMatrix3(t),e[n]=[s,ba.x,ba.y,r[2],r[3],r[4],r[5],r[6]];break;case qn:{ba.set(r[0],r[1]).applyMatrix3(t);const[i,a,o,h,l,u,c,d]=r,p=-l,f=-u,m=-c,y=!d;e[n]=[s,ba.x,ba.y,o,h,p,f,m,y?1:0];break}case Fn:e[n]=[s]}}this.cmds=e}}const xa=new Gi,ba=new Oi,_a=new Oi,wa=new Oi;let Sa=new WeakMap,Ma=-1;function Ea(t){var e,i;const n=[];return"string"==typeof t.fill?n.push(t.fill):(null==(e=t.fill)?void 0:e.isColor)?n.push(t.fill.getHexString()):t.fill instanceof CanvasGradient||t.fill instanceof CanvasPattern?Sa.has(t.fill)||Sa.set(t.fill,"gradientPattern_"+ ++Ma):n.push(""),"string"==typeof t.stroke?n.push(t.stroke):(null==(i=t.stroke)?void 0:i.isColor)?n.push(t.stroke.getHexString()):t.stroke instanceof CanvasGradient||t.stroke instanceof CanvasPattern?Sa.has(t.stroke)||Sa.set(t.stroke,"gradientPattern_"+ ++Ma):n.push(""),n.push(void 0!==t.lineWidth?t.lineWidth.toString():""),n.push(void 0!==t.lineDash?t.lineDash.toString():""),n.push(void 0!==t.lineDashOffset?t.lineDashOffset.toString():""),n.push(void 0!==t.lineCap?t.lineCap.toString():""),n.push(void 0!==t.fillOpacity?t.fillOpacity.toString():""),n.push(void 0!==t.strokeOpacity?t.strokeOpacity.toString():""),n.push(void 0!==t.opacity?t.opacity.toString():""),t.isText&&(n.push(void 0!==t.text?t.text:""),n.push(void 0!==t.fontSize?t.fontSize.toString():"")),n.join("_")}class Aa{constructor(t){d(this,"fill"),d(this,"stroke"),d(this,"lineWidth"),d(this,"lineDash"),d(this,"lineDashOffset"),d(this,"lineCap"),d(this,"lineJoin"),d(this,"fillOpacity"),d(this,"strokeOpacity"),d(this,"opacity"),d(this,"featureKey"),d(this,"map"),this.fill=null==t?void 0:t.fill,this.stroke=null==t?void 0:t.stroke,this.lineWidth=null==t?void 0:t.lineWidth,this.lineDash=null==t?void 0:t.lineDash,this.lineDashOffset=null==t?void 0:t.lineDashOffset,this.lineCap=(null==t?void 0:t.lineCap)||"round",this.lineJoin=(null==t?void 0:t.lineJoin)||"miter",void 0!==(null==t?void 0:t.fillOpacity)?this.fillOpacity=null==t?void 0:t.fillOpacity:this.fillOpacity=1,this.featureKey=Ea(this)}}class Ta extends ya{constructor(t){super(t),this._init(t)}buildPath(t,e,i){const n=this.percent;if(0===n)return;let{x1:s,y1:r,x2:a,y2:o}=e||this;s&&r&&a&&o&&(t.moveTo(s,r),n&&n<1&&(a=s*(1-n)+a*n,o=r*(1-n)+o*n),t.lineTo(a,o))}}class Ia extends wn{constructor(t=new Ta,e=new Aa,i){super(i),d(this,"name","Shape"),d(this,"isShape",!0),d(this,"geo"),d(this,"mtl"),d(this,"boundingBox",new Ri),this.geo=t,this.mtl=e,(null==i?void 0:i.name)&&(this.name=i.name)}destroy(){super.destroy()}computeBoundingBox(){this.boundingBox.makeEmpty(),this.geo.computeBoundingBox(this.boundingBox);for(let t=0,e=this.children.length;t<e;t++)this.boundingBox.union(this.children[t].computeBoundingBox());return this.boundingBox}buildPath(t,e,i){this.geo.buildPath(t)}raycast(t,e=[]){var i,n;if(super.raycast(t,e),!this.boundingBox||this.boundingBox.isEmpty())return e;if(this.boundingBoxWorld.isEmpty()&&this.updateBoundingBox(),t.intersectType)Na.copy(t.worldBox),(Na.containsBox(this.boundingBoxWorld)||(null==(n=this.geo)?void 0:n.isBoxIntersectsPath(Na.applyMatrix3(Da.copy(this.matrixWorld).invert()))))&&e.push(this);else{if(!this.boundingBoxWorld.containsPoint(t.worldCoords))return e;Ca.copy(t.worldCoords).applyMatrix3(Da.copy(this.matrixWorld).invert()),this.composeNode?this.traverseSome((t=>t.geo.isPointInPath(Ca)))&&e.push(this):(null==(i=this.geo)?void 0:i.isPointInPath(Ca))&&e.push(this)}return e}clone(t=!0,e=!1){return new(0,this.constructor)(this.geo,this.mtl).copy(this,t,e)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.params=mi.merge(this.params,t),this.renderOrder=t.renderOrder,i?(this.geo=mi.cloneDeep(t.geo),this.mtl=mi.cloneDeep(t.mtl)):(this.geo=t.geo,this.mtl=t.mtl),this}}const Ca=new Oi,Da=new Gi,Na=new Ri,Ba="#45b787",ka="#21532fff",Oa="#6e9bc5",Pa="#2775b6",La="#F26666",Ra="#D95970",za="#ECDEC0",Ua="#D0AC57",Fa="#918883",Wa="#F2F2F2",qa="#2E3032",Ha="#182327",Va={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ja={h:0,s:0,l:0},Ya={h:0,s:0,l:0};function Ga(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}const Xa=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Za{constructor(t,e,i,n){return d(this,"isColor",!0),d(this,"r",1),d(this,"g",1),d(this,"b",1),d(this,"a",1),void 0===e&&void 0===i?this.set(t):this.setRGBA(t,e,i,n)}static isColor(t){return"string"==typeof t?Xa.test(t):"number"==typeof t&&Number.isInteger(t)&&t>=0&&t<=16777215&&6===t.toString(6).length}static getRandomStyle(t){return t?$a.random().setA(t).getStyle():$a.random().getStyle()}static getDarken(t,e=.8){return $a.set(t).getHSL(Ja),$a.setHSL(Ja.h,Ja.s,Ja.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return $a.set(t),$a.getContrastString()}static getArray(t){return $a.set(t).toArray()}static getComplementary(t){return $a.set(t),$a.getComplementaryString()}static getMoreTransparent(t,e){return $a.set(t).setA(e).getStyle()}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(t){return this.r=t,this.g=t,this.b=t,this.a=1,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this.a=1,this}setR(t){return this.r=t,this}setG(t){return this.g=t,this}setB(t){return this.b=t,this}setA(t){return this.a=t,this}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a)}setRGBA(t,e,i,n=1){return this.r=t,this.g=e,this.b=i,this.a=n,this}setHSL(t,e,i,n=1){var s;if(t=(t%(s=1)+s)%s,e=Di(e,0,1),i=Di(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,s=2*i-n;this.r=Ga(s,n,t+1/3),this.g=Ga(s,n,t),this.b=Ga(s,n,t-1/3)}return this.a=n,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const i=e[1],n=e[2];switch(i){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,this.a=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,this.a=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n)){const e=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,n=parseInt(t[3],10)/100,s=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0);return this.setHSL(e,i,n,s)}}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=e[1],i=t.length;if(3===i)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this.a=1,this;if(6===i)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Va[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}clone(){return new Za(this.r,this.g,this.b,this.a)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}getRGB(t=new Za){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Za){const e=this.a,i=e*this.r+(1-e)*t.r,n=e*this.g+(1-e)*t.g,s=e*this.b+(1-e)*t.b;return new Za(i,n,s)}getHex(){return Di(255*this.r,0,255)<<16^Di(255*this.g,0,255)<<8^Di(255*this.b,0,255)}getHSL(t){const e=this.r,i=this.g,n=this.b,s=Math.max(e,i,n),r=Math.min(e,i,n);let a,o=0;const h=(r+s)/2;if(r===s)o=0,a=0;else{const t=s-r;switch(a=h<=.5?t/(s+r):t/(2-s-r),s){case e:o=(i-n)/t+(i<n?6:0);break;case i:o=(n-e)/t+2;break;case n:o=(e-i)/t+4}o/=6}return t.h=o,t.s=a,t.l=h,t}getStyle(){return 1===this.a?`rgb(${255*this.r|0},${255*this.g|0},${255*this.b|0})`:`rgba(${255*this.r|0},${255*this.g|0},${255*this.b|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let t=(255*this.r*299+255*this.g*587+255*this.b*144)/1e3;return t+=(255-t)*(255-255*this.a)/255,t}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(t=new Za){const e=this.toArray(),i=[0,0,0,1];for(let t=0;t<e.length;t++)if(t<3)i[t]=1-e[t];else{if(3!==t)continue;e[t]>1||e[t]<=0?i[t]=1:i[t]=Math.max(Math.min(parseFloat(e[t].toFixed(2)),1),0)}return t.setRGBA(i[0],i[1],i[2],parseFloat(i[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(void 0===t||t>=1)return this.getHexString();const e=this.getRGBByBg(),i=e.r*t+(1-t),n=e.g*t+(1-t),s=e.b*t+(1-t);return new Za(i,n,s).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(t,e,i){return this.getHSL(ja),ja.h+=t,ja.s+=e,ja.l+=i,this.setHSL(ja.h,ja.s,ja.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(ja),t.getHSL(Ya);const i=ki(ja.h,Ya.h,e),n=ki(ja.s,Ya.s,e),s=ki(ja.l,Ya.l,e);return this.setHSL(i,n,s),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[0,0,0,0],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const $a=new Za,Ja={h:0,s:0,l:0};class Qa extends Aa{constructor(t){super(t),d(this,"text"),d(this,"isText",!0),d(this,"fontFamily","Arial"),d(this,"fontSize",12),d(this,"fontStyle",io),d(this,"fontWeight",io),d(this,"fontVariant",io),d(this,"textDecoration",""),d(this,"textAlign",Ka),d(this,"verticalAlign",to),d(this,"textBaseline",eo),d(this,"lineHeight",1),d(this,"letterSpacing",0),d(this,"wrap",no),d(this,"ellipsis",!1),this.text=null==t?void 0:t.text,this.fill=(null==t?void 0:t.fill)||Ha,this.fontFamily=(null==t?void 0:t.fontFamily)||"Arial",this.fontSize=(null==t?void 0:t.fontSize)||12,this.fontStyle=(null==t?void 0:t.fontStyle)||io,this.fontWeight=(null==t?void 0:t.fontWeight)||io,this.textAlign=(null==t?void 0:t.textAlign)||Ka,this.textBaseline=(null==t?void 0:t.textBaseline)||eo,this.featureKey=Ea(this)}}const Ka="center",to="top",eo="middle",io="normal",no="word";class so{static hasCache(t){return void 0!==ro[t]}static setCache(t,e){ro[t]=e}static getCache(t){return ro[t]}static getCachedFeatureKeys(){return Object.keys(ro)}static getMtl(t,e){let i=Ea(t);return e&&(i=`${e}_${i}`),this.hasCache(i)||(t.text?this.setCache(i,new Qa(t)):this.setCache(i,new Aa(t))),this.getCache(i)}}const ro={};class ao extends ya{constructor(t){super(t),this._init(t)}buildPath(t,e,i){if(0===this.percent)return;let{points:n}=e||this;if(n&&n.length&&!(n.length<2)){for(let e=0,i=n.length;e<i;e+=2)e?t.lineTo(n[e],n[e+1]):t.moveTo(n[e],n[e+1]);t.closePath()}}}class oo extends Ia{constructor(t={}){void 0===t.fontSize&&(t.fontSize=12),void 0===t.renderOrder&&(t.renderOrder=1),super(new ao(t),new Qa(t)),d(this,"name","Text"),d(this,"isText",!0),d(this,"size",new Oi),t.wireframe&&(this.wireframe=!0)}computeBoundingBox(){var t;if(!(null==(t=this.mtl)?void 0:t.text))return this.boundingBox;this.updateMatrixWorld(!0),fa.measureText2(this.mtl.text||"",this.mtl.fontSize,this.size);const e=[];return e.push(-this.size.x/2,-this.size.y/2),e.push(e[0],e[1]+this.size.y),e.push(e[2]+this.size.x,e[3]),e.push(e[3],e[1]),this.geo.setPoints(e),super.computeBoundingBox(),this.boundingBox}buildPath(t,e,i){this.wireframe&&this.geo.buildPath(t)}}class ho{constructor(){d(this,"instancedMesh",!1),d(this,"_xml"),d(this,"_symbolsNodeMap",{}),d(this,"paths",[]),d(this,"labels",[]),d(this,"symbolsMap",{}),d(this,"instances",[]),d(this,"_viewBox",new Ri),d(this,"_isInDefs",!1),d(this,"_transformStack",[]),d(this,"_currentTransform",new Gi),d(this,"centralInitialized",!1),d(this,"centralPoint",new Oi),d(this,"defaultUnit","px"),d(this,"defaultDPI",90),d(this,"stylesheets",{}),d(this,"float2Int",!0),d(this,"scaleFactor",1),d(this,"ASSET_TYPES",[])}static createSVG(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.setAttribute("width",t.toString()),i.setAttribute("height",e.toString()),i}static createSVGPath(t){const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d",t),e}static createSVGText(t,e,i){const n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x",e.toString()),n.setAttribute("y",i.toString()),n.textContent=t,n}static getInstance(){return lo}static setInstancedMesh(t){return this.getInstance().setInstancedMesh(t)}static parse(t,e={}){return this.getInstance().parse(t,e)}static getBoundingBoxByNode(t,e=new Ri){if(e.makeEmpty(),!t)return e;if("text"===t.nodeName){if("function"==typeof t.getBBox){const i=t.getBBox();e.min.set(i.x,i.y),e.max.set(i.x+i.width,i.y+i.height)}const i=t.textContent||"",n=parseInt(t.getAttribute("font-size")||"12");return fa.measureText2(i,n,bo),bo.validate()&&(e.getCenter(_o),e.min.setY(_o.y-bo.y/2),e.max.setY(_o.y+bo.y/2)),this.parseNodeTransform(t,mo),parseInt(t.getAttribute("stroke-width")||"0"),e.applyMatrix3(mo),e}const i=ho.getInstance().parseNode(t);if(!i.length)return e;for(let t=0,n=i.length;t<n;t++)i[t].computeBoundingBox(wo),e.union(wo);return e}static parseNodeTransform(t,e){return ho.getInstance().parseNodeTransform(t,void 0,e)}static getSvgPathDByData(t){if(!t||0===t.length)return"";const e=Array.isArray(t)?t:Array.from(t);let i="",n=0;for(;n<e.length;)switch(e[n++]){case Pn:i+=`M${e[n++]} ${e[n++]}`;break;case Ln:i+=`L${e[n++]} ${e[n++]}`;break;case Rn:i+=`C${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]}`;break;case zn:i+=`Q${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]}`;break;case Un:const t=e[n++],s=e[n++],r=e[n++],a=e[n++],o=e[n++],h=e[n++],l=e[n++],u=e[n++],c=t+Math.cos(o+h)*r,d=s+Math.sin(o+h)*a;i+=`A${r} ${a} ${l} ${Math.abs(h)>Math.PI?1:0} ${u?0:1} ${c} ${d}`;break;case Wn:const p=e[n++],f=e[n++],m=e[n++],y=e[n++];i+=`M${p} ${f} L${p+m} ${f} L${p+m} ${f+y} L${p} ${f+y} Z`;break;case qn:const g=e[n++],v=e[n++],x=e[n++],b=e[n++],_=e[n++],w=e[n++],S=e[n++],M=e[n++],E=g+Math.cos(w)*x,A=v+Math.sin(w)*b,T=g+Math.cos(S)*x,I=v+Math.sin(S)*b;i+=`M${E} ${A} A${x} ${b} ${_} ${Math.abs(S-w)>Math.PI?1:0} ${M?0:1} ${T} ${I}`;break;case Fn:i+="Z"}return i}static getPathProxyBySvgPathD(t,e){return ho.getInstance().getPathProxyBySvgPathD(t,e)}setInstancedMesh(t){return this.instancedMesh=t,this}dispose(){this._xml=void 0,this._symbolsNodeMap={},this.paths=[],this.labels=[],this.symbolsMap={},this.instances=[],this._viewBox.makeEmpty(),this._isInDefs=!1,this._transformStack=[],this._currentTransform.identity(),this.centralPoint.identity(),this.centralInitialized=!1,this.stylesheets={},this.ASSET_TYPES=[]}parse(t,e={}){var i;this.dispose();const n=(new DOMParser).parseFromString(t,"image/svg+xml");this._xml=n.documentElement,function(t,e=new Ri){if(!t)return e;let i=t.split(" "),n=mi.map(i,(t=>parseFloat(t)));4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3]))}((null==(i=this._xml)?void 0:i.getAttribute("viewBox"))||"",this._viewBox),this._viewBox.getCenter(this.centralPoint);const s=ln(this._xml),r=function(t,e=[]){return e.length=0,un(t||[],(t=>{var i;if("assets"===t.label&&(null==(i=t.children)?void 0:i.length))for(let i,n=0,s=t.children.length;n<s;n++)i=t.children[n],i.label&&e.push(mi.head(mi.split(i.label,"-"))||"")})),e=mi.uniq(mi.compact(e))}(s);this.ASSET_TYPES=mi.uniq(mi.compact([...r,...Object.values(dn)])),this.parseNode(this._xml,e,this.paths);const a={xml:this._xml,viewBox:this._viewBox.clone(),idsTree:s,assetTypes:r,paths:this.paths,labels:this.labels};return this.instancedMesh&&(a.symbolsMap=this.symbolsMap,a.instances=this.instances),a}getViewBox(t,e=new Ri){let i=((null==t?void 0:t.getAttribute("viewBox"))||"").split(" "),n=mi.map(i,(t=>parseFloat(t)));return 4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3])),e}parseNode(t,e={},i=[],n,s){var r,a,o;if(1!==t.nodeType)return i;let h=!1;const l="function"==typeof t.getAttribute?t.getAttribute("id"):null,u=this.getNodeTransform(t,e);let c;const d=(t={},e,i)=>{if(!t)return;const s=(null==i?void 0:i.assetType)||this.getAssetType(e),r=(null==i?void 0:i.layerType)||this.getAssetType(e,"layer");return mi.set(t,"userData",{pid:n,id:l||n,nodeName:e.nodeName,layerType:r,assetType:s,style:Object.assign({},i)}),t};switch(t.nodeName){case"svg":case"g":e=this.parseStyle(t,e);break;case"defs":h=!0,this._isInDefs=!0;break;case"style":this.parseCSSStylesheetByTextContent(t);break;case"symbol":if(!l||!this._isInDefs&&this.symbolsMap[l]){if(!this._isInDefs&&l){const t=this.symbolsMap[l],e=(null==t?void 0:t.paths)||[];for(let n=0,s=(null==e?void 0:e.length)||0;n<s;n++)c=e[n],c&&(c=c.clone(),mi.set(c,"userData",Object.assign({},t.userData)),this.transformPath(c,this._currentTransform),i.push(c));return u&&(this._transformStack.pop(),this._transformStack.length>0?this._currentTransform.copy(this._transformStack[this._transformStack.length-1]):this._currentTransform.identity()),i}}else e=this.parseStyle(t,e),this._symbolsNodeMap[l]=t,mi.set(this.symbolsMap,`[${l}].symbolId`,l),mi.set(this.symbolsMap,`[${l}].style`,e);break;case"use":const p=(t.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),f=this._symbolsNodeMap[p],m=this.symbolsMap[p];if(f&&(e=this.parseStyle(f,e)),void 0===(e=this.parseStyle(t,e)).assetType&&(e.assetType=this.getAssetType(t)),void 0===e.layerType&&(e.layerType=this.getAssetType(t,"layer")),!this._isInDefs&&this.instancedMesh&&m){const i={symbolId:p,transform:this._currentTransform.clone(),userData:{}};d(i,t,e),this.instances.push(i)}else f&&(d(m,t,e),this.parseNode(f,e,i,l||n,s));break;case"path":e=this.parseStyle(t,e),t.hasAttribute("d")&&(c=this.parsePathNode(t,s));break;case"rect":e=this.parseStyle(t,e),c=this.parseRectNode(t,s);break;case"polygon":e=this.parseStyle(t,e),c=this.parsePolygonNode(t,s);break;case"polyline":e=this.parseStyle(t,e),c=this.parsePolylineNode(t,s);break;case"circle":e=this.parseStyle(t,e),c=this.parseCircleNode(t,s);break;case"ellipse":e=this.parseStyle(t,e),c=this.parseEllipseNode(t,s);break;case"line":e=this.parseStyle(t,e),c=this.parseLineNode(t,s);break;case"text":e=this.parseStyle(t,e);const y=this.parseTextNode(t,e,s);if(!y)return i;d(y,t,e),n||mi.set(y,"userData.pid",this.getId(t)),mi.set(y,"userData.textContent",t.textContent),mi.set(y,"transform",this._currentTransform.clone()),mi.set(y,"userData.id",mi.get(y,"userData.id")),mi.set(y,"userData.pid",this.getParentId(t,n));const g=this.getLabelAssetId(t);if(g?mi.set(y,"userData.aid",g):mi.set(y,"userData.aid",mi.split((null==(r=null==y?void 0:y.userData)?void 0:r.id)||"","-").splice(2).join("-")),this._isInDefs&&this.symbolsMap[null==(a=y.userData)?void 0:a.pid]){const t=y.userData.pid,e=(null==(o=this.symbolsMap[t])?void 0:o.labels)||[];e.push(y),mi.set(this.symbolsMap,`[${t}].labels`,e)}else this.labels.push(y)}c&&(d(c,t,e),this.transformPath(c,this._currentTransform),i.push(c));const p=t.childNodes;for(let t,n=0,r=p.length;n<r;n++)if(t=p[n],!h||"style"===t.nodeName||"symbol"===t.nodeName)if(this._isInDefs&&"symbol"===t.nodeName){const i=t.getAttribute("id");if(i){const n=this.parseNode(t,e);mi.set(this.symbolsMap,`[${i}].paths`,n)}}else this.parseNode(t,e,i,l,s);return u&&(this._transformStack.pop(),this._transformStack.length>0?this._currentTransform.copy(this._transformStack[this._transformStack.length-1]):this._currentTransform.identity()),h&&(this._isInDefs=!1),i}transformPath(t,e){t.applyMatrix3(e)}getNodeTransform(t,e){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))||"text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))))return null;const i=this.parseNodeTransform(t,e);return this._transformStack.length>0&&i.premultiply(this._transformStack[this._transformStack.length-1]),this._currentTransform.copy(i),this._transformStack.push(i),i}parseNodeTransform(t,e,i=new Gi){var n;i.identity(),this.centralInitialized&&(i.translate(-this.centralPoint.x,-this.centralPoint.y),this.centralInitialized=!0);const s=yo;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){const e=this.parseFloatWithUnits(t.getAttribute("x")),n=this.parseFloatWithUnits(t.getAttribute("y"));i.translate(e,n)}else if("text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))){const n=t.hasAttribute("dx")?this.parseFloatWithUnits(t.getAttribute("dx")||0,{fontSize:null==e?void 0:e.fontSize}):0,s=t.hasAttribute("dy")?this.parseFloatWithUnits(t.getAttribute("dy")||0,{fontSize:null==e?void 0:e.fontSize}):0;i.translate(n,s)}if(t.hasAttribute("transform")){const e=null==(n=t.getAttribute("transform"))?void 0:n.split(")");if(!(null==e?void 0:e.length))return i;for(let t=((null==e?void 0:e.length)||0)-1;t>=0;t--){const n=e[t].trim();if(""===n)continue;const r=n.indexOf("("),a=n.length;if(r>0&&r<a){const t=n.slice(0,r),e=this.parseFloats(n.slice(r+1));switch(s.identity(),t){case"translate":if(e.length>=1){const t=e[0];let i=0;e.length>=2&&(i=e[1]),s.translate(t,i)}break;case"rotate":if(e.length>=1){let t=0,i=0,n=0;t=e[0]*Math.PI/180,e.length>=3&&(i=e[1],n=e[2]),go.makeTranslation(-i,-n),vo.makeRotation(t),xo.multiplyMatrices(vo,go),go.makeTranslation(i,n),s.multiplyMatrices(go,xo)}break;case"scale":if(e.length>=1){const t=e[0];let i=t;e.length>=2&&(i=e[1]),s.scale(t,i)}break;case"skewX":1===e.length&&s.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&s.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&s.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}i.premultiply(s)}}return i}parseStyle(t,e){var i;e=Object.assign({},e);let n={};if(t.hasAttribute("class")){const e=null==(i=t.getAttribute("class"))?void 0:i.split(/\s/).filter(Boolean).map((t=>t.trim())).map((t=>t.startsWith(".")?t.substring(1):t));for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++)n=Object.assign(n,this.stylesheets["."+e[t]])}function s(i,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(i)&&(e[s]=r(t.getAttribute(i))),n[i]&&(e[s]=r(n[i])),t.style&&""!==t.style[i]&&(e[s]=r(t.style[i]))}t.hasAttribute("id")&&(n=Object.assign(n,this.stylesheets["#"+t.getAttribute("id")]));const{fontSize:r,strokeWidth:a}=e,o=this;function h(t){return Math.max(0,Math.min(1,o.parseFloatWithUnits(t)))}function l(t){return Math.max(0,o.parseFloatWithUnits(t,{fontSize:r}))}s("font-size","fontSize",l),s("fill","fill"),s("fill-opacity","fillOpacity",h),s("fill-rule","fillRule"),s("opacity","opacity",h),s("stroke","stroke"),s("stroke-opacity","strokeOpacity",h),s("stroke-width","strokeWidth",(function(t){return Math.max(0,o.parseFloatWithUnits(t,{strokeWidth:a,noDef:!0}))})),s("stroke-linejoin","strokeLineJoin"),s("stroke-linecap","strokeLineCap"),s("stroke-miterlimit","strokeMiterLimit",l),s("visibility","visibility");const u=t.getAttribute("stroke-width")||e.strokeWidth;return mi.endsWith(u,"%")&&(e.thinLine=!0),"none"!==e.fill&&"transparent"!==e.fill||delete e.fill,"none"!==e.stroke&&"transparent"!==e.stroke||delete e.stroke,e}parseCSSStylesheetByTextContent(t){const e=t.textContent.replace(/\/\*[\s\S]*?\*\//g,"").replace(/([^;])}/g,"$1;}"),i=[];let n="",s=0;for(const t of e)"{"===t?s++:"}"===t&&s--,n+=t,"}"===t&&0===s&&(i.push(n.trim()),n="");for(const t of i){if(!t.includes("{"))continue;const[e,i]=t.split(/\s*\{\s*/);if(!e||!i)continue;const n=e.split(",").map((t=>t.trim())).filter(Boolean),s={};i.replace(/}\s*$/,"").split(";").map((t=>t.trim())).filter(Boolean).forEach((t=>{const[e,i]=t.split(/:\s*/);if(e&&i){const t=i.replace(/\s*!important\s*$/,"").trim();s[e.trim()]=t}})),n.forEach((t=>{t&&(this.stylesheets[t]=u(u({},this.stylesheets[t]||{}),s))}))}}parsePathNode(t,e=!1){const i=t.getAttribute("d");if(i&&""!==i&&"none"!==i)return this.getPathProxyBySvgPathD(i,void 0,e)}getPathProxyBySvgPathD(t,e=new Qr,i=!1){if(!t)return;const n=new Oi,s=new Oi,r=new Oi;let a=!0,o=!1;const h=t.match(/[a-df-z][^a-df-z]*/gi);if(null==h?void 0:h.length){for(let t=0,l=(null==h?void 0:h.length)||0;t<l;t++){const l=h[t],u=l.charAt(0),c=l.slice(1).trim();let d;switch(!0===a&&(o=!0,a=!1),u){case"M":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x=i?d[t]:this.normalizeX(d[t]),n.y=i?d[t+1]:this.normalizeY(d[t+1]),s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&r.copy(n);break;case"H":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.x=i?d[t]:this.normalizeX(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"V":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.y=i?d[t]:this.normalizeY(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"L":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x=i?d[t]:this.normalizeX(d[t]),n.y=i?d[t+1]:this.normalizeY(d[t+1]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"C":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=6)t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3]),this.normalizeX(d[a+4]),this.normalizeY(d[a+5])],e.bezierCurveTo(...t),s.x=t[2],s.y=t[3],n.x=t[4],n.y=t[5],0===a&&!0===o&&r.copy(n);break;case"S":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3])],e.bezierCurveTo(this.getReflection(n.x,s.x),this.getReflection(n.y,s.y),t[0],t[1],t[2],t[3]),s.x=t[0],s.y=t[1],n.x=t[2],n.y=t[3],0===a&&!0===o&&r.copy(n);break;case"Q":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3])],e.quadraticCurveTo(t[0],t[1],t[2],t[3]),s.x=t[0],s.y=t[1],n.x=t[2],n.y=t[3],0===a&&!0===o&&r.copy(n);break;case"T":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=2){const h=this.getReflection(n.x,s.x),l=this.getReflection(n.y,s.y);t=i?[d[a],d[a+1]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1])],e.quadraticCurveTo(h,l,t[0],t[1]),s.x=h,s.y=l,n.x=t[0],n.y=t[1],0===a&&!0===o&&r.copy(n)}break;case"A":d=this.parseFloats(c,[3,4],7);for(let t,a=0,h=d.length;a<h;a+=7){if(t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5],d[a+6]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),d[a+2],d[a+3],d[a+4],this.normalizeW(d[a+5]),this.normalizeH(d[a+6])],t[5]==n.x&&t[6]==n.y)continue;const h=n.clone();n.x=t[5],n.y=t[6],s.x=n.x,s.y=n.y,this.parseArcCommand(e,t[a],t[1],t[2],t[3],t[4],h,n),0===a&&!0===o&&r.copy(n)}break;case"m":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x+=i?d[t]:this.normalizeW(d[t]),n.y+=i?d[t+1]:this.normalizeH(d[t+1]),s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&r.copy(n);break;case"h":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.x+=i?d[t]:this.normalizeW(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"v":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.y+=i?d[t]:this.normalizeH(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"l":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x+=i?d[t]:this.normalizeW(d[t]),n.y+=i?d[t+1]:this.normalizeH(d[t+1]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"c":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=6)t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3]),this.normalizeW(d[a+4]),this.normalizeH(d[a+5])],e.bezierCurveTo(n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3],n.x+t[4],n.y+t[5]),s.x=n.x+t[2],s.y=n.y+t[3],n.x+=t[4],n.y+=t[5],0===a&&!0===o&&r.copy(n);break;case"s":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3])],e.bezierCurveTo(this.getReflection(n.x,s.x),this.getReflection(n.y,s.y),n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3]),s.x=n.x+t[0],s.y=n.y+t[1],n.x+=t[2],n.y+=t[3],0===a&&!0===o&&r.copy(n);break;case"q":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3])],e.quadraticCurveTo(n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3]),s.x=n.x+t[0],s.y=n.y+t[1],n.x+=t[2],n.y+=t[3],0===a&&!0===o&&r.copy(n);break;case"t":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=2){const h=this.getReflection(n.x,s.x),l=this.getReflection(n.y,s.y);t=i?[d[a],d[a+1]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1])],e.quadraticCurveTo(h,l,n.x+t[0],n.y+t[1]),s.x=h,s.y=l,n.x=n.x+t[0],n.y=n.y+t[1],0===a&&!0===o&&r.copy(n)}break;case"a":d=this.parseFloats(c,[3,4],7);for(let t,a=0,h=d.length;a<h;a+=7){if(t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5],d[a+6]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),d[a+2],d[a+3],d[a+4],this.normalizeW(d[a+5]),this.normalizeH(d[a+6])],0==t[5]&&0==t[6])continue;const h=n.clone();n.x+=t[5],n.y+=t[6],s.x=n.x,s.y=n.y,this.parseArcCommand(e,t[0],t[1],t[2],t[3],t[4],h,n),0===a&&!0===o&&r.copy(n)}break;case"Z":case"z":e.closePath()}o=!1}return e}}parseArcCommand(t,e,i,n,s,r,a,o){if(0==e||0==i)return void t.lineTo(o.x,o.y);n=n*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const h=(a.x-o.x)/2,l=(a.y-o.y)/2,u=Math.cos(n)*h+Math.sin(n)*l,c=-Math.sin(n)*h+Math.cos(n)*l;let d=e*e,p=i*i;const f=u*u,m=c*c,y=f/d+m/p;if(y>1){const t=Math.sqrt(y);d=(e*=t)*e,p=(i*=t)*i}const g=d*m+p*f,v=(d*p-g)/g;let x=Math.sqrt(Math.max(0,v));s===r&&(x=-x);const b=x*e*c/i,_=-x*i*u/e,w=Math.cos(n)*b-Math.sin(n)*_+(a.x+o.x)/2,S=Math.sin(n)*b+Math.cos(n)*_+(a.y+o.y)/2,M=this.svgAngle(1,0,(u-b)/e,(c-_)/i),E=this.svgAngle((u-b)/e,(c-_)/i,(-u-b)/e,(-c-_)/i)%(2*Math.PI);t.absellipse(w,S,e,i,n,M,M+E,0===r)}svgAngle(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}parseRectNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("x")||0),n=this.parseFloatWithUnits(t.getAttribute("y")||0),s=this.parseFloatWithUnits(t.getAttribute("rx")||t.getAttribute("ry")||0),r=this.parseFloatWithUnits(t.getAttribute("ry")||t.getAttribute("rx")||0),a=this.parseFloatWithUnits(t.getAttribute("width")),o=this.parseFloatWithUnits(t.getAttribute("height"));e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s),r=this.normalizeH(r),a=this.normalizeW(a),o=this.normalizeH(o));const h=.448084975506,l=new Qr;return l.moveTo(i+s,n),l.lineTo(i+a-s,n),0===s&&0===r||l.bezierCurveTo(i+a-s*h,n,i+a,n+r*h,i+a,n+r),l.lineTo(i+a,n+o-r),0===s&&0===r||l.bezierCurveTo(i+a,n+o-r*h,i+a-s*h,n+o,i+a-s,n+o),l.lineTo(i+s,n+o),0===s&&0===r||l.bezierCurveTo(i+s*h,n+o,i,n+o-r*h,i,n+o-r),l.lineTo(i,n+r),0===s&&0===r||l.bezierCurveTo(i,n+r*h,i+s*h,n,i+s,n),l}parsePolygonNode(t,e=!1){var i;const n=this,s=new Qr;let r=0;return null==(i=t.getAttribute("points"))||i.replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,i,a){const o=e?n.parseFloatWithUnits(i):n.normalizeX(n.parseFloatWithUnits(i)),h=e?n.parseFloatWithUnits(a):n.normalizeY(n.parseFloatWithUnits(a));return 0===r?s.moveTo(o,h):s.lineTo(o,h),r++,t})),s.autoClose=!0,s}parsePolylineNode(t,e=!1){var i;const n=this,s=new Qr;let r=0;return null==(i=t.getAttribute("points"))||i.replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,i,a){const o=e?n.parseFloatWithUnits(i):n.normalizeX(n.parseFloatWithUnits(i)),h=e?n.parseFloatWithUnits(a):n.normalizeY(n.parseFloatWithUnits(a));return 0===r?s.moveTo(o,h):s.lineTo(o,h),r++,t})),s.autoClose=!1,s}parseCircleNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("cx")||0),n=this.parseFloatWithUnits(t.getAttribute("cy")||0),s=this.parseFloatWithUnits(t.getAttribute("r")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s));const r=new Qr;return r.absarc(i,n,s,0,2*Math.PI),r}parseEllipseNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("cx")||0),n=this.parseFloatWithUnits(t.getAttribute("cy")||0),s=this.parseFloatWithUnits(t.getAttribute("rx")||0),r=this.parseFloatWithUnits(t.getAttribute("ry")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s),r=this.normalizeH(r));const a=new Qr;return a.absellipse(i,n,s,r,0,0,2*Math.PI,!1),a}parseLineNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("x1")||0),n=this.parseFloatWithUnits(t.getAttribute("y1")||0),s=this.parseFloatWithUnits(t.getAttribute("x2")||0),r=this.parseFloatWithUnits(t.getAttribute("y2")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeX(s),r=this.normalizeY(r));const a=new Qr;return a.moveTo(i,n),a.lineTo(s,r),a}parseTextNode(t,e,i=!1){let n=parseFloat(t.getAttribute("x")||"0"),s=parseFloat(t.getAttribute("y")||"0");i||(n=this.normalizeX(n),s=this.normalizeY(s));const r=t.textContent;if(!r||!e.fontSize)return;const a=Object.assign({},e);return a.fill=t.getAttribute("fill")||e.fill||"#000",a.fontSize=parseFloat(t.getAttribute("font-size")||"0")||parseFloat(e.fontSize)||72,a.fontFamily=t.getAttribute("font-family")||e.fontFamily||"Arial",{textContent:r,style:a,userData:{}}}parseFloatWithUnits(t,e){let i,n="px";if("string"==typeof t||t instanceof String){t=null==t?void 0:t.trim();for(let e=0,i=uo.length;e<i;e++){const i=uo[e];if(t.endsWith(i)){n=i,t=t.substring(0,t.length-i.length);break}}}if("px"===n&&"px"!==this.defaultUnit)i=co.in[this.defaultUnit]/this.defaultDPI;else if("%"===n){this._viewBox.getSize(bo),xo.copy(this._currentTransform).getScale(_o);const t=Math.abs(_o.x||1);i=bo.x/100*t}else"em"===n?i=(null==e?void 0:e.fontSize)||po:(i=co[n][this.defaultUnit],i<0&&(i=co[n].in*this.defaultDPI));return i*parseFloat(t)}getReflection(t,e){return t-(e-t)}parseFloats(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%(i||0))&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}normalizeX(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeY(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeW(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeH(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}getAssetType(t,e="asset"){let i;const n="function"==typeof t.getAttribute?t.getAttribute("id"):"";if(!n&&t.parentNode)return this.getAssetType(t.parentNode,e);if(!n)return i;if("layer"===e)i=fo.find((t=>n===t));else{const t=null==n?void 0:n.replace(/-assets/g,"");i=this.ASSET_TYPES.find((e=>t===e))}return!i&&t.parentNode&&(i=this.getAssetType(t.parentNode,e)),i}getId(t){let e;const i="function"==typeof t.getAttribute?t.getAttribute("id"):"";return e=!i&&t.parentNode?this.getId(t.parentNode):i,e}getParentId(t,e){let i;const n=this.getId(t);return i=t.parentNode&&this.getId(t.parentNode),i&&n!==e||(i=this.getParentId(t.parentNode,e)),i||n||""}getLabelAssetId(t){let e;return this.getId(t),e="function"==typeof t.getAttribute?t.getAttribute("aid"):"",!e&&t.parentNode&&(e=this.getLabelAssetId(t.parentNode)),e}}const lo=new ho,uo=["mm","cm","in","pt","pc","px","em","%"],co={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1},"%":{"%":1,px:-1}},po=16,fo=Object.values(fn),mo=new Gi,yo=new Gi,go=new Gi,vo=new Gi,xo=new Gi,bo=new Oi,_o=new Oi,wo=new Ri;class So{static getPathProxyByNode(t){if(t)return ho.getInstance().parseNode(t)}static mergeGeoShapes(t,e){var i,n,s;if(!(null==t?void 0:t.length))throw new Error("empty geos");const r={cmds:mi.flatMap(t,(t=>t.cmds||[]))};return(null==(i=t[0])?void 0:i.lineWidth)&&(r.lineWidth=t[0].lineWidth),(null==(n=t[0])?void 0:n.thinLine)&&(r.thinLine=t[0].thinLine),(null==(s=t[0])?void 0:s.closed)&&(r.closed=t[0].closed),new va(r)}static getArrowByPathProxy(t,e={},i=new Qr){i.dispose();const{arrowType:n=0,arrowLength:s=10,arrowDeg:r=30}=e||{};if(!t||!n)return i;const a=t.getVertices();if(!(null==a?void 0:a.length)||a.length<4)return i;if(n>0){if(Ao.set(a[2],a[3]),Io.set(a[0],a[1]),Ao.equals(Io))return i;To.subVectors(Ao,Io),Co.lerpVectors(Io,Ao,s/To.length()),Do.copy(Co).rotateAround(Io,Bi(r)),No.copy(Co).rotateAround(Io,-Bi(r))}else{const t=a.length;if(Ao.set(a[t-4],a[t-3]),Io.set(a[t-2],a[t-1]),Ao.equals(Io))return i;To.subVectors(Ao,Io),Co.lerpVectors(Io,Ao,s/To.length()),Do.copy(Co).rotateAround(Io,Bi(r)),No.copy(Co).rotateAround(Io,-Bi(r))}return Co.lerpVectors(Io,Co,.6),Eo.subVectors(Io,Co),Mo.makeTranslation(Eo.x,Eo.y),Io.applyMatrix3(Mo),Co.applyMatrix3(Mo),Do.applyMatrix3(Mo),No.applyMatrix3(Mo),i.moveTo(Co.x,Co.y),i.lineTo(Do.x,Do.y),i.lineTo(Io.x,Io.y),i.lineTo(No.x,No.y),i.lineTo(Co.x,Co.y),i}}const Mo=new Gi,Eo=new Oi,Ao=new Oi,To=new Oi,Io=new Oi,Co=new Oi,Do=new Oi,No=new Oi;class Bo extends ya{constructor(t){super(t),this._init(t)}buildPath(t,e,i){let n,s,r,a,o,{x:h=0,y:l=0,w:u=0,h:c=0,r:d=0}=e||this;u<0&&(h+=u,u=-u),c<0&&(l+=c,c=-c),"number"==typeof d?n=s=r=a=d:d instanceof Array?1===d.length?n=s=r=a=d[0]:2===d.length?(n=r=d[0],s=a=d[1]):3===d.length?(n=d[0],s=a=d[1],r=d[2]):(n=d[0],s=d[1],r=d[2],a=d[3]):n=s=r=a=0,n+s>u&&(o=n+s,n*=u/o,s*=u/o),r+a>u&&(o=r+a,r*=u/o,a*=u/o),s+r>c&&(o=s+r,s*=c/o,r*=c/o),n+a>c&&(o=n+a,n*=c/o,a*=c/o),t.moveTo(h+n,l),t.lineTo(h+u-s,l),0!==s&&t.arc(h+u-s,l+s,s,-Math.PI/2,0),t.lineTo(h+u,l+c-r),0!==r&&t.arc(h+u-r,l+c-r,r,0,Math.PI/2),t.lineTo(h+a,l+c),0!==a&&t.arc(h+a,l+c-a,a,Math.PI/2,Math.PI),t.lineTo(h,l+n),0!==n&&t.arc(h+n,l+n,n,Math.PI,1.5*Math.PI)}}class ko extends Ia{constructor(t,e=new Aa,i){super(new Bo({x:0,y:0,width:1,height:1}),e,i),d(this,"name","SkinnedShape"),this.boundingBox.copy(t),this.geo.lineWidth=e.lineWidth,this.geo.thinLine=!0,Oo.copy(this.boundingBox),Po.copy(Oo.min),Oo.getSize(Lo),this.geo.x=Po.x,this.geo.y=Po.y,this.geo.w=Lo.x,this.geo.h=Lo.y}computeBoundingBox(){return this.boundingBox}}const Oo=new Ri,Po=new Oi,Lo=new Oi;class Ro extends hi{constructor(t={}){super(),d(this,"type","Object2"),d(this,"position",new Oi),d(this,"rotation",new Oi),d(this,"scaled",new Oi(1,1)),d(this,"flipY",!1),d(this,"matrix",new Gi),d(this,"matrixAutoUpdate",!1),void 0!==t.flipY&&(this.flipY=t.flipY),this.flipY&&this.setScale(1,-1)}setPosition(t){return this.position.set(t.x,t.y),this}setRotation(t){return this.rotation.set(t,t),this}setScale(t,e){return this.scaled.set(t,e),this}translate(t,e){return this.position.x+=t,this.position.y+=e,this}rotate(t){return this.rotation.x+=t,this}scale(t,e){return e?(this.scaled.x*=t,this.scaled.y*=e):this.scaled.multiplyScalar(t),this}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){this.matrix.compose(this.position,this.rotation,this.scaled)}copy(t){return this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.matrix.copy(t.matrix),this.matrixAutoUpdate=t.matrixAutoUpdate,this}}class zo extends Ro{constructor(t={}){void 0===t.flipY&&(t.flipY=!0),super(t),d(this,"isTexture",!0),d(this,"type","Texture"),d(this,"params"),d(this,"uuid",_n()),d(this,"image"),d(this,"userData",{}),this.params=t}destroy(){}dispose(){}clone(){return new this.constructor(this.params).copy(this)}copy(t){return super.copy(t),this.uuid=_n(),this.image=t.image,this.userData=mi.cloneDeep(t.userData),this}}class Uo{constructor(t,e){d(this,"bindingStates"),this.ctx=t,this.bindingStates=e}destroy(){}setCtx(t){return this.ctx=t,this}render(t){var e,i,n;if(this.ctx&&(Fo=this.ctx,Fo.save(),t.isText?this.renderText(Fo,t):t.isShape&&(Fo.beginPath(),this.setCtxTransform(Fo,t),this.bindingStyle(Fo,t),this.renderShape(Fo,t),this.renderLineDash(Fo,t)),t.isShape&&(null==(i=null==(e=t.mtl)?void 0:e.map)?void 0:i.image)&&this.renderShapeTexture(Fo,t),Fo.restore(),t.composeNode&&(null==(n=t.children)?void 0:n.length)))for(let e,i=0,n=t.children.length;i<n;i++)e=t.children[i],e.isShape&&this.render(e)}renderFill(t){var e;t.mtl.fill&&(null==(e=this.ctx)||e.fill())}renderStroke(t){var e;t.mtl.stroke&&(null==(e=this.ctx)||e.stroke())}renderText(t,e){if(!t)return;const{text:i,fill:n,stroke:s,fontSize:r,fontFamily:a,fontWeight:o,textAlign:h,textBaseline:l}=e.mtl;if(!i)return;e.modelViewMatrix.decompose(qo,Ho,Vo);const u=(r||12)*Vo.x;t.font=`${o} ${u}px ${a}`,t.fillStyle=n||Ha,h&&(t.textAlign=h),l&&(t.textBaseline=l);let c=qo.y;if("middle"===l){const e=t.measureText(i);c+=(e.actualBoundingBoxAscent-e.actualBoundingBoxDescent)/2}t.fillText(i,qo.x,c)}renderWireFrame(t){this.ctx&&(Go.copy(t.boundingBox).applyMatrix3(t.modelViewMatrix).getSize(Zo),Xo.copy(Go.min),this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=1,this.ctx.strokeStyle=La,this.ctx.setLineDash([5,10]),this.ctx.strokeRect(Xo.x,Xo.y,Zo.x,Zo.y),this.ctx.stroke(),this.ctx.restore())}renderMerged(t){this.ctx&&(Fo=this.ctx,Fo.save(),t.isShape&&(Fo.beginPath(),this.setCtxTransform(Fo,t),this.bindingStyle(Fo,t),this.renderShape(Fo,t)),Fo.restore())}setCtxTransform(t,e){const i=Wo.equals(e.modelViewMatrix);Wo.copy(e.modelViewMatrix),i||Wo.getComponents(jo),t.transform(...jo)}bindingStyle(t,e){if(e.mtl.fill){let i;i=e.mtl.fill.isColor?e.mtl.fill.getHexString():e.mtl.fill,void 0!==e.mtl.fillOpacity&&(t.globalAlpha=e.mtl.fillOpacity),i&&(t.fillStyle=i)}if(e.mtl.stroke){if(e.geo.thinLine){const e=Math.sqrt(jo[0]*jo[0]+jo[1]*jo[1]);t.lineWidth=Math.abs(1/e)}else e.geo.lineWidth?t.lineWidth=e.geo.lineWidth:t.lineWidth=1;let i;e.mtl.lineCap&&(t.lineCap=e.mtl.lineCap),e.mtl.lineJoin&&(t.lineJoin=e.mtl.lineJoin),void 0!==e.mtl.strokeOpacity&&(t.globalAlpha=e.mtl.strokeOpacity),i=e.mtl.stroke.isColor?e.mtl.stroke.getHexString():e.mtl.stroke,i&&(t.strokeStyle=i)}}renderShape(t,e){e.buildPath(t),e.geo.closed&&t.closePath(),this.renderFill(e),this.renderStroke(e)}renderLineDash(t,e){if(e.mtl.stroke&&e.mtl.lineDash&&void 0!==e.mtl.lineDashOffset){if(t.beginPath(),e.buildPath(t),e.geo.thinLine){const e=Math.sqrt(jo[0]*jo[0]+jo[1]*jo[1]);t.lineWidth=Math.abs(1/e)}else e.geo.lineWidth?t.lineWidth=e.geo.lineWidth:t.lineWidth=1;t.strokeStyle=Wa,t.setLineDash(e.mtl.lineDash),t.lineDashOffset=e.mtl.lineDashOffset,t.globalAlpha=1,t.stroke()}}renderShapeTexture(t,e){var i,n,s,r,a,o,h,l;(null==(n=null==(i=null==e?void 0:e.mtl)?void 0:i.map)?void 0:n.image)&&(!(null==(a=null==(r=null==(s=null==e?void 0:e.mtl)?void 0:s.map)?void 0:r.image)?void 0:a.width)||null==(l=null==(h=null==(o=null==e?void 0:e.mtl)?void 0:o.map)?void 0:h.image)||l.height,e.mtl.map.matrix.getComponents(Yo),t.transform(...Yo),t.drawImage(e.mtl.map.image,0,0))}}let Fo;const Wo=new Gi,qo=new Oi,Ho=new Oi,Vo=new Oi,jo=[1,0,0,1,0,0],Yo=[1,0,0,1,0,0],Go=new Ri,Xo=new Oi,Zo=new Oi,$o=class t{constructor(){d(this,"cache",new Map),d(this,"maxSize",2048),d(this,"renderer",new Uo),d(this,"_scaled",new Oi(1,1))}dispose(){this.clear()}static getInstance(){return Jo||(Jo=new t),Jo}static set(t,e){this.getInstance().set(t,e)}static clear(){this.getInstance().clear()}scale(t=1,e=1){return t||e?(this._scaled.set(t,e),this):this}has(t){return this.cache.has(t)}set(t,e){if(!t||!e)throw new Error("error input");this.cache.set(t,e)}get(t){if(!t)throw new Error("error input");return this.cache.get(t)}clear(){Object.values(this.cache).forEach((t=>t.destroy())),this._scaled.identity(),this.cache=new Map,function(){var t;const e=ph();if(null==(t=null==e?void 0:e.children)?void 0:t.length)for(let t=e.children.length-1;t>=0;t--)e.removeChild(e.children[t])}()}calculateMipLevel(t){return t>=1?0:t>=.5?1:t>=.25?2:3}setByShape(t,e,i,n){const s=this.getTextureByShape(e,i,n);return e.userData.textureKey=s.userData.textureKey=t,this.renderShapeTexture(e,s),this.set(t,s),s}getTextureByShape(t,e,i,n){const s=new zo;if(t.boundingBox.isEmpty())throw new Error("get boundingBox error");th.identity(),eh.identity(),e&&!(null==e?void 0:e.isEmpty())?hh.copy(e):hh.copy(t.boundingBox),hh.getSize(th),hh.getCenter(eh),i&&!i.isEmpty()?i.getSize(ih):ih.copy(th),(ih.x<Ko.x||ih.y<Ko.y)&&ih.normalize().multiplyScalar(200),ih.x<1&&(ih.x=1),ih.y<1&&(ih.y=1),sh.set(Jr.config.width,Jr.config.height);const r=ih.length()/sh.length();r>1&&ih.multiplyScalar(1/r);const a=ih.length()/th.length();return lh.copy(th).multiplyScalar(-.5).add(eh).multiplyScalar(a).negate(),uh.identity(),ch.set(a,a),rh.compose(lh,uh,ch),nh.copy(th).multiplyScalar(-.5).add(eh),s.position.copy(nh),s.rotation.copy(uh),s.scaled.multiplyScalar(1/ch.x,1/ch.y),s.updateMatrix(),s}renderShapeTexture(t,e,i){var n;const s=fa.create(ih.x,ih.y),r=fa.getContext2D(s,{alpha:!0});r.clearRect(0,0,s.width,s.height),r.beginPath(),r.strokeStyle=Ra,r.lineWidth=1,r.strokeRect(0,0,s.width,s.height),r.closePath(),this._transform(r,t),this._bindStyle(r,t),t.buildPath(r),this._fill(r,t),this._stroke(r,t),null==(n=t.children)||n.forEach((t=>{t.isShape&&(this._bindStyle(r,t),t.buildPath(r),this._fill(r,t),this._stroke(r,t),t.isText&&this._renderText(r,t))})),e.image=s}_transform(t,e){rh.getComponents(dh),t.transform(...dh)}_bindStyle(t,e){var i,n,s;t.beginPath();const{fill:r,stroke:a}=(null==(i=e.userData)?void 0:i.style)||{};if(r&&(t.fillStyle=r),a){let i=e.mtl.lineWidth;i||(i=1/Math.min(Math.abs(this._scaled.x),Math.abs(this._scaled.y))),t.lineWidth=i,t.strokeStyle=(null==(s=null==(n=e.userData)?void 0:n.style)?void 0:s.stroke)||Ha}}_fill(t,e){var i,n;(null==(n=null==(i=e.userData)?void 0:i.style)?void 0:n.fill)&&t.fill()}_stroke(t,e){var i,n;(null==(n=null==(i=e.userData)?void 0:i.style)?void 0:n.stroke)&&t.stroke()}_renderText(t,e){const{text:i,fill:n,stroke:s,fontSize:r,fontFamily:a,fontWeight:o,textAlign:h,textBaseline:l}=e.mtl;if(!i)return;ah.set,oh.copy(e.matrix).decompose(lh,uh,ch);const u=(r||12)*ch.x;t.font=`${o} ${u}px ${a}`,h&&(t.textAlign=h),l&&(t.textBaseline=l);let c=lh.y;s?(t.strokeStyle=s,t.lineWidth=1*Math.abs(1/dh[0]),t.strokeText(i,lh.x,c)):(t.fillStyle=n||Ha,t.fillText(i,lh.x,c))}};d($o,"DEBUG_DisplayCachedTexture",mi.throttle(((t=80,e=.8)=>{const i=Jo;if(!i)return;let n=ph();if(n||(n=function(t=80,e=.8){const i=document.createElement("div");function n(){i.style.opacity="1"}function s(){i.style.opacity=e.toString()}return i.setAttribute("id","DEBUG_Displaycached"),i.style.position="absolute",i.style.width=t+"px",i.style.height="92vh",i.style.background=`rgba(255, 255, 255, ${e})`,i.style.left="20px",i.style.top="20px",i.style.overflow="auto",i.style.padding="6px",i.style.opacity=e.toString(),i.addEventListener("mouseenter",n),i.addEventListener("mouseleave",s),document.body.appendChild(i),i}(t,e)),!n)throw new Error("dom not found");!function(t,e){e.forEach(((e,i)=>{e&&e.image&&function(t,e,i){let n;for(let i=0,s=t.childNodes.length;i<s;i++)if(t.childNodes[i].getAttribute("id")===e){n=t.childNodes[i];break}n?function(t,e){if(!e.image)return;const i=t.querySelector("canvas");if(!i)return;const n=i.getContext("2d",{alpha:!0});if(!n)throw new Error("getContext error");n.clearRect(0,0,i.width,i.height),n.save(),n.scale(window.devicePixelRatio,window.devicePixelRatio),n.drawImage(e.image,0,0),n.restore()}(n,i):function(t,e,i){if(!i.image)return;!i.image.width||i.image.height;const n=Jr.document.createElement("div");n.setAttribute("id",e),n.style.display="flex",n.style.flexDirection="column";const s=fa.createCanvas({containerId:t.id,width:i.image.width,height:i.image.height,dpr:window.devicePixelRatio});s.style.border=`${za} 1px solid`,s.style.maxWidth=parseInt(t.style.width)-2+"px",s.style.maxHeight=parseInt(s.style.maxWidth)/(i.image.width/i.image.height)+"px";const r=s.getContext("2d",{alpha:!0});if(!r)throw new Error("getContext error");r.save(),r.scale(window.devicePixelRatio,window.devicePixelRatio),r.drawImage(i.image,0,0),r.restore(),n.appendChild(s);const a=Jr.document.createElement("p");function o(){const t=s.toDataURL("image/png",.6),e=document.createElement("a"),i=new MouseEvent("click");e.download=`thumb.${Date.now()}.png`,e.href=t,e.dispatchEvent(i)}a.innerHTML=i.image.width+" * "+i.image.height,a.innerHTML+="<br/>"+e,a.style.margin="0",a.style.padding="0",a.style.lineHeight="1.2",a.style.fontSize="10px",a.style.padding="3px 0 6px 0",a.style.color=Ha,n.appendChild(a),t.appendChild(n),n.addEventListener("click",o)}(t,e,i)}(t,i,e)}))}(n,i.cache)}),5e3));let Jo,Qo=$o;const Ko=new Oi(50,50),th=new Oi,eh=new Oi,ih=new Oi,nh=new Oi,sh=new Oi,rh=new Gi,ah=new Gi,oh=new Gi,hh=new Ri,lh=new Oi,uh=new Oi,ch=new Oi,dh=[1,0,0,1,0,0];function ph(){var t;return"undefined"==typeof window?null:null==(t=null==window?void 0:window.document)?void 0:t.getElementById("DEBUG_Displaycached")}const fh=class t{static getObject2BySvg(t,e){const i=(new mn).parse(t,this.use3DShape),n=this.getShapesByParsed(i,e);if(1==(null==n?void 0:n.length))return n[0];const s=new On;return s.adds(n),s}static getShapesBySvg(t,e){const i=(new mn).parse(t,this.use3DShape);return this.getShapesByParsed(i,e)}static getShapesByParsed(t,e){this.use3DShape=!!(null==e?void 0:e.use3DShape);const i=[],n=this.getPolygons2ByPaths(null==t?void 0:t.paths,e);(null==n?void 0:n.length)&&i.push(...n);const s=this.getLabels(null==t?void 0:t.labels,e);return(null==s?void 0:s.length)&&i.push(...s),i}static getPolygons2ByPaths(t,e){if(!t||!t.length)return;const i=[];for(let n=0,s=t.length;n<s;n++){const s=this.getPolygonsByPath(t[n],e);(null==s?void 0:s.length)&&i.push(...s)}return i}static getPolygonsByPath(t,e){var i,n;if(!t)return;const s=[],{userData:r}=t;let{fill:a,stroke:o,strokeWidth:h,thinLine:l,fillOpacity:u,strokeOpacity:c,opacity:d}=(null==r?void 0:r.style)||{};(null==e?void 0:e.fill)&&(a=e.fill),(null==e?void 0:e.stroke)&&(o=e.stroke),(null==e?void 0:e.lineWidth)&&(h=e.lineWidth),(null==e?void 0:e.thinLine)&&(l=!!e.thinLine),(null==e?void 0:e.fillOpacity)&&(u=e.fillOpacity),(null==e?void 0:e.strokeOpacity)&&(c=e.strokeOpacity),(null==e?void 0:e.opacity)&&(d=e.opacity),"none"!==a&&"transparent"!==a||(a=void 0,mi.unset(r,"style.fill")),"none"!==o&&"transparent"!==o||(o=void 0),o&&!h&&(h=1);const p=so.getMtl({fill:a,stroke:o,lineWidth:h,fillOpacity:u,strokeOpacity:c,opacity:d}),f=[];if(this.use3DShape){const n=mn.createShapes(t),s=(null==(i=t.currentPath)?void 0:i.autoClose)||!1;for(let t,i=0,r=(null==n?void 0:n.length)||0;i<r;i++){t=n[i];const r=_h(t,{flipY:null==e?void 0:e.flipY,strokeWidth:h,thinLine:l,closed:s});r&&f.push(r)}}else{const i=new va({cmds:t.getCmds(),flipY:null==e?void 0:e.flipY,lineWidth:h,thinLine:l});f.push(i)}if(null==f?void 0:f.length){const t=So.mergeGeoShapes(f),i=new Ia(t,p);i.userData=mi.cloneDeep(r),(null==(n=i.userData)?void 0:n.id)&&(i.name=i.userData.id),void 0!==(null==e?void 0:e.selectable)?i.selectable=e.selectable:i.userData.assetType&&(i.selectable=!0),s.push(i)}return s.length?s:void 0}static getInstanceBySymbol(e,i){var n,s,r,a,o,h,l,c;if(!e||!(null==(n=e.paths)?void 0:n.length))return;const d=[],p=mi.cloneDeep(i.userData),f=[];for(let t,i=0,n=(null==(s=null==e?void 0:e.paths)?void 0:s.length)||0;i<n;i++)t=e.paths[i].clone(),t.userData=p,f.push(t);const m=this.getLabels(null==e?void 0:e.labels);if(!e.symbolId)return;const y=new Ri;f.forEach((t=>y.union(t.computeBoundingBox()))),null==m||m.forEach((t=>y.union(bh.copy(t.computeBoundingBox()).applyMatrix3(t.matrix)))),yh.copy(i.transform).decompose(gh,vh,xh);const g=new Aa(u({},null==(r=i.userData)?void 0:r.style)),v=new ko(y,g,{flipY:!0});if(v.userData=p,d.push(v),v.applyMatrix3(yh.flipSvgY()),v.computeBoundingBox(),v.updateMatrix(),v.updateMatrixWorld(!0),!Qo.getInstance().has(e.symbolId)){const i=new Ia;mi.set(i,"userData.id",e.symbolId),mi.set(i,"userData.style",mi.merge({},e.style,p.style));for(let n,s=0,r=(null==(a=null==e?void 0:e.paths)?void 0:a.length)||0;s<r;s++){n=e.paths[s];const r=mi.merge({},null==(o=n.userData)?void 0:o.style,p.style,{flipY:!1});r.stroke&&!r.lineWidth&&(r.lineWidth=null==(l=null==(h=n.userData)?void 0:h.style)?void 0:l.strokeWidth),r.stroke&&!r.lineWidth&&(r.lineWidth=(null==(c=p.style)?void 0:c.strokeWidth)||1);const a=t.getPolygonsByPath(n,r);(null==a?void 0:a.length)&&i.adds(a)}(null==m?void 0:m.length)&&i.adds(m),i.computeBoundingBox(),i.updateMatrix(),i.updateMatrixWorld(!0),i.updateBoundingBox(),Qo.getInstance().scale(xh.x,xh.y).setByShape(e.symbolId,i,y)}let x=Qo.getInstance().get(e.symbolId);return x?(x=x.clone(),x.scaled.multiplyScalar(1,-1),x.updateMatrix(),v.mtl.map=x,d):void 0}static getLabels(t,e){if(!(null==t?void 0:t.length))return;const i=[];for(let n=0,s=(null==t?void 0:t.length)||0;n<s;n++){const s=this.getLabel(t[n],e);(null==s?void 0:s.length)&&i.push(...s)}return i}static getLabel(t,e){var i,n,s,r;if(!t||!t.textContent)return;const a=[];let{fill:o,stroke:h}=(null==(i=t.userData)?void 0:i.style)||{};o&&"none"!==o&&"transparent"!==o||h||(o=qa);const l=new oo({text:t.textContent,fontSize:t.userData.style.fontSize,fill:o,stroke:h,flipY:null==e?void 0:e.flipY,wireframe:null==e?void 0:e.wireframe});t.userData&&(l.userData=mi.cloneDeep(t.userData)),(null==(n=l.userData)?void 0:n.id)&&(l.name=l.userData.id),void 0===(null==(r=null==(s=l.userData)?void 0:s.style)?void 0:r.fill)&&mi.set(l.userData,"style.fill",o),l.renderOrder=1,a.push(l),t.transform&&(yh.setFromMatrix(t.transform),(null==e?void 0:e.flipY)&&yh.scale(1,-1),l.applyMatrix3(yh));const{id:u,pid:c,aid:d,assetType:p,layerType:f}=t.userData;return a}};d(fh,"use3DShape",!1);let mh=fh;const yh=new Gi,gh=new Oi,vh=new Oi,xh=new Oi,bh=new Ri;function _h(t,e){var i,n;const{closed:s,flipY:r,strokeWidth:a,thinLine:o}=e||{};null==(i=null==t?void 0:t.curves)||i.length;const h=wh(t.curves),l=[];for(let e=0,i=null==(n=null==t?void 0:t.holes)?void 0:n.length;e<i;e++){const i=wh(t.holes[e].curves);l.push(...i)}return h.push(...l),new va({cmds:h,closed:s,flipY:r,lineWidth:a,thinLine:o})}function wh(t){const e=[];for(let i,n=0,s=t.length;n<s;n++){const s=t[n],r=s.getPoint(0),a=!n;switch(s.type){case"LineCurve":a&&e.push([Pn,...s.v1.toArray()]),e.push([Ln,...s.v2.toArray()]);break;case"QuadraticBezierCurve":{a&&e.push([Pn,r.x,r.y]);const t=[];t.push(zn),t.push(...s.v1.toArray()),t.push(...s.v2.toArray()),e.push(t);break}case"CubicBezierCurve":{a&&e.push([Pn,r.x,r.y]);const t=[];t.push(Rn),t.push(...s.v0.toArray()),t.push(...s.v1.toArray()),t.push(...s.v2.toArray()),t.push(...s.v3.toArray()),e.push(t);break}case"EllipseCurve":{a&&e.push([Pn,r.x,r.y]);const t=[];t.push(qn),t.push(s.aX),t.push(s.aY),t.push(s.xRadius),t.push(s.yRadius),t.push(s.aRotation),t.push(s.aStartAngle),t.push(s.aEndAngle),t.push(s.aClockwise?1:0),e.push(t);break}}i=s}return e}const Sh=Jr.window||window,Mh=Sh.requestAnimationFrame||Sh.webkitRequestAnimationFrame||Sh.mozRequestAnimationFrame||Sh.oRequestAnimationFrame||Sh.msRequestAnimationFrame||function(t){Sh.setTimeout(t,1e3/60)},Eh=Sh.cancelAnimationFrame||Sh.webkitCancelAnimationFrame||Sh.mozCancelAnimationFrame||Sh.oCancelAnimationFrame||Sh.msCancelAnimationFrame||clearTimeout;class Ah{constructor(t,e,i=16.7,n){var s;if(d(this,"duration",16.7),d(this,"onComplete"),d(this,"generator"),d(this,"t",null),d(this,"stopped",!1),i&&(this.duration=i),this.onComplete=n,!e||"function"!=typeof e)throw new Error("[task] callback method is null!");let r="number"==typeof t&&t||Array.isArray(t)&&t.length;if(!r)throw new Error("[task] task list is empty ...");if(1===r)return e(0),void(null==(s=this.onComplete)||s.call(this));this.generator=this.queue(r,e),this.t=null,this.stopped=!1,this.next()}next(){var t;if(!this.generator||this.stopped)return;const{generator:e}=this,i=performance.now();let n=null;do{if(!e)break;if(n=e.next(),n.done){null==(t=this.onComplete)||t.call(this),this.clear();break}}while(!n.done&&performance.now()-i<this.duration);n.done||this.stopped||(this.t=Mh(this.next.bind(this)))}*queue(t,e){let i=performance.now();for(let n=0;n<t;n++)performance.now()-i>=this.duration&&(i=performance.now(),yield),this.stopped||e(n)}clear(){this.stopped=!0,this.generator=void 0,this.onComplete=void 0,this.t&&(Eh(this.t),this.t=null)}}const Th={enabled:!1,files:{},add:function(t,e){this.enabled&&(this.files[t]=e)},get:function(t){if(this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},Ih=new class{constructor(t,e,i){d(this,"isLoading",!1),d(this,"itemsLoaded",0),d(this,"itemsTotal",0),d(this,"urlModifier"),d(this,"handlers",[]),d(this,"onStart"),d(this,"onLoad"),d(this,"onProgress"),d(this,"onError"),this.onLoad=t,this.onProgress=e,this.onError=i}itemStart(t){this.itemsTotal++,this.isLoading||void 0!==this.onStart&&this.onStart(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,void 0!==this.onProgress&&this.onProgress(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,void 0!==this.onLoad&&this.onLoad())}itemError(t){void 0!==this.onError&&this.onError(t)}resolveURL(t){return void 0!==this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return-1!==e&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,i=this.handlers.length;e<i;e+=2){const i=this.handlers[e],n=this.handlers[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}};class Ch{constructor(t=Ih){d(this,"manager"),d(this,"crossOrigin","anonymous"),d(this,"withCredentials",!1),d(this,"path",""),d(this,"resourcePath",""),d(this,"requestHeader",{}),this.manager=t}loadAsync(t,e){const i=this;return new Promise((function(n,s){i.load(t,n,e,s)}))}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Dh={};class Nh extends Error{constructor(t,e){super(t),d(this,"response"),this.response=e}}class Bh extends Ch{constructor(t){super(t),d(this,"mimeType"),d(this,"responseType")}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const s=Th.get(t);if(void 0!==s)return this.manager.itemStart(t),setTimeout((()=>{e&&e(s),this.manager.itemEnd(t)}),0),s;if(void 0!==Dh[t])return void Dh[t].push({onLoad:e,onProgress:i,onError:n});Dh[t]=[],Dh[t].push({onLoad:e,onProgress:i,onError:n});const r=new Jr.window.Request(t,{headers:new Jr.window.Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(r).then((e=>{if(200===e.status||0===e.status){if(e.status,"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const i=Dh[t],n=e.body.getReader(),s=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),r=s?parseInt(s):0,a=0!==r;let o=0;const h=new ReadableStream({start(t){!function e(){n.read().then((({done:n,value:s})=>{if(n)t.close();else{o+=s.byteLength;const n=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:r});for(let t=0,e=i.length;t<e;t++){const e=i[t];e.onProgress&&e.onProgress(n)}t.enqueue(s),e()}}))}()}});return new Response(h)}throw new Nh(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)})).then((t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then((t=>n.decode(t)))}}})).then((e=>{Th.add(t,e);const i=Dh[t];delete Dh[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onLoad&&n.onLoad(e)}})).catch((e=>{const i=Dh[t];if(void 0===i)throw this.manager.itemError(t),e;delete Dh[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setMimeType(t){return this.mimeType=t,this}setResponseType(t){return this.responseType=t,this}}class kh extends Ch{constructor(t){super(t)}load(t,e,i,n){const s=this,r=new Bh(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(t,(function(i){try{e&&e(i)}catch(e){n&&n(e),s.manager.itemError(t)}}),i,n)}}class Oh extends hi{constructor(t={}){super(),d(this,"name","Adapter2@"+fi.now()),d(this,"params"),d(this,"xml"),d(this,"units"),d(this,"paths"),d(this,"symbolsMap"),d(this,"uses"),d(this,"labels"),d(this,"idsTree"),d(this,"scene"),d(this,"boundingBox",new Ri),d(this,"requestHeader",{}),d(this,"resources",[]),d(this,"_viewBox",new Ri),d(this,"_tic"),d(this,"_tic2"),d(this,"_assetTypes",[]),d(this,"_resourcesMap",{}),d(this,"_assetTypeMap",{}),d(this,"_idsMap",{}),d(this,"_boundingBoxMap",{}),d(this,"use3DShape",!1),this.params=t}destroy(){super.destroy(),this.clear()}clear(){this.xml=void 0,this.paths=[],this.symbolsMap={},this.uses=[],this.labels=[],this.idsTree=[],this._idsMap={},this.boundingBox.makeEmpty(),this._resourcesMap={},this._assetTypeMap={},this._assetTypes=[],Qo.clear()}setRequestHeader(t){return this.requestHeader=t,this}load(t,e){return p(this,null,(function*(){var e,i;if(!t)throw"url not found";let n;if(this.dispatchEvent({type:oi.INITIALIZATION_START}),this.clear(),mh.use3DShape=this.use3DShape,this.use3DShape)n=yield(new mn).setRequestHeader({}).setPixelRatio((null==(e=this.params)?void 0:e.dpr)||1).loadAsync(t).catch((()=>({})));else{const e=yield(new kh).loadAsync(t).catch((()=>({})));n=yield ho.setInstancedMesh(null==(i=Jr.config)?void 0:i.instancedMesh).parse(e)}return n}))}initResources(t,e){var i,n,s,r,a,o;if(this.clear(),!this.scene)throw new Error("please bind a Scene first");if(this.xml=null==t?void 0:t.xml,!this.xml)return void this.dispatchEvent({type:oi.INITIALIZATION_COMPLETE});this.units=null==t?void 0:t.units,this.paths=null==t?void 0:t.paths,this.symbolsMap=null==t?void 0:t.symbolsMap,this.uses=null==t?void 0:t.uses,this.labels=null==t?void 0:t.labels,this.idsTree=null==t?void 0:t.idsTree,this._assetTypes=null==t?void 0:t.assetTypes,(null==t?void 0:t.viewBox)&&this._viewBox.copy(t.viewBox).flipY(),this.recomputeIdsMap();const h=this,l=mi.chain(e).flatMap((t=>this._idsMap[t])).commit().uniq().value();if(null==(i=null==t?void 0:t.paths)?void 0:i.length){const e=null==t?void 0:t.paths;this._tic&&this._tic.clear(),this._tic=new Ah(e,(function(t){var i,n,s,r,a,o,u,c,d,p,f;const m=mh.getPolygonsByPath(e[t],{flipY:!0});if(null==m?void 0:m.length)for(let t=0,e=(null==m?void 0:m.length)||0;t<e;t++){const e=null==(n=null==(i=m[t])?void 0:i.userData)?void 0:n.id;(null==l?void 0:l.length)&&!l.includes(e)&&(m[t].visible=!1),h._resourcesMap[e]||(h._resourcesMap[e]=[]),h._resourcesMap[e].push(m[t]),null==(s=h.scene)||s.add(m[t]),(null==(a=null==(r=m[t])?void 0:r.userData)?void 0:a.assetType)&&(h._assetTypeMap[null==(u=null==(o=m[t])?void 0:o.userData)?void 0:u.assetType]||(h._assetTypeMap[null==(d=null==(c=m[t])?void 0:c.userData)?void 0:d.assetType]=[]),h._assetTypeMap[null==(f=null==(p=m[t])?void 0:p.userData)?void 0:f.assetType].push(m[t]))}}),3,(function(){var t;null==(t=h.scene)||t.computeBoundingBox(),h.scene.needsUpdate=!0}))}if(null==(n=null==t?void 0:t.labels)?void 0:n.length){const e=null==t?void 0:t.labels;this._tic2&&this._tic2.clear(),this._tic2=new Ah(e,(function(t){var i,n,s;const r=mh.getLabel(e[t],{flipY:!0});if(null==r?void 0:r.length)for(let t=0,e=(null==r?void 0:r.length)||0;t<e;t++){r[t].renderOrder=9;const e=null==(n=null==(i=r[t])?void 0:i.userData)?void 0:n.id;(null==l?void 0:l.length)&&!l.includes(e)&&(r[t].visible=!1),h._resourcesMap[e]||(h._resourcesMap[e]=[]),h._resourcesMap[e].push(r[t]),null==(s=h.scene)||s.add(r[t])}}),3,(()=>{var t;null==(t=this.scene)||t.computeBoundingBox(),this.scene.needsUpdate=!0}))}if(null==(s=null==t?void 0:t.instances)?void 0:s.length){const e=null==t?void 0:t.instances;for(let t,i=0,n=e.length;i<n;i++){t=e[i];const n=mh.getInstanceBySymbol(this.symbolsMap[t.symbolId],t);if(null==n?void 0:n.length)for(let t=0,e=(null==n?void 0:n.length)||0;t<e;t++){const e=null==(a=null==(r=n[t])?void 0:r.userData)?void 0:a.id;(null==l?void 0:l.length)&&!l.includes(e)&&(n[t].visible=!1),null==(o=this.scene)||o.add(n[t])}}}}bindScene(t){return this.scene=t,this}recomputeIdsMap(){var t;if(!(null==(t=this.idsTree)?void 0:t.length))return;const e=[];un(this.idsTree,(t=>{var i;if(e.push(t.value),!(null==(i=t.children)?void 0:i.length))return;const n=cn(t);this._idsMap[t.value]=mi.map(n,"value")}))}getAssetIdsByType(t){let e=[];Array.isArray(t)||(t=[t]);for(let i,n=0,s=t.length;n<s;n++){i=t[n];let s=Object.hasOwnProperty.call(this._idsMap,i)?this._idsMap[i]:void 0;(null==s?void 0:s.length)||(s=Object.hasOwnProperty.call(this._idsMap,i+"-assets")?this._idsMap[i+"-assets"]:void 0),(null==s?void 0:s.length)&&(e=e.concat(s))}return e}getLayers(t=2){return this.xml?ln(this.xml,t):[]}getViewBox(){return this._viewBox}getAssetTypes(){return this._assetTypes}getByAssetType(t){return this._assetTypeMap[t]||[]}updateLayersVisibility(t,e=!1){if(!this.scene)throw new Error("please bind a Scene first");const i=mi.chain(t).flatMap((t=>this._idsMap[t])).concat(t).compact().uniq().value();this.scene.traverse((t=>{var n,s;(null==(n=t.userData)?void 0:n.id)&&i.includes(t.userData.id)?t.visible=e:(null==(s=t.userData)?void 0:s.id)&&(t.visible=!e)})),this.scene.needsUpdate=!0}getBoundingBoxByIds(t){if(!this._resourcesMap||!Object.keys(this._resourcesMap).length)return;const e=new Ri;Array.isArray(t)||(t=[t]);for(let i=0,n=null==t?void 0:t.length;i<n;i++){if(!this._resourcesMap.hasOwnProperty(t[i]))continue;const n=this._resourcesMap[t[i]];if(null==n?void 0:n.length)for(let t=0,i=null==n?void 0:n.length;t<i;t++)n[t].boundingBox.isEmpty()&&n[t].computeBoundingBox(),n[t].boundingBox.isEmpty()||e.union(n[t].boundingBox)}return e}transMmByUtils(t=0){return t*Ph[mi.toLower(this.units||"mm")]}}const Ph={mm:1,cm:.1,m:.001,inches:.0393701,inch:.0393701};class Lh{constructor(t){d(this,"params"),d(this,"currentCamera"),d(this,"bindingStates",new WeakMap),d(this,"forceUpdate",!1),d(this,"currentState"),d(this,"cameraVersion"),d(this,"currentRenderState"),d(this,"ctxMap",{}),this.params=t}destroy(){this.bindingStates=new WeakMap,this.currentState=void 0,this.ctxMap={},this.reset()}reset(){this.forceUpdate=!0}setup(t,e,i){this.currentRenderState=e,this.currentCamera=i,this.currentState=this.getBindingState(t),this.ctxMap={};let n=this.needsUpdate(t);return(this.forceUpdate||n)&&this.saveCache(t),this.currentState}getBindingState(t){return this.bindingStates.has(t)||this.bindingStates.set(t,{id:t.id,uuid:t.uuid,needsUpdate:!0,featureKey:t.featureKey,version:-1,cameraVersion:-1,preShape:Rh}),Rh=t,this.bindingStates.get(t)}clearBindingState(){this.currentState&&(this.currentState.needsUpdate=!1,this.currentState.version=-1,this.currentState.cameraVersion=-1)}needsUpdate(t){return!this.currentState||!!this.currentState.needsUpdate||this.currentState.id!==t.id||this.currentState.version!==t.version}saveCache(t){this.currentState&&(this.clearBindingState(),this.currentState.version=t.version,this.currentState.needsUpdate=!1,this.currentState.ctx=fa.getCtx(t.featureKey,this.params.width,this.params.height,this.params.dpr))}updateModelViewMatrix(t,e){void 0!==e?(this.currentState=this.getBindingState(t),(this.currentState.cameraVersion!==e.version||t.dynamically)&&(this.currentState.cameraVersion!==e.version&&(this.currentState.needsUpdate=!0),this.currentState.cameraVersion=e.version,t.updateModelViewMatrix(e))):t.updateModelViewMatrix()}}let Rh;class zh{constructor(){d(this,"light"),d(this,"lightsArray",[]),d(this,"shadowsArray",[]),d(this,"lastCameraVersion",-1)}destroy(){var t;this.clear(),null==(t=this.light)||t.destroy()}clear(){this.lightsArray.length=0,this.shadowsArray.length=0}pushLight(t){this.light||(this.light=t),this.lightsArray.push(t)}pushShadow(t){this.shadowsArray.push(t)}}class Uh{constructor(){d(this,"renderStates",new WeakMap)}destroy(){this.renderStates=new WeakMap}get(t,e=0){const i=this.renderStates.get(t);let n;return void 0===i?(n=new zh,this.renderStates.set(t,[n])):e>=i.length?(n=new zh,i.push(n)):n=i[e],n}}class Fh{constructor(t=1e3){d(this,"cellCapacity"),d(this,"firstIndex"),d(this,"lastIndex"),d(this,"items"),this.cellCapacity=t,this.firstIndex=0,this.lastIndex=0,this.items=[new Array(this.cellCapacity)]}adjustCells(){this.lastIndex<this.cellCapacity||(this.items.push(new Array(this.cellCapacity)),this.lastIndex=0)}enqueue(t,e){if(e)return this.unshift(t);this.items[this.items.length-1][this.lastIndex++]=t,this.adjustCells()}unshift(t){for(let t=this.items.length-1;t>=0;t--)for(let e=this.cellCapacity-1;e>=0;e--)e>0&&void 0===this.items[t][e-1]||(this.items[t][e]=0===e&&t>0?this.items[t-1][this.cellCapacity-1]:this.items[t][e-1]);this.items[0][this.firstIndex]=t,this.lastIndex++,this.adjustCells()}dequeue(){if(this.isEmpty())return;const t=this.items[0][this.firstIndex];return this.firstIndex===this.cellCapacity-1?(this.items.shift(),this.firstIndex=0):this.firstIndex++,t}isEmpty(){return 1===this.items.length&&this.firstIndex===this.lastIndex}peek(){if(!this.isEmpty())return this.items[0][this.firstIndex]}size(){return(this.items.length-1)*this.cellCapacity-this.firstIndex+this.lastIndex}clear(){this.firstIndex=0,this.lastIndex=0,this.items=[new Array(this.cellCapacity)]}toString(){if(this.isEmpty())return"";let t=`${this.items[0][this.firstIndex]}`;for(let e=this.firstIndex+1;e<this.items[0].length;e++)t=`${t},${this.items[0][e]}`;for(let e=1;e<this.items.length-1;e++)for(let i=0;i<this.items[e].length;i++)t=`${t},${this.items[e][i]}`;for(let e=0;e<this.lastIndex;e++)t=`${t},${this.items[this.items.length-1][e]}`;return t}getByIndex(t){if(t>=this.size())return;const e=Math.floor((this.firstIndex+t)/this.cellCapacity),i=(this.firstIndex+t)%this.cellCapacity;return this.items[e][i]}setByIndex(t,e){if(t>=this.size())return!1;const i=Math.floor((this.firstIndex+t)/this.cellCapacity),n=(this.firstIndex+t)%this.cellCapacity;return this.items[i][n]=e,!0}sort(t){const e=this.size(),i=new Array(e);for(let t=0;t<e;t++)i[t]=this.getByIndex(t);i.sort(t),this.clear();for(let t=0;t<i.length;t++)this.enqueue(i[t])}getAll(){const t=[];for(let e=0,i=this.size();e<i;e++)t[e]=this.getByIndex(e);return t}}class Wh{constructor(){d(this,"queue",new Fh),d(this,"mergedQueue",{})}destroy(){this.clear()}clear(){this.queue.clear();const t=mi.keys(this.mergedQueue);for(let e=0,i=null==t?void 0:t.length;e<i;e++)void 0!==this.mergedQueue[t[e]]&&this.mergedQueue[t[e]].clear()}push(t,e){return e&&!t.renderOrder&&(t.renderOrder=e),this.queue.enqueue(t),this}unshift(t){this.queue.enqueue(t,!0)}sort(t){return this.queue.size()&&this.queue.sort(t||qh),this}mergeQueue(){for(let t=0,e=this.queue.size();t<e;t++){const t=this.queue.dequeue();if(!t.isShape)continue;const e=Ea(t.mtl);let i=this.mergedQueue[e];i||(i=new Fh,this.mergedQueue[e]=i),i.enqueue(t)}return this}}function qh(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.id-e.id}class Hh{constructor(){d(this,"lists",new WeakMap)}destroy(){this.lists=new WeakMap}get(t,e){const i=this.lists.get(t);let n;return void 0===i?(n=new Wh,this.lists.set(t,[n])):e>=i.length?(n=new Wh,i.push(n)):n=i[e],n}}class Vh{constructor(t={}){d(this,"name","CvsRenderer@"+fi.now()),d(this,"params"),d(this,"autoClear",!0),d(this,"_currentRenderTarget"),d(this,"cvs"),d(this,"ctx"),d(this,"renderStates",new Uh),d(this,"renderStateStack",[]),d(this,"currentRenderState"),d(this,"renderLists",new Hh),d(this,"currentRenderList"),d(this,"renderListStack",[]),d(this,"bindingStates"),d(this,"renderer"),d(this,"_frustum",new Ri),d(this,"_tic"),d(this,"renderSliceComplete",!1),d(this,"lastTicCompleted",-1),d(this,"_isContextLost",!1),d(this,"contextLostHandler",this.handleContextLost.bind(this)),d(this,"contextRestoreHandler",this.handleContextRestore.bind(this)),this.params=t,Jr.config=t,void 0!==t.autoClear&&(this.autoClear=!!t.autoClear),this.init(),this.bindingStates=new Lh(this.params),this.renderer=new Uo(this.ctx,this.bindingStates)}destroy(){this.renderer.destroy()}init(){if(this.params.workerRender){if(!this.params.cvs)throw new Error("offscreen canvas not found");this.cvs=this.params.cvs}else this.cvs=fa.createCanvas(this.params);if(!this.cvs)throw new Error("canvas create error");const t=this.cvs.getContext("2d",{alpha:!0});if(!t)throw new Error("context error");this.params.cvs=this.cvs,this.params.ctx=this.ctx=t,this.setSize(this.params.width,this.params.height)}get isSliceComplete(){return!!this.params.sliceRendering&&this.renderSliceComplete}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.params.width=t,this.params.height=e,this.params.camera||(this.params.camera={}),this.params.camera.width=t,this.params.camera.height=e,this.params.aspect=t/e,this.params.camera.aspect=this.params.aspect,this.params.camera.left=-.5*t,this.params.camera.right=.5*t,this.params.camera.top=.5*e,this.params.camera.bottom=-.5*e,this.cvs&&fa.resizeCanvas(this.cvs,t,e,this.params.dpr)}getSize(t=new Oi){return t.set(this.params.width,this.params.height)}bindEvents(){var t,e;null==(t=this.cvs)||t.addEventListener(jh,this.contextLostHandler,!1),null==(e=this.cvs)||e.addEventListener(Yh,this.contextRestoreHandler,!1)}unbindEvents(){var t,e;null==(t=this.cvs)||t.removeEventListener(jh,this.contextLostHandler,!1),null==(e=this.cvs)||e.removeEventListener(Yh,this.contextRestoreHandler,!1)}handleContextLost(t){t.preventDefault(),this._isContextLost=!0}handleContextRestore(){this._isContextLost=!1}clean(){this.ctx&&(this._currentRenderTarget?this._currentRenderTarget.ctx.clearRect(0,0,this.params.width,this.params.height):this.ctx.clearRect(0,0,this.params.width,this.params.height))}getRenderTarget(){return this._currentRenderTarget}setRenderTarget(t){this._currentRenderTarget=t}render(t,e,i){if(this._isContextLost||!this.ctx)return;this._currentRenderTarget?this.renderer.ctx=this._currentRenderTarget.ctx:this.renderer.ctx=this.ctx,this.currentRenderState=this.renderStates.get(t,this.renderStateStack.length);const n=void 0!==e&&this.currentRenderState.lastCameraVersion!==e.version;(n||t.dynamically||t.matrixWorldAutoUpdate)&&t.updateMatrixWorld(),(n||e&&void 0===e.parent&&(null==e?void 0:e.matrixWorldAutoUpdate))&&e.updateMatrixWorld(),e&&(this._frustum.copy(e.boundingBoxWorld),this.currentRenderState.lastCameraVersion=e.version),t.isScene&&t.onBeforeRender(this,t,e,i),this.currentRenderState.clear(),this.renderStateStack.push(this.currentRenderState),this.currentRenderList=this.renderLists.get(t,this.renderListStack.length),this.currentRenderList.clear(),this.renderListStack.push(this.currentRenderList),this.projectObject(t,e,0),this.currentRenderList.sort(),this.renderScene(this.currentRenderList,t,e,i),t.isScene&&t.onAfterRender(this,t,e),this.renderStateStack.pop(),this.renderStateStack.length>0?this.currentRenderState=this.renderStateStack[this.renderStateStack.length-1]:this.currentRenderState=void 0,this.renderListStack.pop(),this.renderListStack.length?this.currentRenderList=this.renderListStack[this.renderListStack.length-1]:this.currentRenderList=void 0}renderTexture(t,e){t&&t.image&&(this._currentRenderTarget?this.renderer.ctx=this._currentRenderTarget.ctx:this.renderer.ctx=this.ctx,this.autoClear&&this.clean(),this.renderer.ctx.drawImage(t.image,0,0))}projectObject(t,e,i=0){var n,s,r,a,o,h;if(t.visible)if(t.composeNode)t.boundingBoxWorld.isEmpty()?null==(n=this.currentRenderList)||n.push(t,i):this._frustum.intersectsBox(t.boundingBoxWorld)&&(null==(s=this.currentRenderList)||s.push(t,i));else{t.isGroup&&(i=t.renderOrder),t.isShape&&e?t.boundingBoxWorld.isEmpty()?null==(r=this.currentRenderList)||r.push(t,i):this._frustum.intersectsBox(t.boundingBoxWorld)&&(null==(a=this.currentRenderList)||a.push(t,i)):t.isShape&&(null==(o=this.currentRenderList)||o.push(t,i));for(let i=0,n=(null==(h=t.children)?void 0:h.length)||0;i<n;i++)this.projectObject(t.children[i],e)}}renderScene(t,e,i,n){this.autoClear&&this.clean();const s=t.queue;s.size()<=0||(e.isStatic&&this.params.sliceRendering?this.renderObjectsSlice(s,e,i,n):this.renderObjects(s,e,i,n),s.clear())}renderObjects(t,e,i,n){for(let s,r=0,a=t.size();r<a;r++)s=t.dequeue(),s&&this.renderObject(s,e,i,n)}renderObject(t,e,i,n){t.onBeforeRender(this,e,i,n),this.bindingStates.updateModelViewMatrix(t,i),this.bindingStates.setup(t,this.currentRenderState,i),this.renderer.render(t),this.params.wireframe&&this.renderer.renderWireFrame(t),t.onAfterRender(this,e,i)}renderObjectsMerged(t,e,i,n){fi.now(),(()=>{for(let s,r=0,a=t.size();r<a;r++)s=t.dequeue(),s&&this.renderObjectMerged(s,e,i,n)})()}renderObjectMerged(t,e,i,n){t.onBeforeRender(this,e,i,n),this.bindingStates.updateModelViewMatrix(t,i),this.bindingStates.setup(t,this.currentRenderState,i),this.renderer.renderMerged(t),this.params.wireframe&&this.renderer.renderWireFrame(t),t.onAfterRender(this,e,i)}renderObjectsSlice(t,e,i,n){var s;this.autoClear&&this.clean();const r=t.getAll()||[];if(!(null==r?void 0:r.length))return;this._tic&&this._tic.clear(),this.renderSliceComplete=!1;const a=(null==(s=this._currentRenderTarget)?void 0:s.ctx)||this.ctx;if(!a)throw new Error("CvsRenderer.renderObjectsSlice: no ctx");const o=this;this._tic=new Ah(r,(t=>{this.renderSliceComplete=!1,this.renderer.ctx=a,this.renderObject(r[t],e,i,n),e.isStatic&&t===r.length-1&&this.params.debounceCache&&(this.renderSliceComplete=!0)}),this.params.sliceDuration,(function(){o.lastTicCompleted=fi.now()}))}}const jh="contextlost",Yh="contextrestored";Jr.window.requestAnimationFrame;const Gh=Jr.window.performance?()=>Jr.window.performance.now():()=>(new Date).getTime();class Xh{constructor(t=!0){d(this,"autoStart"),d(this,"startTime",0),d(this,"oldTime",0),d(this,"elapsedTime",0),d(this,"running",!1),this.autoStart=t}start(){this.startTime=Gh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Gh();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}class Zh extends hi{constructor(t={}){super(),d(this,"name","RenderTarget"),d(this,"uuid",_n()),d(this,"featureKey",this.name+"@"+this.uuid),d(this,"offscreen",!0),d(this,"width"),d(this,"height"),d(this,"dpr"),d(this,"texture"),d(this,"cvs"),d(this,"ctx"),void 0!==t.offscreen&&(this.offscreen=t.offscreen),this.width=t.width,this.height=t.height,this.dpr=t.dpr||1,this.offscreen?this.cvs=fa.get(this.featureKey,this.width,this.height,this.dpr):this.cvs=fa.createHtmlCanvas(this.width,this.height,this.dpr),this.ctx=fa.getContext2D(this.cvs,{alpha:!0}),this.texture=new zo,this.texture.image=this.cvs}destroy(){super.destroy()}setSize(t,e,i=Jr.config.dpr){this.width===t&&this.height===e&&this.dpr===i||(this.width=t,this.height=e,fa.resizeCanvas(this.cvs,t,e,i))}clean(){this.ctx&&this.ctx.clearRect(0,0,this.width,this.height)}clone(){return new(0,this.constructor)({width:this.width,height:this.height,dpr:this.dpr}).copy(this)}copy(t){return this.name=t.name,this}}const $h=new Oi;class Jh{constructor(t,e){d(this,"name","EffectComposer"),d(this,"renderer"),d(this,"renderTarget1"),d(this,"renderTarget2"),d(this,"writeBuffer"),d(this,"readBuffer"),d(this,"_width"),d(this,"_height"),d(this,"_pixelRatio"),d(this,"renderToScreen",!0),d(this,"passes",[]),d(this,"clock",new Xh),this.renderer=t,e?(this.renderTarget1=e,this._width=e.width,this._height=e.height):(t.getSize($h),this._width=$h.x,this._height=$h.y,this.renderTarget1=new Zh({width:this._width,height:this._height}),this.renderTarget1.name="EffectComposer.rt1"),this._pixelRatio=Jr.config.dpr,this.renderTarget2=this.renderTarget1.clone(),this.renderTarget2.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}destroy(){this.renderTarget1.destroy(),this.renderTarget2.destroy()}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}clearPasses(){this.passes.length=0}isLastEnabledPass(t){for(let e=t+1,i=this.passes.length;e<i;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();for(let e=0,i=this.passes.length;e<i;e++){const i=this.passes[e];i.enabled&&(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),i.render(this.renderer,this.writeBuffer,this.readBuffer,t,!1),i.needsSwap&&this.swapBuffers())}this.renderer.setRenderTarget(e)}reset(t){void 0===t&&(this.renderer.getSize($h),this._pixelRatio=Jr.config.dpr,this._width=$h.x,this._height=$h.y,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)),this.renderTarget1.destroy(),this.renderTarget2.destroy(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const i=this._width*this._pixelRatio,n=this._height*this._pixelRatio;this.renderTarget1.setSize(i,n),this.renderTarget2.setSize(i,n);for(let t=0,e=this.passes.length;t<e;t++)this.passes[t].setSize(i,n)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}}class Qh{constructor(){d(this,"isPass",!0),d(this,"enabled",!0),d(this,"needsSwap",!0),d(this,"clear",!1),d(this,"renderToScreen",!1)}destroy(){}setSize(t,e){}}class Kh{constructor(){d(this,"renderTarget"),d(this,"texture"),d(this,"width"),d(this,"height"),d(this,"dpr"),d(this,"version",-1),this.width=Jr.config.width,this.height=Jr.config.height,this.dpr=Jr.config.dpr,this.renderTarget=new Zh({width:this.width,height:this.height,dpr:this.dpr}),this.texture=this.renderTarget.texture,this.texture.image=this.renderTarget.cvs}destroy(){}render(t){t.renderTexture(this.texture)}}class tl extends Qh{constructor(t,e,i=!0,n=!1){super(),d(this,"name","RenderPass"),d(this,"scene"),d(this,"camera"),this.scene=t,this.camera=e,this.clear=i,this.needsSwap=n}render(t,e,i,n){const s=t.autoClear;t.autoClear=!1,t.setRenderTarget(this.renderToScreen?void 0:i),this.clear&&t.clean(),t.render(this.scene,this.camera,n),t.autoClear=s}}class el extends Qh{constructor(t,e,i=!0,n=!1){super(),d(this,"name","DebouncePass"),d(this,"scene"),d(this,"camera"),d(this,"fsQuad",new Kh),d(this,"debounceQuad",new Kh),d(this,"cacheQuad",new Kh),d(this,"version",-1),d(this,"_ts",fi.now()),d(this,"_initialized",!1),d(this,"debounceRenderHandler",mi.debounce(this.debounceRender.bind(this),100)),this.scene=t,this.camera=e,this.clear=i,this.needsSwap=n}destroy(){super.destroy()}setSize(t,e){this.fsQuad.renderTarget.setSize(t,e),this.debounceQuad.renderTarget.setSize(t,e),this.cacheQuad.renderTarget.setSize(t,e),this.fsQuad.width=t,this.fsQuad.height=e,this.debounceQuad.width=t,this.debounceQuad.height=e,this.cacheQuad.width=t,this.cacheQuad.height=e}get currentVersion(){var t;return this.scene.version+((null==(t=this.camera)?void 0:t.version)||0)}get isChanged(){return this.version!==this.currentVersion}get isDebounceChanged(){return this.debounceQuad.version!==this.currentVersion}isRenderTicComplete(t){return this._ts<=t.lastTicCompleted}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.isChanged?this.isChanged&&!this._initialized?(this.finalRender(this.fsQuad,t,e,i),this.debounceRender(t,e,i)):(this.renderCache(this.debounceQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i),this.debounceRenderHandler(t,e,i)):(Jr.config.debounceCache&&this.isDebounceChanged&&this.isRenderTicComplete(t)?(this.saveCache(this.fsQuad,this.debounceQuad),this.finalRender(this.fsQuad,t,e,i),this._initialized=!0):Jr.config.debounceCache&&this._initialized?(this.renderCache(this.debounceQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i)):(this.renderCache(this.fsQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i)),this._ts=fi.now()),this.version=this.currentVersion,t.autoClear=n}saveCache(t,e){var i;this.isDebounceChanged&&(e.renderTarget.ctx.clearRect(0,0,Jr.config.width,Jr.config.height),e.renderTarget.ctx.drawImage(t.renderTarget.cvs,0,0),null==(i=this.camera)||i.updateMatrixWorld(),e.texture.matrix.copy(t.texture.matrix),e.version=this.currentVersion)}renderCache(t,e){var i;null==(i=this.camera)||i.updateMatrixWorld(),nl.copy(t.texture.matrix).invert().premultiply(this.camera.viewMatrix).getComponents(sl),il.set(Jr.config.width,Jr.config.height),e.renderTarget.ctx.clearRect(0,0,Jr.config.width,Jr.config.height),e.renderTarget.ctx.save(),e.renderTarget.ctx.transform(...sl),e.renderTarget.ctx.drawImage(t.renderTarget.cvs,0,0,il.x,il.y),e.renderTarget.ctx.restore()}finalRender(t,e,i,n){e.setRenderTarget(this.renderToScreen?void 0:n),this.clear&&e.clean(),e.renderTexture(t.renderTarget.texture,this.camera)}debounceRender(t,e,i){t.setRenderTarget(this.renderToScreen?void 0:this.fsQuad.renderTarget),t.clean(),t.render(this.scene,this.camera),this.fsQuad.texture.matrix.copy(this.camera.viewMatrix)}}const il=new Oi,nl=new Gi,sl=[1,0,0,1,0,0];class rl extends Qh{constructor(){super(),d(this,"name","OutputPass"),d(this,"texture"),d(this,"fsQuad"),this.fsQuad=new Kh,this.texture=this.fsQuad.texture,this.clear=!0}destroy(){super.destroy(),this.fsQuad.destroy()}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.fsQuad.texture.image=i.cvs,t.setRenderTarget(this.renderToScreen?void 0:e),this.clear&&t.clean(),this.fsQuad.render(t),i.clean(),t.autoClear=n}}class al{noise(t,e,i=0){const n=Math.floor(t),s=Math.floor(e),r=Math.floor(i),a=255&n,o=255&s,h=255&r,l=(t-=n)-1,u=(e-=s)-1,c=(i-=r)-1,d=hl(t),p=hl(e),f=hl(i),m=ol[a]+o,y=ol[m]+h,g=ol[m+1]+h,v=ol[a+1]+o,x=ol[v]+h,b=ol[v+1]+h;return ll(f,ll(p,ll(d,ul(ol[y],t,e,i),ul(ol[x],l,e,i)),ll(d,ul(ol[g],t,u,i),ul(ol[b],l,u,i))),ll(p,ll(d,ul(ol[y+1],t,e,c),ul(ol[x+1],l,e,c)),ll(d,ul(ol[g+1],t,u,c),ul(ol[b+1],l,u,c))))}}const ol=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];for(let t=0;t<256;t++)ol[256+t]=ol[t];function hl(t){return t*t*t*(t*(6*t-15)+10)}function ll(t,e,i){return e+t*(i-e)}function ul(t,e,i,n){const s=15&t,r=s<8?e:i,a=s<4?i:12==s||14==s?e:n;return(1&s?-r:r)+(2&s?-a:a)}class cl extends Qh{constructor(t){super(),d(this,"name","PaperPass"),d(this,"fsQuad"),d(this,"ctx"),d(this,"camera"),d(this,"version",0),d(this,"_width",0),d(this,"_height",0),this.camera=t,this.fsQuad=new Kh,this.ctx=fa.getContext2D(this.fsQuad.texture.image,{alpha:!0}),this.needsSwap=!1,this._width=this.fsQuad.width,this._height=this.fsQuad.height,this.generatePerlin()}destroy(){super.destroy(),this.fsQuad.destroy()}setSize(t,e){this.fsQuad.renderTarget.setSize(t,e),this.fsQuad.width=t,this.fsQuad.height=e,this._width=t,this._height=e}generatePerlin(){!function(t,e,i){const n=new al,s=t.createImageData(e,i),r=s.data,a=2.5;for(let t=0;t<i;t++)for(let i=0;i<e;i++){const s=n.noise(i/a,t/a,0),o=Math.floor(128*(s+1)),h=4*(t*e+i);r[h]=o,r[h+1]=o,r[h+2]=o,r[h+3]=16}t.putImageData(s,0,0)}(this.ctx,this._width,this._height)}get currentVersion(){var t;return(null==(t=this.camera)?void 0:t.version)||0}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.currentVersion!==this.version&&(this.version=this.currentVersion),this._width===this.fsQuad.width&&this._height===this.fsQuad.height||(this.fsQuad.width=this._width,this.fsQuad.height=this._height,this.generatePerlin()),t.setRenderTarget(this.renderToScreen?void 0:i),t.renderTexture(this.fsQuad.texture),t.autoClear=n}}class dl extends wn{constructor(){super(),d(this,"name","Scene"),d(this,"type","Scene"),d(this,"isScene",!0),d(this,"view"),d(this,"background"),d(this,"featureKey","Scene_"+this.id),d(this,"matrixAutoUpdate",!1)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}setup(t){this.view=t}render(t){var e;this.visible&&(null==(e=this.children)||e.forEach((function(e){e.isShape&&e.render(t)})))}getIntersectObjects(t,e=dn.RM,i=[]){throw new Error("must be implemented in derived")}getByIds(t,e=[]){return e.length=0,t?(this.traverse((function(i){var n,s;(null==(n=i.userData)?void 0:n.id)&&(Array.isArray(t)&&t.includes(null==(s=i.userData)?void 0:s.id)||i.userData.id===t)&&e.push(i)})),e):e}}class pl extends dl{constructor(){super(...arguments),d(this,"isDynamic",!0),d(this,"dynamically",!0)}}const fl=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),ml=(t,e=0,i)=>fl(t)?new(0,t.constructor)(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i),yl=(t,e,i)=>t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t;class gl{constructor(t,e,i,n){d(this,"parameterPositions"),d(this,"resultBuffer"),d(this,"sampleValues"),d(this,"valueSize"),d(this,"settings",null),d(this,"DefaultSettings_",{}),d(this,"__cacheIndex"),d(this,"_cachedIndex",0),this.parameterPositions=t,this.sampleValues=e,this.valueSize=i,this.resultBuffer=n||new Float32Array(i)}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,n=e[i],s=e[i-1];t:{e:{let r;i:{n:if(!(t<n)){for(let r=i+2;;){if(void 0===n){if(t<s)break n;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===r)break;if(s=n,n=e[++i],t<n)break e}r=e.length;break i}if(t>=s)break t;{const a=e[1];t<a&&(i=2,s=a);for(let r=i-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(i===r)break;if(n=s,s=e[--i-1],t>=s)break e}r=i,i=0}}for(;i<r;){const n=i+r>>>1;t<e[n]?r=n:i=n+1}if(n=e[i],s=e[i-1],void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,n)}return this.interpolate_(i,s,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n;for(let t=0;t!==n;++t)e[t]=i[s+t];return e}}class vl extends gl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}intervalChanged_(){}}class xl extends gl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=(i-e)/(n-e),u=1-l;for(let t=0;t!==a;++t)s[t]=Number(r[h+t])*u+Number(r[o+t])*l;return s}intervalChanged_(){}}class bl extends gl{constructor(t,e,i,n){super(t,e,i,n),d(this,"_weightPrev",-0),d(this,"_offsetPrev",-0),d(this,"_weightNext",-0),d(this,"_offsetNext",-0),this.DefaultSettings_={endingStart:2400,endingEnd:2400}}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,y=-c*m+2*c*f-c*p,g=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let t=0;t!==a;++t)s[t]=y*Number(r[l+t])+g*Number(r[h+t])+v*Number(r[o+t])+x*Number(r[u+t]);return s}intervalChanged_(t,e,i){const n=this.parameterPositions;let s=t-2,r=t+1,a=n[s],o=n[r];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:s=t,a=2*e-i;break;case 2402:s=n.length-2,a=e+n[s]-n[s+1];break;default:s=t,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:r=t,o=2*i-e;break;case 2402:r=1,o=i+n[1]-n[0];break;default:r=t-1,o=e}const h=.5*(i-e),l=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(o-i),this._offsetPrev=s*l,this._offsetNext=r*l}}const _l=2300,wl=2301,Sl=2302;class Ml{constructor(t,e,i,n){if(d(this,"name","KeyframeTrack"),d(this,"times"),d(this,"values"),d(this,"ValueTypeName",""),d(this,"DefaultInterpolation",wl),d(this,"createInterpolant"),d(this,"InterpolantFactoryMethodDiscrete",this._InterpolantFactoryMethodDiscrete),d(this,"InterpolantFactoryMethodLinear",this._InterpolantFactoryMethodLinear),d(this,"InterpolantFactoryMethodSmooth",this._InterpolantFactoryMethodSmooth),!e||!e.length)throw new Error("KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=yl(e,Float32Array),this.values=yl(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:yl(t.times,Array),values:yl(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}_InterpolantFactoryMethodDiscrete(t){return new vl(this.times,this.values,this.getValueSize(),t)}_InterpolantFactoryMethodLinear(t){return new xl(this.times,this.values,this.getValueSize(),t)}_InterpolantFactoryMethodSmooth(t){return new bl(this.times,this.values,this.getValueSize(),t)}getValueSize(){return Math.ceil(this.values.length/this.times.length)}setInterpolation(t){let e;switch(t){case _l:e=this.InterpolantFactoryMethodDiscrete;break;case wl:e=this.InterpolantFactoryMethodLinear;break;case Sl:e=this.InterpolantFactoryMethodSmooth}if(!e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return _l;case this.InterpolantFactoryMethodLinear:return wl;case this.InterpolantFactoryMethodSmooth:return Sl}}shift(t){if(0!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){const i=this.times,n=i.length;let s=0,r=n-1;for(;s!==n&&i[s]<t;)++s;for(;-1!==r&&i[r]>e;)--r;if(++r,0!==s||r!==n){s>=r&&(r=Math.max(r,1),s=r-1);const t=this.getValueSize();this.times=ml(i,s,r),this.values=ml(this.values,s*t,r*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(t=!1);const i=this.times,n=this.values,s=i.length;0===s&&(t=!1);let r=null;for(let e=0;e!==s;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){t=!1;break}if(null!==r&&r>n){t=!1;break}r=n}if(void 0!==n&&fl(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){t=!1;break}}return t}optimize(){const t=ml(this.times),e=ml(this.values),i=this.getValueSize(),n=this.getInterpolation()===Sl,s=t.length-1;let r=1;for(let a=1;a<s;++a){let s=!1;const o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0]))if(n)s=!0;else{const t=a*i,n=t-i,r=t+i;for(let a=0;a!==i;++a){const i=e[t+a];if(i!==e[n+a]||i!==e[r+a]){s=!0;break}}}if(s){if(a!==r){t[r]=t[a];const n=a*i,s=r*i;for(let t=0;t!==i;++t)e[s+t]=e[n+t]}++r}}if(s>0){t[r]=t[s];for(let t=s*i,n=r*i,a=0;a!==i;++a)e[n+a]=e[t+a];++r}return r!==t.length?(this.times=ml(t,0,r),this.values=ml(e,0,r*i)):(this.times=t,this.values=e),this}clone(){const t=ml(this.times,0),e=ml(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}d(Ml,"DefaultInterpolation",wl),Ml.prototype.ValueBufferType=Float32Array;class El extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","vector2")}}class Al extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","number")}}class Tl extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","color")}}class Il extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","bool"),d(this,"DefaultInterpolation",_l)}}Il.prototype.ValueBufferType=Array,Il.prototype.InterpolantFactoryMethodLinear=void 0,Il.prototype.InterpolantFactoryMethodSmooth=void 0;class Cl extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","string"),d(this,"DefaultInterpolation",_l)}}Il.prototype.ValueBufferType=Array,Cl.prototype.InterpolantFactoryMethodLinear=void 0,Cl.prototype.InterpolantFactoryMethodSmooth=void 0;class Dl{constructor(t,e=-1,i,n=Bl){d(this,"name","AnimationClip"),d(this,"duration"),d(this,"tracks"),d(this,"blendMode",Bl),d(this,"uuid",_n()),this.name=t,this.duration=e,this.tracks=i,this.blendMode=n,this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,s=i.length;t!==s;++t)e.push(Nl(i[t]).scale(n));const s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(Ml.toJSON(i[t]));return n}static findByName(t,e){var i;let n;if(t.isShape){const e=t;n=(null==(i=e.geo)?void 0:i.animations)||e.animations}else n=t;for(let t=0;t<n.length;t++)if(n[t].name===e)return n[t]}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){const i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new(0,this.constructor)(this.name,this.duration,t,this.blendMode)}toJSON(){return Dl.toJSON(this)}}function Nl(t){if(void 0===t.type)throw new Error("KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Al;case"vector":case"vector2":return El;case"color":return Tl;case"bool":case"boolean":return Il;case"string":return Cl}throw new Error("KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],i=[];((t,e,i,n)=>{let s=1,r=t[0];for(;void 0!==r&&void 0===r[n];)r=t[s++];if(void 0===r)return;let a=r[n];if(void 0!==a)if(Array.isArray(a))do{a=r[n],void 0!==a&&(e.push(r.time),i.push.apply(i,a)),r=t[s++]}while(void 0!==r);else if(void 0!==a.toArray)do{a=r[n],void 0!==a&&(e.push(r.time),a.toArray(i,i.length)),r=t[s++]}while(void 0!==r);else do{a=r[n],void 0!==a&&(e.push(r.time),i.push(a)),r=t[s++]}while(void 0!==r)})(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const Bl=2500;class kl{constructor(t,e,i){d(this,"path",""),d(this,"parsedPath"),d(this,"_targetGroup"),d(this,"_bindings"),d(this,"rootNode"),this.parsedPath=i||Ol.parseTrackName(e),this._targetGroup=t,this._bindings=t.subscribe_(e,this.parsedPath)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=i.length;n!==s;++n)i[n].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}class Ol{constructor(t,e,i){d(this,"path"),d(this,"parsedPath"),d(this,"node"),d(this,"rootNode"),d(this,"getValue",this._getValue_unbound),d(this,"setValue",this._setValue_unbound),d(this,"targetObject"),d(this,"propertyName"),d(this,"resolvedProperty"),d(this,"propertyIndex",-1),d(this,"BindingType",{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3,ColorString:4}),d(this,"Versioning",{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2}),d(this,"GetterByBindingType",[this._getValue_direct,this._getValue_array,this._getValue_arrayElement,this._getValue_toArray,this._getValue_color]),d(this,"SetterByBindingTypeAndVersioning",[[this._setValue_direct,this._setValue_direct_setNeedsUpdate,this._setValue_direct_setMatrixWorldNeedsUpdate],[this._setValue_array,this._setValue_array_setNeedsUpdate,this._setValue_array_setMatrixWorldNeedsUpdate],[this._setValue_arrayElement,this._setValue_arrayElement_setNeedsUpdate,this._setValue_arrayElement_setMatrixWorldNeedsUpdate],[this._setValue_fromArray,this._setValue_fromArray_setNeedsUpdate,this._setValue_fromArray_setMatrixWorldNeedsUpdate],[this._setValue_color,this._setValue_color_setNeedsUpdate,this._setValue_color_setMatrixWorldNeedsUpdate]]),this.path=e,this.parsedPath=i||Ol.parseTrackName(e),this.node=Ol.findNode(t,this.parsedPath.nodeName),this.rootNode=t}static create(t,e,i){return t&&t.isAnimationObjectGroup?new kl(t,e,i):new Ol(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Ll,"")}static parseTrackName(t){const e=Hl.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4]?parseInt(e[4]):void 0,propertyName:e[5],propertyIndex:e[6]?parseInt(e[6]):void 0},n=i.nodeName&&i.nodeName.lastIndexOf(".")||void 0;if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==Vl.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||void 0===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;const i=t.getObjectByProperty("name",e)||t.getObjectByProperty("uuid",e);return i||void 0}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){this.targetObject&&this.propertyName&&(t[e]=this.targetObject[this.propertyName])}_getValue_array(t,e){const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_getValue_color(t,e){const i=Za.getArray(this.resolvedProperty);for(let n=0,s=i.length;n<s;n++)t[e++]=i[n]}_setValue_direct(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e])}_setValue_direct_setNeedsUpdate(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0)}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_array(t,e){const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){if(!this.targetObject)return;const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){if(!this.targetObject)return;const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0)}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0)}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_color(t,e){this.targetObject&&this.propertyName&&(this.resolvedProperty=this.targetObject[this.propertyName]=jl.fromArray(t,e).getStyle())}_setValue_color_setNeedsUpdate(t,e){this.targetObject&&(this._setValue_color(t,e),this.targetObject.needsUpdate=!0)}_setValue_color_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this._setValue_color(t,e),this.targetObject.matrixWorldNeedsUpdate=!0)}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,i=e.objectName,n=e.propertyName;let s=e.propertyIndex;if(t||(t=Ol.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return;if(i){let n=e.objectIndex;if(void 0===t[i])return;if(t=t[i],void 0!==n){if(void 0===t[n])return;t=t[n]}}if(!t)return;const r=t[n];if(void 0===r)return void e.nodeName;let a=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;void 0!==s?(o=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=s):void 0!==r.fromArray&&void 0!==r.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(o=this.BindingType.EntireArray,this.resolvedProperty=r):r&&Za.isColor(r)?(o=this.BindingType.ColorString,this.resolvedProperty=r,this.propertyName=n):this.propertyName=n,this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=void 0,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}const Pl="\\[\\]\\.:\\/",Ll=new RegExp("["+Pl+"]","g"),Rl="[^"+Pl+"]",zl="[^"+Pl.replace("\\.","")+"]",Ul=/((?:WC+[\/:])*)/.source.replace("WC",Rl),Fl=/(WCOD+)?/.source.replace("WCOD",zl),Wl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Rl),ql=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Rl),Hl=new RegExp("^"+Ul+Fl+Wl+ql+"$"),Vl=["material","materials","bones","map","mat","mtl","geo","l"],jl=new Za;class Yl{constructor(t,e,i){let n,s,r;switch(d(this,"binding"),d(this,"valueSize"),d(this,"buffer"),d(this,"_workIndex",0),d(this,"_mixBufferRegion"),d(this,"_mixBufferRegionAdditive"),d(this,"_setIdentity"),d(this,"_origIndex",3),d(this,"_addIndex",4),d(this,"_cacheIndex"),d(this,"cumulativeWeight",0),d(this,"cumulativeWeightAdditive",0),d(this,"useCount",0),d(this,"referenceCount",0),this.binding=t,this.valueSize=i,e){case"fill":case"stroke":case"textFill":case"string":case"bool":n=this._select,s=this._select,r=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,s=this._lerpAdditive,r=this._setAdditiveIdentityNumeric,this.buffer=new Float32Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=s,this._setIdentity=r,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const i=this.buffer,n=this.valueSize,s=t*n+n;let r=this.cumulativeWeight;if(0===r){for(let t=0;t!==n;++t)i[s+t]=i[t];r=e}else{r+=e;const t=e/r;this._mixBufferRegion(i,s,0,t,n)}this.cumulativeWeight=r}accumulateAdditive(t){const e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,i=this.buffer,n=t*e+e,s=this.cumulativeWeight,r=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-s,e)}r>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,s=e+e;t!==s;++t)if(i[t]!==i[t+e]){a.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,s=n;t!==s;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,n,s){if(n>=.5)for(let n=0;n!==s;++n)t[e+n]=t[i+n]}_lerp(t,e,i,n,s){const r=1-n;for(let a=0;a!==s;++a){const s=e+a;t[s]=t[s]*r+t[i+a]*n}}_lerpAdditive(t,e,i,n,s){for(let r=0;r!==s;++r){const s=e+r;t[s]=t[s]+t[i+r]*n}}}const Gl=2400,Xl=2401;class Zl{constructor(t,e,i,n=e.blendMode){d(this,"blendMode"),d(this,"loop",2201),d(this,"time",0),d(this,"timeScale",1),d(this,"weight",1),d(this,"repetitions",1/0),d(this,"paused",!1),d(this,"enabled",!0),d(this,"clampWhenFinished",!1),d(this,"zeroSlopeAtStart",!0),d(this,"zeroSlopeAtEnd",!0),d(this,"_mixer"),d(this,"_clip"),d(this,"_localRoot"),d(this,"_interpolantSettings"),d(this,"_interpolants"),d(this,"_propertyBindings"),d(this,"_cacheIndex"),d(this,"_byClipCacheIndex"),d(this,"_timeScaleInterpolant"),d(this,"_weightInterpolant"),d(this,"_loopCount",-1),d(this,"_startTime"),d(this,"_effectiveTimeScale",1),d(this,"_effectiveWeight",1),this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const s=e.tracks,r=s.length,a=new Array(r),o={endingStart:Gl,endingEnd:Gl};for(let t=0;t!==r;++t){const e=s[t].createInterpolant();e&&(a[t]=e,e.settings=o)}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r)}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=void 0,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&void 0===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}stopFading(){const t=this._weightInterpolant;return void 0!==t&&(this._weightInterpolant=void 0,this._mixer._takeBackControlInterpolant(t)),this}stopWarping(){const t=this._timeScaleInterpolant;return void 0!==t&&(this._timeScaleInterpolant=void 0,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const s=this._startTime;if(void 0!==s){const n=(t-s)*i;n<0||0===i?e=0:(this._startTime=void 0,e=i*n)}e*=this._updateTimeScale(t);const r=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(r),e[i].accumulateAdditive(a);else for(let i=0,s=t.length;i!==s;++i)t[i].evaluate(r),e[i].accumulate(n,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(void 0!==i){const n=i.evaluate(t)[0];e*=Number(n),t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(void 0!==i){const n=i.evaluate(t)[0];e*=Number(n),t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,s=this._loopCount;const r=2202===i;if(0===t)return-1===s||!r||1&~s?n:e-n;if(2200===i){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",data:{action:this,direction:t<0?-1:1}})}}else{if(-1===s&&(t>=0?(s=0,this._setEndings(!0,0===this.repetitions,r)):this._setEndings(0===this.repetitions,!0,r)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,s+=Math.abs(i);const a=this.repetitions-s;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",data:{action:this,direction:t>0?1:-1}});else{if(1===a){const e=t<0;this._setEndings(e,!e,r)}else this._setEndings(!1,!1,r);this._loopCount=s,this.time=n,this._mixer.dispatchEvent({type:"loop",data:{action:this,loopDelta:i}})}}else this.time=n;if(r&&!(1&~s))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=Xl,n.endingEnd=Xl):(n.endingStart=t?this.zeroSlopeAtStart?Xl:Gl:2402,n.endingEnd=e?this.zeroSlopeAtEnd?Xl:Gl:2402)}}const $l=new Float32Array(1);class Jl extends hi{constructor(t){super(),d(this,"stats"),d(this,"time",0),d(this,"timeScale",1),d(this,"_root"),d(this,"_accuIndex",0),d(this,"_actions",[]),d(this,"_nActiveActions",0),d(this,"_actionsByClip",{}),d(this,"_bindings",[]),d(this,"_nActiveBindings",0),d(this,"_bindingsByRootAndName",{}),d(this,"_controlInterpolants",[]),d(this,"_nActiveControlInterpolants",0),this._root=t,this._initMemoryManager()}destroy(){super.destroy(),this.stopAllAction(),this._root=void 0}dispose(){this._root=void 0}bind(t){t&&(this._root=t)}_bindAction(t,e){if(!this._root)return;const i=t._localRoot||this._root,n=t._clip.tracks,s=n.length,r=t._propertyBindings,a=t._interpolants,o=i.uuid,h=this._bindingsByRootAndName;let l=h[o];void 0===l&&(l={},h[o]=l);for(let t=0;t!==s;++t){const s=n[t],h=s.name;let u=l[h];if(void 0===u){if(u=r[t],void 0!==u){void 0===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,h));continue}const n=e&&e._propertyBindings[t].binding.parsedPath,a=s.getValueSize();u=new Yl(Ol.create(i,h,n),s.ValueTypeName,a),++u.referenceCount,this._addInactiveBinding(u,o,h),r[t]=u}else++u.referenceCount,r[t]=u;a[t].resultBuffer=u.buffer}}_activateAction(t){if(this._root&&!this._isActiveAction(t)){if(void 0===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return void 0!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){const n=this._actions,s=this._actionsByClip;let r=s[e];if(void 0===r)r={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,s[e]=r;else{const e=r.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),r.actionByRoot[i]=t}_removeInactiveAction(t){if(!this._root)return;const e=this._actions,i=e[e.length-1],n=t._cacheIndex||0;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=void 0;const s=t._clip.uuid,r=this._actionsByClip,a=r[s],o=a.knownActions,h=o[o.length-1],l=t._byClipCacheIndex||0;h._byClipCacheIndex=l,o[l]=h,o.pop(),t._byClipCacheIndex=void 0,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===o.length&&delete r[s],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){if(void 0===t._cacheIndex)return;const e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_takeBackAction(t){if(void 0===t._cacheIndex)return;const e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_addInactiveBinding(t,e,i){const n=this._bindingsByRootAndName,s=this._bindings;let r=n[e];void 0===r&&(r={},n[e]=r),r[i]=t,t._cacheIndex=s.length,s.push(t)}_removeInactiveBinding(t){var e;const i=this._bindings,n=t.binding,s=(null==(e=n.rootNode)?void 0:e.uuid)||"",r=n.path,a=this._bindingsByRootAndName,o=a[s],h=i[i.length-1],l=t._cacheIndex||0;h._cacheIndex=l,i[l]=h,i.pop(),delete o[r],0===Object.keys(o).length&&delete a[s]}_lendBinding(t){if(void 0===t._cacheIndex)return;const e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_takeBackBinding(t){if(void 0===t._cacheIndex)return;const e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new xl(new Float32Array(2),new Float32Array(2),1,$l),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){if(void 0===t.__cacheIndex)return;const e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,s=e[n];t.__cacheIndex=n,e[n]=t,s.__cacheIndex=i,e[i]=s}clipAction(t,e,i){if(!this._root)return;const n=e||this._root,s=n.uuid;let r;r="string"==typeof t?Dl.findByName(n,t):t;const a=r?r.uuid:"",o=this._actionsByClip[a];let h;if(void 0===i&&(i=r?r.blendMode:Bl),void 0!==o){const t=o.actionByRoot[s];if(void 0!==t&&t.blendMode===i)return t;h=o.knownActions[0],void 0===r&&(r=h._clip)}if(void 0===r)return;const l=new Zl(this,r,e,i);return this._bindAction(l,h),this._addInactiveAction(l,a,s),l}existingAction(t,e){if(!this._root)return;const i=e||this._root,n=i.uuid;let s="string"==typeof t?Dl.findByName(i,t):t;const r=s?s.uuid:"",a=this._actionsByClip[r];return void 0!==a&&a.actionByRoot[n]||void 0}removeAction(t){t&&this._deactivateAction(t)}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,s=Math.sign(t),r=this._accuIndex^=1;for(let a=0;a!==i;++a)e[a]._update(n,t,s,r);const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(r);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,i=t.uuid,n=this._actionsByClip,s=n[i];if(void 0!==s){const t=s.knownActions;for(let i=0,n=t.length;i!==n;++i){const n=t[i];this._deactivateAction(n);const s=n._cacheIndex||0,r=e[e.length-1];n._cacheIndex=void 0,n._byClipCacheIndex=void 0,r._cacheIndex=s,e[s]=r,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(t){const e=t.uuid,i=this._actionsByClip;for(const t in i){const n=i[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[e];if(void 0!==n)for(const t in n){const e=n[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const i=this.existingAction(t,e);void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class Ql extends Ia{constructor(t,e={}){var i,n;let s;s=ho.parse(t),mi.set(e,"use3DShape",Kl);const r=mh.getShapesByParsed(s,e);if(!(null==r?void 0:r.length))throw new Error(`Svg: no shapes: ${t}`);super(null==(i=null==r?void 0:r[0])?void 0:i.geo,null==(n=null==r?void 0:r[0])?void 0:n.mtl),d(this,"name","Svg"),d(this,"composeNode",!0),(null==r?void 0:r.length)>1&&this.adds(r.slice(1))}}const Kl=!1;class tu extends Ia{constructor(t){const e=new ao(t),i=new Aa(t);(null==t?void 0:t.lineWidth)||(i.lineWidth=1),super(e,i),d(this,"name","Polygon")}}class eu extends pl{constructor(t={}){var e,i;super(),d(this,"isLoadingScene",!0),d(this,"name","LoadingScene"),d(this,"params"),d(this,"loadingShape"),d(this,"lineShape"),d(this,"triangleShape"),d(this,"scales",[.95,1.15,.002]),d(this,"l",0),d(this,"scaleTrend",!1),d(this,"clock",new Xh),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.loadingShape=new Ql(iu,{fill:Fa,flipY:!0}),this.loadingShape.name="loading",this.loadingShape.dynamically=!0,this.add(this.loadingShape),this.loadingShape.setScale(.5,.5).updateMatrix(),this.loadingShape.updateMatrixWorld(),this.loadingShape.computeBoundingBox(),this.loadingShape.updateBoundingBox(),ru.copy(this.loadingShape.boundingBoxWorld).getCenter(nu),ru.getSize(su),this.loadingShape.setPosition(nu.negate()).updateMatrix(),this.l=su.x;const n=Math.max(Math.floor(this.l/30),3),s=[-this.l/2,-(8+n),-this.l/2,-8,this.l/2,-8,this.l/2,-(8+n)];this.lineShape=new tu({points:s,fill:Fa}),this.add(this.lineShape),this.lineShape.name="loadingLine";const r=[0,0,su.x/2,su.x,su.x,0];this.triangleShape=new tu({points:r,fill:Ra}),this.add(this.triangleShape),this.triangleShape.name="loadingTriangle",this.triangleShape.setPosition(new Oi(-.12*su.x,su.y/-.36)).setScale(.25,.15).updateMatrix(),this.computeBoundingBox(),this.mixer=new Jl(this);const a=new El(`${this.loadingShape.name}.mtl.fill`,[0,1.2,2],[0,0,0,.7,.38,.38,.38,.6,0,0,0,.7]),o=new Al(`${this.triangleShape.name}.mtl.fillOpacity`,[0,1.5,3],[1,.1,1],Al.DefaultInterpolation),h=new El(`${this.lineShape.name}.scaled`,[0,.3,1],[1,1,.1,1,1,1]);this._selectedClip=new Dl("selected",3,[a,o,h]),this.selectedAction=null==(e=this.mixer)?void 0:e.clipAction(this._selectedClip,this.desScene),null==(i=this.selectedAction)||i.play()}destroy(){super.destroy()}onBeforeRender(){this.lineShape.updateMatrix()}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta())}}const iu='\n<path d="M0 20.7L0 0L7.272 0L7.272 18L20.592 18L19.08 20.7L0 20.7\nM30.78 2.772L30.78 17.928L41.4 17.928L41.4 0L48.708 0L48.708 20.7L23.472 20.7L23.472 0L41.4 0L38.88 2.772L30.78 2.772\nM62.388 12.924L71.028 12.924L68.904 15.768L61.2 15.768L59.292 20.7L51.588 20.7L59.94 0L73.188 0L81.576 20.7L73.944 20.7L71.028 12.924L67.14 2.772L65.988 2.772L62.388 12.924\nM109.728 17.784L106.884 20.7L84.456 20.7L84.456 0L102.528 0L99.972 2.844L91.656 2.844L91.656 17.928L102.528 17.928L102.528 0L107.136 0L109.728 2.7L109.728 17.784\nM119.628 20.7L112.608 20.7L112.608 0L119.628 0L119.628 20.7\nM139.752 20.7L129.78 6.3L129.78 20.7L122.508 20.7L122.508 0L130.644 0L140.58 14.652L140.58 0L147.78 0L147.78 20.7L139.752 20.7\nM168.732 18L168.732 10.728L163.368 10.728L163.368 7.992L175.932 7.992L175.932 20.7L168.732 20.7L168.732 18.504L166.572 20.7L150.66 20.7L150.66 0L176.04 0L174.456 2.7L158.04 2.7L158.04 18L168.732 18\nZ">\n</path>\n',nu=new Oi,su=new Oi,ru=new Ri,au=new Oi;class ou extends wn{constructor(t){super(),d(this,"isCamera",!0),d(this,"type","Camera2"),d(this,"name","Camera2"),d(this,"params"),d(this,"matrixAutoUpdate",!1),d(this,"matrixWorldAutoUpdate",!1),d(this,"projectionMatrix",new Gi),d(this,"projectionMatrixInverse",new Gi),d(this,"viewMatrix",new Gi),d(this,"viewMatrixNeedsUpdate",!0),d(this,"viewArea",0),d(this,"left",-1),d(this,"right",1),d(this,"top",1),d(this,"bottom",-1),d(this,"width",2),d(this,"height",2),d(this,"aspect",1),d(this,"view"),this.params=t,this.width=void 0!==(null==t?void 0:t.width)?t.width:2,this.height=void 0!==(null==t?void 0:t.height)?t.height:2,this.aspect=void 0!==(null==t?void 0:t.aspect)?t.aspect:1,void 0!==(null==t?void 0:t.left)&&(this.left=t.left),void 0!==(null==t?void 0:t.right)&&(this.right=t.right),void 0!==(null==t?void 0:t.top)&&(this.top=t.top),void 0!==(null==t?void 0:t.bottom)&&(this.bottom=t.bottom);const e=(this.right+this.left)/2,i=(this.top+this.bottom)/2;if(this.aspect>1){const t=Math.round((this.right-this.left)/2/this.aspect);this.top=i+t,this.bottom=i-t}else if(this.aspect<1){const t=Math.round((this.top-this.bottom)/2*this.aspect);this.left=e-t,this.right=e+t}this.flipY=!0===(null==t?void 0:t.flipY),this.updateProjectionMatrix(),(null==t?void 0:t.eye)&&this.position.fromArray(t.eye),(null==t?void 0:t.up)&&this.up.fromArray(t.up),this.computeBoundingBox(),this.update()}destroy(){super.destroy()}get pixelWidth(){return this.scaled.x}set(t=-1,e=1,i=1,n=-1){au.set(t+e,n+i).multiplyScalar(.5);const s=Math.max((e-t)/this.width,(i-n)/this.height);this.setTRS(au,0,s)}setByBox(t){t&&!t.isEmpty()&&this.set(t.min.x,t.max.x,t.max.y,t.min.y)}setTRS(t={x:0,y:0},e=0,i=0){this.position.set(t.x||0,t.y||0),this.rotation.set(e,e),this.scaled.set(i,i),this.update()}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.width=t||2,this.height=e||2,this.left=this.params.left||-1,this.right=this.params.right||1,this.top=this.params.top||1,this.bottom=this.params.bottom||-1,this.aspect=t/e;const i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;if(this.aspect>1){const t=Math.round((this.right-this.left)/2/this.aspect);this.top=n+t,this.bottom=n-t}else if(this.aspect<1){const t=Math.round((this.top-this.bottom)/2*this.aspect);this.left=i-t,this.right=i+t}this.updateProjectionMatrix(),this.boundingBox.min.set(this.left,this.bottom),this.boundingBox.max.set(this.right,this.top),this.update(),this.matrix.decompose(this.position,this.rotation,this.scaled)}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[6],-e[7]).normalize()}getCameraPosition(){return{x:this.position.x,y:this.position.y,z:this.position.z,s:this.scaled.x,r:this.rotation.x}}updateMatrixWorld(t=!1){super.updateMatrixWorld(t),this.updateViewMatrix()}updateProjectionMatrix(){void 0===this.parent&&this.matrixWorldAutoUpdate&&this.updateMatrixWorld(),this.projectionMatrix.makeProjection(this.left,this.right,this.top,this.bottom,this.width,this.height),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}updateViewMatrix(){this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.viewMatrix.multiplyMatrices(this.projectionMatrix,this.matrixWorldInverse)}update(t=!0){this.matrixAutoUpdate||this.updateMatrix(),this.updateMatrixWorld(),this.needsUpdate=!0,this.updateBoundingBox(),t&&this.dispatchEvent({type:"update",data:{t:this.position,r:this.rotation.x,s:this.scaled.x}})}computeBoundingBox(){return this.boundingBox.min.set(this.left,this.bottom),this.boundingBox.max.set(this.right,this.top),this.boundingBox}updateBoundingBox(){super.updateBoundingBox(),this.viewArea=this.boundingBoxWorld.getArea()}toJSON(){const t={};return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.width=this.width,t.height=this.height,t.aspect=this.aspect,t.position=this.position.toArray(),t.rotation=this.rotation.toArray(),t.scaled=this.scaled.toArray(),t}fromJSON(t){this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.position.fromArray(t.position),this.rotation.fromArray(t.rotation),this.scaled.fromArray(t.scaled),this.updateProjectionMatrix(),this.update(!1)}clone(){return(new this.constructor.prototype.constructor).copy(this)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}}var hu=(t=>(t.UPDATE="update",t))(hu||{}),lu=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-lu.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*lu.Bounce.In(2*t):.5*lu.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),uu=function(){return performance.now()},cu=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var n=0,s=e;n<s.length;n++){var r=s[n];null===(t=r._group)||void 0===t||t.remove(r),r._group=this,this._tweens[r.getId()]=r,this._tweensAddedDuringUpdate[r.getId()]=r}},t.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var s=n[i];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},t.prototype.allStopped=function(){return this.getAll().every((function(t){return!t.isPlaying()}))},t.prototype.update=function(t,e){void 0===t&&(t=uu()),void 0===e&&(e=!0);var i=Object.keys(this._tweens);if(0!==i.length)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var s=this._tweens[i[n]],r=!e;s&&!1===s.update(t,r)&&!e&&this.remove(s)}i=Object.keys(this._tweensAddedDuringUpdate)}},t}(),du={Linear:function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n),r=du.Utils.Linear;return e<0?r(t[0],t[1],n):e>1?r(t[i],t[i-1],i-n):r(t[s],t[s+1>i?i:s+1],n-s)},Utils:{Linear:function(t,e,i){return(e-t)*i+t}}},pu=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),fu=new cu,mu=function(){function t(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=lu.Linear.None,this._interpolationFunction=du.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=pu.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,"object"==typeof e?(this._group=e,e.add(this)):!0===e&&(this._group=fu,fu.add(this))}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=uu()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var i in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var s in this._valuesEnd)n[s]=this._valuesEnd[s];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,i,n,s){for(var r in i){var a=t[r],o=Array.isArray(a),h=o?"array":typeof a,l=!o&&Array.isArray(i[r]);if("undefined"!==h&&"function"!==h){if(l){if(0===(y=i[r]).length)continue;for(var u=[a],c=0,d=y.length;c<d;c+=1){var p=this._handleRelativeValue(a,y[c]);if(isNaN(p)){l=!1;break}u.push(p)}l&&(i[r]=u)}if("object"!==h&&!o||!a||l)(void 0===e[r]||s)&&(e[r]=a),o||(e[r]*=1),n[r]=l?i[r].slice().reverse():e[r]||0;else{e[r]=o?[]:{};var f=a;for(var m in f)e[r][m]=f[m];n[r]=o?[]:{};var y=i[r];if(!this._isDynamic){var g={};for(var m in y)g[m]=y[m];i[r]=y=g}this._setupProperties(f,e[r],y,n[r],s)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(t){return void 0===t&&(t=uu()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t),this},t.prototype.resume=function(t){return void 0===t&&(t=uu()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return t?(t.add(this),this):this},t.prototype.remove=function(){var t;return null===(t=this._group)||void 0===t||t.remove(this),this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=lu.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=du.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(e,i){var n,s,r=this;if(void 0===e&&(e=uu()),void 0===i&&(i=t.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!i)return!1;this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,o=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),h=this._duration+this._repeat*o,l=function(){if(0===r._duration)return 1;if(a>h)return 1;var t=Math.trunc(a/o),e=a-t*o,i=Math.min(e/r._duration,1);return 0===i&&a===r._duration?1:i}(),u=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||a>=this._duration){if(this._repeat>0){var c=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(s in isFinite(this._repeat)&&(this._repeat-=c),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[s]||(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*c,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var d=0,p=this._chainedTweens.length;d<p;d++)this._chainedTweens[d].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,i,n){for(var s in i)if(void 0!==e[s]){var r=e[s]||0,a=i[s],o=Array.isArray(t[s]),h=Array.isArray(a);!o&&h?t[s]=this._interpolationFunction(a,n):"object"==typeof a&&a?this._updateProperties(t[s],r,a,n):"number"==typeof(a=this._handleRelativeValue(r,a))&&(t[s]=r+(a-r)*n)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof i?this._valuesStartRepeat[t]+parseFloat(i):this._valuesEnd[t],this._valuesEnd[t]=e},t.autoStartOnUpdate=!1,t}();pu.nextId;var yu=fu;yu.getAll.bind(yu),yu.removeAll.bind(yu),yu.add.bind(yu),yu.remove.bind(yu),yu.update.bind(yu),t={Easing:lu,Tween:mu};class gu extends hi{constructor(t,e){super(),d(this,"name","OrbitControls2"),d(this,"isSvg",!1),d(this,"dom"),d(this,"domOffset",new Oi),d(this,"camera"),d(this,"enabled",!0),d(this,"enablePan",!0),d(this,"enableRotate",!0),d(this,"rotateSpeed",1),d(this,"enableZoom",!0),d(this,"minZoom",0),d(this,"maxZoom",1/0),d(this,"zoomSpeed",1),d(this,"zoomChanged",!1),d(this,"distanceStart",1),d(this,"distanceEnd",1),d(this,"state",-1),d(this,"EPS",1e-6),d(this,"focus",new Oi),d(this,"target",new Oi),d(this,"scaled",1),d(this,"rotateTheta",0),d(this,"enableDamping",!1),d(this,"dampingFactor",.05),d(this,"mouseButtons",{LEFT:2,MIDDLE:1,RIGHT:0}),d(this,"isWheeling",!1),d(this,"finalTimer"),d(this,"rotateStart",new Oi),d(this,"rotateEnd",new Oi),d(this,"rotateDelta",new Oi),d(this,"panStart",new Oi),d(this,"panEnd",new Oi),d(this,"panOffset",new Oi),d(this,"dollyStart",0),d(this,"dollyOffset",new Oi),d(this,"contextMenuHandler",this.handleContextMenu.bind(this)),d(this,"wheelHandler",this.handleWheel.bind(this)),d(this,"pointerDownHandler",this.handlePointerDown.bind(this)),d(this,"pointerUpHandler",this.handlePointerUp.bind(this)),d(this,"pointerMoveHandler",this.handlePointerMove.bind(this)),d(this,"pointerOverHandler",mi.debounce(this.handlePointerOver.bind(this),100)),d(this,"pointerLeaveHandler",this.handlePointerLeave.bind(this)),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"panHandler",this.handlePan.bind(this)),d(this,"pinchHandler",this.handlePinch.bind(this)),d(this,"pressHandler",this.handlePress.bind(this)),d(this,"swipeHandler",this.handleSwipe.bind(this)),d(this,"hammerInputHandler",this.handleHammerInput.bind(this)),this.dom=t,this.camera=e,this.scaled=e.scaled.x,this.resize(),this.dom.style.touchAction="none",this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}update(){this.camera.position.add(this.panOffset).add(this.dollyOffset),this.camera.scaled.set(this.scaled,this.scaled),this.rotateTheta&&(this.camera.rotation.x-=this.rotateTheta,vu.copy(this.camera.position).rotateAround(this.focus,-this.rotateTheta),this.camera.position.copy(vu)),this.camera.update(),this.panOffset.set(0,0),this.dollyOffset.set(0,0),this.scaled=this.camera.scaled.x,this.rotateTheta=0,this.dispatchEvent({type:"cameraChanged",data:{t:this.camera.position,r:this.camera.rotation.x,s:this.camera.scaled.x}})}bindEvents(){this.unbindEvents(),this.dom.addEventListener("panstart",this.panHandler),this.dom.addEventListener("panmove",this.panHandler),this.dom.addEventListener("panend",this.panHandler),this.dom.addEventListener("pinchstart",this.pinchHandler),this.dom.addEventListener("pinchmove",this.pinchHandler),this.dom.addEventListener("pinchend",this.pinchHandler),this.dom.addEventListener("singletap",this.tapHandler),this.dom.addEventListener("press",this.pressHandler),this.dom.addEventListener("hammer.input",this.hammerInputHandler),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("wheel",this.wheelHandler,{passive:!1}),this.dom.addEventListener("mousemove",this.pointerOverHandler)}unbindEvents(){this.dom.removeEventListener("panstart",this.panHandler),this.dom.removeEventListener("panmove",this.panHandler),this.dom.removeEventListener("panend",this.panHandler),this.dom.removeEventListener("pinchstart",this.pinchHandler),this.dom.removeEventListener("pinchmove",this.pinchHandler),this.dom.removeEventListener("pinchend",this.pinchHandler),this.dom.removeEventListener("singletap",this.tapHandler),this.dom.removeEventListener("press",this.pressHandler),this.dom.removeEventListener("hammer.input",this.hammerInputHandler),this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("wheel",this.wheelHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler)}setFocus(t,e){this.focus.set(t,e).sub(this.domOffset).unproject(this.camera)}handleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),xu.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"tap",data:{screenCoords:{x:xu.x,y:xu.y}},e:t})}handleDoubleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),xu.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"doubletap",data:{screenCoords:{x:xu.x,y:xu.y}}})}handlePress(t){"function"==typeof t.preventDefault&&t.preventDefault()}handlePan(t){var e;if(this.scaled=this.camera.scaled.x,1!==(null==(e=t.pointers)?void 0:e.length))return;"function"==typeof t.preventDefault&&t.preventDefault();const i={type:"panmove",data:{}};(t.isFirst||"panstart"===t.type)&&(this.state=2,this.panStart.set(t.center.x,t.center.y),i.type="panstart"),(t.isFinal||"panend"===t.type)&&(this.state=-1,i.type="panend"),this.panEnd.set(t.center.x,t.center.y),this.panOffset.subVectors(this.panEnd,this.panStart).multiplyScalar(-this.camera.scaled.x,-this.camera.scaled.y*(this.camera.flipY?1:-1)).rotate(this.camera.rotation.x),this.panStart.copy(this.panEnd),xu.set(t.center.x,t.center.y).sub(this.domOffset),i.data.screenCoords=xu.clone(),this.dispatchEvent(i),this.enablePan&&this.update()}handlePinch(t){"function"==typeof t.preventDefault&&t.preventDefault(),"pinchstart"===t.type&&(this.dollyStart=this.camera.scaled.x,this.state=1),(t.isFinal||"pinchend"===t.type)&&(this.state=-1),this.scaled=this.dollyStart*(1/t.scale);let e=(this.scaled-this.camera.scaled.x)/this.camera.scaled.x;this.setFocus(t.center.x,t.center.y),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-e).sub(this.camera.position),this.update()}handleRotate(t){"function"==typeof t.preventDefault&&t.preventDefault()}handleSwipe(t){"function"==typeof t.preventDefault&&t.preventDefault()}handleHammerInput(t){t.isFirst&&(this.state=9),t.isFinal&&(this.state=-1)}handleContextMenu(t){this.enabled&&"function"==typeof t.preventDefault&&t.preventDefault()}handleWheel(t){if("function"==typeof t.preventDefault&&t.preventDefault(),!this.enabled||!this.enableZoom||-1!==this.state)return;this.isWheeling||(this.dispatchEvent({type:"wheelstart"}),this.isWheeling=!0),"function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation();let e=t.deltaY;1===(null==t?void 0:t.deltaMode)?e*=16:2===(null==t?void 0:t.deltaMode)&&(e*=100),(null==t?void 0:t.ctrlKey)&&(e*=10),this.setFocus(t.clientX,t.clientY);let i=this.getZoomScale(e);e<0?this.onDollyIn(i):e>0?this.onDollyOut(i):(this.scaled=this.camera.scaled.x,this.dollyOffset.set(0,0)),this.update(),clearTimeout(this.finalTimer),this.finalTimer=setTimeout((()=>{this.isWheeling&&(this.dispatchEvent({type:"wheelend"}),this.isWheeling=!1)}),500)}onDollyIn(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x*t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,1-t).sub(this.camera.position)}onDollyOut(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x/t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-1+t).sub(this.camera.position)}getZoomScale(t){return Math.pow(.95,this.zoomSpeed*Math.abs(.03*t))}handlePointerDown(t){if(this.scaled=this.camera.scaled.x,!this.enabled)return;if(2!==t.button)return;this.dom.addEventListener("pointermove",this.pointerMoveHandler),this.dom.addEventListener("pointerup",this.pointerUpHandler);let e=-1;0===t.button?e=this.mouseButtons.LEFT:1===t.button?e=this.mouseButtons.MIDDLE:2===t.button&&(e=this.mouseButtons.RIGHT),0===e&&(this.rotateStart.set(t.clientX,t.clientY),this.setFocus(this.rotateStart.x,this.rotateStart.y),this.state=0)}handlePointerUp(){this.dom.removeEventListener("pointermove",this.pointerMoveHandler),this.dom.removeEventListener("pointerup",this.pointerUpHandler),this.state=-1}handlePointerLeave(){this.state=-1}handlePointerMove(t){if(this.enabled&&0===this.state){if(!this.enableRotate)return;this.onRotate(t.clientX,t.clientY)}}handlePointerOver(t){t.buttons>0||(xu.set(t.clientX,t.clientY).sub(this.domOffset),this.dispatchEvent({type:"pointerover",data:{screenCoords:{x:xu.x,y:xu.y}},e:t}))}onRotate(t,e){this.rotateEnd.set(t,e),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const i=this.rotateDelta.x*Math.PI*2/this.dom.clientHeight;this.rotateTheta-=i,this.rotateStart.copy(this.rotateEnd),this.update()}}const vu=new Oi,xu=new Oi;var bu=(t=>(t.CONTEXTMENU="contextmenu",t.LOSTPOINTERCAPTURE="lostpointercapture",t.MOUSEOVER="mouseover",t.MOUSEOUT="mouseout",t.MOUSELEAVE="mouseleave",t.MOUSEENTER="mouseenter",t.MOUSEMOVE="mousemove",t.MOUSEDOWN="mousedown",t.MOUSEUP="mouseup",t.POINTERMOVE="pointermove",t.POINTERDOWN="pointerdown",t.POINTERUP="pointerup",t.POINTERCANCEL="pointercancel",t.POINTEROUT="pointerout",t.POINTERLEAVE="pointerleave",t.POINTEROVER="pointerover",t.POINTERENTER="pointerenter",t.TOUCHSTART="touchstart",t.TOUCHEND="touchend",t.TOUCHMOVE="touchmove",t.TOUCHCANCEL="touchcancel",t.WHEEL="wheel",t.WHEEL_START="wheelstart",t.WHEEL_END="wheelend",t.MOUSEWHEEL="mousewheel",t.CLICK="click",t.DBLCLICK="dblclick",t.CONTEXT_LOST="contextlost",t.CONTEXT_RESTORED="contextrestored",t.CONTROLS_CHANGED="controlschanged",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.PAN="pan",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t.ROTATE="rotate",t.ROTATE_START="rotatestart",t.ROTATE_MOVE="rotatemove",t.ROTATE_END="rotateend",t.PINCH="pinch",t.PINCH_START="pinchstart",t.PINCH_MOVE="pinchmove",t.PINCH_END="pinchend",t.PINCH_IN="pinchin",t.PINCH_OUT="pinchout",t.SWIPE="swipe",t.CHANGE_START="change_start",t.CHANGE_END="change_end",t.CAMERA_CHANGED="cameraChanged",t))(bu||{});class _u extends hi{constructor(t={}){var e,i;super(),d(this,"name","View"),d(this,"params"),d(this,"visible",!0),d(this,"cvs"),d(this,"scene"),d(this,"scenes",[]),d(this,"camera"),d(this,"controller"),d(this,"tween"),d(this,"animateDuration"),d(this,"controlsChangedHandler",this.handleControlsChanged.bind(this)),this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new ou(t.camera||{}),this.params.inpEl?this.controller=new gu(this.params.inpEl,this.camera):this.controller=new gu(this.cvs,this.camera),void 0!==(null==(e=this.params.controls)?void 0:e.enableRotate)&&(this.controller.enableRotate=!!(null==(i=this.params.controls)?void 0:i.enableRotate))}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach((t=>t.destroy())),this.scenes.length=0,super.destroy()}resize(){var t;this.camera.resize(),null==(t=this.controller)||t.resize()}setEnablePan(t){this.controller&&(this.controller.enablePan=!!t)}bindEvents(){var t;null==(t=this.controller)||t.addEventListener("change",this.controlsChangedHandler)}unbindEvents(){var t;null==(t=this.controller)||t.removeEventListener("change",this.controlsChangedHandler)}handleControlsChanged(t){}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}getCameraPosition(){return this.camera.boundingBoxWorld}setCameraPosition(t,e=!0){return Eu.copy(t),this.resetCameraByBoundingBox(Eu,e)}saveCameraPosition(t){Eu.copy(this.camera.boundingBoxWorld);const e=t?wu+t:wu;sessionStorage.setItem(e,JSON.stringify(Eu))}clearCameraPosition(t){const e=t?wu+t:wu;sessionStorage.setItem(e,"")}restoreCameraPosition(t){const e=t?wu+t:wu,i=sessionStorage.getItem(e);i&&(Eu.copy(JSON.parse(i)),this.resetCameraByBoundingBox(Eu,!0))}zoomIn(){Eu.copy(this.camera.boundingBoxWorld).getSize(Su),Eu.expandByScalar(-.1*Math.max(Su.x,Su.y)),this.resetCameraByBoundingBox(Eu,!0)}zoomOut(){this.controller&&(Eu.copy(this.camera.boundingBoxWorld).getSize(Su),Eu.expandByScalar(.1*Math.max(Su.x,Su.y)),this.resetCameraByBoundingBox(Eu,!0))}fullscreen(t=10,e=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),"function"==typeof this.scene.computeBoundingBox?Eu.copy(this.scene.computeBoundingBox()):Eu.copy(this.scene.boundingBox),Eu.expandByVector(Su.set(t,t)),this.resetCameraByBoundingBox(Eu,e))}handleCameraChanged(t){}reset(){}resetCameraByBoundingBox(t,e=!1){return p(this,null,(function*(){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(Su),t.getSize(Mu);const n=Math.max(Mu.x/this.camera.width,Mu.y/this.camera.height),s={x:Su.x,y:Su.y,z:0,s:n,r:0};yield this.animateCamera(i,s)}))}animateCamera(e,i){return p(this,null,(function*(){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise((n=>{this.tween=new t.Tween(e).to(i,this.animateDuration).easing(t.Easing.Exponential.Out).onUpdate((t=>{this.camera.position.set(t.x,t.y),this.camera.scaled.set(t.s,t.s),this.camera.rotation.set(t.r,t.r),this.camera.update()})).onComplete((()=>{this.controller&&(this.controller.enabled=!0),n()})).start()}))}))}computeBoundingBox(t,e=new Ri){return t&&t.length?(e.makeEmpty(),t.forEach((t=>e.union(t.computeBoundingBox()))),e):e}expandScenesBoundingBox(t,e=new Ri){t.forEach((t=>t.boundingBox.union(e)))}update(t){this.tween&&this.tween.update(t)}}const wu="camera_position_",Su=new Oi,Mu=new Oi,Eu=new Ri;class Au extends dl{constructor(){super(...arguments),d(this,"isStatic",!0),d(this,"featureKey","StaticScene_"+this.id),d(this,"cameraVersion",0),d(this,"dynamically",!1),d(this,"needsUpdateChangedHandler",this.handleNeedsUpdateChanged.bind(this))}handleNeedsUpdateChanged(){this.needsUpdate=!0}}class Tu extends ya{constructor(t){super(t),d(this,"name","GeoPolyline"),this._init(t),((null==t?void 0:t.stArrow)||(null==t?void 0:t.edArrow))&&(this.arrowLength=(null==t?void 0:t.arrowLength)||10,this.arrowDeg=(null==t?void 0:t.arrowDeg)||30)}buildPath(t,e,i){if(0===this.percent)return;let{points:n}=e||this;if(n&&n.length&&!(n.length<2)){for(let e=0,i=n.length;e<i;e+=2)e?t.lineTo(n[e],n[e+1]):t.moveTo(n[e],n[e+1]);this.addArrow(t)}}addArrow(t,e){const{points:i,stArrow:n,edArrow:s,arrowDeg:r,arrowLength:a}=this;if(!(null==i?void 0:i.length)||!n&&!s||!r)return this;if(e||(e=a),!e)return this;const o=i;if(!(null==o?void 0:o.length)||(null==o?void 0:o.length)<4)return this;if(n){if(Iu.set(o[2],o[3]),Du.set(o[0],o[1]),Iu.equals(Du))return this;Cu.subVectors(Iu,Du),Nu.lerpVectors(Du,Iu,e/Cu.length()),Bu.copy(Nu).rotateAround(Du,Bi(r)),ku.copy(Nu).rotateAround(Du,-Bi(r)),t.moveTo(Bu.x,Bu.y),t.lineTo(Du.x,Du.y),t.lineTo(ku.x,ku.y)}if(s){const i=o.length;if(Iu.set(o[i-4],o[i-3]),Du.set(o[i-2],o[i-1]),Iu.equals(Du))return this;Cu.subVectors(Iu,Du),Nu.lerpVectors(Du,Iu,e/Cu.length()),Bu.copy(Nu).rotateAround(Du,Bi(r)),ku.copy(Nu).rotateAround(Du,-Bi(r)),t.moveTo(Bu.x,Bu.y),t.lineTo(Du.x,Du.y),t.lineTo(ku.x,ku.y)}return this}}const Iu=new Oi,Cu=new Oi,Du=new Oi,Nu=new Oi,Bu=new Oi,ku=new Oi;class Ou extends Ia{constructor(t={}){(null==t?void 0:t.width)||(t.width=.5*Jr.config.width),(null==t?void 0:t.height)||(t.height=.5*Jr.config.height),(null==t?void 0:t.lineWidth)||(t.lineWidth=1),(null==t?void 0:t.stroke)||(t.stroke=Ra),(null==t?void 0:t.arrowDeg)||(t.arrowDeg=30),(null==t?void 0:t.arrowLength)||(t.arrowLength=10),(null==t?void 0:t.lineDash)||(t.lineDash=[10,7]),t.points=[-t.width,0,t.width,0,0,t.height,0,-t.height];const e=.5*(t.arrowLength||10);super(new ao({points:[-e,0,0,e,e,0,0,-e]}),new Aa({fill:Ra})),d(this,"name","Axes"),d(this,"params"),d(this,"xShape"),d(this,"yShape"),d(this,"xRShape"),d(this,"yRShape"),this.params=t,this.xShape=new Ia(new Tu({points:[2*e,0,t.width,0],linewidth:t.lineWidth,edArrow:!0,arrowLength:t.arrowLength,arrowDeg:t.arrowDeg}),new Aa({stroke:Ra,lineWidth:1})),this.yShape=new Ia(new Tu({points:[0,2*e,0,t.height],linewidth:t.lineWidth,edArrow:!0,arrowLength:t.arrowLength,arrowDeg:t.arrowDeg}),new Aa({stroke:ka,lineWidth:1})),this.xRShape=new Ia(new Tu({points:[-2*e,0,-t.width,0],linewidth:t.lineWidth}),new Aa({stroke:Ra,lineWidth:1,lineDash:t.lineDash})),this.yRShape=new Ia(new Tu({points:[0,-2*e,0,-t.height],linewidth:t.lineWidth}),new Aa({stroke:ka,lineWidth:1,lineDash:t.lineDash})),this.add(this.xShape),this.add(this.yShape),this.add(this.xRShape),this.add(this.yRShape),this.computeBoundingBox()}computeBoundingBox(){var t;return(null==(t=this.params)?void 0:t.fixed)?this.boundingBox.makeEmpty():super.computeBoundingBox(),this.boundingBox}updateModelViewMatrix(t){var e;(null==(e=this.params)?void 0:e.fixed)?t?(this.modelViewMatrix.copy(t.viewMatrix),this.computeAxes(t)):this.modelViewMatrix.copy(this.matrixWorld):super.updateModelViewMatrix(t)}computeAxes(t){if(!t)return;t.updateBoundingBox();const e=t.scaled.x,i=this.params.lineWidth*e,n=[this.params.lineDash[0]*e,this.params.lineDash[1]*e],s=(this.params.arrowLength||10)*e,r=s/4;this.xShape.geo.arrowLength=s,this.xShape.geo.setPoints([s+r,0,t.boundingBoxWorld.max.x,0]),this.xShape.geo.lineWidth=i,this.yShape.geo.arrowLength=s,this.yShape.geo.setPoints([0,s+r,0,t.boundingBoxWorld.max.y]),this.yShape.geo.lineWidth=i,this.xRShape.geo.setPoints([-s-r,0,t.boundingBoxWorld.min.x,0]),this.xRShape.geo.lineWidth=i,this.xRShape.mtl.lineDash=n,this.yRShape.geo.setPoints([0,-s-r,0,t.boundingBoxWorld.min.y]),this.yRShape.geo.lineWidth=i,this.yRShape.mtl.lineDash=n,this.geo.setPoints([-s,0,-r,r,0,s,r,r,s,0,r,-r,0,-s,-r,-r])}}class Pu extends Au{constructor(t={},e){super(),d(this,"isMainScene",!0),d(this,"name","MainScene"),d(this,"params"),d(this,"adapter"),d(this,"featureKey","MainScene_"+this.id),d(this,"axesHelper"),d(this,"resourcesMap",{}),d(this,"legend",[]),d(this,"_viewBox",new Ri),this.params=t,this.adapter=e,this.selectable=!0,this.initAxesHelper()}destroy(){var t;super.destroy(),this.resourcesMap={},this.legend=[],null==(t=this.axesHelper)||t.destroy()}initAxesHelper(){this.params.axesHelper&&(this.axesHelper&&this.axesHelper.destroy(),this.axesHelper=new Ou({fixed:!0,lineWidth:.5}),this.add(this.axesHelper))}setViewBox(t){t&&this._viewBox.copy(t)}computeBoundingBox(){return super.computeBoundingBox(),!this._viewBox.isEmpty()&&(this._viewBox.getCenter(Lu),this.boundingBox.getCenter(Ru),Math.round(Oi.getDistance(Lu,Ru)))?this._viewBox:this.boundingBox}getBoundingBox(){return this._viewBox.isEmpty()?this.boundingBox:this._viewBox}add(t){return super.add(t),t.userData.id?(this.resourcesMap[t.userData.id]||(this.resourcesMap[t.userData.id]=[]),this.resourcesMap[t.userData.id].push(t),this):this}remove(t){if(!t)return this;if(super.remove(t),this.resourcesMap[t.userData.id]){const e=this.resourcesMap[t.userData.id].indexOf(t);e>-1&&this.resourcesMap[t.userData.id].splice(e,1),this.resourcesMap[t.userData.id].length||delete this.resourcesMap[t.userData.id]}return this}getAssetIdsByType(t){const e=[];return this.traverse((i=>{i.userData.assetType===t&&i.userData.id&&e.push(i.userData.id)})),e}getByIds(t,e=[]){if(e.length=0,!t)return e;Array.isArray(t)||(t=[t]);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)Object.hasOwnProperty.call(this.resourcesMap,t[i])&&e.push(...this.resourcesMap[t[i]]);return e}setFillOrStrokeByIds(t,e,i="fill"){this.traverse((n=>{var s;if(!n.mtl||!t.includes(n.userData.id))return;const r=mi.cloneDeep(n.mtl);"fill"===i?r.fill=e:"stroke"===i&&(r.stroke=e,r.lineWidth=5),n.mtl=so.getMtl(r),this.addLegend(i,e,null==(s=n.userData)?void 0:s.id)})),this.needsUpdate=!0}clearFillOrStroke(t,e){this.traverse((i=>{var n,s,r,a,o,h;if(!i.mtl)return;if(e&&!e.includes(i.userData.id))return;const l=mi.cloneDeep(i.mtl);void 0!==t&&"fill"!==t||!(null==l?void 0:l.fill)||(l.fill=(null==(s=null==(n=i.userData)?void 0:n.style)?void 0:s.fill)||void 0),void 0!==t&&"stroke"!==t||!(null==l?void 0:l.stroke)||(l.stroke=(null==(a=null==(r=i.userData)?void 0:r.style)?void 0:a.stroke)||void 0,l.lineWidth=(null==(h=null==(o=i.userData)?void 0:o.style)?void 0:h.lineWidth)||1),i.mtl=so.getMtl(l)})),this.needsUpdate=!0,this.clearLegendBy(t)}increaseFontSize(t=1.1){this.traverse((e=>{var i;e.mtl&&e.isText&&(null==(i=e.mtl)?void 0:i.text)&&(e.scaled.multiplyScalar(t),e.updateMatrix(),e.needsUpdate=!0)}));const e=mi.uniq(mi.compact(mi.map(this.children,(t=>t.userData.aid))));this.recomputedAssetLabels(e),this.needsUpdate=!0}increaseStrokeWidth(t=1.1){this.traverse((e=>{var i;e.mtl&&(null==(i=e.mtl)?void 0:i.stroke)&&e.geo.lineWidth&&(e.geo.lineWidth*=t)})),this.needsUpdate=!0}addLegend(t,e,i){let n=this.legend.find((t=>t.color===e));n||(n={type:t,color:e,ids:[]},this.legend.push(n)),n.ids.push(i)}getLegend(){return this.legend}clearLegendBy(t){var e;t||(this.legend.length=0);for(let i=(null==(e=this.legend)?void 0:e.length)-1;i>=0;i--)this.legend[i].type===t&&this.legend.splice(i,i)}getAssetLabels(t,e){var i,n,s,r,a;const o=mi.filter(this.children,(t=>{var i;return(null==(i=t.userData)?void 0:i.aid)===e}));if(!(null==o?void 0:o.length))return;const h=[];for(let t,e=0,l=o.length;e<l;e++){t=o[e],(null==(i=t.mtl)?void 0:i.text)&&h.push(null==(n=t.mtl)?void 0:n.text);for(let e,i=0,n=(null==(s=null==t?void 0:t.children)?void 0:s.length)||0;i<n;i++)e=t.children[i],(null==(r=null==e?void 0:e.mtl)?void 0:r.text)&&h.push(null==(a=null==e?void 0:e.mtl)?void 0:a.text)}return h}setAssetLabels(t,e){if(!mi.find(this.children,(e=>{var i;return(null==(i=e.userData)?void 0:i.id)===t})))return;const i=mi.filter(this.children,(e=>{var i;return(null==(i=e.userData)?void 0:i.aid)===t}));if(!(null==i?void 0:i.length))return;const n=i[i.length-1];for(let t=0,s=((null==e?void 0:e.length)||0)-((i.length||0)-1);t<s;t++){const t=n.clone(!0,!0);this.add(t),t.updateMatrix(),i.push(t)}for(let t=1,n=(null==i?void 0:i.length)||0;t<n;t++){const n=i[t];n.mtl.text=(null==e?void 0:e.length)?e[t-1]:void 0,n.needsUpdate=!0}this.recomputedAssetLabels(t)}recomputedAssetLabels(t){if(t){Array.isArray(t)||(t=[t]);for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++){let i=mi.filter(this.children,(i=>{var n,s;return(null==(n=i.userData)?void 0:n.aid)===t[e]&&!!(null==(s=i.mtl)?void 0:s.text)}));if(!(null==i?void 0:i.length))return;for(let t,e=0,n=(null==i?void 0:i.length)||0;e<n;e++)t=i[e],t.computeBoundingBox(),t.updateBoundingBox(),zu.copy(t.boundingBoxWorld).getSize(Ru),Lu.copy(i[e?e-1:0].position),Ru.multiplyScalar(1.2),e&&(t.position.set(Lu.x,Lu.y-Ru.y),t.updateMatrix())}}}clearAssetLabels(t){const e=t?this.getAssetIdsByType(t):this.children.map((t=>t.userData.id&&t.userData.assetType));for(let t,i=0,n=(null==e?void 0:e.length)||0;i<n;i++)if(t=mi.filter(this.children,(t=>{var n;return(null==(n=t.userData)?void 0:n.aid)===e[i]})),(null==t?void 0:t.length)&&1!==t.length)for(let e=t.length-1;e>0;e--)t[e].destroy(),this.remove(t[e])}getAssetBoundingBox(t,e=new Ri){if(e.makeEmpty(),!t)return e;Array.isArray(t)||(t=[t]);for(let i,n=0,s=(null==t?void 0:t.length)||0;n<s;n++){i=t[n];const s=this.getByIds(i);if(null==s?void 0:s.length)for(let t=0,i=s.length;t<i;t++)e.union(s[t].boundingBoxWorld)}return e}setAssetType(t,e){var i,n;const s=[t];t!==dn.RM&&s.push(dn.RM);const r=null==(i=this.adapter)?void 0:i.getAssetIdsByType(s);(null==r?void 0:r.length)&&(null==(n=this.adapter)||n.updateLayersVisibility(r,!0))}}const Lu=new Oi,Ru=new Oi,zu=new Ri;class Uu extends pl{constructor(t={}){super(),d(this,"name","AnimateScene"),d(this,"params"),d(this,"resourcesMap",{}),d(this,"dynamicFill",La),d(this,"dynamicScale",new Oi(1,1)),d(this,"clock",new Xh),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.initAxesHelper(),this.mixer=new Jl(this)}destroy(){super.destroy()}initAxesHelper(){this.params.axesHelper&&(this.axesHelper&&this.axesHelper.destroy(),this.axesHelper=new Ou({fixed:!0,lineWidth:.5}),this.add(this.axesHelper))}add(t){return super.add(t),t.userData.id?(this.resourcesMap[t.userData.id]||(this.resourcesMap[t.userData.id]=[]),this.resourcesMap[t.userData.id].push(t),this):this}remove(t){if(!t)return this;if(super.remove(t),this.resourcesMap[t.userData.id]){const e=this.resourcesMap[t.userData.id].indexOf(t);e>-1&&this.resourcesMap[t.userData.id].splice(e,1),this.resourcesMap[t.userData.id].length||delete this.resourcesMap[t.userData.id]}return this}getByIds(t,e=[]){if(e.length=0,!t)return e;Array.isArray(t)||(t=[t]);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)Object.hasOwnProperty.call(this.resourcesMap,t[i])&&e.push(...this.resourcesMap[t[i]]);return e}getAssetBoundingBox(t,e=new Ri){if(e.makeEmpty(),!t)return e;Array.isArray(t)||(t=[t]);for(let i,n=0,s=(null==t?void 0:t.length)||0;n<s;n++){i=t[n];const s=this.getByIds(i);if(null==s?void 0:s.length)for(let t=0,i=s.length;t<i;t++)e.union(s[t].boundingBoxWorld)}return e}onBeforeRender(){}update(t){var e;null==(e=this.mixer)||e.update(this.clock.getDelta())}}class Fu extends pl{constructor(t={}){var e,i;super(),d(this,"isEmptyScene",!0),d(this,"name","EmptyScene"),d(this,"params"),d(this,"loadingShape"),d(this,"lineShape"),d(this,"triangleShape"),d(this,"scales",[.95,1.15,.002]),d(this,"l",0),d(this,"scaleTrend",!1),d(this,"clock",new Xh),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.loadingShape=new Ql(Wu,{fill:Fa,flipY:!0}),this.loadingShape.name="loading",this.loadingShape.dynamically=!0,this.add(this.loadingShape),this.loadingShape.updateMatrixWorld(),this.loadingShape.computeBoundingBox(),this.loadingShape.updateBoundingBox(),Vu.copy(this.loadingShape.boundingBoxWorld).getCenter(qu),Vu.getSize(Hu),this.loadingShape.setPosition(qu.negate()).updateMatrix(),this.l=Hu.x;const n=Math.max(Math.floor(this.l/30),2),s=[-this.l/2,-(10+n),-this.l/2,-10,this.l/2,-10,this.l/2,-(10+n)];this.lineShape=new tu({points:s,fill:Fa}),this.add(this.lineShape),this.lineShape.name="loadingLine";const r=[0,0,Hu.x/2,Hu.x,Hu.x,0];this.triangleShape=new tu({points:r,fill:Ra}),this.add(this.triangleShape),this.triangleShape.name="loadingTriangle",this.triangleShape.setPosition(new Oi(-.12*Hu.x,Hu.y/-.4)).setScale(.25,.15).updateMatrix(),this.computeBoundingBox(),this.mixer=new Jl(this);const a=new El(`${this.loadingShape.name}.mtl.fill`,[0,1.2,2],[0,0,0,.7,.38,.38,.38,.7,0,0,0,.7]),o=new Al(`${this.triangleShape.name}.mtl.fillOpacity`,[0,1.5,3],[1,.8,1],Al.DefaultInterpolation),h=new El(`${this.lineShape.name}.scaled`,[0,1.5,3],[1,1,.6,1,1,1]);this._selectedClip=new Dl("selected",3,[a,o,h]),this.selectedAction=null==(e=this.mixer)?void 0:e.clipAction(this._selectedClip,this.desScene),null==(i=this.selectedAction)||i.play()}destroy(){super.destroy()}onBeforeRender(){this.lineShape.updateMatrix()}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta())}}const Wu='\n<path d="M13.5 15.8L12.62 17.3L0.799999 17.3L0.799999 5.8L13.46 5.8L12.56 7.3L4.84 7.3L4.84 10.66L13.12 10.66L12.24 12.18L4.84 12.18L4.84 15.8L13.5 15.8Z\nM32.12 17.3L28.52 17.3L28.52 9.9L25.18 17.3L22.1 17.3L18.8 10L18.8 17.3L15.1 17.3L15.1 5.8L20.06 5.8L23.68 13.68L27.32 5.8L32.12 5.8L32.12 17.3Z\nM37.72 12.8L37.72 17.3L33.72 17.3L33.72 5.8L42.22 5.8L41.06 7.34L37.72 7.34L37.72 11.3L42.22 11.3L42.22 5.8L46.28 5.8L46.28 12.8L37.72 12.8Z\nM57 17.3L53 17.3L53 7.34L47.88 7.34L47.88 5.8L62.48 5.8L61.6 7.34L57 7.34L57 17.3Z\nM69.92 13.52L64.08 5.78L68.62 5.78L71.92 10.58L75.14 5.78L79.64 5.78L73.92 13.56L73.92 17.28L69.92 17.28L69.92 13.52Z" />\n',qu=new Oi,Hu=new Oi,Vu=new Ri;class ju{constructor(){d(this,"camera"),d(this,"screenCoords",new Oi),d(this,"worldCoords",new Oi),d(this,"worldBox",new Ri),d(this,"intersectType",0),d(this,"params",{Shape:{},Line:{threshold:1},Points:{threshold:1},Sprite:{}})}setFromCamera(t,e){return this.camera=e,this.screenCoords.set(t.x,t.y),this.worldCoords.copy(this.screenCoords).unproject(e),this}init(t,e){return this.camera=e,(null==t?void 0:t.screenCoords)&&this.screenCoords.set(t.screenCoords.x,t.screenCoords.y),(null==t?void 0:t.worldCoords)?this.worldCoords.set(t.worldCoords.x,t.worldCoords.y):e&&this.worldCoords.copy(this.screenCoords).unproject(e),(null==t?void 0:t.worldBox)&&this.worldBox.copy(t.worldBox),this.intersectType=void 0!==(null==t?void 0:t.worldBox)?1:0,this}intersectObjects(t,e=!0,i=[]){for(let n=0,s=t.length;n<s;n++)this.intersectObject(t[n],e,i)}intersectObject(t,e=!1,i=[]){if(!t.selectable||!t.visible)return i;if(t.raycast(this,i),!e||t.composeNode)return i;for(let n=0,s=t.children.length;n<s;n++)this.intersectObject(t.children[n],e,i);return i}intersectObjectBy(t,e,i=!0,n=[]){if(!t.selectable||!t.visible)return n;if("function"==typeof e&&e(t)&&t.raycast(this,n),!i||t.composeNode)return n;for(let s=0,r=t.children.length;s<r;s++)this.intersectObjectBy(t.children[s],e,i,n);return n}}class Yu extends hi{constructor(t,e){super(),d(this,"name","Handler"),d(this,"dom"),d(this,"camera"),d(this,"domOffset",new Oi),d(this,"enabled",!0),d(this,"_hoverEnabled",!1),d(this,"scenes",[]),d(this,"rayCaster",new ju),d(this,"contextMenuHandler",this.handleContextMenu.bind(this)),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"pointerOverHandler",mi.debounce(this.handlePointerOver.bind(this),20)),d(this,"panHandler",this.handlePan.bind(this)),d(this,"_hovered"),this.dom=t,this.camera=e,this.resize(),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.dispose()}dispose(){this.scenes=[]}enableHover(t){return this._hoverEnabled=t,this}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}bindScene(...t){return this.scenes.length=0,this.scenes.push(...t),this}bindEvents(){this.unbindEvents(),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("singletap",this.tapHandler),this.dom.addEventListener("panstart",this.panHandler),this.dom.addEventListener("panmove",this.panHandler),this.dom.addEventListener("panend",this.panHandler),this.dom.addEventListener("mousemove",this.pointerOverHandler)}unbindEvents(){this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("singletap",this.tapHandler),this.dom.removeEventListener("panstart",this.panHandler),this.dom.removeEventListener("panmove",this.panHandler),this.dom.removeEventListener("panend",this.panHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler)}handleContextMenu(t){this.enabled&&"function"==typeof t.preventDefault&&t.preventDefault()}handlePointerDown(t){}handlePointerMove(t){}handlePointerUp(t){}handleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),Zu.set(t.center.x,t.center.y).sub(this.domOffset),$u.copy(Zu).unproject(this.camera),this.dispatchEvent({type:"tap",data:{screenCoords:{x:Zu.x,y:Zu.y},worldCoords:{x:$u.x,y:$u.y}},e:t})}handlePan(t){var e,i;"function"==typeof t.preventDefault&&t.preventDefault(),Zu.set(null==(e=t.center)?void 0:e.x,null==(i=t.center)?void 0:i.y).sub(this.domOffset),$u.copy(Zu).unproject(this.camera);const n={screenCoords:{x:Zu.x,y:Zu.y},worldCoords:{x:$u.x,y:$u.y}},s={type:"panmove",data:n};(t.isFirst||"panstart"===t.type)&&(s.type="panstart"),(t.isLast||"panend"===t.type)&&(s.type="panend");const{id:r,target:a}=this.getHover(n);r&&mi.set(s,"data.id",r),a&&mi.set(s,"data.target",a),this.dispatchEvent(s)}handlePointerOver(t){if(!this._hoverEnabled||t.buttons>0)return;const e=this._hovered;Zu.set(t.clientX,t.clientY).sub(this.domOffset),$u.copy(Zu).unproject(this.camera);let i={screenCoords:{x:Zu.x,y:Zu.y},worldCoords:{x:$u.x,y:$u.y}};const n=this._hovered=this.getHover(i),s=u(u({},i),n);this.setCursor((null==n?void 0:n.target)?"pointer":"default"),(null==n?void 0:n.id)!==(null==e?void 0:e.id)&&(null==e?void 0:e.target)&&this.dispatchEventByTarget(e.target,{type:"pointerout",data:u(u({},i),e)}),(null==n?void 0:n.target)&&this.dispatchEventByTarget(n.target,{type:"pointermove",data:s}),(null==n?void 0:n.target)&&(null==n?void 0:n.target)!==(null==e?void 0:e.target)&&this.dispatchEventByTarget(n.target,{type:"pointerover",data:s}),this.dispatchEvent({type:"pointermove",data:s})}getHover(t){var e;const{screenCoords:i,worldCoords:n}=t||{},s={id:void 0,target:void 0},r=[],a=this.scenes.find((t=>t.isDynamic));if(a&&(this.rayCaster.init(t,this.camera).intersectObjectBy(a,Gu,!0,r),r.length))return s.isDynamic=!0,Xu(r,s),s;for(let i,n=0,s=(null==(e=this.scenes)?void 0:e.length)||0;n<s;n++)i=this.scenes[n],i.isDynamic||this.rayCaster.init(t,this.camera).intersectObjectBy(i,Gu,!0,r);return r.length&&(s.isStatic=!0,Xu(r,s)),s}dispatchEventByTarget(t,e){var i;if(!(null==t?void 0:t.visible))return;let n=!1;for(;t&&(n=null==(i=t.userData)?void 0:i.cancelBubble,"function"==typeof t.dispatchEvent&&t.dispatchEvent(e),t=t.parent,!n););n||this.dispatchEvent(e)}setCursor(t){this.dom instanceof si&&"function"==typeof self.postMessage?self.postMessage({type:"setCursor",cursorStyle:t}):this.dom.style&&(this.dom.style.cursor=t||"default")}}function Gu(t){return t.visible}function Xu(t,e={}){var i,n,s;let r=t.find((t=>{var e,i;return t.visible&&t.selectable&&(null==(e=t.userData)?void 0:e.assetType)===(null==(i=Jr.config)?void 0:i.assetType)}));return r?(e.id=(null==(i=r.userData)?void 0:i.id)||r.name,e.target=r,(null==(n=r.userData)?void 0:n.assetType)&&(e.assetType=null==(s=r.userData)?void 0:s.assetType),r.isDummy&&(e.isDummy=!0),e):e}const Zu=new Oi,$u=new Oi;var Ju=(t=>(t.CONTEXTMENU="contextmenu",t.MOUSEDOWN="mousedown",t.MOUSEMOVE="mousemove",t.MOUSEUP="mouseup",t.POINTERDOWN="pointerdown",t.POINTERMOVE="pointermove",t.POINTERUP="pointerup",t.POINTEROUT="pointerout",t.POINTEROVER="pointerover",t.TOUCHSTART="touchstart",t.TOUCHMOVE="touchmove",t.TOUCHEND="touchend",t.WHEEL="wheel",t.KEYDOWN="keydown",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.HOVER="hover",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t))(Ju||{}),Qu=(t=>(t[t.TIPS=1]="TIPS",t[t.HOVER=2]="HOVER",t[t.SELECT=4]="SELECT",t[t.SELECTOR_RECT=8]="SELECTOR_RECT",t[t.DISTRIBUTION=16]="DISTRIBUTION",t[t.DRAG=32]="DRAG",t[t.DUMMY=64]="DUMMY",t[t.LINKER=128]="LINKER",t[t.DRAW_POINT=1024]="DRAW_POINT",t[t.DRAW_POLYLINE=2048]="DRAW_POLYLINE",t[t.DRAW_POLYGON=4096]="DRAW_POLYGON",t[t.DRAW_TEXT=8192]="DRAW_TEXT",t))(Qu||{}),Ku=(t=>(t[t.DEFAULT=1]="DEFAULT",t[t.HOVER=3]="HOVER",t[t.PICKER=15]="PICKER",t[t.DISTRIBUTION=31]="DISTRIBUTION",t[t.DUMMY=119]="DUMMY",t[t.LINKER=135]="LINKER",t[t.DRAWING=15399]="DRAWING",t))(Ku||{}),tc=(t=>(t[t.HOVER=1]="HOVER",t[t.SELECT=2]="SELECT",t[t.HILIGHT=4]="HILIGHT",t[t.DYNAMIC_LINE=8]="DYNAMIC_LINE",t))(tc||{}),ec=(t=>(t[t.KEEP_ORIGIN=1]="KEEP_ORIGIN",t[t.MAKE_COPY=2]="MAKE_COPY",t))(ec||{}),ic=(t=>(t[t.NONE=0]="NONE",t[t.DEFAULT=1]="DEFAULT",t[t.MODIFIED=2]="MODIFIED",t[t.NEW=3]="NEW",t))(ic||{});class nc{constructor(t,i){d(this,"parent"),d(this,"view"),d(this,"scenes",[]),d(this,"oriScene"),d(this,"dstScene"),d(this,"_fnEnable",null==(e=Jr.config)?void 0:e.fnEnable),this.parent=t,this.view=i}fnEnableChanged(t){this._fnEnable=!!t}activate(){}deactivate(){this.scenes=[],this.oriScene=void 0,this.dstScene=void 0}bindScene(...t){return this.scenes.length=0,this.scenes.push(...t),this.oriScene=this.scenes.find((t=>t.isStatic)),this.dstScene=this.scenes.find((t=>t.isDynamic)),this}getDynamicObjectsByIds(t){var e,i,n;const s=[];if(null==(e=this.dstScene)||e.getByIds(t,s),null==s?void 0:s.length)return s;const r=null==(i=this.oriScene)?void 0:i.getByIds(t);if(!(null==r?void 0:r.length))return s;for(let t=0,e=(null==r?void 0:r.length)||0;t<e;t++){const e=r[t].clone(!0,!0);null==(n=this.dstScene)||n.add(e),s.push(e)}return s}clearDynamicObjectsByIds(t){var e,i;if(!t)return;Array.isArray(t)||(t=[t]);const n=null==(e=this.dstScene)?void 0:e.getByIds(t);if(null==n?void 0:n.length)for(let t,e=0,s=(null==n?void 0:n.length)||0;e<s;e++)t=n[e],null==(i=this.dstScene)||i.remove(t),t.destroy()}getColorKeyframeTrack(t,e,i=.5,n=[0,1.2,2]){const s=new Za(e).setA(i).getNormalized(),r=[...s,.38*s[0],.38*s[1],.38*s[2],.5*s[3],...s];return new Tl(t,n,r)}}class sc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.HOVER),d(this,"rayCaster",new ju),d(this,"_hoverIds",[]),d(this,"hoverAction"),d(this,"_hoverClip"),d(this,"dynamicStroke",La);const i=this.getColorKeyframeTrack(".dynamicStroke",Ra,.8);this._hoverClip=new Dl("selected",1,[i])}activate(){var t;super.activate(),this.hoverAction=null==(t=this.parent.mixer)?void 0:t.clipAction(this._hoverClip,this)}deactivate(){var t,e;super.deactivate(),null==(t=this.hoverAction)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.hoverAction),this.hoverAction=void 0,this._hoverIds=[]}handlePointerOver(t){var e,i,n,s,r,a;const{id:o,target:h,isStatic:l,isDynamic:u,isDummy:c}=(null==t?void 0:t.data)||{};if(this._hoverIds.includes(o))return;const d=(null==(i=null==(e=this.view)?void 0:e.camera)?void 0:i.pixelWidth)||1,p=this.getDynamicObjectsByIds(o);c&&(mi.set(t,"data.rmId",null==(n=null==h?void 0:h.userData)?void 0:n.rmId),mi.set(t,"data.wsId",null==(s=null==h?void 0:h.userData)?void 0:s.wsId),mi.set(t,"data.label",null==(r=null==h?void 0:h.userData)?void 0:r.label)),rc(p,d),this._hoverIds.push(o),null==(a=this.hoverAction)||a.play(),this.parent.editor.dispatchEvent({type:oi.POINTER_OVER,data:null==t?void 0:t.data})}handleOut(t){this.clearHover(),this.parent.editor.dispatchEvent({type:oi.POINTER_OUT,data:null==t?void 0:t.data})}clearHover(){var t;if(null==(t=this.hoverAction)||t.stop(),this.dstScene){for(let t=0,e=this._hoverIds.length;t<e;t++){const e=this.dstScene.getByIds(this._hoverIds[t]);e.length&&ac(e)}this._hoverIds=[]}}traverse(t){var e;if(this.dstScene)for(let i=0,n=(null==(e=this._hoverIds)?void 0:e.length)||0;i<n;i++){const e=this.dstScene.getByIds(this._hoverIds[i]);for(let i=0,n=(null==e?void 0:e.length)||0;i<n;i++)t(e[i])}}update(){var t,e;(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length)&&this.traverse((t=>{t.traverse((t=>{t.isShape&&(t.mtl.stroke=this.dynamicStroke)}))}))}}const rc=(t,e=1)=>{if(t){Array.isArray(t)||(t=[t]);for(let i,n=0,s=t.length;n<s;n++)i=t[n],i.traverse((t=>{t.isShape&&(t.userData.actType|=tc.HOVER,t.geo.lineWidth=5*e,t.mtl.stroke=Ua,t.mtl.lineJoin="round")}))}},ac=(t,e=1)=>{if(t){Array.isArray(t)||(t=[t]);for(let e,i=0,n=t.length;i<n;i++)e=t[i],e.traverse((t=>{var e,i,n;t.isShape&&(t.userData.actType&=~tc.HOVER,t.geo.lineWidth=null==(i=null==(e=t.userData)?void 0:e.style)?void 0:i.lineWidth,t.mtl.stroke=null==(n=t.userData.style)?void 0:n.stroke,t.mtl.lineJoin=void 0)}))}};class oc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.SELECT),d(this,"intersects",[]),d(this,"rayCaster"),d(this,"_selectedIds",[]),d(this,"_selectedClip"),d(this,"selectedAction"),d(this,"dynamicSelectFill",La),d(this,"dynamicSelectStroke",La),this.rayCaster=new ju;const i=this.getColorKeyframeTrack(".dynamicSelectFill",La,.5),n=this.getColorKeyframeTrack(".dynamicSelectStroke",Ra,.8);this._selectedClip=new Dl("selected",3,[i,n])}get _selectEnable(){var t,e;return!(!(null==(t=Jr.config)?void 0:t.selectEnable)||!(null==(e=this.view)?void 0:e.camera))}get _multiSelectEnable(){return Jr.config.multiSelectEnable}get _dragEnable(){var t,e;return(null==(t=Jr.config)?void 0:t.multiSelectEnable)&&(null==(e=Jr.config)?void 0:e.fnEnable)}activate(){var t;super.activate(),this.selectedAction=null==(t=this.parent.mixer)?void 0:t.clipAction(this._selectedClip,this)}deactivate(){var t,e;this.clearSelected(),super.deactivate(),null==(t=this.selectedAction)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.selectedAction),this.selectedAction=void 0,this.intersects=[],this._selectedIds=[]}setDynamicFill(t){}handleTap(t){if(this.intersects.length=0,!this.oriScene)return;if(!this._selectEnable&&!this._multiSelectEnable)return;this.rayCaster.init(t.data,this.view.camera).intersectObjectBy(this.oriScene,this._validFilter.bind(this),!0,this.intersects);const e=mi.uniq(mi.compact(mi.map(this.intersects,(t=>{var e,i;return(null==(e=t.userData)?void 0:e.assetType)===Jr.config.assetType?null==(i=t.userData)?void 0:i.id:""}))));this.selectByIds(e,!0),this.parent.editor.dispatchEvent({type:oi.SELECTED,data:this._selectedIds})}handlePanStart(t){var e;if((null==t?void 0:t.type)===bu.PAN_START&&this._dragEnable){if(!this.dstScene)throw new Error("No dynamic scene found!");this.parent.editor.setEnablePan(!1),hc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),uc.makeEmpty().expandByPoint(hc)}}handlePanMove(t){var e;(null==t?void 0:t.type)===bu.PAN_MOVE&&this._dragEnable&&(lc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),uc.makeEmpty().expandByPoint(hc).expandByPoint(lc))}handlePanEnd(t){var e,i;if(this.intersects.length=0,(null==t?void 0:t.type)!==bu.PAN_END)return;if(!this._dragEnable)return;lc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),uc.makeEmpty().expandByPoint(hc).expandByPoint(lc),this.rayCaster.init({worldBox:uc},null==(i=this.view)?void 0:i.camera).intersectObjectBy(this.oriScene,this._validFilter.bind(this),!0,this.intersects);const n=mi.uniq(mi.compact(mi.map(this.intersects,(t=>{var e,i,n;return(null==(e=t.userData)?void 0:e.assetType)===(null==(i=Jr.config)?void 0:i.assetType)?null==(n=t.userData)?void 0:n.id:""}))));this.selectByIds(n,this._multiSelectEnable),this.parent.editor.dispatchEvent({type:oi.SELECTED,data:this._selectedIds})}_validFilter(t){var e,i,n;return!(!t.visible||!t.selectable||(null==(e=t.userData)?void 0:e.assetType)!==(null==(i=Jr.config)?void 0:i.assetType))&&!mi.uniq(mi.compact(mi.map(this.intersects,(t=>{var e;return null==(e=t.userData)?void 0:e.id})))).includes(null==(n=t.userData)?void 0:n.id)}traverse(t){if(!this.dstScene)return;const e=this.dstScene.getByIds(this._selectedIds);if(null==e?void 0:e.length)for(let i=0,n=(null==e?void 0:e.length)||0;i<n;i++)t(e[i])}update(){var t,e;if(!(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length))return;const i=this.getDynamicObjectsByIds(this._selectedIds);for(let t,e=0,n=(null==i?void 0:i.length)||0;e<n;e++)t=i[e],t.isShape&&(t.userData.actType||0)&tc.SELECT&&t.traverse((t=>{t.mtl.fill=this.dynamicSelectFill,t.mtl.stroke=this.dynamicSelectStroke}))}hasSelected(t){return this._selectedIds.includes(t)}clearSelected(t){if(this.dstScene){if(!t||!(null==t?void 0:t.length))return this.clearDynamicObjectsByIds(this._selectedIds),void(this._selectedIds.length=0);Array.isArray(t)||(t=[t]),this.clearDynamicObjectsByIds(t);for(let e=0,i=t.length;e<i;e++){const i=this._selectedIds.indexOf(t[e]);i>-1&&this._selectedIds.splice(i,1)}}}selectByIds(t,e){var i,n;if(t&&this.oriScene&&this.dstScene){if(Array.isArray(t)||(t=[t]),null==(i=this.selectedAction)||i.stop(),this._selectEnable){const i=this.hasSelected(t[0]);if(i?this.clearSelected(t[0]):this.clearSelected(),i&&e)return}else this._multiSelectEnable&&(e||this.clearSelected());this.toggleSelectByIds(t,e),null==(n=this.selectedAction)||n.play()}}toggleSelectByIds(t,e){if(this.oriScene&&this.dstScene){Array.isArray(t)||(t=[t]);for(let i=0,n=t.length;i<n;i++){if(this.hasSelected(t[i])){e&&this.clearSelected(t[i]);continue}const n=this.getDynamicObjectsByIds(t[i]);if(null==n?void 0:n.length){for(let t=0,e=n.length;t<e;t++){n[t].moveToLast();const e=this.getDynamicObjectsByIds(n[t].userData.id);for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++){const i=e[t];i.moveToLast(),i.traverse((t=>{var e;(null==t?void 0:t.isShape)&&(t.userData.actType|=tc.SELECT,t.geo.lineWidth=5*((null==(e=t.userData.style)?void 0:e.strokeWidth)||1))}))}}this._selectedIds.push(t[i])}}}}}const hc=new Oi,lc=new Oi,uc=new Ri;class cc extends Ia{constructor(t={}){var e;const{x:i=0,y:n=0,w:s=10,h:r=10}=t,a=s/2,o=r/2;(null==(e=t.points)?void 0:e.length)||(t.points=[i-a,n-o,i-a,n+o,i+a,n+o,i+a,n-o,i-a,n-o]);const h=new ao(t),l=new Aa(t);(null==t?void 0:t.lineWidth)||(l.lineWidth=1),super(h,l),d(this,"name","Rect")}setPoints(t){return!t||t.length<2||this.geo.setPoints(t),this}}class dc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.SELECTOR_RECT),d(this,"_fnEnable",!1),d(this,"selector"),d(this,"rayCaster",new ju),d(this,"intersects",[]),this.selector=new cc({name:pc,fill:new Za(Pa).setA(.1).getStyle(),stroke:Pa,lineWidth:1,lineDash:[5,5]})}activate(){super.activate()}deactivate(){super.deactivate(),this.intersects=[]}bindScene(...t){var e,i;return super.bindScene(...t),(null==(e=this.dstScene)?void 0:e.getObjectByProperty("name",pc))||null==(i=this.dstScene)||i.add(this.selector),this}fnEnableChanged(t){this._fnEnable=!!t}get _dragEnable(){var t;return(null==(t=Jr.config)?void 0:t.multiSelectEnable)&&this._fnEnable}handlePanStart(t){var e;if(this._dragEnable&&(null==t?void 0:t.type)===bu.PAN_START){if(!this.dstScene)throw new Error("No dynamic scene found!");this.parent.editor.setEnablePan(!1),fc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),yc.makeEmpty().expandByPoint(fc),this.selector.setVisible(!0).setPoints([fc.x,fc.y])}}handlePanMove(t){var e;this._dragEnable&&(null==t?void 0:t.type)===bu.PAN_MOVE&&(mc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),yc.makeEmpty().expandByPoint(fc).expandByPoint(mc),this.selector.setPoints(yc.round().getNumbersArray()))}handlePanEnd(t){var e;this.parent.editor.setEnablePan(!0),this._dragEnable&&(null==t?void 0:t.type)===bu.PAN_END&&(mc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),yc.makeEmpty().expandByPoint(fc).expandByPoint(mc),this.selector.setVisible(!1))}}const pc="EDITOT_SELECTOR",fc=new Oi,mc=new Oi,yc=new Ri;class gc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.DRAG),d(this,"_fnEnable",!1),d(this,"dragMode",ec.MAKE_COPY),d(this,"rayCaster",new ju),d(this,"intersects",[]),d(this,"_currentObject"),d(this,"_originalPosition",new Oi),d(this,"_dragOffset",new Oi),d(this,"_objectFilter"),d(this,"_getDragabledHandler")}activate(){super.activate()}deactivate(){super.deactivate(),this.intersects=[],this._currentObject=void 0}setDraggingObject(t){this.handlePanStart({type:bu.PAN_START,data:{target:t}})}handlePanStart(t){var e,i,n;if((null==t?void 0:t.type)!==bu.PAN_START)return;if(!this.dstScene)throw new Error("No dynamic scene found!");if(!(null==(e=null==t?void 0:t.data)?void 0:e.target))return;let s;s="function"==typeof this._getDragabledHandler?this._getDragabledHandler(null==(i=null==t?void 0:t.data)?void 0:i.target):null==(n=null==t?void 0:t.data)?void 0:n.target,s&&(this.parent.editor.setEnablePan(!1),this._currentObject=s,this.parent.handleDragStart(t))}handlePanMove(t){(null==t?void 0:t.type)===bu.PAN_MOVE&&this._currentObject&&(this._currentObject.position.copy(t.data.worldCoords),this._currentObject.updateMatrix(),this._currentObject.updateWorldMatrix(!0,!1))}handlePanEnd(t){var e;this.parent.editor.setEnablePan(!0),(null==t?void 0:t.type)===bu.PAN_END&&(mi.set(t,"data.target",this._currentObject),this.parent.handleDragEnd(t),this._currentObject=void 0,null==(e=this.view.camera)||e.update())}bindFilter(t){this._objectFilter=t}_defaultFilter(t){return t.visible&&t.selectable}_validFilter(t){return this._objectFilter?this._objectFilter(t):this._defaultFilter(t)}bindGetDragabledHandler(t){this._getDragabledHandler=t}}class vc extends ya{constructor(t){super(t),this._init(t)}buildPath(t,e,i){if(0===this.percent)return;let{x:n=0,y:s=0,radius:r,startAngle:a=0,endAngle:o=2*Math.PI}=e||this;t.arc(n,s,r,a,o)}}class xc extends Ia{constructor(t=new vc,e=new Aa,i){super(t,e,i),d(this,"name","Sprite"),d(this,"isSprite",!0)}updateModelViewMatrix(t){if(t){bc.makeScale(t.scaled.x,t.scaled.y).premultiply(this.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.viewMatrix,bc);for(let e=0,i=this.children.length;e<i;e++)this.children[e].updateModelViewMatrix(t)}}}const bc=new Gi;class _c extends xc{constructor(){super(...arguments),d(this,"isDummy",!0),d(this,"composeNode",!0),d(this,"selectable",!0),d(this,"visible",!0),d(this,"renderOrder",1/0),d(this,"txtShape")}setText(t){var e;(null==(e=this.txtShape)?void 0:e.mtl)&&(this.txtShape.mtl.text=t)}setLabel(t,e){this.userData.label=t}updateModelViewMatrix(t){var e,i;if(super.updateModelViewMatrix(t),!this.txtShape)return;const n=1.2*((null==(e=this.params)?void 0:e.radius)||10)*((null==(i=null==t?void 0:t.scaled)?void 0:i.x)||1);this.txtShape.mtl.fontSize=n,this.txtShape.position.set(0,-n/2),this.txtShape.updateMatrix()}}class wc extends _c{constructor(t,e={}){var i,n;e.radius||(e.radius=null==(n=null==(i=Jr.config)?void 0:i.dummy)?void 0:n.radius);const s=new vc({x:0,y:0,radius:e.radius,thinLine:!0}),r=new Aa({fill:Oa,stroke:Pa});super(s,r),d(this,"params"),d(this,"dragable",!0),d(this,"radius"),this.params=e,this.userData=c(u({},t),{assetType:pn,style:{fill:r.fill,stroke:r.stroke,lineWidth:r.lineWidth}}),this.txtShape=new oo({text:(t.label||"").substring(0,1),fontSize:1.2*e.radius,fill:Wa,textBaseline:"ideographic",fontWeight:"300"}),this.add(this.txtShape)}}class Sc extends _c{constructor(t,e={}){var i,n;e.radius||(e.radius=null==(n=null==(i=Jr.config)?void 0:i.dummy)?void 0:n.radius);const s=e.radius,r=new Bo({x:-s,y:-s,w:2*s,h:2*s,r:s/2}),a=new Aa({fill:Oa,stroke:Pa});super(r,a),d(this,"params"),d(this,"txtShape"),this.params=e,this.userData=c(u({},t),{assetType:pn,style:{fill:a.fill,stroke:a.stroke,lineWidth:a.lineWidth}}),this.txtShape=new oo({text:"1",fontSize:e.radius,fill:Wa,textBaseline:"ideographic",fontWeight:"300"}),this.add(this.txtShape),this.needsUpdate=!0}}class Mc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.DUMMY),d(this,"_fnEnable",!1),d(this,"_dummies",[]),d(this,"_centroidCache",{}),d(this,"_rmMap",new Map),d(this,"_mergedMap",new Map),d(this,"action"),d(this,"_clip"),d(this,"dynamicDummyFill",La),d(this,"dynamicDummyStroke",Ra),d(this,"rayCaster",new ju),d(this,"intersects",[]),d(this,"_currentDummy"),d(this,"_unboundDummiesMap",{}),d(this,"_cameraHandler",this.handleCameraUpdate.bind(this)),d(this,"_getDragabledHandler",this.getDragabled.bind(this));const i=new Tl(".dynamicDummyFill",[0,.6,1],[.95,.38,.38,.8,.95,.38,.38,.3,.95,.38,.38,.8]),n=new Tl(".dynamicDummyStroke",[0,.6,1],[.95,.38,.38,.8,.95,.38,.38,.3,.95,.38,.38,.8]);this._clip=new Dl("currentDummy",1,[i,n]),this.bindEvents()}destroy(){this.deactivate(),this.unbindEvents()}bindEvents(){var t,e;null==(e=null==(t=this.view)?void 0:t.camera)||e.addEventListener(hu.UPDATE,this._cameraHandler)}unbindEvents(){var t,e;null==(e=null==(t=this.view)?void 0:t.camera)||e.removeEventListener(hu.UPDATE,this._cameraHandler)}activate(){var t;super.activate(),this.action=null==(t=this.parent.mixer)?void 0:t.clipAction(this._clip,this);const e=this.parent.get(Qu.DRAG);e&&(e.bindFilter(this._validFilter.bind(this)),e.bindGetDragabledHandler(this._getDragabledHandler))}deactivate(){var t,e;this.clearDummies(),super.deactivate(),null==(t=this.action)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.action),this.action=void 0,this._dummies=[],this._centroidCache={},this._rmMap=new Map,this._mergedMap=new Map,this.intersects=[];const i=this.parent.get(Qu.DRAG);i&&(i.bindFilter(),i.bindGetDragabledHandler())}fnEnableChanged(t){this._fnEnable=!!t}bindEditorDrag(t){let e=this.getDummyById(null==t?void 0:t.id);e||(e=(null==t?void 0:t.rmId)?this.addDummy(t):this.addDummyUnbound(t)),e&&(e.visible=!1)}getDraggingObject(t){return this.getDummyById(null==t?void 0:t.id)}getDragabled(t){var e;if(!t)return;if(Array.isArray(t)||(t=[t]),!t.length)return;const i=t[0];let n=this._unboundDummiesMap[null==(e=i.userData)?void 0:e.id];return!n&&i.dragable&&(i.mtl.fill=i.userData.style.fill=new Za(Oa).setA(.5).getStyle(),i.mtl.lineDash=[2,2],i.userData.status=ic.MODIFIED,n=this.addDummyUnbound(i.userData)),n&&(n.visible=!0),n}handleDragEnd(t){var e;if(!this.oriScene)throw new Error("No dynamic scene found!");const{target:i}=(null==t?void 0:t.data)||{};if(!(null==i?void 0:i.isDummy))return;const n=[],s=c(u({},null==t?void 0:t.data),{screenCoords:i.position});if(this.rayCaster.init(s,this.view.camera).intersectObjectBy(this.oriScene,this._assetFilter.bind(this),!0,n),!(null==n?void 0:n.length))return;i.userData.rmId=null==(e=n[0].userData)?void 0:e.id;const r=this.getDummiesVo(!0);this.parent.editor.dispatchEvent({type:oi.DRAG_END,data:r})}_validFilter(t){var e,i;return!(!t.visible||!t.selectable||(null==(e=t.userData)?void 0:e.assetType)!==pn)&&!mi.uniq(mi.compact(mi.map(this.intersects,(t=>{var e;return null==(e=t.userData)?void 0:e.id})))).includes(null==(i=t.userData)?void 0:i.id)}_assetFilter(t){var e;return t.visible&&t.selectable&&(null==(e=t.userData)?void 0:e.assetType)===Jr.config.assetType}getDummiesVo(t=!0){var e,i,n,s,r,a,o,h,l,u;const c=[];for(let a=0,o=this._dummies.length;a<o;a++){const o=this._dummies[a];if((null==(e=o.userData)?void 0:e.assetType)!==pn)continue;if(t&&o.userData.status!==ic.NEW)continue;const h={id:null==(i=o.userData)?void 0:i.id,label:null==(n=o.userData)?void 0:n.label,rmId:null==(s=o.userData)?void 0:s.rmId,wsId:null==(r=o.userData)?void 0:r.wsId};c.push(h)}for(let e=Object.keys(this._unboundDummiesMap),i=0,n=(null==e?void 0:e.length)||0;i<n;i++){const n=e[i];if(!n)continue;const s=this._unboundDummiesMap[n];if((null==(a=s.userData)?void 0:a.assetType)!==pn)continue;if(t&&s.userData.status!==ic.NEW)continue;const r={id:null==(o=s.userData)?void 0:o.id,label:null==(h=s.userData)?void 0:h.label,rmId:null==(l=s.userData)?void 0:l.rmId,wsId:null==(u=s.userData)?void 0:u.wsId},d=c.findIndex((t=>t.id===r.id));d>-1&&c.splice(d,1),c.push(r)}return c}getAssetById(t){let e;for(let i=0,n=this.scenes.length;i<n&&(e=this.scenes[i].getByIds(t),!e);i++);return e}getAssetBoundingBoxById(t,e=new Ri){e.makeEmpty();const i=this.getAssetById(t);if(!(null==i?void 0:i.length))return e;for(let t=0,n=(null==i?void 0:i.length)||0;t<n;t++)e.union(i[t].boundingBoxWorld);return e}getDummyLabels(t){var e,i;const n=this.getDummyById(t);return n instanceof Sc?((null==(e=null==n?void 0:n.userData)?void 0:e.label)||"").split(","):[null==(i=null==n?void 0:n.userData)?void 0:i.label]}getDummiesBoundingBox(t,e){if(Ac.makeEmpty(),!(null==t?void 0:t.length))return Ac.clone();for(let e,i=0,n=(null==t?void 0:t.length)||0;i<n;i++){e=t[i];const n=this.getDummyById(e);n&&Ac.union(n.boundingBoxWorld)}return Ac.clone()}addDummy(t){var e,i;if(!this.dstScene||!(null==t?void 0:t.rmId))return;const n=t.rmId;let s=this._dummies.find((e=>{var i;return(null==(i=e.userData)?void 0:i.id)===t.id}));return s||(s=new wc(t,Jr.config.dummy),s.name=t.id||n+"_"+(t.id||(null==(e=this.dstScene.children)?void 0:e.length)),s.userData.rmId=n,this.dstScene.add(s),this._dummies.push(s),this._rmMap.has(n)||this._rmMap.set(n,[]),null==(i=this._rmMap.get(n))||i.push(s)),s}addDummyMerged(t,e){var i,n;if(!this.dstScene||!(null==t?void 0:t.rmId))return;let s;return this._mergedMap.has(t.id)?s=this._mergedMap.get(t.id):(s=new Sc(t,Jr.config.dummy),s.name=t.id||e+"_"+(t.id||(null==(i=this.dstScene.children)?void 0:i.length)),null==(n=this.dstScene)||n.add(s),this._mergedMap.set(e,s)),s}addDummyUnbound(t){var e;if(!(null==t?void 0:t.id))return;const i=new wc(t,Jr.config.dummy);return i.mtl.fill=i.userData.style.fill=Ba,i.mtl.stroke=i.userData.style.stroke=ka,i.userData.status=ic.NEW,null==(e=this.dstScene)||e.add(i),this._unboundDummiesMap[t.id]=i,i}traverseDummies(t){var e;for(let i=0,n=(null==(e=this._dummies)?void 0:e.length)||0;i<n;i++)t(this._dummies[i]);for(let[e,i]of this._mergedMap.entries())t(i);Object.values(this._unboundDummiesMap).forEach((e=>{t(e)}))}clearDummies(t){var e,i,n,s;for(let i,n=Object.keys(this._unboundDummiesMap),s=(null==n?void 0:n.length)||0;s>=0;s--)i=this._unboundDummiesMap[n[s]],(null==t?void 0:t.length)&&!t.includes(null==i?void 0:i.userData.status)||(null==(e=this.dstScene)||e.remove(i),null==i||i.destroy(),delete this._unboundDummiesMap[n[s]]);for(let e,s=((null==(i=this._dummies)?void 0:i.length)||0)-1;s>=0;s--)e=this._dummies[s],(null==t?void 0:t.length)&&!t.includes(e.userData.status)||(null==(n=this.dstScene)||n.remove(e),null==e||e.destroy(),this._dummies.splice(s,1));for(let[e,i]of this._mergedMap.entries())(null==t?void 0:t.length)&&!t.includes(i.userData.status)||(null==(s=this.dstScene)||s.remove(i),null==i||i.destroy(),this._mergedMap.delete(e));(null==t?void 0:t.length)||(this._dummies.length=0,this._centroidCache={},this._rmMap.clear(),this._mergedMap.clear(),this._unboundDummiesMap={})}setDummies(t){var e;if(this.clearDummies(),null==t?void 0:t.length){for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.addDummy(t[e]);null==(e=this.view.camera)||e.update()}}getDummyById(t){var e;if(t){for(let i=0,n=(null==(e=this._dummies)?void 0:e.length)||0;i<n;i++)if(this._dummies[i].name===t)return this._dummies[i];for(let[e,i]of this._mergedMap.entries())if(i.name===t)return i;return this._unboundDummiesMap[t]}}focusAtDummy(t,e=1e3){return p(this,null,(function*(){var i,n,s,r,a,o,h;const l=this.getDummyById(t),u=null==(i=null==l?void 0:l.userData)?void 0:i.rmId;if(u){if(this.getAssetBoundingBoxById(u,Ac),!Ac.isEmpty()&&(Ac.expandByScalar(e),null==(n=this.view)?void 0:n.camera))return void((null==(r=null==(s=this.view)?void 0:s.camera)?void 0:r.boundingBoxWorld.containsBox(Ac))||(yield this.view.resetCameraByBoundingBox(Ac,!0)));if((null==l?void 0:l.position)&&!(null==l?void 0:l.position.isEmpty()))return l.updateWorldMatrix(!0,!1),Tc.copy(l.position).applyMatrix3(l.matrixWorld),Ac.setFromCenterAndSize(Tc,Ic.set(2*e,2*e)),void((null==(o=null==(a=this.view)?void 0:a.camera)?void 0:o.boundingBoxWorld.containsBox(Ac))||(yield null==(h=this.view)?void 0:h.resetCameraByBoundingBox(Ac,!0)))}}))}highlightDummies(t){return p(this,null,(function*(){var e;Array.isArray(t)||(t=[t]),this.traverseDummies((e=>{var i;t.includes(e.userData.id)||e instanceof Sc&&(null==(i=mi.intersection(t,e.userData.id.split(",")))?void 0:i.length)?e.userData.actType|=tc.HILIGHT:e.userData.actType&=~tc.HILIGHT})),null==(e=this.action)||e.play()}))}resetHighlightDummies(){var t;this.traverseDummies((t=>{t.userData.actType&=~tc.HILIGHT,t.mtl.fill=t.userData.style.fill,t.mtl.stroke=t.userData.style.stroke})),null==(t=this.action)||t.stop()}update(){var t,e;(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length)&&this.dstScene.traverse((t=>{var e;((null==(e=null==t?void 0:t.userData)?void 0:e.actType)||0)&tc.HILIGHT&&t.isDummy&&(t.mtl.fill=this.dynamicDummyFill,t.mtl.stroke=this.dynamicDummyStroke)}))}handleCameraUpdate(t){var e,i;if(null==(e=this.view)?void 0:e.camera){for(let t,e=0,n=(null==(i=this._dummies)?void 0:i.length)||0;e<n;e++)t=this._dummies[e],this.updateDummy(t);this.mergeDummies()}}updateDummy(t){var e,i;const n=t.userData.rmId,s=this.getAssetById(n);if((null==s?void 0:s.length)&&!this._centroidCache[n]){const t=[];for(let n,r=0,a=s.length;r<a;r++)n=s[r],null==(i=null==(e=n.geo)?void 0:e.path)||i.getVertices(t);Oi.getPoleOfInaccessibility(t,Tc),this._centroidCache[n]=Tc.clone()}}mergeDummies(){var t,e,i;if(!(null==(t=this.view)?void 0:t.camera))return;Ec.copy(this.view.camera.viewMatrix);const n=(null==(i=null==(e=Jr.config)?void 0:e.dummy)?void 0:i.radius)||10;this.view.camera.pixelWidth;for(let[t,e]of this._rmMap){if(!(null==e?void 0:e.length))continue;this.getAssetBoundingBoxById(t,Ac),Ac.applyMatrix3(Ec).getSize(Tc).round(),Ic.copy(this._centroidCache[t]).applyMatrix3(Ec);const i=Ac.centralArrange(e.length,2*n,2*n,Ic);if(Array.isArray(i)){const n=this._mergedMap.get(t);n&&(n.visible=!1),e.forEach(((t,e)=>{t.visible=!0,t.boundingBox.getSize(Dc),t.setPosition(Cc.copy(i[e]).unproject(this.view.camera)).updateMatrix()}))}else{e.forEach((t=>t.visible=!1));let i=this._mergedMap.get(t);if(!i){let n=mi.cloneDeep(e[0].userData)||{};const s=mi.reduce(e,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.label)&&t.push(null==(n=e.userData)?void 0:n.label),t}),[]),r=mi.reduce(e,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.id)&&t.push(null==(n=e.userData)?void 0:n.id),t}),[]);n=mi.merge(n,{rmId:t,id:r.join(","),label:s.join(",")}),i=this.addDummyMerged(n,t)}if(!i)continue;i.setText(String(e.length)),i.visible=!0,Cc.copy(e[0].position),i.setPosition(Cc).updateMatrix()}}}}const Ec=new Gi,Ac=new Ri,Tc=new Oi,Ic=new Oi,Cc=new Oi,Dc=new Oi;function Nc(t,e=[]){var i,n;return t&&t.value?(e.push(t.value),(null==(i=t.children)?void 0:i.length)&&(null==(n=t.children)||n.forEach((t=>Nc(t,e)))),e):e}class Bc extends Ia{constructor(t){const e=new Ta(t),i=new Aa(t);(null==t?void 0:t.lineWidth)||(i.lineWidth=1),super(e,i),d(this,"name","Line"),d(this,"isLine",!0)}}class kc{static getPoint(t){const e=new vc(t),i=so.getMtl(t);return new xc(e,i)}static getRect(t){const e=new Bo(t),i=so.getMtl(t);return new xc(e,i)}static getMark(t){const e=new va({cmds:[[Pn,0,0],[Ln,-5,-10],[Rn,-5,-10,-12.5,-25,0,-25],[Rn,0,-25,12.5,-25,5,-10],[Ln,0,0],[Fn]],closed:!0,flipY:!0,lineWidth:1,thinLine:!0}),i=so.getMtl(t);return new xc(e,i)}}class Oc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.LINKER),d(this,"_linesIds",[]),d(this,"_startIds",[]),d(this,"_endIds",[]),d(this,"_lineDash",20)}activate(){super.activate()}deactivate(){this.clear(),super.deactivate(),this._linesIds=[],this._startIds=[],this._endIds=[]}update(){var t,e;for(let i=0,n=(null==(t=this._linesIds)?void 0:t.length)||0;i<n;i++){const t=null==(e=this.dstScene)?void 0:e.getByIds(this._linesIds[i]);if(null==t?void 0:t.length)for(let e,i=0,n=t.length;i<n;i++){if(e=t[i],!(null==e?void 0:e.mtl))continue;let n=e.mtl.lineDashOffset||0;n<=-2*this._lineDash&&(n=0),e.mtl.lineDashOffset=n-1}}}clear(){var t;(null==(t=this._linesIds)?void 0:t.length)&&(this.clearDynamicObjectsByIds(this._linesIds),this.clearDynamicObjectsByIds(this._startIds),this.clearDynamicObjectsByIds(this._endIds),this._linesIds=[],this._startIds=[],this._endIds=[])}linkAssetsByTree(t){var e,i;if(this.clear(),!(null==(e=null==t?void 0:t.children)?void 0:e.length))return;Nc(t);const n=this.getLinesByTree(t,void 0,!0);if(null==n?void 0:n.length)for(let t,e=0,s=n.length;e<s;e++)t=n[e],null==(i=this.dstScene)||i.add(t),this._linesIds.push(t.userData.id)}getLinesByTree(t,e=[],i=!1){var n,s;if(!(null==t?void 0:t.value))return e;const r=this.getDynamicObjectsByIds(t.value);if(Pc.makeEmpty().expandByObjects(r).getCenter(Rc),i){const e=kc.getMark({fill:La,stroke:ka,lineWidth:1});e.userData.id=`${t.value}-start`,e.setPosition(Rc).updateMatrix(),null==(n=this.dstScene)||n.add(e),this._startIds.push(e.userData.id)}return null==(s=t.children)||s.forEach((i=>{var n,s;const r=this.getDynamicObjectsByIds(i.value);Lc.makeEmpty().expandByObjects(r).getCenter(zc);const a=new Bc({x1:Rc.x,y1:Rc.y,x2:zc.x,y2:zc.y,stroke:Ra,strokeWidth:10,lineCap:"round",lineJoin:"round",lineDash:[this._lineDash,this._lineDash],thinLine:!0});a.userData.id=`${t.value}-${i.value}`,a.userData.actType|=tc.DYNAMIC_LINE,e.push(a);const o=kc.getMark({fill:Ba,stroke:ka,lineWidth:1});o.userData.id=`${t.value}-end`,o.setPosition(zc).updateMatrix(),null==(n=this.dstScene)||n.add(o),this._endIds.push(o.userData.id),(null==(s=i.children)?void 0:s.length)&&this.getLinesByTree(i,e,!1)})),e}}const Pc=new Ri,Lc=new Ri,Rc=new Oi,zc=new Oi;class Uc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.DISTRIBUTION),d(this,"fillIdsMap",{}),d(this,"strokeIdsMap",{})}activate(){super.activate()}deactivate(){this.clearByIds(),super.deactivate(),this.fillIdsMap={},this.strokeIdsMap={}}update(){}setFillByIds(t,e){var i,n;if(t&&e){Array.isArray(t)||(t=[t]);for(let n,s=0,r=(null==t?void 0:t.length)||0;s<r;s++){n=t[s],this.clearById(n,!1);const r=null==(i=this.oriScene)?void 0:i.getByIds(n);if(null==r?void 0:r.length)for(let t,i=0,n=(null==r?void 0:r.length)||0;i<n;i++)t=r[i],(null==t?void 0:t.mtl)&&(t.mtl=so.getMtl(c(u({},t.userData.style),{fill:e})),t.geo.lineWidth=t.userData.style.lineWidth||1,t.needsUpdate=!0)}this.fillIdsMap[e]=t,(null==(n=this.view)?void 0:n.camera)&&(this.view.camera.needsUpdate=!0)}}setStrokeByIds(t,e){var i,n;if(t&&e){Array.isArray(t)||(t=[t]);for(let n,s=0,r=(null==t?void 0:t.length)||0;s<r;s++){n=t[s],this.clearById(n,!1);const r=null==(i=this.oriScene)?void 0:i.getByIds(n);if(null==r?void 0:r.length)for(let t,i=0,n=(null==r?void 0:r.length)||0;i<n;i++)t=r[i],(null==t?void 0:t.mtl)&&(t.mtl=so.getMtl(c(u({},t.userData.style),{stroke:e,lineWidth:5*(t.userData.style.lineWidth||1)})),t.geo.lineWidth=5*(t.userData.style.lineWidth||1),t.needsUpdate=!0)}this.strokeIdsMap[e]=t,(null==(n=this.view)?void 0:n.camera)&&(this.view.camera.needsUpdate=!0)}}clearById(t,e=!0){var i,n,s,r,a,o,h;if(!t)return;const l=null==(i=this.oriScene)?void 0:i.getByIds(t);for(let t,e=0,i=(null==l?void 0:l.length)||0;e<i;e++)t=l[e],(null==t?void 0:t.mtl)&&(t.mtl=so.getMtl(t.userData.style),t.geo.lineWidth=null==(n=t.userData.style)?void 0:n.lineWidth,t.needsUpdate=!0);for(let e,i=Object.keys(this.fillIdsMap),n=((null==i?void 0:i.length)||0)-1;n>=0;n--){e=i[n];const a=null==(s=this.fillIdsMap[e])?void 0:s.findIndex((e=>e===t));a>-1&&this.fillIdsMap[e].splice(a,1),(null==(r=this.fillIdsMap[e])?void 0:r.length)||delete this.fillIdsMap[e]}for(let e,i=Object.keys(this.strokeIdsMap),n=((null==i?void 0:i.length)||0)-1;n>=0;n--){e=i[n];const s=null==(a=this.strokeIdsMap[e])?void 0:a.findIndex((e=>e===t));s>-1&&this.strokeIdsMap[e].splice(s,1),(null==(o=this.strokeIdsMap[e])?void 0:o.length)||delete this.strokeIdsMap[e]}e&&(null==(h=this.view)?void 0:h.camera)&&(this.view.camera.needsUpdate=!0)}clearFillByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=mi.uniq(mi.compact(mi.flatten(mi.values(this.fillIdsMap)))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}clearStrokeByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=mi.uniq(mi.compact(mi.flatten(mi.values(this.strokeIdsMap)))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}clearByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=mi.uniq(mi.compact(mi.flatten(mi.concat(mi.values(this.fillIdsMap),mi.values(this.strokeIdsMap))))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}getLegend(){const t=[];for(let e in this.fillIdsMap)t.push({type:"fill",color:e,ids:this.fillIdsMap[e]});for(let e in this.strokeIdsMap)t.push({type:"stroke",color:e,ids:this.strokeIdsMap[e]});return t}}class Fc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.TIPS),d(this,"engineVersion","v2.0.2"),d(this,"monitor"),this.monitor=new Ia}activate(){super.activate()}deactivate(){super.deactivate()}handlePointerMove(t){var e,i,n;let s=(null==(e=null==t?void 0:t.e)?void 0:e.target)||(null==(n=null==(i=null==t?void 0:t.e)?void 0:i.srcEvent)?void 0:n.target);null==s||s.id}}class Wc{constructor(t,e){d(this,"tools",new Map),d(this,"activedTools",new Map),d(this,"activedTool"),d(this,"scenes",[]),d(this,"dstScene"),d(this,"mixer"),d(this,"clock",new Xh),this.editor=t,this.view=e,this.mixer=new Jl}destroy(){var t;this.dispose(),this.tools.clear(),null==(t=this.mixer)||t.destroy()}dispose(){var t;this.tools.forEach((t=>{t.deactivate&&t.deactivate()})),this.deactiveAll(),this.scenes=[],null==(t=this.mixer)||t.dispose()}register(t){Array.isArray(t)||(t=[t]),this.deactiveAll();for(let e,i=0,n=(null==t?void 0:t.length)||0;i<n;i++){e=t[i];let n=this.tools.get(e);if(!n){switch(e){case Qu.TIPS:n=new Fc(this,this.view);break;case Qu.HOVER:n=new sc(this,this.view);break;case Qu.SELECT:n=new oc(this,this.view);break;case Qu.SELECTOR_RECT:n=new dc(this,this.view);break;case Qu.DISTRIBUTION:n=new Uc(this,this.view);break;case Qu.DRAG:n=new gc(this,this.view);break;case Qu.DUMMY:n=new Mc(this,this.view);break;case Qu.LINKER:n=new Oc(this,this.view)}n&&this.tools.set(e,n)}n&&(null==n?void 0:n.bindScene)&&n.bindScene(...this.scenes)}return this}bindScene(...t){var e;return this.scenes.length=0,this.scenes.push(...t),this.dstScene=this.scenes.find((t=>t.isDynamic)),this.dstScene&&(null==(e=this.mixer)||e.bind(this.dstScene)),this.activedTools.forEach((t=>{t.bindScene&&t.bindScene(...this.scenes)})),this}setMode(t){this.deactiveAll();for(let e=1;e<=t;e<<=1)if(t&e){const t=e;this.tools.has(t)&&this.activateTool(t)}}clearMode(){this.deactiveAll()}activateTool(t){const e=this.tools.get(t);e&&(null==e||e.deactivate(),this.activedTools.set(e.type,e),e.bindScene&&e.bindScene(...this.scenes),e.activate())}get(t){return this.tools.get(t)}getActiveTool(t){return this.activedTools.get(t)}deactiveAll(t){const e=[];this.activedTools.forEach((i=>{(null==t?void 0:t.includes(i.type))||e.push(i.type)})),e.forEach((t=>{var e;null==(e=this.activedTools.get(t))||e.deactivate(),this.activedTools.delete(t)}))}handleTap(t){this.activedTools.forEach((e=>{e.handleTap&&e.handleTap(t)}))}handlePanStart(t){this.activedTools.forEach((e=>{e.handlePanStart&&e.handlePanStart(t)}))}handlePanMove(t){this.activedTools.forEach((e=>{e.handlePanMove&&e.handlePanMove(t)}))}handlePanEnd(t){this.activedTools.forEach((e=>{e.handlePanEnd&&e.handlePanEnd(t)}))}handlePointerOver(t){this.activedTools.forEach((e=>{e.handlePointerOver&&e.handlePointerOver(t)}))}handlePointerOut(t){this.activedTools.forEach((e=>{e.handlePointerOut&&e.handlePointerOut(t)}))}handlePointerMove(t){this.activedTools.forEach((e=>{e.handlePointerMove&&e.handlePointerMove(t)}))}handleDragStart(t){this.activedTools.forEach((e=>{e.handleDragStart&&e.handleDragStart(t)}))}handleDragEnd(t){this.activedTools.forEach((e=>{e.handleDragEnd&&e.handleDragEnd(t)}))}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta()),this.activedTools.forEach((t=>{t.update&&t.update()}))}clearDummies(t){var e;null==(e=this.tools.get(Qu.DUMMY))||e.clearDummies(t)}setDummies(t){var e;null==(e=this.tools.get(Qu.DUMMY))||e.setDummies(t)}focusAtDummy(t,e=1e3){var i;null==(i=this.tools.get(Qu.DUMMY))||i.focusAtDummy(t,e)}highlightDummies(t){var e;null==(e=this.tools.get(Qu.DUMMY))||e.highlightDummies(t)}resetHighlightDummies(){var t;null==(t=this.tools.get(Qu.DUMMY))||t.resetHighlightDummies()}getDummyLabels(t){var e;return null==(e=this.tools.get(Qu.DUMMY))?void 0:e.getDummyLabels(t)}getDummiesBoundingBox(t,e){var i;return null==(i=this.tools.get(Qu.DUMMY))?void 0:i.getDummiesBoundingBox(t)}}class qc extends hi{constructor(t,e){var i,n;super(),d(this,"scenes",[]),d(this,"dstScene"),d(this,"handler"),d(this,"view"),d(this,"mode",Ku.DEFAULT),d(this,"toolManager"),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"panStartHandler",this.handlePanStart.bind(this)),d(this,"panMoveHandler",this.handlePanMove.bind(this)),d(this,"panEndHandler",this.handlePanEnd.bind(this)),d(this,"pointerOverHandler",this.handlePointerOver.bind(this)),d(this,"pointerOutHandler",this.handlePointerOut.bind(this)),d(this,"pointerMoveHandler",this.handlePointerMove.bind(this)),this.view=e,(null==(i=this.view)?void 0:i.camera)&&(this.handler=new Yu(t,this.view.camera).enableHover(null==(n=Jr.config.controls)?void 0:n.enableHover)),this.toolManager=new Wc(this,this.view).register([Qu.TIPS,Qu.HOVER,Qu.SELECT,Qu.SELECTOR_RECT,Qu.DISTRIBUTION,Qu.DRAG,Qu.DUMMY,Qu.LINKER]),this.toolManager.setMode(this.mode)}destroy(){var t;this.dispose(),this.unbindEvents(),null==(t=this.handler)||t.destroy()}dispose(){this.toolManager.dispose(),this.scenes=[]}bind(t,e){this.view=t,this.handler=e}bindScene(...t){var e;return this.scenes.length=0,this.scenes.push(...t),null==(e=this.handler)||e.bindScene(...t),this.dstScene=this.scenes.find((t=>t.isDynamic)),this.toolManager.bindScene(...t),this.bindEvents(),this}setMode(t){t&&(this.mode=t,this.toolManager.setMode(t),Jr.config.editorMode=Ku.PICKER)}clearMode(){this.mode=Ku.DEFAULT,this.toolManager.clearMode(),Jr.config.editorMode=Ku.DEFAULT}bindEvents(){var t,e,i,n,s,r,a;this.unbindEvents(),null==(t=this.handler)||t.addEventListener(Ju.TAP,this.tapHandler),null==(e=this.handler)||e.addEventListener(Ju.PAN_START,this.panStartHandler),null==(i=this.handler)||i.addEventListener(Ju.PAN_MOVE,this.panMoveHandler),null==(n=this.handler)||n.addEventListener(Ju.PAN_END,this.panEndHandler),null==(s=this.handler)||s.addEventListener(Ju.POINTEROVER,this.pointerOverHandler),null==(r=this.handler)||r.addEventListener(Ju.POINTEROUT,this.pointerOutHandler),null==(a=this.handler)||a.addEventListener(Ju.POINTERMOVE,this.pointerMoveHandler)}unbindEvents(){var t,e,i,n,s,r,a;null==(t=this.handler)||t.removeEventListener(Ju.TAP,this.tapHandler),null==(e=this.handler)||e.removeEventListener(Ju.PAN_START,this.panStartHandler),null==(i=this.handler)||i.removeEventListener(Ju.PAN_MOVE,this.panMoveHandler),null==(n=this.handler)||n.removeEventListener(Ju.PAN_END,this.panEndHandler),null==(s=this.handler)||s.removeEventListener(Ju.POINTEROVER,this.pointerOverHandler),null==(r=this.handler)||r.removeEventListener(Ju.POINTEROUT,this.pointerOutHandler),null==(a=this.handler)||a.removeEventListener(Ju.POINTERMOVE,this.pointerMoveHandler)}handleTap(t){this.toolManager.handleTap(t)}handlePanStart(t){this.toolManager.handlePanStart(t)}handlePanMove(t){this.toolManager.handlePanMove(t)}handlePanEnd(t){this.toolManager.handlePanEnd(t)}handlePointerOver(t){this.toolManager.handlePointerOver(t)}handlePointerOut(t){this.toolManager.handlePointerOut(t)}handlePointerMove(t){this.toolManager.handlePointerMove(t)}update(){this.toolManager.update()}setEnablePan(t=!1){this.view&&this.view.setEnablePan&&this.view.setEnablePan(t)}selectEnableChanged(t=!1){t?this.setMode(Ku.PICKER):this.clearMode()}multiSelectEnableChanged(t=!1){t?this.setMode(Ku.PICKER):this.clearMode()}fnEnableChanged(t=!1){var e;null==(e=this.toolManager.get(Qu.SELECTOR_RECT))||e.fnEnableChanged(t)}clearSelected(t){var e;this.mode&Qu.SELECT||this.setMode(Ku.PICKER),null==(e=this.toolManager.get(Qu.SELECT))||e.clearSelected(t)}selectByIds(t,e){var i;this.mode&Qu.SELECT||this.setMode(Ku.PICKER),null==(i=this.toolManager.get(Qu.SELECT))||i.selectByIds(t,e)}setDynamicFill(t){var e;null==(e=this.toolManager.get(Qu.SELECT))||e.setDynamicFill(t)}clearDummies(t){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.clearDummies(t)}setDummies(t){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.setDummies(t)}focusAtDummy(t,e=1e3){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.focusAtDummy(t,e)}highlightDummies(t){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.highlightDummies(t)}resetHighlightDummies(){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.resetHighlightDummies()}getAssetLabels(t,e){var i;if(this.mode===Ku.DUMMY)return null==(i=this.toolManager.get(Qu.DUMMY))?void 0:i.getDummyLabels(e)}getAssetBoundingBox(t,e){var i;if(this.mode===Ku.DUMMY)return null==(i=this.toolManager.get(Qu.DUMMY))?void 0:i.getDummiesBoundingBox(t,e)}bindEditorDrag(t){var e;if(this.mode===Ku.DUMMY)return null==(e=this.toolManager.get(Qu.DUMMY))?void 0:e.bindEditorDrag(t)}setEditorDraggingObject(t){var e,i;if(this.mode===Ku.DUMMY){const n=null==(e=this.toolManager.get(Qu.DUMMY))?void 0:e.getDraggingObject(t);null==(i=this.toolManager.get(Qu.DRAG))||i.setDraggingObject(n)}}getDummies(t){var e;if(this.mode===Ku.DUMMY)return null==(e=this.toolManager.get(Qu.DUMMY))?void 0:e.getDummiesVo(t)}setFillByIds(t,e){var i;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(i=this.toolManager.get(Qu.DISTRIBUTION))||i.setFillByIds(t,e)}setStrokeByIds(t,e){var i;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(i=this.toolManager.get(Qu.DISTRIBUTION))||i.setStrokeByIds(t,e)}clearFillByIds(t){var e;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(e=this.toolManager.get(Qu.DISTRIBUTION))||e.clearFillByIds(t)}clearStrokeByIds(t){var e;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(e=this.toolManager.get(Qu.DISTRIBUTION))||e.clearStrokeByIds(t)}clearByIds(t){var e;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(e=this.toolManager.get(Qu.DISTRIBUTION))||e.clearByIds(t)}getLegend(){var t;return this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(t=this.toolManager.get(Qu.DISTRIBUTION))?void 0:t.getLegend()}linkAssetsByTree(t){var e;this.mode!==Ku.LINKER&&this.setMode(Ku.LINKER),null==(e=this.toolManager.get(Qu.LINKER))||e.linkAssetsByTree(t)}}const Hc=new Oi,Vc=new ri,jc=new class extends hi{constructor(){super(),d(this,"name","App2@"+fi.now()),d(this,"scenes",[]),d(this,"requestHeader",{}),d(this,"_tic"),d(this,"_url"),d(this,"_layers"),d(this,"_lastCameraVersion",-1/0),d(this,"_runningHandler",this.running.bind(this)),d(this,"_pointerOverHandler",(t=>this.dispatchEvent(t))),d(this,"_pointerOutHandler",(t=>this.dispatchEvent(t))),d(this,"_selectedHandler",(t=>this.dispatchEvent(t))),d(this,"_dragEndHandler",(t=>this.dispatchEvent(t))),this.adapter=new Oh}destroy(){var t,e,i,n,s;this.unbindEvents(),super.destroy(),null==(t=this.composer)||t.destroy(),null==(e=this.mainScene)||e.destroy(),null==(i=this.animateScene)||i.destroy(),null==(n=this.view)||n.destroy(),null==(s=this.renderer)||s.destroy()}init(t={}){var e,i;return this.params=t,this.renderer||(this.renderer=new Vh(t)),this.view||(this.view=new _u(t)),this.composer||(this.composer=new Jh(this.renderer,new Zh(t))),this.editor||(this.editor=new qc(this.params.inpEl?this.params.inpEl:this.params.cvs,this.view)),null==(e=this.mainScene)||e.destroy(),this.mainScene=new Pu(t,this.adapter),null==(i=this.animateScene)||i.destroy(),this.animateScene=new Uu(t),this.trans2LoadingScene(),this.bindEvents(),this}bindEvents(){var t,e,i,n;this.unbindEvents(),null==(t=this.editor)||t.addEventListener(oi.POINTER_OVER,this._pointerOverHandler),null==(e=this.editor)||e.addEventListener(oi.POINTER_OUT,this._pointerOutHandler),null==(i=this.editor)||i.addEventListener(oi.SELECTED,this._selectedHandler),null==(n=this.editor)||n.addEventListener(oi.DRAG_END,this._dragEndHandler)}unbindEvents(){var t,e,i,n;null==(t=this.editor)||t.removeEventListener(oi.POINTER_OVER,this._pointerOverHandler),null==(e=this.editor)||e.removeEventListener(oi.POINTER_OUT,this._pointerOutHandler),null==(i=this.editor)||i.removeEventListener(oi.SELECTED,this._selectedHandler),null==(n=this.editor)||n.removeEventListener(oi.DRAG_END,this._dragEndHandler)}get isLoadingScene(){var t;return"LoadingScene"===(null==(t=this.scenes[0])?void 0:t.name)}setRequestHeader(t){return this.requestHeader=t,this}load(t,e,i=2){return p(this,null,(function*(){if(this._tic&&this._tic.clear(),this._url=t,this._layers=e,yield this.trans2LoadingScene(),!t)throw"url not found";const i=yield this.adapter.setRequestHeader(this.requestHeader).load(t,e);return this.adapter.bindScene(this.mainScene).initResources(i,e),yield this.trans2MainScene(),(i||{}).idsTree}))}hasScene(t){return this.scenes.findIndex((e=>e.uuid===t.uuid))>=0}pushScene(t){this.hasScene(t)||(this.view.bindScene(t),this.scenes.push(t))}clearScenes(){this.view.scenes.length=0,this.scenes.forEach((t=>this.removeScene(t))),this.scenes.length=0,this.loadingScene=void 0}removeScene(t){const e=this.scenes.findIndex((e=>e.uuid===t.uuid));e<0||(this.scenes[e].destroy(),this.scenes.splice(e,1))}removeLoadingScene(){this.loadingScene&&(this.removeScene(this.loadingScene),this.loadingScene=void 0)}trans2LoadingScene(){return p(this,null,(function*(){var t;this.clearScenes(),this.loadingScene||(this.loadingScene=new eu(this.params)),this.pushScene(this.loadingScene),null==(t=this.editor)||t.dispose(),this.view.fullscreen(250);const e=new tl(this.loadingScene,this.view.camera);this.composer.clearPasses(),this.composer.addPass(e),this.mainScene=new Pu(this.params,this.adapter)}))}trans2MainScene(){return p(this,null,(function*(){var t,e;this.clearScenes(),this.mainScene||(this.mainScene=new Pu(this.params,this.adapter)),this.animateScene||(this.animateScene=new Uu(this.params)),null==(t=this.editor)||t.setMode(Ku.DEFAULT),null==(e=this.editor)||e.bindScene(this.mainScene,this.animateScene),this.mainScene.setViewBox(this.adapter.getViewBox()),this.pushScene(this.mainScene),this.view.scene=this.mainScene,this.view.fullscreen(10,!0);const i=new el(this.mainScene,this.view.camera,!1,!1),n=new tl(this.animateScene,this.view.camera,!1,!1),s=new rl;this.composer.clearPasses(),this.params.bgPass&&this.composer.addPass(new cl(this.view.camera)),this.composer.addPass(i),this.composer.addPass(n),this.composer.addPass(s)}))}trans2EmptyScene(){var t;this.clearScenes(),this.emptyScene=new Fu(this.params),null==(t=this.editor)||t.dispose(),this.pushScene(this.emptyScene),this.view.scene=this.emptyScene,this.view.fullscreen(250,!0),this.editor&&this.editor.bindScene(this.emptyScene);const e=new tl(this.emptyScene,this.view.camera);this.composer.clearPasses(),this.composer.addPass(e)}debounceCacheChanged(t=!1){this.params.debounceCache=t}wireframeChanged(t=!1){this.params.wireframe=t}sliceDurationChanged(t){this.params.sliceDuration=t}selectEnableChanged(t=!1){return p(this,null,(function*(){var e;yield this.clearSelected(),this.params.selectEnable=t,null==(e=this.editor)||e.selectEnableChanged(t)}))}multiSelectEnableChanged(t=!1){return p(this,null,(function*(){var e;yield this.clearSelected(),this.params.multiSelectEnable=t,null==(e=this.editor)||e.multiSelectEnableChanged(t)}))}assetTypeChanged(t){return p(this,null,(function*(){t&&(this.params.assetType=t,this.setAssetType(t))}))}fnEnableChanged(t){return p(this,null,(function*(){var e;this.params.fnEnable=!!t,null==(e=this.editor)||e.fnEnableChanged(t)}))}zoomToSelectEnableChanged(t){return p(this,null,(function*(){this.params.zoomToSelectEnable=!!t}))}socialDistanceEnableChanged(t){return p(this,null,(function*(){this.params.socialDistanceEnable=!!t}))}enableHoverChanged(t){return p(this,null,(function*(){var e,i;mi.set(this.params,"controls.enableHover",!!t),null==(i=null==(e=this.editor)?void 0:e.handler)||i.enableHover(this.params.controls.enableHover)}))}resize(){var t;let e;this.params.containerId&&(e=Jr.window.document.getElementById(this.params.containerId)),e||(e=Jr.window.document.getElementsByTagName("body")[0]);const i=null==(t=null==e?void 0:e.parentElement)?void 0:t.getBoundingClientRect();i&&this.setSize(i.width,i.height)}setSize(t,e){var i,n,s;null==(i=this.renderer)||i.setSize(t,e),null==(n=this.view)||n.resize(),null==(s=this.composer)||s.setSize(t,e)}refresh(){this.view.camera.needsUpdate=!0}fullscreen(){this.view.fullscreen(1,!0)}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}zoomIn(){this.view.zoomIn()}zoomOut(){this.view.zoomOut()}fontZoomIn(t=1.1){var e;null==(e=this.mainScene)||e.increaseFontSize(t)}fontZoomOut(t=.9){var e;null==(e=this.mainScene)||e.increaseFontSize(t)}unproject(t){return p(this,null,(function*(){return Hc.copy(t).unproject(this.view.camera)}))}strokeMore(t=1.1){var e;null==(e=this.mainScene)||e.increaseStrokeWidth(t)}strokeLess(t=.9){var e;null==(e=this.mainScene)||e.increaseStrokeWidth(t)}updateLayersVisibility(t,e=!1){this.adapter.updateLayersVisibility(t,e)}getLayers(t=2){return p(this,null,(function*(){return this.adapter.getLayers(t)}))}focusAtIds(t,e=100){return p(this,null,(function*(){if(!this.mainScene)return;const i=this.adapter.getBoundingBoxByIds(t);return i&&!i.isEmpty()?(i.expandByVector(new Oi(1,1).multiplyScalar(e)),i.isEmpty()||(yield this.view.resetCameraByBoundingBox(i,!0)),i):void 0}))}clearSelected(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.clearSelected(t)}))}targetByIds(t){return p(this,null,(function*(){var e,i;this.clearSelected(),this.selectByIds(t);let n=null==(e=this.mainScene)?void 0:e.getAssetBoundingBox(t);n||(n=null==(i=this.editor)?void 0:i.getAssetBoundingBox(t)),n&&(n.isEmpty()||(n.getSize(Hc),n.expandByScalar(Math.round(.5*Math.max(Hc.x,Hc.y))),yield this.view.resetCameraByBoundingBox(n,!0)))}))}getAssetIdsByType(t){return p(this,null,(function*(){var e;return null==(e=this.adapter)?void 0:e.getAssetIdsByType(t)}))}setFillByIds(t,e){return p(this,null,(function*(){var i;null==(i=this.editor)||i.setFillByIds(t,e)}))}clearFillByIds(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.clearFillByIds(t)}))}setStrokeByIds(t,e){return p(this,null,(function*(){var i;null==(i=this.editor)||i.setStrokeByIds(t,e)}))}clearFill(){return p(this,null,(function*(){var t;null==(t=this.editor)||t.clearFillByIds()}))}clearStroke(){return p(this,null,(function*(){var t;null==(t=this.editor)||t.clearStrokeByIds()}))}getLegend(){return p(this,null,(function*(){var t;return null==(t=this.editor)?void 0:t.getLegend()}))}getAssetLabels(t,e){return p(this,null,(function*(){var i,n;return t===pn?null==(i=this.editor)?void 0:i.getAssetLabels(t,e):null==(n=this.mainScene)?void 0:n.getAssetLabels(t,e)}))}setAssetLabels(t,e){return p(this,null,(function*(){var i;return null==(i=this.mainScene)?void 0:i.setAssetLabels(t,e)}))}clearAssetLabels(t){return p(this,null,(function*(){var e;return null==(e=this.mainScene)?void 0:e.clearAssetLabels(t)}))}selectByIds(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.selectByIds(t,!0)}))}getAssetBoundingBox(t,e){return p(this,null,(function*(){var i,n;let s=null==(i=this.mainScene)?void 0:i.getAssetBoundingBox(t);if(s||(s=null==(n=this.editor)?void 0:n.getAssetBoundingBox(t)),s)return e?s.applyMatrix3(this.view.camera.viewMatrix):s}))}setAssetType(t,e){var i;t&&(this.params.assetType=t,null==(i=this.mainScene)||i.setAssetType(t,e))}linkAssetsByTree(t){var e;null==(e=this.editor)||e.linkAssetsByTree(t)}clearDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.clearDummies(t)}))}setDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setDummies(t)}))}focusAtDummy(t,e=1e3){return p(this,null,(function*(){var i;return null==(i=this.editor)?void 0:i.focusAtDummy(t,e)}))}highlightDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.highlightDummies(t)}))}resetHighlightDummies(){return p(this,null,(function*(){var t;return null==(t=this.editor)?void 0:t.resetHighlightDummies()}))}setEditorMode(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setMode(t)}))}bindEditorDrag(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.bindEditorDrag(t)}))}setEditorDraggingObject(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setEditorDraggingObject(t)}))}getDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.getDummies(t)}))}start(){requestAnimationFrame(this._runningHandler)}running(t){var e,i,n,s,r,a;null==(e=this.view)||e.update(t),null==(i=this.editor)||i.update(),(null==(n=this.scenes)?void 0:n.length)&&this.scenes.forEach((t=>"function"==typeof(null==t?void 0:t.update)?t.update():void 0)),null==(s=this.composer)||s.render(),this._lastCameraVersion=null==(a=null==(r=this.view)?void 0:r.camera)?void 0:a.version,requestAnimationFrame(this._runningHandler)}},Yc=function(t){const e=(null==t?void 0:t.data)||{};delete e.target,self.postMessage({type:oi.POINTER_OVER,data:e})},Gc=function(t){const e=(null==t?void 0:t.data)||{};delete e.target,self.postMessage({type:oi.POINTER_OUT,data:e})},Xc=function(t){self.postMessage({type:oi.SELECTED,data:null==t?void 0:t.data})},Zc=function(t){self.postMessage({type:oi.DRAG_END,data:null==t?void 0:t.data})},$c=function(){jc.removeEventListener(oi.POINTER_OVER,Yc),jc.removeEventListener(oi.POINTER_OUT,Gc),jc.removeEventListener(oi.SELECTED,Xc),jc.removeEventListener(oi.DRAG_END,Zc)};jc.addEventListener(oi.POINTER_OVER,Yc),jc.addEventListener(oi.POINTER_OUT,Gc),jc.addEventListener(oi.SELECTED,Xc),jc.addEventListener(oi.DRAG_END,Zc);const Jc={makeProxy:function(t){Vc.makeProxy(t)},start:function(t){const e=Vc.getProxy(t.proxyId);e.ownerDocument=e,self.document={};const i=c(u({},t.conf),{cvs:t.canvas,workerRender:!0,inpEl:e});jc.init(i).start()},event:Vc.handleEvent,ping:()=>self.postMessage({type:"pang"}),[oi.TERMINATE]:function(){$c(),jc.destroy()},[oi.LOAD]:e=>p(t,null,(function*(){return self.postMessage({type:oi.LOAD,data:yield jc.load(null==e?void 0:e.url,null==e?void 0:e.layers,null==e?void 0:e.lv)})})),[oi.SET_SIZE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_SIZE,data:yield jc.setSize(null==e?void 0:e.w,null==e?void 0:e.h)})})),[oi.DEBOUNCE_CACHE_CHANGED]:t=>jc.debounceCacheChanged(t.v),[oi.WIREFRAME_CHANGED]:t=>jc.wireframeChanged(t.v),[oi.SLICE_DURATION_CHANGED]:t=>jc.sliceDurationChanged(t.v),[oi.SELECT_ENABLE_CHANGED]:t=>jc.selectEnableChanged(t.v),[oi.MULTI_SELECT_ENABLE_CHANGED]:t=>jc.multiSelectEnableChanged(t.v),[oi.ASSET_TYPE_CHANGED]:t=>jc.assetTypeChanged(t.v),[oi.FN_ENABLE_CHANGED]:t=>jc.fnEnableChanged(t.v),[oi.ZOOM_TO_SELECT_ENABLE_CHANGED]:t=>jc.zoomToSelectEnableChanged(t.v),[oi.SOCIAL_DISTANCE_ENABLE_CHANGED]:t=>jc.socialDistanceEnableChanged(t.v),[oi.ENABLE_HOVER_CHANGED]:t=>jc.enableHoverChanged(t.v),[oi.REFRESH]:()=>p(t,null,(function*(){return self.postMessage({type:oi.REFRESH,data:yield jc.refresh()})})),[oi.FULLSCREEN]:()=>p(t,null,(function*(){return self.postMessage({type:oi.FULLSCREEN,data:yield jc.fullscreen()})})),[oi.GET_CAMERA_POSITION]:()=>{var t;return self.postMessage({type:oi.GET_CAMERA_POSITION,data:null==(t=jc.view)?void 0:t.getCameraPosition()})},[oi.SET_CAMERA_POSITION]:e=>p(t,null,(function*(){var t;return self.postMessage({type:oi.SET_CAMERA_POSITION,data:yield null==(t=jc.view)?void 0:t.setCameraPosition(null==e?void 0:e.data,!0)})})),[oi.ZOOM_IN]:()=>p(t,null,(function*(){return self.postMessage({type:oi.ZOOM_IN,data:yield jc.zoomIn()})})),[oi.ZOOM_OUT]:()=>p(t,null,(function*(){return self.postMessage({type:oi.ZOOM_OUT,data:yield jc.zoomOut()})})),[oi.FONT_ZOOM_IN]:e=>p(t,null,(function*(){return self.postMessage({type:oi.FONT_ZOOM_IN,data:yield jc.fontZoomIn(null==e?void 0:e.v)})})),[oi.FONT_ZOOM_OUT]:e=>p(t,null,(function*(){return self.postMessage({type:oi.FONT_ZOOM_OUT,data:yield jc.fontZoomOut(null==e?void 0:e.v)})})),[oi.UNPROJECT]:e=>p(t,null,(function*(){return self.postMessage({type:oi.UNPROJECT,data:yield jc.unproject(null==e?void 0:e.v)})})),[oi.STROKE_MORE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.STROKE_MORE,data:yield jc.strokeMore(null==e?void 0:e.v)})})),[oi.STROKE_LESS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.STROKE_LESS,data:yield jc.strokeLess(null==e?void 0:e.v)})})),[oi.UPDATE_LAYERS_VISIBILITY]:function(t){jc.updateLayersVisibility(null==t?void 0:t.ids,null==t?void 0:t.visible)},getLayers:function(t){return p(this,null,(function*(){const e=yield jc.getLayers(null==t?void 0:t.lv);self.postMessage({type:oi.GET_LAYERS,data:e})}))},[oi.FOCUS_AT_IDS]:function(t){return p(this,null,(function*(){const e=yield jc.focusAtIds(null==t?void 0:t.ids,null==t?void 0:t.padding);self.postMessage({type:oi.FOCUS_AT_IDS,data:e})}))},[oi.CLEAR_SELECTED]:function(t){return p(this,null,(function*(){const e=yield jc.clearSelected(null==t?void 0:t.data);self.postMessage({type:oi.CLEAR_SELECTED,data:e})}))},[oi.TARGET_BY_IDS]:function(t){return p(this,null,(function*(){const e=yield jc.targetByIds(null==t?void 0:t.ids);self.postMessage({type:oi.TARGET_BY_IDS,data:e})}))},[oi.GET_ASSET_IDS_BY_TYPE]:function(t){return p(this,null,(function*(){const e=yield jc.getAssetIdsByType(null==t?void 0:t.assetType);self.postMessage({type:oi.GET_ASSET_IDS_BY_TYPE,data:e})}))},[oi.SET_FILL_BY_IDS]:function(t){return p(this,null,(function*(){const e=yield jc.setFillByIds(null==t?void 0:t.ids,null==t?void 0:t.c);self.postMessage({type:oi.SET_FILL_BY_IDS,data:e})}))},[oi.CLEAR_FILL_BY_IDS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.CLEAR_FILL_BY_IDS,data:yield jc.clearFillByIds(null==e?void 0:e.ids)})})),[oi.SET_STROKE_BY_IDS]:function(t){return p(this,null,(function*(){const e=yield jc.setStrokeByIds(null==t?void 0:t.ids,null==t?void 0:t.c);self.postMessage({type:oi.SET_STROKE_BY_IDS,data:e})}))},[oi.CLEAR_FILL]:function(t){return p(this,null,(function*(){const t=yield jc.clearFill();self.postMessage({type:oi.CLEAR_FILL,data:t})}))},[oi.CLEAR_STROKE]:function(t){return p(this,null,(function*(){const t=yield jc.clearStroke();self.postMessage({type:oi.CLEAR_STROKE,data:t})}))},[oi.GET_LEGEND]:()=>p(t,null,(function*(){return self.postMessage({type:oi.GET_LEGEND,data:yield jc.getLegend()})})),[oi.GET_ASSET_LABELS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.GET_ASSET_LABELS,data:yield jc.getAssetLabels(null==e?void 0:e.assetType,null==e?void 0:e.id)})})),[oi.SET_ASSET_LABELS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_ASSET_LABELS,data:yield jc.setAssetLabels(null==e?void 0:e.id,null==e?void 0:e.labels)})})),[oi.CLEAR_ASSET_LABELS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.CLEAR_ASSET_LABELS,data:yield jc.clearAssetLabels(null==e?void 0:e.assetType)})})),[oi.SELECT_BY_IDS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SELECT_BY_IDS,data:yield jc.selectByIds(null==e?void 0:e.ids)})})),[oi.GET_ASSET_BOUNDING_BOX]:e=>p(t,null,(function*(){return self.postMessage({type:oi.GET_ASSET_BOUNDING_BOX,data:yield jc.getAssetBoundingBox(null==e?void 0:e.id,null==e?void 0:e.isViewCoords)})})),[oi.SET_ASSET_TYPE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_ASSET_TYPE,data:yield jc.setAssetType(null==e?void 0:e.assetType,null==e?void 0:e.showLayers)})})),[oi.LINK_ASSETS_BY_TREE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.LINK_ASSETS_BY_TREE,data:yield jc.linkAssetsByTree(null==e?void 0:e.o)})})),[oi.CLEAR_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.CLEAR_DUMMIES,data:yield jc.clearDummies(null==e?void 0:e.aeTypes)})})),[oi.SET_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_DUMMIES,data:yield jc.setDummies(null==e?void 0:e.dummies)})})),[oi.FOCUS_AT_DUMMY]:e=>p(t,null,(function*(){return self.postMessage({type:oi.FOCUS_AT_DUMMY,data:yield jc.focusAtDummy(null==e?void 0:e.id,null==e?void 0:e.padding)})})),[oi.HIGHLIGHT_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.HIGHLIGHT_DUMMIES,data:yield jc.highlightDummies(null==e?void 0:e.ids)})})),[oi.RESET_HIGHLIGHT_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.RESET_HIGHLIGHT_DUMMIES,data:yield jc.resetHighlightDummies()})})),[oi.SET_EDITOR_MODE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_EDITOR_MODE,data:yield jc.setEditorMode(null==e?void 0:e.mode)})})),[oi.BIND_EDITOR_DRAG]:e=>p(t,null,(function*(){return self.postMessage({type:oi.BIND_EDITOR_DRAG,data:yield jc.bindEditorDrag(null==e?void 0:e.vo)})})),[oi.SET_EDITOR_DRAGGING_OBJECT]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_EDITOR_DRAGGING_OBJECT,data:yield jc.setEditorDraggingObject(null==e?void 0:e.vo)})})),[oi.GET_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.GET_DUMMIES,data:yield jc.getDummies(null==e?void 0:e.hasBound)})}))};self.onmessage=function(t){var e,i;const n=Jc[null==(e=t.data)?void 0:e.type];if("function"!=typeof n)throw new Error(`unsupported command: ${null==(i=t.data)?void 0:i.type}`);n(t.data)}}},function(){return e||(0,t[r(t)[0]])((e={exports:{}}).exports,e),e.exports});export default f();
16
- //# sourceMappingURL=renderer2.worker.js.map
15
+ */ci=pi,di=pi.exports,function(){var t,e="Expected a function",i="__lodash_hash_undefined__",n="__lodash_placeholder__",s=32,r=128,a=256,o=1/0,h=9007199254740991,l=NaN,u=4294967295,c=[["ary",r],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",a]],d="[object Arguments]",p="[object Array]",f="[object Boolean]",m="[object Date]",y="[object Error]",g="[object Function]",v="[object GeneratorFunction]",x="[object Map]",b="[object Number]",_="[object Object]",w="[object Promise]",S="[object RegExp]",M="[object Set]",E="[object String]",A="[object Symbol]",T="[object WeakMap]",I="[object ArrayBuffer]",C="[object DataView]",D="[object Float32Array]",N="[object Float64Array]",B="[object Int8Array]",k="[object Int16Array]",O="[object Int32Array]",P="[object Uint8Array]",L="[object Uint8ClampedArray]",R="[object Uint16Array]",z="[object Uint32Array]",U=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,V=RegExp(q.source),j=RegExp(H.source),Y=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,K=RegExp(Q.source),tt=/^\s+/,et=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nt=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,at=/[()=,{}\[\]\/\s]/,ot=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lt=/\w*$/,ut=/^[-+]0x[0-9a-f]+$/i,ct=/^0b[01]+$/i,dt=/^\[object .+?Constructor\]$/,pt=/^0o[0-7]+$/i,ft=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,gt=/['\n\r\u2028\u2029\\]/g,vt="\\ud800-\\udfff",xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",bt="\\u2700-\\u27bf",_t="a-z\\xdf-\\xf6\\xf8-\\xff",wt="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",Mt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Et="['’]",At="["+vt+"]",Tt="["+Mt+"]",It="["+xt+"]",Ct="\\d+",Dt="["+bt+"]",Nt="["+_t+"]",Bt="[^"+vt+Mt+Ct+bt+_t+wt+"]",kt="\\ud83c[\\udffb-\\udfff]",Ot="[^"+vt+"]",Pt="(?:\\ud83c[\\udde6-\\uddff]){2}",Lt="[\\ud800-\\udbff][\\udc00-\\udfff]",Rt="["+wt+"]",zt="\\u200d",Ut="(?:"+Nt+"|"+Bt+")",Ft="(?:"+Rt+"|"+Bt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+It+"|"+kt+")?",Vt="["+St+"]?",jt=Vt+Ht+"(?:"+zt+"(?:"+[Ot,Pt,Lt].join("|")+")"+Vt+Ht+")*",Yt="(?:"+[Dt,Pt,Lt].join("|")+")"+jt,Gt="(?:"+[Ot+It+"?",It,Pt,Lt,At].join("|")+")",Xt=RegExp(Et,"g"),Zt=RegExp(It,"g"),$t=RegExp(kt+"(?="+kt+")|"+Gt+jt,"g"),Jt=RegExp([Rt+"?"+Nt+"+"+Wt+"(?="+[Tt,Rt,"$"].join("|")+")",Ft+"+"+qt+"(?="+[Tt,Rt+Ut,"$"].join("|")+")",Rt+"?"+Ut+"+"+Wt,Rt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ct,Yt].join("|"),"g"),Qt=RegExp("["+zt+vt+xt+St+"]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,te=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ee=-1,ie={};ie[D]=ie[N]=ie[B]=ie[k]=ie[O]=ie[P]=ie[L]=ie[R]=ie[z]=!0,ie[d]=ie[p]=ie[I]=ie[f]=ie[C]=ie[m]=ie[y]=ie[g]=ie[x]=ie[b]=ie[_]=ie[S]=ie[M]=ie[E]=ie[T]=!1;var ne={};ne[d]=ne[p]=ne[I]=ne[C]=ne[f]=ne[m]=ne[D]=ne[N]=ne[B]=ne[k]=ne[O]=ne[x]=ne[b]=ne[_]=ne[S]=ne[M]=ne[E]=ne[A]=ne[P]=ne[L]=ne[R]=ne[z]=!0,ne[y]=ne[g]=ne[T]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},re=parseFloat,ae=parseInt,oe="object"==typeof li&&li&&li.Object===Object&&li,he="object"==typeof self&&self&&self.Object===Object&&self,le=oe||he||Function("return this")(),ue=di&&!di.nodeType&&di,ce=ue&&ci&&!ci.nodeType&&ci,de=ce&&ce.exports===ue,pe=de&&oe.process,fe=function(){try{var t=ce&&ce.require&&ce.require("util").types;return t||pe&&pe.binding&&pe.binding("util")}catch(t){}}(),me=fe&&fe.isArrayBuffer,ye=fe&&fe.isDate,ge=fe&&fe.isMap,ve=fe&&fe.isRegExp,xe=fe&&fe.isSet,be=fe&&fe.isTypedArray;function _e(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function we(t,e,i,n){for(var s=-1,r=null==t?0:t.length;++s<r;){var a=t[s];e(n,a,i(a),t)}return n}function Se(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}function Me(t,e){for(var i=null==t?0:t.length;i--&&!1!==e(t[i],i,t););return t}function Ee(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(!e(t[i],i,t))return!1;return!0}function Ae(t,e){for(var i=-1,n=null==t?0:t.length,s=0,r=[];++i<n;){var a=t[i];e(a,i,t)&&(r[s++]=a)}return r}function Te(t,e){return!(null==t||!t.length)&&Re(t,e,0)>-1}function Ie(t,e,i){for(var n=-1,s=null==t?0:t.length;++n<s;)if(i(e,t[n]))return!0;return!1}function Ce(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s}function De(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t}function Ne(t,e,i,n){var s=-1,r=null==t?0:t.length;for(n&&r&&(i=t[++s]);++s<r;)i=e(i,t[s],s,t);return i}function Be(t,e,i,n){var s=null==t?0:t.length;for(n&&s&&(i=t[--s]);s--;)i=e(i,t[s],s,t);return i}function ke(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}var Oe=We("length");function Pe(t,e,i){var n;return i(t,(function(t,i,s){if(e(t,i,s))return n=i,!1})),n}function Le(t,e,i,n){for(var s=t.length,r=i+(n?1:-1);n?r--:++r<s;)if(e(t[r],r,t))return r;return-1}function Re(t,e,i){return e==e?function(t,e,i){for(var n=i-1,s=t.length;++n<s;)if(t[n]===e)return n;return-1}(t,e,i):Le(t,Ue,i)}function ze(t,e,i,n){for(var s=i-1,r=t.length;++s<r;)if(n(t[s],e))return s;return-1}function Ue(t){return t!=t}function Fe(t,e){var i=null==t?0:t.length;return i?Ve(t,e)/i:l}function We(e){return function(i){return null==i?t:i[e]}}function qe(e){return function(i){return null==e?t:e[i]}}function He(t,e,i,n,s){return s(t,(function(t,s,r){i=n?(n=!1,t):e(i,t,s,r)})),i}function Ve(e,i){for(var n,s=-1,r=e.length;++s<r;){var a=i(e[s]);a!==t&&(n=n===t?a:n+a)}return n}function je(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}function Ye(t){return t?t.slice(0,hi(t)+1).replace(tt,""):t}function Ge(t){return function(e){return t(e)}}function Xe(t,e){return Ce(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function $e(t,e){for(var i=-1,n=t.length;++i<n&&Re(e,t[i],0)>-1;);return i}function Je(t,e){for(var i=t.length;i--&&Re(e,t[i],0)>-1;);return i}var Qe=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ke=qe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ti(t){return"\\"+se[t]}function ei(t){return Qt.test(t)}function ii(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function ni(t,e){return function(i){return t(e(i))}}function si(t,e){for(var i=-1,s=t.length,r=0,a=[];++i<s;){var o=t[i];o!==e&&o!==n||(t[i]=n,a[r++]=i)}return a}function ri(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}function ai(t){return ei(t)?function(t){for(var e=$t.lastIndex=0;$t.test(t);)++e;return e}(t):Oe(t)}function oi(t){return ei(t)?function(t){return t.match($t)||[]}(t):function(t){return t.split("")}(t)}function hi(t){for(var e=t.length;e--&&et.test(t.charAt(e)););return e}var ui=qe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pi=function et(vt){var xt,bt=(vt=null==vt?le:pi.defaults(le.Object(),vt,pi.pick(le,te))).Array,_t=vt.Date,wt=vt.Error,St=vt.Function,Mt=vt.Math,Et=vt.Object,At=vt.RegExp,Tt=vt.String,It=vt.TypeError,Ct=bt.prototype,Dt=St.prototype,Nt=Et.prototype,Bt=vt["__core-js_shared__"],kt=Dt.toString,Ot=Nt.hasOwnProperty,Pt=0,Lt=(xt=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+xt:"",Rt=Nt.toString,zt=kt.call(Et),Ut=le._,Ft=At("^"+kt.call(Ot).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wt=de?vt.Buffer:t,qt=vt.Symbol,Ht=vt.Uint8Array,Vt=Wt?Wt.allocUnsafe:t,jt=ni(Et.getPrototypeOf,Et),Yt=Et.create,Gt=Nt.propertyIsEnumerable,$t=Ct.splice,Qt=qt?qt.isConcatSpreadable:t,se=qt?qt.iterator:t,oe=qt?qt.toStringTag:t,he=function(){try{var t=lr(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=vt.clearTimeout!==le.clearTimeout&&vt.clearTimeout,ce=_t&&_t.now!==le.Date.now&&_t.now,pe=vt.setTimeout!==le.setTimeout&&vt.setTimeout,fe=Mt.ceil,Oe=Mt.floor,qe=Et.getOwnPropertySymbols,li=Wt?Wt.isBuffer:t,ci=vt.isFinite,di=Ct.join,fi=ni(Et.keys,Et),mi=Mt.max,yi=Mt.min,gi=_t.now,vi=vt.parseInt,xi=Mt.random,bi=Ct.reverse,_i=lr(vt,"DataView"),wi=lr(vt,"Map"),Si=lr(vt,"Promise"),Mi=lr(vt,"Set"),Ei=lr(vt,"WeakMap"),Ai=lr(Et,"create"),Ti=Ei&&new Ei,Ii={},Ci=zr(_i),Di=zr(wi),Ni=zr(Si),Bi=zr(Mi),ki=zr(Ei),Oi=qt?qt.prototype:t,Pi=Oi?Oi.valueOf:t,Li=Oi?Oi.toString:t;function Ri(t){if(eo(t)&&!Va(t)&&!(t instanceof Wi)){if(t instanceof Fi)return t;if(Ot.call(t,"__wrapped__"))return Ur(t)}return new Fi(t)}var zi=function(){function e(){}return function(i){if(!to(i))return{};if(Yt)return Yt(i);e.prototype=i;var n=new e;return e.prototype=t,n}}();function Ui(){}function Fi(e,i){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=t}function Wi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=u,this.__views__=[]}function qi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Hi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Vi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function ji(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new Vi;++e<i;)this.add(t[e])}function Yi(t){var e=this.__data__=new Hi(t);this.size=e.size}function Gi(t,e){var i=Va(t),n=!i&&Ha(t),s=!i&&!n&&Xa(t),r=!i&&!n&&!s&&lo(t),a=i||n||s||r,o=a?je(t.length,Tt):[],h=o.length;for(var l in t)!e&&!Ot.call(t,l)||a&&("length"==l||s&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||yr(l,h))||o.push(l);return o}function Xi(e){var i=e.length;return i?e[Yn(0,i-1)]:t}function Zi(t,e){return Br(Ts(t),rn(e,0,t.length))}function $i(t){return Br(Ts(t))}function Ji(e,i,n){(n!==t&&!Fa(e[i],n)||n===t&&!(i in e))&&nn(e,i,n)}function Qi(e,i,n){var s=e[i];Ot.call(e,i)&&Fa(s,n)&&(n!==t||i in e)||nn(e,i,n)}function Ki(t,e){for(var i=t.length;i--;)if(Fa(t[i][0],e))return i;return-1}function tn(t,e,i,n){return un(t,(function(t,s,r){e(n,t,i(t),r)})),n}function en(t,e){return t&&Is(e,Bo(e),t)}function nn(t,e,i){"__proto__"==e&&he?he(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function sn(e,i){for(var n=-1,s=i.length,r=bt(s),a=null==e;++n<s;)r[n]=a?t:To(e,i[n]);return r}function rn(e,i,n){return e==e&&(n!==t&&(e=e<=n?e:n),i!==t&&(e=e>=i?e:i)),e}function an(e,i,n,s,r,a){var o,h=1&i,l=2&i,u=4&i;if(n&&(o=r?n(e,s,r,a):n(e)),o!==t)return o;if(!to(e))return e;var c=Va(e);if(c){if(o=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&Ot.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(e),!h)return Ts(e,o)}else{var p=dr(e),y=p==g||p==v;if(Xa(e))return _s(e,h);if(p==_||p==d||y&&!r){if(o=l||y?{}:fr(e),!h)return l?function(t,e){return Is(t,cr(t),e)}(e,function(t,e){return t&&Is(e,ko(e),t)}(o,e)):function(t,e){return Is(t,ur(t),e)}(e,en(o,e))}else{if(!ne[p])return r?e:{};o=function(t,e,i){var n,s=t.constructor;switch(e){case I:return ws(t);case f:case m:return new s(+t);case C:return function(t,e){var i=e?ws(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,i);case D:case N:case B:case k:case O:case P:case L:case R:case z:return Ss(t,i);case x:return new s;case b:case E:return new s(t);case S:return function(t){var e=new t.constructor(t.source,lt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new s;case A:return n=t,Pi?Et(Pi.call(n)):{}}}(e,p,h)}}a||(a=new Yi);var w=a.get(e);if(w)return w;a.set(e,o),ao(e)?e.forEach((function(t){o.add(an(t,i,n,t,e,a))})):io(e)&&e.forEach((function(t,s){o.set(s,an(t,i,n,s,e,a))}));var T=c?t:(u?l?ir:er:l?ko:Bo)(e);return Se(T||e,(function(t,s){T&&(t=e[s=t]),Qi(o,s,an(t,i,n,s,e,a))})),o}function on(e,i,n){var s=n.length;if(null==e)return!s;for(e=Et(e);s--;){var r=n[s],a=i[r],o=e[r];if(o===t&&!(r in e)||!a(o))return!1}return!0}function hn(i,n,s){if("function"!=typeof i)throw new It(e);return Ir((function(){i.apply(t,s)}),n)}function ln(t,e,i,n){var s=-1,r=Te,a=!0,o=t.length,h=[],l=e.length;if(!o)return h;i&&(e=Ce(e,Ge(i))),n?(r=Ie,a=!1):e.length>=200&&(r=Ze,a=!1,e=new ji(e));t:for(;++s<o;){var u=t[s],c=null==i?u:i(u);if(u=n||0!==u?u:0,a&&c==c){for(var d=l;d--;)if(e[d]===c)continue t;h.push(u)}else r(e,c,n)||h.push(u)}return h}Ri.templateSettings={escape:Y,evaluate:G,interpolate:X,variable:"",imports:{_:Ri}},Ri.prototype=Ui.prototype,Ri.prototype.constructor=Ri,Fi.prototype=zi(Ui.prototype),Fi.prototype.constructor=Fi,Wi.prototype=zi(Ui.prototype),Wi.prototype.constructor=Wi,qi.prototype.clear=function(){this.__data__=Ai?Ai(null):{},this.size=0},qi.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qi.prototype.get=function(e){var n=this.__data__;if(Ai){var s=n[e];return s===i?t:s}return Ot.call(n,e)?n[e]:t},qi.prototype.has=function(e){var i=this.__data__;return Ai?i[e]!==t:Ot.call(i,e)},qi.prototype.set=function(e,n){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Ai&&n===t?i:n,this},Hi.prototype.clear=function(){this.__data__=[],this.size=0},Hi.prototype.delete=function(t){var e=this.__data__,i=Ki(e,t);return!(i<0||(i==e.length-1?e.pop():$t.call(e,i,1),--this.size,0))},Hi.prototype.get=function(e){var i=this.__data__,n=Ki(i,e);return n<0?t:i[n][1]},Hi.prototype.has=function(t){return Ki(this.__data__,t)>-1},Hi.prototype.set=function(t,e){var i=this.__data__,n=Ki(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},Vi.prototype.clear=function(){this.size=0,this.__data__={hash:new qi,map:new(wi||Hi),string:new qi}},Vi.prototype.delete=function(t){var e=or(this,t).delete(t);return this.size-=e?1:0,e},Vi.prototype.get=function(t){return or(this,t).get(t)},Vi.prototype.has=function(t){return or(this,t).has(t)},Vi.prototype.set=function(t,e){var i=or(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},ji.prototype.add=ji.prototype.push=function(t){return this.__data__.set(t,i),this},ji.prototype.has=function(t){return this.__data__.has(t)},Yi.prototype.clear=function(){this.__data__=new Hi,this.size=0},Yi.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Yi.prototype.get=function(t){return this.__data__.get(t)},Yi.prototype.has=function(t){return this.__data__.has(t)},Yi.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Hi){var n=i.__data__;if(!wi||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new Vi(n)}return i.set(t,e),this.size=i.size,this};var un=Ns(vn),cn=Ns(xn,!0);function dn(t,e){var i=!0;return un(t,(function(t,n,s){return i=!!e(t,n,s)})),i}function pn(e,i,n){for(var s=-1,r=e.length;++s<r;){var a=e[s],o=i(a);if(null!=o&&(h===t?o==o&&!ho(o):n(o,h)))var h=o,l=a}return l}function fn(t,e){var i=[];return un(t,(function(t,n,s){e(t,n,s)&&i.push(t)})),i}function mn(t,e,i,n,s){var r=-1,a=t.length;for(i||(i=mr),s||(s=[]);++r<a;){var o=t[r];e>0&&i(o)?e>1?mn(o,e-1,i,n,s):De(s,o):n||(s[s.length]=o)}return s}var yn=Bs(),gn=Bs(!0);function vn(t,e){return t&&yn(t,e,Bo)}function xn(t,e){return t&&gn(t,e,Bo)}function bn(t,e){return Ae(e,(function(e){return Ja(t[e])}))}function _n(e,i){for(var n=0,s=(i=gs(i,e)).length;null!=e&&n<s;)e=e[Rr(i[n++])];return n&&n==s?e:t}function wn(t,e,i){var n=e(t);return Va(t)?n:De(n,i(t))}function Sn(e){return null==e?e===t?"[object Undefined]":"[object Null]":oe&&oe in Et(e)?function(e){var i=Ot.call(e,oe),n=e[oe];try{e[oe]=t;var s=!0}catch(t){}var r=Rt.call(e);return s&&(i?e[oe]=n:delete e[oe]),r}(e):function(t){return Rt.call(t)}(e)}function Mn(t,e){return t>e}function En(t,e){return null!=t&&Ot.call(t,e)}function An(t,e){return null!=t&&e in Et(t)}function Tn(e,i,n){for(var s=n?Ie:Te,r=e[0].length,a=e.length,o=a,h=bt(a),l=1/0,u=[];o--;){var c=e[o];o&&i&&(c=Ce(c,Ge(i))),l=yi(c.length,l),h[o]=!n&&(i||r>=120&&c.length>=120)?new ji(o&&c):t}c=e[0];var d=-1,p=h[0];t:for(;++d<r&&u.length<l;){var f=c[d],m=i?i(f):f;if(f=n||0!==f?f:0,!(p?Ze(p,m):s(u,m,n))){for(o=a;--o;){var y=h[o];if(!(y?Ze(y,m):s(e[o],m,n)))continue t}p&&p.push(m),u.push(f)}}return u}function In(e,i,n){var s=null==(e=Er(e,i=gs(i,e)))?e:e[Rr($r(i))];return null==s?t:_e(s,e,n)}function Cn(t){return eo(t)&&Sn(t)==d}function Dn(e,i,n,s,r){return e===i||(null==e||null==i||!eo(e)&&!eo(i)?e!=e&&i!=i:function(e,i,n,s,r,a){var o=Va(e),h=Va(i),l=o?p:dr(e),u=h?p:dr(i),c=(l=l==d?_:l)==_,g=(u=u==d?_:u)==_,v=l==u;if(v&&Xa(e)){if(!Xa(i))return!1;o=!0,c=!1}if(v&&!c)return a||(a=new Yi),o||lo(e)?Ks(e,i,n,s,r,a):function(t,e,i,n,s,r,a){switch(i){case C:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case I:return!(t.byteLength!=e.byteLength||!r(new Ht(t),new Ht(e)));case f:case m:case b:return Fa(+t,+e);case y:return t.name==e.name&&t.message==e.message;case S:case E:return t==e+"";case x:var o=ii;case M:var h=1&n;if(o||(o=ri),t.size!=e.size&&!h)return!1;var l=a.get(t);if(l)return l==e;n|=2,a.set(t,e);var u=Ks(o(t),o(e),n,s,r,a);return a.delete(t),u;case A:if(Pi)return Pi.call(t)==Pi.call(e)}return!1}(e,i,l,n,s,r,a);if(!(1&n)){var w=c&&Ot.call(e,"__wrapped__"),T=g&&Ot.call(i,"__wrapped__");if(w||T){var D=w?e.value():e,N=T?i.value():i;return a||(a=new Yi),r(D,N,n,s,a)}}return!!v&&(a||(a=new Yi),function(e,i,n,s,r,a){var o=1&n,h=er(e),l=h.length,u=er(i),c=u.length;if(l!=c&&!o)return!1;for(var d=l;d--;){var p=h[d];if(!(o?p in i:Ot.call(i,p)))return!1}var f=a.get(e),m=a.get(i);if(f&&m)return f==i&&m==e;var y=!0;a.set(e,i),a.set(i,e);for(var g=o;++d<l;){var v=e[p=h[d]],x=i[p];if(s)var b=o?s(x,v,p,i,e,a):s(v,x,p,e,i,a);if(!(b===t?v===x||r(v,x,n,s,a):b)){y=!1;break}g||(g="constructor"==p)}if(y&&!g){var _=e.constructor,w=i.constructor;_==w||!("constructor"in e)||!("constructor"in i)||"function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w||(y=!1)}return a.delete(e),a.delete(i),y}(e,i,n,s,r,a))}(e,i,n,s,Dn,r))}function Nn(e,i,n,s){var r=n.length,a=r,o=!s;if(null==e)return!a;for(e=Et(e);r--;){var h=n[r];if(o&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++r<a;){var l=(h=n[r])[0],u=e[l],c=h[1];if(o&&h[2]){if(u===t&&!(l in e))return!1}else{var d=new Yi;if(s)var p=s(u,c,l,e,i,d);if(!(p===t?Dn(c,u,3,s,d):p))return!1}}return!0}function Bn(t){return!(!to(t)||(e=t,Lt&&Lt in e))&&(Ja(t)?Ft:dt).test(zr(t));var e}function kn(t){return"function"==typeof t?t:null==t?sh:"object"==typeof t?Va(t)?Un(t[0],t[1]):zn(t):ph(t)}function On(t){if(!_r(t))return fi(t);var e=[];for(var i in Et(t))Ot.call(t,i)&&"constructor"!=i&&e.push(i);return e}function Pn(t){if(!to(t))return function(t){var e=[];if(null!=t)for(var i in Et(t))e.push(i);return e}(t);var e=_r(t),i=[];for(var n in t)("constructor"!=n||!e&&Ot.call(t,n))&&i.push(n);return i}function Ln(t,e){return t<e}function Rn(t,e){var i=-1,n=Ya(t)?bt(t.length):[];return un(t,(function(t,s,r){n[++i]=e(t,s,r)})),n}function zn(t){var e=hr(t);return 1==e.length&&e[0][2]?Sr(e[0][0],e[0][1]):function(i){return i===t||Nn(i,t,e)}}function Un(e,i){return vr(e)&&wr(i)?Sr(Rr(e),i):function(n){var s=To(n,e);return s===t&&s===i?Io(n,e):Dn(i,s,3)}}function Fn(e,i,n,s,r){e!==i&&yn(i,(function(a,o){if(r||(r=new Yi),to(a))!function(e,i,n,s,r,a,o){var h=Ar(e,n),l=Ar(i,n),u=o.get(l);if(u)Ji(e,n,u);else{var c=a?a(h,l,n+"",e,i,o):t,d=c===t;if(d){var p=Va(l),f=!p&&Xa(l),m=!p&&!f&&lo(l);c=l,p||f||m?Va(h)?c=h:Ga(h)?c=Ts(h):f?(d=!1,c=_s(l,!0)):m?(d=!1,c=Ss(l,!0)):c=[]:so(l)||Ha(l)?(c=h,Ha(h)?c=vo(h):to(h)&&!Ja(h)||(c=fr(l))):d=!1}d&&(o.set(l,c),r(c,l,s,a,o),o.delete(l)),Ji(e,n,c)}}(e,i,o,n,Fn,s,r);else{var h=s?s(Ar(e,o),a,o+"",e,i,r):t;h===t&&(h=a),Ji(e,o,h)}}),ko)}function Wn(e,i){var n=e.length;if(n)return yr(i+=i<0?n:0,n)?e[i]:t}function qn(t,e,i){e=e.length?Ce(e,(function(t){return Va(t)?function(e){return _n(e,1===t.length?t[0]:t)}:t})):[sh];var n=-1;return e=Ce(e,Ge(ar())),function(t,e){var i=t.length;for(t.sort(e);i--;)t[i]=t[i].value;return t}(Rn(t,(function(t,i,s){return{criteria:Ce(e,(function(e){return e(t)})),index:++n,value:t}})),(function(t,e){return function(t,e,i){for(var n=-1,s=t.criteria,r=e.criteria,a=s.length,o=i.length;++n<a;){var h=Ms(s[n],r[n]);if(h)return n>=o?h:h*("desc"==i[n]?-1:1)}return t.index-e.index}(t,e,i)}))}function Hn(t,e,i){for(var n=-1,s=e.length,r={};++n<s;){var a=e[n],o=_n(t,a);i(o,a)&&Jn(r,gs(a,t),o)}return r}function Vn(t,e,i,n){var s=n?ze:Re,r=-1,a=e.length,o=t;for(t===e&&(e=Ts(e)),i&&(o=Ce(t,Ge(i)));++r<a;)for(var h=0,l=e[r],u=i?i(l):l;(h=s(o,u,h,n))>-1;)o!==t&&$t.call(o,h,1),$t.call(t,h,1);return t}function jn(t,e){for(var i=t?e.length:0,n=i-1;i--;){var s=e[i];if(i==n||s!==r){var r=s;yr(s)?$t.call(t,s,1):ls(t,s)}}return t}function Yn(t,e){return t+Oe(xi()*(e-t+1))}function Gn(t,e){var i="";if(!t||e<1||e>h)return i;do{e%2&&(i+=t),(e=Oe(e/2))&&(t+=t)}while(e);return i}function Xn(t,e){return Cr(Mr(t,e,sh),t+"")}function Zn(t){return Xi(Wo(t))}function $n(t,e){var i=Wo(t);return Br(i,rn(e,0,i.length))}function Jn(e,i,n,s){if(!to(e))return e;for(var r=-1,a=(i=gs(i,e)).length,o=a-1,h=e;null!=h&&++r<a;){var l=Rr(i[r]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(r!=o){var c=h[l];(u=s?s(c,l,h):t)===t&&(u=to(c)?c:yr(i[r+1])?[]:{})}Qi(h,l,u),h=h[l]}return e}var Qn=Ti?function(t,e){return Ti.set(t,e),t}:sh,Kn=he?function(t,e){return he(t,"toString",{configurable:!0,enumerable:!1,value:eh(e),writable:!0})}:sh;function ts(t){return Br(Wo(t))}function es(t,e,i){var n=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var r=bt(s);++n<s;)r[n]=t[n+e];return r}function is(t,e){var i;return un(t,(function(t,n,s){return!(i=e(t,n,s))})),!!i}function ns(t,e,i){var n=0,s=null==t?n:t.length;if("number"==typeof e&&e==e&&s<=2147483647){for(;n<s;){var r=n+s>>>1,a=t[r];null!==a&&!ho(a)&&(i?a<=e:a<e)?n=r+1:s=r}return s}return ss(t,e,sh,i)}function ss(e,i,n,s){var r=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(i=n(i))!=i,h=null===i,l=ho(i),u=i===t;r<a;){var c=Oe((r+a)/2),d=n(e[c]),p=d!==t,f=null===d,m=d==d,y=ho(d);if(o)var g=s||m;else g=u?m&&(s||p):h?m&&p&&(s||!f):l?m&&p&&!f&&(s||!y):!f&&!y&&(s?d<=i:d<i);g?r=c+1:a=c}return yi(a,4294967294)}function rs(t,e){for(var i=-1,n=t.length,s=0,r=[];++i<n;){var a=t[i],o=e?e(a):a;if(!i||!Fa(o,h)){var h=o;r[s++]=0===a?0:a}}return r}function as(t){return"number"==typeof t?t:ho(t)?l:+t}function os(t){if("string"==typeof t)return t;if(Va(t))return Ce(t,os)+"";if(ho(t))return Li?Li.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function hs(t,e,i){var n=-1,s=Te,r=t.length,a=!0,o=[],h=o;if(i)a=!1,s=Ie;else if(r>=200){var l=e?null:Gs(t);if(l)return ri(l);a=!1,s=Ze,h=new ji}else h=e?[]:o;t:for(;++n<r;){var u=t[n],c=e?e(u):u;if(u=i||0!==u?u:0,a&&c==c){for(var d=h.length;d--;)if(h[d]===c)continue t;e&&h.push(c),o.push(u)}else s(h,c,i)||(h!==o&&h.push(c),o.push(u))}return o}function ls(t,e){return null==(t=Er(t,e=gs(e,t)))||delete t[Rr($r(e))]}function us(t,e,i,n){return Jn(t,e,i(_n(t,e)),n)}function cs(t,e,i,n){for(var s=t.length,r=n?s:-1;(n?r--:++r<s)&&e(t[r],r,t););return i?es(t,n?0:r,n?r+1:s):es(t,n?r+1:0,n?s:r)}function ds(t,e){var i=t;return i instanceof Wi&&(i=i.value()),Ne(e,(function(t,e){return e.func.apply(e.thisArg,De([t],e.args))}),i)}function ps(t,e,i){var n=t.length;if(n<2)return n?hs(t[0]):[];for(var s=-1,r=bt(n);++s<n;)for(var a=t[s],o=-1;++o<n;)o!=s&&(r[s]=ln(r[s]||a,t[o],e,i));return hs(mn(r,1),e,i)}function fs(e,i,n){for(var s=-1,r=e.length,a=i.length,o={};++s<r;){var h=s<a?i[s]:t;n(o,e[s],h)}return o}function ms(t){return Ga(t)?t:[]}function ys(t){return"function"==typeof t?t:sh}function gs(t,e){return Va(t)?t:vr(t,e)?[t]:Lr(xo(t))}var vs=Xn;function xs(e,i,n){var s=e.length;return n=n===t?s:n,!i&&n>=s?e:es(e,i,n)}var bs=ue||function(t){return le.clearTimeout(t)};function _s(t,e){if(e)return t.slice();var i=t.length,n=Vt?Vt(i):new t.constructor(i);return t.copy(n),n}function ws(t){var e=new t.constructor(t.byteLength);return new Ht(e).set(new Ht(t)),e}function Ss(t,e){var i=e?ws(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Ms(e,i){if(e!==i){var n=e!==t,s=null===e,r=e==e,a=ho(e),o=i!==t,h=null===i,l=i==i,u=ho(i);if(!h&&!u&&!a&&e>i||a&&o&&l&&!h&&!u||s&&o&&l||!n&&l||!r)return 1;if(!s&&!a&&!u&&e<i||u&&n&&r&&!s&&!a||h&&n&&r||!o&&r||!l)return-1}return 0}function Es(t,e,i,n){for(var s=-1,r=t.length,a=i.length,o=-1,h=e.length,l=mi(r-a,0),u=bt(h+l),c=!n;++o<h;)u[o]=e[o];for(;++s<a;)(c||s<r)&&(u[i[s]]=t[s]);for(;l--;)u[o++]=t[s++];return u}function As(t,e,i,n){for(var s=-1,r=t.length,a=-1,o=i.length,h=-1,l=e.length,u=mi(r-o,0),c=bt(u+l),d=!n;++s<u;)c[s]=t[s];for(var p=s;++h<l;)c[p+h]=e[h];for(;++a<o;)(d||s<r)&&(c[p+i[a]]=t[s++]);return c}function Ts(t,e){var i=-1,n=t.length;for(e||(e=bt(n));++i<n;)e[i]=t[i];return e}function Is(e,i,n,s){var r=!n;n||(n={});for(var a=-1,o=i.length;++a<o;){var h=i[a],l=s?s(n[h],e[h],h,n,e):t;l===t&&(l=e[h]),r?nn(n,h,l):Qi(n,h,l)}return n}function Cs(t,e){return function(i,n){var s=Va(i)?we:tn,r=e?e():{};return s(i,t,ar(n,2),r)}}function Ds(e){return Xn((function(i,n){var s=-1,r=n.length,a=r>1?n[r-1]:t,o=r>2?n[2]:t;for(a=e.length>3&&"function"==typeof a?(r--,a):t,o&&gr(n[0],n[1],o)&&(a=r<3?t:a,r=1),i=Et(i);++s<r;){var h=n[s];h&&e(i,h,s,a)}return i}))}function Ns(t,e){return function(i,n){if(null==i)return i;if(!Ya(i))return t(i,n);for(var s=i.length,r=e?s:-1,a=Et(i);(e?r--:++r<s)&&!1!==n(a[r],r,a););return i}}function Bs(t){return function(e,i,n){for(var s=-1,r=Et(e),a=n(e),o=a.length;o--;){var h=a[t?o:++s];if(!1===i(r[h],h,r))break}return e}}function ks(e){return function(i){var n=ei(i=xo(i))?oi(i):t,s=n?n[0]:i.charAt(0),r=n?xs(n,1).join(""):i.slice(1);return s[e]()+r}}function Os(t){return function(e){return Ne(Qo(Vo(e).replace(Xt,"")),t,"")}}function Ps(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var i=zi(t.prototype),n=t.apply(i,e);return to(n)?n:i}}function Ls(e){return function(i,n,s){var r=Et(i);if(!Ya(i)){var a=ar(n,3);i=Bo(i),n=function(t){return a(r[t],t,r)}}var o=e(i,n,s);return o>-1?r[a?i[o]:o]:t}}function Rs(i){return tr((function(n){var s=n.length,r=s,a=Fi.prototype.thru;for(i&&n.reverse();r--;){var o=n[r];if("function"!=typeof o)throw new It(e);if(a&&!h&&"wrapper"==sr(o))var h=new Fi([],!0)}for(r=h?r:s;++r<s;){var l=sr(o=n[r]),u="wrapper"==l?nr(o):t;h=u&&xr(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?h[sr(u[0])].apply(h,u[3]):1==o.length&&xr(o)?h[l]():h.thru(o)}return function(){var t=arguments,e=t[0];if(h&&1==t.length&&Va(e))return h.plant(e).value();for(var i=0,r=s?n[i].apply(this,t):e;++i<s;)r=n[i].call(this,r);return r}}))}function zs(e,i,n,s,a,o,h,l,u,c){var d=i&r,p=1&i,f=2&i,m=24&i,y=512&i,g=f?t:Ps(e);return function r(){for(var v=arguments.length,x=bt(v),b=v;b--;)x[b]=arguments[b];if(m)var _=rr(r),w=function(t,e){for(var i=t.length,n=0;i--;)t[i]===e&&++n;return n}(x,_);if(s&&(x=Es(x,s,a,m)),o&&(x=As(x,o,h,m)),v-=w,m&&v<c){var S=si(x,_);return js(e,i,zs,r.placeholder,n,x,S,l,u,c-v)}var M=p?n:this,E=f?M[e]:e;return v=x.length,l?x=function(e,i){for(var n=e.length,s=yi(i.length,n),r=Ts(e);s--;){var a=i[s];e[s]=yr(a,n)?r[a]:t}return e}(x,l):y&&v>1&&x.reverse(),d&&u<v&&(x.length=u),this&&this!==le&&this instanceof r&&(E=g||Ps(E)),E.apply(M,x)}}function Us(t,e){return function(i,n){return function(t,e,i,n){return vn(t,(function(t,s,r){e(n,i(t),s,r)})),n}(i,t,e(n),{})}}function Fs(e,i){return function(n,s){var r;if(n===t&&s===t)return i;if(n!==t&&(r=n),s!==t){if(r===t)return s;"string"==typeof n||"string"==typeof s?(n=os(n),s=os(s)):(n=as(n),s=as(s)),r=e(n,s)}return r}}function Ws(t){return tr((function(e){return e=Ce(e,Ge(ar())),Xn((function(i){var n=this;return t(e,(function(t){return _e(t,n,i)}))}))}))}function qs(e,i){var n=(i=i===t?" ":os(i)).length;if(n<2)return n?Gn(i,e):i;var s=Gn(i,fe(e/ai(i)));return ei(i)?xs(oi(s),0,e).join(""):s.slice(0,e)}function Hs(e){return function(i,n,s){return s&&"number"!=typeof s&&gr(i,n,s)&&(n=s=t),i=fo(i),n===t?(n=i,i=0):n=fo(n),function(t,e,i,n){for(var s=-1,r=mi(fe((e-t)/(i||1)),0),a=bt(r);r--;)a[n?r:++s]=t,t+=i;return a}(i,n,s=s===t?i<n?1:-1:fo(s),e)}}function Vs(t){return function(e,i){return"string"==typeof e&&"string"==typeof i||(e=go(e),i=go(i)),t(e,i)}}function js(e,i,n,r,a,o,h,l,u,c){var d=8&i;i|=d?s:64,4&(i&=~(d?64:s))||(i&=-4);var p=[e,i,a,d?o:t,d?h:t,d?t:o,d?t:h,l,u,c],f=n.apply(t,p);return xr(e)&&Tr(f,p),f.placeholder=r,Dr(f,e,i)}function Ys(t){var e=Mt[t];return function(t,i){if(t=go(t),(i=null==i?0:yi(mo(i),292))&&ci(t)){var n=(xo(t)+"e").split("e");return+((n=(xo(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}var Gs=Mi&&1/ri(new Mi([,-0]))[1]==o?function(t){return new Mi(t)}:lh;function Xs(t){return function(e){var i=dr(e);return i==x?ii(e):i==M?function(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=[t,t]})),i}(e):function(t,e){return Ce(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Zs(i,o,h,l,u,c,d,p){var f=2&o;if(!f&&"function"!=typeof i)throw new It(e);var m=l?l.length:0;if(m||(o&=-97,l=u=t),d=d===t?d:mi(mo(d),0),p=p===t?p:mo(p),m-=u?u.length:0,64&o){var y=l,g=u;l=u=t}var v=f?t:nr(i),x=[i,o,h,l,u,y,g,c,d,p];if(v&&function(t,e){var i=t[1],s=e[1],o=i|s,h=o<131,l=s==r&&8==i||s==r&&i==a&&t[7].length<=e[8]||384==s&&e[7].length<=e[8]&&8==i;if(!h&&!l)return t;1&s&&(t[2]=e[2],o|=1&i?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?Es(c,u,e[4]):u,t[4]=c?si(t[3],n):e[4]}(u=e[5])&&(c=t[5],t[5]=c?As(c,u,e[6]):u,t[6]=c?si(t[5],n):e[6]),(u=e[7])&&(t[7]=u),s&r&&(t[8]=null==t[8]?e[8]:yi(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(x,v),i=x[0],o=x[1],h=x[2],l=x[3],u=x[4],!(p=x[9]=x[9]===t?f?0:i.length:mi(x[9]-m,0))&&24&o&&(o&=-25),o&&1!=o)b=8==o||16==o?function(e,i,n){var s=Ps(e);return function r(){for(var a=arguments.length,o=bt(a),h=a,l=rr(r);h--;)o[h]=arguments[h];var u=a<3&&o[0]!==l&&o[a-1]!==l?[]:si(o,l);return(a-=u.length)<n?js(e,i,zs,r.placeholder,t,o,u,t,t,n-a):_e(this&&this!==le&&this instanceof r?s:e,this,o)}}(i,o,p):o!=s&&33!=o||u.length?zs.apply(t,x):function(t,e,i,n){var s=1&e,r=Ps(t);return function e(){for(var a=-1,o=arguments.length,h=-1,l=n.length,u=bt(l+o),c=this&&this!==le&&this instanceof e?r:t;++h<l;)u[h]=n[h];for(;o--;)u[h++]=arguments[++a];return _e(c,s?i:this,u)}}(i,o,h,l);else var b=function(t,e,i){var n=1&e,s=Ps(t);return function e(){return(this&&this!==le&&this instanceof e?s:t).apply(n?i:this,arguments)}}(i,o,h);return Dr((v?Qn:Tr)(b,x),i,o)}function $s(e,i,n,s){return e===t||Fa(e,Nt[n])&&!Ot.call(s,n)?i:e}function Js(e,i,n,s,r,a){return to(e)&&to(i)&&(a.set(i,e),Fn(e,i,t,Js,a),a.delete(i)),e}function Qs(e){return so(e)?t:e}function Ks(e,i,n,s,r,a){var o=1&n,h=e.length,l=i.length;if(h!=l&&!(o&&l>h))return!1;var u=a.get(e),c=a.get(i);if(u&&c)return u==i&&c==e;var d=-1,p=!0,f=2&n?new ji:t;for(a.set(e,i),a.set(i,e);++d<h;){var m=e[d],y=i[d];if(s)var g=o?s(y,m,d,i,e,a):s(m,y,d,e,i,a);if(g!==t){if(g)continue;p=!1;break}if(f){if(!ke(i,(function(t,e){if(!Ze(f,e)&&(m===t||r(m,t,n,s,a)))return f.push(e)}))){p=!1;break}}else if(m!==y&&!r(m,y,n,s,a)){p=!1;break}}return a.delete(e),a.delete(i),p}function tr(e){return Cr(Mr(e,t,jr),e+"")}function er(t){return wn(t,Bo,ur)}function ir(t){return wn(t,ko,cr)}var nr=Ti?function(t){return Ti.get(t)}:lh;function sr(t){for(var e=t.name+"",i=Ii[e],n=Ot.call(Ii,e)?i.length:0;n--;){var s=i[n],r=s.func;if(null==r||r==t)return s.name}return e}function rr(t){return(Ot.call(Ri,"placeholder")?Ri:t).placeholder}function ar(){var t=Ri.iteratee||rh;return t=t===rh?kn:t,arguments.length?t(arguments[0],arguments[1]):t}function or(t,e){var i,n,s=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof e?"string":"hash"]:s.map}function hr(t){for(var e=Bo(t),i=e.length;i--;){var n=e[i],s=t[n];e[i]=[n,s,wr(s)]}return e}function lr(e,i){var n=function(e,i){return null==e?t:e[i]}(e,i);return Bn(n)?n:t}var ur=qe?function(t){return null==t?[]:(t=Et(t),Ae(qe(t),(function(e){return Gt.call(t,e)})))}:yh,cr=qe?function(t){for(var e=[];t;)De(e,ur(t)),t=jt(t);return e}:yh,dr=Sn;function pr(t,e,i){for(var n=-1,s=(e=gs(e,t)).length,r=!1;++n<s;){var a=Rr(e[n]);if(!(r=null!=t&&i(t,a)))break;t=t[a]}return r||++n!=s?r:!!(s=null==t?0:t.length)&&Ka(s)&&yr(a,s)&&(Va(t)||Ha(t))}function fr(t){return"function"!=typeof t.constructor||_r(t)?{}:zi(jt(t))}function mr(t){return Va(t)||Ha(t)||!!(Qt&&t&&t[Qt])}function yr(t,e){var i=typeof t;return!!(e=null==e?h:e)&&("number"==i||"symbol"!=i&&ft.test(t))&&t>-1&&t%1==0&&t<e}function gr(t,e,i){if(!to(i))return!1;var n=typeof e;return!!("number"==n?Ya(i)&&yr(e,i.length):"string"==n&&e in i)&&Fa(i[e],t)}function vr(t,e){if(Va(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!ho(t))||$.test(t)||!Z.test(t)||null!=e&&t in Et(e)}function xr(t){var e=sr(t),i=Ri[e];if("function"!=typeof i||!(e in Wi.prototype))return!1;if(t===i)return!0;var n=nr(i);return!!n&&t===n[0]}(_i&&dr(new _i(new ArrayBuffer(1)))!=C||wi&&dr(new wi)!=x||Si&&dr(Si.resolve())!=w||Mi&&dr(new Mi)!=M||Ei&&dr(new Ei)!=T)&&(dr=function(e){var i=Sn(e),n=i==_?e.constructor:t,s=n?zr(n):"";if(s)switch(s){case Ci:return C;case Di:return x;case Ni:return w;case Bi:return M;case ki:return T}return i});var br=Bt?Ja:gh;function _r(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Nt)}function wr(t){return t==t&&!to(t)}function Sr(e,i){return function(n){return null!=n&&n[e]===i&&(i!==t||e in Et(n))}}function Mr(e,i,n){return i=mi(i===t?e.length-1:i,0),function(){for(var t=arguments,s=-1,r=mi(t.length-i,0),a=bt(r);++s<r;)a[s]=t[i+s];s=-1;for(var o=bt(i+1);++s<i;)o[s]=t[s];return o[i]=n(a),_e(e,this,o)}}function Er(t,e){return e.length<2?t:_n(t,es(e,0,-1))}function Ar(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Tr=Nr(Qn),Ir=pe||function(t,e){return le.setTimeout(t,e)},Cr=Nr(Kn);function Dr(t,e,i){var n=e+"";return Cr(t,function(t,e){var i=e.length;if(!i)return t;var n=i-1;return e[n]=(i>1?"& ":"")+e[n],e=e.join(i>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Se(c,(function(i){var n="_."+i[0];e&i[1]&&!Te(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(nt);return e?e[1].split(st):[]}(n),i)))}function Nr(e){var i=0,n=0;return function(){var s=gi(),r=16-(s-n);if(n=s,r>0){if(++i>=800)return arguments[0]}else i=0;return e.apply(t,arguments)}}function Br(e,i){var n=-1,s=e.length,r=s-1;for(i=i===t?s:i;++n<i;){var a=Yn(n,r),o=e[a];e[a]=e[n],e[n]=o}return e.length=i,e}var kr,Or,Pr,Lr=(kr=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(J,(function(t,i,n,s){e.push(n?s.replace(ot,"$1"):i||t)})),e},Or=Oa(kr,(function(t){return 500===Pr.size&&Pr.clear(),t})),Pr=Or.cache,Or);function Rr(t){if("string"==typeof t||ho(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function zr(t){if(null!=t){try{return kt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ur(t){if(t instanceof Wi)return t.clone();var e=new Fi(t.__wrapped__,t.__chain__);return e.__actions__=Ts(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Fr=Xn((function(t,e){return Ga(t)?ln(t,mn(e,1,Ga,!0)):[]})),Wr=Xn((function(e,i){var n=$r(i);return Ga(n)&&(n=t),Ga(e)?ln(e,mn(i,1,Ga,!0),ar(n,2)):[]})),qr=Xn((function(e,i){var n=$r(i);return Ga(n)&&(n=t),Ga(e)?ln(e,mn(i,1,Ga,!0),t,n):[]}));function Hr(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=null==i?0:mo(i);return s<0&&(s=mi(n+s,0)),Le(t,ar(e,3),s)}function Vr(e,i,n){var s=null==e?0:e.length;if(!s)return-1;var r=s-1;return n!==t&&(r=mo(n),r=n<0?mi(s+r,0):yi(r,s-1)),Le(e,ar(i,3),r,!0)}function jr(t){return null!=t&&t.length?mn(t,1):[]}function Yr(e){return e&&e.length?e[0]:t}var Gr=Xn((function(t){var e=Ce(t,ms);return e.length&&e[0]===t[0]?Tn(e):[]})),Xr=Xn((function(e){var i=$r(e),n=Ce(e,ms);return i===$r(n)?i=t:n.pop(),n.length&&n[0]===e[0]?Tn(n,ar(i,2)):[]})),Zr=Xn((function(e){var i=$r(e),n=Ce(e,ms);return(i="function"==typeof i?i:t)&&n.pop(),n.length&&n[0]===e[0]?Tn(n,t,i):[]}));function $r(e){var i=null==e?0:e.length;return i?e[i-1]:t}var Jr=Xn(Qr);function Qr(t,e){return t&&t.length&&e&&e.length?Vn(t,e):t}var Kr=tr((function(t,e){var i=null==t?0:t.length,n=sn(t,e);return jn(t,Ce(e,(function(t){return yr(t,i)?+t:t})).sort(Ms)),n}));function ta(t){return null==t?t:bi.call(t)}var ea=Xn((function(t){return hs(mn(t,1,Ga,!0))})),ia=Xn((function(e){var i=$r(e);return Ga(i)&&(i=t),hs(mn(e,1,Ga,!0),ar(i,2))})),na=Xn((function(e){var i=$r(e);return i="function"==typeof i?i:t,hs(mn(e,1,Ga,!0),t,i)}));function sa(t){if(!t||!t.length)return[];var e=0;return t=Ae(t,(function(t){if(Ga(t))return e=mi(t.length,e),!0})),je(e,(function(e){return Ce(t,We(e))}))}function ra(e,i){if(!e||!e.length)return[];var n=sa(e);return null==i?n:Ce(n,(function(e){return _e(i,t,e)}))}var aa=Xn((function(t,e){return Ga(t)?ln(t,e):[]})),oa=Xn((function(t){return ps(Ae(t,Ga))})),ha=Xn((function(e){var i=$r(e);return Ga(i)&&(i=t),ps(Ae(e,Ga),ar(i,2))})),la=Xn((function(e){var i=$r(e);return i="function"==typeof i?i:t,ps(Ae(e,Ga),t,i)})),ua=Xn(sa),ca=Xn((function(e){var i=e.length,n=i>1?e[i-1]:t;return n="function"==typeof n?(e.pop(),n):t,ra(e,n)}));function da(t){var e=Ri(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var fa=tr((function(e){var i=e.length,n=i?e[0]:0,s=this.__wrapped__,r=function(t){return sn(t,e)};return!(i>1||this.__actions__.length)&&s instanceof Wi&&yr(n)?((s=s.slice(n,+n+(i?1:0))).__actions__.push({func:pa,args:[r],thisArg:t}),new Fi(s,this.__chain__).thru((function(e){return i&&!e.length&&e.push(t),e}))):this.thru(r)})),ma=Cs((function(t,e,i){Ot.call(t,i)?++t[i]:nn(t,i,1)})),ya=Ls(Hr),ga=Ls(Vr);function va(t,e){return(Va(t)?Se:un)(t,ar(e,3))}function xa(t,e){return(Va(t)?Me:cn)(t,ar(e,3))}var ba=Cs((function(t,e,i){Ot.call(t,i)?t[i].push(e):nn(t,i,[e])})),_a=Xn((function(t,e,i){var n=-1,s="function"==typeof e,r=Ya(t)?bt(t.length):[];return un(t,(function(t){r[++n]=s?_e(e,t,i):In(t,e,i)})),r})),wa=Cs((function(t,e,i){nn(t,i,e)}));function Sa(t,e){return(Va(t)?Ce:Rn)(t,ar(e,3))}var Ma=Cs((function(t,e,i){t[i?0:1].push(e)}),(function(){return[[],[]]})),Ea=Xn((function(t,e){if(null==t)return[];var i=e.length;return i>1&&gr(t,e[0],e[1])?e=[]:i>2&&gr(e[0],e[1],e[2])&&(e=[e[0]]),qn(t,mn(e,1),[])})),Aa=ce||function(){return le.Date.now()};function Ta(e,i,n){return i=n?t:i,i=e&&null==i?e.length:i,Zs(e,r,t,t,t,t,i)}function Ia(i,n){var s;if("function"!=typeof n)throw new It(e);return i=mo(i),function(){return--i>0&&(s=n.apply(this,arguments)),i<=1&&(n=t),s}}var Ca=Xn((function(t,e,i){var n=1;if(i.length){var r=si(i,rr(Ca));n|=s}return Zs(t,n,e,i,r)})),Da=Xn((function(t,e,i){var n=3;if(i.length){var r=si(i,rr(Da));n|=s}return Zs(e,n,t,i,r)}));function Na(i,n,s){var r,a,o,h,l,u,c=0,d=!1,p=!1,f=!0;if("function"!=typeof i)throw new It(e);function m(e){var n=r,s=a;return r=a=t,c=e,h=i.apply(s,n)}function y(e){var i=e-u;return u===t||i>=n||i<0||p&&e-c>=o}function g(){var t=Aa();if(y(t))return v(t);l=Ir(g,function(t){var e=n-(t-u);return p?yi(e,o-(t-c)):e}(t))}function v(e){return l=t,f&&r?m(e):(r=a=t,h)}function x(){var e=Aa(),i=y(e);if(r=arguments,a=this,u=e,i){if(l===t)return function(t){return c=t,l=Ir(g,n),d?m(t):h}(u);if(p)return bs(l),l=Ir(g,n),m(u)}return l===t&&(l=Ir(g,n)),h}return n=go(n)||0,to(s)&&(d=!!s.leading,o=(p="maxWait"in s)?mi(go(s.maxWait)||0,n):o,f="trailing"in s?!!s.trailing:f),x.cancel=function(){l!==t&&bs(l),c=0,r=u=a=l=t},x.flush=function(){return l===t?h:v(Aa())},x}var Ba=Xn((function(t,e){return hn(t,1,e)})),ka=Xn((function(t,e,i){return hn(t,go(e)||0,i)}));function Oa(t,i){if("function"!=typeof t||null!=i&&"function"!=typeof i)throw new It(e);var n=function(){var e=arguments,s=i?i.apply(this,e):e[0],r=n.cache;if(r.has(s))return r.get(s);var a=t.apply(this,e);return n.cache=r.set(s,a)||r,a};return n.cache=new(Oa.Cache||Vi),n}function Pa(t){if("function"!=typeof t)throw new It(e);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)}}Oa.Cache=Vi;var La=vs((function(t,e){var i=(e=1==e.length&&Va(e[0])?Ce(e[0],Ge(ar())):Ce(mn(e,1),Ge(ar()))).length;return Xn((function(n){for(var s=-1,r=yi(n.length,i);++s<r;)n[s]=e[s].call(this,n[s]);return _e(t,this,n)}))})),Ra=Xn((function(e,i){var n=si(i,rr(Ra));return Zs(e,s,t,i,n)})),za=Xn((function(e,i){var n=si(i,rr(za));return Zs(e,64,t,i,n)})),Ua=tr((function(e,i){return Zs(e,a,t,t,t,i)}));function Fa(t,e){return t===e||t!=t&&e!=e}var Wa=Vs(Mn),qa=Vs((function(t,e){return t>=e})),Ha=Cn(function(){return arguments}())?Cn:function(t){return eo(t)&&Ot.call(t,"callee")&&!Gt.call(t,"callee")},Va=bt.isArray,ja=me?Ge(me):function(t){return eo(t)&&Sn(t)==I};function Ya(t){return null!=t&&Ka(t.length)&&!Ja(t)}function Ga(t){return eo(t)&&Ya(t)}var Xa=li||gh,Za=ye?Ge(ye):function(t){return eo(t)&&Sn(t)==m};function $a(t){if(!eo(t))return!1;var e=Sn(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!so(t)}function Ja(t){if(!to(t))return!1;var e=Sn(t);return e==g||e==v||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qa(t){return"number"==typeof t&&t==mo(t)}function Ka(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function to(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function eo(t){return null!=t&&"object"==typeof t}var io=ge?Ge(ge):function(t){return eo(t)&&dr(t)==x};function no(t){return"number"==typeof t||eo(t)&&Sn(t)==b}function so(t){if(!eo(t)||Sn(t)!=_)return!1;var e=jt(t);if(null===e)return!0;var i=Ot.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&kt.call(i)==zt}var ro=ve?Ge(ve):function(t){return eo(t)&&Sn(t)==S},ao=xe?Ge(xe):function(t){return eo(t)&&dr(t)==M};function oo(t){return"string"==typeof t||!Va(t)&&eo(t)&&Sn(t)==E}function ho(t){return"symbol"==typeof t||eo(t)&&Sn(t)==A}var lo=be?Ge(be):function(t){return eo(t)&&Ka(t.length)&&!!ie[Sn(t)]},uo=Vs(Ln),co=Vs((function(t,e){return t<=e}));function po(t){if(!t)return[];if(Ya(t))return oo(t)?oi(t):Ts(t);if(se&&t[se])return function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}(t[se]());var e=dr(t);return(e==x?ii:e==M?ri:Wo)(t)}function fo(t){return t?(t=go(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function mo(t){var e=fo(t),i=e%1;return e==e?i?e-i:e:0}function yo(t){return t?rn(mo(t),0,u):0}function go(t){if("number"==typeof t)return t;if(ho(t))return l;if(to(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=to(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var i=ct.test(t);return i||pt.test(t)?ae(t.slice(2),i?2:8):ut.test(t)?l:+t}function vo(t){return Is(t,ko(t))}function xo(t){return null==t?"":os(t)}var bo=Ds((function(t,e){if(_r(e)||Ya(e))Is(e,Bo(e),t);else for(var i in e)Ot.call(e,i)&&Qi(t,i,e[i])})),_o=Ds((function(t,e){Is(e,ko(e),t)})),wo=Ds((function(t,e,i,n){Is(e,ko(e),t,n)})),So=Ds((function(t,e,i,n){Is(e,Bo(e),t,n)})),Mo=tr(sn),Eo=Xn((function(e,i){e=Et(e);var n=-1,s=i.length,r=s>2?i[2]:t;for(r&&gr(i[0],i[1],r)&&(s=1);++n<s;)for(var a=i[n],o=ko(a),h=-1,l=o.length;++h<l;){var u=o[h],c=e[u];(c===t||Fa(c,Nt[u])&&!Ot.call(e,u))&&(e[u]=a[u])}return e})),Ao=Xn((function(e){return e.push(t,Js),_e(Po,t,e)}));function To(e,i,n){var s=null==e?t:_n(e,i);return s===t?n:s}function Io(t,e){return null!=t&&pr(t,e,An)}var Co=Us((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),t[e]=i}),eh(sh)),Do=Us((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),Ot.call(t,e)?t[e].push(i):t[e]=[i]}),ar),No=Xn(In);function Bo(t){return Ya(t)?Gi(t):On(t)}function ko(t){return Ya(t)?Gi(t,!0):Pn(t)}var Oo=Ds((function(t,e,i){Fn(t,e,i)})),Po=Ds((function(t,e,i,n){Fn(t,e,i,n)})),Lo=tr((function(t,e){var i={};if(null==t)return i;var n=!1;e=Ce(e,(function(e){return e=gs(e,t),n||(n=e.length>1),e})),Is(t,ir(t),i),n&&(i=an(i,7,Qs));for(var s=e.length;s--;)ls(i,e[s]);return i})),Ro=tr((function(t,e){return null==t?{}:function(t,e){return Hn(t,e,(function(e,i){return Io(t,i)}))}(t,e)}));function zo(t,e){if(null==t)return{};var i=Ce(ir(t),(function(t){return[t]}));return e=ar(e),Hn(t,i,(function(t,i){return e(t,i[0])}))}var Uo=Xs(Bo),Fo=Xs(ko);function Wo(t){return null==t?[]:Xe(t,Bo(t))}var qo=Os((function(t,e,i){return e=e.toLowerCase(),t+(i?Ho(e):e)}));function Ho(t){return Jo(xo(t).toLowerCase())}function Vo(t){return(t=xo(t))&&t.replace(mt,Qe).replace(Zt,"")}var jo=Os((function(t,e,i){return t+(i?"-":"")+e.toLowerCase()})),Yo=Os((function(t,e,i){return t+(i?" ":"")+e.toLowerCase()})),Go=ks("toLowerCase"),Xo=Os((function(t,e,i){return t+(i?"_":"")+e.toLowerCase()})),Zo=Os((function(t,e,i){return t+(i?" ":"")+Jo(e)})),$o=Os((function(t,e,i){return t+(i?" ":"")+e.toUpperCase()})),Jo=ks("toUpperCase");function Qo(e,i,n){return e=xo(e),(i=n?t:i)===t?function(t){return Kt.test(t)}(e)?function(t){return t.match(Jt)||[]}(e):function(t){return t.match(rt)||[]}(e):e.match(i)||[]}var Ko=Xn((function(e,i){try{return _e(e,t,i)}catch(t){return $a(t)?t:new wt(t)}})),th=tr((function(t,e){return Se(e,(function(e){e=Rr(e),nn(t,e,Ca(t[e],t))})),t}));function eh(t){return function(){return t}}var ih=Rs(),nh=Rs(!0);function sh(t){return t}function rh(t){return kn("function"==typeof t?t:an(t,1))}var ah=Xn((function(t,e){return function(i){return In(i,t,e)}})),oh=Xn((function(t,e){return function(i){return In(t,i,e)}}));function hh(t,e,i){var n=Bo(e),s=bn(e,n);null!=i||to(e)&&(s.length||!n.length)||(i=e,e=t,t=this,s=bn(e,Bo(e)));var r=!(to(i)&&"chain"in i&&!i.chain),a=Ja(t);return Se(s,(function(i){var n=e[i];t[i]=n,a&&(t.prototype[i]=function(){var e=this.__chain__;if(r||e){var i=t(this.__wrapped__);return(i.__actions__=Ts(this.__actions__)).push({func:n,args:arguments,thisArg:t}),i.__chain__=e,i}return n.apply(t,De([this.value()],arguments))})})),t}function lh(){}var uh=Ws(Ce),ch=Ws(Ee),dh=Ws(ke);function ph(t){return vr(t)?We(Rr(t)):function(t){return function(e){return _n(e,t)}}(t)}var fh=Hs(),mh=Hs(!0);function yh(){return[]}function gh(){return!1}var vh,xh=Fs((function(t,e){return t+e}),0),bh=Ys("ceil"),_h=Fs((function(t,e){return t/e}),1),wh=Ys("floor"),Sh=Fs((function(t,e){return t*e}),1),Mh=Ys("round"),Eh=Fs((function(t,e){return t-e}),0);return Ri.after=function(t,i){if("function"!=typeof i)throw new It(e);return t=mo(t),function(){if(--t<1)return i.apply(this,arguments)}},Ri.ary=Ta,Ri.assign=bo,Ri.assignIn=_o,Ri.assignInWith=wo,Ri.assignWith=So,Ri.at=Mo,Ri.before=Ia,Ri.bind=Ca,Ri.bindAll=th,Ri.bindKey=Da,Ri.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Va(t)?t:[t]},Ri.chain=da,Ri.chunk=function(e,i,n){i=(n?gr(e,i,n):i===t)?1:mi(mo(i),0);var s=null==e?0:e.length;if(!s||i<1)return[];for(var r=0,a=0,o=bt(fe(s/i));r<s;)o[a++]=es(e,r,r+=i);return o},Ri.compact=function(t){for(var e=-1,i=null==t?0:t.length,n=0,s=[];++e<i;){var r=t[e];r&&(s[n++]=r)}return s},Ri.concat=function(){var t=arguments.length;if(!t)return[];for(var e=bt(t-1),i=arguments[0],n=t;n--;)e[n-1]=arguments[n];return De(Va(i)?Ts(i):[i],mn(e,1))},Ri.cond=function(t){var i=null==t?0:t.length,n=ar();return t=i?Ce(t,(function(t){if("function"!=typeof t[1])throw new It(e);return[n(t[0]),t[1]]})):[],Xn((function(e){for(var n=-1;++n<i;){var s=t[n];if(_e(s[0],this,e))return _e(s[1],this,e)}}))},Ri.conforms=function(t){return function(t){var e=Bo(t);return function(i){return on(i,t,e)}}(an(t,1))},Ri.constant=eh,Ri.countBy=ma,Ri.create=function(t,e){var i=zi(t);return null==e?i:en(i,e)},Ri.curry=function e(i,n,s){var r=Zs(i,8,t,t,t,t,t,n=s?t:n);return r.placeholder=e.placeholder,r},Ri.curryRight=function e(i,n,s){var r=Zs(i,16,t,t,t,t,t,n=s?t:n);return r.placeholder=e.placeholder,r},Ri.debounce=Na,Ri.defaults=Eo,Ri.defaultsDeep=Ao,Ri.defer=Ba,Ri.delay=ka,Ri.difference=Fr,Ri.differenceBy=Wr,Ri.differenceWith=qr,Ri.drop=function(e,i,n){var s=null==e?0:e.length;return s?es(e,(i=n||i===t?1:mo(i))<0?0:i,s):[]},Ri.dropRight=function(e,i,n){var s=null==e?0:e.length;return s?es(e,0,(i=s-(i=n||i===t?1:mo(i)))<0?0:i):[]},Ri.dropRightWhile=function(t,e){return t&&t.length?cs(t,ar(e,3),!0,!0):[]},Ri.dropWhile=function(t,e){return t&&t.length?cs(t,ar(e,3),!0):[]},Ri.fill=function(e,i,n,s){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&gr(e,i,n)&&(n=0,s=r),function(e,i,n,s){var r=e.length;for((n=mo(n))<0&&(n=-n>r?0:r+n),(s=s===t||s>r?r:mo(s))<0&&(s+=r),s=n>s?0:yo(s);n<s;)e[n++]=i;return e}(e,i,n,s)):[]},Ri.filter=function(t,e){return(Va(t)?Ae:fn)(t,ar(e,3))},Ri.flatMap=function(t,e){return mn(Sa(t,e),1)},Ri.flatMapDeep=function(t,e){return mn(Sa(t,e),o)},Ri.flatMapDepth=function(e,i,n){return n=n===t?1:mo(n),mn(Sa(e,i),n)},Ri.flatten=jr,Ri.flattenDeep=function(t){return null!=t&&t.length?mn(t,o):[]},Ri.flattenDepth=function(e,i){return null!=e&&e.length?mn(e,i=i===t?1:mo(i)):[]},Ri.flip=function(t){return Zs(t,512)},Ri.flow=ih,Ri.flowRight=nh,Ri.fromPairs=function(t){for(var e=-1,i=null==t?0:t.length,n={};++e<i;){var s=t[e];n[s[0]]=s[1]}return n},Ri.functions=function(t){return null==t?[]:bn(t,Bo(t))},Ri.functionsIn=function(t){return null==t?[]:bn(t,ko(t))},Ri.groupBy=ba,Ri.initial=function(t){return null!=t&&t.length?es(t,0,-1):[]},Ri.intersection=Gr,Ri.intersectionBy=Xr,Ri.intersectionWith=Zr,Ri.invert=Co,Ri.invertBy=Do,Ri.invokeMap=_a,Ri.iteratee=rh,Ri.keyBy=wa,Ri.keys=Bo,Ri.keysIn=ko,Ri.map=Sa,Ri.mapKeys=function(t,e){var i={};return e=ar(e,3),vn(t,(function(t,n,s){nn(i,e(t,n,s),t)})),i},Ri.mapValues=function(t,e){var i={};return e=ar(e,3),vn(t,(function(t,n,s){nn(i,n,e(t,n,s))})),i},Ri.matches=function(t){return zn(an(t,1))},Ri.matchesProperty=function(t,e){return Un(t,an(e,1))},Ri.memoize=Oa,Ri.merge=Oo,Ri.mergeWith=Po,Ri.method=ah,Ri.methodOf=oh,Ri.mixin=hh,Ri.negate=Pa,Ri.nthArg=function(t){return t=mo(t),Xn((function(e){return Wn(e,t)}))},Ri.omit=Lo,Ri.omitBy=function(t,e){return zo(t,Pa(ar(e)))},Ri.once=function(t){return Ia(2,t)},Ri.orderBy=function(e,i,n,s){return null==e?[]:(Va(i)||(i=null==i?[]:[i]),Va(n=s?t:n)||(n=null==n?[]:[n]),qn(e,i,n))},Ri.over=uh,Ri.overArgs=La,Ri.overEvery=ch,Ri.overSome=dh,Ri.partial=Ra,Ri.partialRight=za,Ri.partition=Ma,Ri.pick=Ro,Ri.pickBy=zo,Ri.property=ph,Ri.propertyOf=function(e){return function(i){return null==e?t:_n(e,i)}},Ri.pull=Jr,Ri.pullAll=Qr,Ri.pullAllBy=function(t,e,i){return t&&t.length&&e&&e.length?Vn(t,e,ar(i,2)):t},Ri.pullAllWith=function(e,i,n){return e&&e.length&&i&&i.length?Vn(e,i,t,n):e},Ri.pullAt=Kr,Ri.range=fh,Ri.rangeRight=mh,Ri.rearg=Ua,Ri.reject=function(t,e){return(Va(t)?Ae:fn)(t,Pa(ar(e,3)))},Ri.remove=function(t,e){var i=[];if(!t||!t.length)return i;var n=-1,s=[],r=t.length;for(e=ar(e,3);++n<r;){var a=t[n];e(a,n,t)&&(i.push(a),s.push(n))}return jn(t,s),i},Ri.rest=function(i,n){if("function"!=typeof i)throw new It(e);return Xn(i,n=n===t?n:mo(n))},Ri.reverse=ta,Ri.sampleSize=function(e,i,n){return i=(n?gr(e,i,n):i===t)?1:mo(i),(Va(e)?Zi:$n)(e,i)},Ri.set=function(t,e,i){return null==t?t:Jn(t,e,i)},Ri.setWith=function(e,i,n,s){return s="function"==typeof s?s:t,null==e?e:Jn(e,i,n,s)},Ri.shuffle=function(t){return(Va(t)?$i:ts)(t)},Ri.slice=function(e,i,n){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&gr(e,i,n)?(i=0,n=s):(i=null==i?0:mo(i),n=n===t?s:mo(n)),es(e,i,n)):[]},Ri.sortBy=Ea,Ri.sortedUniq=function(t){return t&&t.length?rs(t):[]},Ri.sortedUniqBy=function(t,e){return t&&t.length?rs(t,ar(e,2)):[]},Ri.split=function(e,i,n){return n&&"number"!=typeof n&&gr(e,i,n)&&(i=n=t),(n=n===t?u:n>>>0)?(e=xo(e))&&("string"==typeof i||null!=i&&!ro(i))&&!(i=os(i))&&ei(e)?xs(oi(e),0,n):e.split(i,n):[]},Ri.spread=function(t,i){if("function"!=typeof t)throw new It(e);return i=null==i?0:mi(mo(i),0),Xn((function(e){var n=e[i],s=xs(e,0,i);return n&&De(s,n),_e(t,this,s)}))},Ri.tail=function(t){var e=null==t?0:t.length;return e?es(t,1,e):[]},Ri.take=function(e,i,n){return e&&e.length?es(e,0,(i=n||i===t?1:mo(i))<0?0:i):[]},Ri.takeRight=function(e,i,n){var s=null==e?0:e.length;return s?es(e,(i=s-(i=n||i===t?1:mo(i)))<0?0:i,s):[]},Ri.takeRightWhile=function(t,e){return t&&t.length?cs(t,ar(e,3),!1,!0):[]},Ri.takeWhile=function(t,e){return t&&t.length?cs(t,ar(e,3)):[]},Ri.tap=function(t,e){return e(t),t},Ri.throttle=function(t,i,n){var s=!0,r=!0;if("function"!=typeof t)throw new It(e);return to(n)&&(s="leading"in n?!!n.leading:s,r="trailing"in n?!!n.trailing:r),Na(t,i,{leading:s,maxWait:i,trailing:r})},Ri.thru=pa,Ri.toArray=po,Ri.toPairs=Uo,Ri.toPairsIn=Fo,Ri.toPath=function(t){return Va(t)?Ce(t,Rr):ho(t)?[t]:Ts(Lr(xo(t)))},Ri.toPlainObject=vo,Ri.transform=function(t,e,i){var n=Va(t),s=n||Xa(t)||lo(t);if(e=ar(e,4),null==i){var r=t&&t.constructor;i=s?n?new r:[]:to(t)&&Ja(r)?zi(jt(t)):{}}return(s?Se:vn)(t,(function(t,n,s){return e(i,t,n,s)})),i},Ri.unary=function(t){return Ta(t,1)},Ri.union=ea,Ri.unionBy=ia,Ri.unionWith=na,Ri.uniq=function(t){return t&&t.length?hs(t):[]},Ri.uniqBy=function(t,e){return t&&t.length?hs(t,ar(e,2)):[]},Ri.uniqWith=function(e,i){return i="function"==typeof i?i:t,e&&e.length?hs(e,t,i):[]},Ri.unset=function(t,e){return null==t||ls(t,e)},Ri.unzip=sa,Ri.unzipWith=ra,Ri.update=function(t,e,i){return null==t?t:us(t,e,ys(i))},Ri.updateWith=function(e,i,n,s){return s="function"==typeof s?s:t,null==e?e:us(e,i,ys(n),s)},Ri.values=Wo,Ri.valuesIn=function(t){return null==t?[]:Xe(t,ko(t))},Ri.without=aa,Ri.words=Qo,Ri.wrap=function(t,e){return Ra(ys(e),t)},Ri.xor=oa,Ri.xorBy=ha,Ri.xorWith=la,Ri.zip=ua,Ri.zipObject=function(t,e){return fs(t||[],e||[],Qi)},Ri.zipObjectDeep=function(t,e){return fs(t||[],e||[],Jn)},Ri.zipWith=ca,Ri.entries=Uo,Ri.entriesIn=Fo,Ri.extend=_o,Ri.extendWith=wo,hh(Ri,Ri),Ri.add=xh,Ri.attempt=Ko,Ri.camelCase=qo,Ri.capitalize=Ho,Ri.ceil=bh,Ri.clamp=function(e,i,n){return n===t&&(n=i,i=t),n!==t&&(n=(n=go(n))==n?n:0),i!==t&&(i=(i=go(i))==i?i:0),rn(go(e),i,n)},Ri.clone=function(t){return an(t,4)},Ri.cloneDeep=function(t){return an(t,5)},Ri.cloneDeepWith=function(e,i){return an(e,5,i="function"==typeof i?i:t)},Ri.cloneWith=function(e,i){return an(e,4,i="function"==typeof i?i:t)},Ri.conformsTo=function(t,e){return null==e||on(t,e,Bo(e))},Ri.deburr=Vo,Ri.defaultTo=function(t,e){return null==t||t!=t?e:t},Ri.divide=_h,Ri.endsWith=function(e,i,n){e=xo(e),i=os(i);var s=e.length,r=n=n===t?s:rn(mo(n),0,s);return(n-=i.length)>=0&&e.slice(n,r)==i},Ri.eq=Fa,Ri.escape=function(t){return(t=xo(t))&&j.test(t)?t.replace(H,Ke):t},Ri.escapeRegExp=function(t){return(t=xo(t))&&K.test(t)?t.replace(Q,"\\$&"):t},Ri.every=function(e,i,n){var s=Va(e)?Ee:dn;return n&&gr(e,i,n)&&(i=t),s(e,ar(i,3))},Ri.find=ya,Ri.findIndex=Hr,Ri.findKey=function(t,e){return Pe(t,ar(e,3),vn)},Ri.findLast=ga,Ri.findLastIndex=Vr,Ri.findLastKey=function(t,e){return Pe(t,ar(e,3),xn)},Ri.floor=wh,Ri.forEach=va,Ri.forEachRight=xa,Ri.forIn=function(t,e){return null==t?t:yn(t,ar(e,3),ko)},Ri.forInRight=function(t,e){return null==t?t:gn(t,ar(e,3),ko)},Ri.forOwn=function(t,e){return t&&vn(t,ar(e,3))},Ri.forOwnRight=function(t,e){return t&&xn(t,ar(e,3))},Ri.get=To,Ri.gt=Wa,Ri.gte=qa,Ri.has=function(t,e){return null!=t&&pr(t,e,En)},Ri.hasIn=Io,Ri.head=Yr,Ri.identity=sh,Ri.includes=function(t,e,i,n){t=Ya(t)?t:Wo(t),i=i&&!n?mo(i):0;var s=t.length;return i<0&&(i=mi(s+i,0)),oo(t)?i<=s&&t.indexOf(e,i)>-1:!!s&&Re(t,e,i)>-1},Ri.indexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=null==i?0:mo(i);return s<0&&(s=mi(n+s,0)),Re(t,e,s)},Ri.inRange=function(e,i,n){return i=fo(i),n===t?(n=i,i=0):n=fo(n),function(t,e,i){return t>=yi(e,i)&&t<mi(e,i)}(e=go(e),i,n)},Ri.invoke=No,Ri.isArguments=Ha,Ri.isArray=Va,Ri.isArrayBuffer=ja,Ri.isArrayLike=Ya,Ri.isArrayLikeObject=Ga,Ri.isBoolean=function(t){return!0===t||!1===t||eo(t)&&Sn(t)==f},Ri.isBuffer=Xa,Ri.isDate=Za,Ri.isElement=function(t){return eo(t)&&1===t.nodeType&&!so(t)},Ri.isEmpty=function(t){if(null==t)return!0;if(Ya(t)&&(Va(t)||"string"==typeof t||"function"==typeof t.splice||Xa(t)||lo(t)||Ha(t)))return!t.length;var e=dr(t);if(e==x||e==M)return!t.size;if(_r(t))return!On(t).length;for(var i in t)if(Ot.call(t,i))return!1;return!0},Ri.isEqual=function(t,e){return Dn(t,e)},Ri.isEqualWith=function(e,i,n){var s=(n="function"==typeof n?n:t)?n(e,i):t;return s===t?Dn(e,i,t,n):!!s},Ri.isError=$a,Ri.isFinite=function(t){return"number"==typeof t&&ci(t)},Ri.isFunction=Ja,Ri.isInteger=Qa,Ri.isLength=Ka,Ri.isMap=io,Ri.isMatch=function(t,e){return t===e||Nn(t,e,hr(e))},Ri.isMatchWith=function(e,i,n){return n="function"==typeof n?n:t,Nn(e,i,hr(i),n)},Ri.isNaN=function(t){return no(t)&&t!=+t},Ri.isNative=function(t){if(br(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Bn(t)},Ri.isNil=function(t){return null==t},Ri.isNull=function(t){return null===t},Ri.isNumber=no,Ri.isObject=to,Ri.isObjectLike=eo,Ri.isPlainObject=so,Ri.isRegExp=ro,Ri.isSafeInteger=function(t){return Qa(t)&&t>=-9007199254740991&&t<=h},Ri.isSet=ao,Ri.isString=oo,Ri.isSymbol=ho,Ri.isTypedArray=lo,Ri.isUndefined=function(e){return e===t},Ri.isWeakMap=function(t){return eo(t)&&dr(t)==T},Ri.isWeakSet=function(t){return eo(t)&&"[object WeakSet]"==Sn(t)},Ri.join=function(t,e){return null==t?"":di.call(t,e)},Ri.kebabCase=jo,Ri.last=$r,Ri.lastIndexOf=function(e,i,n){var s=null==e?0:e.length;if(!s)return-1;var r=s;return n!==t&&(r=(r=mo(n))<0?mi(s+r,0):yi(r,s-1)),i==i?function(t,e,i){for(var n=i+1;n--;)if(t[n]===e)return n;return n}(e,i,r):Le(e,Ue,r,!0)},Ri.lowerCase=Yo,Ri.lowerFirst=Go,Ri.lt=uo,Ri.lte=co,Ri.max=function(e){return e&&e.length?pn(e,sh,Mn):t},Ri.maxBy=function(e,i){return e&&e.length?pn(e,ar(i,2),Mn):t},Ri.mean=function(t){return Fe(t,sh)},Ri.meanBy=function(t,e){return Fe(t,ar(e,2))},Ri.min=function(e){return e&&e.length?pn(e,sh,Ln):t},Ri.minBy=function(e,i){return e&&e.length?pn(e,ar(i,2),Ln):t},Ri.stubArray=yh,Ri.stubFalse=gh,Ri.stubObject=function(){return{}},Ri.stubString=function(){return""},Ri.stubTrue=function(){return!0},Ri.multiply=Sh,Ri.nth=function(e,i){return e&&e.length?Wn(e,mo(i)):t},Ri.noConflict=function(){return le._===this&&(le._=Ut),this},Ri.noop=lh,Ri.now=Aa,Ri.pad=function(t,e,i){t=xo(t);var n=(e=mo(e))?ai(t):0;if(!e||n>=e)return t;var s=(e-n)/2;return qs(Oe(s),i)+t+qs(fe(s),i)},Ri.padEnd=function(t,e,i){t=xo(t);var n=(e=mo(e))?ai(t):0;return e&&n<e?t+qs(e-n,i):t},Ri.padStart=function(t,e,i){t=xo(t);var n=(e=mo(e))?ai(t):0;return e&&n<e?qs(e-n,i)+t:t},Ri.parseInt=function(t,e,i){return i||null==e?e=0:e&&(e=+e),vi(xo(t).replace(tt,""),e||0)},Ri.random=function(e,i,n){if(n&&"boolean"!=typeof n&&gr(e,i,n)&&(i=n=t),n===t&&("boolean"==typeof i?(n=i,i=t):"boolean"==typeof e&&(n=e,e=t)),e===t&&i===t?(e=0,i=1):(e=fo(e),i===t?(i=e,e=0):i=fo(i)),e>i){var s=e;e=i,i=s}if(n||e%1||i%1){var r=xi();return yi(e+r*(i-e+re("1e-"+((r+"").length-1))),i)}return Yn(e,i)},Ri.reduce=function(t,e,i){var n=Va(t)?Ne:He,s=arguments.length<3;return n(t,ar(e,4),i,s,un)},Ri.reduceRight=function(t,e,i){var n=Va(t)?Be:He,s=arguments.length<3;return n(t,ar(e,4),i,s,cn)},Ri.repeat=function(e,i,n){return i=(n?gr(e,i,n):i===t)?1:mo(i),Gn(xo(e),i)},Ri.replace=function(){var t=arguments,e=xo(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Ri.result=function(e,i,n){var s=-1,r=(i=gs(i,e)).length;for(r||(r=1,e=t);++s<r;){var a=null==e?t:e[Rr(i[s])];a===t&&(s=r,a=n),e=Ja(a)?a.call(e):a}return e},Ri.round=Mh,Ri.runInContext=et,Ri.sample=function(t){return(Va(t)?Xi:Zn)(t)},Ri.size=function(t){if(null==t)return 0;if(Ya(t))return oo(t)?ai(t):t.length;var e=dr(t);return e==x||e==M?t.size:On(t).length},Ri.snakeCase=Xo,Ri.some=function(e,i,n){var s=Va(e)?ke:is;return n&&gr(e,i,n)&&(i=t),s(e,ar(i,3))},Ri.sortedIndex=function(t,e){return ns(t,e)},Ri.sortedIndexBy=function(t,e,i){return ss(t,e,ar(i,2))},Ri.sortedIndexOf=function(t,e){var i=null==t?0:t.length;if(i){var n=ns(t,e);if(n<i&&Fa(t[n],e))return n}return-1},Ri.sortedLastIndex=function(t,e){return ns(t,e,!0)},Ri.sortedLastIndexBy=function(t,e,i){return ss(t,e,ar(i,2),!0)},Ri.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var i=ns(t,e,!0)-1;if(Fa(t[i],e))return i}return-1},Ri.startCase=Zo,Ri.startsWith=function(t,e,i){return t=xo(t),i=null==i?0:rn(mo(i),0,t.length),e=os(e),t.slice(i,i+e.length)==e},Ri.subtract=Eh,Ri.sum=function(t){return t&&t.length?Ve(t,sh):0},Ri.sumBy=function(t,e){return t&&t.length?Ve(t,ar(e,2)):0},Ri.template=function(e,i,n){var s=Ri.templateSettings;n&&gr(e,i,n)&&(i=t),e=xo(e),i=wo({},i,s,$s);var r,a,o=wo({},i.imports,s.imports,$s),h=Bo(o),l=Xe(o,h),u=0,c=i.interpolate||yt,d="__p += '",p=At((i.escape||yt).source+"|"+c.source+"|"+(c===X?ht:yt).source+"|"+(i.evaluate||yt).source+"|$","g"),f="//# sourceURL="+(Ot.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ee+"]")+"\n";e.replace(p,(function(t,i,n,s,o,h){return n||(n=s),d+=e.slice(u,h).replace(gt,ti),i&&(r=!0,d+="' +\n__e("+i+") +\n'"),o&&(a=!0,d+="';\n"+o+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=h+t.length,t})),d+="';\n";var m=Ot.call(i,"variable")&&i.variable;if(m){if(at.test(m))throw new wt("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(U,""):d).replace(F,"$1").replace(W,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var y=Ko((function(){return St(h,f+"return "+d).apply(t,l)}));if(y.source=d,$a(y))throw y;return y},Ri.times=function(t,e){if((t=mo(t))<1||t>h)return[];var i=u,n=yi(t,u);e=ar(e),t-=u;for(var s=je(n,e);++i<t;)e(i);return s},Ri.toFinite=fo,Ri.toInteger=mo,Ri.toLength=yo,Ri.toLower=function(t){return xo(t).toLowerCase()},Ri.toNumber=go,Ri.toSafeInteger=function(t){return t?rn(mo(t),-9007199254740991,h):0===t?t:0},Ri.toString=xo,Ri.toUpper=function(t){return xo(t).toUpperCase()},Ri.trim=function(e,i,n){if((e=xo(e))&&(n||i===t))return Ye(e);if(!e||!(i=os(i)))return e;var s=oi(e),r=oi(i);return xs(s,$e(s,r),Je(s,r)+1).join("")},Ri.trimEnd=function(e,i,n){if((e=xo(e))&&(n||i===t))return e.slice(0,hi(e)+1);if(!e||!(i=os(i)))return e;var s=oi(e);return xs(s,0,Je(s,oi(i))+1).join("")},Ri.trimStart=function(e,i,n){if((e=xo(e))&&(n||i===t))return e.replace(tt,"");if(!e||!(i=os(i)))return e;var s=oi(e);return xs(s,$e(s,oi(i))).join("")},Ri.truncate=function(e,i){var n=30,s="...";if(to(i)){var r="separator"in i?i.separator:r;n="length"in i?mo(i.length):n,s="omission"in i?os(i.omission):s}var a=(e=xo(e)).length;if(ei(e)){var o=oi(e);a=o.length}if(n>=a)return e;var h=n-ai(s);if(h<1)return s;var l=o?xs(o,0,h).join(""):e.slice(0,h);if(r===t)return l+s;if(o&&(h+=l.length-h),ro(r)){if(e.slice(h).search(r)){var u,c=l;for(r.global||(r=At(r.source,xo(lt.exec(r))+"g")),r.lastIndex=0;u=r.exec(c);)var d=u.index;l=l.slice(0,d===t?h:d)}}else if(e.indexOf(os(r),h)!=h){var p=l.lastIndexOf(r);p>-1&&(l=l.slice(0,p))}return l+s},Ri.unescape=function(t){return(t=xo(t))&&V.test(t)?t.replace(q,ui):t},Ri.uniqueId=function(t){var e=++Pt;return xo(t)+e},Ri.upperCase=$o,Ri.upperFirst=Jo,Ri.each=va,Ri.eachRight=xa,Ri.first=Yr,hh(Ri,(vh={},vn(Ri,(function(t,e){Ot.call(Ri.prototype,e)||(vh[e]=t)})),vh),{chain:!1}),Ri.VERSION="4.17.21",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Ri[t].placeholder=Ri})),Se(["drop","take"],(function(e,i){Wi.prototype[e]=function(n){n=n===t?1:mi(mo(n),0);var s=this.__filtered__&&!i?new Wi(this):this.clone();return s.__filtered__?s.__takeCount__=yi(n,s.__takeCount__):s.__views__.push({size:yi(n,u),type:e+(s.__dir__<0?"Right":"")}),s},Wi.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Se(["filter","map","takeWhile"],(function(t,e){var i=e+1,n=1==i||3==i;Wi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ar(t,3),type:i}),e.__filtered__=e.__filtered__||n,e}})),Se(["head","last"],(function(t,e){var i="take"+(e?"Right":"");Wi.prototype[t]=function(){return this[i](1).value()[0]}})),Se(["initial","tail"],(function(t,e){var i="drop"+(e?"":"Right");Wi.prototype[t]=function(){return this.__filtered__?new Wi(this):this[i](1)}})),Wi.prototype.compact=function(){return this.filter(sh)},Wi.prototype.find=function(t){return this.filter(t).head()},Wi.prototype.findLast=function(t){return this.reverse().find(t)},Wi.prototype.invokeMap=Xn((function(t,e){return"function"==typeof t?new Wi(this):this.map((function(i){return In(i,t,e)}))})),Wi.prototype.reject=function(t){return this.filter(Pa(ar(t)))},Wi.prototype.slice=function(e,i){e=mo(e);var n=this;return n.__filtered__&&(e>0||i<0)?new Wi(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),i!==t&&(n=(i=mo(i))<0?n.dropRight(-i):n.take(i-e)),n)},Wi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wi.prototype.toArray=function(){return this.take(u)},vn(Wi.prototype,(function(e,i){var n=/^(?:filter|find|map|reject)|While$/.test(i),s=/^(?:head|last)$/.test(i),r=Ri[s?"take"+("last"==i?"Right":""):i],a=s||/^find/.test(i);r&&(Ri.prototype[i]=function(){var i=this.__wrapped__,o=s?[1]:arguments,h=i instanceof Wi,l=o[0],u=h||Va(i),c=function(t){var e=r.apply(Ri,De([t],o));return s&&d?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(h=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,m=h&&!p;if(!a&&u){i=m?i:new Wi(this);var y=e.apply(i,o);return y.__actions__.push({func:pa,args:[c],thisArg:t}),new Fi(y,d)}return f&&m?e.apply(this,o):(y=this.thru(c),f?s?y.value()[0]:y.value():y)})})),Se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Ri.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var s=this.value();return e.apply(Va(s)?s:[],t)}return this[i]((function(i){return e.apply(Va(i)?i:[],t)}))}})),vn(Wi.prototype,(function(t,e){var i=Ri[e];if(i){var n=i.name+"";Ot.call(Ii,n)||(Ii[n]=[]),Ii[n].push({name:e,func:i})}})),Ii[zs(t,2).name]=[{name:"wrapper",func:t}],Wi.prototype.clone=function(){var t=new Wi(this.__wrapped__);return t.__actions__=Ts(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ts(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ts(this.__views__),t},Wi.prototype.reverse=function(){if(this.__filtered__){var t=new Wi(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wi.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,i=Va(t),n=e<0,s=i?t.length:0,r=function(t,e,i){for(var n=-1,s=i.length;++n<s;){var r=i[n],a=r.size;switch(r.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=yi(e,t+a);break;case"takeRight":t=mi(t,e-a)}}return{start:t,end:e}}(0,s,this.__views__),a=r.start,o=r.end,h=o-a,l=n?o:a-1,u=this.__iteratees__,c=u.length,d=0,p=yi(h,this.__takeCount__);if(!i||!n&&s==h&&p==h)return ds(t,this.__actions__);var f=[];t:for(;h--&&d<p;){for(var m=-1,y=t[l+=e];++m<c;){var g=u[m],v=g.iteratee,x=g.type,b=v(y);if(2==x)y=b;else if(!b){if(1==x)continue t;break t}}f[d++]=y}return f},Ri.prototype.at=fa,Ri.prototype.chain=function(){return da(this)},Ri.prototype.commit=function(){return new Fi(this.value(),this.__chain__)},Ri.prototype.next=function(){this.__values__===t&&(this.__values__=po(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Ri.prototype.plant=function(e){for(var i,n=this;n instanceof Ui;){var s=Ur(n);s.__index__=0,s.__values__=t,i?r.__wrapped__=s:i=s;var r=s;n=n.__wrapped__}return r.__wrapped__=e,i},Ri.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wi){var i=e;return this.__actions__.length&&(i=new Wi(this)),(i=i.reverse()).__actions__.push({func:pa,args:[ta],thisArg:t}),new Fi(i,this.__chain__)}return this.thru(ta)},Ri.prototype.toJSON=Ri.prototype.valueOf=Ri.prototype.value=function(){return ds(this.__wrapped__,this.__actions__)},Ri.prototype.first=Ri.prototype.head,se&&(Ri.prototype[se]=function(){return this}),Ri}();ce?((ce.exports=pi)._=pi,ue._=pi):le._=pi}.call(li);var fi=pi.exports,mi=ui(fi);function yi(t){return t>-1e-8&&t<1e-8}function gi(t,e,i,n,s){const r=1-s;return r*r*(r*t+3*s*e)+s*s*(s*n+3*r*i)}function vi(t,e,i,n,s){const r=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let h=0;if(yi(a)){if((l=r)>1e-8||l<-1e-8){const t=-o/r;t>=0&&t<=1&&(s[h++]=t)}}else{const t=r*r-4*a*o;if(yi(t))s[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),n=(-r-e)/(2*a);i>=0&&i<=1&&(s[h++]=i),n>=0&&n<=1&&(s[h++]=n)}}var l;return h}function xi(t,e,i,n,s,r,a,o,h){let l=t,u=e,c=0;const d=1/h;for(let p=1;p<=h;p++){let h=p*d;const f=gi(t,i,s,a,h),m=gi(e,n,r,o,h),y=f-l,g=m-u;c+=Math.sqrt(y*y+g*g),l=f,u=m}return c}function bi(t,e,i,n,s,r){const a=(e-t)*s+t,o=(i-e)*s+e,h=(n-i)*s+i,l=(o-a)*s+a,u=(h-o)*s+o,c=(u-l)*s+l;r[0]=t,r[1]=a,r[2]=l,r[3]=c,r[4]=c,r[5]=u,r[6]=h,r[7]=n}function _i(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}function wi(t,e,i,n){const s=1-n;return s*(s*t+2*n*e)+n*n*i}function Si(t,e,i,n,s,r,a){let o=t,h=e,l=0;const u=1/a;for(let c=1;c<=a;c++){let a=c*u;const d=wi(t,i,s,a),p=wi(e,n,r,a),f=d-o,m=p-h;l+=Math.sqrt(f*f+m*m),o=d,h=p}return l}function Mi(t,e,i,n,s){const r=(e-t)*n+t,a=(i-e)*n+e,o=(a-r)*n+r;s[0]=t,s[1]=r,s[2]=o,s[3]=o,s[4]=a,s[5]=i}const Ei=Math.PI,Ai=2*Ei;function Ti(t){return(t%=Ai)<0&&(t+=Ai),t}function Ii(t,e){let i=Ti(t[0]),n=Ti(t[1]);e?i<n&&(i+=Ai):n<i&&(n+=Ai),t[0]=i,t[1]=n}function Ci(t,e,i,n){if(yi(e-i))return!0;const s=1e-8;return t=Ti(t),e=Ti(e),i=Ti(i),n?i<=e?t-s>=i&&t+s<=e:t-s>=i||t+s<=e:e<=i?t+s>=e&&t-s<=i:t+s>=e||t-s<=i}const Di=(t,e,i)=>Math.max(e,Math.min(i,t)),Ni=(t,e=1e-6)=>Math.abs(t)<e?0:t<0?-1:1,Bi=t=>t*(Math.PI/180),ki=(t,e,i)=>(1-i)*t+i*e;class Oi{constructor(t=0,e=0,i){d(this,"isVector2",!0),d(this,"x",0),d(this,"y",0),d(this,"z"),this.x=t,this.y=e,this.z=i||0}static isZero(t){return 0===t.x&&0===t.y}static isEmpty(t){return!Number.isFinite(t.x)&&!Number.isFinite(t.y)}static equals(t,e,i=!0){return i?t.x===e.x&&t.y===e.y:Math.abs(t.x-e.x)<Li&&Math.abs(t.y-e.y)<Li}static getInt32Array(t,e=2){const i=new ArrayBuffer(t.length*e*4),n=new Int32Array(i);for(let e=0,i=t.length;e<i;e++)n[2*e]=t[e].x,n[2*e+1]=t[e].y;return n}static getFloat64Array(t,e=2){const i=new ArrayBuffer(t.length*e*8),n=new Float64Array(i);for(let e=0,i=t.length;e<i;e++)n[2*e]=t[e].x,n[2*e+1]=t[e].y;return n}static getVectors(t){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(new Oi(t[i].x,t[i].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let i=0,n=t.length;i<n;i++)e.push(Oi.getString(t[i]));return e.join(",")}static getString(t){return`${t.x},${t.y}`}static getLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}static getDistance(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}static distanceToPolygon(t,e){let i=1/0;for(let n=0,s=e.length-1;n<e.length;s=n++){const r=e[n].x,a=e[n].y,o=e[s].x-r,h=e[s].y-a,l=Math.sqrt(o*o+h*h);if(l>0){const e=Math.max(0,Math.min(1,((t.x-r)*o+(t.y-a)*h)/(l*l))),n=r+e*o,s=a+e*h,u=Math.sqrt((t.x-n)*(t.x-n)+(t.y-s)*(t.y-s));i=Math.min(i,u)}}return i}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return(new Oi).subVectors(t,e)}static isPointOnSegment(t,e,i){return 0===Ni(this.sub(t,i).cross(this.sub(e,i)))&&Ni(this.sub(t,i).dot(this.sub(e,i)))<=0}static angle(t,e,i){return i?Math.atan2(t.y-e.y,t.x-e.x):(t=>{let e=t*(180/Math.PI);return e<0&&(e+=360),e>360&&(e-=360),e})(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let i=this.getClothoidPoints(t,e),n=0;for(let t=0,e=i.length;t<e;t++){let e=Math.max(0,t-1);t>0?n+=this.getDistance(i[e],i[e+1]):n=0,i[t].l=Math.round(n);let s=this.angle(i[e+1],i[e]);i[t].a=Math.round(100*s)/100}return i}static getClothoidPoints(t,e=100){let i=[],n=t.concat([]);if(!n||n.length<2)return i;2===n.length?(n.push(n[1]),n.unshift(n[0])):3===n.length&&n.splice(2,0,n[1]);for(let t=0;t<n.length-3;t+=3){let s=new Oi(n[t].x,n[t].y),r=new Oi(n[t+1].x,n[t+1].y),a=new Oi(n[t+2].x,n[t+2].y),o=new Oi(n[t+3].x,n[t+3].y),h=0;h+=s.distanceTo(r),h+=r.distanceTo(a),h+=a.distanceTo(o);let l=Math.min(.5,1/(h/e));for(let t=l;t<1;t+=l){let e=3*(r.x-s.x),n=3*(a.x-r.x)-e,h=o.x-s.x-e-n,l=3*(r.y-s.y),u=3*(a.y-r.y)-l,c=o.y-s.y-l-u,d=h*Math.pow(t,3)+n*Math.pow(t,2)+e*t+s.x,p=c*Math.pow(t,3)+u*Math.pow(t,2)+l*t+s.y;i.push({x:Math.round(d),y:Math.round(p),a:0,l:0})}}return i.unshift({x:n[0].x,y:n[0].y,a:0,l:0}),i.push({x:n[n.length-1].x,y:n[n.length-1].y,a:0,l:0}),i}static getClothoidLength(t){let e=0;if(t.length>2)for(let i=0;i<t.length;i++){let n=Math.max(0,i-1);i>0&&(e+=this.getDistance(t[n],t[n+1]))}return e}static getCircleCenterByChord(t,e,i,n=!0,s=new Oi){const r=this.getDistance(t,e);if(0===r)return s.x=1/0,s.y=1/0,s;Pi.set((t.x+e.x)/2,(t.y+e.y)/2);const a=Math.sqrt(i*i-r*r/4),o=n?-1:1;return s.x=Pi.x+o*a*(e.y-t.y)/r,s.y=Pi.y-o*a*(e.x-t.x)/r,s}static isPointInCircle(t,e,i){return this.getDistance(i,t)<e}static isPointInConvexHull(t,e){let i=!1;const n=e.length;for(let s=0,r=n-1;s<n;r=s++){const n=e[s],a=e[r];if(Math.min(n.x,a.x)<=t.x&&t.x<=Math.max(n.x,a.x)&&Math.min(n.y,a.y)<=t.y&&t.y<=Math.max(n.y,a.y)){const e=(a.x-n.x)*(t.y-n.y)-(a.y-n.y)*(t.x-n.x);if(Math.abs(e)<1e-12)return!0}n.y>t.y!=a.y>t.y&&t.x<(a.x-n.x)*(t.y-n.y)/(a.y-n.y)+n.x&&(i=!i)}return i}static isPointInPolygon(t,e){let i=!1;for(let n=0,s=e.length-1;n<e.length;s=n++){const r=e[n].x,a=e[n].y,o=e[s].x,h=e[s].y;a>t.y!=h>t.y&&t.x<(o-r)*(t.y-a)/(h-a)+r&&(i=!i)}return i}static isPointInPolygonByRay(t,e){let i=0;const n=(new Oi).copy(t),s=new Oi,r=new Oi;for(let t=0;t<e.length;t++){t===e.length-1?(s.copy(e[t]),r.copy(e[0])):(s.copy(e[t]),r.copy(e[t+1]));let a=[s.y,r.y].sort(((t,e)=>t-e));a[0]<n.y&&a[1]>n.y&&(s.x<n.x||r.x<n.x)&&i++}return i%2==1}static getIntersectionOfSegments(t,e,i,n,s=!1,r=new Oi){const a=(n.y-i.y)*(e.x-t.x)-(n.x-i.x)*(e.y-t.y);if(0===a)return r.makeEmpty();const o=((n.x-i.x)*(t.y-i.y)-(n.y-i.y)*(t.x-i.x))/a,h=((e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x))/a;return s&&(o<0||o>1||h<0||h>1)?r.makeEmpty():(r.x=t.x+o*(e.x-t.x),r.y=t.y+o*(e.y-t.y),r)}static getConvexHullByGrahamScan(t,e=!1,i=[]){if(!t||!t.length)return i;const n=t.length;let s=0;for(let e=0;e<n;e++)t[e].x<t[s].x&&(s=e);let r,a=s;do{i.push(t[a]),r=(a+1)%n;for(let e=0;e<n;e++)this.whichSideOfSegment(t[a],t[e],t[r])>0&&(r=e);a=r}while(a!==s);return e&&i.push(t[s]),i}static whichSideOfSegment(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)}static getPointsWithMatrix3(t,e){const i=[];if(!t)return i;for(let n=0,s=t.length;n<s;n++)i.push({x:e.elements[0]*t[n].x+e.elements[3]*t[n].y+e.elements[6],y:e.elements[1]*t[n].x+e.elements[4]*t[n].y+e.elements[7]});return i}static getPointsApplyMatrix3(t,e=[]){for(let i=0,n=e.length;i<n;i++){const n=t.elements[0]*e[i].x+t.elements[3]*e[i].y+t.elements[6],s=t.elements[1]*e[i].x+t.elements[4]*e[i].y+t.elements[7];e[i].x=n,e[i].y=s}return e}static getCentral(t,e=new Oi){let i=0,n=0;for(let e=0,s=t.length;e<s;e++)i+=t[e].x,n+=t[e].y;return e.set(i/t.length,n/t.length)}static getCentralByNumbers2(t,e=new Oi){let i=0,n=0;for(let e=0,s=t.length;e<s;e+=2)i+=t[e],n+=t[e+1];const s=t.length/2;return e.set(i/s,n/s)}static getCentroidByNumbers2(t,e=new Oi){if(!t||0===t.length)return e.set(0,0);if(t.length<6)return this.getCentralByNumbers2(t,e);let i=0,n=0,s=0;for(let e=0;e<t.length;e+=2){const r=(e+2)%t.length,a=t[e]*t[r+1]-t[r]*t[e+1];i+=a,n+=(t[e]+t[r])*a,s+=(t[e+1]+t[r+1])*a}return i/=2,Math.abs(i)<1e-10?this.getCentralByNumbers2(t,e):(n/=6*i,s/=6*i,e.set(n,s))}static getPoleOfInaccessibility(t,e=new Oi,i=1){const n=new Oi;Oi.getCentroidByNumbers2(t,n);const s=[];for(let e=0;e<t.length;e+=2)s.push({x:t[e],y:t[e+1]});let r={x:n.x,y:n.y},a=this.distanceToPolygon(r,s);for(let t=0;t<20;t++){const e=2*Math.PI*t/20,i=20*Math.random(),o={x:n.x+i*Math.cos(e),y:n.y+i*Math.sin(e)};if(this.isPointInPolygon(o,s)){const t=this.distanceToPolygon(o,s);t>a&&(a=t,r=o)}}return e.set(r.x,r.y),e.z=a,e}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clone(){return new Oi(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}cross(t){return this.x*t.y-this.y*t.x}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}dot(t){return this.x*t.x+this.y*t.y}equals(t,e=!0){return e?t.x===this.x&&t.y===this.y:Math.abs(t.x-this.x)<Li&&Math.abs(t.y-this.y)<Li}equalsXY(){return Math.abs(this.x-this.y)<Li}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+t)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}length(){return Math.sqrt(this.dot(this))}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}maxXY(t,e){return this.x=Math.max(this.x,t),this.y=Math.max(this.y,e),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}minXY(t,e){return this.x=Math.min(this.x,t),this.y=Math.min(this.y,e),this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t,e){return this.x*=t,this.y*=e||t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(t){return this.applyMatrix3(t.matrixWorldInverse).applyMatrix3(t.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.x,s=this.y;return this.x=n*e-s*i,this.y=n*i+s*e,this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),s=this.x-t.x,r=this.y-t.y;return this.x=s*i-r*n+t.x,this.y=s*n+r*i+t.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(t,e,i){return this.x=t,this.y=e,i&&(this.z=i),this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("out of range: "+t)}return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,3*e)}setLength(t){return this.normalize().multiplyScalar(t)}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(t,e=!1){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const Pi=new Oi,Li=1e-8;class Ri{constructor(t=new Oi(1/0,1/0),e=new Oi(-1/0,-1/0)){d(this,"isBox2",!0),d(this,"min"),d(this,"max"),this.min=t,this.max=e}applyMatrix3(t){return this.isEmpty()||(zi[0].set(this.min.x,this.min.y).applyMatrix3(t),zi[1].set(this.min.x,this.max.y).applyMatrix3(t),zi[3].set(this.max.x,this.max.y).applyMatrix3(t),zi[2].set(this.max.x,this.min.y).applyMatrix3(t),this.setFromPoints(zi)),this}clone(){return(new Ri).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}ceil(){return this.min.ceilToZero(),this.max.ceilToZero(),this}distanceToPoint(t){return Ui.copy(t).clamp(this.min,this.max).sub(t).length()}expandByXY(t,e){return this.min.minXY(t,e),this.max.maxXY(t,e),this}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByPoints(t){if(!t||!t.length)return this;for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){var e;this.union(t.boundingBoxWorld);for(let i=0,n=(null==(e=t.children)?void 0:e.length)||0;i<n;i++)this.expandByObject(t.children[i]);return this}expandByObjects(t){for(let e=0,i=t.length;e<i;e++)this.expandByObject(t[e]);return this}expandByBox(t){t.isEmpty()||(this.expandByPoint(t.min),this.expandByPoint(t.max))}expandByCubic(t,e,i,n,s,r,a,o){this.makeEmpty();let h=vi(t,i,s,a,Wi);for(let e=0;e<h;e++){const n=gi(t,i,s,a,Wi[e]);this.min.x=Math.min(n,this.min.x),this.max.x=Math.max(n,this.max.x)}h=vi(e,n,r,o,qi);for(let t=0;t<h;t++){const i=gi(e,n,r,o,qi[t]);this.min.y=Math.min(i,this.min.y),this.max.y=Math.max(i,this.max.y)}return this.expandByXY(t,e),this.expandByXY(a,o),this}expandByQuadratic(t,e,i,n,s,r){const a=Math.max(0,Math.min(1,_i(t,i,s))),o=Math.max(0,Math.min(1,_i(e,n,r))),h=wi(t,i,s,a),l=wi(e,n,r,o);return this.expandByXY(t,e),this.expandByXY(s,r),this.expandByXY(h,l),this}expandByArc(t,e,i,n,s,r,a){let o=s%(2*Math.PI);o<0&&(o+=2*Math.PI);let h=r%(2*Math.PI);if(h<0&&(h+=2*Math.PI),o===h)return this.expandByXY(t-i,e-n),this.expandByXY(t+i,e+n),this;if(a){const t=o;o=h,h=t}return h<o&&(h+=2*Math.PI),this.expandByXY(t+i*Math.cos(o),e+n*Math.sin(o)),this.expandByXY(t+i*Math.cos(h),e+n*Math.sin(h)),o>.5*Math.PI&&h<2*Math.PI+.5*Math.PI&&this.expandByXY(t,e+n),o>Math.PI&&h<2*Math.PI+Math.PI&&this.expandByXY(t-i,e),o>1.5*Math.PI&&h<2*Math.PI+1.5*Math.PI&&this.expandByXY(t,e-n),o>0&&h<2*Math.PI&&this.expandByXY(t+i,e),this}expandByEllipse(t,e,i,n,s,r,a,o){Hi[0]=r,Hi[1]=a,Ii(Hi,o),r=Hi[0],a=Hi[1];const h=t+i*Math.cos(r),l=e+n*Math.sin(r),u=t+i*Math.cos(a),c=e+n*Math.sin(a);this.expandByXY(h,l),this.expandByXY(u,c);const d=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const h of d)if(Ci(h,r,a,o)){const r=t+i*Math.cos(h),a=e+n*Math.sin(h),o=t+(r-t)*Math.cos(s)-(a-e)*Math.sin(s),l=e+(r-t)*Math.sin(s)+(a-e)*Math.cos(s);this.expandByXY(o,l)}return this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}floor(){return this.min.floorToZero(),this.max.floorToZero(),this}getCenter(t=new Oi){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t=new Oi){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}getPoints(t=[]){return t.length=0,t[0]={x:this.min.x,y:this.min.y},t[1]={x:this.min.x,y:this.max.y},t[2]={x:this.max.x,y:this.max.y},t[3]={x:this.max.x,y:this.min.y},t}getNumbersArray(t=[]){return[this.min.x,this.min.y,this.min.x,this.max.y,this.max.x,this.max.y,this.max.x,this.min.y]}getArea(){return this.getSize(Ui),Ui.x*Ui.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}intersectsBox(t){return!!t&&!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}intersectsObject(t){return!(!t||!t.geometry)&&this.intersectsBox(t.geometry.boundingBox)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}round(){return this.min.roundToZero(),this.max.roundToZero(),this}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(Ui.fromArray(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Ui.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromProjectionMatrix(t){return this.min.set(t.elements[6],t.elements[7]),this.max.set(t.elements[6],t.elements[7]),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}setFromMinMaxString(t,e=" "){if(this.makeEmpty(),!(null==t?void 0:t.length))return this;let i=t.split(e),n=mi.map(i,(t=>parseFloat(t)));for(let t=0,e=n.length;t<e;t+=2)this.expandByPoint(Ui.fromArray(n,t));return this}setFromXYXY(t,e,i,n){return this.makeEmpty(),this.expandByXY(t,e),this.expandByXY(i,n),this}translate(t){return this.min.add(t),this.max.add(t),this}toString(){return`{"min":${this.min.toString()},"max":${this.max.toString()}}`}fromString(t){return t?(this.copy(JSON.parse(t)),this):this}union(t){return t.validate()?(this.min.min(t.min),this.max.max(t.max),this):this}validate(){return this.min.validate()&&this.max.validate()}unproject(t){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}centralArrange(t=1,e=20,i=10,n){const s=e+i;n?Ui.copy(n):this.getCenter(Ui),this.getSize(Fi),Fi.subScalar(e);const r=Math.floor(Fi.x/s),a=r*s,o=Math.ceil(t/r)*s;if(Fi.x<s||Fi.y<s||a>=Fi.x||o>=Fi.y)return Ui.clone();let h=[],l=0,u=0;for(let e=0;e<t;e++){const e=r>t?t*s:a,i=Ui.x-e/2+u*s+s/2,n=Ui.y-o/2+l*s+s/2;h.push(new Oi(i,n)),u++,u>=r&&(u=0,l++)}return h}flipY(){return Ui.copy(this.min).multiplyScalar(1,-1),Fi.copy(this.max).multiplyScalar(1,-1),this.min.set(Ui.x,Fi.y),this.max.set(Fi.x,Ui.y),this}}const zi=[new Oi,new Oi,new Oi,new Oi],Ui=new Oi,Fi=new Oi,Wi=[],qi=[],Hi=[],Vi=n;class ji extends $e{constructor(t){super(t),this.defaultDPI=90,this.defaultUnit="px"}load(t,e,i,n){const s=this,r=new Ke(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(t,(function(i){try{e(s.parse(i))}catch(e){n&&n(e),s.manager.itemError(t)}}),i,n)}parse(t){const e=this;function i(t,e,i,s,r,a,o,h){if(0==e||0==i)return void t.lineTo(h.x,h.y);s=s*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const l=(o.x-h.x)/2,u=(o.y-h.y)/2,c=Math.cos(s)*l+Math.sin(s)*u,d=-Math.sin(s)*l+Math.cos(s)*u;let p=e*e,f=i*i;const m=c*c,y=d*d,g=m/p+y/f;if(g>1){const t=Math.sqrt(g);p=(e*=t)*e,f=(i*=t)*i}const v=p*y+f*m,x=(p*f-v)/v;let b=Math.sqrt(Math.max(0,x));r===a&&(b=-b);const _=b*e*d/i,w=-b*i*c/e,S=Math.cos(s)*_-Math.sin(s)*w+(o.x+h.x)/2,M=Math.sin(s)*_+Math.cos(s)*w+(o.y+h.y)/2,E=n(1,0,(c-_)/e,(d-w)/i),A=n((c-_)/e,(d-w)/i,(-c-_)/e,(-d-w)/i)%(2*Math.PI);t.currentPath.absellipse(S,M,e,i,E,E+A,0===a,s)}function n(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}function s(t,e){e=Object.assign({},e);let i={};if(t.hasAttribute("class")){const e=t.getAttribute("class").split(/\s/).filter(Boolean).map((t=>t.trim()));for(let t=0;t<e.length;t++)i=Object.assign(i,m["."+e[t]])}function n(n,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(n)&&(e[s]=r(t.getAttribute(n))),i[n]&&(e[s]=r(i[n])),t.style&&""!==t.style[n]&&(e[s]=r(t.style[n]))}function s(t){return Math.max(0,Math.min(1,l(t)))}function r(t){return Math.max(0,l(t))}return t.hasAttribute("id")&&(i=Object.assign(i,m["#"+t.getAttribute("id")])),n("fill","fill"),n("fill-opacity","fillOpacity",s),n("fill-rule","fillRule"),n("opacity","opacity",s),n("stroke","stroke"),n("stroke-opacity","strokeOpacity",s),n("stroke-width","strokeWidth",r),n("stroke-linejoin","strokeLineJoin"),n("stroke-linecap","strokeLineCap"),n("stroke-miterlimit","strokeMiterLimit",r),n("visibility","visibility"),e}function r(t,e){return t-(e-t)}function a(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%i)&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}const o=["mm","cm","in","pt","pc","px"],h={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function l(t){let i,n="px";if("string"==typeof t||t instanceof String)for(let e=0,i=o.length;e<i;e++){const i=o[e];if(t.endsWith(i)){n=i,t=t.substring(0,t.length-i.length);break}}return"px"===n&&"px"!==e.defaultUnit?i=h.in[e.defaultUnit]/e.defaultDPI:(i=h[n][e.defaultUnit],i<0&&(i=h[n].in*e.defaultDPI)),i*parseFloat(t)}function u(t){const e=t.elements;return e[0]*e[4]-e[1]*e[3]<0}function c(t){const e=t.elements,i=e[0]*e[3]+e[1]*e[4];if(0===i)return!1;const n=d(t),s=p(t);return Math.abs(i/(n*s))>Number.EPSILON}function d(t){const e=t.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function p(t){const e=t.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}const f=[],m={},y=[],g=new b,v=new b,_=new b,w=new b,S=new x,M=new R,E=new b,A=(new DOMParser).parseFromString(t,"image/svg+xml");return function t(e,n){if(1!==e.nodeType)return;const o=function(t){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))))return null;const e=function(t){const e=new b,i=g;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){const i=l(t.getAttribute("x")),n=l(t.getAttribute("y"));e.translate(i,n)}if(t.hasAttribute("transform")){const n=t.getAttribute("transform").split(")");for(let t=n.length-1;t>=0;t--){const s=n[t].trim();if(""===s)continue;const r=s.indexOf("("),o=s.length;if(r>0&&r<o){const t=s.slice(0,r),e=a(s.slice(r+1));switch(i.identity(),t){case"translate":if(e.length>=1){const t=e[0];let n=0;e.length>=2&&(n=e[1]),i.translate(t,n)}break;case"rotate":if(e.length>=1){let t=0,n=0,s=0;t=e[0]*Math.PI/180,e.length>=3&&(n=e[1],s=e[2]),v.makeTranslation(-n,-s),_.makeRotation(t),w.multiplyMatrices(_,v),v.makeTranslation(n,s),i.multiplyMatrices(v,w)}break;case"scale":if(e.length>=1){const t=e[0];let n=t;e.length>=2&&(n=e[1]),i.scale(t,n)}break;case"skewX":1===e.length&&i.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&i.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&i.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}e.premultiply(i)}}return e}(t);return y.length>0&&e.premultiply(y[y.length-1]),E.copy(e),y.push(e),e}(e);let h=!1,A=null;switch(e.nodeName){case"svg":case"g":n=s(e,n);break;case"style":!function(t){if(t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length)for(let e=0;e<t.sheet.cssRules.length;e++){const i=t.sheet.cssRules[e];if(1!==i.type)continue;const n=i.selectorText.split(/,/gm).filter(Boolean).map((t=>t.trim()));for(let t=0;t<n.length;t++){const e=Object.fromEntries(Object.entries(i.style).filter((([,t])=>""!==t)));m[n[t]]=Object.assign(m[n[t]]||{},e)}}}(e);break;case"path":n=s(e,n),e.hasAttribute("d")&&(A=function(t){const e=new ii,n=new x,s=new x,o=new x;let h=!0,l=!1;const u=t.getAttribute("d");if(""===u||"none"===u)return null;const c=u.match(/[a-df-z][^a-df-z]*/gi);for(let t=0,u=c.length;t<u;t++){const u=c[t],d=u.charAt(0),p=u.slice(1).trim();let f;switch(!0===h&&(l=!0,h=!1),d){case"M":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x=f[t+0],n.y=f[t+1],s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&o.copy(n);break;case"H":f=a(p);for(let t=0,i=f.length;t<i;t++)n.x=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"V":f=a(p);for(let t=0,i=f.length;t<i;t++)n.y=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"L":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x=f[t+0],n.y=f[t+1],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"C":f=a(p);for(let t=0,i=f.length;t<i;t+=6)e.bezierCurveTo(f[t+0],f[t+1],f[t+2],f[t+3],f[t+4],f[t+5]),s.x=f[t+2],s.y=f[t+3],n.x=f[t+4],n.y=f[t+5],0===t&&!0===l&&o.copy(n);break;case"S":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.bezierCurveTo(r(n.x,s.x),r(n.y,s.y),f[t+0],f[t+1],f[t+2],f[t+3]),s.x=f[t+0],s.y=f[t+1],n.x=f[t+2],n.y=f[t+3],0===t&&!0===l&&o.copy(n);break;case"Q":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.quadraticCurveTo(f[t+0],f[t+1],f[t+2],f[t+3]),s.x=f[t+0],s.y=f[t+1],n.x=f[t+2],n.y=f[t+3],0===t&&!0===l&&o.copy(n);break;case"T":f=a(p);for(let t=0,i=f.length;t<i;t+=2){const i=r(n.x,s.x),a=r(n.y,s.y);e.quadraticCurveTo(i,a,f[t+0],f[t+1]),s.x=i,s.y=a,n.x=f[t+0],n.y=f[t+1],0===t&&!0===l&&o.copy(n)}break;case"A":f=a(p,[3,4],7);for(let t=0,r=f.length;t<r;t+=7){if(f[t+5]==n.x&&f[t+6]==n.y)continue;const r=n.clone();n.x=f[t+5],n.y=f[t+6],s.x=n.x,s.y=n.y,i(e,f[t],f[t+1],f[t+2],f[t+3],f[t+4],r,n),0===t&&!0===l&&o.copy(n)}break;case"m":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x+=f[t+0],n.y+=f[t+1],s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&o.copy(n);break;case"h":f=a(p);for(let t=0,i=f.length;t<i;t++)n.x+=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"v":f=a(p);for(let t=0,i=f.length;t<i;t++)n.y+=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"l":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x+=f[t+0],n.y+=f[t+1],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"c":f=a(p);for(let t=0,i=f.length;t<i;t+=6)e.bezierCurveTo(n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3],n.x+f[t+4],n.y+f[t+5]),s.x=n.x+f[t+2],s.y=n.y+f[t+3],n.x+=f[t+4],n.y+=f[t+5],0===t&&!0===l&&o.copy(n);break;case"s":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.bezierCurveTo(r(n.x,s.x),r(n.y,s.y),n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3]),s.x=n.x+f[t+0],s.y=n.y+f[t+1],n.x+=f[t+2],n.y+=f[t+3],0===t&&!0===l&&o.copy(n);break;case"q":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.quadraticCurveTo(n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3]),s.x=n.x+f[t+0],s.y=n.y+f[t+1],n.x+=f[t+2],n.y+=f[t+3],0===t&&!0===l&&o.copy(n);break;case"t":f=a(p);for(let t=0,i=f.length;t<i;t+=2){const i=r(n.x,s.x),a=r(n.y,s.y);e.quadraticCurveTo(i,a,n.x+f[t+0],n.y+f[t+1]),s.x=i,s.y=a,n.x=n.x+f[t+0],n.y=n.y+f[t+1],0===t&&!0===l&&o.copy(n)}break;case"a":f=a(p,[3,4],7);for(let t=0,r=f.length;t<r;t+=7){if(0==f[t+5]&&0==f[t+6])continue;const r=n.clone();n.x+=f[t+5],n.y+=f[t+6],s.x=n.x,s.y=n.y,i(e,f[t],f[t+1],f[t+2],f[t+3],f[t+4],r,n),0===t&&!0===l&&o.copy(n)}break;case"Z":case"z":e.currentPath.autoClose=!0,e.currentPath.curves.length>0&&(n.copy(o),e.currentPath.currentPoint.copy(n),h=!0)}l=!1}return e}(e));break;case"rect":n=s(e,n),A=function(t){const e=l(t.getAttribute("x")||0),i=l(t.getAttribute("y")||0),n=l(t.getAttribute("rx")||t.getAttribute("ry")||0),s=l(t.getAttribute("ry")||t.getAttribute("rx")||0),r=l(t.getAttribute("width")),a=l(t.getAttribute("height")),o=.448084975506,h=new ii;return h.moveTo(e+n,i),h.lineTo(e+r-n,i),(0!==n||0!==s)&&h.bezierCurveTo(e+r-n*o,i,e+r,i+s*o,e+r,i+s),h.lineTo(e+r,i+a-s),(0!==n||0!==s)&&h.bezierCurveTo(e+r,i+a-s*o,e+r-n*o,i+a,e+r-n,i+a),h.lineTo(e+n,i+a),(0!==n||0!==s)&&h.bezierCurveTo(e+n*o,i+a,e,i+a-s*o,e,i+a-s),h.lineTo(e,i+s),(0!==n||0!==s)&&h.bezierCurveTo(e,i+s*o,e+n*o,i,e+n,i),h}(e);break;case"polygon":n=s(e,n),A=function(t){function e(t,e,i){const r=l(e),a=l(i);0===s?n.moveTo(r,a):n.lineTo(r,a),s++}const i=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,n=new ii;let s=0;return t.getAttribute("points").replace(i,e),n.currentPath.autoClose=!0,n}(e);break;case"polyline":n=s(e,n),A=function(t){function e(t,e,i){const r=l(e),a=l(i);0===s?n.moveTo(r,a):n.lineTo(r,a),s++}const i=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,n=new ii;let s=0;return t.getAttribute("points").replace(i,e),n.currentPath.autoClose=!1,n}(e);break;case"circle":n=s(e,n),A=function(t){const e=l(t.getAttribute("cx")||0),i=l(t.getAttribute("cy")||0),n=l(t.getAttribute("r")||0),s=new ye;s.absarc(e,i,n,0,2*Math.PI);const r=new ii;return r.subPaths.push(s),r}(e);break;case"ellipse":n=s(e,n),A=function(t){const e=l(t.getAttribute("cx")||0),i=l(t.getAttribute("cy")||0),n=l(t.getAttribute("rx")||0),s=l(t.getAttribute("ry")||0),r=new ye;r.absellipse(e,i,n,s,0,2*Math.PI);const a=new ii;return a.subPaths.push(r),a}(e);break;case"line":n=s(e,n),A=function(t){const e=l(t.getAttribute("x1")||0),i=l(t.getAttribute("y1")||0),n=l(t.getAttribute("x2")||0),s=l(t.getAttribute("y2")||0),r=new ii;return r.moveTo(e,i),r.lineTo(n,s),r.currentPath.autoClose=!1,r}(e);break;case"defs":h=!0;break;case"use":n=s(e,n);const o=(e.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),u=e.viewportElement.getElementById(o);u&&t(u,n)}A&&(void 0!==n.fill&&"none"!==n.fill&&A.color.setStyle(n.fill,Vi),function(t,e){function i(t){M.set(t.x,t.y,1).applyMatrix3(e),t.set(M.x,M.y)}function n(t){const i=t.xRadius,n=t.yRadius,s=Math.cos(t.aRotation),r=Math.sin(t.aRotation),a=new R(i*s,i*r,0),o=new R(-n*r,n*s,0),h=a.applyMatrix3(e),l=o.applyMatrix3(e),c=g.set(h.x,l.x,0,h.y,l.y,0,0,0,1),d=v.copy(c).invert(),p=_.copy(d).transpose().multiply(d).elements,f=function(t,e,i){let n,s,r,a,o;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(n=.5*(h+u),o=1/n,s=t*o*i-e*o*e):h<0?s=.5*(h-u):(n=.5*u,s=-.5*u),r=l>0?l+u:l-u,Math.abs(r)>2*Math.abs(e)?(o=-2*e/r,a=1/Math.sqrt(1+o*o),r=o*a):0===Math.abs(e)?(r=1,a=0):(o=-.5*r/e,r=1/Math.sqrt(1+o*o),a=o*r),l>0&&(o=r,r=-a,a=o),{rt1:n,rt2:s,cs:r,sn:a}}(p[0],p[1],p[4]),m=Math.sqrt(f.rt1),y=Math.sqrt(f.rt2);if(t.xRadius=1/m,t.yRadius=1/y,t.aRotation=Math.atan2(f.sn,f.cs),!((t.aEndAngle-t.aStartAngle)%(2*Math.PI)<Number.EPSILON)){const i=v.set(m,0,0,0,y,0,0,0,1),n=_.set(f.cs,f.sn,0,-f.sn,f.cs,0,0,0,1),s=i.multiply(n).multiply(c),r=t=>{const{x:e,y:i}=new R(Math.cos(t),Math.sin(t),0).applyMatrix3(s);return Math.atan2(i,e)};t.aStartAngle=r(t.aStartAngle),t.aEndAngle=r(t.aEndAngle),u(e)&&(t.aClockwise=!t.aClockwise)}}function s(t){const i=d(e),n=p(e);t.xRadius*=i,t.yRadius*=n;const s=i>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);t.aRotation+=s,u(e)&&(t.aStartAngle*=-1,t.aEndAngle*=-1,t.aClockwise=!t.aClockwise)}const r=t.subPaths;for(let t=0,a=r.length;t<a;t++){const a=r[t].curves;for(let t=0;t<a.length;t++){const r=a[t];r.isLineCurve?(i(r.v1),i(r.v2)):r.isCubicBezierCurve?(i(r.v0),i(r.v1),i(r.v2),i(r.v3)):r.isQuadraticBezierCurve?(i(r.v0),i(r.v1),i(r.v2)):r.isEllipseCurve&&(S.set(r.aX,r.aY),i(S),r.aX=S.x,r.aY=S.y,c(e)?n(r):s(r))}}}(A,E),f.push(A),A.userData={node:e,style:n});const T=e.childNodes;for(let e=0;e<T.length;e++){const i=T[e];h&&"style"!==i.nodeName&&"defs"!==i.nodeName||t(i,n)}o&&(y.pop(),y.length>0?E.copy(y[y.length-1]):E.identity())}(A.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:f,xml:A.documentElement}}static createShapes(t){const e=999999999,i=0,n=1,s=2,r=3,a=4,o=5,h=6,l={loc:i,t:0};function u(t,e,n,r){const a=t.x,o=e.x,h=n.x,u=r.x,d=t.y,p=e.y,f=n.y,m=r.y,y=(u-h)*(d-f)-(m-f)*(a-h),g=(m-f)*(o-a)-(u-h)*(p-d),v=y/g,x=((o-a)*(d-f)-(p-d)*(a-h))/g;if(0===g&&0!==y||v<=0||v>=1||x<0||x>1)return null;if(0===y&&0===g){for(let h=0;h<2;h++){if(c(0===h?n:r,t,e),l.loc==i){const t=0===h?n:r;return{x:t.x,y:t.y,t:l.t}}if(l.loc==s)return{x:+(a+l.t*(o-a)).toPrecision(10),y:+(d+l.t*(p-d)).toPrecision(10),t:l.t}}return null}for(let s=0;s<2;s++)if(c(0===s?n:r,t,e),l.loc==i){const t=0===s?n:r;return{x:t.x,y:t.y,t:l.t}}return{x:+(a+v*(o-a)).toPrecision(10),y:+(d+v*(p-d)).toPrecision(10),t:v}}function c(t,e,u){const c=u.x-e.x,d=u.y-e.y,p=t.x-e.x,f=t.y-e.y,m=c*f-p*d;if(t.x===e.x&&t.y===e.y)return l.loc=i,void(l.t=0);if(t.x===u.x&&t.y===u.y)return l.loc=n,void(l.t=1);if(m<-Number.EPSILON)return void(l.loc=r);if(m>Number.EPSILON)return void(l.loc=a);if(c*p<0||d*f<0)return void(l.loc=o);if(Math.sqrt(c*c+d*d)<Math.sqrt(p*p+f*f))return void(l.loc=h);let y;y=0!==c?p/c:f/d,l.loc=s,l.t=y}function d(t,e,i){const n=new x;e.getCenter(n);const s=[];return i.forEach((e=>{e.boundingBox.containsPoint(n)&&function(t,e){const i=[],n=[];for(let s=1;s<t.length;s++){const r=t[s-1],a=t[s];for(let t=1;t<e.length;t++){const s=u(r,a,e[t-1],e[t]);null!==s&&void 0===i.find((t=>t.t<=s.t+Number.EPSILON&&t.t>=s.t-Number.EPSILON))&&(i.push(s),n.push(new x(s.x,s.y)))}}return n}(t,e.points).forEach((t=>{s.push({identifier:e.identifier,isCW:e.isCW,point:t})}))})),s.sort(((t,e)=>t.point.x-e.point.x)),s}let p=e,f=-999999999,m=t.subPaths.map((t=>{const i=t.getPoints();let n=-999999999,s=e,r=-999999999,a=e;for(let t=0;t<i.length;t++){const e=i[t];e.y>n&&(n=e.y),e.y<s&&(s=e.y),e.x>r&&(r=e.x),e.x<a&&(a=e.x)}return f<=r&&(f=r+1),p>=a&&(p=a-1),{curves:t.curves,points:i,isCW:je.isClockWise(i),identifier:-1,boundingBox:new ei(new x(a,s),new x(r,n))}}));m=m.filter((t=>t.points.length>1));for(let t=0;t<m.length;t++)m[t].identifier=t;const y=m.map((e=>function(t,e,i,n,s){null!=s&&""!==s||(s="nonzero");const r=new x;t.boundingBox.getCenter(r);const a=d([new x(i,r.y),new x(n,r.y)],t.boundingBox,e);a.sort(((t,e)=>t.point.x-e.point.x));const o=[],h=[];a.forEach((e=>{e.identifier===t.identifier?o.push(e):h.push(e)}));const l=o[0].point.x,u=[];let c=0;for(;c<h.length&&h[c].point.x<l;)u.length>0&&u[u.length-1]===h[c].identifier?u.pop():u.push(h[c].identifier),c++;if(u.push(t.identifier),"evenodd"===s){const e=u.length%2==0,i=u[u.length-2];return{identifier:t.identifier,isHole:e,for:i}}if("nonzero"===s){let i=!0,n=null,s=null;for(let t=0;t<u.length;t++){const r=u[t];i?(s=e[r].isCW,i=!1,n=r):s!==e[r].isCW&&(s=e[r].isCW,i=!0)}return{identifier:t.identifier,isHole:i,for:n}}}(e,m,p,f,t.userData?t.userData.style.fillRule:void 0))),g=[];return m.forEach((t=>{if(!y[t.identifier].isHole){const e=new ge;e.curves=t.curves,y.filter((e=>e.isHole&&e.for===t.identifier)).forEach((t=>{const i=m[t.identifier],n=new ye;n.curves=i.curves,e.holes.push(n)})),g.push(e)}})),g}static getStrokeStyle(t,e,i,n,s){return{strokeColor:e=void 0!==e?e:"#000",strokeWidth:t=void 0!==t?t:1,strokeLineJoin:i=void 0!==i?i:"miter",strokeLineCap:n=void 0!==n?n:"butt",strokeMiterLimit:s=void 0!==s?s:4}}static pointsToStroke(t,e,i,n){const s=[],r=[],a=[];if(0===ji.pointsToStrokeWithBuffers(t,e,i,n,s,r,a))return null;const o=new Kt;return o.setAttribute("position",new jt(s,3)),o.setAttribute("normal",new jt(r,3)),o.setAttribute("uv",new jt(a,2)),o}static pointsToStrokeWithBuffers(t,e,i,n,s,r,a,o){const h=new x,l=new x,u=new x,c=new x,d=new x,p=new x,f=new x,m=new x,y=new x,g=new x,v=new x,b=new x,_=new x,w=new x,S=new x,M=new x,E=new x;i=void 0!==i?i:12,n=void 0!==n?n:.001,o=void 0!==o?o:0;const A=(t=function(t){let e=!1;for(let i=1,s=t.length-1;i<s;i++)if(t[i].distanceTo(t[i+1])<n){e=!0;break}if(!e)return t;const i=[];i.push(t[0]);for(let e=1,s=t.length-1;e<s;e++)t[e].distanceTo(t[e+1])>=n&&i.push(t[e]);return i.push(t[t.length-1]),i}(t)).length;if(A<2)return 0;const T=t[0].equals(t[A-1]);let I,C,D=t[0];const N=e.strokeWidth/2,B=1/(A-1);let k,O,P,L,R=0,z=!1,U=0,F=3*o,W=2*o;q(t[0],t[1],h).multiplyScalar(N),m.copy(t[0]).sub(h),y.copy(t[0]).add(h),g.copy(m),v.copy(y);for(let i=1;i<A;i++){I=t[i],C=i===A-1?T?t[1]:void 0:t[i+1];const n=h;if(q(D,I,n),u.copy(n).multiplyScalar(N),b.copy(I).sub(u),_.copy(I).add(u),k=R+B,O=!1,void 0!==C){q(I,C,l),u.copy(l).multiplyScalar(N),w.copy(I).sub(u),S.copy(I).add(u),P=!0,u.subVectors(C,D),n.dot(u)<0&&(P=!1),1===i&&(z=P),u.subVectors(C,I),u.normalize();const t=Math.abs(n.dot(u));if(t>Number.EPSILON){const i=N/t;u.multiplyScalar(-i),c.subVectors(I,D),d.copy(c).setLength(i).add(u),M.copy(d).negate();const n=d.length(),s=c.length();c.divideScalar(s),p.subVectors(C,I);const r=p.length();switch(p.divideScalar(r),c.dot(M)<s&&p.dot(M)<r&&(O=!0),E.copy(d).add(I),M.add(I),L=!1,O?P?(S.copy(M),_.copy(M)):(w.copy(M),b.copy(M)):j(),e.strokeLineJoin){case"bevel":Y(P,O,k);break;case"round":G(P,O),P?V(I,b,w,k,0):V(I,S,_,k,1);break;default:const t=N*e.strokeMiterLimit/n;if(t<1){if("miter-clip"!==e.strokeLineJoin){Y(P,O,k);break}G(P,O),P?(p.subVectors(E,b).multiplyScalar(t).add(b),f.subVectors(E,w).multiplyScalar(t).add(w),H(b,k,0),H(p,k,0),H(I,k,.5),H(I,k,.5),H(p,k,0),H(f,k,0),H(I,k,.5),H(f,k,0),H(w,k,0)):(p.subVectors(E,_).multiplyScalar(t).add(_),f.subVectors(E,S).multiplyScalar(t).add(S),H(_,k,1),H(p,k,1),H(I,k,.5),H(I,k,.5),H(p,k,1),H(f,k,1),H(I,k,.5),H(f,k,1),H(S,k,1))}else O?(P?(H(y,R,1),H(m,R,0),H(E,k,0),H(y,R,1),H(E,k,0),H(M,k,1)):(H(y,R,1),H(m,R,0),H(E,k,1),H(m,R,0),H(M,k,0),H(E,k,1)),P?w.copy(E):S.copy(E)):P?(H(b,k,0),H(E,k,0),H(I,k,.5),H(I,k,.5),H(E,k,0),H(w,k,0)):(H(_,k,1),H(E,k,1),H(I,k,.5),H(I,k,.5),H(E,k,1),H(S,k,1)),L=!0}}else j()}else j();T||i!==A-1||X(t[0],g,v,P,!0,R),R=k,D=I,m.copy(w),y.copy(S)}if(T){if(O&&s){let t=E,e=M;z!==P&&(t=M,e=E),P?(L||z)&&(e.toArray(s,0),e.toArray(s,9),L&&t.toArray(s,3)):!L&&z||(e.toArray(s,3),e.toArray(s,9),L&&t.toArray(s,0))}}else X(I,b,_,P,!1,k);return U;function q(t,e,i){return i.subVectors(e,t),i.set(-i.y,i.x).normalize()}function H(t,e,i){s&&(s[F]=t.x,s[F+1]=t.y,s[F+2]=0,r&&(r[F]=0,r[F+1]=0,r[F+2]=1),F+=3,a&&(a[W]=e,a[W+1]=i,W+=2)),U+=3}function V(t,e,n,s,r){h.copy(e).sub(t).normalize(),l.copy(n).sub(t).normalize();let a=Math.PI;const o=h.dot(l);Math.abs(o)<1&&(a=Math.abs(Math.acos(o))),a/=i,u.copy(e);for(let e=0,n=i-1;e<n;e++)c.copy(u).rotateAround(t,a),H(u,s,r),H(c,s,r),H(t,s,.5),u.copy(c);H(c,s,r),H(n,s,r),H(t,s,.5)}function j(){H(y,R,1),H(m,R,0),H(b,k,0),H(y,R,1),H(b,k,0),H(_,k,1)}function Y(t,e,i){e?t?(H(y,R,1),H(m,R,0),H(b,k,0),H(y,R,1),H(b,k,0),H(M,k,1),H(b,i,0),H(w,i,0),H(M,i,.5)):(H(y,R,1),H(m,R,0),H(_,k,1),H(m,R,0),H(M,k,0),H(_,k,1),H(_,i,1),H(M,i,0),H(S,i,1)):t?(H(b,i,0),H(w,i,0),H(I,i,.5)):(H(_,i,1),H(S,i,0),H(I,i,.5))}function G(t,e){e&&(t?(H(y,R,1),H(m,R,0),H(b,k,0),H(y,R,1),H(b,k,0),H(M,k,1),H(b,R,0),H(I,k,.5),H(M,k,1),H(I,k,.5),H(w,R,0),H(M,k,1)):(H(y,R,1),H(m,R,0),H(_,k,1),H(m,R,0),H(M,k,0),H(_,k,1),H(_,R,1),H(M,k,0),H(I,k,.5),H(I,k,.5),H(M,k,0),H(S,R,1)))}function X(t,i,n,r,o,d){switch(e.strokeLineCap){case"round":o?V(t,n,i,d,.5):V(t,i,n,d,.5);break;case"square":if(o)h.subVectors(i,t),l.set(h.y,-h.x),u.addVectors(h,l).add(t),c.subVectors(l,h).add(t),r?(u.toArray(s,3),c.toArray(s,0),c.toArray(s,9)):(u.toArray(s,3),1===a[7]?c.toArray(s,9):u.toArray(s,9),c.toArray(s,0));else{h.subVectors(n,t),l.set(h.y,-h.x),u.addVectors(h,l).add(t),c.subVectors(l,h).add(t);const e=s.length;r?(u.toArray(s,e-3),c.toArray(s,e-6),c.toArray(s,e-12)):(c.toArray(s,e-6),u.toArray(s,e-3),c.toArray(s,e-12))}}}}}class Yi extends R{constructor(t,e,i){super(t,e,i)}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}floorToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this.z=this.z<0?Math.floor(this.z):Math.ceil(this.z),this}roundToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this.z=this.z<0?Math.floor(this.z):Math.ceil(this.z),this}toString(){return`{x: ${this.x}, y: ${this.y}}`}}class Gi{constructor(){d(this,"isMatrix3",!0),d(this,"elements",[1,0,0,0,1,0,0,0,1])}static equals(t,e,i=1e-6){if(t.elements.length!=e.elements.length)return!1;for(let n=0,s=t.elements.length;n<s;n++){const s=t.elements[n]-e.elements[n];if(Math.abs(s)>i)return!1}return!0}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}clone(){return(new Gi).fromArray(this.elements)}compose(t,e,i){const n=Math.sin(e.x),s=Math.cos(e.x);return this.set(i.x*s,i.y*n*-1,t.x,i.x*n,i.y*s,t.y,0,0,1)}composeWithCenter(t,e,i,n){return Qi.identity(),Ki.makeTranslation(t.x,t.y),tn.makeRotation(e.x),en.makeScale(i.x,i.y),$i.copy(n).applyMatrix3(en),Qi.multiply(nn.makeTranslation(-$i.x,-$i.y)).multiply(Ki).multiply(nn.makeTranslation($i.x,$i.y)).multiply(tn).multiply(nn.makeTranslation(-$i.x,-$i.y)).multiply(en),this.copy(Qi)}decompose(t,e,i){const n=Qi.copy(this).elements,s=Math.sqrt(n[0]*n[0]+n[3]*n[3]),r=Math.sqrt(n[1]*n[1]+n[4]*n[4]),a=n[0]*n[4]-n[3]*n[1];n[0]||n[3]?i.set(s,a/s):n[1]||n[4]?i.set(a/r,r):i.set(0,0);let o=0;o=n[0]||n[3]?n[3]>0?-Math.acos(n[0]/s):Math.acos(n[0]/s):n[1]||n[4]?Math.PI/2-(n[4]>0?Math.acos(-n[1]/r):-Math.acos(n[1]/r)):0,0!==o&&i.y<0&&(o*=-1),e.set(o,o),t.set(n[6],n[7])}compose2(t,e,i){return this.identity().translate(t.x,t.y).rotate(e.x).scale(i.x,i.y),this}decompose2(t,e,i){const n=this.clone();n.scale(-1,1);const s=n.elements[0],r=n.elements[1],a=n.elements[3],o=n.elements[4];let h=0,l=0,u=0;if(0!==s||0!==a){const t=Math.hypot(s,a);h=t,l=(s*o-r*a)/t;const e=Math.acos(s/t);u=a>0?-e:e}else if(0!==r||0!==o){const t=Math.hypot(r,o);h=(s*o-r*a)/t,l=t;const e=Math.acos(r/t);u=Math.PI/2+(o>0?-e:e)}else h=0,l=0,u=0;h=-h,t.x=n.elements[6],t.y=n.elements[7],e.x=e.y=u/Math.PI/180,i.x=h,i.y=l}composeSvgTransform(t=0,e=0,i,n=!1){if(!i&&!t&&!e)return this;this.identity(),Qi.identity();let s=i.split(") ").map((t=>t.trim()+")")).filter((t=>")"!==t));return s||(s=[]),(t||e)&&s.push(`translate(${t},${e})`),s.forEach((t=>{const e=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(t),i=/rotate\(\s*(-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+))?)?\s*\)/.exec(t),n=/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(t);if(e){const t=Number(e[1])||1,i=Number(e[2])||t;Qi.multiply(en.makeScale(t,i))}else if(i){const t=Bi(Number(i[1])||0);Number(i[2])||Number(i[3])?(Zi.set(Number(i[2]||"0"),Number(i[3]||"0")),Qi.multiply(tn.makeRotationByPoint(t,Zi))):Qi.multiply(tn.makeRotation(t))}else n&&Qi.multiply(Ki.makeTranslation(Number(n[1])||0,Number(n[2])||0))})),this.copy(Qi),n&&this.premultiply(en.makeScale(1,-1)),this}decomposeSvgMatrix(t,e,i){const n=Qi.copy(this).elements;Zi.set(n[0],n[1]),$i.set(n[3],n[4]);let s=Zi.length();Zi.normalize();let r=Zi.dot($i);Ji.copy(Zi).multiplyScalar(-r),$i.add(Ji);const a=$i.length()||0;$i.normalize(),Zi.x*$i.y<$i.x*Zi.y&&(Zi.x=-Zi.x,Zi.y=-Zi.y,s=-s,r=-r);const o=s?Math.atan2(Zi.y,Zi.x):Math.atan2(-Zi.x,$i.y);t.set(n[6],n[7]),e.set(o,o),i.set(s,a)}determinant(){const t=this.elements,e=t[0],i=t[3],n=t[6],s=t[1],r=t[4],a=t[7],o=t[2],h=t[5],l=t[8];return e*r*l-e*h*a-s*i*l+s*h*n+o*i*a-o*r*n}equals(t,e=0){const i=this.elements,n=t.elements;for(let t=0;t<9;t++)if(Math.abs(i[t]-n[t])>e)return!1;return!0}extractBasis2(t,e){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),this}flipY(){return this.premultiply(en.makeScale(1,-1))}flipSvgY(){return this.elements[1]*=-1,this.elements[3]*=-1,this.elements[7]*=-1,this}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}getComponents(t=[1,0,0,1,0,0]){return t[0]=this.elements[0],t[1]=this.elements[1],t[2]=this.elements[3],t[3]=this.elements[4],t[4]=this.elements[6],t[5]=this.elements[7],t}fromComponents(t){return this}getNormalMatrix(t){return this.setFromMatrix(t).invert().transpose()}getRotation(t){let e=this.elements;const i=Math.sqrt(e[0]*e[0]+e[3]*e[3]),n=Math.sqrt(e[1]*e[1]+e[4]*e[4]);let s=0;s=e[0]||e[3]?e[3]>0?-Math.acos(e[0]/i):Math.acos(e[0]/i):e[1]||e[4]?Math.PI/2-(e[4]>0?Math.acos(-e[1]/n):-Math.acos(e[1]/n)):0,this.getScale($i),0!==s&&$i.x<0&&(s*=-1),t.set(s,s)}getScale(t){let e=this.elements,i=Math.sqrt(e[0]*e[0]+e[1]*e[1]),n=Math.sqrt(e[3]*e[3]+e[4]*e[4]),s=e[0]*e[4]-e[3]*e[1];e[0]||e[1]?t.set(s/n,n):e[3]||e[4]?t.set(i,s/i):t.set(0,0)}getTransition(t){t.set(this.elements[6],this.elements[7])}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}hasChange(){for(let t=0,e=this.elements.length;t<e;t++)if(Math.abs(this.elements[t]-Xi[t])>Number.EPSILON)return!0;return!1}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*r-a*h,c=a*o-l*s,d=h*s-r*o,p=e*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=u*f,t[1]=(n*h-l*i)*f,t[2]=(a*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(n*s-a*e)*f,t[6]=d*f,t[7]=(i*o-h*e)*f,t[8]=(r*e-i*s)*f,this}lookAt(t,e,i){return this.identity().rotate(e.angle()-t.angle()+i.angle())}makeProjection(t,e,i,n,s,r){const a=s/(e-t),o=r/(i-n),h=s/2-(e+t)*a,l=r/2+(i+n)*o;return this.elements[0]=a,this.elements[3]=0,this.elements[6]=h,this.elements[1]=0,this.elements[4]=-o,this.elements[7]=l,this.elements[2]=0,this.elements[5]=0,this.elements[8]=1,this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeRotationByPoint(t,e){const i=Math.cos(t),n=Math.sin(t),s=-e.x*i+e.y*n+e.x,r=-e.x*n-e.y*i+e.y;return this.set(i,-n,s,n,i,r,0,0,1),this}makeRotationFromQuaternion(t){return this.compose(sn,t,rn)}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}multiply(t){return this.multiplyMatrices(this,t)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,s=this.elements,r=i[0],a=i[3],o=i[6],h=i[1],l=i[4],u=i[7],c=i[2],d=i[5],p=i[8],f=n[0],m=n[3],y=n[6],g=n[1],v=n[4],x=n[7],b=n[2],_=n[5],w=n[8];return s[0]=r*f+a*g+o*b,s[3]=r*m+a*v+o*_,s[6]=r*y+a*x+o*w,s[1]=h*f+l*g+u*b,s[4]=h*m+l*v+u*_,s[7]=h*y+l*x+u*w,s[2]=c*f+d*g+p*b,s[5]=c*m+d*v+p*_,s[8]=c*y+d*x+p*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}premultiply(t){return this.multiplyMatrices(t,this)}rotate(t){return this.premultiply(tn.makeRotation(-t))}scale(t,e){return this.premultiply(en.makeScale(t,e))}set(t,e,i,n,s,r,a,o,h){return this.elements[0]=t,this.elements[3]=e,this.elements[6]=i,this.elements[1]=n,this.elements[4]=s,this.elements[7]=r,this.elements[2]=a,this.elements[5]=o,this.elements[8]=h,this}setFromDomMatrix(t){return void 0!==t.m11&&void 0!==t.m21&&void 0!==t.m41&&void 0!==t.m12&&void 0!==t.m22&&void 0!==t.m42&&void 0!==t.m14&&void 0!==t.m24&&void 0!==t.m44?this.set(t.m11,t.m21,t.m41,t.m12,t.m22,t.m42,t.m14,t.m24,t.m44):void 0!==t.a&&void 0!==t.b&&void 0!==t.c&&void 0!==t.d&&void 0!==t.e&&void 0!==t.f&&this.set(t.a,t.c,t.e,t.b,t.d,t.f,0,0,1),this}setFromMatrix(t){const e=t.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this}setUvTransform(t,e,i,n,s,r,a){const o=Math.cos(s),h=Math.sin(s);return this.set(i*o,i*h,-i*(o*r+h*a)+r+t,-n*h,n*o,-n*(-h*r+o*a)+a+e,0,0,1),this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}toString(){return`[${this.elements[0]},${this.elements[1]}, ${this.elements[3]},${this.elements[4]}, ${this.elements[6]},${this.elements[7]}]`}translate(t,e){return this.premultiply(Ki.makeTranslation(t,e))}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}getTransformScaleX(){return Math.sqrt(this.elements[0]*this.elements[0]+this.elements[1]*this.elements[1])}getTransformScaleY(){return Math.sqrt(this.elements[3]*this.elements[3]+this.elements[4]*this.elements[4])}isTransformSkewed(){const t=this.elements[0]*this.elements[3]+this.elements[1]*this.elements[4];return 0!==t&&Math.abs(t/(this.getTransformScaleX()*this.getTransformScaleY()))>Number.EPSILON}isTransformFlipped(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]<0}hasMirror(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]<0}hasMirrorY(){return this.elements[0]<0&&this.elements[4]>0}hasMirrorX(){return this.elements[4]<0&&this.elements[0]>0}}const Xi=[1,0,0,0,1,0,0,0,1],Zi=new Oi,$i=new Oi,Ji=new Oi,Qi=new Gi,Ki=new Gi,tn=new Gi,en=new Gi,nn=new Gi,sn=new Oi(0,0,0),rn=new Oi(1,1,1),an=["view"],on=["viewer","mirror"];let hn=0;function ln(t,e=0,i=0,n=[]){var s,r;if(!t)return n;const a=function(t,e,i){if(!t)return i;let n=i;return"function"==typeof t.getAttribute?n=null==t?void 0:t.getAttribute(e):Object.hasOwnProperty.call(t,"attributes")&&(n=t.attributes[e]),n||i}(t,"id","");if(an.includes(t.nodeName)||"defs"===t.nodeName)return hn--,n;if(e&&hn>e)return n;let o;a&&!on.includes(a)&&(o={label:a,value:a,children:[]},n.push(o)),hn++;for(let i=0,r=null==(s=t.childNodes)?void 0:s.length;i<r;i++)ln(t.childNodes[i],e,hn,o?o.children:n);return 0===(null==(r=null==o?void 0:o.children)?void 0:r.length)&&delete o.children,hn=i,n}function un(t,e){var i;if(Array.isArray(t))for(let i=0,n=t.length||0;i<n;i++)un(t[i],e);else if(e(t),null==(i=t.children)?void 0:i.length)for(let i=0,n=t.children.length;i<n;i++)un(t.children[i],e)}function cn(t){var e,i,n;const s=[];if(!(null==(e=null==t?void 0:t.children)?void 0:e.length))return s;for(let e,r=0,a=(null==(i=null==t?void 0:t.children)?void 0:i.length)||0;r<a;r++)e=t.children[r],s.push(e),(null==(n=e.children)?void 0:n.length)&&s.push(...cn(e));return s}var dn=(t=>(t.GROS="gros",t.RM="rm",t.WS="ws",t.SU="su",t.EQ="eq",t.FN="fn",t.GL="gl",t.IP="ip",t))(dn||{});const pn="dummy";var fn=(t=>(t.BACKGROUND="background",t.BACKGROUND_LABELS="background-labels",t.ASSETS="assets",t.ANNOTATIONS="annotations",t.TEXT="text",t.ASSET_LABELS="asset-labels",t.LABELS="labels",t))(fn||{});class mn extends ji{constructor(t=void 0){super(t),d(this,"viewportElement"),d(this,"instancedMesh",!1),d(this,"dpr",1)}setRequestHeader(t){return this.requestHeader=t,this}setInstancedMesh(t=!1){return this.instancedMesh=t,this}setPixelRatio(t){return this.dpr=t,this}parse(t,e=!0){const i=this;function n(t,e,i,n,r,a,o,h){var l;if(0==e||0==i)return void t.lineTo(h.x,h.y);n=n*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const u=(o.x-h.x)/2,c=(o.y-h.y)/2,d=Math.cos(n)*u+Math.sin(n)*c,p=-Math.sin(n)*u+Math.cos(n)*c;let f=e*e,m=i*i;const y=d*d,g=p*p,v=y/f+g/m;if(v>1){const t=Math.sqrt(v);f=(e*=t)*e,m=(i*=t)*i}const x=f*g+m*y,b=(f*m-x)/x;let _=Math.sqrt(Math.max(0,b));r===a&&(_=-_);const w=_*e*p/i,S=-_*i*d/e,M=Math.cos(n)*w-Math.sin(n)*S+(o.x+h.x)/2,E=Math.sin(n)*w+Math.cos(n)*S+(o.y+h.y)/2,A=s(1,0,(d-w)/e,(p-S)/i),T=s((d-w)/e,(p-S)/i,(-d-w)/e,(-p-S)/i)%(2*Math.PI);null==(l=t.currentPath)||l.absellipse(M,E,e,i,A,A+T,0===a,n)}function s(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}function r(t,e){var i;e=Object.assign({},e);let n={};if(t.hasAttribute("class")){const e=null==(i=t.getAttribute("class"))?void 0:i.split(/\s/).filter(Boolean).map((t=>t.trim()));for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++)n=Object.assign(n,I["."+e[t]])}function s(i,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(i)&&(e[s]=r(t.getAttribute(i))),n[i]&&(e[s]=r(n[i])),t.style&&""!==t.style[i]&&(e[s]=r(t.style[i]))}t.hasAttribute("id")&&(n=Object.assign(n,I["#"+t.getAttribute("id")]));const{fontSize:r,strokeWidth:a}=e;function o(t){return Math.max(0,Math.min(1,c(t)))}function h(t){return Math.max(0,c(t,{fontSize:r}))}s("font-size","fontSize",h),s("fill","fill"),s("fill-opacity","fillOpacity",o),s("fill-rule","fillRule"),s("opacity","opacity",o),s("stroke","stroke"),s("stroke-opacity","strokeOpacity",o),s("stroke-width","strokeWidth",(function(t){return Math.max(0,c(t,{}))})),s("stroke-linejoin","strokeLineJoin"),s("stroke-linecap","strokeLineCap"),s("stroke-miterlimit","strokeMiterLimit",h),s("visibility","visibility");const l=t.getAttribute("stroke-width")||e.strokeWidth;return mi.endsWith(l,"%")&&(e.thinLine=!0),e}function a(t,e){return t-(e-t)}function o(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%(i||0))&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}const h=["mm","cm","in","pt","pc","px","em","%"],l={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1},"%":{"%":1,px:-1}};function c(t,e){let n,s="px";if("string"==typeof t||t instanceof String){t=null==t?void 0:t.trim();for(let e=0,i=h.length;e<i;e++){const i=h[e];if(t.endsWith(i)){s=i,t=t.substring(0,t.length-i.length);break}}}if("px"===s&&"px"!==i.defaultUnit)n=l.in[i.defaultUnit]/i.defaultDPI;else if("%"===s){W.getSize(vn),gn.copy(L).getScale(xn);const t=Math.abs(xn.x||1);n=vn.x/100*t}else"em"===s?n=(null==e?void 0:e.fontSize)||V:(n=l[s][i.defaultUnit],n<0&&(n=l[s].in*i.defaultDPI));return n*parseFloat(t)}function d(t){const e=t.elements;return e[0]*e[4]-e[1]*e[3]<0}function p(t){const e=t.elements,i=e[0]*e[3]+e[1]*e[4];if(0===i)return!1;const n=f(t),s=m(t);return Math.abs(i/(n*s))>Number.EPSILON}function f(t){const e=t.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function m(t){const e=t.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}function y(t){return Math.round(t*H*100)/100}function g(t){return Math.round(t*H*100)/100}function v(t){return Math.round(t*H*100)/100}function _(t){return Math.round(t*H*100)/100}function w(t,e="asset"){let i;const n="function"==typeof t.getAttribute?t.getAttribute("id"):"";if(!n&&t.parentNode)return w(t.parentNode,e);if(!n)return i;if("layer"===e)i=Q.find((t=>n===t));else{const t=null==n?void 0:n.replace(/-assets/g,"");i=J.find((e=>t===e))}return!i&&t.parentNode&&(i=w(t.parentNode,e)),i}function S(t){let e;const i="function"==typeof t.getAttribute?t.getAttribute("id"):"";return e=!i&&t.parentNode?S(t.parentNode):i,e}function M(t,e){let i;const n=S(t);return i=t.parentNode&&S(t.parentNode),i&&n!==e||(i=M(t.parentNode,e)),i||n||""}function E(t){let e;return S(t),e="function"==typeof t.getAttribute?t.getAttribute("aid"):"",!e&&t.parentNode&&(e=E(t.parentNode)),e}const A=[],T=[],I={},C=[],D=new b,N=new b,B=new b,k=new b,O=new x,P=new R,L=new b,z={},U={},F=[],W=new Ri,q=new Oi,H=1,V=16,j=(new DOMParser).parseFromString(t,"image/svg+xml");i.viewportElement=j.documentElement,function(t,e=new Ri){if(!t)return e;let i=t.split(" "),n=mi.map(i,(t=>parseFloat(t)));4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3]))}(i.viewportElement.getAttribute("viewBox")||"",W);const Y=j.getElementsByTagName("view"),G=(null==Y?void 0:Y.length)?Y[0]:null,X=(null==G?void 0:G.getAttribute("units"))||"";W.getCenter(q);const Z=ln(j.documentElement);let $=[];un(Z||[],(t=>{var e;if("assets"===t.label&&(null==(e=t.children)?void 0:e.length))for(let e,i=0,n=t.children.length;i<n;i++)e=t.children[i],e.label&&$.push(mi.head(mi.split(e.label,"-"))||"")})),$=mi.uniq(mi.compact($));const J=mi.uniq(mi.compact([...$,...Object.values(dn)])),Q=Object.values(fn);!function t(e,i,s,h=!1){var l;if(1!==e.nodeType)return;const x=function(t,e){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))||"text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))))return null;const i=function(t,e){var i;const n=new b,s=D;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){let e=c(t.getAttribute("x")),i=c(t.getAttribute("y"));n.translate(e,i)}else if("text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))){let i=0,s=0;i=t.hasAttribute("dx")?c(t.getAttribute("dx")||0,{fontSize:null==e?void 0:e.fontSize}):0,s=t.hasAttribute("dy")?c(t.getAttribute("dy")||0,{fontSize:null==e?void 0:e.fontSize}):0,n.translate(i,s)}if(t.hasAttribute("transform")){const e=null==(i=t.getAttribute("transform"))?void 0:i.split(")");for(let t=((null==e?void 0:e.length)||0)-1;t>=0;t--){const i=e[t].trim();if(""===i)continue;const r=i.indexOf("("),a=i.length;if(r>0&&r<a){const t=i.slice(0,r),e=o(i.slice(r+1));switch(s.identity(),t){case"translate":if(e.length>=1){const t=e[0];let i=0;e.length>=2&&(i=e[1]),s.translate(t,i)}break;case"rotate":if(e.length>=1){let t=0,i=0,n=0;t=e[0]*Math.PI/180,e.length>=3&&(i=e[1],n=e[2]),N.makeTranslation(-i,-n),B.makeRotation(t),k.multiplyMatrices(B,N),N.makeTranslation(i,n),s.multiplyMatrices(N,k)}break;case"scale":if(e.length>=1){const t=e[0];let i=t;e.length>=2&&(i=e[1]),s.scale(t,i)}break;case"skewX":1===e.length&&s.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&s.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&s.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}n.premultiply(s)}}return n}(t,e);return C.length>0&&i.premultiply(C[C.length-1]),L.copy(i),C.push(i),i}(e,i);let R=!1,z=null,F=[];const W="function"==typeof e.getAttribute?e.getAttribute("id"):null;switch(e.nodeName){case"svg":case"g":i=r(e,i);break;case"style":!function(t){const e=t.textContent,i=null==e?void 0:e.replace(/\/\*[\s\S]*?\*\//g,""),n=null==i?void 0:i.replace(/([^;])}/g,"$1;}");if(!n)return;const s=[];let r="",a=0;for(const t of n)"{"===t?a++:"}"===t&&a--,r+=t,"}"===t&&0===a&&(s.push(r.trim()),r="");for(const t of s){if(!t.includes("{"))continue;const[e,i]=t.split(/\s*\{\s*/);if(!e||!i)continue;const n=e.split(",").map((t=>t.trim())).filter(Boolean),s={};i.replace(/}\s*$/,"").split(";").map((t=>t.trim())).filter(Boolean).forEach((t=>{const[e,i]=t.split(/:\s*/);if(e&&i){const t=i.replace(/\s*!important\s*$/,"").trim();s[e.trim()]=t}})),n.forEach((t=>{t&&(I[t]=u(u({},I[t]||{}),s))}))}}(e);break;case"path":i=r(e,i),e.hasAttribute("d")&&(z=function(t,e=!1){const i=new ii,s=new Oi,r=new Oi,h=new Oi;let l=!0,u=!1;const c=t.getAttribute("d");if(!c||""===c||"none"===c)return null;const d=c.match(/[a-df-z][^a-df-z]*/gi);if(!(null==d?void 0:d.length))return null;for(let t=0,c=(null==d?void 0:d.length)||0;t<c;t++){const c=d[t],p=c.charAt(0),f=c.slice(1).trim();let m;switch(!0===l&&(u=!0,l=!1),p){case"M":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x=e?m[t]:y(m[t]),s.y=e?m[t+1]:g(m[t+1]),r.x=s.x,r.y=s.y,0===t?i.moveTo(s.x,s.y):i.lineTo(s.x,s.y),0===t&&h.copy(s);break;case"H":m=o(f);for(let t=0,n=m.length;t<n;t++)s.x=e?m[t]:y(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"V":m=o(f);for(let t=0,n=m.length;t<n;t++)s.y=e?m[t]:g(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"L":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x=e?m[t]:y(m[t]),s.y=e?m[t+1]:g(m[t+1]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"C":m=o(f);for(let t,n=0,a=m.length;n<a;n+=6)t=e?[m[n],m[n+1],m[n+2],m[n+3],m[n+4],m[n+5]]:[y(m[n]),g(m[n+1]),y(m[n+2]),g(m[n+3]),y(m[n+4]),g(m[n+5])],i.bezierCurveTo(...t),r.x=t[2],r.y=t[3],s.x=t[4],s.y=t[5],0===n&&!0===u&&h.copy(s);break;case"S":m=o(f);for(let t,n=0,o=m.length;n<o;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[y(m[n]),g(m[n+1]),y(m[n+2]),g(m[n+3])],i.bezierCurveTo(a(s.x,r.x),a(s.y,r.y),t[0],t[1],t[2],t[3]),r.x=t[0],r.y=t[1],s.x=t[2],s.y=t[3],0===n&&!0===u&&h.copy(s);break;case"Q":m=o(f);for(let t,n=0,a=m.length;n<a;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[y(m[n]),g(m[n+1]),y(m[n+2]),g(m[n+3])],i.quadraticCurveTo(t[0],t[1],t[2],t[3]),r.x=t[0],r.y=t[1],s.x=t[2],s.y=t[3],0===n&&!0===u&&h.copy(s);break;case"T":m=o(f);for(let t,n=0,o=m.length;n<o;n+=2){const o=a(s.x,r.x),l=a(s.y,r.y);t=e?[m[n],m[n+1]]:[y(m[n]),g(m[n+1])],i.quadraticCurveTo(o,l,t[0],t[1]),r.x=o,r.y=l,s.x=t[0],s.y=t[1],0===n&&!0===u&&h.copy(s)}break;case"A":m=o(f,[3,4],7);for(let t,a=0,o=m.length;a<o;a+=7){if(t=e?[m[a],m[a+1],m[a+2],m[a+3],m[a+4],m[a+5],m[a+6]]:[y(m[a]),g(m[a+1]),m[a+2],m[a+3],m[a+4],v(m[a+5]),_(m[a+6])],t[5]==s.x&&t[6]==s.y)continue;const o=s.clone();s.x=t[5],s.y=t[6],r.x=s.x,r.y=s.y,n(i,t[a],t[1],t[2],t[3],t[4],o,s),0===a&&!0===u&&h.copy(s)}break;case"m":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x+=e?m[t]:v(m[t]),s.y+=e?m[t+1]:_(m[t+1]),r.x=s.x,r.y=s.y,0===t?i.moveTo(s.x,s.y):i.lineTo(s.x,s.y),0===t&&h.copy(s);break;case"h":m=o(f);for(let t=0,n=m.length;t<n;t++)s.x+=e?m[t]:v(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"v":m=o(f);for(let t=0,n=m.length;t<n;t++)s.y+=e?m[t]:_(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"l":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x+=e?m[t]:v(m[t]),s.y+=e?m[t+1]:_(m[t+1]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"c":m=o(f);for(let t,n=0,a=m.length;n<a;n+=6)t=e?[m[n],m[n+1],m[n+2],m[n+3],m[n+4],m[n+5]]:[v(m[n]),_(m[n+1]),v(m[n+2]),_(m[n+3]),v(m[n+4]),_(m[n+5])],i.bezierCurveTo(s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3],s.x+t[4],s.y+t[5]),r.x=s.x+t[2],r.y=s.y+t[3],s.x+=t[4],s.y+=t[5],0===n&&!0===u&&h.copy(s);break;case"s":m=o(f);for(let t,n=0,o=m.length;n<o;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[v(m[n]),_(m[n+1]),v(m[n+2]),_(m[n+3])],i.bezierCurveTo(a(s.x,r.x),a(s.y,r.y),s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3]),r.x=s.x+t[0],r.y=s.y+t[1],s.x+=t[2],s.y+=t[3],0===n&&!0===u&&h.copy(s);break;case"q":m=o(f);for(let t,n=0,a=m.length;n<a;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[v(m[n]),_(m[n+1]),v(m[n+2]),_(m[n+3])],i.quadraticCurveTo(s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3]),r.x=s.x+t[0],r.y=s.y+t[1],s.x+=t[2],s.y+=t[3],0===n&&!0===u&&h.copy(s);break;case"t":m=o(f);for(let t,n=0,o=m.length;n<o;n+=2){const o=a(s.x,r.x),l=a(s.y,r.y);t=e?[m[n],m[n+1]]:[v(m[n]),_(m[n+1])],i.quadraticCurveTo(o,l,s.x+t[0],s.y+t[1]),r.x=o,r.y=l,s.x=s.x+t[0],s.y=s.y+t[1],0===n&&!0===u&&h.copy(s)}break;case"a":m=o(f,[3,4],7);for(let t,a=0,o=m.length;a<o;a+=7){if(t=e?[m[a],m[a+1],m[a+2],m[a+3],m[a+4],m[a+5],m[a+6]]:[v(m[a]),_(m[a+1]),m[a+2],m[a+3],m[a+4],v(m[a+5]),_(m[a+6])],0==t[5]&&0==t[6])continue;const o=s.clone();s.x+=t[5],s.y+=t[6],r.x=s.x,r.y=s.y,n(i,t[0],t[1],t[2],t[3],t[4],o,s),0===a&&!0===u&&h.copy(s)}break;case"Z":case"z":i.currentPath.autoClose=!0,i.currentPath.curves.length>0&&(s.copy(h),i.currentPath.currentPoint.copy(s),l=!0)}u=!1}return i}(e,h));break;case"rect":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("x")||0),n=c(t.getAttribute("y")||0),s=c(t.getAttribute("rx")||t.getAttribute("ry")||0),r=c(t.getAttribute("ry")||t.getAttribute("rx")||0),a=c(t.getAttribute("width")),o=c(t.getAttribute("height"));e||(i=y(i),n=g(n),s=v(s),r=_(r),a=v(a),o=_(o));const h=.448084975506,l=new ii;return l.moveTo(i+s,n),l.lineTo(i+a-s,n),(0!==s||0!==r)&&l.bezierCurveTo(i+a-s*h,n,i+a,n+r*h,i+a,n+r),l.lineTo(i+a,n+o-r),(0!==s||0!==r)&&l.bezierCurveTo(i+a,n+o-r*h,i+a-s*h,n+o,i+a-s,n+o),l.lineTo(i+s,n+o),(0!==s||0!==r)&&l.bezierCurveTo(i+s*h,n+o,i,n+o-r*h,i,n+o-r),l.lineTo(i,n+r),(0!==s||0!==r)&&l.bezierCurveTo(i,n+r*h,i+s*h,n,i+s,n),l}(e,h);break;case"polygon":i=r(e,i),z=function(t,e=!1){var i;function n(t,i,n){const s=e?c(i):y(c(i)),o=e?c(n):g(c(n));return 0===a?r.moveTo(s,o):r.lineTo(s,o),a++,t}const s=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new ii;let a=0;return null==(i=t.getAttribute("points"))||i.replace(s,n),r.currentPath.autoClose=!0,r}(e,h);break;case"polyline":i=r(e,i),z=function(t,e=!1){var i;function n(t,i,n){const s=e?c(i):y(c(i)),o=e?c(n):g(c(n));return 0===a?r.moveTo(s,o):r.lineTo(s,o),a++,t}const s=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new ii;let a=0;return null==(i=t.getAttribute("points"))||i.replace(s,n),r.currentPath.autoClose=!1,r}(e,h);break;case"circle":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("cx")||0),n=c(t.getAttribute("cy")||0),s=c(t.getAttribute("r")||0);e||(i=y(i),n=g(n),s=v(s));const r=new ye;r.absarc(i,n,s,0,2*Math.PI);const a=new ii;return a.subPaths.push(r),a}(e,h);break;case"ellipse":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("cx")||0),n=c(t.getAttribute("cy")||0),s=c(t.getAttribute("rx")||0),r=c(t.getAttribute("ry")||0);e||(i=y(i),n=g(n),s=v(s),r=_(r));const a=new ye;a.absellipse(i,n,s,r,0,2*Math.PI);const o=new ii;return o.subPaths.push(a),o}(e,h);break;case"line":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("x1")||0),n=c(t.getAttribute("y1")||0),s=c(t.getAttribute("x2")||0),r=c(t.getAttribute("y2")||0);e||(i=y(i),n=g(n),s=y(s),r=g(r));const a=new ii;return a.moveTo(i,n),a.lineTo(s,r),a.currentPath.autoClose=!1,a}(e,h);break;case"defs":R=!0;break;case"use":const l=(e.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),d=U[l];d&&(i=r(e,i),void 0===(i=r(d,i)).assetType&&(i.assetType=w(e)),void 0===i.layerType&&(i.layerType=w(e,"layer")),t(d,i,W||s,h));break;case"text":i=r(e,i),z=function(t,e){parseFloat(t.getAttribute("x")||"0"),parseFloat(t.getAttribute("y")||"0");const i=t.textContent;if(!i||!e.fontSize)return;const n=Object.assign({},e);return n.fill=t.getAttribute("fill")||e.fill||"#000",n.fontSize=parseFloat(t.getAttribute("font-size")||e.fontSize||"72"),n.fontFamily=t.getAttribute("font-family")||e.fontFamily||"Arial",{type:"text",textContent:i,style:n,color:new Rt,subPaths:[],userData:{}}}(e,i)}if(z){void 0!==i.fill&&"transparent"===i.fill||void 0!==i.fill&&"none"!==i.fill&&z.color.setStyle(i.fill,yn);const t=i.assetType||w(e),n=i.layerType||w(e,"layer");if(z.userData={pid:s,id:W||s,nodeName:e.nodeName,layerType:n,assetType:t,style:i},"text"===e.nodeName){s||mi.set(z,"userData.pid",S(e)),z.userData.textContent=e.textContent,z.transform=mi.cloneDeep(L),z.userData.id=mi.get(z,"userData.pid"),mi.set(z,"userData.pid",M(e,s));const t=E(e);t?mi.set(z,"userData.aid",t):mi.set(z,"userData.aid",mi.split(null==(l=z.userData)?void 0:l.id,"-").splice(2).join("-")),A.find((t=>t.userData.id===z.userData.aid))}else!function(t,e){function i(t){P.set(t.x,t.y,1).applyMatrix3(e),t.set(P.x,P.y)}function n(t){const i=t.xRadius,n=t.yRadius,s=Math.cos(t.aRotation),r=Math.sin(t.aRotation),a=new Yi(i*s,i*r,0),o=new Yi(-n*r,n*s,0),h=a.applyMatrix3(e),l=o.applyMatrix3(e),u=D.set(h.x,l.x,0,h.y,l.y,0,0,0,1),c=N.copy(u).invert(),p=B.copy(c).transpose().multiply(c).elements,f=function(t,e,i){let n,s,r,a,o;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(n=.5*(h+u),o=1/n,s=t*o*i-e*o*e):h<0?s=.5*(h-u):(n=.5*u,s=-.5*u),r=l>0?l+u:l-u,Math.abs(r)>2*Math.abs(e)?(o=-2*e/r,a=1/Math.sqrt(1+o*o),r=o*a):0===Math.abs(e)?(r=1,a=0):(o=-.5*r/e,r=1/Math.sqrt(1+o*o),a=o*r),l>0&&(o=r,r=-a,a=o),{rt1:n,rt2:s,cs:r,sn:a}}(p[0],p[1],p[4]),m=Math.sqrt(f.rt1),y=Math.sqrt(f.rt2);if(t.xRadius=1/m,t.yRadius=1/y,t.aRotation=Math.atan2(f.sn,f.cs),!((t.aEndAngle-t.aStartAngle)%(2*Math.PI)<Number.EPSILON)){const i=N.set(m,0,0,0,y,0,0,0,1),n=B.set(f.cs,f.sn,0,-f.sn,f.cs,0,0,0,1),s=i.multiply(n).multiply(u),r=t=>{const{x:e,y:i}=new Yi(Math.cos(t),Math.sin(t),0).applyMatrix3(s);return Math.atan2(i,e)};t.aStartAngle=r(t.aStartAngle),t.aEndAngle=r(t.aEndAngle),d(e)&&(t.aClockwise=!t.aClockwise)}}function s(t){const i=f(e),n=m(e);t.xRadius*=i,t.yRadius*=n;const s=i>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);t.aRotation+=s,d(e)&&(t.aStartAngle*=-1,t.aEndAngle*=-1,t.aClockwise=!t.aClockwise)}const r=t.subPaths;for(let t=0,a=(null==r?void 0:r.length)||0;t<a;t++){const a=r[t].curves;for(let t=0;t<a.length;t++){const r=a[t];r.isLineCurve?(i(r.v1),i(r.v2)):r.isCubicBezierCurve?(i(r.v0),i(r.v1),i(r.v2),i(r.v3)):r.isQuadraticBezierCurve?(i(r.v0),i(r.v1),i(r.v2)):r.isEllipseCurve&&(O.set(r.aX,r.aY),i(O),r.aX=O.x,r.aY=O.y,p(e)?n(r):s(r))}}}(z,L);"text"!==e.nodeName?A.push(z):"text"===e.nodeName&&T.push(z)}const q=e.childNodes,H="symbol"===e.nodeName?s:W;for(let e=0,n=(null==q?void 0:q.length)||0;e<n;e++){const n=q[e];if(R){const t="function"==typeof n.getAttribute?n.getAttribute("id"):null;"symbol"===n.nodeName&&t&&(U[t]=n)}if(R&&"style"!==n.nodeName&&"defs"!==n.nodeName)continue;let s=t(n,i,H,h);s&&F.push(s)}return x&&(C.pop(),C.length>0?L.copy(C[C.length-1]):L.identity()),z||((null==F?void 0:F.length)?F:void 0)}(j.documentElement,{fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4,fontSize:V});for(let t in z)z[t].len=mi.sumBy(F,(e=>e.symbolId===t?1:0));return F.forEach((t=>{var e;return t.len=null==(e=z[t.symbolId])?void 0:e.len})),{xml:j.documentElement,viewBox:W,paths:A,labels:T,idsTree:Z,assetTypes:$,symbolsMap:z,uses:F,units:X}}}const yn=n,gn=new Gi;new b,new class extends rt{constructor(t=1,e=0,i=0,n=0,s=0,r=1,a=0,o=0,h=0,l=0,u=1,c=0,d=0,p=0,f=0,m=1){super(t,e,i,n,s,r,a,o,h,l,u,c,d,p,f,m)}setByMatrix3(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[4]=i[3],e[8]=0,e[12]=i[6],e[1]=i[1],e[5]=i[4],e[9]=0,e[13]=i[7],e[2]=0,e[6]=0,e[10]=1,e[14]=0,e[3]=0,e[7]=0,e[11]=0,e[15]=1,this}getMatrix3Array(t=[]){const e=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[4],t[4]=e[5],t[5]=0,t[6]=e[12],t[7]=e[13],t[8]=1,t}};const vn=new Oi,xn=new x;new Yi,new Yi,new Yi,new Yi;const bn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],_n=()=>{const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(bn[255&t]+bn[t>>8&255]+bn[t>>16&255]+bn[t>>24&255]+"-"+bn[255&e]+bn[e>>8&255]+"-"+bn[e>>16&15|64]+bn[e>>24&255]+"-"+bn[63&i|128]+bn[i>>8&255]+"-"+bn[i>>16&255]+bn[i>>24&255]+bn[255&n]+bn[n>>8&255]+bn[n>>16&255]+bn[n>>24&255]).toLowerCase()};class wn extends hi{constructor(t={}){super(),d(this,"isObject2",!0),d(this,"id",Sn++),d(this,"uuid",_n()),d(this,"name"),d(this,"type","Object2"),d(this,"featureKey","Object2_"+this.id),d(this,"parent"),d(this,"children",[]),d(this,"up",new Oi(0,1)),d(this,"position",new Oi),d(this,"rotation",new Oi),d(this,"scaled",new Oi(1,1)),d(this,"flipY",!1),d(this,"selectable",!1),d(this,"matrix",new Gi),d(this,"matrixWorld",new Gi),d(this,"matrixWorldInverse",new Gi),d(this,"modelViewMatrix",new Gi),d(this,"normalMatrix",new Gi),d(this,"fixed",!1),d(this,"dynamically",!1),d(this,"matrixAutoUpdate",!1),d(this,"matrixWorldNeedsUpdate",!1),d(this,"matrixWorldAutoUpdate",!1),d(this,"composeNode",!1),d(this,"isInComposeNode",!1),d(this,"alignCenter",!1),d(this,"boundingBox",new Ri),d(this,"boundingBoxWorld",new Ri),d(this,"boundingBoxNeedsUpdate",!1),d(this,"centerPoint",new Oi),d(this,"visible",!0),d(this,"castShadow",!1),d(this,"receiveShadow",!1),d(this,"renderOrder",0),d(this,"animations",[]),d(this,"finalSize"),d(this,"userData",{}),d(this,"DefaultUp",new Oi(0,1)),d(this,"_autoSort",!0),d(this,"_version",0),void 0!==t.name?this.name=t.name:this.name="Object2",void 0!==t.flipY&&(this.flipY=t.flipY),void 0!==t.selectable&&(this.selectable=t.selectable),void 0!==t.finalSize&&(this.finalSize=t.finalSize),this.setAttrs(t)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}destroy(){super.destroy(),this.clear(),this.removeFromParent(),this.dispatchEvent(kn)}setVisible(t){return this.visible=t,this}setPosition(t){return this.position.set(t.x,t.y),this}translate(t,e){this.position.x+=t,this.position.y+=e}setScale(t,e){return this.scaled.set(t,e),this}setRotationFromMatrix(t){t.decompose(In,this.rotation,Cn)}setRotation(t){return this.rotation.set(t,t),this}rotate(t){this.rotation.x+=t}scale(t,e){e?(this.scaled.x*=t,this.scaled.y*=e):this.scaled.multiplyScalar(t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(En.copy(this.matrixWorld).invert())}lookAt(t){An.copy(t),this.updateWorldMatrix(!0,!1),this.matrixWorld.getTransition(In),En.lookAt(In,An,Nn),En.getRotation(Dn),this.rotation.set(Dn.x,Dn.x),this.parent&&(this.parent.matrixWorld.getRotation(Dn),this.rotate(Dn.x))}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){Mn.copy(this.scaled),this.flipY&&(Mn.y*=-1),this.matrix.compose(this.position,this.rotation,Mn),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.matrixWorldNeedsUpdate=!1,t=!0,this.boundingBoxNeedsUpdate=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t);this.boundingBoxNeedsUpdate&&(this.updateBoundingBox(),this.boundingBoxNeedsUpdate=!1)}updateWorldMatrix(t=!1,e=!1){const i=this.parent;if(t&&i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),e){const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}updateModelViewMatrix(t){En.copy(this.matrixWorld),t&&this.fixed?this.modelViewMatrix.copy(t.projectionMatrix):t?this.modelViewMatrix.multiplyMatrices(t.viewMatrix,En):this.modelViewMatrix.copy(En);for(let e=0,i=this.children.length;e<i;e++)this.children[e].updateModelViewMatrix(t)}computeBoundingBox(){this.boundingBox.makeEmpty(),this.centerPoint.set(0,0);for(let t=0,e=this.children.length;t<e;t++)this.children[t].updateMatrixWorld(),Tn.copy(this.children[t].computeBoundingBox()),Tn.applyMatrix3(En.copy(this.children[t].matrixWorld)),this.boundingBox.union(Tn);return this.boundingBox.applyMatrix3(this.matrixWorldInverse),this.boundingBox}updateBoundingBox(){this.boundingBox.isEmpty()||this.boundingBoxWorld.copy(this.boundingBox).applyMatrix3(this.matrixWorld)}setAttrs(t){if(!t)return this;for(const e in t)"children"!==e&&void 0!==t[e]&&("userData"===e&&t[e]?Object.keys(t[e]).forEach((i=>this.userData[i]=t[e][i])):this.userData[e]=t[e]);return this}add(t){return t&&t.isObject2&&t!==this?(t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.isInComposeNode=this.composeNode||this.isInComposeNode,t.selectable&&t.parent.setSelectable(t.selectable),this._autoSort&&this.children.sort(((t,e)=>t.renderOrder-e.renderOrder)),t.dispatchEvent(Bn),this.matrixAutoUpdate||(this.matrixWorldNeedsUpdate=!0),this.visible&&(this.needsUpdate=!0),this):this}adds(t){if(!t||!t.length)return this;this._autoSort=!1;for(let e=0,i=t.length;e<i;e++)e===t.length-1&&(this._autoSort=!0),this.add(t[e]);return this}remove(t){const e=this.children.indexOf(t);return-1!==e&&(t.parent=void 0,this.children.splice(e,1),t.dispatchEvent(kn)),this}removes(t){for(let e=0,i=t.length;e<i;e++)this.remove(t[e]);return this}removeFromParent(){const t=this.parent;return t&&t.remove(this),this.parent=void 0,this}moveToLast(){const t=this.parent;t&&(this.removeFromParent(),t.add(this))}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=void 0,e.destroy(),e.dispatchEvent(kn)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),En.copy(this.matrixWorld).invert(),t.parent&&(t.parent.updateWorldMatrix(!0,!1),En.multiply(t.parent.matrixWorld)),t.applyMatrix3(En),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(t,Dn,Cn),t}getWorldRotation(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(In,t,Cn),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(In,Dn,t),t}getWorldDirection(t){return this.updateWorldMatrix(!0,!1),t.set(this.matrixWorld.elements[6],this.matrixWorld.elements[7]).normalize()}traverse(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e&&(t(e),e.traverseAncestors(t))}traverseSome(t){if(t(this))return!0;const e=this.children;for(let i=0,n=e.length;i<n;i++)if(e[i].traverseSome(t))return!0;return!1}onBeforeRender(t,e,i,n){}render(t){}onAfterRender(t,e,i){}setSelectable(t){this.selectable=t,this.parent&&this.parent.setSelectable(t)}raycast(t,e=[]){}getByRange(t,e=!1,i=[]){if(Tn.copy(t),Tn.containsBox(this.boundingBoxWorld)&&i.push(this),!e||this.composeNode)return i;for(let n=0,s=this.children.length;n<s;n++)this.children[n].getByRange(t,e,i);return i}clone(t=!0,e=!1){return new(0,this.constructor)(this.userData).copy(this,t,e)}copy(t,e=!0,i=!1){if(this.name=t.name,this.type=t.type,this.featureKey=t.featureKey,this._version=0,this.parent=t.parent,this.up.copy(t.up),this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.selectable=t.selectable,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.modelViewMatrix.copy(t.modelViewMatrix),this.normalMatrix.copy(t.normalMatrix),this.fixed=t.fixed,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.composeNode=t.composeNode,this.alignCenter=t.alignCenter,this.boundingBox.copy(t.boundingBox),this.boundingBoxWorld.copy(t.boundingBoxWorld),this.boundingBoxNeedsUpdate=t.boundingBoxNeedsUpdate,this.centerPoint.copy(t.centerPoint),this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e)for(let n=0;n<t.children.length;n++){const s=t.children[n];this.add(s.clone(e,i))}return this}}let Sn=0;const Mn=new Oi,En=new Gi,An=new Oi,Tn=new Ri,In=new Oi,Cn=new Oi,Dn=new Oi,Nn=new Oi(0,1),Bn={type:"added"},kn={type:"removed"};class On extends wn{constructor(t={}){super(t),d(this,"type","Group2"),d(this,"isGroup",!0),d(this,"versions",[]),d(this,"params"),d(this,"alignCenter",!1),d(this,"dynamically",!1),d(this,"usedCache",!1),d(this,"wireframe",!1),d(this,"showPoints",!1),this.params=t,void 0!==t.usedCache&&(this.usedCache=t.usedCache),void 0!==t.wireframe&&(this.wireframe=t.wireframe),void 0!==t.showPoints&&(this.showPoints=t.showPoints),void 0!==t.alignCenter&&(this.alignCenter=t.alignCenter),void 0!==t.dynamically&&(this.dynamically=t.dynamically)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}clone(t=!0,e=!1){return new(0,this.constructor)(this.params).copy(this,t,e)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.params=t.params,this.alignCenter=t.alignCenter,this.dynamically=t.dynamically,this.usedCache=t.usedCache,this.wireframe=t.wireframe,this.showPoints=t.showPoints,this}composeWireframeGeometryPath(t){return this.traverse((e=>{e.isShape&&e.geometry&&e.geometry.path&&t.addPath(e.geometry.path)})),t}raycast(t,e=[]){var i;if(!this.boundingBox||this.boundingBox.isEmpty())return e;if(!this.boundingBoxWorld.containsPoint(t.worldCoords))return e;let n=[];for(let e=0,s=null==(i=this.children)?void 0:i.length;e<s;e++)this.children[e].raycast(t,n);return n.length&&e.push(this),e}}const Pn=1,Ln=2,Rn=3,zn=4,Un=5,Fn=-1,Wn=51,qn=52;function Hn(t,e){const i=t.x*Math.cos(e)-t.y*Math.sin(e),n=t.y*Math.cos(e)+t.x*Math.sin(e);t.x=i,t.y=n}function Vn(t,e){t.x*=e,t.y*=e}let jn=class t{constructor(e){d(this,"commands"),this.commands=[],e&&e instanceof t?this.commands.push(...e.commands):e&&(this.commands=function(t){const e=[],i=String(t).trim();return"M"!==i[0]&&"m"!==i[0]||i.replace(Xn,((t,i,n)=>{const s=function(t){const e=t.match(Zn);return e?e.map(Number):[]}(n);let r=i.toLowerCase(),a=i;if("m"===r&&s.length>2&&(e.push([a,...s.splice(0,2)]),r="l",a="m"===a?"l":"L"),s.length<Gn[r])return"";for(e.push([a,...s.splice(0,Gn[r])]);s.length>=Gn[r]&&s.length&&Gn[r];)e.push([a,...s.splice(0,Gn[r])]);return""})),e}(e))}addPath(e){e&&e instanceof t&&this.commands.push(...e.commands)}moveTo(t,e){this.commands.push(["M",t,e])}lineTo(t,e){this.commands.push(["L",t,e])}arc(t,e,i,n,s,r){this.commands.push(["AC",t,e,i,n,s,!!r])}arcTo(t,e,i,n,s){this.commands.push(["AT",t,e,i,n,s])}ellipse(t,e,i,n,s,r,a,o){this.commands.push(["E",t,e,i,n,s,r,a,!!o])}closePath(){this.commands.push(["Z"])}bezierCurveTo(t,e,i,n,s,r){this.commands.push(["C",t,e,i,n,s,r])}quadraticCurveTo(t,e,i,n){this.commands.push(["Q",t,e,i,n])}rect(t,e,i,n){this.commands.push(["R",t,e,i,n])}roundRect(t,e,i,n,s){void 0===s?this.commands.push(["RR",t,e,i,n,0]):this.commands.push(["RR",t,e,i,n,s])}};function Yn(t,e){let i,n,s,r,a,o,h,l,u,c,d,p,f,m,y,g,v,x,b,_,w,S=0,M=0,E=null,A=null,T=null,I=null,C=null,D=null;t.beginPath();for(let O=0;O<e.length;++O){let P;switch(x=e[O][0],"S"!==x&&"s"!==x&&"C"!==x&&"c"!==x&&(E=null,A=null),"T"!==x&&"t"!==x&&"Q"!==x&&"q"!==x&&(T=null,I=null),x){case"m":case"M":P=e[O],"m"===x?(S+=P[1],M+=P[2]):(S=P[1],M=P[2]),"M"!==x&&C||(C={x:S,y:M}),t.moveTo(S,M);break;case"l":P=e[O],S+=P[1],M+=P[2],t.lineTo(S,M);break;case"L":P=e[O],S=P[1],M=P[2],t.lineTo(S,M);break;case"H":P=e[O],S=P[1],t.lineTo(S,M);break;case"h":P=e[O],S+=P[1],t.lineTo(S,M);break;case"V":P=e[O],M=P[1],t.lineTo(S,M);break;case"v":P=e[O],M+=P[1],t.lineTo(S,M);break;case"a":case"A":if(P=e[O],null===D)throw new Error("This should never happen");"a"===x?(S+=P[6],M+=P[7]):(S=P[6],M=P[7]),m=P[1],y=P[2],h=P[3]*Math.PI/180,s=!!P[4],r=!!P[5],a={x:S,y:M},o={x:(D.x-a.x)/2,y:(D.y-a.y)/2},Hn(o,-h),l=o.x*o.x/(m*m)+o.y*o.y/(y*y),l>1&&(l=Math.sqrt(l),m*=l,y*=l),b={x:m*o.y/y,y:-y*o.x/m},u=m*m*y*y,c=m*m*o.y*o.y+y*y*o.x*o.x,Vn(b,r!==s?Math.sqrt((u-c)/c)||0:-Math.sqrt((u-c)/c)||0),n=Math.atan2((o.y-b.y)/y,(o.x-b.x)/m),i=Math.atan2(-(o.y+b.y)/y,-(o.x+b.x)/m),Hn(b,h),N=b,B=(a.x+D.x)/2,k=(a.y+D.y)/2,N.x+=B,N.y+=k,t.save(),t.translate(b.x,b.y),t.rotate(h),t.scale(m,y),t.arc(0,0,1,n,i,!r),t.restore();break;case"C":P=e[O],E=P[3],A=P[4],S=P[5],M=P[6],t.bezierCurveTo(P[1],P[2],E,A,S,M);break;case"c":P=e[O],t.bezierCurveTo(P[1]+S,P[2]+M,P[3]+S,P[4]+M,P[5]+S,P[6]+M),E=P[3]+S,A=P[4]+M,S+=P[5],M+=P[6];break;case"S":P=e[O],null!==E&&null!==A||(E=S,A=M),t.bezierCurveTo(2*S-E,2*M-A,P[1],P[2],P[3],P[4]),E=P[1],A=P[2],S=P[3],M=P[4];break;case"s":P=e[O],null!==E&&null!==A||(E=S,A=M),t.bezierCurveTo(2*S-E,2*M-A,P[1]+S,P[2]+M,P[3]+S,P[4]+M),E=P[1]+S,A=P[2]+M,S+=P[3],M+=P[4];break;case"Q":P=e[O],T=P[1],I=P[2],S=P[3],M=P[4],t.quadraticCurveTo(T,I,S,M);break;case"q":P=e[O],T=P[1]+S,I=P[2]+M,S+=P[3],M+=P[4],t.quadraticCurveTo(T,I,S,M);break;case"T":P=e[O],null!==T&&null!==I||(T=S,I=M),T=2*S-T,I=2*M-I,S=P[1],M=P[2],t.quadraticCurveTo(T,I,S,M);break;case"t":P=e[O],null!==T&&null!==I||(T=S,I=M),T=2*S-T,I=2*M-I,S+=P[1],M+=P[2],t.quadraticCurveTo(T,I,S,M);break;case"z":case"Z":C&&(S=C.x,M=C.y),C=null,t.closePath();break;case"AC":P=e[O],S=P[1],M=P[2],f=P[3],n=P[4],i=P[5],_=P[6],t.arc(S,M,f,n,i,_);break;case"AT":P=e[O],d=P[1],p=P[2],S=P[3],M=P[4],f=P[5],t.arcTo(d,p,S,M,f);break;case"E":P=e[O],S=P[1],M=P[2],m=P[3],y=P[4],h=P[5],n=P[6],i=P[7],_=P[8],t.save(),t.translate(S,M),t.rotate(h),t.scale(m,y),t.arc(0,0,1,n,i,_),t.restore();break;case"R":P=e[O],S=P[1],M=P[2],g=P[3],v=P[4],C={x:S,y:M},t.rect(S,M,g,v);break;case"RR":P=e[O],S=P[1],M=P[2],g=P[3],v=P[4],w=P[5],C={x:S,y:M},t.roundRect(S,M,g,v,w)}D?(D.x=S,D.y=M):D={x:S,y:M}}var N,B,k}const Gn={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Xn=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Zn=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var $n={},Jn={};function Qn(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}var Kn=Qn({HTML:"text/html",isHTML:function(t){return t===Kn.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),ts=Qn({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===ts.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Jn.assign=function(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Jn.find=function(t,e,i){if(void 0===i&&(i=Array.prototype),t&&"function"==typeof i.find)return i.find.call(t,e);for(var n=0;n<t.length;n++)if(Object.prototype.hasOwnProperty.call(t,n)){var s=t[n];if(e.call(void 0,s,n,t))return s}},Jn.freeze=Qn,Jn.MIME_TYPE=Kn,Jn.NAMESPACE=ts;var es=Jn,is=es.find,ns=es.NAMESPACE;function ss(t){return""!==t}function rs(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function as(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(ss):[]}(t);return Object.keys(e.reduce(rs,{}))}function os(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function hs(t,e){var i=t.prototype;if(!(i instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,os(i,n),t.prototype=i=n}i.constructor!=t&&(i.constructor=t)}var ls={},us=ls.ELEMENT_NODE=1,cs=ls.ATTRIBUTE_NODE=2,ds=ls.TEXT_NODE=3,ps=ls.CDATA_SECTION_NODE=4,fs=ls.ENTITY_REFERENCE_NODE=5,ms=ls.ENTITY_NODE=6,ys=ls.PROCESSING_INSTRUCTION_NODE=7,gs=ls.COMMENT_NODE=8,vs=ls.DOCUMENT_NODE=9,xs=ls.DOCUMENT_TYPE_NODE=10,bs=ls.DOCUMENT_FRAGMENT_NODE=11,_s=ls.NOTATION_NODE=12,ws={},Ss={};ws.INDEX_SIZE_ERR=(Ss[1]="Index size error",1),ws.DOMSTRING_SIZE_ERR=(Ss[2]="DOMString size error",2);var Ms=ws.HIERARCHY_REQUEST_ERR=(Ss[3]="Hierarchy request error",3);ws.WRONG_DOCUMENT_ERR=(Ss[4]="Wrong document",4),ws.INVALID_CHARACTER_ERR=(Ss[5]="Invalid character",5),ws.NO_DATA_ALLOWED_ERR=(Ss[6]="No data allowed",6),ws.NO_MODIFICATION_ALLOWED_ERR=(Ss[7]="No modification allowed",7);var Es=ws.NOT_FOUND_ERR=(Ss[8]="Not found",8);ws.NOT_SUPPORTED_ERR=(Ss[9]="Not supported",9);var As=ws.INUSE_ATTRIBUTE_ERR=(Ss[10]="Attribute in use",10);function Ts(t,e){if(e instanceof Error)var i=e;else i=this,Error.call(this,Ss[t]),this.message=Ss[t],Error.captureStackTrace&&Error.captureStackTrace(this,Ts);return i.code=t,e&&(this.message=this.message+": "+e),i}function Is(){}function Cs(t,e){this._node=t,this._refresh=e,Ds(this)}function Ds(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var i=t._refresh(t._node);if(gr(t,"length",i.length),!t.$$length||i.length<t.$$length)for(var n=i.length;n in t;n++)Object.prototype.hasOwnProperty.call(t,n)&&delete t[n];os(i,t),t._inc=e}}function Ns(){}function Bs(t,e){for(var i=t.length;i--;)if(t[i]===e)return i}function ks(t,e,i,n){if(n?e[Bs(e,n)]=i:e[e.length++]=i,t){i.ownerElement=t;var s=t.ownerDocument;s&&(n&&Fs(s,t,n),function(t,e,i){t&&t._inc++;var n=i.namespaceURI;n===ns.XMLNS&&(e._nsMap[i.prefix?i.localName:""]=i.value)}(s,t,i))}}function Os(t,e,i){var n=Bs(e,i);if(!(n>=0))throw new Ts(Es,new Error(t.tagName+"@"+i));for(var s=e.length-1;n<s;)e[n]=e[++n];if(e.length=s,t){var r=t.ownerDocument;r&&(Fs(r,t,i),i.ownerElement=null)}}function Ps(){}function Ls(){}function Rs(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function zs(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(zs(t,e))return!0}while(t=t.nextSibling)}function Us(){this.ownerDocument=this}function Fs(t,e,i,n){t&&t._inc++,i.namespaceURI===ns.XMLNS&&delete e._nsMap[i.prefix?i.localName:""]}function Ws(t,e,i){if(t&&t._inc){t._inc++;var n=e.childNodes;if(i)n[n.length++]=i;else{for(var s=e.firstChild,r=0;s;)n[r++]=s,s=s.nextSibling;n.length=r,delete n[n.length]}}}function qs(t,e){var i=e.previousSibling,n=e.nextSibling;return i?i.nextSibling=n:t.firstChild=n,n?n.previousSibling=i:t.lastChild=i,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Ws(t.ownerDocument,t),e}function Hs(t){return t&&t.nodeType===Ls.DOCUMENT_TYPE_NODE}function Vs(t){return t&&t.nodeType===Ls.ELEMENT_NODE}function js(t){return t&&t.nodeType===Ls.TEXT_NODE}function Ys(t,e){var i=t.childNodes||[];if(is(i,Vs)||Hs(e))return!1;var n=is(i,Hs);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function Gs(t,e){var i=t.childNodes||[];if(is(i,(function(t){return Vs(t)&&t!==e})))return!1;var n=is(i,Hs);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function Xs(t,e,i){if(!function(t){return t&&(t.nodeType===Ls.DOCUMENT_NODE||t.nodeType===Ls.DOCUMENT_FRAGMENT_NODE||t.nodeType===Ls.ELEMENT_NODE)}(t))throw new Ts(Ms,"Unexpected parent node type "+t.nodeType);if(i&&i.parentNode!==t)throw new Ts(Es,"child not in parent");if(!function(t){return t&&(Vs(t)||js(t)||Hs(t)||t.nodeType===Ls.DOCUMENT_FRAGMENT_NODE||t.nodeType===Ls.COMMENT_NODE||t.nodeType===Ls.PROCESSING_INSTRUCTION_NODE)}(e)||Hs(e)&&t.nodeType!==Ls.DOCUMENT_NODE)throw new Ts(Ms,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function Zs(t,e,i){var n=t.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ls.DOCUMENT_FRAGMENT_NODE){var r=s.filter(Vs);if(r.length>1||is(s,js))throw new Ts(Ms,"More than one element or text in fragment");if(1===r.length&&!Ys(t,i))throw new Ts(Ms,"Element in fragment can not be inserted before doctype")}if(Vs(e)&&!Ys(t,i))throw new Ts(Ms,"Only one element can be added and only after doctype");if(Hs(e)){if(is(n,Hs))throw new Ts(Ms,"Only one doctype is allowed");var a=is(n,Vs);if(i&&n.indexOf(a)<n.indexOf(i))throw new Ts(Ms,"Doctype can only be inserted before an element");if(!i&&a)throw new Ts(Ms,"Doctype can not be appended since element is present")}}function $s(t,e,i){var n=t.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ls.DOCUMENT_FRAGMENT_NODE){var r=s.filter(Vs);if(r.length>1||is(s,js))throw new Ts(Ms,"More than one element or text in fragment");if(1===r.length&&!Gs(t,i))throw new Ts(Ms,"Element in fragment can not be inserted before doctype")}if(Vs(e)&&!Gs(t,i))throw new Ts(Ms,"Only one element can be added and only after doctype");if(Hs(e)){let t=function(t){return Hs(t)&&t!==i};if(is(n,t))throw new Ts(Ms,"Only one doctype is allowed");var a=is(n,Vs);if(i&&n.indexOf(a)<n.indexOf(i))throw new Ts(Ms,"Doctype can only be inserted before an element")}}function Js(t,e,i,n){Xs(t,e,i),t.nodeType===Ls.DOCUMENT_NODE&&(n||Zs)(t,e,i);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===bs){var r=e.firstChild;if(null==r)return e;var a=e.lastChild}else r=a=e;var o=i?i.previousSibling:t.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:t.firstChild=r,null==i?t.lastChild=a:i.previousSibling=a;do{r.parentNode=t}while(r!==a&&(r=r.nextSibling));return Ws(t.ownerDocument||t,t),e.nodeType==bs&&(e.firstChild=e.lastChild=null),e}function Qs(){this._nsMap={}}function Ks(){}function tr(){}function er(){}function ir(){}function nr(){}function sr(){}function rr(){}function ar(){}function or(){}function hr(){}function lr(){}function ur(){}function cr(t,e){var i=[],n=9==this.nodeType&&this.documentElement||this,s=n.prefix,r=n.namespaceURI;if(r&&null==s&&null==(s=n.lookupPrefix(r)))var a=[{namespace:r,prefix:null}];return fr(this,i,t,e,a),i.join("")}function dr(t,e,i){var n=t.prefix||"",s=t.namespaceURI;if(!s)return!1;if("xml"===n&&s===ns.XML||s===ns.XMLNS)return!1;for(var r=i.length;r--;){var a=i[r];if(a.prefix===n)return a.namespace!==s}return!0}function pr(t,e,i){t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,Rs),'"')}function fr(t,e,i,n,s){if(s||(s=[]),n){if(!(t=n(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case us:var r=t.attributes,a=r.length,o=t.firstChild,h=t.tagName,l=h;if(!(i=ns.isHTML(t.namespaceURI)||i)&&!t.prefix&&t.namespaceURI){for(var u,c=0;c<r.length;c++)if("xmlns"===r.item(c).name){u=r.item(c).value;break}if(!u)for(var d=s.length-1;d>=0;d--)if(""===(p=s[d]).prefix&&p.namespace===t.namespaceURI){u=p.namespace;break}if(u!==t.namespaceURI)for(d=s.length-1;d>=0;d--){var p;if((p=s[d]).namespace===t.namespaceURI){p.prefix&&(l=p.prefix+":"+h);break}}}e.push("<",l);for(var f=0;f<a;f++)"xmlns"==(m=r.item(f)).prefix?s.push({prefix:m.localName,namespace:m.value}):"xmlns"==m.nodeName&&s.push({prefix:"",namespace:m.value});for(f=0;f<a;f++){var m,y,g;dr(m=r.item(f),0,s)&&(pr(e,(y=m.prefix||"")?"xmlns:"+y:"xmlns",g=m.namespaceURI),s.push({prefix:y,namespace:g})),fr(m,e,i,n,s)}if(h===l&&dr(t,0,s)&&(pr(e,(y=t.prefix||"")?"xmlns:"+y:"xmlns",g=t.namespaceURI),s.push({prefix:y,namespace:g})),o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(h)){if(e.push(">"),i&&/^script$/i.test(h))for(;o;)o.data?e.push(o.data):fr(o,e,i,n,s.slice()),o=o.nextSibling;else for(;o;)fr(o,e,i,n,s.slice()),o=o.nextSibling;e.push("</",l,">")}else e.push("/>");return;case vs:case bs:for(o=t.firstChild;o;)fr(o,e,i,n,s.slice()),o=o.nextSibling;return;case cs:return pr(e,t.name,t.value);case ds:return e.push(t.data.replace(/[<&>]/g,Rs));case ps:return e.push("<![CDATA[",t.data,"]]>");case gs:return e.push("\x3c!--",t.data,"--\x3e");case xs:var v=t.publicId,x=t.systemId;if(e.push("<!DOCTYPE ",t.name),v)e.push(" PUBLIC ",v),x&&"."!=x&&e.push(" ",x),e.push(">");else if(x&&"."!=x)e.push(" SYSTEM ",x,">");else{var b=t.internalSubset;b&&e.push(" [",b,"]"),e.push(">")}return;case ys:return e.push("<?",t.target," ",t.data,"?>");case fs:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function mr(t,e,i){var n;switch(e.nodeType){case us:(n=e.cloneNode(!1)).ownerDocument=t;case bs:break;case cs:i=!0}if(n||(n=e.cloneNode(!1)),n.ownerDocument=t,n.parentNode=null,i)for(var s=e.firstChild;s;)n.appendChild(mr(t,s,i)),s=s.nextSibling;return n}function yr(t,e,i){var n=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var r=e[s];"object"!=typeof r&&r!=n[s]&&(n[s]=r)}switch(e.childNodes&&(n.childNodes=new Is),n.ownerDocument=t,n.nodeType){case us:var a=e.attributes,o=n.attributes=new Ns,h=a.length;o._ownerElement=n;for(var l=0;l<h;l++)n.setAttributeNode(yr(t,a.item(l),!0));break;case cs:i=!0}if(i)for(var u=e.firstChild;u;)n.appendChild(yr(t,u,i)),u=u.nextSibling;return n}function gr(t,e,i){t[e]=i}ws.INVALID_STATE_ERR=(Ss[11]="Invalid state",11),ws.SYNTAX_ERR=(Ss[12]="Syntax error",12),ws.INVALID_MODIFICATION_ERR=(Ss[13]="Invalid modification",13),ws.NAMESPACE_ERR=(Ss[14]="Invalid namespace",14),ws.INVALID_ACCESS_ERR=(Ss[15]="Invalid access",15),Ts.prototype=Error.prototype,os(ws,Ts),Is.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t,e){for(var i=[],n=0;n<this.length;n++)fr(this[n],i,t,e);return i.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},Cs.prototype.item=function(t){return Ds(this),this[t]||null},hs(Cs,Is),Ns.prototype={length:0,item:Is.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var i=this[e];if(i.nodeName==t)return i}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new Ts(As);var i=this.getNamedItem(t.nodeName);return ks(this._ownerElement,this,t,i),i},setNamedItemNS:function(t){var e,i=t.ownerElement;if(i&&i!=this._ownerElement)throw new Ts(As);return e=this.getNamedItemNS(t.namespaceURI,t.localName),ks(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return Os(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);return Os(this._ownerElement,this,i),i},getNamedItemNS:function(t,e){for(var i=this.length;i--;){var n=this[i];if(n.localName==e&&n.namespaceURI==t)return n}return null}},Ps.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,i){var n=new Us;if(n.implementation=this,n.childNodes=new Is,n.doctype=i||null,i&&n.appendChild(i),e){var s=n.createElementNS(t,e);n.appendChild(s)}return n},createDocumentType:function(t,e,i){var n=new sr;return n.name=t,n.nodeName=t,n.publicId=e||"",n.systemId=i||"",n}},Ls.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return Js(this,t,e)},replaceChild:function(t,e){Js(this,t,e,$s),e&&this.removeChild(e)},removeChild:function(t){return qs(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return yr(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==ds&&t.nodeType==ds?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var i=e._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===t)return n;e=e.nodeType==cs?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var i=e._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,t))return i[t];e=e.nodeType==cs?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},os(ls,Ls),os(ls,Ls.prototype),Us.prototype={nodeName:"#document",nodeType:vs,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==bs){for(var i=t.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,e),i=n}return t}return Js(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===us&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),qs(this,t)},replaceChild:function(t,e){Js(this,t,e,$s),t.ownerDocument=this,e&&this.removeChild(e),Vs(t)&&(this.documentElement=t)},importNode:function(t,e){return mr(this,t,e)},getElementById:function(t){var e=null;return zs(this.documentElement,(function(i){if(i.nodeType==us&&i.getAttribute("id")==t)return e=i,!0})),e},getElementsByClassName:function(t){var e=as(t);return new Cs(this,(function(i){var n=[];return e.length>0&&zs(i.documentElement,(function(s){if(s!==i&&s.nodeType===us){var r=s.getAttribute("class");if(r){var a=t===r;if(!a){var o=as(r);a=e.every((h=o,function(t){return h&&-1!==h.indexOf(t)}))}a&&n.push(s)}}var h})),n}))},createElement:function(t){var e=new Qs;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new Is,(e.attributes=new Ns)._ownerElement=e,e},createDocumentFragment:function(){var t=new hr;return t.ownerDocument=this,t.childNodes=new Is,t},createTextNode:function(t){var e=new er;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new ir;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new nr;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var i=new lr;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=t,i.nodeValue=i.data=e,i},createAttribute:function(t){var e=new Ks;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new or;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var i=new Qs,n=e.split(":"),s=i.attributes=new Ns;return i.childNodes=new Is,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=t,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,s._ownerElement=i,i},createAttributeNS:function(t,e){var i=new Ks,n=e.split(":");return i.ownerDocument=this,i.nodeName=e,i.name=e,i.namespaceURI=t,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,i}},hs(Us,Ls),Qs.prototype={nodeType:us,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var i=this.ownerDocument.createAttribute(t);i.value=i.nodeValue=""+e,this.setAttributeNode(i)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===bs?this.insertBefore(t,null):function(t,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.lastChild=e,Ws(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i&&i.value||""},setAttributeNS:function(t,e,i){var n=this.ownerDocument.createAttributeNS(t,e);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new Cs(this,(function(e){var i=[];return zs(e,(function(n){n===e||n.nodeType!=us||"*"!==t&&n.tagName!=t||i.push(n)})),i}))},getElementsByTagNameNS:function(t,e){return new Cs(this,(function(i){var n=[];return zs(i,(function(s){s===i||s.nodeType!==us||"*"!==t&&s.namespaceURI!==t||"*"!==e&&s.localName!=e||n.push(s)})),n}))}},Us.prototype.getElementsByTagName=Qs.prototype.getElementsByTagName,Us.prototype.getElementsByTagNameNS=Qs.prototype.getElementsByTagNameNS,hs(Qs,Ls),Ks.prototype.nodeType=cs,hs(Ks,Ls),tr.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(Ss[Ms])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){i=this.data.substring(0,t)+i+this.data.substring(t+e),this.nodeValue=this.data=i,this.length=i.length}},hs(tr,Ls),er.prototype={nodeName:"#text",nodeType:ds,splitText:function(t){var e=this.data,i=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},hs(er,tr),ir.prototype={nodeName:"#comment",nodeType:gs},hs(ir,tr),nr.prototype={nodeName:"#cdata-section",nodeType:ps},hs(nr,tr),sr.prototype.nodeType=xs,hs(sr,Ls),rr.prototype.nodeType=_s,hs(rr,Ls),ar.prototype.nodeType=ms,hs(ar,Ls),or.prototype.nodeType=fs,hs(or,Ls),hr.prototype.nodeName="#document-fragment",hr.prototype.nodeType=bs,hs(hr,Ls),lr.prototype.nodeType=ys,hs(lr,Ls),ur.prototype.serializeToString=function(t,e,i){return cr.call(t,e,i)},Ls.prototype.toString=cr;try{if(Object.defineProperty){let t=function(e){switch(e.nodeType){case us:case bs:var i=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&i.push(t(e)),e=e.nextSibling;return i.join("");default:return e.nodeValue}};Object.defineProperty(Cs.prototype,"length",{get:function(){return Ds(this),this.$$length}}),Object.defineProperty(Ls.prototype,"textContent",{get:function(){return t(this)},set:function(t){switch(this.nodeType){case us:case bs:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),gr=function(t,e,i){t["$$"+e]=i}}}catch(t){}$n.DocumentType=sr,$n.DOMException=Ts,$n.DOMImplementation=Ps,$n.Element=Qs,$n.Node=Ls,$n.NodeList=Is,$n.XMLSerializer=ur;var vr={},xr={};!function(t){var e=Jn.freeze;t.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES}(xr);var br={},_r=Jn.NAMESPACE,wr=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Sr=new RegExp("[\\-\\.0-9"+wr.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Mr=new RegExp("^"+wr.source+Sr.source+"*(?::"+wr.source+Sr.source+"*)?$");function Er(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Er)}function Ar(){}function Tr(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function Ir(t,e,i,n,s,r){function a(t,e,n){i.attributeNames.hasOwnProperty(t)&&r.fatalError("Attribute "+t+" redefined"),i.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),n)}for(var o,h=++e,l=0;;){var u=t.charAt(h);switch(u){case"=":if(1===l)o=t.slice(e,h),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(r.warning('attribute value must after "="'),o=t.slice(e,h)),e=h+1,!((h=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");a(o,c=t.slice(e,h),e-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');a(o,c=t.slice(e,h),e),r.warning('attribute "'+o+'" missed start quot('+u+")!!"),e=h+1,l=5}break;case"/":switch(l){case 0:i.setTagName(t.slice(e,h));case 5:case 6:case 7:l=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return r.error("unexpected end of input"),0==l&&i.setTagName(t.slice(e,h)),h;case">":switch(l){case 0:i.setTagName(t.slice(e,h));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=t.slice(e,h)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case 2:2===l&&(c=o),4==l?(r.warning('attribute "'+c+'" missed quot(")!'),a(o,c,e)):(_r.isHTML(n[""])&&c.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),a(c,c,e));break;case 3:throw new Error("attribute value missed!!")}return h;case"€":u=" ";default:if(u<=" ")switch(l){case 0:i.setTagName(t.slice(e,h)),l=6;break;case 1:o=t.slice(e,h),l=2;break;case 4:var c=t.slice(e,h);r.warning('attribute "'+c+'" missed quot(")!!'),a(o,c,e);case 5:l=6}else switch(l){case 2:i.tagName,_r.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=h,l=1;break;case 5:r.warning('attribute space is required"'+o+'"!!');case 6:l=1,e=h;break;case 3:l=4,e=h;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function Cr(t,e,i){for(var n=t.tagName,s=null,r=t.length;r--;){var a=t[r],o=a.qName,h=a.value;if((d=o.indexOf(":"))>0)var l=a.prefix=o.slice(0,d),u=o.slice(d+1),c="xmlns"===l&&u;else u=o,l=null,c="xmlns"===o&&"";a.localName=u,!1!==c&&(null==s&&(s={},Br(i,i={})),i[c]=s[c]=h,a.uri=_r.XMLNS,e.startPrefixMapping(c,h))}for(r=t.length;r--;)(l=(a=t[r]).prefix)&&("xml"===l&&(a.uri=_r.XML),"xmlns"!==l&&(a.uri=i[l||""]));var d;(d=n.indexOf(":"))>0?(l=t.prefix=n.slice(0,d),u=t.localName=n.slice(d+1)):(l=null,u=t.localName=n);var p=t.uri=i[l||""];if(e.startElement(p,u,n,t),!t.closed)return t.currentNSMap=i,t.localNSMap=s,!0;if(e.endElement(p,u,n),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}function Dr(t,e,i,n,s){if(/^(?:script|textarea)$/i.test(i)){var r=t.indexOf("</"+i+">",e),a=t.substring(e+1,r);if(/[&<]/.test(a))return/^script$/i.test(i)?(s.characters(a,0,a.length),r):(a=a.replace(/&#?\w+;/g,n),s.characters(a,0,a.length),r)}return e+1}function Nr(t,e,i,n){var s=n[i];return null==s&&((s=t.lastIndexOf("</"+i+">"))<e&&(s=t.lastIndexOf("</"+i)),n[i]=s),s<e}function Br(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function kr(t,e,i,n){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(s=t.indexOf("--\x3e",e+4))>e?(i.comment(t,e+4,s-e-4),s+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var s=t.indexOf("]]>",e+9);return i.startCDATA(),i.characters(t,e+9,s-e-9),i.endCDATA(),s+3}var r=function(t,e){var i,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(t);i=s.exec(t);)if(n.push(i),i[1])return n}(t,e),a=r.length;if(a>1&&/!doctype/i.test(r[0][0])){var o=r[1][0],h=!1,l=!1;a>3&&(/^public$/i.test(r[2][0])?(h=r[3][0],l=a>4&&r[4][0]):/^system$/i.test(r[2][0])&&(l=r[3][0]));var u=r[a-1];return i.startDTD(o,h,l),i.endDTD(),u.index+u[0].length}return-1}function Or(t,e,i){var n=t.indexOf("?>",e);if(n){var s=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return s?(s[0].length,i.processingInstruction(s[1],s[2]),n+2):-1}return-1}function Pr(){this.attributeNames={}}Er.prototype=new Error,Er.prototype.name=Er.name,Ar.prototype={parse:function(t,e,i){var n=this.domBuilder;n.startDocument(),Br(e,e={}),function(t,e,i,n,s){function r(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}function a(t){var e=t.slice(1,-1);return Object.hasOwnProperty.call(i,e)?i[e]:"#"===e.charAt(0)?r(parseInt(e.substr(1).replace("x","0x"))):(s.error("entity not found:"+t),t)}function o(e){if(e>m){var i=t.substring(m,e).replace(/&#?\w+;/g,a);d&&h(m),n.characters(i,0,e-m),m=e}}function h(e,i){for(;e>=u&&(i=c.exec(t));)l=i.index,u=l+i[0].length,d.lineNumber++;d.columnNumber=e-l+1}for(var l=0,u=0,c=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,p=[{currentNSMap:e}],f={},m=0;;){try{var y=t.indexOf("<",m);if(y<0){if(!t.substr(m).match(/^\s*$/)){var g=n.doc,v=g.createTextNode(t.substr(m));g.appendChild(v),n.currentElement=v}return}switch(y>m&&o(y),t.charAt(y+1)){case"/":var x=t.indexOf(">",y+3),b=t.substring(y+2,x).replace(/[ \t\n\r]+$/g,""),_=p.pop();x<0?(b=t.substring(y+2).replace(/[\s<].*/,""),s.error("end tag name: "+b+" is not complete:"+_.tagName),x=y+1+b.length):b.match(/\s</)&&(b=b.replace(/[\s<].*/,""),s.error("end tag name: "+b+" maybe not complete"),x=y+1+b.length);var w=_.localNSMap,S=_.tagName==b;if(S||_.tagName&&_.tagName.toLowerCase()==b.toLowerCase()){if(n.endElement(_.uri,_.localName,b),w)for(var M in w)Object.prototype.hasOwnProperty.call(w,M)&&n.endPrefixMapping(M);S||s.fatalError("end tag name: "+b+" is not match the current start tagName:"+_.tagName)}else p.push(_);x++;break;case"?":d&&h(y),x=Or(t,y,n);break;case"!":d&&h(y),x=kr(t,y,n,s);break;default:d&&h(y);var E=new Pr,A=p[p.length-1].currentNSMap,T=(x=Ir(t,y,E,A,a,s),E.length);if(!E.closed&&Nr(t,x,E.tagName,f)&&(E.closed=!0,i.nbsp||s.warning("unclosed xml attribute")),d&&T){for(var I=Tr(d,{}),C=0;C<T;C++){var D=E[C];h(D.offset),D.locator=Tr(d,{})}n.locator=I,Cr(E,n,A)&&p.push(E),n.locator=d}else Cr(E,n,A)&&p.push(E);_r.isHTML(E.uri)&&!E.closed?x=Dr(t,x,E.tagName,a,n):x++}}catch(t){if(t instanceof Er)throw t;s.error("element parse error: "+t),x=-1}x>m?m=x:o(Math.max(y,m)+1)}}(t,e,i,n,this.errorHandler),n.endDocument()}},Pr.prototype={setTagName:function(t){if(!Mr.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,i){if(!Mr.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},br.XMLReader=Ar,br.ParseError=Er;var Lr=Jn,Rr=xr,zr=br,Ur=$n.DOMImplementation,Fr=Lr.NAMESPACE,Wr=zr.ParseError,qr=zr.XMLReader;function Hr(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Vr(t){this.options=t||{locator:{}}}function jr(){this.cdata=!1}function Yr(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function Gr(t,e,i){return"string"==typeof t?t.substr(e,i):t.length>=e+i||e?new java.lang.String(t,e,i)+"":t}function Xr(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}Vr.prototype.parseFromString=function(t,e){var i=this.options,n=new qr,s=i.domBuilder||new jr,r=i.errorHandler,a=i.locator,o=i.xmlns||{},h=/\/x?html?$/.test(e),l=h?Rr.HTML_ENTITIES:Rr.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=function(t,e,i){if(!t){if(e instanceof jr)return e;t=e}var n={},s=t instanceof Function;function r(e){var r=t[e];!r&&s&&(r=2==t.length?function(i){t(e,i)}:t),n[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+function(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(i))}||function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),n}(r,s,a),n.domBuilder=i.domBuilder||s,h&&(o[""]=Fr.HTML),o.xml=o.xml||Fr.XML;var u=i.normalizeLineEndings||Hr;return t&&"string"==typeof t?n.parse(u(t),o,l):n.errorHandler.error("invalid doc source"),s.doc},jr.prototype={startDocument:function(){this.doc=(new Ur).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,i,n){var s=this.doc,r=s.createElementNS(t,i||e),a=n.length;Xr(this,r),this.currentElement=r,this.locator&&Yr(this.locator,r);for(var o=0;o<a;o++){t=n.getURI(o);var h=n.getValue(o),l=(i=n.getQName(o),s.createAttributeNS(t,i));this.locator&&Yr(n.getLocator(o),l),l.value=l.nodeValue=h,r.setAttributeNode(l)}},endElement:function(t,e,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var i=this.doc.createProcessingInstruction(t,e);this.locator&&Yr(this.locator,i),Xr(this,i)},ignorableWhitespace:function(t,e,i){},characters:function(t,e,i){if(t=Gr.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(t);else n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&Yr(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,i){t=Gr.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&Yr(this.locator,n),Xr(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(t,e,i);this.locator&&Yr(this.locator,s),Xr(this,s),this.doc.doctype=s}},warning:function(t){},error:function(t){},fatalError:function(t){throw new Wr(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){jr.prototype[t]=function(){return null}})),vr.__DOMHandler=jr,vr.normalizeLineEndings=Hr,vr.DOMParser=Vr;var Zr=vr.DOMParser;const $r="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{document:void 0,tinyEngine:void 0};$r.Path2D||function(t){if(!t||!t.CanvasRenderingContext2D||t.Path2D)return;const{CanvasRenderingContext2D:e}=t,i=null==e?void 0:e.prototype.fill,n=null==e?void 0:e.prototype.stroke,s=null==e?void 0:e.prototype.isPointInPath;e.prototype.fill=function(...t){if(!(t[0]instanceof jn)){const e=t[0]||"nonzero";return i.apply(this,[e])}{const e=t[0],n=t[1]||"nonzero";Yn(this,e.commands),i.apply(this,[n])}},e.prototype.stroke=function(t){t&&Yn(this,t.commands),n.apply(this)},e.prototype.isPointInPath=function(...t){if(t[0]instanceof jn){const e=t[0],i=t[1],n=t[2],r=t[3]||"nonzero";return Yn(this,e.commands),s.apply(this,[i,n,r])}return s.apply(this,t)},t.Path2D=jn}($r),$r.DOMParser||($r.DOMParser=Zr);const Jr={window:$r,isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),document:$r.document,config:{width:0,height:0,dpr:1,fnEnable:!1,editorMode:0,debounceCache:!0,instancedMesh:!0,controls:{enableHover:!0},assetType:"rm",selectEnable:!1,multiSelectEnable:!1,dummy:{radius:15}}};class Qr{constructor(t=!0){d(this,"dpr",1),d(this,"data"),d(this,"userData",{}),d(this,"autoClose",!1),d(this,"_saveData",!0),d(this,"_len",0),d(this,"_x0",0),d(this,"_y0",0),d(this,"_xi",0),d(this,"_yi",0),d(this,"_version",0),d(this,"_ctx"),d(this,"_ppx",0),d(this,"_ppy",0),d(this,"_ppl",0),d(this,"_ux",0),d(this,"_uy",0),d(this,"_pathSegLen"),d(this,"_pathLen",0),this._saveData=!!t,this._saveData&&(this.data=[])}dispose(){return this.reset(),this.data=[],this._len=0,this.userData={},this._ctx=void 0,this._version=0,this._ppx=0,this._ppy=0,this._ppl=0,this._ux=0,this._uy=0,this}reset(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=void 0,this._pathLen=0),this.needsUpdate=!0}set needsUpdate(t){!0===t&&this._version++}get version(){return this._version}clone(){const t=new Qr(this._saveData),e=this.data;return t.data=(null==e?void 0:e.slice)?e.slice():Array.prototype.slice.call(e),t._len=this._len,t._ux=this._ux,t._uy=this._uy,t._ppx=this._ppx,t._ppy=this._ppy,t._ppl=this._ppl,t.autoClose=this.autoClose,t.userData=mi.cloneDeep(this.userData),t}setDpr(t){return this.dpr=t||1,this}setScale(t,e,i){return i&&(this._ux=Math.abs(i/(Jr.config.dpr||1)/(t||1)),this._uy=Math.abs(i/(Jr.config.dpr||1)/(e||1))),this}setContext(t){return this._ctx=t,this}getContext(){return this._ctx}len(){return this._len}setData(t){if(!this._saveData)return;const e=(null==t?void 0:t.length)||0;this.data&&this.data.length===e||(this.data=new Float32Array(e));for(let i=0;i<e;i++)this.data[i]=t[i];this._len=e}addData(...t){if(!this._saveData)return;let e=this.data;this._len+(null==t?void 0:t.length)>((null==e?void 0:e.length)||0)&&(this._expandData(),e=this.data);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)e[this._len++]=t[i]}insertData(t,...e){if(!this._saveData||!e||0===e.length)return;const i=this.getCmds();t<0&&(t=0),t>i.length&&(t=i.length),e.length>0&&i.splice(t,0,[...e]);const n=mi.flatten(i);this.setData(n),this.needsUpdate=!0}removeData(t){if(!this._saveData||!this.data||this._len<=0)return;const e=this.getCmds();if(t<0||t>=e.length)return;e.splice(t,1);const i=mi.flatten(e);this.setData(i),this.needsUpdate=!0}_expandData(){if(!(this.data instanceof Array)){const t=[];for(let e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}}appendPath(t){if(!this._saveData||!t)return;t instanceof Array||(t=[t]);const e=t.length;let i=0,n=this._len;for(let n=0;n<e;n++)i+=t[n].len()||0;const s=this.data;if((s instanceof Float32Array||!s)&&(this.data=new Float32Array(n+i),n>0&&s))for(let t=0;t<n;t++)this.data[t]=s[t];for(let i=0;i<e;i++){const e=t[i].data;for(let i=0,s=(null==t?void 0:t.length)||0;i<s;i++)this.data[n++]=e[i]}this._len=n}toStatic(){this._saveData&&(this._pendingLine(),this.data instanceof Array&&(this.data.length=this._len,this._len>11&&(this.data=new Float32Array(this.data))))}rebuildPath(t,e){if(!this.data||!this._len||e<=0)return;const i=this.data,n=this._ux,s=this._uy,r=this._len;let a=0,o=0,h=0,l=0,u=0,c=0;const d=e<1;let p,f,m,y,g=0,v=0,x=0,b=0;if(!d||(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,f=this._pathLen,x=f*e,x))t:for(let e=0;e<r;){const r=i[e++],f=1===e;switch(f&&(a=h=i[e],o=l=i[e+1]),r!==Ln&&b>0&&(t.lineTo(m,y),b=0),r){case Pn:a=h=i[e++],o=l=i[e++],t.moveTo(h,l);break;case Ln:{u=i[e++],c=i[e++];const r=Math.abs(u-h),a=Math.abs(c-l);if(r>n||a>s){if(d){const e=p[v++];if(g+e>x){const i=(x-g)/e;t.lineTo(h*(1-i)+u*i,l*(1-i)+c*i);break t}g+=e}t.lineTo(u,c),h=u,l=c,b=0}else{const t=r*r+a*a;t>b&&(m=u,y=c,b=t)}break}case Rn:{const n=i[e++],s=i[e++],r=i[e++],a=i[e++],o=i[e++],u=i[e++];if(d){const e=p[v++];if(g+e>x){const i=(x-g)/e;bi(h,n,r,o,i,ta),bi(l,s,a,u,i,ea),t.bezierCurveTo(ta[1],ea[1],ta[2],ea[2],ta[3],ea[3]);break t}g+=e}t.bezierCurveTo(n,s,r,a,o,u),h=o,l=u;break}case zn:{const n=i[e++],s=i[e++],r=i[e++],a=i[e++];if(d){const e=p[v++];if(g+e>x){const i=(x-g)/e;Mi(h,n,r,i,ta),Mi(l,s,a,i,ea),t.quadraticCurveTo(ta[1],ea[1],ta[2],ea[2]);break t}g+=e}t.quadraticCurveTo(n,s,r,a),h=r,l=a;break}case Un:const r=i[e++],_=i[e++],w=i[e++],S=i[e++];let M=i[e++],E=i[e++];const A=i[e++],T=!i[e++],I=w>S?w:S,C=Math.abs(w-S)>.001;let D=M+E,N=!1;if(d){const t=p[v++];g+t>x&&(D=M+E*(x-g)/t,N=!0),g+=t}if(C&&"function"==typeof t.ellipse?t.ellipse(r,_,w,S,A,M,D,T):t.arc(r,_,I,M,D,T),N)break t;f&&(a=r+Math.cos(M)*w,o=_+Math.sin(M)*S),h=Math.cos(D)*w+r,l=Math.sin(D)*S+_;break;case Wn:a=h=i[e],o=l=i[e+1],u=i[e++],c=i[e++];const B=i[e++],k=i[e++];if(d){const e=p[v++];if(g+e>x){let e=x-g;t.moveTo(u,c),t.lineTo(u+Math.min(B,e),c),e-=B,e>0&&t.lineTo(u+B,c+Math.min(k,e)),e-=k,e>0&&t.lineTo(u+Math.max(B-e,0),c+k),e-=B,e>0&&t.lineTo(u,c+Math.max(k-e,0));break t}g+=e}t.rect(u,c,B,k);break;case Fn:if(d){const e=p[v++];if(g+e>x){const i=(x-g)/e;t.lineTo(h*(1-i)+a*i,l*(1-i)+o*i);break t}g+=e}t.closePath(),h=a,l=o}}}_calculateLength(){let t=0;if(!this.data||!this._len)return t;const e=this.data,i=this._len,n=this._ux,s=this._uy;let r=0,a=0,o=0,h=0;this._pathSegLen||(this._pathSegLen=[]);const l=this._pathSegLen;let u=0;for(let c=0;c<i;){const d=e[c++],p=1===c;p&&(r=o=e[c],a=h=e[c+1]);let f=-1;switch(d){case Pn:r=o=e[c++],a=h=e[c++];break;case Ln:{const t=e[c++],r=e[c++],a=t-o,l=r-h;(Math.abs(a)>n||Math.abs(l)>s||c==i-1)&&(f=Math.sqrt(a*a+l*l),o=t,h=r);break}case Rn:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++],r=e[c++],a=e[c++];f=xi(o,h,t,i,n,s,r,a,10),o=r,h=a;break}case zn:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++];f=Si(o,h,t,i,n,s,10),o=n,h=s;break}case Un:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++],l=e[c++];let u=e[c++];const d=l+u;c+=1,p&&(r=t+Math.cos(l)*n,a=i+Math.sin(l)*s),f=Math.max(n,s)*Math.min(Math.abs(u),2*Ei),o=Math.cos(d)*n+t,h=Math.sin(d)*s+i;break}case Wn:r=o=e[c++],a=h=e[c++],f=2*(e[c++]+e[c++]);break;case Fn:{const t=r-o,e=a-h;f=Math.sqrt(t*t+e*e),o=r,h=a;break}}f>=0&&(l[u++]=f,t+=1)}return this._pathLen=t,t}computeBoundingBox(t=new Ri){if(t.makeEmpty(),Kr.makeEmpty(),!this.data||!this._len)return t;const e=this.data;let i=0,n=0,s=0,r=0,a=0;for(a=0;a<this._len;){const o=e[a++],h=1===a;switch(h&&(i=s=e[a],n=r=e[a+1]),o){case Pn:i=s=e[a++],n=r=e[a++],Kr.setFromXYXY(i,n,i,n);break;case Ln:t.expandByXY(s,r),t.expandByXY(e[a],e[a+1]),s=e[a++],r=e[a++];break;case Rn:t.expandByCubic(s,r,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1]),s=e[a++],r=e[a++];break;case zn:t.expandByQuadratic(s,r,e[a++],e[a++],e[a],e[a+1]),s=e[a++],r=e[a++];break;case Un:const o=e[a++],l=e[a++],u=Math.abs(e[a++]),c=Math.abs(e[a++]);let d=e[a++],p=e[a++]+d;a+=1;const f=!e[a++];h&&(i=o+Math.cos(d)*u,n=l+Math.sin(d)*c),t.expandByArc(o,l,u,c,d,p,f),s=Math.cos(p)*u+o,r=Math.sin(p)*c+l;break;case Wn:i=s=e[a++],n=r=e[a++];const m=e[a++],y=e[a++];t.expandByXY(i,n),t.expandByXY(i+m,n+y);break;case qn:{const i=e[a++],n=e[a++],s=Math.abs(e[a++]),r=Math.abs(e[a++]),o=e[a++];let h=e[a++],l=e[a++];const u=!!e[a++];t.expandByEllipse(i,n,s,r,o,h,l,u);break}case Fn:s=i,r=n}t.expandByBox(Kr)}return t}applyMatrix3(t){if(!this.data||!this._len)return this;const e=this.data,i=this._len;let n=0;for(t.getScale(aa);n<i;)switch(e[n++]){case Pn:case Ln:ra.set(e[n],e[n+1]).applyMatrix3(t),e[n]=ra.x,e[n+1]=ra.y,n+=2;break;case Rn:for(let i=0;i<3;i++)ra.set(e[n+2*i],e[n+2*i+1]).applyMatrix3(t),e[n+2*i]=ra.x,e[n+2*i+1]=ra.y;n+=6;break;case zn:for(let i=0;i<2;i++)ra.set(e[n+2*i],e[n+2*i+1]).applyMatrix3(t),e[n+2*i]=ra.x,e[n+2*i+1]=ra.y;n+=4;break;case Un:ra.set(e[n],e[n+1]).applyMatrix3(t),e[n+5]=ra.x,e[n+6]=ra.y,e[n]*=aa.x,e[n+1]*=aa.y,n+=7;break;case Wn:ra.set(e[n],e[n+1]).applyMatrix3(t),e[n]=ra.x,e[n+1]=ra.y,e[n+2]*=aa.x,e[n+3]*=aa.y,n+=4;break;case qn:ra.set(e[n],e[n+1]).applyMatrix3(t);let i=[e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]];t.isTransformSkewed()?da([e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]],t,i):pa([e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]],t,i),e[n]=ra.x,e[n+1]=ra.y,e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],n+=8}return this.needsUpdate=!0,this}_pendingLine(){var t;this._ppl>0&&(null==(t=this._ctx)||t.lineTo(this._ppx,this._ppy),this._ppl=0)}beginPath(){var t;return null==(t=this._ctx)||t.beginPath(),this.reset(),this}moveTo(t,e){var i;return this._pendingLine(),this.addData(Pn,t,e),null==(i=this._ctx)||i.moveTo(t,e),this._x0=this._xi=t,this._y0=this._yi=e,this}lineTo(t,e){var i;const n=Math.abs(t-this._xi),s=Math.abs(e-this._yi);if(this.addData(Ln,t,e),n>this._ux||s>this._uy)null==(i=this._ctx)||i.lineTo(t,e),this._xi=t,this._yi=e,this._ppl=0;else{const i=n*n+s*s;i>this._ppl&&(this._ppx=t,this._ppy=e,this._ppl=i)}return this}bezierCurveTo(t,e,i,n,s,r){var a;return this._pendingLine(),this.addData(Rn,t,e,i,n,s,r),null==(a=this._ctx)||a.bezierCurveTo(t,e,i,n,s,r),this._xi=s,this._yi=r,this}quadraticCurveTo(t,e,i,n){var s;return this._pendingLine(),this.addData(zn,t,e,i,n),null==(s=this._ctx)||s.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this}arc(t,e,i,n,s,r){var a;this._pendingLine(),ia[0]=n,ia[1]=s,Ii(ia,!!r),n=ia[0];const o=(s=ia[1])-n;return this.addData(Un,t,e,i,i,n,o,0,r?0:1),null==(a=this._ctx)||a.arc(t,e,i,n,s,r),this._xi=t+Math.cos(s)*i,this._yi=e+Math.sin(s)*i,this}arcTo(t,e,i,n,s){var r;return this._pendingLine(),null==(r=this._ctx)||r.arcTo(t,e,i,n,s),this}rect(t,e,i,n){var s;return this._pendingLine(),this.addData(Wn,t,e,i,n),null==(s=this._ctx)||s.rect(t,e,i,n),this}closePath(){var t;return this._pendingLine(),this.addData(Fn),null==(t=this._ctx)||t.closePath(),this._xi=this._x0,this._yi=this._y0,this}ellipse(t,e,i,n,s,r,a,o){var h;return this._pendingLine(),this.addData(qn,t,e,i,n,s,r,a,o?1:0),null==(h=this._ctx)||h.ellipse(t,e,i,n,s,r,a,o),this}absellipse(t,e,i,n,s,r,a,o=!1){return this._pendingLine(),this.addData(qn,t,e,i,n,s,r,a,o?1:0),this}absarc(t,e,i,n,s,r=!1){return this.absellipse(t,e,i,i,0,n,s,r),this}fill(t){t.fill(),this.toStatic()}stroke(t){this._pendingLine(),t.stroke(),this.toStatic()}addArrow(t,e,i=30){if(!t||!e)return this;const n=this.getVertices();return!(null==n?void 0:n.length)||n.length<4||(t>0?(na.set(n[2],n[3]),ra.set(n[0],n[1]),sa.subVectors(na,ra),aa.lerpVectors(ra,na,e/sa.length()),oa.copy(aa).rotateAround(ra,Bi(i)),ha.copy(aa).rotateAround(ra,-Bi(i)),this.moveTo(oa.x,oa.y),this.lineTo(ra.x,ra.y),this.lineTo(ha.x,ha.y)):(na.set(n[n.length-4],n[n.length-3]),ra.set(n[n.length-2],n[n.length-1]),sa.subVectors(na,ra),aa.lerpVectors(ra,na,e/sa.length()),oa.copy(aa).rotateAround(ra,Bi(i)),ha.copy(aa).rotateAround(ra,-Bi(i)),this.moveTo(oa.x,oa.y),this.lineTo(ra.x,ra.y),this.lineTo(ha.x,ha.y))),this}getVertices(t=[]){if(!this.data||!this._len)return t;const e=this.data;for(let i=0;i<this._len;){const n=e[i++];switch(n){case Pn:case Ln:t.push(e[i++],e[i++]);break;case Rn:i+=4,t.push(e[i++],e[i++]);break;case zn:i+=2,t.push(e[i++],e[i++]);break;case Un:const s=e[i++],r=e[i++],a=e[i++],o=e[i++],h=e[i++],l=e[i++]+h;i+=2;const u=s+Math.cos(h)*a,c=r+Math.sin(h)*o;t.push(u,c);const d=s+Math.cos(l)*a,p=r+Math.sin(l)*o;t.push(d,p);break;case Wn:const f=e[i++],m=e[i++],y=e[i++],g=e[i++];t.push(f,m,f+y,m,f+y,m+g,f,m+g);break;case qn:const v=e[i++],x=e[i++],b=e[i++],_=e[i++];e[i++];const w=e[i++],S=e[i++];e[i++];const M=v+b*Math.cos(w),E=x+_*Math.sin(w);t.push(M,E);const A=v+b*Math.cos(S),T=x+_*Math.sin(S);t.push(A,T);break;case Fn:break;default:throw new Error("Invalid command "+n)}}return t}getCmds(){var t;if(!(null==(t=this.data)?void 0:t.length))throw new Error("PathProxy.getCmds: empty path.data.");const e=this.data,i=[];let n=0;for(n=0;n<e.length;)switch(e[n++]){case Pn:i.push([Pn,e[n++],e[n++]]);break;case Ln:i.push([Ln,e[n++],e[n++]]);break;case Rn:i.push([Rn,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case zn:i.push([zn,e[n++],e[n++],e[n++],e[n++]]);break;case Un:i.push([Un,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case Wn:i.push([Wn,e[n++],e[n++],e[n++],e[n++]]);break;case qn:i.push([qn,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case Fn:i.push([Fn])}return i}getControlPoints(t=[]){if(t.length=0,!this.data||!this._len)return t;const e=this.data;let i=0,n=0,s=0;for(i=0;i<this._len;)switch(e[i++]){case Pn:n=e[i],s=e[i+1],i+=2,t.push(new Oi(n,s));break;case Ln:{const r=e[i++],a=e[i++];t.push(new Oi(r,a)),n=r,s=a;break}case Rn:{const r=n,a=s,o=e[i++],h=e[i++],l=e[i++],u=e[i++],c=e[i++],d=e[i++];t.push(new Oi(r,a)),t.push(new Oi(o,h)),t.push(new Oi(l,u)),t.push(new Oi(c,d)),n=c,s=d;break}case zn:{const r=n,a=s,o=e[i++],h=e[i++],l=e[i++],u=e[i++];t.push(new Oi(r,a)),t.push(new Oi(o,h)),t.push(new Oi(l,u)),n=l,s=u;break}case Un:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++],l=e[i++],u=e[i++];e[i++],e[i++];const c=l+u,d=r+Math.cos(l)*o,p=a+Math.sin(l)*h;t.push(new Oi(d,p));const f=r+Math.cos(c)*o,m=a+Math.sin(c)*h;t.push(new Oi(f,m)),t.push(new Oi(r,a)),n=f,s=m;break}case Wn:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++];t.push(new Oi(r,a)),t.push(new Oi(r+o,a)),t.push(new Oi(r+o,a+h)),t.push(new Oi(r,a+h)),n=r,s=a;break}case qn:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++];t.push(new Oi(r,a)),o>h?(t.push(new Oi(r+o,a)),t.push(new Oi(r,a+h)),o!==h&&(t.push(new Oi(r-o,a)),t.push(new Oi(r,a-h)))):h>o?(t.push(new Oi(r+o,a)),t.push(new Oi(r,a+h)),t.push(new Oi(r-o,a)),t.push(new Oi(r,a-h))):t.push(new Oi(r+o,a)),n=r,s=a;break}}return t}getStartPoint(t=new Oi){return t.set(this._x0,this._y0)}getEndPoint(t=new Oi){return t.set(this._xi,this._yi)}}const Kr=new Ri,ta=[],ea=[],ia=[],na=new Oi,sa=new Oi,ra=new Oi,aa=new Oi,oa=new Oi,ha=new Oi,la=new Gi,ua=new Gi,ca=new Gi;function da(t,e,i=[0,0,0,0,0,0,0,0]){const[n,s,r,a,o,h,l,u]=t;i[0]=n,i[1]=s;const c=Math.cos(o),d=Math.sin(o);ra.set(r*c,r*d).applyMatrix3(e),aa.set(-a*d,a*c).applyMatrix3(e);const p=la.set(ra.x,aa.x,0,ra.y,aa.y,0,0,0,1),f=ua.copy(p).invert(),m=ca.copy(f).transpose().multiply(f).elements,y=function(t,e,i){let n,s,r,a,o=0;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(o=.5*(h+u),a=1/o,n=t*a*i-e*a*e):h<0?n=.5*(h-u):(o=.5*u,n=-.5*u),s=l>0?l+u:l-u,Math.abs(s)>2*Math.abs(e)?(a=-2*e/s,r=1/Math.sqrt(1+a*a),s=a*r):0===Math.abs(e)?(s=1,r=0):(a=-.5*s/e,s=1/Math.sqrt(1+a*a),r=a*s),l>0&&(a=s,s=-r,r=a),{rt1:o,rt2:n,cs:s,sn:r}}(m[0],m[1],m[4]),g=Math.sqrt(y.rt1),v=Math.sqrt(y.rt2);if(i[2]=1/g,i[3]=1/v,i[4]=Math.atan2(y.sn,y.cs),!((l-h)%(2*Math.PI)<Number.EPSILON)){const t=ua.set(g,0,0,0,v,0,0,0,1),n=ca.set(y.cs,y.sn,0,-y.sn,y.cs,0,0,0,1),s=t.multiply(n).multiply(p),r=t=>{const{x:e,y:i}=new Oi(Math.cos(t),Math.sin(t)).applyMatrix3(s);return Math.atan2(i,e)};i[5]=r(h),i[6]=r(l),e.isTransformFlipped()&&(i[7]=u?0:1)}return i}function pa(t,e,i=[0,0,0,0,0,0,0,0]){const[n,s,r,a,o,h,l,u]=t;i[0]=n,i[1]=s;const c=e.getTransformScaleX(),d=e.getTransformScaleY();i[2]=r*c,i[3]=a*d;const p=c>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);return i[4]=o+p,e.isTransformFlipped()&&(i[5]=-1*h,i[6]=-1*l,i[7]=u?0:1),i}class fa{static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(t){var e;if(!(null==(e=Jr.window)?void 0:e.document))throw new Error("environment not support");let i,n;if(t.containerId&&(i=Jr.window.document.getElementById(t.containerId)),i||(i=Jr.window.document.getElementsByTagName("body")[0]),t.canvasId&&(n=Jr.window.document.getElementById(t.canvasId)||void 0),t.width||(t.width=(null==i?void 0:i.offsetWidth)||100),t.height||(t.height=(null==i?void 0:i.offsetHeight)||100),t.dpr||(t.dpr=Jr.config.dpr),n)this.resizeCanvas(n,t.width,t.height,t.dpr);else{if(n=this.createHtmlCanvas(t.width,t.height,t.dpr),!n)throw new Error("error environment");t.canvasId&&n.setAttribute("id",t.canvasId),null==i||i.appendChild(n)}return n.style.background=t.background||"transparent",n}static getContext2D(t,e={}){const i={alpha:!0,willReadFrequently:!!e.willReadFrequently},n=t.getContext("2d",i);if(!n)throw new Error("getContext2D error");return n.scale(e.dpr||1,e.dpr||1),n}static resizeCanvas(t,e,i,n=1){t instanceof OffscreenCanvas?(t.width=e,t.height=i):t instanceof HTMLCanvasElement&&(t.setAttribute("width",(e*n).toString()),t.setAttribute("height",(i*n).toString()),t.style.width=e+"px",t.style.height=i+"px",t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.imageRendering="pixelated",t.style.transform="translateZ(0)")}static getImageBitmapByCanvasAsync(t){return p(this,null,(function*(){if(t)return t instanceof OffscreenCanvas?t.transferToImageBitmap():t instanceof HTMLCanvasElement?yield createImageBitmap(t):void 0}))}static get(t,e,i,n=1){let s=this.cached.get(t);return s||(s=this.create(e,i,n),this.set(t,s)),this.resizeCanvas(s,e,i,n),s}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e)}static remove(t){this.cached.has(t)&&this.cached.delete(t)}static create(t,e,i=1){var n;if(null==(n=Jr.window)?void 0:n.OffscreenCanvas)return new OffscreenCanvas(t,e);throw new Error("environment does not support")}static createHtmlCanvas(t,e,i=1){if(!Jr.window.document)throw new Error("environment does not support");const n=Jr.window.document.createElement("canvas");return this.resizeCanvas(n,t,e,i),n}static measureText(t,e,i=new Oi){if(!t)throw new Error("input error");const n=this.get("measureText",1,1).getContext("2d");if(!n)throw new Error("bufferCtx not found");e.render(n);const s=n.measureText(t);if(!s)throw new Error("measureText error");const r=s.actualBoundingBoxRight+s.actualBoundingBoxLeft,a=s.actualBoundingBoxAscent+s.actualBoundingBoxDescent;return i.set(r,a),i}static measureText2(t,e=12,i=new Oi){if(!t)throw new Error("input error");const n=this.get("measureText",1,1).getContext("2d");if(!n)throw new Error("bufferCtx not found");n.font=`${e}px sans-serif`;const s=n.measureText(t);if(!s)throw new Error("measureText error");const r=s.actualBoundingBoxRight+s.actualBoundingBoxLeft,a=s.actualBoundingBoxAscent+s.actualBoundingBoxDescent;return i.set(r,a),i}static getCtx(t,e,i,n=1){if(!ma[t]){const s=this.create(e,i,n);ma[t]={cvs:s,ctx:s.getContext("2d")},this.resizeCanvas(s,e,i,n)}return ma[t].ctx}}d(fa,"cached",new Map),d(fa,"cachedCanvas",new Map);const ma={};class ya{constructor(t){d(this,"params"),d(this,"percent"),d(this,"path"),d(this,"boundingBox",new Ri),this.params=t,this.percent=null==t?void 0:t.percent}_init(t){return this.attr(t),this}attr(t,e){if(!t)return this;if("string"==typeof t)this.attrKV(t,e);else if("object"==typeof t){let e=Object.keys(t);for(let i,n=0,s=e.length;n<s;n++)i=e[n],this.attrKV(i,t[i])}return this}attrKV(t,e){return this[t]=e,this}buildPath(t,e,i){}setPoints(t){return t&&t.length?(this.points=t,this):this}computeBoundingBox(t=new Ri){return this.boundingBox.makeEmpty(),this.path||(this.path=new Qr),this.path.reset(),this.buildPath(this.path,this),this.path.computeBoundingBox(this.boundingBox),t.copy(this.boundingBox),t}isPointInBoundingBox(t){return!!this.boundingBox&&this.boundingBox.containsPoint(t)}isPointInPath(t){return!!this.isPointInBoundingBox(t)&&("function"==typeof Path2D?this.isPointInPathByPath2D(t):this.isPointInPathByCtx(t))}isPointInPathByCtx(t){let e=!1;return ga.save(),this.buildPath(ga,this),e=ga.isPointInPath(t.x,t.y),ga.restore(),e}isPointInPathByPath2D(t){if(!Path2D)return!1;const e=new Path2D;return this.buildPath(e,this),ga.isPointInPath(e,t.x,t.y)}isBoxIntersectsBoundingBox(t){return!!this.boundingBox&&this.boundingBox.intersectsBox(t)}isBoxIntersectsPath(t){return!!this.isBoxIntersectsBoundingBox(t)}}const ga=fa.get("RAY_CASTER",10,10).getContext("2d");class va extends ya{constructor(t){super(t),this._init(t),this.flipY&&this.scale(1,-1)}initByPathProxy(t){var e;if(!t||!(null==(e=t.data)?void 0:e.length))throw new Error("GeoShape.initByPathProxy: path is required.");this.path=t;const i=t.data,n=[];let s=0;for(s=0;s<i.length;)switch(i[s++]){case Pn:n.push([Pn,i[s++],i[s++]]);break;case Ln:n.push([Ln,i[s++],i[s++]]);break;case Rn:n.push([Rn,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case zn:n.push([zn,i[s++],i[s++],i[s++],i[s++]]);break;case Un:n.push([Un,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case Wn:n.push([Wn,i[s++],i[s++],i[s++],i[s++]]);break;case qn:n.push([qn,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case Fn:n.push([Fn])}return this.cmds=n,this}computeBoundingBox(t=new Ri){return super.computeBoundingBox(t),this.boundingBox}buildPath(t,e,i){if(0===this.percent)return;const{cmds:n}=this;for(let e=0,i=(null==n?void 0:n.length)||0;e<i;e++){const[i,...s]=n[e];switch(i){case Pn:t.moveTo(...s);break;case Ln:t.lineTo(...s);break;case Rn:t.bezierCurveTo(...s);break;case zn:t.quadraticCurveTo(...s);break;case Un:t.arc(s[0],s[1],s[2],s[3],s[4],!!s[5]);break;case Fn:t.closePath();break;case Wn:t.rect(...s);break;case qn:t.ellipse(s[0],s[1],s[2],s[3],s[4],s[5],s[6],!!s[7])}}}scale(t,e){this.transform(xa.makeScale(t,e))}transform(t){const e=[],{cmds:i}=this;for(let n=0,s=(null==i?void 0:i.length)||0;n<s;n++){const[s,...r]=i[n];switch(s){case Pn:case Ln:case Wn:ba.set(r[0],r[1]).applyMatrix3(t),e[n]=[s,ba.x,ba.y];break;case Rn:ba.set(r[0],r[1]).applyMatrix3(t),_a.set(r[2],r[3]).applyMatrix3(t),wa.set(r[4],r[5]).applyMatrix3(t),e[n]=[s,ba.x,ba.y,_a.x,_a.y,wa.x,wa.y];break;case zn:ba.set(r[0],r[1]).applyMatrix3(t),_a.set(r[2],r[3]).applyMatrix3(t),e[n]=[s,ba.x,ba.y,_a.x,_a.y];break;case Un:ba.set(r[0],r[1]).applyMatrix3(t),e[n]=[s,ba.x,ba.y,r[2],r[3],r[4],r[5],r[6]];break;case qn:{ba.set(r[0],r[1]).applyMatrix3(t);const[i,a,o,h,l,u,c,d]=r,p=-l,f=-u,m=-c,y=!d;e[n]=[s,ba.x,ba.y,o,h,p,f,m,y?1:0];break}case Fn:e[n]=[s]}}this.cmds=e}}const xa=new Gi,ba=new Oi,_a=new Oi,wa=new Oi;let Sa=new WeakMap,Ma=-1;function Ea(t){var e,i;const n=[];return"string"==typeof t.fill?n.push(t.fill):(null==(e=t.fill)?void 0:e.isColor)?n.push(t.fill.getHexString()):t.fill instanceof CanvasGradient||t.fill instanceof CanvasPattern?Sa.has(t.fill)||Sa.set(t.fill,"gradientPattern_"+ ++Ma):n.push(""),"string"==typeof t.stroke?n.push(t.stroke):(null==(i=t.stroke)?void 0:i.isColor)?n.push(t.stroke.getHexString()):t.stroke instanceof CanvasGradient||t.stroke instanceof CanvasPattern?Sa.has(t.stroke)||Sa.set(t.stroke,"gradientPattern_"+ ++Ma):n.push(""),n.push(void 0!==t.lineWidth?t.lineWidth.toString():""),n.push(void 0!==t.lineDash?t.lineDash.toString():""),n.push(void 0!==t.lineDashOffset?t.lineDashOffset.toString():""),n.push(void 0!==t.lineCap?t.lineCap.toString():""),n.push(void 0!==t.fillOpacity?t.fillOpacity.toString():""),n.push(void 0!==t.strokeOpacity?t.strokeOpacity.toString():""),n.push(void 0!==t.opacity?t.opacity.toString():""),t.isText&&(n.push(void 0!==t.text?t.text:""),n.push(void 0!==t.fontSize?t.fontSize.toString():"")),n.join("_")}class Aa{constructor(t){d(this,"fill"),d(this,"stroke"),d(this,"lineWidth"),d(this,"lineDash"),d(this,"lineDashOffset"),d(this,"lineCap"),d(this,"lineJoin"),d(this,"fillOpacity"),d(this,"strokeOpacity"),d(this,"opacity"),d(this,"featureKey"),d(this,"map"),this.fill=null==t?void 0:t.fill,this.stroke=null==t?void 0:t.stroke,this.lineWidth=null==t?void 0:t.lineWidth,this.lineDash=null==t?void 0:t.lineDash,this.lineDashOffset=null==t?void 0:t.lineDashOffset,this.lineCap=(null==t?void 0:t.lineCap)||"round",this.lineJoin=(null==t?void 0:t.lineJoin)||"miter",void 0!==(null==t?void 0:t.fillOpacity)?this.fillOpacity=null==t?void 0:t.fillOpacity:this.fillOpacity=1,this.featureKey=Ea(this)}}class Ta extends ya{constructor(t){super(t),this._init(t)}buildPath(t,e,i){const n=this.percent;if(0===n)return;let{x1:s,y1:r,x2:a,y2:o}=e||this;s&&r&&a&&o&&(t.moveTo(s,r),n&&n<1&&(a=s*(1-n)+a*n,o=r*(1-n)+o*n),t.lineTo(a,o))}}class Ia extends wn{constructor(t=new Ta,e=new Aa,i){super(i),d(this,"name","Shape"),d(this,"isShape",!0),d(this,"geo"),d(this,"mtl"),d(this,"boundingBox",new Ri),this.geo=t,this.mtl=e,(null==i?void 0:i.name)&&(this.name=i.name)}destroy(){super.destroy()}computeBoundingBox(){this.boundingBox.makeEmpty(),this.geo.computeBoundingBox(this.boundingBox);for(let t=0,e=this.children.length;t<e;t++)this.boundingBox.union(this.children[t].computeBoundingBox());return this.boundingBox}buildPath(t,e,i){this.geo.buildPath(t)}raycast(t,e=[]){var i,n;if(super.raycast(t,e),!this.boundingBox||this.boundingBox.isEmpty())return e;if(this.boundingBoxWorld.isEmpty()&&this.updateBoundingBox(),t.intersectType)Na.copy(t.worldBox),(Na.containsBox(this.boundingBoxWorld)||(null==(n=this.geo)?void 0:n.isBoxIntersectsPath(Na.applyMatrix3(Da.copy(this.matrixWorld).invert()))))&&e.push(this);else{if(!this.boundingBoxWorld.containsPoint(t.worldCoords))return e;Ca.copy(t.worldCoords).applyMatrix3(Da.copy(this.matrixWorld).invert()),this.composeNode?this.traverseSome((t=>t.geo.isPointInPath(Ca)))&&e.push(this):(null==(i=this.geo)?void 0:i.isPointInPath(Ca))&&e.push(this)}return e}clone(t=!0,e=!1){return new(0,this.constructor)(this.geo,this.mtl).copy(this,t,e)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.params=mi.merge(this.params,t),this.renderOrder=t.renderOrder,i?(this.geo=mi.cloneDeep(t.geo),this.mtl=mi.cloneDeep(t.mtl)):(this.geo=t.geo,this.mtl=t.mtl),this}}const Ca=new Oi,Da=new Gi,Na=new Ri,Ba="#45b787",ka="#21532fff",Oa="#6e9bc5",Pa="#2775b6",La="#F26666",Ra="#D95970",za="#ECDEC0",Ua="#D0AC57",Fa="#918883",Wa="#F2F2F2",qa="#2E3032",Ha="#182327",Va={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ja={h:0,s:0,l:0},Ya={h:0,s:0,l:0};function Ga(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}const Xa=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Za{constructor(t,e,i,n){return d(this,"isColor",!0),d(this,"r",1),d(this,"g",1),d(this,"b",1),d(this,"a",1),void 0===e&&void 0===i?this.set(t):this.setRGBA(t,e,i,n)}static isColor(t){return"string"==typeof t?Xa.test(t):"number"==typeof t&&Number.isInteger(t)&&t>=0&&t<=16777215&&6===t.toString(6).length}static getRandomStyle(t){return t?$a.random().setA(t).getStyle():$a.random().getStyle()}static getDarken(t,e=.8){return $a.set(t).getHSL(Ja),$a.setHSL(Ja.h,Ja.s,Ja.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return $a.set(t),$a.getContrastString()}static getArray(t){return $a.set(t).toArray()}static getComplementary(t){return $a.set(t),$a.getComplementaryString()}static getMoreTransparent(t,e){return $a.set(t).setA(e).getStyle()}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(t){return this.r=t,this.g=t,this.b=t,this.a=1,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this.a=1,this}setR(t){return this.r=t,this}setG(t){return this.g=t,this}setB(t){return this.b=t,this}setA(t){return this.a=t,this}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a)}setRGBA(t,e,i,n=1){return this.r=t,this.g=e,this.b=i,this.a=n,this}setHSL(t,e,i,n=1){var s;if(t=(t%(s=1)+s)%s,e=Di(e,0,1),i=Di(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,s=2*i-n;this.r=Ga(s,n,t+1/3),this.g=Ga(s,n,t),this.b=Ga(s,n,t-1/3)}return this.a=n,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const i=e[1],n=e[2];switch(i){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,this.a=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,this.a=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n)){const e=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,n=parseInt(t[3],10)/100,s=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0);return this.setHSL(e,i,n,s)}}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=e[1],i=t.length;if(3===i)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this.a=1,this;if(6===i)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Va[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}clone(){return new Za(this.r,this.g,this.b,this.a)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}getRGB(t=new Za){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Za){const e=this.a,i=e*this.r+(1-e)*t.r,n=e*this.g+(1-e)*t.g,s=e*this.b+(1-e)*t.b;return new Za(i,n,s)}getHex(){return Di(255*this.r,0,255)<<16^Di(255*this.g,0,255)<<8^Di(255*this.b,0,255)}getHSL(t){const e=this.r,i=this.g,n=this.b,s=Math.max(e,i,n),r=Math.min(e,i,n);let a,o=0;const h=(r+s)/2;if(r===s)o=0,a=0;else{const t=s-r;switch(a=h<=.5?t/(s+r):t/(2-s-r),s){case e:o=(i-n)/t+(i<n?6:0);break;case i:o=(n-e)/t+2;break;case n:o=(e-i)/t+4}o/=6}return t.h=o,t.s=a,t.l=h,t}getStyle(){return 1===this.a?`rgb(${255*this.r|0},${255*this.g|0},${255*this.b|0})`:`rgba(${255*this.r|0},${255*this.g|0},${255*this.b|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let t=(255*this.r*299+255*this.g*587+255*this.b*144)/1e3;return t+=(255-t)*(255-255*this.a)/255,t}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(t=new Za){const e=this.toArray(),i=[0,0,0,1];for(let t=0;t<e.length;t++)if(t<3)i[t]=1-e[t];else{if(3!==t)continue;e[t]>1||e[t]<=0?i[t]=1:i[t]=Math.max(Math.min(parseFloat(e[t].toFixed(2)),1),0)}return t.setRGBA(i[0],i[1],i[2],parseFloat(i[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(void 0===t||t>=1)return this.getHexString();const e=this.getRGBByBg(),i=e.r*t+(1-t),n=e.g*t+(1-t),s=e.b*t+(1-t);return new Za(i,n,s).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(t,e,i){return this.getHSL(ja),ja.h+=t,ja.s+=e,ja.l+=i,this.setHSL(ja.h,ja.s,ja.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(ja),t.getHSL(Ya);const i=ki(ja.h,Ya.h,e),n=ki(ja.s,Ya.s,e),s=ki(ja.l,Ya.l,e);return this.setHSL(i,n,s),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[0,0,0,0],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const $a=new Za,Ja={h:0,s:0,l:0};class Qa extends Aa{constructor(t){super(t),d(this,"text"),d(this,"isText",!0),d(this,"fontFamily","Arial"),d(this,"fontSize",12),d(this,"fontStyle",io),d(this,"fontWeight",io),d(this,"fontVariant",io),d(this,"textDecoration",""),d(this,"textAlign",Ka),d(this,"verticalAlign",to),d(this,"textBaseline",eo),d(this,"lineHeight",1),d(this,"letterSpacing",0),d(this,"wrap",no),d(this,"ellipsis",!1),this.text=null==t?void 0:t.text,this.fill=(null==t?void 0:t.fill)||Ha,this.fontFamily=(null==t?void 0:t.fontFamily)||"Arial",this.fontSize=(null==t?void 0:t.fontSize)||12,this.fontStyle=(null==t?void 0:t.fontStyle)||io,this.fontWeight=(null==t?void 0:t.fontWeight)||io,this.textAlign=(null==t?void 0:t.textAlign)||Ka,this.textBaseline=(null==t?void 0:t.textBaseline)||eo,this.featureKey=Ea(this)}}const Ka="center",to="top",eo="middle",io="normal",no="word";class so{static hasCache(t){return void 0!==ro[t]}static setCache(t,e){ro[t]=e}static getCache(t){return ro[t]}static getCachedFeatureKeys(){return Object.keys(ro)}static getMtl(t,e){let i=Ea(t);return e&&(i=`${e}_${i}`),this.hasCache(i)||(t.text?this.setCache(i,new Qa(t)):this.setCache(i,new Aa(t))),this.getCache(i)}}const ro={};class ao extends ya{constructor(t){super(t),this._init(t)}buildPath(t,e,i){if(0===this.percent)return;let{points:n}=e||this;if(n&&n.length&&!(n.length<2)){for(let e=0,i=n.length;e<i;e+=2)e?t.lineTo(n[e],n[e+1]):t.moveTo(n[e],n[e+1]);t.closePath()}}}class oo extends Ia{constructor(t={}){void 0===t.fontSize&&(t.fontSize=12),void 0===t.renderOrder&&(t.renderOrder=1),super(new ao(t),new Qa(t)),d(this,"name","Text"),d(this,"isText",!0),d(this,"size",new Oi),t.wireframe&&(this.wireframe=!0)}computeBoundingBox(){var t;if(!(null==(t=this.mtl)?void 0:t.text))return this.boundingBox;this.updateMatrixWorld(!0),fa.measureText2(this.mtl.text||"",this.mtl.fontSize,this.size);const e=[];return e.push(-this.size.x/2,-this.size.y/2),e.push(e[0],e[1]+this.size.y),e.push(e[2]+this.size.x,e[3]),e.push(e[3],e[1]),this.geo.setPoints(e),super.computeBoundingBox(),this.boundingBox}buildPath(t,e,i){this.wireframe&&this.geo.buildPath(t)}}class ho{constructor(){d(this,"instancedMesh",!1),d(this,"_xml"),d(this,"_symbolsNodeMap",{}),d(this,"paths",[]),d(this,"labels",[]),d(this,"symbolsMap",{}),d(this,"instances",[]),d(this,"_viewBox",new Ri),d(this,"_isInDefs",!1),d(this,"_transformStack",[]),d(this,"_currentTransform",new Gi),d(this,"centralInitialized",!1),d(this,"centralPoint",new Oi),d(this,"defaultUnit","px"),d(this,"defaultDPI",90),d(this,"stylesheets",{}),d(this,"float2Int",!0),d(this,"scaleFactor",1),d(this,"ASSET_TYPES",[])}static createSVG(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.setAttribute("width",t.toString()),i.setAttribute("height",e.toString()),i}static createSVGPath(t){const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d",t),e}static createSVGText(t,e,i){const n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x",e.toString()),n.setAttribute("y",i.toString()),n.textContent=t,n}static getInstance(){return lo}static setInstancedMesh(t){return this.getInstance().setInstancedMesh(t)}static parse(t,e={}){return this.getInstance().parse(t,e)}static getBoundingBoxByNode(t,e=new Ri){if(e.makeEmpty(),!t)return e;if("text"===t.nodeName){if("function"==typeof t.getBBox){const i=t.getBBox();e.min.set(i.x,i.y),e.max.set(i.x+i.width,i.y+i.height)}const i=t.textContent||"",n=parseInt(t.getAttribute("font-size")||"12");return fa.measureText2(i,n,bo),bo.validate()&&(e.getCenter(_o),e.min.setY(_o.y-bo.y/2),e.max.setY(_o.y+bo.y/2)),this.parseNodeTransform(t,mo),parseInt(t.getAttribute("stroke-width")||"0"),e.applyMatrix3(mo),e}const i=ho.getInstance().parseNode(t);if(!i.length)return e;for(let t=0,n=i.length;t<n;t++)i[t].computeBoundingBox(wo),e.union(wo);return e}static parseNodeTransform(t,e){return ho.getInstance().parseNodeTransform(t,void 0,e)}static getSvgPathDByData(t){if(!t||0===t.length)return"";const e=Array.isArray(t)?t:Array.from(t);let i="",n=0;for(;n<e.length;)switch(e[n++]){case Pn:i+=`M${e[n++]} ${e[n++]}`;break;case Ln:i+=`L${e[n++]} ${e[n++]}`;break;case Rn:i+=`C${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]}`;break;case zn:i+=`Q${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]}`;break;case Un:const t=e[n++],s=e[n++],r=e[n++],a=e[n++],o=e[n++],h=e[n++],l=e[n++],u=e[n++],c=t+Math.cos(o+h)*r,d=s+Math.sin(o+h)*a;i+=`A${r} ${a} ${l} ${Math.abs(h)>Math.PI?1:0} ${u?0:1} ${c} ${d}`;break;case Wn:const p=e[n++],f=e[n++],m=e[n++],y=e[n++];i+=`M${p} ${f} L${p+m} ${f} L${p+m} ${f+y} L${p} ${f+y} Z`;break;case qn:const g=e[n++],v=e[n++],x=e[n++],b=e[n++],_=e[n++],w=e[n++],S=e[n++],M=e[n++],E=g+Math.cos(w)*x,A=v+Math.sin(w)*b,T=g+Math.cos(S)*x,I=v+Math.sin(S)*b;i+=`M${E} ${A} A${x} ${b} ${_} ${Math.abs(S-w)>Math.PI?1:0} ${M?0:1} ${T} ${I}`;break;case Fn:i+="Z"}return i}static getPathProxyBySvgPathD(t,e){return ho.getInstance().getPathProxyBySvgPathD(t,e)}setInstancedMesh(t){return this.instancedMesh=t,this}dispose(){this._xml=void 0,this._symbolsNodeMap={},this.paths=[],this.labels=[],this.symbolsMap={},this.instances=[],this._viewBox.makeEmpty(),this._isInDefs=!1,this._transformStack=[],this._currentTransform.identity(),this.centralPoint.identity(),this.centralInitialized=!1,this.stylesheets={},this.ASSET_TYPES=[]}parse(t,e={}){var i;this.dispose();const n=(new DOMParser).parseFromString(t,"image/svg+xml");this._xml=n.documentElement,function(t,e=new Ri){if(!t)return e;let i=t.split(" "),n=mi.map(i,(t=>parseFloat(t)));4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3]))}((null==(i=this._xml)?void 0:i.getAttribute("viewBox"))||"",this._viewBox),this._viewBox.getCenter(this.centralPoint);const s=ln(this._xml),r=function(t,e=[]){return e.length=0,un(t||[],(t=>{var i;if("assets"===t.label&&(null==(i=t.children)?void 0:i.length))for(let i,n=0,s=t.children.length;n<s;n++)i=t.children[n],i.label&&e.push(mi.head(mi.split(i.label,"-"))||"")})),e=mi.uniq(mi.compact(e))}(s);this.ASSET_TYPES=mi.uniq(mi.compact([...r,...Object.values(dn)])),this.parseNode(this._xml,e,this.paths);const a={xml:this._xml,viewBox:this._viewBox.clone(),idsTree:s,assetTypes:r,paths:this.paths,labels:this.labels};return this.instancedMesh&&(a.symbolsMap=this.symbolsMap,a.instances=this.instances),a}getViewBox(t,e=new Ri){let i=((null==t?void 0:t.getAttribute("viewBox"))||"").split(" "),n=mi.map(i,(t=>parseFloat(t)));return 4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3])),e}parseNode(t,e={},i=[],n,s){var r,a,o;if(1!==t.nodeType)return i;let h=!1;const l="function"==typeof t.getAttribute?t.getAttribute("id"):null,u=this.getNodeTransform(t,e);let c;const d=(t={},e,i)=>{if(!t)return;const s=(null==i?void 0:i.assetType)||this.getAssetType(e),r=(null==i?void 0:i.layerType)||this.getAssetType(e,"layer");return mi.set(t,"userData",{pid:n,id:l||n,nodeName:e.nodeName,layerType:r,assetType:s,style:Object.assign({},i)}),t};switch(t.nodeName){case"svg":case"g":e=this.parseStyle(t,e);break;case"defs":h=!0,this._isInDefs=!0;break;case"style":this.parseCSSStylesheetByTextContent(t);break;case"symbol":if(!l||!this._isInDefs&&this.symbolsMap[l]){if(!this._isInDefs&&l){const t=this.symbolsMap[l],e=(null==t?void 0:t.paths)||[];for(let n=0,s=(null==e?void 0:e.length)||0;n<s;n++)c=e[n],c&&(c=c.clone(),mi.set(c,"userData",Object.assign({},t.userData)),this.transformPath(c,this._currentTransform),i.push(c));return u&&(this._transformStack.pop(),this._transformStack.length>0?this._currentTransform.copy(this._transformStack[this._transformStack.length-1]):this._currentTransform.identity()),i}}else e=this.parseStyle(t,e),this._symbolsNodeMap[l]=t,mi.set(this.symbolsMap,`[${l}].symbolId`,l),mi.set(this.symbolsMap,`[${l}].style`,e);break;case"use":const p=(t.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),f=this._symbolsNodeMap[p],m=this.symbolsMap[p];if(f&&(e=this.parseStyle(f,e)),void 0===(e=this.parseStyle(t,e)).assetType&&(e.assetType=this.getAssetType(t)),void 0===e.layerType&&(e.layerType=this.getAssetType(t,"layer")),!this._isInDefs&&this.instancedMesh&&m){const i={symbolId:p,transform:this._currentTransform.clone(),userData:{}};d(i,t,e),this.instances.push(i)}else f&&(d(m,t,e),this.parseNode(f,e,i,l||n,s));break;case"path":e=this.parseStyle(t,e),t.hasAttribute("d")&&(c=this.parsePathNode(t,s));break;case"rect":e=this.parseStyle(t,e),c=this.parseRectNode(t,s);break;case"polygon":e=this.parseStyle(t,e),c=this.parsePolygonNode(t,s);break;case"polyline":e=this.parseStyle(t,e),c=this.parsePolylineNode(t,s);break;case"circle":e=this.parseStyle(t,e),c=this.parseCircleNode(t,s);break;case"ellipse":e=this.parseStyle(t,e),c=this.parseEllipseNode(t,s);break;case"line":e=this.parseStyle(t,e),c=this.parseLineNode(t,s);break;case"text":e=this.parseStyle(t,e);const y=this.parseTextNode(t,e,s);if(!y)return i;d(y,t,e),n||mi.set(y,"userData.pid",this.getId(t)),mi.set(y,"userData.textContent",t.textContent),mi.set(y,"transform",this._currentTransform.clone()),mi.set(y,"userData.id",mi.get(y,"userData.id")),mi.set(y,"userData.pid",this.getParentId(t,n));const g=this.getLabelAssetId(t);if(g?mi.set(y,"userData.aid",g):mi.set(y,"userData.aid",mi.split((null==(r=null==y?void 0:y.userData)?void 0:r.id)||"","-").splice(2).join("-")),this._isInDefs&&this.symbolsMap[null==(a=y.userData)?void 0:a.pid]){const t=y.userData.pid,e=(null==(o=this.symbolsMap[t])?void 0:o.labels)||[];e.push(y),mi.set(this.symbolsMap,`[${t}].labels`,e)}else this.labels.push(y)}c&&(d(c,t,e),this.transformPath(c,this._currentTransform),i.push(c));const p=t.childNodes;for(let t,n=0,r=p.length;n<r;n++)if(t=p[n],!h||"style"===t.nodeName||"symbol"===t.nodeName)if(this._isInDefs&&"symbol"===t.nodeName){const i=t.getAttribute("id");if(i){const n=this.parseNode(t,e);mi.set(this.symbolsMap,`[${i}].paths`,n)}}else this.parseNode(t,e,i,l,s);return u&&(this._transformStack.pop(),this._transformStack.length>0?this._currentTransform.copy(this._transformStack[this._transformStack.length-1]):this._currentTransform.identity()),h&&(this._isInDefs=!1),i}transformPath(t,e){t.applyMatrix3(e)}getNodeTransform(t,e){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))||"text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))))return null;const i=this.parseNodeTransform(t,e);return this._transformStack.length>0&&i.premultiply(this._transformStack[this._transformStack.length-1]),this._currentTransform.copy(i),this._transformStack.push(i),i}parseNodeTransform(t,e,i=new Gi){var n;i.identity(),this.centralInitialized&&(i.translate(-this.centralPoint.x,-this.centralPoint.y),this.centralInitialized=!0);const s=yo;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){const e=this.parseFloatWithUnits(t.getAttribute("x")),n=this.parseFloatWithUnits(t.getAttribute("y"));i.translate(e,n)}else if("text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))){const n=t.hasAttribute("dx")?this.parseFloatWithUnits(t.getAttribute("dx")||0,{fontSize:null==e?void 0:e.fontSize}):0,s=t.hasAttribute("dy")?this.parseFloatWithUnits(t.getAttribute("dy")||0,{fontSize:null==e?void 0:e.fontSize}):0;i.translate(n,s)}if(t.hasAttribute("transform")){const e=null==(n=t.getAttribute("transform"))?void 0:n.split(")");if(!(null==e?void 0:e.length))return i;for(let t=((null==e?void 0:e.length)||0)-1;t>=0;t--){const n=e[t].trim();if(""===n)continue;const r=n.indexOf("("),a=n.length;if(r>0&&r<a){const t=n.slice(0,r),e=this.parseFloats(n.slice(r+1));switch(s.identity(),t){case"translate":if(e.length>=1){const t=e[0];let i=0;e.length>=2&&(i=e[1]),s.translate(t,i)}break;case"rotate":if(e.length>=1){let t=0,i=0,n=0;t=e[0]*Math.PI/180,e.length>=3&&(i=e[1],n=e[2]),go.makeTranslation(-i,-n),vo.makeRotation(t),xo.multiplyMatrices(vo,go),go.makeTranslation(i,n),s.multiplyMatrices(go,xo)}break;case"scale":if(e.length>=1){const t=e[0];let i=t;e.length>=2&&(i=e[1]),s.scale(t,i)}break;case"skewX":1===e.length&&s.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&s.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&s.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}i.premultiply(s)}}return i}parseStyle(t,e){var i;e=Object.assign({},e);let n={};if(t.hasAttribute("class")){const e=null==(i=t.getAttribute("class"))?void 0:i.split(/\s/).filter(Boolean).map((t=>t.trim())).map((t=>t.startsWith(".")?t.substring(1):t));for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++)n=Object.assign(n,this.stylesheets["."+e[t]])}function s(i,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(i)&&(e[s]=r(t.getAttribute(i))),n[i]&&(e[s]=r(n[i])),t.style&&""!==t.style[i]&&(e[s]=r(t.style[i]))}t.hasAttribute("id")&&(n=Object.assign(n,this.stylesheets["#"+t.getAttribute("id")]));const{fontSize:r,strokeWidth:a}=e,o=this;function h(t){return Math.max(0,Math.min(1,o.parseFloatWithUnits(t)))}function l(t){return Math.max(0,o.parseFloatWithUnits(t,{fontSize:r}))}s("font-size","fontSize",l),s("fill","fill"),s("fill-opacity","fillOpacity",h),s("fill-rule","fillRule"),s("opacity","opacity",h),s("stroke","stroke"),s("stroke-opacity","strokeOpacity",h),s("stroke-width","strokeWidth",(function(t){return Math.max(0,o.parseFloatWithUnits(t,{strokeWidth:a,noDef:!0}))})),s("stroke-linejoin","strokeLineJoin"),s("stroke-linecap","strokeLineCap"),s("stroke-miterlimit","strokeMiterLimit",l),s("visibility","visibility");const u=t.getAttribute("stroke-width")||e.strokeWidth;return mi.endsWith(u,"%")&&(e.thinLine=!0),"none"!==e.fill&&"transparent"!==e.fill||delete e.fill,"none"!==e.stroke&&"transparent"!==e.stroke||delete e.stroke,e}parseCSSStylesheetByTextContent(t){const e=t.textContent.replace(/\/\*[\s\S]*?\*\//g,"").replace(/([^;])}/g,"$1;}"),i=[];let n="",s=0;for(const t of e)"{"===t?s++:"}"===t&&s--,n+=t,"}"===t&&0===s&&(i.push(n.trim()),n="");for(const t of i){if(!t.includes("{"))continue;const[e,i]=t.split(/\s*\{\s*/);if(!e||!i)continue;const n=e.split(",").map((t=>t.trim())).filter(Boolean),s={};i.replace(/}\s*$/,"").split(";").map((t=>t.trim())).filter(Boolean).forEach((t=>{const[e,i]=t.split(/:\s*/);if(e&&i){const t=i.replace(/\s*!important\s*$/,"").trim();s[e.trim()]=t}})),n.forEach((t=>{t&&(this.stylesheets[t]=u(u({},this.stylesheets[t]||{}),s))}))}}parsePathNode(t,e=!1){const i=t.getAttribute("d");if(i&&""!==i&&"none"!==i)return this.getPathProxyBySvgPathD(i,void 0,e)}getPathProxyBySvgPathD(t,e=new Qr,i=!1){if(!t)return;const n=new Oi,s=new Oi,r=new Oi;let a=!0,o=!1;const h=t.match(/[a-df-z][^a-df-z]*/gi);if(null==h?void 0:h.length){for(let t=0,l=(null==h?void 0:h.length)||0;t<l;t++){const l=h[t],u=l.charAt(0),c=l.slice(1).trim();let d;switch(!0===a&&(o=!0,a=!1),u){case"M":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x=i?d[t]:this.normalizeX(d[t]),n.y=i?d[t+1]:this.normalizeY(d[t+1]),s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&r.copy(n);break;case"H":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.x=i?d[t]:this.normalizeX(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"V":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.y=i?d[t]:this.normalizeY(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"L":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x=i?d[t]:this.normalizeX(d[t]),n.y=i?d[t+1]:this.normalizeY(d[t+1]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"C":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=6)t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3]),this.normalizeX(d[a+4]),this.normalizeY(d[a+5])],e.bezierCurveTo(...t),s.x=t[2],s.y=t[3],n.x=t[4],n.y=t[5],0===a&&!0===o&&r.copy(n);break;case"S":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3])],e.bezierCurveTo(this.getReflection(n.x,s.x),this.getReflection(n.y,s.y),t[0],t[1],t[2],t[3]),s.x=t[0],s.y=t[1],n.x=t[2],n.y=t[3],0===a&&!0===o&&r.copy(n);break;case"Q":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3])],e.quadraticCurveTo(t[0],t[1],t[2],t[3]),s.x=t[0],s.y=t[1],n.x=t[2],n.y=t[3],0===a&&!0===o&&r.copy(n);break;case"T":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=2){const h=this.getReflection(n.x,s.x),l=this.getReflection(n.y,s.y);t=i?[d[a],d[a+1]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1])],e.quadraticCurveTo(h,l,t[0],t[1]),s.x=h,s.y=l,n.x=t[0],n.y=t[1],0===a&&!0===o&&r.copy(n)}break;case"A":d=this.parseFloats(c,[3,4],7);for(let t,a=0,h=d.length;a<h;a+=7){if(t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5],d[a+6]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),d[a+2],d[a+3],d[a+4],this.normalizeW(d[a+5]),this.normalizeH(d[a+6])],t[5]==n.x&&t[6]==n.y)continue;const h=n.clone();n.x=t[5],n.y=t[6],s.x=n.x,s.y=n.y,this.parseArcCommand(e,t[a],t[1],t[2],t[3],t[4],h,n),0===a&&!0===o&&r.copy(n)}break;case"m":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x+=i?d[t]:this.normalizeW(d[t]),n.y+=i?d[t+1]:this.normalizeH(d[t+1]),s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&r.copy(n);break;case"h":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.x+=i?d[t]:this.normalizeW(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"v":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.y+=i?d[t]:this.normalizeH(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"l":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x+=i?d[t]:this.normalizeW(d[t]),n.y+=i?d[t+1]:this.normalizeH(d[t+1]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"c":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=6)t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3]),this.normalizeW(d[a+4]),this.normalizeH(d[a+5])],e.bezierCurveTo(n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3],n.x+t[4],n.y+t[5]),s.x=n.x+t[2],s.y=n.y+t[3],n.x+=t[4],n.y+=t[5],0===a&&!0===o&&r.copy(n);break;case"s":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3])],e.bezierCurveTo(this.getReflection(n.x,s.x),this.getReflection(n.y,s.y),n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3]),s.x=n.x+t[0],s.y=n.y+t[1],n.x+=t[2],n.y+=t[3],0===a&&!0===o&&r.copy(n);break;case"q":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3])],e.quadraticCurveTo(n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3]),s.x=n.x+t[0],s.y=n.y+t[1],n.x+=t[2],n.y+=t[3],0===a&&!0===o&&r.copy(n);break;case"t":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=2){const h=this.getReflection(n.x,s.x),l=this.getReflection(n.y,s.y);t=i?[d[a],d[a+1]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1])],e.quadraticCurveTo(h,l,n.x+t[0],n.y+t[1]),s.x=h,s.y=l,n.x=n.x+t[0],n.y=n.y+t[1],0===a&&!0===o&&r.copy(n)}break;case"a":d=this.parseFloats(c,[3,4],7);for(let t,a=0,h=d.length;a<h;a+=7){if(t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5],d[a+6]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),d[a+2],d[a+3],d[a+4],this.normalizeW(d[a+5]),this.normalizeH(d[a+6])],0==t[5]&&0==t[6])continue;const h=n.clone();n.x+=t[5],n.y+=t[6],s.x=n.x,s.y=n.y,this.parseArcCommand(e,t[0],t[1],t[2],t[3],t[4],h,n),0===a&&!0===o&&r.copy(n)}break;case"Z":case"z":e.closePath()}o=!1}return e}}parseArcCommand(t,e,i,n,s,r,a,o){if(0==e||0==i)return void t.lineTo(o.x,o.y);n=n*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const h=(a.x-o.x)/2,l=(a.y-o.y)/2,u=Math.cos(n)*h+Math.sin(n)*l,c=-Math.sin(n)*h+Math.cos(n)*l;let d=e*e,p=i*i;const f=u*u,m=c*c,y=f/d+m/p;if(y>1){const t=Math.sqrt(y);d=(e*=t)*e,p=(i*=t)*i}const g=d*m+p*f,v=(d*p-g)/g;let x=Math.sqrt(Math.max(0,v));s===r&&(x=-x);const b=x*e*c/i,_=-x*i*u/e,w=Math.cos(n)*b-Math.sin(n)*_+(a.x+o.x)/2,S=Math.sin(n)*b+Math.cos(n)*_+(a.y+o.y)/2,M=this.svgAngle(1,0,(u-b)/e,(c-_)/i),E=this.svgAngle((u-b)/e,(c-_)/i,(-u-b)/e,(-c-_)/i)%(2*Math.PI);t.absellipse(w,S,e,i,n,M,M+E,0===r)}svgAngle(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}parseRectNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("x")||0),n=this.parseFloatWithUnits(t.getAttribute("y")||0),s=this.parseFloatWithUnits(t.getAttribute("rx")||t.getAttribute("ry")||0),r=this.parseFloatWithUnits(t.getAttribute("ry")||t.getAttribute("rx")||0),a=this.parseFloatWithUnits(t.getAttribute("width")),o=this.parseFloatWithUnits(t.getAttribute("height"));e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s),r=this.normalizeH(r),a=this.normalizeW(a),o=this.normalizeH(o));const h=.448084975506,l=new Qr;return l.moveTo(i+s,n),l.lineTo(i+a-s,n),0===s&&0===r||l.bezierCurveTo(i+a-s*h,n,i+a,n+r*h,i+a,n+r),l.lineTo(i+a,n+o-r),0===s&&0===r||l.bezierCurveTo(i+a,n+o-r*h,i+a-s*h,n+o,i+a-s,n+o),l.lineTo(i+s,n+o),0===s&&0===r||l.bezierCurveTo(i+s*h,n+o,i,n+o-r*h,i,n+o-r),l.lineTo(i,n+r),0===s&&0===r||l.bezierCurveTo(i,n+r*h,i+s*h,n,i+s,n),l}parsePolygonNode(t,e=!1){var i;const n=this,s=new Qr;let r=0;return null==(i=t.getAttribute("points"))||i.replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,i,a){const o=e?n.parseFloatWithUnits(i):n.normalizeX(n.parseFloatWithUnits(i)),h=e?n.parseFloatWithUnits(a):n.normalizeY(n.parseFloatWithUnits(a));return 0===r?s.moveTo(o,h):s.lineTo(o,h),r++,t})),s.autoClose=!0,s}parsePolylineNode(t,e=!1){var i;const n=this,s=new Qr;let r=0;return null==(i=t.getAttribute("points"))||i.replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,i,a){const o=e?n.parseFloatWithUnits(i):n.normalizeX(n.parseFloatWithUnits(i)),h=e?n.parseFloatWithUnits(a):n.normalizeY(n.parseFloatWithUnits(a));return 0===r?s.moveTo(o,h):s.lineTo(o,h),r++,t})),s.autoClose=!1,s}parseCircleNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("cx")||0),n=this.parseFloatWithUnits(t.getAttribute("cy")||0),s=this.parseFloatWithUnits(t.getAttribute("r")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s));const r=new Qr;return r.absarc(i,n,s,0,2*Math.PI),r}parseEllipseNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("cx")||0),n=this.parseFloatWithUnits(t.getAttribute("cy")||0),s=this.parseFloatWithUnits(t.getAttribute("rx")||0),r=this.parseFloatWithUnits(t.getAttribute("ry")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s),r=this.normalizeH(r));const a=new Qr;return a.absellipse(i,n,s,r,0,0,2*Math.PI,!1),a}parseLineNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("x1")||0),n=this.parseFloatWithUnits(t.getAttribute("y1")||0),s=this.parseFloatWithUnits(t.getAttribute("x2")||0),r=this.parseFloatWithUnits(t.getAttribute("y2")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeX(s),r=this.normalizeY(r));const a=new Qr;return a.moveTo(i,n),a.lineTo(s,r),a}parseTextNode(t,e,i=!1){let n=parseFloat(t.getAttribute("x")||"0"),s=parseFloat(t.getAttribute("y")||"0");i||(n=this.normalizeX(n),s=this.normalizeY(s));const r=t.textContent;if(!r||!e.fontSize)return;const a=Object.assign({},e);return a.fill=t.getAttribute("fill")||e.fill||"#000",a.fontSize=parseFloat(t.getAttribute("font-size")||"0")||parseFloat(e.fontSize)||72,a.fontFamily=t.getAttribute("font-family")||e.fontFamily||"Arial",{textContent:r,style:a,userData:{}}}parseFloatWithUnits(t,e){let i,n="px";if("string"==typeof t||t instanceof String){t=null==t?void 0:t.trim();for(let e=0,i=uo.length;e<i;e++){const i=uo[e];if(t.endsWith(i)){n=i,t=t.substring(0,t.length-i.length);break}}}if("px"===n&&"px"!==this.defaultUnit)i=co.in[this.defaultUnit]/this.defaultDPI;else if("%"===n){this._viewBox.getSize(bo),xo.copy(this._currentTransform).getScale(_o);const t=Math.abs(_o.x||1);i=bo.x/100*t}else"em"===n?i=(null==e?void 0:e.fontSize)||po:(i=co[n][this.defaultUnit],i<0&&(i=co[n].in*this.defaultDPI));return i*parseFloat(t)}getReflection(t,e){return t-(e-t)}parseFloats(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%(i||0))&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}normalizeX(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeY(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeW(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeH(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}getAssetType(t,e="asset"){let i;const n="function"==typeof t.getAttribute?t.getAttribute("id"):"";if(!n&&t.parentNode)return this.getAssetType(t.parentNode,e);if(!n)return i;if("layer"===e)i=fo.find((t=>n===t));else{const t=null==n?void 0:n.replace(/-assets/g,"");i=this.ASSET_TYPES.find((e=>t===e))}return!i&&t.parentNode&&(i=this.getAssetType(t.parentNode,e)),i}getId(t){let e;const i="function"==typeof t.getAttribute?t.getAttribute("id"):"";return e=!i&&t.parentNode?this.getId(t.parentNode):i,e}getParentId(t,e){let i;const n=this.getId(t);return i=t.parentNode&&this.getId(t.parentNode),i&&n!==e||(i=this.getParentId(t.parentNode,e)),i||n||""}getLabelAssetId(t){let e;return this.getId(t),e="function"==typeof t.getAttribute?t.getAttribute("aid"):"",!e&&t.parentNode&&(e=this.getLabelAssetId(t.parentNode)),e}}const lo=new ho,uo=["mm","cm","in","pt","pc","px","em","%"],co={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1},"%":{"%":1,px:-1}},po=16,fo=Object.values(fn),mo=new Gi,yo=new Gi,go=new Gi,vo=new Gi,xo=new Gi,bo=new Oi,_o=new Oi,wo=new Ri;class So{static getPathProxyByNode(t){if(t)return ho.getInstance().parseNode(t)}static mergeGeoShapes(t,e){var i,n,s;if(!(null==t?void 0:t.length))throw new Error("empty geos");const r={cmds:mi.flatMap(t,(t=>t.cmds||[]))};return(null==(i=t[0])?void 0:i.lineWidth)&&(r.lineWidth=t[0].lineWidth),(null==(n=t[0])?void 0:n.thinLine)&&(r.thinLine=t[0].thinLine),(null==(s=t[0])?void 0:s.closed)&&(r.closed=t[0].closed),new va(r)}static getArrowByPathProxy(t,e={},i=new Qr){i.dispose();const{arrowType:n=0,arrowLength:s=10,arrowDeg:r=30}=e||{};if(!t||!n)return i;const a=t.getVertices();if(!(null==a?void 0:a.length)||a.length<4)return i;if(n>0){if(Ao.set(a[2],a[3]),Io.set(a[0],a[1]),Ao.equals(Io))return i;To.subVectors(Ao,Io),Co.lerpVectors(Io,Ao,s/To.length()),Do.copy(Co).rotateAround(Io,Bi(r)),No.copy(Co).rotateAround(Io,-Bi(r))}else{const t=a.length;if(Ao.set(a[t-4],a[t-3]),Io.set(a[t-2],a[t-1]),Ao.equals(Io))return i;To.subVectors(Ao,Io),Co.lerpVectors(Io,Ao,s/To.length()),Do.copy(Co).rotateAround(Io,Bi(r)),No.copy(Co).rotateAround(Io,-Bi(r))}return Co.lerpVectors(Io,Co,.6),Eo.subVectors(Io,Co),Mo.makeTranslation(Eo.x,Eo.y),Io.applyMatrix3(Mo),Co.applyMatrix3(Mo),Do.applyMatrix3(Mo),No.applyMatrix3(Mo),i.moveTo(Co.x,Co.y),i.lineTo(Do.x,Do.y),i.lineTo(Io.x,Io.y),i.lineTo(No.x,No.y),i.lineTo(Co.x,Co.y),i}}const Mo=new Gi,Eo=new Oi,Ao=new Oi,To=new Oi,Io=new Oi,Co=new Oi,Do=new Oi,No=new Oi;class Bo extends ya{constructor(t){super(t),this._init(t)}buildPath(t,e,i){let n,s,r,a,o,{x:h=0,y:l=0,w:u=0,h:c=0,r:d=0}=e||this;u<0&&(h+=u,u=-u),c<0&&(l+=c,c=-c),"number"==typeof d?n=s=r=a=d:d instanceof Array?1===d.length?n=s=r=a=d[0]:2===d.length?(n=r=d[0],s=a=d[1]):3===d.length?(n=d[0],s=a=d[1],r=d[2]):(n=d[0],s=d[1],r=d[2],a=d[3]):n=s=r=a=0,n+s>u&&(o=n+s,n*=u/o,s*=u/o),r+a>u&&(o=r+a,r*=u/o,a*=u/o),s+r>c&&(o=s+r,s*=c/o,r*=c/o),n+a>c&&(o=n+a,n*=c/o,a*=c/o),t.moveTo(h+n,l),t.lineTo(h+u-s,l),0!==s&&t.arc(h+u-s,l+s,s,-Math.PI/2,0),t.lineTo(h+u,l+c-r),0!==r&&t.arc(h+u-r,l+c-r,r,0,Math.PI/2),t.lineTo(h+a,l+c),0!==a&&t.arc(h+a,l+c-a,a,Math.PI/2,Math.PI),t.lineTo(h,l+n),0!==n&&t.arc(h+n,l+n,n,Math.PI,1.5*Math.PI)}}class ko extends Ia{constructor(t,e=new Aa,i){super(new Bo({x:0,y:0,width:1,height:1}),e,i),d(this,"name","SkinnedShape"),this.boundingBox.copy(t),this.geo.lineWidth=e.lineWidth,this.geo.thinLine=!0,Oo.copy(this.boundingBox),Po.copy(Oo.min),Oo.getSize(Lo),this.geo.x=Po.x,this.geo.y=Po.y,this.geo.w=Lo.x,this.geo.h=Lo.y}computeBoundingBox(){return this.boundingBox}}const Oo=new Ri,Po=new Oi,Lo=new Oi;class Ro extends hi{constructor(t={}){super(),d(this,"type","Object2"),d(this,"position",new Oi),d(this,"rotation",new Oi),d(this,"scaled",new Oi(1,1)),d(this,"flipY",!1),d(this,"matrix",new Gi),d(this,"matrixAutoUpdate",!1),void 0!==t.flipY&&(this.flipY=t.flipY),this.flipY&&this.setScale(1,-1)}setPosition(t){return this.position.set(t.x,t.y),this}setRotation(t){return this.rotation.set(t,t),this}setScale(t,e){return this.scaled.set(t,e),this}translate(t,e){return this.position.x+=t,this.position.y+=e,this}rotate(t){return this.rotation.x+=t,this}scale(t,e){return e?(this.scaled.x*=t,this.scaled.y*=e):this.scaled.multiplyScalar(t),this}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){this.matrix.compose(this.position,this.rotation,this.scaled)}copy(t){return this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.matrix.copy(t.matrix),this.matrixAutoUpdate=t.matrixAutoUpdate,this}}class zo extends Ro{constructor(t={}){void 0===t.flipY&&(t.flipY=!0),super(t),d(this,"isTexture",!0),d(this,"type","Texture"),d(this,"params"),d(this,"uuid",_n()),d(this,"image"),d(this,"userData",{}),this.params=t}destroy(){}dispose(){}clone(){return new this.constructor(this.params).copy(this)}copy(t){return super.copy(t),this.uuid=_n(),this.image=t.image,this.userData=mi.cloneDeep(t.userData),this}}class Uo{constructor(t,e){d(this,"bindingStates"),this.ctx=t,this.bindingStates=e}destroy(){}setCtx(t){return this.ctx=t,this}render(t){var e,i,n;if(this.ctx&&(Fo=this.ctx,Fo.save(),t.isText?this.renderText(Fo,t):t.isShape&&(Fo.beginPath(),this.setCtxTransform(Fo,t),this.bindingStyle(Fo,t),this.renderShape(Fo,t),this.renderLineDash(Fo,t)),t.isShape&&(null==(i=null==(e=t.mtl)?void 0:e.map)?void 0:i.image)&&this.renderShapeTexture(Fo,t),Fo.restore(),t.composeNode&&(null==(n=t.children)?void 0:n.length)))for(let e,i=0,n=t.children.length;i<n;i++)e=t.children[i],e.isShape&&this.render(e)}renderFill(t){var e;t.mtl.fill&&(null==(e=this.ctx)||e.fill())}renderStroke(t){var e;t.mtl.stroke&&(null==(e=this.ctx)||e.stroke())}renderText(t,e){if(!t)return;const{text:i,fill:n,stroke:s,fontSize:r,fontFamily:a,fontWeight:o,textAlign:h,textBaseline:l}=e.mtl;if(!i)return;e.modelViewMatrix.decompose(qo,Ho,Vo);const u=(r||12)*Vo.x;t.font=`${o} ${u}px ${a}`,t.fillStyle=n||Ha,h&&(t.textAlign=h),l&&(t.textBaseline=l);let c=qo.y;if("middle"===l){const e=t.measureText(i);c+=(e.actualBoundingBoxAscent-e.actualBoundingBoxDescent)/2}t.fillText(i,qo.x,c)}renderWireFrame(t){this.ctx&&(Go.copy(t.boundingBox).applyMatrix3(t.modelViewMatrix).getSize(Zo),Xo.copy(Go.min),this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=1,this.ctx.strokeStyle=La,this.ctx.setLineDash([5,10]),this.ctx.strokeRect(Xo.x,Xo.y,Zo.x,Zo.y),this.ctx.stroke(),this.ctx.restore())}renderMerged(t){this.ctx&&(Fo=this.ctx,Fo.save(),t.isShape&&(Fo.beginPath(),this.setCtxTransform(Fo,t),this.bindingStyle(Fo,t),this.renderShape(Fo,t)),Fo.restore())}setCtxTransform(t,e){const i=Wo.equals(e.modelViewMatrix);Wo.copy(e.modelViewMatrix),i||Wo.getComponents(jo),t.transform(...jo)}bindingStyle(t,e){if(e.mtl.fill){let i;i=e.mtl.fill.isColor?e.mtl.fill.getHexString():e.mtl.fill,void 0!==e.mtl.fillOpacity&&(t.globalAlpha=e.mtl.fillOpacity),i&&(t.fillStyle=i)}if(e.mtl.stroke){if(e.geo.thinLine){const e=Math.sqrt(jo[0]*jo[0]+jo[1]*jo[1]);t.lineWidth=Math.abs(1/e)}else e.geo.lineWidth?t.lineWidth=e.geo.lineWidth:t.lineWidth=1;let i;e.mtl.lineCap&&(t.lineCap=e.mtl.lineCap),e.mtl.lineJoin&&(t.lineJoin=e.mtl.lineJoin),void 0!==e.mtl.strokeOpacity&&(t.globalAlpha=e.mtl.strokeOpacity),i=e.mtl.stroke.isColor?e.mtl.stroke.getHexString():e.mtl.stroke,i&&(t.strokeStyle=i)}}renderShape(t,e){e.buildPath(t),e.geo.closed&&t.closePath(),this.renderFill(e),this.renderStroke(e)}renderLineDash(t,e){if(e.mtl.stroke&&e.mtl.lineDash&&void 0!==e.mtl.lineDashOffset){if(t.beginPath(),e.buildPath(t),e.geo.thinLine){const e=Math.sqrt(jo[0]*jo[0]+jo[1]*jo[1]);t.lineWidth=Math.abs(1/e)}else e.geo.lineWidth?t.lineWidth=e.geo.lineWidth:t.lineWidth=1;t.strokeStyle=Wa,t.setLineDash(e.mtl.lineDash),t.lineDashOffset=e.mtl.lineDashOffset,t.globalAlpha=1,t.stroke()}}renderShapeTexture(t,e){var i,n,s,r,a,o,h,l;(null==(n=null==(i=null==e?void 0:e.mtl)?void 0:i.map)?void 0:n.image)&&(!(null==(a=null==(r=null==(s=null==e?void 0:e.mtl)?void 0:s.map)?void 0:r.image)?void 0:a.width)||null==(l=null==(h=null==(o=null==e?void 0:e.mtl)?void 0:o.map)?void 0:h.image)||l.height,e.mtl.map.matrix.getComponents(Yo),t.transform(...Yo),t.drawImage(e.mtl.map.image,0,0))}}let Fo;const Wo=new Gi,qo=new Oi,Ho=new Oi,Vo=new Oi,jo=[1,0,0,1,0,0],Yo=[1,0,0,1,0,0],Go=new Ri,Xo=new Oi,Zo=new Oi,$o=class t{constructor(){d(this,"cache",new Map),d(this,"maxSize",2048),d(this,"renderer",new Uo),d(this,"_scaled",new Oi(1,1))}dispose(){this.clear()}static getInstance(){return Jo||(Jo=new t),Jo}static set(t,e){this.getInstance().set(t,e)}static clear(){this.getInstance().clear()}scale(t=1,e=1){return t||e?(this._scaled.set(t,e),this):this}has(t){return this.cache.has(t)}set(t,e){if(!t||!e)throw new Error("error input");this.cache.set(t,e)}get(t){if(!t)throw new Error("error input");return this.cache.get(t)}clear(){Object.values(this.cache).forEach((t=>t.destroy())),this._scaled.identity(),this.cache=new Map,function(){var t;const e=ph();if(null==(t=null==e?void 0:e.children)?void 0:t.length)for(let t=e.children.length-1;t>=0;t--)e.removeChild(e.children[t])}()}calculateMipLevel(t){return t>=1?0:t>=.5?1:t>=.25?2:3}setByShape(t,e,i,n){const s=this.getTextureByShape(e,i,n);return e.userData.textureKey=s.userData.textureKey=t,this.renderShapeTexture(e,s),this.set(t,s),s}getTextureByShape(t,e,i,n){const s=new zo;if(t.boundingBox.isEmpty())throw new Error("get boundingBox error");th.identity(),eh.identity(),e&&!(null==e?void 0:e.isEmpty())?hh.copy(e):hh.copy(t.boundingBox),hh.getSize(th),hh.getCenter(eh),i&&!i.isEmpty()?i.getSize(ih):ih.copy(th),(ih.x<Ko.x||ih.y<Ko.y)&&ih.normalize().multiplyScalar(200),ih.x<1&&(ih.x=1),ih.y<1&&(ih.y=1),sh.set(Jr.config.width,Jr.config.height);const r=ih.length()/sh.length();r>1&&ih.multiplyScalar(1/r);const a=ih.length()/th.length();return lh.copy(th).multiplyScalar(-.5).add(eh).multiplyScalar(a).negate(),uh.identity(),ch.set(a,a),rh.compose(lh,uh,ch),nh.copy(th).multiplyScalar(-.5).add(eh),s.position.copy(nh),s.rotation.copy(uh),s.scaled.multiplyScalar(1/ch.x,1/ch.y),s.updateMatrix(),s}renderShapeTexture(t,e,i){var n;const s=fa.create(ih.x,ih.y),r=fa.getContext2D(s,{alpha:!0});r.clearRect(0,0,s.width,s.height),r.beginPath(),r.strokeStyle=Ra,r.lineWidth=1,r.strokeRect(0,0,s.width,s.height),r.closePath(),this._transform(r,t),this._bindStyle(r,t),t.buildPath(r),this._fill(r,t),this._stroke(r,t),null==(n=t.children)||n.forEach((t=>{t.isShape&&(this._bindStyle(r,t),t.buildPath(r),this._fill(r,t),this._stroke(r,t),t.isText&&this._renderText(r,t))})),e.image=s}_transform(t,e){rh.getComponents(dh),t.transform(...dh)}_bindStyle(t,e){var i,n,s;t.beginPath();const{fill:r,stroke:a}=(null==(i=e.userData)?void 0:i.style)||{};if(r&&(t.fillStyle=r),a){let i=e.mtl.lineWidth;i||(i=1/Math.min(Math.abs(this._scaled.x),Math.abs(this._scaled.y))),t.lineWidth=i,t.strokeStyle=(null==(s=null==(n=e.userData)?void 0:n.style)?void 0:s.stroke)||Ha}}_fill(t,e){var i,n;(null==(n=null==(i=e.userData)?void 0:i.style)?void 0:n.fill)&&t.fill()}_stroke(t,e){var i,n;(null==(n=null==(i=e.userData)?void 0:i.style)?void 0:n.stroke)&&t.stroke()}_renderText(t,e){const{text:i,fill:n,stroke:s,fontSize:r,fontFamily:a,fontWeight:o,textAlign:h,textBaseline:l}=e.mtl;if(!i)return;ah.set,oh.copy(e.matrix).decompose(lh,uh,ch);const u=(r||12)*ch.x;t.font=`${o} ${u}px ${a}`,h&&(t.textAlign=h),l&&(t.textBaseline=l);let c=lh.y;s?(t.strokeStyle=s,t.lineWidth=1*Math.abs(1/dh[0]),t.strokeText(i,lh.x,c)):(t.fillStyle=n||Ha,t.fillText(i,lh.x,c))}};d($o,"DEBUG_DisplayCachedTexture",mi.throttle(((t=80,e=.8)=>{const i=Jo;if(!i)return;let n=ph();if(n||(n=function(t=80,e=.8){const i=document.createElement("div");function n(){i.style.opacity="1"}function s(){i.style.opacity=e.toString()}return i.setAttribute("id","DEBUG_Displaycached"),i.style.position="absolute",i.style.width=t+"px",i.style.height="92vh",i.style.background=`rgba(255, 255, 255, ${e})`,i.style.left="20px",i.style.top="20px",i.style.overflow="auto",i.style.padding="6px",i.style.opacity=e.toString(),i.addEventListener("mouseenter",n),i.addEventListener("mouseleave",s),document.body.appendChild(i),i}(t,e)),!n)throw new Error("dom not found");!function(t,e){e.forEach(((e,i)=>{e&&e.image&&function(t,e,i){let n;for(let i=0,s=t.childNodes.length;i<s;i++)if(t.childNodes[i].getAttribute("id")===e){n=t.childNodes[i];break}n?function(t,e){if(!e.image)return;const i=t.querySelector("canvas");if(!i)return;const n=i.getContext("2d",{alpha:!0});if(!n)throw new Error("getContext error");n.clearRect(0,0,i.width,i.height),n.save(),n.scale(window.devicePixelRatio,window.devicePixelRatio),n.drawImage(e.image,0,0),n.restore()}(n,i):function(t,e,i){if(!i.image)return;!i.image.width||i.image.height;const n=Jr.document.createElement("div");n.setAttribute("id",e),n.style.display="flex",n.style.flexDirection="column";const s=fa.createCanvas({containerId:t.id,width:i.image.width,height:i.image.height,dpr:window.devicePixelRatio});s.style.border=`${za} 1px solid`,s.style.maxWidth=parseInt(t.style.width)-2+"px",s.style.maxHeight=parseInt(s.style.maxWidth)/(i.image.width/i.image.height)+"px";const r=s.getContext("2d",{alpha:!0});if(!r)throw new Error("getContext error");r.save(),r.scale(window.devicePixelRatio,window.devicePixelRatio),r.drawImage(i.image,0,0),r.restore(),n.appendChild(s);const a=Jr.document.createElement("p");function o(){const t=s.toDataURL("image/png",.6),e=document.createElement("a"),i=new MouseEvent("click");e.download=`thumb.${Date.now()}.png`,e.href=t,e.dispatchEvent(i)}a.innerHTML=i.image.width+" * "+i.image.height,a.innerHTML+="<br/>"+e,a.style.margin="0",a.style.padding="0",a.style.lineHeight="1.2",a.style.fontSize="10px",a.style.padding="3px 0 6px 0",a.style.color=Ha,n.appendChild(a),t.appendChild(n),n.addEventListener("click",o)}(t,e,i)}(t,i,e)}))}(n,i.cache)}),5e3));let Jo,Qo=$o;const Ko=new Oi(50,50),th=new Oi,eh=new Oi,ih=new Oi,nh=new Oi,sh=new Oi,rh=new Gi,ah=new Gi,oh=new Gi,hh=new Ri,lh=new Oi,uh=new Oi,ch=new Oi,dh=[1,0,0,1,0,0];function ph(){var t;return"undefined"==typeof window?null:null==(t=null==window?void 0:window.document)?void 0:t.getElementById("DEBUG_Displaycached")}const fh=class t{static getObject2BySvg(t,e){const i=(new mn).parse(t,this.use3DShape),n=this.getShapesByParsed(i,e);if(1==(null==n?void 0:n.length))return n[0];const s=new On;return s.adds(n),s}static getShapesBySvg(t,e){const i=(new mn).parse(t,this.use3DShape);return this.getShapesByParsed(i,e)}static getShapesByParsed(t,e){this.use3DShape=!!(null==e?void 0:e.use3DShape);const i=[],n=this.getPolygons2ByPaths(null==t?void 0:t.paths,e);(null==n?void 0:n.length)&&i.push(...n);const s=this.getLabels(null==t?void 0:t.labels,e);return(null==s?void 0:s.length)&&i.push(...s),i}static getPolygons2ByPaths(t,e){if(!t||!t.length)return;const i=[];for(let n=0,s=t.length;n<s;n++){const s=this.getPolygonsByPath(t[n],e);(null==s?void 0:s.length)&&i.push(...s)}return i}static getPolygonsByPath(t,e){var i,n;if(!t)return;const s=[],{userData:r}=t;let{fill:a,stroke:o,strokeWidth:h,thinLine:l,fillOpacity:u,strokeOpacity:c,opacity:d}=(null==r?void 0:r.style)||{};(null==e?void 0:e.fill)&&(a=e.fill),(null==e?void 0:e.stroke)&&(o=e.stroke),(null==e?void 0:e.lineWidth)&&(h=e.lineWidth),(null==e?void 0:e.thinLine)&&(l=!!e.thinLine),(null==e?void 0:e.fillOpacity)&&(u=e.fillOpacity),(null==e?void 0:e.strokeOpacity)&&(c=e.strokeOpacity),(null==e?void 0:e.opacity)&&(d=e.opacity),"none"!==a&&"transparent"!==a||(a=void 0,mi.unset(r,"style.fill")),"none"!==o&&"transparent"!==o||(o=void 0),o&&!h&&(h=1);const p=so.getMtl({fill:a,stroke:o,lineWidth:h,fillOpacity:u,strokeOpacity:c,opacity:d}),f=[];if(this.use3DShape){const n=mn.createShapes(t),s=(null==(i=t.currentPath)?void 0:i.autoClose)||!1;for(let t,i=0,r=(null==n?void 0:n.length)||0;i<r;i++){t=n[i];const r=_h(t,{flipY:null==e?void 0:e.flipY,strokeWidth:h,thinLine:l,closed:s});r&&f.push(r)}}else{const i=new va({cmds:t.getCmds(),flipY:null==e?void 0:e.flipY,lineWidth:h,thinLine:l});f.push(i)}if(null==f?void 0:f.length){const t=So.mergeGeoShapes(f),i=new Ia(t,p);i.userData=mi.cloneDeep(r),(null==(n=i.userData)?void 0:n.id)&&(i.name=i.userData.id),void 0!==(null==e?void 0:e.selectable)?i.selectable=e.selectable:i.userData.assetType&&(i.selectable=!0),s.push(i)}return s.length?s:void 0}static getInstanceBySymbol(e,i){var n,s,r,a,o,h,l,c;if(!e||!(null==(n=e.paths)?void 0:n.length))return;const d=[],p=mi.cloneDeep(i.userData),f=[];for(let t,i=0,n=(null==(s=null==e?void 0:e.paths)?void 0:s.length)||0;i<n;i++)t=e.paths[i].clone(),t.userData=p,f.push(t);const m=this.getLabels(null==e?void 0:e.labels);if(!e.symbolId)return;const y=new Ri;f.forEach((t=>y.union(t.computeBoundingBox()))),null==m||m.forEach((t=>y.union(bh.copy(t.computeBoundingBox()).applyMatrix3(t.matrix)))),yh.copy(i.transform).decompose(gh,vh,xh);const g=new Aa(u({},null==(r=i.userData)?void 0:r.style)),v=new ko(y,g,{flipY:!0});if(v.userData=p,d.push(v),v.applyMatrix3(yh.flipSvgY()),v.computeBoundingBox(),v.updateMatrix(),v.updateMatrixWorld(!0),!Qo.getInstance().has(e.symbolId)){const i=new Ia;mi.set(i,"userData.id",e.symbolId),mi.set(i,"userData.style",mi.merge({},e.style,p.style));for(let n,s=0,r=(null==(a=null==e?void 0:e.paths)?void 0:a.length)||0;s<r;s++){n=e.paths[s];const r=mi.merge({},null==(o=n.userData)?void 0:o.style,p.style,{flipY:!1});r.stroke&&!r.lineWidth&&(r.lineWidth=null==(l=null==(h=n.userData)?void 0:h.style)?void 0:l.strokeWidth),r.stroke&&!r.lineWidth&&(r.lineWidth=(null==(c=p.style)?void 0:c.strokeWidth)||1);const a=t.getPolygonsByPath(n,r);(null==a?void 0:a.length)&&i.adds(a)}(null==m?void 0:m.length)&&i.adds(m),i.computeBoundingBox(),i.updateMatrix(),i.updateMatrixWorld(!0),i.updateBoundingBox(),Qo.getInstance().scale(xh.x,xh.y).setByShape(e.symbolId,i,y)}let x=Qo.getInstance().get(e.symbolId);return x?(x=x.clone(),x.scaled.multiplyScalar(1,-1),x.updateMatrix(),v.mtl.map=x,d):void 0}static getLabels(t,e){if(!(null==t?void 0:t.length))return;const i=[];for(let n=0,s=(null==t?void 0:t.length)||0;n<s;n++){const s=this.getLabel(t[n],e);(null==s?void 0:s.length)&&i.push(...s)}return i}static getLabel(t,e){var i,n,s,r;if(!t||!t.textContent)return;const a=[];let{fill:o,stroke:h}=(null==(i=t.userData)?void 0:i.style)||{};o&&"none"!==o&&"transparent"!==o||h||(o=qa);const l=new oo({text:t.textContent,fontSize:t.userData.style.fontSize,fill:o,stroke:h,flipY:null==e?void 0:e.flipY,wireframe:null==e?void 0:e.wireframe});t.userData&&(l.userData=mi.cloneDeep(t.userData)),(null==(n=l.userData)?void 0:n.id)&&(l.name=l.userData.id),void 0===(null==(r=null==(s=l.userData)?void 0:s.style)?void 0:r.fill)&&mi.set(l.userData,"style.fill",o),l.renderOrder=1,a.push(l),t.transform&&(yh.setFromMatrix(t.transform),(null==e?void 0:e.flipY)&&yh.scale(1,-1),l.applyMatrix3(yh));const{id:u,pid:c,aid:d,assetType:p,layerType:f}=t.userData;return a}};d(fh,"use3DShape",!1);let mh=fh;const yh=new Gi,gh=new Oi,vh=new Oi,xh=new Oi,bh=new Ri;function _h(t,e){var i,n;const{closed:s,flipY:r,strokeWidth:a,thinLine:o}=e||{};null==(i=null==t?void 0:t.curves)||i.length;const h=wh(t.curves),l=[];for(let e=0,i=null==(n=null==t?void 0:t.holes)?void 0:n.length;e<i;e++){const i=wh(t.holes[e].curves);l.push(...i)}return h.push(...l),new va({cmds:h,closed:s,flipY:r,lineWidth:a,thinLine:o})}function wh(t){const e=[];for(let i,n=0,s=t.length;n<s;n++){const s=t[n],r=s.getPoint(0),a=!n;switch(s.type){case"LineCurve":a&&e.push([Pn,...s.v1.toArray()]),e.push([Ln,...s.v2.toArray()]);break;case"QuadraticBezierCurve":{a&&e.push([Pn,r.x,r.y]);const t=[];t.push(zn),t.push(...s.v1.toArray()),t.push(...s.v2.toArray()),e.push(t);break}case"CubicBezierCurve":{a&&e.push([Pn,r.x,r.y]);const t=[];t.push(Rn),t.push(...s.v0.toArray()),t.push(...s.v1.toArray()),t.push(...s.v2.toArray()),t.push(...s.v3.toArray()),e.push(t);break}case"EllipseCurve":{a&&e.push([Pn,r.x,r.y]);const t=[];t.push(qn),t.push(s.aX),t.push(s.aY),t.push(s.xRadius),t.push(s.yRadius),t.push(s.aRotation),t.push(s.aStartAngle),t.push(s.aEndAngle),t.push(s.aClockwise?1:0),e.push(t);break}}i=s}return e}const Sh=Jr.window||window,Mh=Sh.requestAnimationFrame||Sh.webkitRequestAnimationFrame||Sh.mozRequestAnimationFrame||Sh.oRequestAnimationFrame||Sh.msRequestAnimationFrame||function(t){Sh.setTimeout(t,1e3/60)},Eh=Sh.cancelAnimationFrame||Sh.webkitCancelAnimationFrame||Sh.mozCancelAnimationFrame||Sh.oCancelAnimationFrame||Sh.msCancelAnimationFrame||clearTimeout;class Ah{constructor(t,e,i=16.7,n){var s;if(d(this,"duration",16.7),d(this,"onComplete"),d(this,"generator"),d(this,"t",null),d(this,"stopped",!1),i&&(this.duration=i),this.onComplete=n,!e||"function"!=typeof e)throw new Error("[task] callback method is null!");let r="number"==typeof t&&t||Array.isArray(t)&&t.length;if(!r)throw new Error("[task] task list is empty ...");if(1===r)return e(0),void(null==(s=this.onComplete)||s.call(this));this.generator=this.queue(r,e),this.t=null,this.stopped=!1,this.next()}next(){var t;if(!this.generator||this.stopped)return;const{generator:e}=this,i=performance.now();let n=null;do{if(!e)break;if(n=e.next(),n.done){null==(t=this.onComplete)||t.call(this),this.clear();break}}while(!n.done&&performance.now()-i<this.duration);n.done||this.stopped||(this.t=Mh(this.next.bind(this)))}*queue(t,e){let i=performance.now();for(let n=0;n<t;n++)performance.now()-i>=this.duration&&(i=performance.now(),yield),this.stopped||e(n)}clear(){this.stopped=!0,this.generator=void 0,this.onComplete=void 0,this.t&&(Eh(this.t),this.t=null)}}const Th={enabled:!1,files:{},add:function(t,e){this.enabled&&(this.files[t]=e)},get:function(t){if(this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},Ih=new class{constructor(t,e,i){d(this,"isLoading",!1),d(this,"itemsLoaded",0),d(this,"itemsTotal",0),d(this,"urlModifier"),d(this,"handlers",[]),d(this,"onStart"),d(this,"onLoad"),d(this,"onProgress"),d(this,"onError"),this.onLoad=t,this.onProgress=e,this.onError=i}itemStart(t){this.itemsTotal++,this.isLoading||void 0!==this.onStart&&this.onStart(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,void 0!==this.onProgress&&this.onProgress(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,void 0!==this.onLoad&&this.onLoad())}itemError(t){void 0!==this.onError&&this.onError(t)}resolveURL(t){return void 0!==this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return-1!==e&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,i=this.handlers.length;e<i;e+=2){const i=this.handlers[e],n=this.handlers[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}};class Ch{constructor(t=Ih){d(this,"manager"),d(this,"crossOrigin","anonymous"),d(this,"withCredentials",!1),d(this,"path",""),d(this,"resourcePath",""),d(this,"requestHeader",{}),this.manager=t}loadAsync(t,e){const i=this;return new Promise((function(n,s){i.load(t,n,e,s)}))}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Dh={};class Nh extends Error{constructor(t,e){super(t),d(this,"response"),this.response=e}}class Bh extends Ch{constructor(t){super(t),d(this,"mimeType"),d(this,"responseType")}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const s=Th.get(t);if(void 0!==s)return this.manager.itemStart(t),setTimeout((()=>{e&&e(s),this.manager.itemEnd(t)}),0),s;if(void 0!==Dh[t])return void Dh[t].push({onLoad:e,onProgress:i,onError:n});Dh[t]=[],Dh[t].push({onLoad:e,onProgress:i,onError:n});const r=new Jr.window.Request(t,{headers:new Jr.window.Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(r).then((e=>{if(200===e.status||0===e.status){if(e.status,"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const i=Dh[t],n=e.body.getReader(),s=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),r=s?parseInt(s):0,a=0!==r;let o=0;const h=new ReadableStream({start(t){!function e(){n.read().then((({done:n,value:s})=>{if(n)t.close();else{o+=s.byteLength;const n=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:r});for(let t=0,e=i.length;t<e;t++){const e=i[t];e.onProgress&&e.onProgress(n)}t.enqueue(s),e()}}))}()}});return new Response(h)}throw new Nh(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)})).then((t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then((t=>n.decode(t)))}}})).then((e=>{Th.add(t,e);const i=Dh[t];delete Dh[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onLoad&&n.onLoad(e)}})).catch((e=>{const i=Dh[t];if(void 0===i)throw this.manager.itemError(t),e;delete Dh[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setMimeType(t){return this.mimeType=t,this}setResponseType(t){return this.responseType=t,this}}class kh extends Ch{constructor(t){super(t)}load(t,e,i,n){const s=this,r=new Bh(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(t,(function(i){try{e&&e(i)}catch(e){n&&n(e),s.manager.itemError(t)}}),i,n)}}class Oh extends hi{constructor(t={}){super(),d(this,"name","Adapter2@"+fi.now()),d(this,"params"),d(this,"xml"),d(this,"units"),d(this,"paths"),d(this,"symbolsMap"),d(this,"uses"),d(this,"labels"),d(this,"idsTree"),d(this,"scene"),d(this,"boundingBox",new Ri),d(this,"requestHeader",{}),d(this,"resources",[]),d(this,"_viewBox",new Ri),d(this,"_tic"),d(this,"_tic2"),d(this,"_assetTypes",[]),d(this,"_resourcesMap",{}),d(this,"_assetTypeMap",{}),d(this,"_idsMap",{}),d(this,"_boundingBoxMap",{}),d(this,"use3DShape",!1),this.params=t}destroy(){super.destroy(),this.clear()}clear(){this.xml=void 0,this.paths=[],this.symbolsMap={},this.uses=[],this.labels=[],this.idsTree=[],this._idsMap={},this.boundingBox.makeEmpty(),this._resourcesMap={},this._assetTypeMap={},this._assetTypes=[],Qo.clear()}setRequestHeader(t){return this.requestHeader=t,this}load(t,e){return p(this,null,(function*(){var e,i;if(!t)throw"url not found";let n;if(this.dispatchEvent({type:oi.INITIALIZATION_START}),this.clear(),mh.use3DShape=this.use3DShape,this.use3DShape)n=yield(new mn).setRequestHeader({}).setPixelRatio((null==(e=this.params)?void 0:e.dpr)||1).loadAsync(t).catch((()=>({})));else{const e=yield(new kh).loadAsync(t).catch((()=>({})));n=yield ho.setInstancedMesh(null==(i=Jr.config)?void 0:i.instancedMesh).parse(e)}return n}))}initResources(t,e){var i,n,s,r,a,o;if(this.clear(),!this.scene)throw new Error("please bind a Scene first");if(this.xml=null==t?void 0:t.xml,!this.xml)return void this.dispatchEvent({type:oi.INITIALIZATION_COMPLETE});this.units=null==t?void 0:t.units,this.paths=null==t?void 0:t.paths,this.symbolsMap=null==t?void 0:t.symbolsMap,this.uses=null==t?void 0:t.uses,this.labels=null==t?void 0:t.labels,this.idsTree=null==t?void 0:t.idsTree,this._assetTypes=null==t?void 0:t.assetTypes,(null==t?void 0:t.viewBox)&&this._viewBox.copy(t.viewBox).flipY(),this.recomputeIdsMap();const h=this,l=mi.chain(e).flatMap((t=>this._idsMap[t])).commit().uniq().value();if(null==(i=null==t?void 0:t.paths)?void 0:i.length){const e=null==t?void 0:t.paths;this._tic&&this._tic.clear(),this._tic=new Ah(e,(function(t){var i,n,s,r,a,o,u,c,d,p,f;const m=mh.getPolygonsByPath(e[t],{flipY:!0});if(null==m?void 0:m.length)for(let t=0,e=(null==m?void 0:m.length)||0;t<e;t++){const e=null==(n=null==(i=m[t])?void 0:i.userData)?void 0:n.id;(null==l?void 0:l.length)&&!l.includes(e)&&(m[t].visible=!1),h._resourcesMap[e]||(h._resourcesMap[e]=[]),h._resourcesMap[e].push(m[t]),null==(s=h.scene)||s.add(m[t]),(null==(a=null==(r=m[t])?void 0:r.userData)?void 0:a.assetType)&&(h._assetTypeMap[null==(u=null==(o=m[t])?void 0:o.userData)?void 0:u.assetType]||(h._assetTypeMap[null==(d=null==(c=m[t])?void 0:c.userData)?void 0:d.assetType]=[]),h._assetTypeMap[null==(f=null==(p=m[t])?void 0:p.userData)?void 0:f.assetType].push(m[t]))}}),3,(function(){var t;null==(t=h.scene)||t.computeBoundingBox(),h.scene.needsUpdate=!0}))}if(null==(n=null==t?void 0:t.labels)?void 0:n.length){const e=null==t?void 0:t.labels;this._tic2&&this._tic2.clear(),this._tic2=new Ah(e,(function(t){var i,n,s;const r=mh.getLabel(e[t],{flipY:!0});if(null==r?void 0:r.length)for(let t=0,e=(null==r?void 0:r.length)||0;t<e;t++){r[t].renderOrder=9;const e=null==(n=null==(i=r[t])?void 0:i.userData)?void 0:n.id;(null==l?void 0:l.length)&&!l.includes(e)&&(r[t].visible=!1),h._resourcesMap[e]||(h._resourcesMap[e]=[]),h._resourcesMap[e].push(r[t]),null==(s=h.scene)||s.add(r[t])}}),3,(()=>{var t;null==(t=this.scene)||t.computeBoundingBox(),this.scene.needsUpdate=!0}))}if(null==(s=null==t?void 0:t.instances)?void 0:s.length){const e=null==t?void 0:t.instances;for(let t,i=0,n=e.length;i<n;i++){t=e[i];const n=mh.getInstanceBySymbol(this.symbolsMap[t.symbolId],t);if(null==n?void 0:n.length)for(let t=0,e=(null==n?void 0:n.length)||0;t<e;t++){const e=null==(a=null==(r=n[t])?void 0:r.userData)?void 0:a.id;(null==l?void 0:l.length)&&!l.includes(e)&&(n[t].visible=!1),null==(o=this.scene)||o.add(n[t])}}}}bindScene(t){return this.scene=t,this}recomputeIdsMap(){var t;if(!(null==(t=this.idsTree)?void 0:t.length))return;const e=[];un(this.idsTree,(t=>{var i;if(e.push(t.value),!(null==(i=t.children)?void 0:i.length))return;const n=cn(t);this._idsMap[t.value]=mi.map(n,"value")}))}getAssetIdsByType(t){let e=[];Array.isArray(t)||(t=[t]);for(let i,n=0,s=t.length;n<s;n++){i=t[n];let s=Object.hasOwnProperty.call(this._idsMap,i)?this._idsMap[i]:void 0;(null==s?void 0:s.length)||(s=Object.hasOwnProperty.call(this._idsMap,i+"-assets")?this._idsMap[i+"-assets"]:void 0),(null==s?void 0:s.length)&&(e=e.concat(s))}return e}getLayers(t=2){return this.xml?ln(this.xml,t):[]}getViewBox(){return this._viewBox}getAssetTypes(){return this._assetTypes}getByAssetType(t){return this._assetTypeMap[t]||[]}updateLayersVisibility(t,e=!1){if(!this.scene)throw new Error("please bind a Scene first");const i=mi.chain(t).flatMap((t=>this._idsMap[t])).concat(t).compact().uniq().value();this.scene.traverse((t=>{var n,s;(null==(n=t.userData)?void 0:n.id)&&i.includes(t.userData.id)?t.visible=e:(null==(s=t.userData)?void 0:s.id)&&(t.visible=!e)})),this.scene.needsUpdate=!0}getBoundingBoxByIds(t){if(!this._resourcesMap||!Object.keys(this._resourcesMap).length)return;const e=new Ri;Array.isArray(t)||(t=[t]);for(let i=0,n=null==t?void 0:t.length;i<n;i++){if(!this._resourcesMap.hasOwnProperty(t[i]))continue;const n=this._resourcesMap[t[i]];if(null==n?void 0:n.length)for(let t=0,i=null==n?void 0:n.length;t<i;t++)n[t].boundingBox.isEmpty()&&n[t].computeBoundingBox(),n[t].boundingBox.isEmpty()||e.union(n[t].boundingBox)}return e}transMmByUtils(t=0){return t*Ph[mi.toLower(this.units||"mm")]}}const Ph={mm:1,cm:.1,m:.001,inches:.0393701,inch:.0393701};class Lh{constructor(t){d(this,"params"),d(this,"currentCamera"),d(this,"bindingStates",new WeakMap),d(this,"forceUpdate",!1),d(this,"currentState"),d(this,"cameraVersion"),d(this,"currentRenderState"),d(this,"ctxMap",{}),this.params=t}destroy(){this.bindingStates=new WeakMap,this.currentState=void 0,this.ctxMap={},this.reset()}reset(){this.forceUpdate=!0}setup(t,e,i){this.currentRenderState=e,this.currentCamera=i,this.currentState=this.getBindingState(t),this.ctxMap={};let n=this.needsUpdate(t);return(this.forceUpdate||n)&&this.saveCache(t),this.currentState}getBindingState(t){return this.bindingStates.has(t)||this.bindingStates.set(t,{id:t.id,uuid:t.uuid,needsUpdate:!0,featureKey:t.featureKey,version:-1,cameraVersion:-1,preShape:Rh}),Rh=t,this.bindingStates.get(t)}clearBindingState(){this.currentState&&(this.currentState.needsUpdate=!1,this.currentState.version=-1,this.currentState.cameraVersion=-1)}needsUpdate(t){return!this.currentState||!!this.currentState.needsUpdate||this.currentState.id!==t.id||this.currentState.version!==t.version}saveCache(t){this.currentState&&(this.clearBindingState(),this.currentState.version=t.version,this.currentState.needsUpdate=!1,this.currentState.ctx=fa.getCtx(t.featureKey,this.params.width,this.params.height,this.params.dpr))}updateModelViewMatrix(t,e){void 0!==e?(this.currentState=this.getBindingState(t),(this.currentState.cameraVersion!==e.version||t.dynamically)&&(this.currentState.cameraVersion!==e.version&&(this.currentState.needsUpdate=!0),this.currentState.cameraVersion=e.version,t.updateModelViewMatrix(e))):t.updateModelViewMatrix()}}let Rh;class zh{constructor(){d(this,"light"),d(this,"lightsArray",[]),d(this,"shadowsArray",[]),d(this,"lastCameraVersion",-1)}destroy(){var t;this.clear(),null==(t=this.light)||t.destroy()}clear(){this.lightsArray.length=0,this.shadowsArray.length=0}pushLight(t){this.light||(this.light=t),this.lightsArray.push(t)}pushShadow(t){this.shadowsArray.push(t)}}class Uh{constructor(){d(this,"renderStates",new WeakMap)}destroy(){this.renderStates=new WeakMap}get(t,e=0){const i=this.renderStates.get(t);let n;return void 0===i?(n=new zh,this.renderStates.set(t,[n])):e>=i.length?(n=new zh,i.push(n)):n=i[e],n}}class Fh{constructor(t=1e3){d(this,"cellCapacity"),d(this,"firstIndex"),d(this,"lastIndex"),d(this,"items"),this.cellCapacity=t,this.firstIndex=0,this.lastIndex=0,this.items=[new Array(this.cellCapacity)]}adjustCells(){this.lastIndex<this.cellCapacity||(this.items.push(new Array(this.cellCapacity)),this.lastIndex=0)}enqueue(t,e){if(e)return this.unshift(t);this.items[this.items.length-1][this.lastIndex++]=t,this.adjustCells()}unshift(t){for(let t=this.items.length-1;t>=0;t--)for(let e=this.cellCapacity-1;e>=0;e--)e>0&&void 0===this.items[t][e-1]||(this.items[t][e]=0===e&&t>0?this.items[t-1][this.cellCapacity-1]:this.items[t][e-1]);this.items[0][this.firstIndex]=t,this.lastIndex++,this.adjustCells()}dequeue(){if(this.isEmpty())return;const t=this.items[0][this.firstIndex];return this.firstIndex===this.cellCapacity-1?(this.items.shift(),this.firstIndex=0):this.firstIndex++,t}isEmpty(){return 1===this.items.length&&this.firstIndex===this.lastIndex}peek(){if(!this.isEmpty())return this.items[0][this.firstIndex]}size(){return(this.items.length-1)*this.cellCapacity-this.firstIndex+this.lastIndex}clear(){this.firstIndex=0,this.lastIndex=0,this.items=[new Array(this.cellCapacity)]}toString(){if(this.isEmpty())return"";let t=`${this.items[0][this.firstIndex]}`;for(let e=this.firstIndex+1;e<this.items[0].length;e++)t=`${t},${this.items[0][e]}`;for(let e=1;e<this.items.length-1;e++)for(let i=0;i<this.items[e].length;i++)t=`${t},${this.items[e][i]}`;for(let e=0;e<this.lastIndex;e++)t=`${t},${this.items[this.items.length-1][e]}`;return t}getByIndex(t){if(t>=this.size())return;const e=Math.floor((this.firstIndex+t)/this.cellCapacity),i=(this.firstIndex+t)%this.cellCapacity;return this.items[e][i]}setByIndex(t,e){if(t>=this.size())return!1;const i=Math.floor((this.firstIndex+t)/this.cellCapacity),n=(this.firstIndex+t)%this.cellCapacity;return this.items[i][n]=e,!0}sort(t){const e=this.size(),i=new Array(e);for(let t=0;t<e;t++)i[t]=this.getByIndex(t);i.sort(t),this.clear();for(let t=0;t<i.length;t++)this.enqueue(i[t])}getAll(){const t=[];for(let e=0,i=this.size();e<i;e++)t[e]=this.getByIndex(e);return t}}class Wh{constructor(){d(this,"queue",new Fh),d(this,"mergedQueue",{})}destroy(){this.clear()}clear(){this.queue.clear();const t=mi.keys(this.mergedQueue);for(let e=0,i=null==t?void 0:t.length;e<i;e++)void 0!==this.mergedQueue[t[e]]&&this.mergedQueue[t[e]].clear()}push(t,e){return e&&!t.renderOrder&&(t.renderOrder=e),this.queue.enqueue(t),this}unshift(t){this.queue.enqueue(t,!0)}sort(t){return this.queue.size()&&this.queue.sort(t||qh),this}mergeQueue(){for(let t=0,e=this.queue.size();t<e;t++){const t=this.queue.dequeue();if(!t.isShape)continue;const e=Ea(t.mtl);let i=this.mergedQueue[e];i||(i=new Fh,this.mergedQueue[e]=i),i.enqueue(t)}return this}}function qh(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.id-e.id}class Hh{constructor(){d(this,"lists",new WeakMap)}destroy(){this.lists=new WeakMap}get(t,e){const i=this.lists.get(t);let n;return void 0===i?(n=new Wh,this.lists.set(t,[n])):e>=i.length?(n=new Wh,i.push(n)):n=i[e],n}}class Vh{constructor(t={}){d(this,"name","CvsRenderer@"+fi.now()),d(this,"params"),d(this,"autoClear",!0),d(this,"_currentRenderTarget"),d(this,"cvs"),d(this,"ctx"),d(this,"renderStates",new Uh),d(this,"renderStateStack",[]),d(this,"currentRenderState"),d(this,"renderLists",new Hh),d(this,"currentRenderList"),d(this,"renderListStack",[]),d(this,"bindingStates"),d(this,"renderer"),d(this,"_frustum",new Ri),d(this,"_tic"),d(this,"renderSliceComplete",!1),d(this,"lastTicCompleted",-1),d(this,"_isContextLost",!1),d(this,"contextLostHandler",this.handleContextLost.bind(this)),d(this,"contextRestoreHandler",this.handleContextRestore.bind(this)),this.params=t,Jr.config=t,void 0!==t.autoClear&&(this.autoClear=!!t.autoClear),this.init(),this.bindingStates=new Lh(this.params),this.renderer=new Uo(this.ctx,this.bindingStates)}destroy(){this.renderer.destroy()}init(){if(this.params.workerRender){if(!this.params.cvs)throw new Error("offscreen canvas not found");this.cvs=this.params.cvs}else this.cvs=fa.createCanvas(this.params);if(!this.cvs)throw new Error("canvas create error");const t=this.cvs.getContext("2d",{alpha:!0});if(!t)throw new Error("context error");this.params.cvs=this.cvs,this.params.ctx=this.ctx=t,this.setSize(this.params.width,this.params.height)}get isSliceComplete(){return!!this.params.sliceRendering&&this.renderSliceComplete}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.params.width=t,this.params.height=e,this.params.camera||(this.params.camera={}),this.params.camera.width=t,this.params.camera.height=e,this.params.aspect=t/e,this.params.camera.aspect=this.params.aspect,this.params.camera.left=-.5*t,this.params.camera.right=.5*t,this.params.camera.top=.5*e,this.params.camera.bottom=-.5*e,this.cvs&&fa.resizeCanvas(this.cvs,t,e,this.params.dpr)}getSize(t=new Oi){return t.set(this.params.width,this.params.height)}bindEvents(){var t,e;null==(t=this.cvs)||t.addEventListener(jh,this.contextLostHandler,!1),null==(e=this.cvs)||e.addEventListener(Yh,this.contextRestoreHandler,!1)}unbindEvents(){var t,e;null==(t=this.cvs)||t.removeEventListener(jh,this.contextLostHandler,!1),null==(e=this.cvs)||e.removeEventListener(Yh,this.contextRestoreHandler,!1)}handleContextLost(t){t.preventDefault(),this._isContextLost=!0}handleContextRestore(){this._isContextLost=!1}clean(){this.ctx&&(this._currentRenderTarget?this._currentRenderTarget.ctx.clearRect(0,0,this.params.width,this.params.height):this.ctx.clearRect(0,0,this.params.width,this.params.height))}getRenderTarget(){return this._currentRenderTarget}setRenderTarget(t){this._currentRenderTarget=t}render(t,e,i){if(this._isContextLost||!this.ctx)return;this._currentRenderTarget?this.renderer.ctx=this._currentRenderTarget.ctx:this.renderer.ctx=this.ctx,this.currentRenderState=this.renderStates.get(t,this.renderStateStack.length);const n=void 0!==e&&this.currentRenderState.lastCameraVersion!==e.version;(n||t.dynamically||t.matrixWorldAutoUpdate)&&t.updateMatrixWorld(),(n||e&&void 0===e.parent&&(null==e?void 0:e.matrixWorldAutoUpdate))&&e.updateMatrixWorld(),e&&(this._frustum.copy(e.boundingBoxWorld),this.currentRenderState.lastCameraVersion=e.version),t.isScene&&t.onBeforeRender(this,t,e,i),this.currentRenderState.clear(),this.renderStateStack.push(this.currentRenderState),this.currentRenderList=this.renderLists.get(t,this.renderListStack.length),this.currentRenderList.clear(),this.renderListStack.push(this.currentRenderList),this.projectObject(t,e,0),this.currentRenderList.sort(),this.renderScene(this.currentRenderList,t,e,i),t.isScene&&t.onAfterRender(this,t,e),this.renderStateStack.pop(),this.renderStateStack.length>0?this.currentRenderState=this.renderStateStack[this.renderStateStack.length-1]:this.currentRenderState=void 0,this.renderListStack.pop(),this.renderListStack.length?this.currentRenderList=this.renderListStack[this.renderListStack.length-1]:this.currentRenderList=void 0}renderTexture(t,e){t&&t.image&&(this._currentRenderTarget?this.renderer.ctx=this._currentRenderTarget.ctx:this.renderer.ctx=this.ctx,this.autoClear&&this.clean(),this.renderer.ctx.drawImage(t.image,0,0))}projectObject(t,e,i=0){var n,s,r,a,o,h;if(t.visible)if(t.composeNode)t.boundingBoxWorld.isEmpty()?null==(n=this.currentRenderList)||n.push(t,i):this._frustum.intersectsBox(t.boundingBoxWorld)&&(null==(s=this.currentRenderList)||s.push(t,i));else{t.isGroup&&(i=t.renderOrder),t.isShape&&e?t.boundingBoxWorld.isEmpty()?null==(r=this.currentRenderList)||r.push(t,i):this._frustum.intersectsBox(t.boundingBoxWorld)&&(null==(a=this.currentRenderList)||a.push(t,i)):t.isShape&&(null==(o=this.currentRenderList)||o.push(t,i));for(let i=0,n=(null==(h=t.children)?void 0:h.length)||0;i<n;i++)this.projectObject(t.children[i],e)}}renderScene(t,e,i,n){this.autoClear&&this.clean();const s=t.queue;s.size()<=0||(e.isStatic&&this.params.sliceRendering?this.renderObjectsSlice(s,e,i,n):this.renderObjects(s,e,i,n),s.clear())}renderObjects(t,e,i,n){for(let s,r=0,a=t.size();r<a;r++)s=t.dequeue(),s&&this.renderObject(s,e,i,n)}renderObject(t,e,i,n){t.onBeforeRender(this,e,i,n),this.bindingStates.updateModelViewMatrix(t,i),this.bindingStates.setup(t,this.currentRenderState,i),this.renderer.render(t),this.params.wireframe&&this.renderer.renderWireFrame(t),t.onAfterRender(this,e,i)}renderObjectsMerged(t,e,i,n){fi.now(),(()=>{for(let s,r=0,a=t.size();r<a;r++)s=t.dequeue(),s&&this.renderObjectMerged(s,e,i,n)})()}renderObjectMerged(t,e,i,n){t.onBeforeRender(this,e,i,n),this.bindingStates.updateModelViewMatrix(t,i),this.bindingStates.setup(t,this.currentRenderState,i),this.renderer.renderMerged(t),this.params.wireframe&&this.renderer.renderWireFrame(t),t.onAfterRender(this,e,i)}renderObjectsSlice(t,e,i,n){var s;this.autoClear&&this.clean();const r=t.getAll()||[];if(!(null==r?void 0:r.length))return;this._tic&&this._tic.clear(),this.renderSliceComplete=!1;const a=(null==(s=this._currentRenderTarget)?void 0:s.ctx)||this.ctx;if(!a)throw new Error("CvsRenderer.renderObjectsSlice: no ctx");const o=this;this._tic=new Ah(r,(t=>{this.renderSliceComplete=!1,this.renderer.ctx=a,this.renderObject(r[t],e,i,n),e.isStatic&&t===r.length-1&&this.params.debounceCache&&(this.renderSliceComplete=!0)}),this.params.sliceDuration,(function(){o.lastTicCompleted=fi.now()}))}}const jh="contextlost",Yh="contextrestored";Jr.window.requestAnimationFrame;const Gh=Jr.window.performance?()=>Jr.window.performance.now():()=>(new Date).getTime();class Xh{constructor(t=!0){d(this,"autoStart"),d(this,"startTime",0),d(this,"oldTime",0),d(this,"elapsedTime",0),d(this,"running",!1),this.autoStart=t}start(){this.startTime=Gh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Gh();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}class Zh extends hi{constructor(t={}){super(),d(this,"name","RenderTarget"),d(this,"uuid",_n()),d(this,"featureKey",this.name+"@"+this.uuid),d(this,"offscreen",!0),d(this,"width"),d(this,"height"),d(this,"dpr"),d(this,"texture"),d(this,"cvs"),d(this,"ctx"),void 0!==t.offscreen&&(this.offscreen=t.offscreen),this.width=t.width,this.height=t.height,this.dpr=t.dpr||1,this.offscreen?this.cvs=fa.get(this.featureKey,this.width,this.height,this.dpr):this.cvs=fa.createHtmlCanvas(this.width,this.height,this.dpr),this.ctx=fa.getContext2D(this.cvs,{alpha:!0}),this.texture=new zo,this.texture.image=this.cvs}destroy(){super.destroy()}setSize(t,e,i=Jr.config.dpr){this.width===t&&this.height===e&&this.dpr===i||(this.width=t,this.height=e,fa.resizeCanvas(this.cvs,t,e,i))}clean(){this.ctx&&this.ctx.clearRect(0,0,this.width,this.height)}clone(){return new(0,this.constructor)({width:this.width,height:this.height,dpr:this.dpr}).copy(this)}copy(t){return this.name=t.name,this}}const $h=new Oi;class Jh{constructor(t,e){d(this,"name","EffectComposer"),d(this,"renderer"),d(this,"renderTarget1"),d(this,"renderTarget2"),d(this,"writeBuffer"),d(this,"readBuffer"),d(this,"_width"),d(this,"_height"),d(this,"_pixelRatio"),d(this,"renderToScreen",!0),d(this,"passes",[]),d(this,"clock",new Xh),this.renderer=t,e?(this.renderTarget1=e,this._width=e.width,this._height=e.height):(t.getSize($h),this._width=$h.x,this._height=$h.y,this.renderTarget1=new Zh({width:this._width,height:this._height}),this.renderTarget1.name="EffectComposer.rt1"),this._pixelRatio=Jr.config.dpr,this.renderTarget2=this.renderTarget1.clone(),this.renderTarget2.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}destroy(){this.renderTarget1.destroy(),this.renderTarget2.destroy()}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}clearPasses(){this.passes.length=0}isLastEnabledPass(t){for(let e=t+1,i=this.passes.length;e<i;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();for(let e=0,i=this.passes.length;e<i;e++){const i=this.passes[e];i.enabled&&(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),i.render(this.renderer,this.writeBuffer,this.readBuffer,t,!1),i.needsSwap&&this.swapBuffers())}this.renderer.setRenderTarget(e)}reset(t){void 0===t&&(this.renderer.getSize($h),this._pixelRatio=Jr.config.dpr,this._width=$h.x,this._height=$h.y,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)),this.renderTarget1.destroy(),this.renderTarget2.destroy(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const i=this._width*this._pixelRatio,n=this._height*this._pixelRatio;this.renderTarget1.setSize(i,n),this.renderTarget2.setSize(i,n);for(let t=0,e=this.passes.length;t<e;t++)this.passes[t].setSize(i,n)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}}class Qh{constructor(){d(this,"isPass",!0),d(this,"enabled",!0),d(this,"needsSwap",!0),d(this,"clear",!1),d(this,"renderToScreen",!1)}destroy(){}setSize(t,e){}}class Kh{constructor(){d(this,"renderTarget"),d(this,"texture"),d(this,"width"),d(this,"height"),d(this,"dpr"),d(this,"version",-1),this.width=Jr.config.width,this.height=Jr.config.height,this.dpr=Jr.config.dpr,this.renderTarget=new Zh({width:this.width,height:this.height,dpr:this.dpr}),this.texture=this.renderTarget.texture,this.texture.image=this.renderTarget.cvs}destroy(){}render(t){t.renderTexture(this.texture)}}class tl extends Qh{constructor(t,e,i=!0,n=!1){super(),d(this,"name","RenderPass"),d(this,"scene"),d(this,"camera"),this.scene=t,this.camera=e,this.clear=i,this.needsSwap=n}render(t,e,i,n){const s=t.autoClear;t.autoClear=!1,t.setRenderTarget(this.renderToScreen?void 0:i),this.clear&&t.clean(),t.render(this.scene,this.camera,n),t.autoClear=s}}class el extends Qh{constructor(t,e,i=!0,n=!1){super(),d(this,"name","DebouncePass"),d(this,"scene"),d(this,"camera"),d(this,"fsQuad",new Kh),d(this,"debounceQuad",new Kh),d(this,"cacheQuad",new Kh),d(this,"version",-1),d(this,"_ts",fi.now()),d(this,"_initialized",!1),d(this,"debounceRenderHandler",mi.debounce(this.debounceRender.bind(this),100)),this.scene=t,this.camera=e,this.clear=i,this.needsSwap=n}destroy(){super.destroy()}setSize(t,e){this.fsQuad.renderTarget.setSize(t,e),this.debounceQuad.renderTarget.setSize(t,e),this.cacheQuad.renderTarget.setSize(t,e),this.fsQuad.width=t,this.fsQuad.height=e,this.debounceQuad.width=t,this.debounceQuad.height=e,this.cacheQuad.width=t,this.cacheQuad.height=e}get currentVersion(){var t;return this.scene.version+((null==(t=this.camera)?void 0:t.version)||0)}get isChanged(){return this.version!==this.currentVersion}get isDebounceChanged(){return this.debounceQuad.version!==this.currentVersion}isRenderTicComplete(t){return this._ts<=t.lastTicCompleted}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.isChanged?this.isChanged&&!this._initialized?(this.finalRender(this.fsQuad,t,e,i),this.debounceRender(t,e,i)):(this.renderCache(this.debounceQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i),this.debounceRenderHandler(t,e,i)):(Jr.config.debounceCache&&this.isDebounceChanged&&this.isRenderTicComplete(t)?(this.saveCache(this.fsQuad,this.debounceQuad),this.finalRender(this.fsQuad,t,e,i),this._initialized=!0):Jr.config.debounceCache&&this._initialized?(this.renderCache(this.debounceQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i)):(this.renderCache(this.fsQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i)),this._ts=fi.now()),this.version=this.currentVersion,t.autoClear=n}saveCache(t,e){var i;this.isDebounceChanged&&(e.renderTarget.ctx.clearRect(0,0,Jr.config.width,Jr.config.height),e.renderTarget.ctx.drawImage(t.renderTarget.cvs,0,0),null==(i=this.camera)||i.updateMatrixWorld(),e.texture.matrix.copy(t.texture.matrix),e.version=this.currentVersion)}renderCache(t,e){var i;null==(i=this.camera)||i.updateMatrixWorld(),nl.copy(t.texture.matrix).invert().premultiply(this.camera.viewMatrix).getComponents(sl),il.set(Jr.config.width,Jr.config.height),e.renderTarget.ctx.clearRect(0,0,Jr.config.width,Jr.config.height),e.renderTarget.ctx.save(),e.renderTarget.ctx.transform(...sl),e.renderTarget.ctx.drawImage(t.renderTarget.cvs,0,0,il.x,il.y),e.renderTarget.ctx.restore()}finalRender(t,e,i,n){e.setRenderTarget(this.renderToScreen?void 0:n),this.clear&&e.clean(),e.renderTexture(t.renderTarget.texture,this.camera)}debounceRender(t,e,i){t.setRenderTarget(this.renderToScreen?void 0:this.fsQuad.renderTarget),t.clean(),t.render(this.scene,this.camera),this.fsQuad.texture.matrix.copy(this.camera.viewMatrix)}}const il=new Oi,nl=new Gi,sl=[1,0,0,1,0,0];class rl extends Qh{constructor(){super(),d(this,"name","OutputPass"),d(this,"texture"),d(this,"fsQuad"),this.fsQuad=new Kh,this.texture=this.fsQuad.texture,this.clear=!0}destroy(){super.destroy(),this.fsQuad.destroy()}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.fsQuad.texture.image=i.cvs,t.setRenderTarget(this.renderToScreen?void 0:e),this.clear&&t.clean(),this.fsQuad.render(t),i.clean(),t.autoClear=n}}class al{noise(t,e,i=0){const n=Math.floor(t),s=Math.floor(e),r=Math.floor(i),a=255&n,o=255&s,h=255&r,l=(t-=n)-1,u=(e-=s)-1,c=(i-=r)-1,d=hl(t),p=hl(e),f=hl(i),m=ol[a]+o,y=ol[m]+h,g=ol[m+1]+h,v=ol[a+1]+o,x=ol[v]+h,b=ol[v+1]+h;return ll(f,ll(p,ll(d,ul(ol[y],t,e,i),ul(ol[x],l,e,i)),ll(d,ul(ol[g],t,u,i),ul(ol[b],l,u,i))),ll(p,ll(d,ul(ol[y+1],t,e,c),ul(ol[x+1],l,e,c)),ll(d,ul(ol[g+1],t,u,c),ul(ol[b+1],l,u,c))))}}const ol=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];for(let t=0;t<256;t++)ol[256+t]=ol[t];function hl(t){return t*t*t*(t*(6*t-15)+10)}function ll(t,e,i){return e+t*(i-e)}function ul(t,e,i,n){const s=15&t,r=s<8?e:i,a=s<4?i:12==s||14==s?e:n;return(1&s?-r:r)+(2&s?-a:a)}class cl extends Qh{constructor(t){super(),d(this,"name","PaperPass"),d(this,"fsQuad"),d(this,"ctx"),d(this,"camera"),d(this,"version",0),d(this,"_width",0),d(this,"_height",0),this.camera=t,this.fsQuad=new Kh,this.ctx=fa.getContext2D(this.fsQuad.texture.image,{alpha:!0}),this.needsSwap=!1,this._width=this.fsQuad.width,this._height=this.fsQuad.height,this.generatePerlin()}destroy(){super.destroy(),this.fsQuad.destroy()}setSize(t,e){this.fsQuad.renderTarget.setSize(t,e),this.fsQuad.width=t,this.fsQuad.height=e,this._width=t,this._height=e}generatePerlin(){!function(t,e,i){const n=new al,s=t.createImageData(e,i),r=s.data,a=2.5;for(let t=0;t<i;t++)for(let i=0;i<e;i++){const s=n.noise(i/a,t/a,0),o=Math.floor(128*(s+1)),h=4*(t*e+i);r[h]=o,r[h+1]=o,r[h+2]=o,r[h+3]=16}t.putImageData(s,0,0)}(this.ctx,this._width,this._height)}get currentVersion(){var t;return(null==(t=this.camera)?void 0:t.version)||0}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.currentVersion!==this.version&&(this.version=this.currentVersion),this._width===this.fsQuad.width&&this._height===this.fsQuad.height||(this.fsQuad.width=this._width,this.fsQuad.height=this._height,this.generatePerlin()),t.setRenderTarget(this.renderToScreen?void 0:i),t.renderTexture(this.fsQuad.texture),t.autoClear=n}}class dl extends wn{constructor(){super(),d(this,"name","Scene"),d(this,"type","Scene"),d(this,"isScene",!0),d(this,"view"),d(this,"background"),d(this,"featureKey","Scene_"+this.id),d(this,"matrixAutoUpdate",!1)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}setup(t){this.view=t}render(t){var e;this.visible&&(null==(e=this.children)||e.forEach((function(e){e.isShape&&e.render(t)})))}getIntersectObjects(t,e=dn.RM,i=[]){throw new Error("must be implemented in derived")}getByIds(t,e=[]){return e.length=0,t?(this.traverse((function(i){var n,s;(null==(n=i.userData)?void 0:n.id)&&(Array.isArray(t)&&t.includes(null==(s=i.userData)?void 0:s.id)||i.userData.id===t)&&e.push(i)})),e):e}}class pl extends dl{constructor(){super(...arguments),d(this,"isDynamic",!0),d(this,"dynamically",!0)}}const fl=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),ml=(t,e=0,i)=>fl(t)?new(0,t.constructor)(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i),yl=(t,e,i)=>t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t;class gl{constructor(t,e,i,n){d(this,"parameterPositions"),d(this,"resultBuffer"),d(this,"sampleValues"),d(this,"valueSize"),d(this,"settings",null),d(this,"DefaultSettings_",{}),d(this,"__cacheIndex"),d(this,"_cachedIndex",0),this.parameterPositions=t,this.sampleValues=e,this.valueSize=i,this.resultBuffer=n||new Float32Array(i)}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,n=e[i],s=e[i-1];t:{e:{let r;i:{n:if(!(t<n)){for(let r=i+2;;){if(void 0===n){if(t<s)break n;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===r)break;if(s=n,n=e[++i],t<n)break e}r=e.length;break i}if(t>=s)break t;{const a=e[1];t<a&&(i=2,s=a);for(let r=i-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(i===r)break;if(n=s,s=e[--i-1],t>=s)break e}r=i,i=0}}for(;i<r;){const n=i+r>>>1;t<e[n]?r=n:i=n+1}if(n=e[i],s=e[i-1],void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,n)}return this.interpolate_(i,s,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n;for(let t=0;t!==n;++t)e[t]=i[s+t];return e}}class vl extends gl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}intervalChanged_(){}}class xl extends gl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=(i-e)/(n-e),u=1-l;for(let t=0;t!==a;++t)s[t]=Number(r[h+t])*u+Number(r[o+t])*l;return s}intervalChanged_(){}}class bl extends gl{constructor(t,e,i,n){super(t,e,i,n),d(this,"_weightPrev",-0),d(this,"_offsetPrev",-0),d(this,"_weightNext",-0),d(this,"_offsetNext",-0),this.DefaultSettings_={endingStart:2400,endingEnd:2400}}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,y=-c*m+2*c*f-c*p,g=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let t=0;t!==a;++t)s[t]=y*Number(r[l+t])+g*Number(r[h+t])+v*Number(r[o+t])+x*Number(r[u+t]);return s}intervalChanged_(t,e,i){const n=this.parameterPositions;let s=t-2,r=t+1,a=n[s],o=n[r];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:s=t,a=2*e-i;break;case 2402:s=n.length-2,a=e+n[s]-n[s+1];break;default:s=t,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:r=t,o=2*i-e;break;case 2402:r=1,o=i+n[1]-n[0];break;default:r=t-1,o=e}const h=.5*(i-e),l=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(o-i),this._offsetPrev=s*l,this._offsetNext=r*l}}const _l=2300,wl=2301,Sl=2302;class Ml{constructor(t,e,i,n){if(d(this,"name","KeyframeTrack"),d(this,"times"),d(this,"values"),d(this,"ValueTypeName",""),d(this,"DefaultInterpolation",wl),d(this,"createInterpolant"),d(this,"InterpolantFactoryMethodDiscrete",this._InterpolantFactoryMethodDiscrete),d(this,"InterpolantFactoryMethodLinear",this._InterpolantFactoryMethodLinear),d(this,"InterpolantFactoryMethodSmooth",this._InterpolantFactoryMethodSmooth),!e||!e.length)throw new Error("KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=yl(e,Float32Array),this.values=yl(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:yl(t.times,Array),values:yl(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}_InterpolantFactoryMethodDiscrete(t){return new vl(this.times,this.values,this.getValueSize(),t)}_InterpolantFactoryMethodLinear(t){return new xl(this.times,this.values,this.getValueSize(),t)}_InterpolantFactoryMethodSmooth(t){return new bl(this.times,this.values,this.getValueSize(),t)}getValueSize(){return Math.ceil(this.values.length/this.times.length)}setInterpolation(t){let e;switch(t){case _l:e=this.InterpolantFactoryMethodDiscrete;break;case wl:e=this.InterpolantFactoryMethodLinear;break;case Sl:e=this.InterpolantFactoryMethodSmooth}if(!e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return _l;case this.InterpolantFactoryMethodLinear:return wl;case this.InterpolantFactoryMethodSmooth:return Sl}}shift(t){if(0!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){const i=this.times,n=i.length;let s=0,r=n-1;for(;s!==n&&i[s]<t;)++s;for(;-1!==r&&i[r]>e;)--r;if(++r,0!==s||r!==n){s>=r&&(r=Math.max(r,1),s=r-1);const t=this.getValueSize();this.times=ml(i,s,r),this.values=ml(this.values,s*t,r*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(t=!1);const i=this.times,n=this.values,s=i.length;0===s&&(t=!1);let r=null;for(let e=0;e!==s;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){t=!1;break}if(null!==r&&r>n){t=!1;break}r=n}if(void 0!==n&&fl(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){t=!1;break}}return t}optimize(){const t=ml(this.times),e=ml(this.values),i=this.getValueSize(),n=this.getInterpolation()===Sl,s=t.length-1;let r=1;for(let a=1;a<s;++a){let s=!1;const o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0]))if(n)s=!0;else{const t=a*i,n=t-i,r=t+i;for(let a=0;a!==i;++a){const i=e[t+a];if(i!==e[n+a]||i!==e[r+a]){s=!0;break}}}if(s){if(a!==r){t[r]=t[a];const n=a*i,s=r*i;for(let t=0;t!==i;++t)e[s+t]=e[n+t]}++r}}if(s>0){t[r]=t[s];for(let t=s*i,n=r*i,a=0;a!==i;++a)e[n+a]=e[t+a];++r}return r!==t.length?(this.times=ml(t,0,r),this.values=ml(e,0,r*i)):(this.times=t,this.values=e),this}clone(){const t=ml(this.times,0),e=ml(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}d(Ml,"DefaultInterpolation",wl),Ml.prototype.ValueBufferType=Float32Array;class El extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","vector2")}}class Al extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","number")}}class Tl extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","color")}}class Il extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","bool"),d(this,"DefaultInterpolation",_l)}}Il.prototype.ValueBufferType=Array,Il.prototype.InterpolantFactoryMethodLinear=void 0,Il.prototype.InterpolantFactoryMethodSmooth=void 0;class Cl extends Ml{constructor(){super(...arguments),d(this,"ValueTypeName","string"),d(this,"DefaultInterpolation",_l)}}Il.prototype.ValueBufferType=Array,Cl.prototype.InterpolantFactoryMethodLinear=void 0,Cl.prototype.InterpolantFactoryMethodSmooth=void 0;class Dl{constructor(t,e=-1,i,n=Bl){d(this,"name","AnimationClip"),d(this,"duration"),d(this,"tracks"),d(this,"blendMode",Bl),d(this,"uuid",_n()),this.name=t,this.duration=e,this.tracks=i,this.blendMode=n,this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,s=i.length;t!==s;++t)e.push(Nl(i[t]).scale(n));const s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(Ml.toJSON(i[t]));return n}static findByName(t,e){var i;let n;if(t.isShape){const e=t;n=(null==(i=e.geo)?void 0:i.animations)||e.animations}else n=t;for(let t=0;t<n.length;t++)if(n[t].name===e)return n[t]}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){const i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new(0,this.constructor)(this.name,this.duration,t,this.blendMode)}toJSON(){return Dl.toJSON(this)}}function Nl(t){if(void 0===t.type)throw new Error("KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Al;case"vector":case"vector2":return El;case"color":return Tl;case"bool":case"boolean":return Il;case"string":return Cl}throw new Error("KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],i=[];((t,e,i,n)=>{let s=1,r=t[0];for(;void 0!==r&&void 0===r[n];)r=t[s++];if(void 0===r)return;let a=r[n];if(void 0!==a)if(Array.isArray(a))do{a=r[n],void 0!==a&&(e.push(r.time),i.push.apply(i,a)),r=t[s++]}while(void 0!==r);else if(void 0!==a.toArray)do{a=r[n],void 0!==a&&(e.push(r.time),a.toArray(i,i.length)),r=t[s++]}while(void 0!==r);else do{a=r[n],void 0!==a&&(e.push(r.time),i.push(a)),r=t[s++]}while(void 0!==r)})(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const Bl=2500;class kl{constructor(t,e,i){d(this,"path",""),d(this,"parsedPath"),d(this,"_targetGroup"),d(this,"_bindings"),d(this,"rootNode"),this.parsedPath=i||Ol.parseTrackName(e),this._targetGroup=t,this._bindings=t.subscribe_(e,this.parsedPath)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=i.length;n!==s;++n)i[n].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}class Ol{constructor(t,e,i){d(this,"path"),d(this,"parsedPath"),d(this,"node"),d(this,"rootNode"),d(this,"getValue",this._getValue_unbound),d(this,"setValue",this._setValue_unbound),d(this,"targetObject"),d(this,"propertyName"),d(this,"resolvedProperty"),d(this,"propertyIndex",-1),d(this,"BindingType",{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3,ColorString:4}),d(this,"Versioning",{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2}),d(this,"GetterByBindingType",[this._getValue_direct,this._getValue_array,this._getValue_arrayElement,this._getValue_toArray,this._getValue_color]),d(this,"SetterByBindingTypeAndVersioning",[[this._setValue_direct,this._setValue_direct_setNeedsUpdate,this._setValue_direct_setMatrixWorldNeedsUpdate],[this._setValue_array,this._setValue_array_setNeedsUpdate,this._setValue_array_setMatrixWorldNeedsUpdate],[this._setValue_arrayElement,this._setValue_arrayElement_setNeedsUpdate,this._setValue_arrayElement_setMatrixWorldNeedsUpdate],[this._setValue_fromArray,this._setValue_fromArray_setNeedsUpdate,this._setValue_fromArray_setMatrixWorldNeedsUpdate],[this._setValue_color,this._setValue_color_setNeedsUpdate,this._setValue_color_setMatrixWorldNeedsUpdate]]),this.path=e,this.parsedPath=i||Ol.parseTrackName(e),this.node=Ol.findNode(t,this.parsedPath.nodeName),this.rootNode=t}static create(t,e,i){return t&&t.isAnimationObjectGroup?new kl(t,e,i):new Ol(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Ll,"")}static parseTrackName(t){const e=Hl.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4]?parseInt(e[4]):void 0,propertyName:e[5],propertyIndex:e[6]?parseInt(e[6]):void 0},n=i.nodeName&&i.nodeName.lastIndexOf(".")||void 0;if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==Vl.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||void 0===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;const i=t.getObjectByProperty("name",e)||t.getObjectByProperty("uuid",e);return i||void 0}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){this.targetObject&&this.propertyName&&(t[e]=this.targetObject[this.propertyName])}_getValue_array(t,e){const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_getValue_color(t,e){const i=Za.getArray(this.resolvedProperty);for(let n=0,s=i.length;n<s;n++)t[e++]=i[n]}_setValue_direct(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e])}_setValue_direct_setNeedsUpdate(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0)}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_array(t,e){const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){if(!this.targetObject)return;const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){if(!this.targetObject)return;const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0)}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0)}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_color(t,e){this.targetObject&&this.propertyName&&(this.resolvedProperty=this.targetObject[this.propertyName]=jl.fromArray(t,e).getStyle())}_setValue_color_setNeedsUpdate(t,e){this.targetObject&&(this._setValue_color(t,e),this.targetObject.needsUpdate=!0)}_setValue_color_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this._setValue_color(t,e),this.targetObject.matrixWorldNeedsUpdate=!0)}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,i=e.objectName,n=e.propertyName;let s=e.propertyIndex;if(t||(t=Ol.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return;if(i){let n=e.objectIndex;if(void 0===t[i])return;if(t=t[i],void 0!==n){if(void 0===t[n])return;t=t[n]}}if(!t)return;const r=t[n];if(void 0===r)return void e.nodeName;let a=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;void 0!==s?(o=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=s):void 0!==r.fromArray&&void 0!==r.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(o=this.BindingType.EntireArray,this.resolvedProperty=r):r&&Za.isColor(r)?(o=this.BindingType.ColorString,this.resolvedProperty=r,this.propertyName=n):this.propertyName=n,this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=void 0,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}const Pl="\\[\\]\\.:\\/",Ll=new RegExp("["+Pl+"]","g"),Rl="[^"+Pl+"]",zl="[^"+Pl.replace("\\.","")+"]",Ul=/((?:WC+[\/:])*)/.source.replace("WC",Rl),Fl=/(WCOD+)?/.source.replace("WCOD",zl),Wl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Rl),ql=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Rl),Hl=new RegExp("^"+Ul+Fl+Wl+ql+"$"),Vl=["material","materials","bones","map","mat","mtl","geo","l"],jl=new Za;class Yl{constructor(t,e,i){let n,s,r;switch(d(this,"binding"),d(this,"valueSize"),d(this,"buffer"),d(this,"_workIndex",0),d(this,"_mixBufferRegion"),d(this,"_mixBufferRegionAdditive"),d(this,"_setIdentity"),d(this,"_origIndex",3),d(this,"_addIndex",4),d(this,"_cacheIndex"),d(this,"cumulativeWeight",0),d(this,"cumulativeWeightAdditive",0),d(this,"useCount",0),d(this,"referenceCount",0),this.binding=t,this.valueSize=i,e){case"fill":case"stroke":case"textFill":case"string":case"bool":n=this._select,s=this._select,r=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,s=this._lerpAdditive,r=this._setAdditiveIdentityNumeric,this.buffer=new Float32Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=s,this._setIdentity=r,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const i=this.buffer,n=this.valueSize,s=t*n+n;let r=this.cumulativeWeight;if(0===r){for(let t=0;t!==n;++t)i[s+t]=i[t];r=e}else{r+=e;const t=e/r;this._mixBufferRegion(i,s,0,t,n)}this.cumulativeWeight=r}accumulateAdditive(t){const e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,i=this.buffer,n=t*e+e,s=this.cumulativeWeight,r=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-s,e)}r>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,s=e+e;t!==s;++t)if(i[t]!==i[t+e]){a.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,s=n;t!==s;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,n,s){if(n>=.5)for(let n=0;n!==s;++n)t[e+n]=t[i+n]}_lerp(t,e,i,n,s){const r=1-n;for(let a=0;a!==s;++a){const s=e+a;t[s]=t[s]*r+t[i+a]*n}}_lerpAdditive(t,e,i,n,s){for(let r=0;r!==s;++r){const s=e+r;t[s]=t[s]+t[i+r]*n}}}const Gl=2400,Xl=2401;class Zl{constructor(t,e,i,n=e.blendMode){d(this,"blendMode"),d(this,"loop",2201),d(this,"time",0),d(this,"timeScale",1),d(this,"weight",1),d(this,"repetitions",1/0),d(this,"paused",!1),d(this,"enabled",!0),d(this,"clampWhenFinished",!1),d(this,"zeroSlopeAtStart",!0),d(this,"zeroSlopeAtEnd",!0),d(this,"_mixer"),d(this,"_clip"),d(this,"_localRoot"),d(this,"_interpolantSettings"),d(this,"_interpolants"),d(this,"_propertyBindings"),d(this,"_cacheIndex"),d(this,"_byClipCacheIndex"),d(this,"_timeScaleInterpolant"),d(this,"_weightInterpolant"),d(this,"_loopCount",-1),d(this,"_startTime"),d(this,"_effectiveTimeScale",1),d(this,"_effectiveWeight",1),this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const s=e.tracks,r=s.length,a=new Array(r),o={endingStart:Gl,endingEnd:Gl};for(let t=0;t!==r;++t){const e=s[t].createInterpolant();e&&(a[t]=e,e.settings=o)}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r)}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=void 0,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&void 0===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}stopFading(){const t=this._weightInterpolant;return void 0!==t&&(this._weightInterpolant=void 0,this._mixer._takeBackControlInterpolant(t)),this}stopWarping(){const t=this._timeScaleInterpolant;return void 0!==t&&(this._timeScaleInterpolant=void 0,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const s=this._startTime;if(void 0!==s){const n=(t-s)*i;n<0||0===i?e=0:(this._startTime=void 0,e=i*n)}e*=this._updateTimeScale(t);const r=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(r),e[i].accumulateAdditive(a);else for(let i=0,s=t.length;i!==s;++i)t[i].evaluate(r),e[i].accumulate(n,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(void 0!==i){const n=i.evaluate(t)[0];e*=Number(n),t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(void 0!==i){const n=i.evaluate(t)[0];e*=Number(n),t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,s=this._loopCount;const r=2202===i;if(0===t)return-1===s||!r||1&~s?n:e-n;if(2200===i){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",data:{action:this,direction:t<0?-1:1}})}}else{if(-1===s&&(t>=0?(s=0,this._setEndings(!0,0===this.repetitions,r)):this._setEndings(0===this.repetitions,!0,r)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,s+=Math.abs(i);const a=this.repetitions-s;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",data:{action:this,direction:t>0?1:-1}});else{if(1===a){const e=t<0;this._setEndings(e,!e,r)}else this._setEndings(!1,!1,r);this._loopCount=s,this.time=n,this._mixer.dispatchEvent({type:"loop",data:{action:this,loopDelta:i}})}}else this.time=n;if(r&&!(1&~s))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=Xl,n.endingEnd=Xl):(n.endingStart=t?this.zeroSlopeAtStart?Xl:Gl:2402,n.endingEnd=e?this.zeroSlopeAtEnd?Xl:Gl:2402)}}const $l=new Float32Array(1);class Jl extends hi{constructor(t){super(),d(this,"stats"),d(this,"time",0),d(this,"timeScale",1),d(this,"_root"),d(this,"_accuIndex",0),d(this,"_actions",[]),d(this,"_nActiveActions",0),d(this,"_actionsByClip",{}),d(this,"_bindings",[]),d(this,"_nActiveBindings",0),d(this,"_bindingsByRootAndName",{}),d(this,"_controlInterpolants",[]),d(this,"_nActiveControlInterpolants",0),this._root=t,this._initMemoryManager()}destroy(){super.destroy(),this.stopAllAction(),this._root=void 0}dispose(){this._root=void 0}bind(t){t&&(this._root=t)}_bindAction(t,e){if(!this._root)return;const i=t._localRoot||this._root,n=t._clip.tracks,s=n.length,r=t._propertyBindings,a=t._interpolants,o=i.uuid,h=this._bindingsByRootAndName;let l=h[o];void 0===l&&(l={},h[o]=l);for(let t=0;t!==s;++t){const s=n[t],h=s.name;let u=l[h];if(void 0===u){if(u=r[t],void 0!==u){void 0===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,h));continue}const n=e&&e._propertyBindings[t].binding.parsedPath,a=s.getValueSize();u=new Yl(Ol.create(i,h,n),s.ValueTypeName,a),++u.referenceCount,this._addInactiveBinding(u,o,h),r[t]=u}else++u.referenceCount,r[t]=u;a[t].resultBuffer=u.buffer}}_activateAction(t){if(this._root&&!this._isActiveAction(t)){if(void 0===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return void 0!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){const n=this._actions,s=this._actionsByClip;let r=s[e];if(void 0===r)r={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,s[e]=r;else{const e=r.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),r.actionByRoot[i]=t}_removeInactiveAction(t){if(!this._root)return;const e=this._actions,i=e[e.length-1],n=t._cacheIndex||0;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=void 0;const s=t._clip.uuid,r=this._actionsByClip,a=r[s],o=a.knownActions,h=o[o.length-1],l=t._byClipCacheIndex||0;h._byClipCacheIndex=l,o[l]=h,o.pop(),t._byClipCacheIndex=void 0,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===o.length&&delete r[s],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){if(void 0===t._cacheIndex)return;const e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_takeBackAction(t){if(void 0===t._cacheIndex)return;const e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_addInactiveBinding(t,e,i){const n=this._bindingsByRootAndName,s=this._bindings;let r=n[e];void 0===r&&(r={},n[e]=r),r[i]=t,t._cacheIndex=s.length,s.push(t)}_removeInactiveBinding(t){var e;const i=this._bindings,n=t.binding,s=(null==(e=n.rootNode)?void 0:e.uuid)||"",r=n.path,a=this._bindingsByRootAndName,o=a[s],h=i[i.length-1],l=t._cacheIndex||0;h._cacheIndex=l,i[l]=h,i.pop(),delete o[r],0===Object.keys(o).length&&delete a[s]}_lendBinding(t){if(void 0===t._cacheIndex)return;const e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_takeBackBinding(t){if(void 0===t._cacheIndex)return;const e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new xl(new Float32Array(2),new Float32Array(2),1,$l),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){if(void 0===t.__cacheIndex)return;const e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,s=e[n];t.__cacheIndex=n,e[n]=t,s.__cacheIndex=i,e[i]=s}clipAction(t,e,i){if(!this._root)return;const n=e||this._root,s=n.uuid;let r;r="string"==typeof t?Dl.findByName(n,t):t;const a=r?r.uuid:"",o=this._actionsByClip[a];let h;if(void 0===i&&(i=r?r.blendMode:Bl),void 0!==o){const t=o.actionByRoot[s];if(void 0!==t&&t.blendMode===i)return t;h=o.knownActions[0],void 0===r&&(r=h._clip)}if(void 0===r)return;const l=new Zl(this,r,e,i);return this._bindAction(l,h),this._addInactiveAction(l,a,s),l}existingAction(t,e){if(!this._root)return;const i=e||this._root,n=i.uuid;let s="string"==typeof t?Dl.findByName(i,t):t;const r=s?s.uuid:"",a=this._actionsByClip[r];return void 0!==a&&a.actionByRoot[n]||void 0}removeAction(t){t&&this._deactivateAction(t)}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,s=Math.sign(t),r=this._accuIndex^=1;for(let a=0;a!==i;++a)e[a]._update(n,t,s,r);const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(r);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,i=t.uuid,n=this._actionsByClip,s=n[i];if(void 0!==s){const t=s.knownActions;for(let i=0,n=t.length;i!==n;++i){const n=t[i];this._deactivateAction(n);const s=n._cacheIndex||0,r=e[e.length-1];n._cacheIndex=void 0,n._byClipCacheIndex=void 0,r._cacheIndex=s,e[s]=r,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(t){const e=t.uuid,i=this._actionsByClip;for(const t in i){const n=i[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[e];if(void 0!==n)for(const t in n){const e=n[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const i=this.existingAction(t,e);void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class Ql extends Ia{constructor(t,e={}){var i,n;let s;s=ho.parse(t),mi.set(e,"use3DShape",Kl);const r=mh.getShapesByParsed(s,e);if(!(null==r?void 0:r.length))throw new Error(`Svg: no shapes: ${t}`);super(null==(i=null==r?void 0:r[0])?void 0:i.geo,null==(n=null==r?void 0:r[0])?void 0:n.mtl),d(this,"name","Svg"),d(this,"composeNode",!0),(null==r?void 0:r.length)>1&&this.adds(r.slice(1))}}const Kl=!1;class tu extends Ia{constructor(t){const e=new ao(t),i=new Aa(t);(null==t?void 0:t.lineWidth)||(i.lineWidth=1),super(e,i),d(this,"name","Polygon")}}class eu extends pl{constructor(t={}){var e,i;super(),d(this,"isLoadingScene",!0),d(this,"name","LoadingScene"),d(this,"params"),d(this,"loadingShape"),d(this,"lineShape"),d(this,"triangleShape"),d(this,"scales",[.95,1.15,.002]),d(this,"l",0),d(this,"scaleTrend",!1),d(this,"clock",new Xh),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.loadingShape=new Ql(iu,{fill:Fa,flipY:!0}),this.loadingShape.name="loading",this.loadingShape.dynamically=!0,this.add(this.loadingShape),this.loadingShape.setScale(.5,.5).updateMatrix(),this.loadingShape.updateMatrixWorld(),this.loadingShape.computeBoundingBox(),this.loadingShape.updateBoundingBox(),ru.copy(this.loadingShape.boundingBoxWorld).getCenter(nu),ru.getSize(su),this.loadingShape.setPosition(nu.negate()).updateMatrix(),this.l=su.x;const n=Math.max(Math.floor(this.l/30),3),s=[-this.l/2,-(8+n),-this.l/2,-8,this.l/2,-8,this.l/2,-(8+n)];this.lineShape=new tu({points:s,fill:Fa}),this.add(this.lineShape),this.lineShape.name="loadingLine";const r=[0,0,su.x/2,su.x,su.x,0];this.triangleShape=new tu({points:r,fill:Ra}),this.add(this.triangleShape),this.triangleShape.name="loadingTriangle",this.triangleShape.setPosition(new Oi(-.12*su.x,su.y/-.36)).setScale(.25,.15).updateMatrix(),this.computeBoundingBox(),this.mixer=new Jl(this);const a=new El(`${this.loadingShape.name}.mtl.fill`,[0,1.2,2],[0,0,0,.7,.38,.38,.38,.6,0,0,0,.7]),o=new Al(`${this.triangleShape.name}.mtl.fillOpacity`,[0,1.5,3],[1,.1,1],Al.DefaultInterpolation),h=new El(`${this.lineShape.name}.scaled`,[0,.3,1],[1,1,.1,1,1,1]);this._selectedClip=new Dl("selected",3,[a,o,h]),this.selectedAction=null==(e=this.mixer)?void 0:e.clipAction(this._selectedClip,this.desScene),null==(i=this.selectedAction)||i.play()}destroy(){super.destroy()}onBeforeRender(){this.lineShape.updateMatrix()}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta())}}const iu='\n<path d="M0 20.7L0 0L7.272 0L7.272 18L20.592 18L19.08 20.7L0 20.7\nM30.78 2.772L30.78 17.928L41.4 17.928L41.4 0L48.708 0L48.708 20.7L23.472 20.7L23.472 0L41.4 0L38.88 2.772L30.78 2.772\nM62.388 12.924L71.028 12.924L68.904 15.768L61.2 15.768L59.292 20.7L51.588 20.7L59.94 0L73.188 0L81.576 20.7L73.944 20.7L71.028 12.924L67.14 2.772L65.988 2.772L62.388 12.924\nM109.728 17.784L106.884 20.7L84.456 20.7L84.456 0L102.528 0L99.972 2.844L91.656 2.844L91.656 17.928L102.528 17.928L102.528 0L107.136 0L109.728 2.7L109.728 17.784\nM119.628 20.7L112.608 20.7L112.608 0L119.628 0L119.628 20.7\nM139.752 20.7L129.78 6.3L129.78 20.7L122.508 20.7L122.508 0L130.644 0L140.58 14.652L140.58 0L147.78 0L147.78 20.7L139.752 20.7\nM168.732 18L168.732 10.728L163.368 10.728L163.368 7.992L175.932 7.992L175.932 20.7L168.732 20.7L168.732 18.504L166.572 20.7L150.66 20.7L150.66 0L176.04 0L174.456 2.7L158.04 2.7L158.04 18L168.732 18\nZ">\n</path>\n',nu=new Oi,su=new Oi,ru=new Ri,au=new Oi;class ou extends wn{constructor(t){super(),d(this,"isCamera",!0),d(this,"type","Camera2"),d(this,"name","Camera2"),d(this,"params"),d(this,"matrixAutoUpdate",!1),d(this,"matrixWorldAutoUpdate",!1),d(this,"projectionMatrix",new Gi),d(this,"projectionMatrixInverse",new Gi),d(this,"viewMatrix",new Gi),d(this,"viewMatrixNeedsUpdate",!0),d(this,"viewArea",0),d(this,"left",-1),d(this,"right",1),d(this,"top",1),d(this,"bottom",-1),d(this,"width",2),d(this,"height",2),d(this,"aspect",1),d(this,"view"),this.params=t,this.width=void 0!==(null==t?void 0:t.width)?t.width:2,this.height=void 0!==(null==t?void 0:t.height)?t.height:2,this.aspect=void 0!==(null==t?void 0:t.aspect)?t.aspect:1,void 0!==(null==t?void 0:t.left)&&(this.left=t.left),void 0!==(null==t?void 0:t.right)&&(this.right=t.right),void 0!==(null==t?void 0:t.top)&&(this.top=t.top),void 0!==(null==t?void 0:t.bottom)&&(this.bottom=t.bottom);const e=(this.right+this.left)/2,i=(this.top+this.bottom)/2;if(this.aspect>1){const t=Math.round((this.right-this.left)/2/this.aspect);this.top=i+t,this.bottom=i-t}else if(this.aspect<1){const t=Math.round((this.top-this.bottom)/2*this.aspect);this.left=e-t,this.right=e+t}this.flipY=!0===(null==t?void 0:t.flipY),this.updateProjectionMatrix(),(null==t?void 0:t.eye)&&this.position.fromArray(t.eye),(null==t?void 0:t.up)&&this.up.fromArray(t.up),this.computeBoundingBox(),this.update()}destroy(){super.destroy()}get pixelWidth(){return this.scaled.x}set(t=-1,e=1,i=1,n=-1){au.set(t+e,n+i).multiplyScalar(.5);const s=Math.max((e-t)/this.width,(i-n)/this.height);this.setTRS(au,0,s)}setByBox(t){t&&!t.isEmpty()&&this.set(t.min.x,t.max.x,t.max.y,t.min.y)}setTRS(t={x:0,y:0},e=0,i=0){this.position.set(t.x||0,t.y||0),this.rotation.set(e,e),this.scaled.set(i,i),this.update()}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.width=t||2,this.height=e||2,this.left=this.params.left||-1,this.right=this.params.right||1,this.top=this.params.top||1,this.bottom=this.params.bottom||-1,this.aspect=t/e;const i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;if(this.aspect>1){const t=Math.round((this.right-this.left)/2/this.aspect);this.top=n+t,this.bottom=n-t}else if(this.aspect<1){const t=Math.round((this.top-this.bottom)/2*this.aspect);this.left=i-t,this.right=i+t}this.updateProjectionMatrix(),this.boundingBox.min.set(this.left,this.bottom),this.boundingBox.max.set(this.right,this.top),this.update(),this.matrix.decompose(this.position,this.rotation,this.scaled)}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[6],-e[7]).normalize()}getCameraPosition(){return{x:this.position.x,y:this.position.y,z:this.position.z,s:this.scaled.x,r:this.rotation.x}}updateMatrixWorld(t=!1){super.updateMatrixWorld(t),this.updateViewMatrix()}updateProjectionMatrix(){void 0===this.parent&&this.matrixWorldAutoUpdate&&this.updateMatrixWorld(),this.projectionMatrix.makeProjection(this.left,this.right,this.top,this.bottom,this.width,this.height),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}updateViewMatrix(){this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.viewMatrix.multiplyMatrices(this.projectionMatrix,this.matrixWorldInverse)}update(t=!0){this.matrixAutoUpdate||this.updateMatrix(),this.updateMatrixWorld(),this.needsUpdate=!0,this.updateBoundingBox(),t&&this.dispatchEvent({type:"update",data:{t:this.position,r:this.rotation.x,s:this.scaled.x}})}computeBoundingBox(){return this.boundingBox.min.set(this.left,this.bottom),this.boundingBox.max.set(this.right,this.top),this.boundingBox}updateBoundingBox(){super.updateBoundingBox(),this.viewArea=this.boundingBoxWorld.getArea()}toJSON(){const t={};return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.width=this.width,t.height=this.height,t.aspect=this.aspect,t.position=this.position.toArray(),t.rotation=this.rotation.toArray(),t.scaled=this.scaled.toArray(),t}fromJSON(t){this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.position.fromArray(t.position),this.rotation.fromArray(t.rotation),this.scaled.fromArray(t.scaled),this.updateProjectionMatrix(),this.update(!1)}clone(){return(new this.constructor.prototype.constructor).copy(this)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}}var hu=(t=>(t.UPDATE="update",t))(hu||{}),lu=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-lu.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*lu.Bounce.In(2*t):.5*lu.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),uu=function(){return performance.now()},cu=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var n=0,s=e;n<s.length;n++){var r=s[n];null===(t=r._group)||void 0===t||t.remove(r),r._group=this,this._tweens[r.getId()]=r,this._tweensAddedDuringUpdate[r.getId()]=r}},t.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var s=n[i];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},t.prototype.allStopped=function(){return this.getAll().every((function(t){return!t.isPlaying()}))},t.prototype.update=function(t,e){void 0===t&&(t=uu()),void 0===e&&(e=!0);var i=Object.keys(this._tweens);if(0!==i.length)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var s=this._tweens[i[n]],r=!e;s&&!1===s.update(t,r)&&!e&&this.remove(s)}i=Object.keys(this._tweensAddedDuringUpdate)}},t}(),du={Linear:function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n),r=du.Utils.Linear;return e<0?r(t[0],t[1],n):e>1?r(t[i],t[i-1],i-n):r(t[s],t[s+1>i?i:s+1],n-s)},Utils:{Linear:function(t,e,i){return(e-t)*i+t}}},pu=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),fu=new cu,mu=function(){function t(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=lu.Linear.None,this._interpolationFunction=du.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=pu.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,"object"==typeof e?(this._group=e,e.add(this)):!0===e&&(this._group=fu,fu.add(this))}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=uu()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var i in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var s in this._valuesEnd)n[s]=this._valuesEnd[s];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,i,n,s){for(var r in i){var a=t[r],o=Array.isArray(a),h=o?"array":typeof a,l=!o&&Array.isArray(i[r]);if("undefined"!==h&&"function"!==h){if(l){if(0===(y=i[r]).length)continue;for(var u=[a],c=0,d=y.length;c<d;c+=1){var p=this._handleRelativeValue(a,y[c]);if(isNaN(p)){l=!1;break}u.push(p)}l&&(i[r]=u)}if("object"!==h&&!o||!a||l)(void 0===e[r]||s)&&(e[r]=a),o||(e[r]*=1),n[r]=l?i[r].slice().reverse():e[r]||0;else{e[r]=o?[]:{};var f=a;for(var m in f)e[r][m]=f[m];n[r]=o?[]:{};var y=i[r];if(!this._isDynamic){var g={};for(var m in y)g[m]=y[m];i[r]=y=g}this._setupProperties(f,e[r],y,n[r],s)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(t){return void 0===t&&(t=uu()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t),this},t.prototype.resume=function(t){return void 0===t&&(t=uu()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return t?(t.add(this),this):this},t.prototype.remove=function(){var t;return null===(t=this._group)||void 0===t||t.remove(this),this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=lu.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=du.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(e,i){var n,s,r=this;if(void 0===e&&(e=uu()),void 0===i&&(i=t.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!i)return!1;this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,o=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),h=this._duration+this._repeat*o,l=function(){if(0===r._duration)return 1;if(a>h)return 1;var t=Math.trunc(a/o),e=a-t*o,i=Math.min(e/r._duration,1);return 0===i&&a===r._duration?1:i}(),u=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||a>=this._duration){if(this._repeat>0){var c=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(s in isFinite(this._repeat)&&(this._repeat-=c),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[s]||(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*c,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var d=0,p=this._chainedTweens.length;d<p;d++)this._chainedTweens[d].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,i,n){for(var s in i)if(void 0!==e[s]){var r=e[s]||0,a=i[s],o=Array.isArray(t[s]),h=Array.isArray(a);!o&&h?t[s]=this._interpolationFunction(a,n):"object"==typeof a&&a?this._updateProperties(t[s],r,a,n):"number"==typeof(a=this._handleRelativeValue(r,a))&&(t[s]=r+(a-r)*n)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof i?this._valuesStartRepeat[t]+parseFloat(i):this._valuesEnd[t],this._valuesEnd[t]=e},t.autoStartOnUpdate=!1,t}();pu.nextId;var yu=fu;yu.getAll.bind(yu),yu.removeAll.bind(yu),yu.add.bind(yu),yu.remove.bind(yu),yu.update.bind(yu),t={Easing:lu,Tween:mu};class gu extends hi{constructor(t,e){super(),d(this,"name","OrbitControls2"),d(this,"isSvg",!1),d(this,"dom"),d(this,"domOffset",new Oi),d(this,"camera"),d(this,"enabled",!0),d(this,"enablePan",!0),d(this,"enableRotate",!0),d(this,"rotateSpeed",1),d(this,"enableZoom",!0),d(this,"minZoom",0),d(this,"maxZoom",1/0),d(this,"zoomSpeed",1),d(this,"zoomChanged",!1),d(this,"distanceStart",1),d(this,"distanceEnd",1),d(this,"state",-1),d(this,"EPS",1e-6),d(this,"focus",new Oi),d(this,"target",new Oi),d(this,"scaled",1),d(this,"rotateTheta",0),d(this,"enableDamping",!1),d(this,"dampingFactor",.05),d(this,"mouseButtons",{LEFT:2,MIDDLE:1,RIGHT:0}),d(this,"isWheeling",!1),d(this,"finalTimer"),d(this,"rotateStart",new Oi),d(this,"rotateEnd",new Oi),d(this,"rotateDelta",new Oi),d(this,"panStart",new Oi),d(this,"panEnd",new Oi),d(this,"panOffset",new Oi),d(this,"dollyStart",0),d(this,"dollyOffset",new Oi),d(this,"contextMenuHandler",this.handleContextMenu.bind(this)),d(this,"wheelHandler",this.handleWheel.bind(this)),d(this,"pointerDownHandler",this.handlePointerDown.bind(this)),d(this,"pointerUpHandler",this.handlePointerUp.bind(this)),d(this,"pointerMoveHandler",this.handlePointerMove.bind(this)),d(this,"pointerOverHandler",mi.debounce(this.handlePointerOver.bind(this),100)),d(this,"pointerLeaveHandler",this.handlePointerLeave.bind(this)),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"panHandler",this.handlePan.bind(this)),d(this,"pinchHandler",this.handlePinch.bind(this)),d(this,"pressHandler",this.handlePress.bind(this)),d(this,"swipeHandler",this.handleSwipe.bind(this)),d(this,"hammerInputHandler",this.handleHammerInput.bind(this)),this.dom=t,this.camera=e,this.scaled=e.scaled.x,this.resize(),this.dom.style.touchAction="none",this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}update(){this.camera.position.add(this.panOffset).add(this.dollyOffset),this.camera.scaled.set(this.scaled,this.scaled),this.rotateTheta&&(this.camera.rotation.x-=this.rotateTheta,vu.copy(this.camera.position).rotateAround(this.focus,-this.rotateTheta),this.camera.position.copy(vu)),this.camera.update(),this.panOffset.set(0,0),this.dollyOffset.set(0,0),this.scaled=this.camera.scaled.x,this.rotateTheta=0,this.dispatchEvent({type:"cameraChanged",data:{t:this.camera.position,r:this.camera.rotation.x,s:this.camera.scaled.x}})}bindEvents(){this.unbindEvents(),this.dom.addEventListener("panstart",this.panHandler),this.dom.addEventListener("panmove",this.panHandler),this.dom.addEventListener("panend",this.panHandler),this.dom.addEventListener("pinchstart",this.pinchHandler),this.dom.addEventListener("pinchmove",this.pinchHandler),this.dom.addEventListener("pinchend",this.pinchHandler),this.dom.addEventListener("singletap",this.tapHandler),this.dom.addEventListener("press",this.pressHandler),this.dom.addEventListener("hammer.input",this.hammerInputHandler),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("wheel",this.wheelHandler,{passive:!1}),this.dom.addEventListener("mousemove",this.pointerOverHandler)}unbindEvents(){this.dom.removeEventListener("panstart",this.panHandler),this.dom.removeEventListener("panmove",this.panHandler),this.dom.removeEventListener("panend",this.panHandler),this.dom.removeEventListener("pinchstart",this.pinchHandler),this.dom.removeEventListener("pinchmove",this.pinchHandler),this.dom.removeEventListener("pinchend",this.pinchHandler),this.dom.removeEventListener("singletap",this.tapHandler),this.dom.removeEventListener("press",this.pressHandler),this.dom.removeEventListener("hammer.input",this.hammerInputHandler),this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("wheel",this.wheelHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler)}setFocus(t,e){this.focus.set(t,e).sub(this.domOffset).unproject(this.camera)}handleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),xu.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"tap",data:{screenCoords:{x:xu.x,y:xu.y}},e:t})}handleDoubleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),xu.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"doubletap",data:{screenCoords:{x:xu.x,y:xu.y}}})}handlePress(t){"function"==typeof t.preventDefault&&t.preventDefault()}handlePan(t){var e;if(this.scaled=this.camera.scaled.x,1!==(null==(e=t.pointers)?void 0:e.length))return;"function"==typeof t.preventDefault&&t.preventDefault();const i={type:"panmove",data:{}};(t.isFirst||"panstart"===t.type)&&(this.state=2,this.panStart.set(t.center.x,t.center.y),i.type="panstart"),(t.isFinal||"panend"===t.type)&&(this.state=-1,i.type="panend"),this.panEnd.set(t.center.x,t.center.y),this.panOffset.subVectors(this.panEnd,this.panStart).multiplyScalar(-this.camera.scaled.x,-this.camera.scaled.y*(this.camera.flipY?1:-1)).rotate(this.camera.rotation.x),this.panStart.copy(this.panEnd),xu.set(t.center.x,t.center.y).sub(this.domOffset),i.data.screenCoords=xu.clone(),this.dispatchEvent(i),this.enablePan&&this.update()}handlePinch(t){"function"==typeof t.preventDefault&&t.preventDefault(),"pinchstart"===t.type&&(this.dollyStart=this.camera.scaled.x,this.state=1),(t.isFinal||"pinchend"===t.type)&&(this.state=-1),this.scaled=this.dollyStart*(1/t.scale);let e=(this.scaled-this.camera.scaled.x)/this.camera.scaled.x;this.setFocus(t.center.x,t.center.y),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-e).sub(this.camera.position),this.update()}handleRotate(t){"function"==typeof t.preventDefault&&t.preventDefault()}handleSwipe(t){"function"==typeof t.preventDefault&&t.preventDefault()}handleHammerInput(t){t.isFirst&&(this.state=9),t.isFinal&&(this.state=-1)}handleContextMenu(t){this.enabled&&"function"==typeof t.preventDefault&&t.preventDefault()}handleWheel(t){if("function"==typeof t.preventDefault&&t.preventDefault(),!this.enabled||!this.enableZoom||-1!==this.state)return;this.isWheeling||(this.dispatchEvent({type:"wheelstart"}),this.isWheeling=!0),"function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation();let e=t.deltaY;1===(null==t?void 0:t.deltaMode)?e*=16:2===(null==t?void 0:t.deltaMode)&&(e*=100),(null==t?void 0:t.ctrlKey)&&(e*=10),this.setFocus(t.clientX,t.clientY);let i=this.getZoomScale(e);e<0?this.onDollyIn(i):e>0?this.onDollyOut(i):(this.scaled=this.camera.scaled.x,this.dollyOffset.set(0,0)),this.update(),clearTimeout(this.finalTimer),this.finalTimer=setTimeout((()=>{this.isWheeling&&(this.dispatchEvent({type:"wheelend"}),this.isWheeling=!1)}),500)}onDollyIn(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x*t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,1-t).sub(this.camera.position)}onDollyOut(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x/t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-1+t).sub(this.camera.position)}getZoomScale(t){return Math.pow(.95,this.zoomSpeed*Math.abs(.03*t))}handlePointerDown(t){if(this.scaled=this.camera.scaled.x,!this.enabled)return;if(2!==t.button)return;this.dom.addEventListener("pointermove",this.pointerMoveHandler),this.dom.addEventListener("pointerup",this.pointerUpHandler);let e=-1;0===t.button?e=this.mouseButtons.LEFT:1===t.button?e=this.mouseButtons.MIDDLE:2===t.button&&(e=this.mouseButtons.RIGHT),0===e&&(this.rotateStart.set(t.clientX,t.clientY),this.setFocus(this.rotateStart.x,this.rotateStart.y),this.state=0)}handlePointerUp(){this.dom.removeEventListener("pointermove",this.pointerMoveHandler),this.dom.removeEventListener("pointerup",this.pointerUpHandler),this.state=-1}handlePointerLeave(){this.state=-1}handlePointerMove(t){if(this.enabled&&0===this.state){if(!this.enableRotate)return;this.onRotate(t.clientX,t.clientY)}}handlePointerOver(t){t.buttons>0||(xu.set(t.clientX,t.clientY).sub(this.domOffset),this.dispatchEvent({type:"pointerover",data:{screenCoords:{x:xu.x,y:xu.y}},e:t}))}onRotate(t,e){this.rotateEnd.set(t,e),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const i=this.rotateDelta.x*Math.PI*2/this.dom.clientHeight;this.rotateTheta-=i,this.rotateStart.copy(this.rotateEnd),this.update()}}const vu=new Oi,xu=new Oi;var bu=(t=>(t.CONTEXTMENU="contextmenu",t.LOSTPOINTERCAPTURE="lostpointercapture",t.MOUSEOVER="mouseover",t.MOUSEOUT="mouseout",t.MOUSELEAVE="mouseleave",t.MOUSEENTER="mouseenter",t.MOUSEMOVE="mousemove",t.MOUSEDOWN="mousedown",t.MOUSEUP="mouseup",t.POINTERMOVE="pointermove",t.POINTERDOWN="pointerdown",t.POINTERUP="pointerup",t.POINTERCANCEL="pointercancel",t.POINTEROUT="pointerout",t.POINTERLEAVE="pointerleave",t.POINTEROVER="pointerover",t.POINTERENTER="pointerenter",t.TOUCHSTART="touchstart",t.TOUCHEND="touchend",t.TOUCHMOVE="touchmove",t.TOUCHCANCEL="touchcancel",t.WHEEL="wheel",t.WHEEL_START="wheelstart",t.WHEEL_END="wheelend",t.MOUSEWHEEL="mousewheel",t.CLICK="click",t.DBLCLICK="dblclick",t.CONTEXT_LOST="contextlost",t.CONTEXT_RESTORED="contextrestored",t.CONTROLS_CHANGED="controlschanged",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.PAN="pan",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t.ROTATE="rotate",t.ROTATE_START="rotatestart",t.ROTATE_MOVE="rotatemove",t.ROTATE_END="rotateend",t.PINCH="pinch",t.PINCH_START="pinchstart",t.PINCH_MOVE="pinchmove",t.PINCH_END="pinchend",t.PINCH_IN="pinchin",t.PINCH_OUT="pinchout",t.SWIPE="swipe",t.CHANGE_START="change_start",t.CHANGE_END="change_end",t.CAMERA_CHANGED="cameraChanged",t))(bu||{});class _u extends hi{constructor(t={}){var e,i;super(),d(this,"name","View"),d(this,"params"),d(this,"visible",!0),d(this,"cvs"),d(this,"scene"),d(this,"scenes",[]),d(this,"camera"),d(this,"controller"),d(this,"tween"),d(this,"animateDuration"),d(this,"controlsChangedHandler",this.handleControlsChanged.bind(this)),this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new ou(t.camera||{}),this.params.inpEl?this.controller=new gu(this.params.inpEl,this.camera):this.controller=new gu(this.cvs,this.camera),void 0!==(null==(e=this.params.controls)?void 0:e.enableRotate)&&(this.controller.enableRotate=!!(null==(i=this.params.controls)?void 0:i.enableRotate))}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach((t=>t.destroy())),this.scenes.length=0,super.destroy()}resize(){var t;this.camera.resize(),null==(t=this.controller)||t.resize()}setEnablePan(t){this.controller&&(this.controller.enablePan=!!t)}bindEvents(){var t;null==(t=this.controller)||t.addEventListener("change",this.controlsChangedHandler)}unbindEvents(){var t;null==(t=this.controller)||t.removeEventListener("change",this.controlsChangedHandler)}handleControlsChanged(t){}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}getCameraPosition(){return this.camera.boundingBoxWorld}setCameraPosition(t,e=!0){return Eu.copy(t),this.resetCameraByBoundingBox(Eu,e)}saveCameraPosition(t){Eu.copy(this.camera.boundingBoxWorld);const e=t?wu+t:wu;sessionStorage.setItem(e,JSON.stringify(Eu))}clearCameraPosition(t){const e=t?wu+t:wu;sessionStorage.setItem(e,"")}restoreCameraPosition(t){const e=t?wu+t:wu,i=sessionStorage.getItem(e);i&&(Eu.copy(JSON.parse(i)),this.resetCameraByBoundingBox(Eu,!0))}zoomIn(){Eu.copy(this.camera.boundingBoxWorld).getSize(Su),Eu.expandByScalar(-.1*Math.max(Su.x,Su.y)),this.resetCameraByBoundingBox(Eu,!0)}zoomOut(){this.controller&&(Eu.copy(this.camera.boundingBoxWorld).getSize(Su),Eu.expandByScalar(.1*Math.max(Su.x,Su.y)),this.resetCameraByBoundingBox(Eu,!0))}fullscreen(t=10,e=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),"function"==typeof this.scene.computeBoundingBox?Eu.copy(this.scene.computeBoundingBox()):Eu.copy(this.scene.boundingBox),Eu.expandByVector(Su.set(t,t)),this.resetCameraByBoundingBox(Eu,e))}handleCameraChanged(t){}reset(){}resetCameraByBoundingBox(t,e=!1){return p(this,null,(function*(){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(Su),t.getSize(Mu);const n=Math.max(Mu.x/this.camera.width,Mu.y/this.camera.height),s={x:Su.x,y:Su.y,z:0,s:n,r:0};yield this.animateCamera(i,s)}))}animateCamera(e,i){return p(this,null,(function*(){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise((n=>{this.tween=new t.Tween(e).to(i,this.animateDuration).easing(t.Easing.Exponential.Out).onUpdate((t=>{this.camera.position.set(t.x,t.y),this.camera.scaled.set(t.s,t.s),this.camera.rotation.set(t.r,t.r),this.camera.update()})).onComplete((()=>{this.controller&&(this.controller.enabled=!0),n()})).start()}))}))}computeBoundingBox(t,e=new Ri){return t&&t.length?(e.makeEmpty(),t.forEach((t=>e.union(t.computeBoundingBox()))),e):e}expandScenesBoundingBox(t,e=new Ri){t.forEach((t=>t.boundingBox.union(e)))}update(t){this.tween&&this.tween.update(t)}}const wu="camera_position_",Su=new Oi,Mu=new Oi,Eu=new Ri;class Au extends dl{constructor(){super(...arguments),d(this,"isStatic",!0),d(this,"featureKey","StaticScene_"+this.id),d(this,"cameraVersion",0),d(this,"dynamically",!1),d(this,"needsUpdateChangedHandler",this.handleNeedsUpdateChanged.bind(this))}handleNeedsUpdateChanged(){this.needsUpdate=!0}}class Tu extends ya{constructor(t){super(t),d(this,"name","GeoPolyline"),this._init(t),((null==t?void 0:t.stArrow)||(null==t?void 0:t.edArrow))&&(this.arrowLength=(null==t?void 0:t.arrowLength)||10,this.arrowDeg=(null==t?void 0:t.arrowDeg)||30)}buildPath(t,e,i){if(0===this.percent)return;let{points:n}=e||this;if(n&&n.length&&!(n.length<2)){for(let e=0,i=n.length;e<i;e+=2)e?t.lineTo(n[e],n[e+1]):t.moveTo(n[e],n[e+1]);this.addArrow(t)}}addArrow(t,e){const{points:i,stArrow:n,edArrow:s,arrowDeg:r,arrowLength:a}=this;if(!(null==i?void 0:i.length)||!n&&!s||!r)return this;if(e||(e=a),!e)return this;const o=i;if(!(null==o?void 0:o.length)||(null==o?void 0:o.length)<4)return this;if(n){if(Iu.set(o[2],o[3]),Du.set(o[0],o[1]),Iu.equals(Du))return this;Cu.subVectors(Iu,Du),Nu.lerpVectors(Du,Iu,e/Cu.length()),Bu.copy(Nu).rotateAround(Du,Bi(r)),ku.copy(Nu).rotateAround(Du,-Bi(r)),t.moveTo(Bu.x,Bu.y),t.lineTo(Du.x,Du.y),t.lineTo(ku.x,ku.y)}if(s){const i=o.length;if(Iu.set(o[i-4],o[i-3]),Du.set(o[i-2],o[i-1]),Iu.equals(Du))return this;Cu.subVectors(Iu,Du),Nu.lerpVectors(Du,Iu,e/Cu.length()),Bu.copy(Nu).rotateAround(Du,Bi(r)),ku.copy(Nu).rotateAround(Du,-Bi(r)),t.moveTo(Bu.x,Bu.y),t.lineTo(Du.x,Du.y),t.lineTo(ku.x,ku.y)}return this}}const Iu=new Oi,Cu=new Oi,Du=new Oi,Nu=new Oi,Bu=new Oi,ku=new Oi;class Ou extends Ia{constructor(t={}){(null==t?void 0:t.width)||(t.width=.5*Jr.config.width),(null==t?void 0:t.height)||(t.height=.5*Jr.config.height),(null==t?void 0:t.lineWidth)||(t.lineWidth=1),(null==t?void 0:t.stroke)||(t.stroke=Ra),(null==t?void 0:t.arrowDeg)||(t.arrowDeg=30),(null==t?void 0:t.arrowLength)||(t.arrowLength=10),(null==t?void 0:t.lineDash)||(t.lineDash=[10,7]),t.points=[-t.width,0,t.width,0,0,t.height,0,-t.height];const e=.5*(t.arrowLength||10);super(new ao({points:[-e,0,0,e,e,0,0,-e]}),new Aa({fill:Ra})),d(this,"name","Axes"),d(this,"params"),d(this,"xShape"),d(this,"yShape"),d(this,"xRShape"),d(this,"yRShape"),this.params=t,this.xShape=new Ia(new Tu({points:[2*e,0,t.width,0],linewidth:t.lineWidth,edArrow:!0,arrowLength:t.arrowLength,arrowDeg:t.arrowDeg}),new Aa({stroke:Ra,lineWidth:1})),this.yShape=new Ia(new Tu({points:[0,2*e,0,t.height],linewidth:t.lineWidth,edArrow:!0,arrowLength:t.arrowLength,arrowDeg:t.arrowDeg}),new Aa({stroke:ka,lineWidth:1})),this.xRShape=new Ia(new Tu({points:[-2*e,0,-t.width,0],linewidth:t.lineWidth}),new Aa({stroke:Ra,lineWidth:1,lineDash:t.lineDash})),this.yRShape=new Ia(new Tu({points:[0,-2*e,0,-t.height],linewidth:t.lineWidth}),new Aa({stroke:ka,lineWidth:1,lineDash:t.lineDash})),this.add(this.xShape),this.add(this.yShape),this.add(this.xRShape),this.add(this.yRShape),this.computeBoundingBox()}computeBoundingBox(){var t;return(null==(t=this.params)?void 0:t.fixed)?this.boundingBox.makeEmpty():super.computeBoundingBox(),this.boundingBox}updateModelViewMatrix(t){var e;(null==(e=this.params)?void 0:e.fixed)?t?(this.modelViewMatrix.copy(t.viewMatrix),this.computeAxes(t)):this.modelViewMatrix.copy(this.matrixWorld):super.updateModelViewMatrix(t)}computeAxes(t){if(!t)return;t.updateBoundingBox();const e=t.scaled.x,i=this.params.lineWidth*e,n=[this.params.lineDash[0]*e,this.params.lineDash[1]*e],s=(this.params.arrowLength||10)*e,r=s/4;this.xShape.geo.arrowLength=s,this.xShape.geo.setPoints([s+r,0,t.boundingBoxWorld.max.x,0]),this.xShape.geo.lineWidth=i,this.yShape.geo.arrowLength=s,this.yShape.geo.setPoints([0,s+r,0,t.boundingBoxWorld.max.y]),this.yShape.geo.lineWidth=i,this.xRShape.geo.setPoints([-s-r,0,t.boundingBoxWorld.min.x,0]),this.xRShape.geo.lineWidth=i,this.xRShape.mtl.lineDash=n,this.yRShape.geo.setPoints([0,-s-r,0,t.boundingBoxWorld.min.y]),this.yRShape.geo.lineWidth=i,this.yRShape.mtl.lineDash=n,this.geo.setPoints([-s,0,-r,r,0,s,r,r,s,0,r,-r,0,-s,-r,-r])}}class Pu extends Au{constructor(t={},e){super(),d(this,"isMainScene",!0),d(this,"name","MainScene"),d(this,"params"),d(this,"adapter"),d(this,"featureKey","MainScene_"+this.id),d(this,"axesHelper"),d(this,"resourcesMap",{}),d(this,"legend",[]),d(this,"_viewBox",new Ri),this.params=t,this.adapter=e,this.selectable=!0,this.initAxesHelper()}destroy(){var t;super.destroy(),this.resourcesMap={},this.legend=[],null==(t=this.axesHelper)||t.destroy()}initAxesHelper(){this.params.axesHelper&&(this.axesHelper&&this.axesHelper.destroy(),this.axesHelper=new Ou({fixed:!0,lineWidth:.5}),this.add(this.axesHelper))}setViewBox(t){t&&this._viewBox.copy(t)}computeBoundingBox(){return super.computeBoundingBox(),!this._viewBox.isEmpty()&&(this._viewBox.getCenter(Lu),this.boundingBox.getCenter(Ru),Math.round(Oi.getDistance(Lu,Ru)))?this._viewBox:this.boundingBox}getBoundingBox(){return this._viewBox.isEmpty()?this.boundingBox:this._viewBox}add(t){return super.add(t),t.userData.id?(this.resourcesMap[t.userData.id]||(this.resourcesMap[t.userData.id]=[]),this.resourcesMap[t.userData.id].push(t),this):this}remove(t){if(!t)return this;if(super.remove(t),this.resourcesMap[t.userData.id]){const e=this.resourcesMap[t.userData.id].indexOf(t);e>-1&&this.resourcesMap[t.userData.id].splice(e,1),this.resourcesMap[t.userData.id].length||delete this.resourcesMap[t.userData.id]}return this}getAssetIdsByType(t){const e=[];return this.traverse((i=>{i.userData.assetType===t&&i.userData.id&&e.push(i.userData.id)})),e}getByIds(t,e=[]){if(e.length=0,!t)return e;Array.isArray(t)||(t=[t]);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)Object.hasOwnProperty.call(this.resourcesMap,t[i])&&e.push(...this.resourcesMap[t[i]]);return e}setFillOrStrokeByIds(t,e,i="fill"){this.traverse((n=>{var s;if(!n.mtl||!t.includes(n.userData.id))return;const r=mi.cloneDeep(n.mtl);"fill"===i?r.fill=e:"stroke"===i&&(r.stroke=e,r.lineWidth=5),n.mtl=so.getMtl(r),this.addLegend(i,e,null==(s=n.userData)?void 0:s.id)})),this.needsUpdate=!0}clearFillOrStroke(t,e){this.traverse((i=>{var n,s,r,a,o,h;if(!i.mtl)return;if(e&&!e.includes(i.userData.id))return;const l=mi.cloneDeep(i.mtl);void 0!==t&&"fill"!==t||!(null==l?void 0:l.fill)||(l.fill=(null==(s=null==(n=i.userData)?void 0:n.style)?void 0:s.fill)||void 0),void 0!==t&&"stroke"!==t||!(null==l?void 0:l.stroke)||(l.stroke=(null==(a=null==(r=i.userData)?void 0:r.style)?void 0:a.stroke)||void 0,l.lineWidth=(null==(h=null==(o=i.userData)?void 0:o.style)?void 0:h.lineWidth)||1),i.mtl=so.getMtl(l)})),this.needsUpdate=!0,this.clearLegendBy(t)}increaseFontSize(t=1.1){this.traverse((e=>{var i;e.mtl&&e.isText&&(null==(i=e.mtl)?void 0:i.text)&&(e.scaled.multiplyScalar(t),e.updateMatrix(),e.needsUpdate=!0)}));const e=mi.uniq(mi.compact(mi.map(this.children,(t=>t.userData.aid))));this.recomputedAssetLabels(e),this.needsUpdate=!0}increaseStrokeWidth(t=1.1){this.traverse((e=>{var i;e.mtl&&(null==(i=e.mtl)?void 0:i.stroke)&&e.geo.lineWidth&&(e.geo.lineWidth*=t)})),this.needsUpdate=!0}addLegend(t,e,i){let n=this.legend.find((t=>t.color===e));n||(n={type:t,color:e,ids:[]},this.legend.push(n)),n.ids.push(i)}getLegend(){return this.legend}clearLegendBy(t){var e;t||(this.legend.length=0);for(let i=(null==(e=this.legend)?void 0:e.length)-1;i>=0;i--)this.legend[i].type===t&&this.legend.splice(i,i)}getAssetLabels(t,e){var i,n,s,r,a;const o=mi.filter(this.children,(t=>{var i;return(null==(i=t.userData)?void 0:i.aid)===e}));if(!(null==o?void 0:o.length))return;const h=[];for(let t,e=0,l=o.length;e<l;e++){t=o[e],(null==(i=t.mtl)?void 0:i.text)&&h.push(null==(n=t.mtl)?void 0:n.text);for(let e,i=0,n=(null==(s=null==t?void 0:t.children)?void 0:s.length)||0;i<n;i++)e=t.children[i],(null==(r=null==e?void 0:e.mtl)?void 0:r.text)&&h.push(null==(a=null==e?void 0:e.mtl)?void 0:a.text)}return h}setAssetLabels(t,e){if(!mi.find(this.children,(e=>{var i;return(null==(i=e.userData)?void 0:i.id)===t})))return;const i=mi.filter(this.children,(e=>{var i;return(null==(i=e.userData)?void 0:i.aid)===t}));if(!(null==i?void 0:i.length))return;const n=i[i.length-1];for(let t=0,s=((null==e?void 0:e.length)||0)-((i.length||0)-1);t<s;t++){const t=n.clone(!0,!0);this.add(t),t.updateMatrix(),i.push(t)}for(let t=1,n=(null==i?void 0:i.length)||0;t<n;t++){const n=i[t];n.mtl.text=(null==e?void 0:e.length)?e[t-1]:void 0,n.needsUpdate=!0}this.recomputedAssetLabels(t)}recomputedAssetLabels(t){if(t){Array.isArray(t)||(t=[t]);for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++){let i=mi.filter(this.children,(i=>{var n,s;return(null==(n=i.userData)?void 0:n.aid)===t[e]&&!!(null==(s=i.mtl)?void 0:s.text)}));if(!(null==i?void 0:i.length))return;for(let t,e=0,n=(null==i?void 0:i.length)||0;e<n;e++)t=i[e],t.computeBoundingBox(),t.updateBoundingBox(),zu.copy(t.boundingBoxWorld).getSize(Ru),Lu.copy(i[e?e-1:0].position),Ru.multiplyScalar(1.2),e&&(t.position.set(Lu.x,Lu.y-Ru.y),t.updateMatrix())}}}clearAssetLabels(t){const e=t?this.getAssetIdsByType(t):this.children.map((t=>t.userData.id&&t.userData.assetType));for(let t,i=0,n=(null==e?void 0:e.length)||0;i<n;i++)if(t=mi.filter(this.children,(t=>{var n;return(null==(n=t.userData)?void 0:n.aid)===e[i]})),(null==t?void 0:t.length)&&1!==t.length)for(let e=t.length-1;e>0;e--)t[e].destroy(),this.remove(t[e])}getAssetBoundingBox(t,e=new Ri){if(e.makeEmpty(),!t)return e;Array.isArray(t)||(t=[t]);for(let i,n=0,s=(null==t?void 0:t.length)||0;n<s;n++){i=t[n];const s=this.getByIds(i);if(null==s?void 0:s.length)for(let t=0,i=s.length;t<i;t++)e.union(s[t].boundingBoxWorld)}return e}setAssetType(t,e){var i,n;const s=[t];t!==dn.RM&&s.push(dn.RM);const r=null==(i=this.adapter)?void 0:i.getAssetIdsByType(s);(null==r?void 0:r.length)&&(null==(n=this.adapter)||n.updateLayersVisibility(r,!0))}}const Lu=new Oi,Ru=new Oi,zu=new Ri;class Uu extends pl{constructor(t={}){super(),d(this,"name","AnimateScene"),d(this,"params"),d(this,"resourcesMap",{}),d(this,"dynamicFill",La),d(this,"dynamicScale",new Oi(1,1)),d(this,"clock",new Xh),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.initAxesHelper(),this.mixer=new Jl(this)}destroy(){super.destroy()}initAxesHelper(){this.params.axesHelper&&(this.axesHelper&&this.axesHelper.destroy(),this.axesHelper=new Ou({fixed:!0,lineWidth:.5}),this.add(this.axesHelper))}add(t){return super.add(t),t.userData.id?(this.resourcesMap[t.userData.id]||(this.resourcesMap[t.userData.id]=[]),this.resourcesMap[t.userData.id].push(t),this):this}remove(t){if(!t)return this;if(super.remove(t),this.resourcesMap[t.userData.id]){const e=this.resourcesMap[t.userData.id].indexOf(t);e>-1&&this.resourcesMap[t.userData.id].splice(e,1),this.resourcesMap[t.userData.id].length||delete this.resourcesMap[t.userData.id]}return this}getByIds(t,e=[]){if(e.length=0,!t)return e;Array.isArray(t)||(t=[t]);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)Object.hasOwnProperty.call(this.resourcesMap,t[i])&&e.push(...this.resourcesMap[t[i]]);return e}getAssetBoundingBox(t,e=new Ri){if(e.makeEmpty(),!t)return e;Array.isArray(t)||(t=[t]);for(let i,n=0,s=(null==t?void 0:t.length)||0;n<s;n++){i=t[n];const s=this.getByIds(i);if(null==s?void 0:s.length)for(let t=0,i=s.length;t<i;t++)e.union(s[t].boundingBoxWorld)}return e}onBeforeRender(){}update(t){var e;null==(e=this.mixer)||e.update(this.clock.getDelta())}}class Fu extends pl{constructor(t={}){var e,i;super(),d(this,"isEmptyScene",!0),d(this,"name","EmptyScene"),d(this,"params"),d(this,"loadingShape"),d(this,"lineShape"),d(this,"triangleShape"),d(this,"scales",[.95,1.15,.002]),d(this,"l",0),d(this,"scaleTrend",!1),d(this,"clock",new Xh),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.loadingShape=new Ql(Wu,{fill:Fa,flipY:!0}),this.loadingShape.name="loading",this.loadingShape.dynamically=!0,this.add(this.loadingShape),this.loadingShape.updateMatrixWorld(),this.loadingShape.computeBoundingBox(),this.loadingShape.updateBoundingBox(),Vu.copy(this.loadingShape.boundingBoxWorld).getCenter(qu),Vu.getSize(Hu),this.loadingShape.setPosition(qu.negate()).updateMatrix(),this.l=Hu.x;const n=Math.max(Math.floor(this.l/30),2),s=[-this.l/2,-(10+n),-this.l/2,-10,this.l/2,-10,this.l/2,-(10+n)];this.lineShape=new tu({points:s,fill:Fa}),this.add(this.lineShape),this.lineShape.name="loadingLine";const r=[0,0,Hu.x/2,Hu.x,Hu.x,0];this.triangleShape=new tu({points:r,fill:Ra}),this.add(this.triangleShape),this.triangleShape.name="loadingTriangle",this.triangleShape.setPosition(new Oi(-.12*Hu.x,Hu.y/-.4)).setScale(.25,.15).updateMatrix(),this.computeBoundingBox(),this.mixer=new Jl(this);const a=new El(`${this.loadingShape.name}.mtl.fill`,[0,1.2,2],[0,0,0,.7,.38,.38,.38,.7,0,0,0,.7]),o=new Al(`${this.triangleShape.name}.mtl.fillOpacity`,[0,1.5,3],[1,.8,1],Al.DefaultInterpolation),h=new El(`${this.lineShape.name}.scaled`,[0,1.5,3],[1,1,.6,1,1,1]);this._selectedClip=new Dl("selected",3,[a,o,h]),this.selectedAction=null==(e=this.mixer)?void 0:e.clipAction(this._selectedClip,this.desScene),null==(i=this.selectedAction)||i.play()}destroy(){super.destroy()}onBeforeRender(){this.lineShape.updateMatrix()}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta())}}const Wu='\n<path d="M13.5 15.8L12.62 17.3L0.799999 17.3L0.799999 5.8L13.46 5.8L12.56 7.3L4.84 7.3L4.84 10.66L13.12 10.66L12.24 12.18L4.84 12.18L4.84 15.8L13.5 15.8Z\nM32.12 17.3L28.52 17.3L28.52 9.9L25.18 17.3L22.1 17.3L18.8 10L18.8 17.3L15.1 17.3L15.1 5.8L20.06 5.8L23.68 13.68L27.32 5.8L32.12 5.8L32.12 17.3Z\nM37.72 12.8L37.72 17.3L33.72 17.3L33.72 5.8L42.22 5.8L41.06 7.34L37.72 7.34L37.72 11.3L42.22 11.3L42.22 5.8L46.28 5.8L46.28 12.8L37.72 12.8Z\nM57 17.3L53 17.3L53 7.34L47.88 7.34L47.88 5.8L62.48 5.8L61.6 7.34L57 7.34L57 17.3Z\nM69.92 13.52L64.08 5.78L68.62 5.78L71.92 10.58L75.14 5.78L79.64 5.78L73.92 13.56L73.92 17.28L69.92 17.28L69.92 13.52Z" />\n',qu=new Oi,Hu=new Oi,Vu=new Ri;class ju{constructor(){d(this,"camera"),d(this,"screenCoords",new Oi),d(this,"worldCoords",new Oi),d(this,"worldBox",new Ri),d(this,"intersectType",0),d(this,"params",{Shape:{},Line:{threshold:1},Points:{threshold:1},Sprite:{}})}setFromCamera(t,e){return this.camera=e,this.screenCoords.set(t.x,t.y),this.worldCoords.copy(this.screenCoords).unproject(e),this}init(t,e){return this.camera=e,(null==t?void 0:t.screenCoords)&&this.screenCoords.set(t.screenCoords.x,t.screenCoords.y),(null==t?void 0:t.worldCoords)?this.worldCoords.set(t.worldCoords.x,t.worldCoords.y):e&&this.worldCoords.copy(this.screenCoords).unproject(e),(null==t?void 0:t.worldBox)&&this.worldBox.copy(t.worldBox),this.intersectType=void 0!==(null==t?void 0:t.worldBox)?1:0,this}intersectObjects(t,e=!0,i=[]){for(let n=0,s=t.length;n<s;n++)this.intersectObject(t[n],e,i)}intersectObject(t,e=!1,i=[]){if(!t.selectable||!t.visible)return i;if(t.raycast(this,i),!e||t.composeNode)return i;for(let n=0,s=t.children.length;n<s;n++)this.intersectObject(t.children[n],e,i);return i}intersectObjectBy(t,e,i=!0,n=[]){if(!t.selectable||!t.visible)return n;if("function"==typeof e&&e(t)&&t.raycast(this,n),!i||t.composeNode)return n;for(let s=0,r=t.children.length;s<r;s++)this.intersectObjectBy(t.children[s],e,i,n);return n}}class Yu extends hi{constructor(t,e){super(),d(this,"name","Handler"),d(this,"dom"),d(this,"camera"),d(this,"domOffset",new Oi),d(this,"enabled",!0),d(this,"_hoverEnabled",!1),d(this,"scenes",[]),d(this,"rayCaster",new ju),d(this,"contextMenuHandler",this.handleContextMenu.bind(this)),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"pointerOverHandler",mi.debounce(this.handlePointerOver.bind(this),20)),d(this,"panHandler",this.handlePan.bind(this)),d(this,"_hovered"),this.dom=t,this.camera=e,this.resize(),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.dispose()}dispose(){this.scenes=[]}enableHover(t){return this._hoverEnabled=t,this}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}bindScene(...t){return this.scenes.length=0,this.scenes.push(...t),this}bindEvents(){this.unbindEvents(),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("singletap",this.tapHandler),this.dom.addEventListener("panstart",this.panHandler),this.dom.addEventListener("panmove",this.panHandler),this.dom.addEventListener("panend",this.panHandler),this.dom.addEventListener("mousemove",this.pointerOverHandler)}unbindEvents(){this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("singletap",this.tapHandler),this.dom.removeEventListener("panstart",this.panHandler),this.dom.removeEventListener("panmove",this.panHandler),this.dom.removeEventListener("panend",this.panHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler)}handleContextMenu(t){this.enabled&&"function"==typeof t.preventDefault&&t.preventDefault()}handlePointerDown(t){}handlePointerMove(t){}handlePointerUp(t){}handleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),Zu.set(t.center.x,t.center.y).sub(this.domOffset),$u.copy(Zu).unproject(this.camera),this.dispatchEvent({type:"tap",data:{screenCoords:{x:Zu.x,y:Zu.y},worldCoords:{x:$u.x,y:$u.y}},e:t})}handlePan(t){var e,i;"function"==typeof t.preventDefault&&t.preventDefault(),Zu.set(null==(e=t.center)?void 0:e.x,null==(i=t.center)?void 0:i.y).sub(this.domOffset),$u.copy(Zu).unproject(this.camera);const n={screenCoords:{x:Zu.x,y:Zu.y},worldCoords:{x:$u.x,y:$u.y}},s={type:"panmove",data:n};(t.isFirst||"panstart"===t.type)&&(s.type="panstart"),(t.isLast||"panend"===t.type)&&(s.type="panend");const{id:r,target:a}=this.getHover(n);r&&mi.set(s,"data.id",r),a&&mi.set(s,"data.target",a),this.dispatchEvent(s)}handlePointerOver(t){if(!this._hoverEnabled||t.buttons>0)return;const e=this._hovered;Zu.set(t.clientX,t.clientY).sub(this.domOffset),$u.copy(Zu).unproject(this.camera);let i={screenCoords:{x:Zu.x,y:Zu.y},worldCoords:{x:$u.x,y:$u.y}};const n=this._hovered=this.getHover(i),s=u(u({},i),n);this.setCursor((null==n?void 0:n.target)?"pointer":"default"),(null==n?void 0:n.id)!==(null==e?void 0:e.id)&&(null==e?void 0:e.target)&&this.dispatchEventByTarget(e.target,{type:"pointerout",data:u(u({},i),e)}),(null==n?void 0:n.target)&&this.dispatchEventByTarget(n.target,{type:"pointermove",data:s}),(null==n?void 0:n.target)&&(null==n?void 0:n.target)!==(null==e?void 0:e.target)&&this.dispatchEventByTarget(n.target,{type:"pointerover",data:s}),this.dispatchEvent({type:"pointermove",data:s})}getHover(t){var e;const{screenCoords:i,worldCoords:n}=t||{},s={id:void 0,target:void 0},r=[],a=this.scenes.find((t=>t.isDynamic));if(a&&(this.rayCaster.init(t,this.camera).intersectObjectBy(a,Gu,!0,r),r.length))return s.isDynamic=!0,Xu(r,s),s;for(let i,n=0,s=(null==(e=this.scenes)?void 0:e.length)||0;n<s;n++)i=this.scenes[n],i.isDynamic||this.rayCaster.init(t,this.camera).intersectObjectBy(i,Gu,!0,r);return r.length&&(s.isStatic=!0,Xu(r,s)),s}dispatchEventByTarget(t,e){var i;if(!(null==t?void 0:t.visible))return;let n=!1;for(;t&&(n=null==(i=t.userData)?void 0:i.cancelBubble,"function"==typeof t.dispatchEvent&&t.dispatchEvent(e),t=t.parent,!n););n||this.dispatchEvent(e)}setCursor(t){this.dom instanceof si&&"function"==typeof self.postMessage?self.postMessage({type:"setCursor",cursorStyle:t}):this.dom.style&&(this.dom.style.cursor=t||"default")}}function Gu(t){return t.visible}function Xu(t,e={}){var i,n,s;let r=t.find((t=>{var e,i;return t.visible&&t.selectable&&(null==(e=t.userData)?void 0:e.assetType)===(null==(i=Jr.config)?void 0:i.assetType)}));return r?(e.id=(null==(i=r.userData)?void 0:i.id)||r.name,e.target=r,(null==(n=r.userData)?void 0:n.assetType)&&(e.assetType=null==(s=r.userData)?void 0:s.assetType),r.isDummy&&(e.isDummy=!0),e):e}const Zu=new Oi,$u=new Oi;var Ju=(t=>(t.CONTEXTMENU="contextmenu",t.MOUSEDOWN="mousedown",t.MOUSEMOVE="mousemove",t.MOUSEUP="mouseup",t.POINTERDOWN="pointerdown",t.POINTERMOVE="pointermove",t.POINTERUP="pointerup",t.POINTEROUT="pointerout",t.POINTEROVER="pointerover",t.TOUCHSTART="touchstart",t.TOUCHMOVE="touchmove",t.TOUCHEND="touchend",t.WHEEL="wheel",t.KEYDOWN="keydown",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.HOVER="hover",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t))(Ju||{}),Qu=(t=>(t[t.TIPS=1]="TIPS",t[t.HOVER=2]="HOVER",t[t.SELECT=4]="SELECT",t[t.SELECTOR_RECT=8]="SELECTOR_RECT",t[t.DISTRIBUTION=16]="DISTRIBUTION",t[t.DRAG=32]="DRAG",t[t.DUMMY=64]="DUMMY",t[t.LINKER=128]="LINKER",t[t.DRAW_POINT=1024]="DRAW_POINT",t[t.DRAW_POLYLINE=2048]="DRAW_POLYLINE",t[t.DRAW_POLYGON=4096]="DRAW_POLYGON",t[t.DRAW_TEXT=8192]="DRAW_TEXT",t))(Qu||{}),Ku=(t=>(t[t.DEFAULT=1]="DEFAULT",t[t.HOVER=3]="HOVER",t[t.PICKER=15]="PICKER",t[t.DISTRIBUTION=31]="DISTRIBUTION",t[t.DUMMY=119]="DUMMY",t[t.LINKER=135]="LINKER",t[t.DRAWING=15399]="DRAWING",t))(Ku||{}),tc=(t=>(t[t.HOVER=1]="HOVER",t[t.SELECT=2]="SELECT",t[t.HILIGHT=4]="HILIGHT",t[t.DYNAMIC_LINE=8]="DYNAMIC_LINE",t))(tc||{}),ec=(t=>(t[t.KEEP_ORIGIN=1]="KEEP_ORIGIN",t[t.MAKE_COPY=2]="MAKE_COPY",t))(ec||{}),ic=(t=>(t[t.NONE=0]="NONE",t[t.DEFAULT=1]="DEFAULT",t[t.MODIFIED=2]="MODIFIED",t[t.NEW=3]="NEW",t))(ic||{});class nc{constructor(t,i){d(this,"parent"),d(this,"view"),d(this,"scenes",[]),d(this,"oriScene"),d(this,"dstScene"),d(this,"_fnEnable",null==(e=Jr.config)?void 0:e.fnEnable),this.parent=t,this.view=i}fnEnableChanged(t){this._fnEnable=!!t}activate(){}deactivate(){this.scenes=[],this.oriScene=void 0,this.dstScene=void 0}bindScene(...t){return this.scenes.length=0,this.scenes.push(...t),this.oriScene=this.scenes.find((t=>t.isStatic)),this.dstScene=this.scenes.find((t=>t.isDynamic)),this}getDynamicObjectsByIds(t){var e,i,n;const s=[];if(null==(e=this.dstScene)||e.getByIds(t,s),null==s?void 0:s.length)return s;const r=null==(i=this.oriScene)?void 0:i.getByIds(t);if(!(null==r?void 0:r.length))return s;for(let t=0,e=(null==r?void 0:r.length)||0;t<e;t++){const e=r[t].clone(!0,!0);null==(n=this.dstScene)||n.add(e),s.push(e)}return s}clearDynamicObjectsByIds(t){var e,i;if(!t)return;Array.isArray(t)||(t=[t]);const n=null==(e=this.dstScene)?void 0:e.getByIds(t);if(null==n?void 0:n.length)for(let t,e=0,s=(null==n?void 0:n.length)||0;e<s;e++)t=n[e],null==(i=this.dstScene)||i.remove(t),t.destroy()}getColorKeyframeTrack(t,e,i=.5,n=[0,1.2,2]){const s=new Za(e).setA(i).getNormalized(),r=[...s,.38*s[0],.38*s[1],.38*s[2],.5*s[3],...s];return new Tl(t,n,r)}}class sc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.HOVER),d(this,"rayCaster",new ju),d(this,"_hoverIds",[]),d(this,"hoverAction"),d(this,"_hoverClip"),d(this,"dynamicStroke",La);const i=this.getColorKeyframeTrack(".dynamicStroke",Ra,.8);this._hoverClip=new Dl("selected",1,[i])}activate(){var t;super.activate(),this.hoverAction=null==(t=this.parent.mixer)?void 0:t.clipAction(this._hoverClip,this)}deactivate(){var t,e;super.deactivate(),null==(t=this.hoverAction)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.hoverAction),this.hoverAction=void 0,this._hoverIds=[]}handlePointerOver(t){var e,i,n,s,r,a;const{id:o,target:h,isStatic:l,isDynamic:u,isDummy:c}=(null==t?void 0:t.data)||{};if(this._hoverIds.includes(o))return;const d=(null==(i=null==(e=this.view)?void 0:e.camera)?void 0:i.pixelWidth)||1,p=this.getDynamicObjectsByIds(o);c&&(mi.set(t,"data.rmId",null==(n=null==h?void 0:h.userData)?void 0:n.rmId),mi.set(t,"data.wsId",null==(s=null==h?void 0:h.userData)?void 0:s.wsId),mi.set(t,"data.label",null==(r=null==h?void 0:h.userData)?void 0:r.label)),rc(p,d),this._hoverIds.push(o),null==(a=this.hoverAction)||a.play(),this.parent.editor.dispatchEvent({type:oi.POINTER_OVER,data:null==t?void 0:t.data})}handleOut(t){this.clearHover(),this.parent.editor.dispatchEvent({type:oi.POINTER_OUT,data:null==t?void 0:t.data})}clearHover(){var t;if(null==(t=this.hoverAction)||t.stop(),this.dstScene){for(let t=0,e=this._hoverIds.length;t<e;t++){const e=this.dstScene.getByIds(this._hoverIds[t]);e.length&&ac(e)}this._hoverIds=[]}}traverse(t){var e;if(this.dstScene)for(let i=0,n=(null==(e=this._hoverIds)?void 0:e.length)||0;i<n;i++){const e=this.dstScene.getByIds(this._hoverIds[i]);for(let i=0,n=(null==e?void 0:e.length)||0;i<n;i++)t(e[i])}}update(){var t,e;(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length)&&this.traverse((t=>{t.traverse((t=>{t.isShape&&(t.mtl.stroke=this.dynamicStroke)}))}))}}const rc=(t,e=1)=>{if(t){Array.isArray(t)||(t=[t]);for(let i,n=0,s=t.length;n<s;n++)i=t[n],i.traverse((t=>{t.isShape&&(t.userData.actType|=tc.HOVER,t.geo.lineWidth=5*e,t.mtl.stroke=Ua,t.mtl.lineJoin="round")}))}},ac=(t,e=1)=>{if(t){Array.isArray(t)||(t=[t]);for(let e,i=0,n=t.length;i<n;i++)e=t[i],e.traverse((t=>{var e,i,n;t.isShape&&(t.userData.actType&=~tc.HOVER,t.geo.lineWidth=null==(i=null==(e=t.userData)?void 0:e.style)?void 0:i.lineWidth,t.mtl.stroke=null==(n=t.userData.style)?void 0:n.stroke,t.mtl.lineJoin=void 0)}))}};class oc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.SELECT),d(this,"intersects",[]),d(this,"rayCaster"),d(this,"_selectedIds",[]),d(this,"_selectedClip"),d(this,"selectedAction"),d(this,"dynamicSelectFill",La),d(this,"dynamicSelectStroke",La),this.rayCaster=new ju;const i=this.getColorKeyframeTrack(".dynamicSelectFill",La,.5),n=this.getColorKeyframeTrack(".dynamicSelectStroke",Ra,.8);this._selectedClip=new Dl("selected",3,[i,n])}get _selectEnable(){var t,e;return!(!(null==(t=Jr.config)?void 0:t.selectEnable)||!(null==(e=this.view)?void 0:e.camera))}get _multiSelectEnable(){return Jr.config.multiSelectEnable}get _dragEnable(){var t,e;return(null==(t=Jr.config)?void 0:t.multiSelectEnable)&&(null==(e=Jr.config)?void 0:e.fnEnable)}activate(){var t;super.activate(),this.selectedAction=null==(t=this.parent.mixer)?void 0:t.clipAction(this._selectedClip,this)}deactivate(){var t,e;this.clearSelected(),super.deactivate(),null==(t=this.selectedAction)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.selectedAction),this.selectedAction=void 0,this.intersects=[],this._selectedIds=[]}setDynamicFill(t){}handleTap(t){if(this.intersects.length=0,!this.oriScene)return;if(!this._selectEnable&&!this._multiSelectEnable)return;this.rayCaster.init(t.data,this.view.camera).intersectObjectBy(this.oriScene,this._validFilter.bind(this),!0,this.intersects);const e=mi.uniq(mi.compact(mi.map(this.intersects,(t=>{var e,i;return(null==(e=t.userData)?void 0:e.assetType)===Jr.config.assetType?null==(i=t.userData)?void 0:i.id:""}))));this.selectByIds(e,!0),this.parent.editor.dispatchEvent({type:oi.SELECTED,data:this._selectedIds})}handlePanStart(t){var e;if((null==t?void 0:t.type)===bu.PAN_START&&this._dragEnable){if(!this.dstScene)throw new Error("No dynamic scene found!");this.parent.editor.setEnablePan(!1),hc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),uc.makeEmpty().expandByPoint(hc)}}handlePanMove(t){var e;(null==t?void 0:t.type)===bu.PAN_MOVE&&this._dragEnable&&(lc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),uc.makeEmpty().expandByPoint(hc).expandByPoint(lc))}handlePanEnd(t){var e,i;if(this.intersects.length=0,(null==t?void 0:t.type)!==bu.PAN_END)return;if(!this._dragEnable)return;lc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),uc.makeEmpty().expandByPoint(hc).expandByPoint(lc),this.rayCaster.init({worldBox:uc},null==(i=this.view)?void 0:i.camera).intersectObjectBy(this.oriScene,this._validFilter.bind(this),!0,this.intersects);const n=mi.uniq(mi.compact(mi.map(this.intersects,(t=>{var e,i,n;return(null==(e=t.userData)?void 0:e.assetType)===(null==(i=Jr.config)?void 0:i.assetType)?null==(n=t.userData)?void 0:n.id:""}))));this.selectByIds(n,this._multiSelectEnable),this.parent.editor.dispatchEvent({type:oi.SELECTED,data:this._selectedIds})}_validFilter(t){var e,i,n;return!(!t.visible||!t.selectable||(null==(e=t.userData)?void 0:e.assetType)!==(null==(i=Jr.config)?void 0:i.assetType))&&!mi.uniq(mi.compact(mi.map(this.intersects,(t=>{var e;return null==(e=t.userData)?void 0:e.id})))).includes(null==(n=t.userData)?void 0:n.id)}traverse(t){if(!this.dstScene)return;const e=this.dstScene.getByIds(this._selectedIds);if(null==e?void 0:e.length)for(let i=0,n=(null==e?void 0:e.length)||0;i<n;i++)t(e[i])}update(){var t,e;if(!(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length))return;const i=this.getDynamicObjectsByIds(this._selectedIds);for(let t,e=0,n=(null==i?void 0:i.length)||0;e<n;e++)t=i[e],t.isShape&&(t.userData.actType||0)&tc.SELECT&&t.traverse((t=>{t.mtl.fill=this.dynamicSelectFill,t.mtl.stroke=this.dynamicSelectStroke}))}hasSelected(t){return this._selectedIds.includes(t)}clearSelected(t){if(this.dstScene){if(!t||!(null==t?void 0:t.length))return this.clearDynamicObjectsByIds(this._selectedIds),void(this._selectedIds.length=0);Array.isArray(t)||(t=[t]),this.clearDynamicObjectsByIds(t);for(let e=0,i=t.length;e<i;e++){const i=this._selectedIds.indexOf(t[e]);i>-1&&this._selectedIds.splice(i,1)}}}selectByIds(t,e){var i,n;if(t&&this.oriScene&&this.dstScene){if(Array.isArray(t)||(t=[t]),null==(i=this.selectedAction)||i.stop(),this._selectEnable){const i=this.hasSelected(t[0]);if(i?this.clearSelected(t[0]):this.clearSelected(),i&&e)return}else this._multiSelectEnable&&(e||this.clearSelected());this.toggleSelectByIds(t,e),null==(n=this.selectedAction)||n.play()}}toggleSelectByIds(t,e){if(this.oriScene&&this.dstScene){Array.isArray(t)||(t=[t]);for(let i=0,n=t.length;i<n;i++){if(this.hasSelected(t[i])){e&&this.clearSelected(t[i]);continue}const n=this.getDynamicObjectsByIds(t[i]);if(null==n?void 0:n.length){for(let t=0,e=n.length;t<e;t++){n[t].moveToLast();const e=this.getDynamicObjectsByIds(n[t].userData.id);for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++){const i=e[t];i.moveToLast(),i.traverse((t=>{var e;(null==t?void 0:t.isShape)&&(t.userData.actType|=tc.SELECT,t.geo.lineWidth=5*((null==(e=t.userData.style)?void 0:e.strokeWidth)||1))}))}}this._selectedIds.push(t[i])}}}}}const hc=new Oi,lc=new Oi,uc=new Ri;class cc extends Ia{constructor(t={}){var e;const{x:i=0,y:n=0,w:s=10,h:r=10}=t,a=s/2,o=r/2;(null==(e=t.points)?void 0:e.length)||(t.points=[i-a,n-o,i-a,n+o,i+a,n+o,i+a,n-o,i-a,n-o]);const h=new ao(t),l=new Aa(t);(null==t?void 0:t.lineWidth)||(l.lineWidth=1),super(h,l),d(this,"name","Rect")}setPoints(t){return!t||t.length<2||this.geo.setPoints(t),this}}class dc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.SELECTOR_RECT),d(this,"_fnEnable",!1),d(this,"selector"),d(this,"rayCaster",new ju),d(this,"intersects",[]),this.selector=new cc({name:pc,fill:new Za(Pa).setA(.1).getStyle(),stroke:Pa,lineWidth:1,lineDash:[5,5]})}activate(){super.activate()}deactivate(){super.deactivate(),this.intersects=[]}bindScene(...t){var e,i;return super.bindScene(...t),(null==(e=this.dstScene)?void 0:e.getObjectByProperty("name",pc))||null==(i=this.dstScene)||i.add(this.selector),this}fnEnableChanged(t){this._fnEnable=!!t}get _dragEnable(){var t;return(null==(t=Jr.config)?void 0:t.multiSelectEnable)&&this._fnEnable}handlePanStart(t){var e;if(this._dragEnable&&(null==t?void 0:t.type)===bu.PAN_START){if(!this.dstScene)throw new Error("No dynamic scene found!");this.parent.editor.setEnablePan(!1),fc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),yc.makeEmpty().expandByPoint(fc),this.selector.setVisible(!0).setPoints([fc.x,fc.y])}}handlePanMove(t){var e;this._dragEnable&&(null==t?void 0:t.type)===bu.PAN_MOVE&&(mc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),yc.makeEmpty().expandByPoint(fc).expandByPoint(mc),this.selector.setPoints(yc.round().getNumbersArray()))}handlePanEnd(t){var e;this.parent.editor.setEnablePan(!0),this._dragEnable&&(null==t?void 0:t.type)===bu.PAN_END&&(mc.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),yc.makeEmpty().expandByPoint(fc).expandByPoint(mc),this.selector.setVisible(!1))}}const pc="EDITOT_SELECTOR",fc=new Oi,mc=new Oi,yc=new Ri;class gc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.DRAG),d(this,"_fnEnable",!1),d(this,"dragMode",ec.MAKE_COPY),d(this,"rayCaster",new ju),d(this,"intersects",[]),d(this,"_currentObject"),d(this,"_originalPosition",new Oi),d(this,"_dragOffset",new Oi),d(this,"_objectFilter"),d(this,"_getDragabledHandler")}activate(){super.activate()}deactivate(){super.deactivate(),this.intersects=[],this._currentObject=void 0}setDraggingObject(t){this.handlePanStart({type:bu.PAN_START,data:{target:t}})}handlePanStart(t){var e,i,n;if((null==t?void 0:t.type)!==bu.PAN_START)return;if(!this.dstScene)throw new Error("No dynamic scene found!");if(!(null==(e=null==t?void 0:t.data)?void 0:e.target))return;let s;s="function"==typeof this._getDragabledHandler?this._getDragabledHandler(null==(i=null==t?void 0:t.data)?void 0:i.target):null==(n=null==t?void 0:t.data)?void 0:n.target,s&&(this.parent.editor.setEnablePan(!1),this._currentObject=s,this.parent.handleDragStart(t))}handlePanMove(t){(null==t?void 0:t.type)===bu.PAN_MOVE&&this._currentObject&&(this._currentObject.position.copy(t.data.worldCoords),this._currentObject.updateMatrix(),this._currentObject.updateWorldMatrix(!0,!1))}handlePanEnd(t){var e;this.parent.editor.setEnablePan(!0),(null==t?void 0:t.type)===bu.PAN_END&&(mi.set(t,"data.target",this._currentObject),this.parent.handleDragEnd(t),this._currentObject=void 0,null==(e=this.view.camera)||e.update())}bindFilter(t){this._objectFilter=t}_defaultFilter(t){return t.visible&&t.selectable}_validFilter(t){return this._objectFilter?this._objectFilter(t):this._defaultFilter(t)}bindGetDragabledHandler(t){this._getDragabledHandler=t}}class vc extends ya{constructor(t){super(t),this._init(t)}buildPath(t,e,i){if(0===this.percent)return;let{x:n=0,y:s=0,radius:r,startAngle:a=0,endAngle:o=2*Math.PI}=e||this;t.arc(n,s,r,a,o)}}class xc extends Ia{constructor(t=new vc,e=new Aa,i){super(t,e,i),d(this,"name","Sprite"),d(this,"isSprite",!0)}updateModelViewMatrix(t){if(t){bc.makeScale(t.scaled.x,t.scaled.y).premultiply(this.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.viewMatrix,bc);for(let e=0,i=this.children.length;e<i;e++)this.children[e].updateModelViewMatrix(t)}}}const bc=new Gi;class _c extends xc{constructor(){super(...arguments),d(this,"isDummy",!0),d(this,"composeNode",!0),d(this,"selectable",!0),d(this,"visible",!0),d(this,"renderOrder",1/0),d(this,"txtShape")}setText(t){var e;(null==(e=this.txtShape)?void 0:e.mtl)&&(this.txtShape.mtl.text=t)}setLabel(t,e){this.userData.label=t}updateModelViewMatrix(t){var e,i;if(super.updateModelViewMatrix(t),!this.txtShape)return;const n=1.2*((null==(e=this.params)?void 0:e.radius)||10)*((null==(i=null==t?void 0:t.scaled)?void 0:i.x)||1);this.txtShape.mtl.fontSize=n,this.txtShape.position.set(0,-n/2),this.txtShape.updateMatrix()}}class wc extends _c{constructor(t,e={}){var i,n;e.radius||(e.radius=null==(n=null==(i=Jr.config)?void 0:i.dummy)?void 0:n.radius);const s=new vc({x:0,y:0,radius:e.radius,thinLine:!0}),r=new Aa({fill:Oa,stroke:Pa});super(s,r),d(this,"params"),d(this,"dragable",!0),d(this,"radius"),this.params=e,this.userData=c(u({},t),{assetType:pn,style:{fill:r.fill,stroke:r.stroke,lineWidth:r.lineWidth}}),this.txtShape=new oo({text:(t.label||"").substring(0,1),fontSize:1.2*e.radius,fill:Wa,textBaseline:"ideographic",fontWeight:"300"}),this.add(this.txtShape)}}class Sc extends _c{constructor(t,e={}){var i,n;e.radius||(e.radius=null==(n=null==(i=Jr.config)?void 0:i.dummy)?void 0:n.radius);const s=e.radius,r=new Bo({x:-s,y:-s,w:2*s,h:2*s,r:s/2}),a=new Aa({fill:Oa,stroke:Pa});super(r,a),d(this,"params"),d(this,"txtShape"),this.params=e,this.userData=c(u({},t),{assetType:pn,style:{fill:a.fill,stroke:a.stroke,lineWidth:a.lineWidth}}),this.txtShape=new oo({text:"1",fontSize:e.radius,fill:Wa,textBaseline:"ideographic",fontWeight:"300"}),this.add(this.txtShape),this.needsUpdate=!0}}class Mc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.DUMMY),d(this,"_fnEnable",!1),d(this,"_dummies",[]),d(this,"_centroidCache",{}),d(this,"_rmMap",new Map),d(this,"_mergedMap",new Map),d(this,"action"),d(this,"_clip"),d(this,"dynamicDummyFill",La),d(this,"dynamicDummyStroke",Ra),d(this,"rayCaster",new ju),d(this,"intersects",[]),d(this,"_currentDummy"),d(this,"_unboundDummiesMap",{}),d(this,"_cameraHandler",this.handleCameraUpdate.bind(this)),d(this,"_getDragabledHandler",this.getDragabled.bind(this));const i=new Tl(".dynamicDummyFill",[0,.6,1],[.95,.38,.38,.8,.95,.38,.38,.3,.95,.38,.38,.8]),n=new Tl(".dynamicDummyStroke",[0,.6,1],[.95,.38,.38,.8,.95,.38,.38,.3,.95,.38,.38,.8]);this._clip=new Dl("currentDummy",1,[i,n]),this.bindEvents()}destroy(){this.deactivate(),this.unbindEvents()}bindEvents(){var t,e;null==(e=null==(t=this.view)?void 0:t.camera)||e.addEventListener(hu.UPDATE,this._cameraHandler)}unbindEvents(){var t,e;null==(e=null==(t=this.view)?void 0:t.camera)||e.removeEventListener(hu.UPDATE,this._cameraHandler)}activate(){var t;super.activate(),this.action=null==(t=this.parent.mixer)?void 0:t.clipAction(this._clip,this);const e=this.parent.get(Qu.DRAG);e&&(e.bindFilter(this._validFilter.bind(this)),e.bindGetDragabledHandler(this._getDragabledHandler))}deactivate(){var t,e;this.clearDummies(),super.deactivate(),null==(t=this.action)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.action),this.action=void 0,this._dummies=[],this._centroidCache={},this._rmMap=new Map,this._mergedMap=new Map,this.intersects=[];const i=this.parent.get(Qu.DRAG);i&&(i.bindFilter(),i.bindGetDragabledHandler())}fnEnableChanged(t){this._fnEnable=!!t}bindEditorDrag(t){let e=this.getDummyById(null==t?void 0:t.id);e||(e=(null==t?void 0:t.rmId)?this.addDummy(t):this.addDummyUnbound(t)),e&&(e.visible=!1)}getDraggingObject(t){return this.getDummyById(null==t?void 0:t.id)}getDragabled(t){var e;if(!t)return;if(Array.isArray(t)||(t=[t]),!t.length)return;const i=t[0];let n=this._unboundDummiesMap[null==(e=i.userData)?void 0:e.id];return!n&&i.dragable&&(i.mtl.fill=i.userData.style.fill=new Za(Oa).setA(.5).getStyle(),i.mtl.lineDash=[2,2],i.userData.status=ic.MODIFIED,n=this.addDummyUnbound(i.userData)),n&&(n.visible=!0),n}handleDragEnd(t){var e;if(!this.oriScene)throw new Error("No dynamic scene found!");const{target:i}=(null==t?void 0:t.data)||{};if(!(null==i?void 0:i.isDummy))return;const n=[],s=c(u({},null==t?void 0:t.data),{screenCoords:i.position});if(this.rayCaster.init(s,this.view.camera).intersectObjectBy(this.oriScene,this._assetFilter.bind(this),!0,n),!(null==n?void 0:n.length))return;i.userData.rmId=null==(e=n[0].userData)?void 0:e.id;const r=this.getDummiesVo(!0);this.parent.editor.dispatchEvent({type:oi.DRAG_END,data:r})}_validFilter(t){var e,i;return!(!t.visible||!t.selectable||(null==(e=t.userData)?void 0:e.assetType)!==pn)&&!mi.uniq(mi.compact(mi.map(this.intersects,(t=>{var e;return null==(e=t.userData)?void 0:e.id})))).includes(null==(i=t.userData)?void 0:i.id)}_assetFilter(t){var e;return t.visible&&t.selectable&&(null==(e=t.userData)?void 0:e.assetType)===Jr.config.assetType}getDummiesVo(t=!0){var e,i,n,s,r,a,o,h,l,u;const c=[];for(let a=0,o=this._dummies.length;a<o;a++){const o=this._dummies[a];if((null==(e=o.userData)?void 0:e.assetType)!==pn)continue;if(t&&o.userData.status!==ic.NEW)continue;const h={id:null==(i=o.userData)?void 0:i.id,label:null==(n=o.userData)?void 0:n.label,rmId:null==(s=o.userData)?void 0:s.rmId,wsId:null==(r=o.userData)?void 0:r.wsId};c.push(h)}for(let e=Object.keys(this._unboundDummiesMap),i=0,n=(null==e?void 0:e.length)||0;i<n;i++){const n=e[i];if(!n)continue;const s=this._unboundDummiesMap[n];if((null==(a=s.userData)?void 0:a.assetType)!==pn)continue;if(t&&s.userData.status!==ic.NEW)continue;const r={id:null==(o=s.userData)?void 0:o.id,label:null==(h=s.userData)?void 0:h.label,rmId:null==(l=s.userData)?void 0:l.rmId,wsId:null==(u=s.userData)?void 0:u.wsId},d=c.findIndex((t=>t.id===r.id));d>-1&&c.splice(d,1),c.push(r)}return c}getAssetById(t){let e;for(let i=0,n=this.scenes.length;i<n&&(e=this.scenes[i].getByIds(t),!e);i++);return e}getAssetBoundingBoxById(t,e=new Ri){e.makeEmpty();const i=this.getAssetById(t);if(!(null==i?void 0:i.length))return e;for(let t=0,n=(null==i?void 0:i.length)||0;t<n;t++)e.union(i[t].boundingBoxWorld);return e}getDummyLabels(t){var e,i;const n=this.getDummyById(t);return n instanceof Sc?((null==(e=null==n?void 0:n.userData)?void 0:e.label)||"").split(","):[null==(i=null==n?void 0:n.userData)?void 0:i.label]}getDummiesBoundingBox(t,e){if(Ac.makeEmpty(),!(null==t?void 0:t.length))return Ac.clone();for(let e,i=0,n=(null==t?void 0:t.length)||0;i<n;i++){e=t[i];const n=this.getDummyById(e);n&&Ac.union(n.boundingBoxWorld)}return Ac.clone()}addDummy(t){var e,i;if(!this.dstScene||!(null==t?void 0:t.rmId))return;const n=t.rmId;let s=this._dummies.find((e=>{var i;return(null==(i=e.userData)?void 0:i.id)===t.id}));return s||(s=new wc(t,Jr.config.dummy),s.name=t.id||n+"_"+(t.id||(null==(e=this.dstScene.children)?void 0:e.length)),s.userData.rmId=n,this.dstScene.add(s),this._dummies.push(s),this._rmMap.has(n)||this._rmMap.set(n,[]),null==(i=this._rmMap.get(n))||i.push(s)),s}addDummyMerged(t,e){var i,n;if(!this.dstScene||!(null==t?void 0:t.rmId))return;let s;return this._mergedMap.has(t.id)?s=this._mergedMap.get(t.id):(s=new Sc(t,Jr.config.dummy),s.name=t.id||e+"_"+(t.id||(null==(i=this.dstScene.children)?void 0:i.length)),null==(n=this.dstScene)||n.add(s),this._mergedMap.set(e,s)),s}addDummyUnbound(t){var e;if(!(null==t?void 0:t.id))return;const i=new wc(t,Jr.config.dummy);return i.mtl.fill=i.userData.style.fill=Ba,i.mtl.stroke=i.userData.style.stroke=ka,i.userData.status=ic.NEW,null==(e=this.dstScene)||e.add(i),this._unboundDummiesMap[t.id]=i,i}traverseDummies(t){var e;for(let i=0,n=(null==(e=this._dummies)?void 0:e.length)||0;i<n;i++)t(this._dummies[i]);for(let[e,i]of this._mergedMap.entries())t(i);Object.values(this._unboundDummiesMap).forEach((e=>{t(e)}))}clearDummies(t){var e,i,n,s;for(let i,n=Object.keys(this._unboundDummiesMap),s=(null==n?void 0:n.length)||0;s>=0;s--)i=this._unboundDummiesMap[n[s]],(null==t?void 0:t.length)&&!t.includes(null==i?void 0:i.userData.status)||(null==(e=this.dstScene)||e.remove(i),null==i||i.destroy(),delete this._unboundDummiesMap[n[s]]);for(let e,s=((null==(i=this._dummies)?void 0:i.length)||0)-1;s>=0;s--)e=this._dummies[s],(null==t?void 0:t.length)&&!t.includes(e.userData.status)||(null==(n=this.dstScene)||n.remove(e),null==e||e.destroy(),this._dummies.splice(s,1));for(let[e,i]of this._mergedMap.entries())(null==t?void 0:t.length)&&!t.includes(i.userData.status)||(null==(s=this.dstScene)||s.remove(i),null==i||i.destroy(),this._mergedMap.delete(e));(null==t?void 0:t.length)||(this._dummies.length=0,this._centroidCache={},this._rmMap.clear(),this._mergedMap.clear(),this._unboundDummiesMap={})}setDummies(t){var e;if(this.clearDummies(),null==t?void 0:t.length){for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.addDummy(t[e]);null==(e=this.view.camera)||e.update()}}getDummyById(t){var e;if(t){for(let i=0,n=(null==(e=this._dummies)?void 0:e.length)||0;i<n;i++)if(this._dummies[i].name===t)return this._dummies[i];for(let[e,i]of this._mergedMap.entries())if(i.name===t)return i;return this._unboundDummiesMap[t]}}focusAtDummy(t,e=1e3){return p(this,null,(function*(){var i,n,s,r,a,o,h;const l=this.getDummyById(t),u=null==(i=null==l?void 0:l.userData)?void 0:i.rmId;if(u){if(this.getAssetBoundingBoxById(u,Ac),!Ac.isEmpty()&&(Ac.expandByScalar(e),null==(n=this.view)?void 0:n.camera))return void((null==(r=null==(s=this.view)?void 0:s.camera)?void 0:r.boundingBoxWorld.containsBox(Ac))||(yield this.view.resetCameraByBoundingBox(Ac,!0)));if((null==l?void 0:l.position)&&!(null==l?void 0:l.position.isEmpty()))return l.updateWorldMatrix(!0,!1),Tc.copy(l.position).applyMatrix3(l.matrixWorld),Ac.setFromCenterAndSize(Tc,Ic.set(2*e,2*e)),void((null==(o=null==(a=this.view)?void 0:a.camera)?void 0:o.boundingBoxWorld.containsBox(Ac))||(yield null==(h=this.view)?void 0:h.resetCameraByBoundingBox(Ac,!0)))}}))}highlightDummies(t){return p(this,null,(function*(){var e;Array.isArray(t)||(t=[t]),this.traverseDummies((e=>{var i;t.includes(e.userData.id)||e instanceof Sc&&(null==(i=mi.intersection(t,e.userData.id.split(",")))?void 0:i.length)?e.userData.actType|=tc.HILIGHT:e.userData.actType&=~tc.HILIGHT})),null==(e=this.action)||e.play()}))}resetHighlightDummies(){var t;this.traverseDummies((t=>{t.userData.actType&=~tc.HILIGHT,t.mtl.fill=t.userData.style.fill,t.mtl.stroke=t.userData.style.stroke})),null==(t=this.action)||t.stop()}update(){var t,e;(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length)&&this.dstScene.traverse((t=>{var e;((null==(e=null==t?void 0:t.userData)?void 0:e.actType)||0)&tc.HILIGHT&&t.isDummy&&(t.mtl.fill=this.dynamicDummyFill,t.mtl.stroke=this.dynamicDummyStroke)}))}handleCameraUpdate(t){var e,i;if(null==(e=this.view)?void 0:e.camera){for(let t,e=0,n=(null==(i=this._dummies)?void 0:i.length)||0;e<n;e++)t=this._dummies[e],this.updateDummy(t);this.mergeDummies()}}updateDummy(t){var e,i;const n=t.userData.rmId,s=this.getAssetById(n);if((null==s?void 0:s.length)&&!this._centroidCache[n]){const t=[];for(let n,r=0,a=s.length;r<a;r++)n=s[r],null==(i=null==(e=n.geo)?void 0:e.path)||i.getVertices(t);Oi.getPoleOfInaccessibility(t,Tc),this._centroidCache[n]=Tc.clone()}}mergeDummies(){var t,e,i;if(!(null==(t=this.view)?void 0:t.camera))return;Ec.copy(this.view.camera.viewMatrix);const n=(null==(i=null==(e=Jr.config)?void 0:e.dummy)?void 0:i.radius)||10;this.view.camera.pixelWidth;for(let[t,e]of this._rmMap){if(!(null==e?void 0:e.length))continue;this.getAssetBoundingBoxById(t,Ac),Ac.applyMatrix3(Ec).getSize(Tc).round(),Ic.copy(this._centroidCache[t]).applyMatrix3(Ec);const i=Ac.centralArrange(e.length,2*n,2*n,Ic);if(Array.isArray(i)){const n=this._mergedMap.get(t);n&&(n.visible=!1),e.forEach(((t,e)=>{t.visible=!0,t.boundingBox.getSize(Dc),t.setPosition(Cc.copy(i[e]).unproject(this.view.camera)).updateMatrix()}))}else{e.forEach((t=>t.visible=!1));let i=this._mergedMap.get(t);if(!i){let n=mi.cloneDeep(e[0].userData)||{};const s=mi.reduce(e,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.label)&&t.push(null==(n=e.userData)?void 0:n.label),t}),[]),r=mi.reduce(e,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.id)&&t.push(null==(n=e.userData)?void 0:n.id),t}),[]);n=mi.merge(n,{rmId:t,id:r.join(","),label:s.join(",")}),i=this.addDummyMerged(n,t)}if(!i)continue;i.setText(String(e.length)),i.visible=!0,Cc.copy(e[0].position),i.setPosition(Cc).updateMatrix()}}}}const Ec=new Gi,Ac=new Ri,Tc=new Oi,Ic=new Oi,Cc=new Oi,Dc=new Oi;function Nc(t,e=[]){var i,n;return t&&t.value?(e.push(t.value),(null==(i=t.children)?void 0:i.length)&&(null==(n=t.children)||n.forEach((t=>Nc(t,e)))),e):e}class Bc extends Ia{constructor(t){const e=new Ta(t),i=new Aa(t);(null==t?void 0:t.lineWidth)||(i.lineWidth=1),super(e,i),d(this,"name","Line"),d(this,"isLine",!0)}}class kc{static getPoint(t){const e=new vc(t),i=so.getMtl(t);return new xc(e,i)}static getRect(t){const e=new Bo(t),i=so.getMtl(t);return new xc(e,i)}static getMark(t){const e=new va({cmds:[[Pn,0,0],[Ln,-5,-10],[Rn,-5,-10,-12.5,-25,0,-25],[Rn,0,-25,12.5,-25,5,-10],[Ln,0,0],[Fn]],closed:!0,flipY:!0,lineWidth:1,thinLine:!0}),i=so.getMtl(t);return new xc(e,i)}}class Oc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.LINKER),d(this,"_linesIds",[]),d(this,"_startIds",[]),d(this,"_endIds",[]),d(this,"_lineDash",20)}activate(){super.activate()}deactivate(){this.clear(),super.deactivate(),this._linesIds=[],this._startIds=[],this._endIds=[]}update(){var t,e;for(let i=0,n=(null==(t=this._linesIds)?void 0:t.length)||0;i<n;i++){const t=null==(e=this.dstScene)?void 0:e.getByIds(this._linesIds[i]);if(null==t?void 0:t.length)for(let e,i=0,n=t.length;i<n;i++){if(e=t[i],!(null==e?void 0:e.mtl))continue;let n=e.mtl.lineDashOffset||0;n<=-2*this._lineDash&&(n=0),e.mtl.lineDashOffset=n-1}}}clear(){var t;(null==(t=this._linesIds)?void 0:t.length)&&(this.clearDynamicObjectsByIds(this._linesIds),this.clearDynamicObjectsByIds(this._startIds),this.clearDynamicObjectsByIds(this._endIds),this._linesIds=[],this._startIds=[],this._endIds=[])}linkAssetsByTree(t){var e,i;if(this.clear(),!(null==(e=null==t?void 0:t.children)?void 0:e.length))return;Nc(t);const n=this.getLinesByTree(t,void 0,!0);if(null==n?void 0:n.length)for(let t,e=0,s=n.length;e<s;e++)t=n[e],null==(i=this.dstScene)||i.add(t),this._linesIds.push(t.userData.id)}getLinesByTree(t,e=[],i=!1){var n,s;if(!(null==t?void 0:t.value))return e;const r=this.getDynamicObjectsByIds(t.value);if(Pc.makeEmpty().expandByObjects(r).getCenter(Rc),i){const e=kc.getMark({fill:La,stroke:ka,lineWidth:1});e.userData.id=`${t.value}-start`,e.setPosition(Rc).updateMatrix(),null==(n=this.dstScene)||n.add(e),this._startIds.push(e.userData.id)}return null==(s=t.children)||s.forEach((i=>{var n,s;const r=this.getDynamicObjectsByIds(i.value);Lc.makeEmpty().expandByObjects(r).getCenter(zc);const a=new Bc({x1:Rc.x,y1:Rc.y,x2:zc.x,y2:zc.y,stroke:Ra,strokeWidth:10,lineCap:"round",lineJoin:"round",lineDash:[this._lineDash,this._lineDash],thinLine:!0});a.userData.id=`${t.value}-${i.value}`,a.userData.actType|=tc.DYNAMIC_LINE,e.push(a);const o=kc.getMark({fill:Ba,stroke:ka,lineWidth:1});o.userData.id=`${t.value}-end`,o.setPosition(zc).updateMatrix(),null==(n=this.dstScene)||n.add(o),this._endIds.push(o.userData.id),(null==(s=i.children)?void 0:s.length)&&this.getLinesByTree(i,e,!1)})),e}}const Pc=new Ri,Lc=new Ri,Rc=new Oi,zc=new Oi;class Uc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.DISTRIBUTION),d(this,"fillIdsMap",{}),d(this,"strokeIdsMap",{})}activate(){super.activate()}deactivate(){this.clearByIds(),super.deactivate(),this.fillIdsMap={},this.strokeIdsMap={}}update(){}setFillByIds(t,e){var i,n;if(t&&e){Array.isArray(t)||(t=[t]);for(let n,s=0,r=(null==t?void 0:t.length)||0;s<r;s++){n=t[s],this.clearById(n,!1);const r=null==(i=this.oriScene)?void 0:i.getByIds(n);if(null==r?void 0:r.length)for(let t,i=0,n=(null==r?void 0:r.length)||0;i<n;i++)t=r[i],(null==t?void 0:t.mtl)&&(t.mtl=so.getMtl(c(u({},t.userData.style),{fill:e})),t.geo.lineWidth=t.userData.style.lineWidth||1,t.needsUpdate=!0)}this.fillIdsMap[e]=t,(null==(n=this.view)?void 0:n.camera)&&(this.view.camera.needsUpdate=!0)}}setStrokeByIds(t,e){var i,n;if(t&&e){Array.isArray(t)||(t=[t]);for(let n,s=0,r=(null==t?void 0:t.length)||0;s<r;s++){n=t[s],this.clearById(n,!1);const r=null==(i=this.oriScene)?void 0:i.getByIds(n);if(null==r?void 0:r.length)for(let t,i=0,n=(null==r?void 0:r.length)||0;i<n;i++)t=r[i],(null==t?void 0:t.mtl)&&(t.mtl=so.getMtl(c(u({},t.userData.style),{stroke:e,lineWidth:5*(t.userData.style.lineWidth||1)})),t.geo.lineWidth=5*(t.userData.style.lineWidth||1),t.needsUpdate=!0)}this.strokeIdsMap[e]=t,(null==(n=this.view)?void 0:n.camera)&&(this.view.camera.needsUpdate=!0)}}clearById(t,e=!0){var i,n,s,r,a,o,h;if(!t)return;const l=null==(i=this.oriScene)?void 0:i.getByIds(t);for(let t,e=0,i=(null==l?void 0:l.length)||0;e<i;e++)t=l[e],(null==t?void 0:t.mtl)&&(t.mtl=so.getMtl(t.userData.style),t.geo.lineWidth=null==(n=t.userData.style)?void 0:n.lineWidth,t.needsUpdate=!0);for(let e,i=Object.keys(this.fillIdsMap),n=((null==i?void 0:i.length)||0)-1;n>=0;n--){e=i[n];const a=null==(s=this.fillIdsMap[e])?void 0:s.findIndex((e=>e===t));a>-1&&this.fillIdsMap[e].splice(a,1),(null==(r=this.fillIdsMap[e])?void 0:r.length)||delete this.fillIdsMap[e]}for(let e,i=Object.keys(this.strokeIdsMap),n=((null==i?void 0:i.length)||0)-1;n>=0;n--){e=i[n];const s=null==(a=this.strokeIdsMap[e])?void 0:a.findIndex((e=>e===t));s>-1&&this.strokeIdsMap[e].splice(s,1),(null==(o=this.strokeIdsMap[e])?void 0:o.length)||delete this.strokeIdsMap[e]}e&&(null==(h=this.view)?void 0:h.camera)&&(this.view.camera.needsUpdate=!0)}clearFillByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=mi.uniq(mi.compact(mi.flatten(mi.values(this.fillIdsMap)))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}clearStrokeByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=mi.uniq(mi.compact(mi.flatten(mi.values(this.strokeIdsMap)))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}clearByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=mi.uniq(mi.compact(mi.flatten(mi.concat(mi.values(this.fillIdsMap),mi.values(this.strokeIdsMap))))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}getLegend(){const t=[];for(let e in this.fillIdsMap)t.push({type:"fill",color:e,ids:this.fillIdsMap[e]});for(let e in this.strokeIdsMap)t.push({type:"stroke",color:e,ids:this.strokeIdsMap[e]});return t}}class Fc extends nc{constructor(t,e){super(t,e),d(this,"type",Qu.TIPS),d(this,"engineVersion","v2.0.5"),d(this,"monitor"),this.monitor=new Ia}activate(){super.activate()}deactivate(){super.deactivate()}handlePointerMove(t){var e,i,n;let s=(null==(e=null==t?void 0:t.e)?void 0:e.target)||(null==(n=null==(i=null==t?void 0:t.e)?void 0:i.srcEvent)?void 0:n.target);null==s||s.id}}class Wc{constructor(t,e){d(this,"tools",new Map),d(this,"activedTools",new Map),d(this,"activedTool"),d(this,"scenes",[]),d(this,"dstScene"),d(this,"mixer"),d(this,"clock",new Xh),this.editor=t,this.view=e,this.mixer=new Jl}destroy(){var t;this.dispose(),this.tools.clear(),null==(t=this.mixer)||t.destroy()}dispose(){var t;this.tools.forEach((t=>{t.deactivate&&t.deactivate()})),this.deactiveAll(),this.scenes=[],null==(t=this.mixer)||t.dispose()}register(t){Array.isArray(t)||(t=[t]),this.deactiveAll();for(let e,i=0,n=(null==t?void 0:t.length)||0;i<n;i++){e=t[i];let n=this.tools.get(e);if(!n){switch(e){case Qu.TIPS:n=new Fc(this,this.view);break;case Qu.HOVER:n=new sc(this,this.view);break;case Qu.SELECT:n=new oc(this,this.view);break;case Qu.SELECTOR_RECT:n=new dc(this,this.view);break;case Qu.DISTRIBUTION:n=new Uc(this,this.view);break;case Qu.DRAG:n=new gc(this,this.view);break;case Qu.DUMMY:n=new Mc(this,this.view);break;case Qu.LINKER:n=new Oc(this,this.view)}n&&this.tools.set(e,n)}n&&(null==n?void 0:n.bindScene)&&n.bindScene(...this.scenes)}return this}bindScene(...t){var e;return this.scenes.length=0,this.scenes.push(...t),this.dstScene=this.scenes.find((t=>t.isDynamic)),this.dstScene&&(null==(e=this.mixer)||e.bind(this.dstScene)),this.activedTools.forEach((t=>{t.bindScene&&t.bindScene(...this.scenes)})),this}setMode(t){this.deactiveAll();for(let e=1;e<=t;e<<=1)if(t&e){const t=e;this.tools.has(t)&&this.activateTool(t)}}clearMode(){this.deactiveAll()}activateTool(t){const e=this.tools.get(t);e&&(null==e||e.deactivate(),this.activedTools.set(e.type,e),e.bindScene&&e.bindScene(...this.scenes),e.activate())}get(t){return this.tools.get(t)}getActiveTool(t){return this.activedTools.get(t)}deactiveAll(t){const e=[];this.activedTools.forEach((i=>{(null==t?void 0:t.includes(i.type))||e.push(i.type)})),e.forEach((t=>{var e;null==(e=this.activedTools.get(t))||e.deactivate(),this.activedTools.delete(t)}))}handleTap(t){this.activedTools.forEach((e=>{e.handleTap&&e.handleTap(t)}))}handlePanStart(t){this.activedTools.forEach((e=>{e.handlePanStart&&e.handlePanStart(t)}))}handlePanMove(t){this.activedTools.forEach((e=>{e.handlePanMove&&e.handlePanMove(t)}))}handlePanEnd(t){this.activedTools.forEach((e=>{e.handlePanEnd&&e.handlePanEnd(t)}))}handlePointerOver(t){this.activedTools.forEach((e=>{e.handlePointerOver&&e.handlePointerOver(t)}))}handlePointerOut(t){this.activedTools.forEach((e=>{e.handlePointerOut&&e.handlePointerOut(t)}))}handlePointerMove(t){this.activedTools.forEach((e=>{e.handlePointerMove&&e.handlePointerMove(t)}))}handleDragStart(t){this.activedTools.forEach((e=>{e.handleDragStart&&e.handleDragStart(t)}))}handleDragEnd(t){this.activedTools.forEach((e=>{e.handleDragEnd&&e.handleDragEnd(t)}))}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta()),this.activedTools.forEach((t=>{t.update&&t.update()}))}clearDummies(t){var e;null==(e=this.tools.get(Qu.DUMMY))||e.clearDummies(t)}setDummies(t){var e;null==(e=this.tools.get(Qu.DUMMY))||e.setDummies(t)}focusAtDummy(t,e=1e3){var i;null==(i=this.tools.get(Qu.DUMMY))||i.focusAtDummy(t,e)}highlightDummies(t){var e;null==(e=this.tools.get(Qu.DUMMY))||e.highlightDummies(t)}resetHighlightDummies(){var t;null==(t=this.tools.get(Qu.DUMMY))||t.resetHighlightDummies()}getDummyLabels(t){var e;return null==(e=this.tools.get(Qu.DUMMY))?void 0:e.getDummyLabels(t)}getDummiesBoundingBox(t,e){var i;return null==(i=this.tools.get(Qu.DUMMY))?void 0:i.getDummiesBoundingBox(t)}}class qc extends hi{constructor(t,e){var i,n;super(),d(this,"scenes",[]),d(this,"dstScene"),d(this,"handler"),d(this,"view"),d(this,"mode",Ku.DEFAULT),d(this,"toolManager"),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"panStartHandler",this.handlePanStart.bind(this)),d(this,"panMoveHandler",this.handlePanMove.bind(this)),d(this,"panEndHandler",this.handlePanEnd.bind(this)),d(this,"pointerOverHandler",this.handlePointerOver.bind(this)),d(this,"pointerOutHandler",this.handlePointerOut.bind(this)),d(this,"pointerMoveHandler",this.handlePointerMove.bind(this)),this.view=e,(null==(i=this.view)?void 0:i.camera)&&(this.handler=new Yu(t,this.view.camera).enableHover(null==(n=Jr.config.controls)?void 0:n.enableHover)),this.toolManager=new Wc(this,this.view).register([Qu.TIPS,Qu.HOVER,Qu.SELECT,Qu.SELECTOR_RECT,Qu.DISTRIBUTION,Qu.DRAG,Qu.DUMMY,Qu.LINKER]),this.toolManager.setMode(this.mode)}destroy(){var t;this.dispose(),this.unbindEvents(),null==(t=this.handler)||t.destroy()}dispose(){this.toolManager.dispose(),this.scenes=[]}bind(t,e){this.view=t,this.handler=e}bindScene(...t){var e;return this.scenes.length=0,this.scenes.push(...t),null==(e=this.handler)||e.bindScene(...t),this.dstScene=this.scenes.find((t=>t.isDynamic)),this.toolManager.bindScene(...t),this.bindEvents(),this}setMode(t){t&&(this.mode=t,this.toolManager.setMode(t),Jr.config.editorMode=Ku.PICKER)}clearMode(){this.mode=Ku.DEFAULT,this.toolManager.clearMode(),Jr.config.editorMode=Ku.DEFAULT}bindEvents(){var t,e,i,n,s,r,a;this.unbindEvents(),null==(t=this.handler)||t.addEventListener(Ju.TAP,this.tapHandler),null==(e=this.handler)||e.addEventListener(Ju.PAN_START,this.panStartHandler),null==(i=this.handler)||i.addEventListener(Ju.PAN_MOVE,this.panMoveHandler),null==(n=this.handler)||n.addEventListener(Ju.PAN_END,this.panEndHandler),null==(s=this.handler)||s.addEventListener(Ju.POINTEROVER,this.pointerOverHandler),null==(r=this.handler)||r.addEventListener(Ju.POINTEROUT,this.pointerOutHandler),null==(a=this.handler)||a.addEventListener(Ju.POINTERMOVE,this.pointerMoveHandler)}unbindEvents(){var t,e,i,n,s,r,a;null==(t=this.handler)||t.removeEventListener(Ju.TAP,this.tapHandler),null==(e=this.handler)||e.removeEventListener(Ju.PAN_START,this.panStartHandler),null==(i=this.handler)||i.removeEventListener(Ju.PAN_MOVE,this.panMoveHandler),null==(n=this.handler)||n.removeEventListener(Ju.PAN_END,this.panEndHandler),null==(s=this.handler)||s.removeEventListener(Ju.POINTEROVER,this.pointerOverHandler),null==(r=this.handler)||r.removeEventListener(Ju.POINTEROUT,this.pointerOutHandler),null==(a=this.handler)||a.removeEventListener(Ju.POINTERMOVE,this.pointerMoveHandler)}handleTap(t){this.toolManager.handleTap(t)}handlePanStart(t){this.toolManager.handlePanStart(t)}handlePanMove(t){this.toolManager.handlePanMove(t)}handlePanEnd(t){this.toolManager.handlePanEnd(t)}handlePointerOver(t){this.toolManager.handlePointerOver(t)}handlePointerOut(t){this.toolManager.handlePointerOut(t)}handlePointerMove(t){this.toolManager.handlePointerMove(t)}update(){this.toolManager.update()}setEnablePan(t=!1){this.view&&this.view.setEnablePan&&this.view.setEnablePan(t)}selectEnableChanged(t=!1){t?this.setMode(Ku.PICKER):this.clearMode()}multiSelectEnableChanged(t=!1){t?this.setMode(Ku.PICKER):this.clearMode()}fnEnableChanged(t=!1){var e;null==(e=this.toolManager.get(Qu.SELECTOR_RECT))||e.fnEnableChanged(t)}clearSelected(t){var e;this.mode&Qu.SELECT||this.setMode(Ku.PICKER),null==(e=this.toolManager.get(Qu.SELECT))||e.clearSelected(t)}selectByIds(t,e){var i;this.mode&Qu.SELECT||this.setMode(Ku.PICKER),null==(i=this.toolManager.get(Qu.SELECT))||i.selectByIds(t,e)}setDynamicFill(t){var e;null==(e=this.toolManager.get(Qu.SELECT))||e.setDynamicFill(t)}clearDummies(t){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.clearDummies(t)}setDummies(t){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.setDummies(t)}focusAtDummy(t,e=1e3){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.focusAtDummy(t,e)}highlightDummies(t){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.highlightDummies(t)}resetHighlightDummies(){this.mode&Ku.DUMMY||this.setMode(Ku.DUMMY),this.toolManager.resetHighlightDummies()}getAssetLabels(t,e){var i;if(this.mode===Ku.DUMMY)return null==(i=this.toolManager.get(Qu.DUMMY))?void 0:i.getDummyLabels(e)}getAssetBoundingBox(t,e){var i;if(this.mode===Ku.DUMMY)return null==(i=this.toolManager.get(Qu.DUMMY))?void 0:i.getDummiesBoundingBox(t,e)}bindEditorDrag(t){var e;if(this.mode===Ku.DUMMY)return null==(e=this.toolManager.get(Qu.DUMMY))?void 0:e.bindEditorDrag(t)}setEditorDraggingObject(t){var e,i;if(this.mode===Ku.DUMMY){const n=null==(e=this.toolManager.get(Qu.DUMMY))?void 0:e.getDraggingObject(t);null==(i=this.toolManager.get(Qu.DRAG))||i.setDraggingObject(n)}}getDummies(t){var e;if(this.mode===Ku.DUMMY)return null==(e=this.toolManager.get(Qu.DUMMY))?void 0:e.getDummiesVo(t)}setFillByIds(t,e){var i;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(i=this.toolManager.get(Qu.DISTRIBUTION))||i.setFillByIds(t,e)}setStrokeByIds(t,e){var i;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(i=this.toolManager.get(Qu.DISTRIBUTION))||i.setStrokeByIds(t,e)}clearFillByIds(t){var e;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(e=this.toolManager.get(Qu.DISTRIBUTION))||e.clearFillByIds(t)}clearStrokeByIds(t){var e;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(e=this.toolManager.get(Qu.DISTRIBUTION))||e.clearStrokeByIds(t)}clearByIds(t){var e;this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(e=this.toolManager.get(Qu.DISTRIBUTION))||e.clearByIds(t)}getLegend(){var t;return this.mode&Qu.DISTRIBUTION||this.setMode(Ku.DISTRIBUTION),null==(t=this.toolManager.get(Qu.DISTRIBUTION))?void 0:t.getLegend()}linkAssetsByTree(t){var e;this.mode!==Ku.LINKER&&this.setMode(Ku.LINKER),null==(e=this.toolManager.get(Qu.LINKER))||e.linkAssetsByTree(t)}}const Hc=new Oi,Vc=new ri,jc=new class extends hi{constructor(){super(),d(this,"name","App2@"+fi.now()),d(this,"scenes",[]),d(this,"requestHeader",{}),d(this,"_tic"),d(this,"_url"),d(this,"_layers"),d(this,"_lastCameraVersion",-1/0),d(this,"_runningHandler",this.running.bind(this)),d(this,"_pointerOverHandler",(t=>this.dispatchEvent(t))),d(this,"_pointerOutHandler",(t=>this.dispatchEvent(t))),d(this,"_selectedHandler",(t=>this.dispatchEvent(t))),d(this,"_dragEndHandler",(t=>this.dispatchEvent(t))),this.adapter=new Oh}destroy(){var t,e,i,n,s;this.unbindEvents(),super.destroy(),null==(t=this.composer)||t.destroy(),null==(e=this.mainScene)||e.destroy(),null==(i=this.animateScene)||i.destroy(),null==(n=this.view)||n.destroy(),null==(s=this.renderer)||s.destroy()}init(t={}){var e,i;return this.params=t,this.renderer||(this.renderer=new Vh(t)),this.view||(this.view=new _u(t)),this.composer||(this.composer=new Jh(this.renderer,new Zh(t))),this.editor||(this.editor=new qc(this.params.inpEl?this.params.inpEl:this.params.cvs,this.view)),null==(e=this.mainScene)||e.destroy(),this.mainScene=new Pu(t,this.adapter),null==(i=this.animateScene)||i.destroy(),this.animateScene=new Uu(t),this.trans2LoadingScene(),this.bindEvents(),this}bindEvents(){var t,e,i,n;this.unbindEvents(),null==(t=this.editor)||t.addEventListener(oi.POINTER_OVER,this._pointerOverHandler),null==(e=this.editor)||e.addEventListener(oi.POINTER_OUT,this._pointerOutHandler),null==(i=this.editor)||i.addEventListener(oi.SELECTED,this._selectedHandler),null==(n=this.editor)||n.addEventListener(oi.DRAG_END,this._dragEndHandler)}unbindEvents(){var t,e,i,n;null==(t=this.editor)||t.removeEventListener(oi.POINTER_OVER,this._pointerOverHandler),null==(e=this.editor)||e.removeEventListener(oi.POINTER_OUT,this._pointerOutHandler),null==(i=this.editor)||i.removeEventListener(oi.SELECTED,this._selectedHandler),null==(n=this.editor)||n.removeEventListener(oi.DRAG_END,this._dragEndHandler)}get isLoadingScene(){var t;return"LoadingScene"===(null==(t=this.scenes[0])?void 0:t.name)}setRequestHeader(t){return this.requestHeader=t,this}load(t,e,i=2){return p(this,null,(function*(){if(this._tic&&this._tic.clear(),this._url=t,this._layers=e,yield this.trans2LoadingScene(),!t)throw"url not found";const i=yield this.adapter.setRequestHeader(this.requestHeader).load(t,e);return this.adapter.bindScene(this.mainScene).initResources(i,e),yield this.trans2MainScene(),(i||{}).idsTree}))}hasScene(t){return this.scenes.findIndex((e=>e.uuid===t.uuid))>=0}pushScene(t){this.hasScene(t)||(this.view.bindScene(t),this.scenes.push(t))}clearScenes(){this.view.scenes.length=0,this.scenes.forEach((t=>this.removeScene(t))),this.scenes.length=0,this.loadingScene=void 0}removeScene(t){const e=this.scenes.findIndex((e=>e.uuid===t.uuid));e<0||(this.scenes[e].destroy(),this.scenes.splice(e,1))}removeLoadingScene(){this.loadingScene&&(this.removeScene(this.loadingScene),this.loadingScene=void 0)}trans2LoadingScene(){return p(this,null,(function*(){var t;this.clearScenes(),this.loadingScene||(this.loadingScene=new eu(this.params)),this.pushScene(this.loadingScene),null==(t=this.editor)||t.dispose(),this.view.fullscreen(250);const e=new tl(this.loadingScene,this.view.camera);this.composer.clearPasses(),this.composer.addPass(e),this.mainScene=new Pu(this.params,this.adapter)}))}trans2MainScene(){return p(this,null,(function*(){var t,e;this.clearScenes(),this.mainScene||(this.mainScene=new Pu(this.params,this.adapter)),this.animateScene||(this.animateScene=new Uu(this.params)),null==(t=this.editor)||t.setMode(Ku.DEFAULT),null==(e=this.editor)||e.bindScene(this.mainScene,this.animateScene),this.mainScene.setViewBox(this.adapter.getViewBox()),this.pushScene(this.mainScene),this.view.scene=this.mainScene,this.view.fullscreen(10,!0);const i=new el(this.mainScene,this.view.camera,!1,!1),n=new tl(this.animateScene,this.view.camera,!1,!1),s=new rl;this.composer.clearPasses(),this.params.bgPass&&this.composer.addPass(new cl(this.view.camera)),this.composer.addPass(i),this.composer.addPass(n),this.composer.addPass(s)}))}trans2EmptyScene(){var t;this.clearScenes(),this.emptyScene=new Fu(this.params),null==(t=this.editor)||t.dispose(),this.pushScene(this.emptyScene),this.view.scene=this.emptyScene,this.view.fullscreen(250,!0),this.editor&&this.editor.bindScene(this.emptyScene);const e=new tl(this.emptyScene,this.view.camera);this.composer.clearPasses(),this.composer.addPass(e)}debounceCacheChanged(t=!1){this.params.debounceCache=t}wireframeChanged(t=!1){this.params.wireframe=t}sliceDurationChanged(t){this.params.sliceDuration=t}selectEnableChanged(t=!1){return p(this,null,(function*(){var e;yield this.clearSelected(),this.params.selectEnable=t,null==(e=this.editor)||e.selectEnableChanged(t)}))}multiSelectEnableChanged(t=!1){return p(this,null,(function*(){var e;yield this.clearSelected(),this.params.multiSelectEnable=t,null==(e=this.editor)||e.multiSelectEnableChanged(t)}))}assetTypeChanged(t){return p(this,null,(function*(){t&&(this.params.assetType=t,this.setAssetType(t))}))}fnEnableChanged(t){return p(this,null,(function*(){var e;this.params.fnEnable=!!t,null==(e=this.editor)||e.fnEnableChanged(t)}))}zoomToSelectEnableChanged(t){return p(this,null,(function*(){this.params.zoomToSelectEnable=!!t}))}socialDistanceEnableChanged(t){return p(this,null,(function*(){this.params.socialDistanceEnable=!!t}))}enableHoverChanged(t){return p(this,null,(function*(){var e,i;mi.set(this.params,"controls.enableHover",!!t),null==(i=null==(e=this.editor)?void 0:e.handler)||i.enableHover(this.params.controls.enableHover)}))}resize(){var t;let e;this.params.containerId&&(e=Jr.window.document.getElementById(this.params.containerId)),e||(e=Jr.window.document.getElementsByTagName("body")[0]);const i=null==(t=null==e?void 0:e.parentElement)?void 0:t.getBoundingClientRect();i&&this.setSize(i.width,i.height)}setSize(t,e){var i,n,s;null==(i=this.renderer)||i.setSize(t,e),null==(n=this.view)||n.resize(),null==(s=this.composer)||s.setSize(t,e)}refresh(){this.view.camera.needsUpdate=!0}fullscreen(){this.view.fullscreen(1,!0)}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}zoomIn(){this.view.zoomIn()}zoomOut(){this.view.zoomOut()}fontZoomIn(t=1.1){var e;null==(e=this.mainScene)||e.increaseFontSize(t)}fontZoomOut(t=.9){var e;null==(e=this.mainScene)||e.increaseFontSize(t)}unproject(t){return p(this,null,(function*(){return Hc.copy(t).unproject(this.view.camera)}))}strokeMore(t=1.1){var e;null==(e=this.mainScene)||e.increaseStrokeWidth(t)}strokeLess(t=.9){var e;null==(e=this.mainScene)||e.increaseStrokeWidth(t)}updateLayersVisibility(t,e=!1){this.adapter.updateLayersVisibility(t,e)}getLayers(t=2){return p(this,null,(function*(){return this.adapter.getLayers(t)}))}focusAtIds(t,e=100){return p(this,null,(function*(){if(!this.mainScene)return;const i=this.adapter.getBoundingBoxByIds(t);return i&&!i.isEmpty()?(i.expandByVector(new Oi(1,1).multiplyScalar(e)),i.isEmpty()||(yield this.view.resetCameraByBoundingBox(i,!0)),i):void 0}))}clearSelected(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.clearSelected(t)}))}targetByIds(t){return p(this,null,(function*(){var e,i;this.clearSelected(),this.selectByIds(t);let n=null==(e=this.mainScene)?void 0:e.getAssetBoundingBox(t);n||(n=null==(i=this.editor)?void 0:i.getAssetBoundingBox(t)),n&&(n.isEmpty()||(n.getSize(Hc),n.expandByScalar(Math.round(.5*Math.max(Hc.x,Hc.y))),yield this.view.resetCameraByBoundingBox(n,!0)))}))}getAssetIdsByType(t){return p(this,null,(function*(){var e;return null==(e=this.adapter)?void 0:e.getAssetIdsByType(t)}))}setFillByIds(t,e){return p(this,null,(function*(){var i;null==(i=this.editor)||i.setFillByIds(t,e)}))}clearFillByIds(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.clearFillByIds(t)}))}setStrokeByIds(t,e){return p(this,null,(function*(){var i;null==(i=this.editor)||i.setStrokeByIds(t,e)}))}clearFill(){return p(this,null,(function*(){var t;null==(t=this.editor)||t.clearFillByIds()}))}clearStroke(){return p(this,null,(function*(){var t;null==(t=this.editor)||t.clearStrokeByIds()}))}getLegend(){return p(this,null,(function*(){var t;return null==(t=this.editor)?void 0:t.getLegend()}))}getAssetLabels(t,e){return p(this,null,(function*(){var i,n;return t===pn?null==(i=this.editor)?void 0:i.getAssetLabels(t,e):null==(n=this.mainScene)?void 0:n.getAssetLabels(t,e)}))}setAssetLabels(t,e){return p(this,null,(function*(){var i;return null==(i=this.mainScene)?void 0:i.setAssetLabels(t,e)}))}clearAssetLabels(t){return p(this,null,(function*(){var e;return null==(e=this.mainScene)?void 0:e.clearAssetLabels(t)}))}selectByIds(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.selectByIds(t,!0)}))}getAssetBoundingBox(t,e){return p(this,null,(function*(){var i,n;let s=null==(i=this.mainScene)?void 0:i.getAssetBoundingBox(t);if(s||(s=null==(n=this.editor)?void 0:n.getAssetBoundingBox(t)),s)return e?s.applyMatrix3(this.view.camera.viewMatrix):s}))}setAssetType(t,e){var i;t&&(this.params.assetType=t,null==(i=this.mainScene)||i.setAssetType(t,e))}linkAssetsByTree(t){var e;null==(e=this.editor)||e.linkAssetsByTree(t)}clearDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.clearDummies(t)}))}setDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setDummies(t)}))}focusAtDummy(t,e=1e3){return p(this,null,(function*(){var i;return null==(i=this.editor)?void 0:i.focusAtDummy(t,e)}))}highlightDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.highlightDummies(t)}))}resetHighlightDummies(){return p(this,null,(function*(){var t;return null==(t=this.editor)?void 0:t.resetHighlightDummies()}))}setEditorMode(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setMode(t)}))}bindEditorDrag(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.bindEditorDrag(t)}))}setEditorDraggingObject(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setEditorDraggingObject(t)}))}getDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.getDummies(t)}))}start(){requestAnimationFrame(this._runningHandler)}running(t){var e,i,n,s,r,a;null==(e=this.view)||e.update(t),null==(i=this.editor)||i.update(),(null==(n=this.scenes)?void 0:n.length)&&this.scenes.forEach((t=>"function"==typeof(null==t?void 0:t.update)?t.update():void 0)),null==(s=this.composer)||s.render(),this._lastCameraVersion=null==(a=null==(r=this.view)?void 0:r.camera)?void 0:a.version,requestAnimationFrame(this._runningHandler)}},Yc=function(t){const e=(null==t?void 0:t.data)||{};delete e.target,self.postMessage({type:oi.POINTER_OVER,data:e})},Gc=function(t){const e=(null==t?void 0:t.data)||{};delete e.target,self.postMessage({type:oi.POINTER_OUT,data:e})},Xc=function(t){self.postMessage({type:oi.SELECTED,data:null==t?void 0:t.data})},Zc=function(t){self.postMessage({type:oi.DRAG_END,data:null==t?void 0:t.data})},$c=function(){jc.removeEventListener(oi.POINTER_OVER,Yc),jc.removeEventListener(oi.POINTER_OUT,Gc),jc.removeEventListener(oi.SELECTED,Xc),jc.removeEventListener(oi.DRAG_END,Zc)};jc.addEventListener(oi.POINTER_OVER,Yc),jc.addEventListener(oi.POINTER_OUT,Gc),jc.addEventListener(oi.SELECTED,Xc),jc.addEventListener(oi.DRAG_END,Zc);const Jc={makeProxy:function(t){Vc.makeProxy(t)},start:function(t){const e=Vc.getProxy(t.proxyId);e.ownerDocument=e,self.document={};const i=c(u({},t.conf),{cvs:t.canvas,workerRender:!0,inpEl:e});jc.init(i).start()},event:Vc.handleEvent,ping:()=>self.postMessage({type:"pang"}),[oi.TERMINATE]:function(){$c(),jc.destroy()},[oi.LOAD]:e=>p(t,null,(function*(){return self.postMessage({type:oi.LOAD,data:yield jc.load(null==e?void 0:e.url,null==e?void 0:e.layers,null==e?void 0:e.lv)})})),[oi.SET_SIZE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_SIZE,data:yield jc.setSize(null==e?void 0:e.w,null==e?void 0:e.h)})})),[oi.DEBOUNCE_CACHE_CHANGED]:t=>jc.debounceCacheChanged(t.v),[oi.WIREFRAME_CHANGED]:t=>jc.wireframeChanged(t.v),[oi.SLICE_DURATION_CHANGED]:t=>jc.sliceDurationChanged(t.v),[oi.SELECT_ENABLE_CHANGED]:t=>jc.selectEnableChanged(t.v),[oi.MULTI_SELECT_ENABLE_CHANGED]:t=>jc.multiSelectEnableChanged(t.v),[oi.ASSET_TYPE_CHANGED]:t=>jc.assetTypeChanged(t.v),[oi.FN_ENABLE_CHANGED]:t=>jc.fnEnableChanged(t.v),[oi.ZOOM_TO_SELECT_ENABLE_CHANGED]:t=>jc.zoomToSelectEnableChanged(t.v),[oi.SOCIAL_DISTANCE_ENABLE_CHANGED]:t=>jc.socialDistanceEnableChanged(t.v),[oi.ENABLE_HOVER_CHANGED]:t=>jc.enableHoverChanged(t.v),[oi.REFRESH]:()=>p(t,null,(function*(){return self.postMessage({type:oi.REFRESH,data:yield jc.refresh()})})),[oi.FULLSCREEN]:()=>p(t,null,(function*(){return self.postMessage({type:oi.FULLSCREEN,data:yield jc.fullscreen()})})),[oi.GET_CAMERA_POSITION]:()=>{var t;return self.postMessage({type:oi.GET_CAMERA_POSITION,data:null==(t=jc.view)?void 0:t.getCameraPosition()})},[oi.SET_CAMERA_POSITION]:e=>p(t,null,(function*(){var t;return self.postMessage({type:oi.SET_CAMERA_POSITION,data:yield null==(t=jc.view)?void 0:t.setCameraPosition(null==e?void 0:e.data,!0)})})),[oi.ZOOM_IN]:()=>p(t,null,(function*(){return self.postMessage({type:oi.ZOOM_IN,data:yield jc.zoomIn()})})),[oi.ZOOM_OUT]:()=>p(t,null,(function*(){return self.postMessage({type:oi.ZOOM_OUT,data:yield jc.zoomOut()})})),[oi.FONT_ZOOM_IN]:e=>p(t,null,(function*(){return self.postMessage({type:oi.FONT_ZOOM_IN,data:yield jc.fontZoomIn(null==e?void 0:e.v)})})),[oi.FONT_ZOOM_OUT]:e=>p(t,null,(function*(){return self.postMessage({type:oi.FONT_ZOOM_OUT,data:yield jc.fontZoomOut(null==e?void 0:e.v)})})),[oi.UNPROJECT]:e=>p(t,null,(function*(){return self.postMessage({type:oi.UNPROJECT,data:yield jc.unproject(null==e?void 0:e.v)})})),[oi.STROKE_MORE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.STROKE_MORE,data:yield jc.strokeMore(null==e?void 0:e.v)})})),[oi.STROKE_LESS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.STROKE_LESS,data:yield jc.strokeLess(null==e?void 0:e.v)})})),[oi.UPDATE_LAYERS_VISIBILITY]:function(t){jc.updateLayersVisibility(null==t?void 0:t.ids,null==t?void 0:t.visible)},getLayers:function(t){return p(this,null,(function*(){const e=yield jc.getLayers(null==t?void 0:t.lv);self.postMessage({type:oi.GET_LAYERS,data:e})}))},[oi.FOCUS_AT_IDS]:function(t){return p(this,null,(function*(){const e=yield jc.focusAtIds(null==t?void 0:t.ids,null==t?void 0:t.padding);self.postMessage({type:oi.FOCUS_AT_IDS,data:e})}))},[oi.CLEAR_SELECTED]:function(t){return p(this,null,(function*(){const e=yield jc.clearSelected(null==t?void 0:t.data);self.postMessage({type:oi.CLEAR_SELECTED,data:e})}))},[oi.TARGET_BY_IDS]:function(t){return p(this,null,(function*(){const e=yield jc.targetByIds(null==t?void 0:t.ids);self.postMessage({type:oi.TARGET_BY_IDS,data:e})}))},[oi.GET_ASSET_IDS_BY_TYPE]:function(t){return p(this,null,(function*(){const e=yield jc.getAssetIdsByType(null==t?void 0:t.assetType);self.postMessage({type:oi.GET_ASSET_IDS_BY_TYPE,data:e})}))},[oi.SET_FILL_BY_IDS]:function(t){return p(this,null,(function*(){const e=yield jc.setFillByIds(null==t?void 0:t.ids,null==t?void 0:t.c);self.postMessage({type:oi.SET_FILL_BY_IDS,data:e})}))},[oi.CLEAR_FILL_BY_IDS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.CLEAR_FILL_BY_IDS,data:yield jc.clearFillByIds(null==e?void 0:e.ids)})})),[oi.SET_STROKE_BY_IDS]:function(t){return p(this,null,(function*(){const e=yield jc.setStrokeByIds(null==t?void 0:t.ids,null==t?void 0:t.c);self.postMessage({type:oi.SET_STROKE_BY_IDS,data:e})}))},[oi.CLEAR_FILL]:function(t){return p(this,null,(function*(){const t=yield jc.clearFill();self.postMessage({type:oi.CLEAR_FILL,data:t})}))},[oi.CLEAR_STROKE]:function(t){return p(this,null,(function*(){const t=yield jc.clearStroke();self.postMessage({type:oi.CLEAR_STROKE,data:t})}))},[oi.GET_LEGEND]:()=>p(t,null,(function*(){return self.postMessage({type:oi.GET_LEGEND,data:yield jc.getLegend()})})),[oi.GET_ASSET_LABELS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.GET_ASSET_LABELS,data:yield jc.getAssetLabels(null==e?void 0:e.assetType,null==e?void 0:e.id)})})),[oi.SET_ASSET_LABELS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_ASSET_LABELS,data:yield jc.setAssetLabels(null==e?void 0:e.id,null==e?void 0:e.labels)})})),[oi.CLEAR_ASSET_LABELS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.CLEAR_ASSET_LABELS,data:yield jc.clearAssetLabels(null==e?void 0:e.assetType)})})),[oi.SELECT_BY_IDS]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SELECT_BY_IDS,data:yield jc.selectByIds(null==e?void 0:e.ids)})})),[oi.GET_ASSET_BOUNDING_BOX]:e=>p(t,null,(function*(){return self.postMessage({type:oi.GET_ASSET_BOUNDING_BOX,data:yield jc.getAssetBoundingBox(null==e?void 0:e.id,null==e?void 0:e.isViewCoords)})})),[oi.SET_ASSET_TYPE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_ASSET_TYPE,data:yield jc.setAssetType(null==e?void 0:e.assetType,null==e?void 0:e.showLayers)})})),[oi.LINK_ASSETS_BY_TREE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.LINK_ASSETS_BY_TREE,data:yield jc.linkAssetsByTree(null==e?void 0:e.o)})})),[oi.CLEAR_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.CLEAR_DUMMIES,data:yield jc.clearDummies(null==e?void 0:e.aeTypes)})})),[oi.SET_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_DUMMIES,data:yield jc.setDummies(null==e?void 0:e.dummies)})})),[oi.FOCUS_AT_DUMMY]:e=>p(t,null,(function*(){return self.postMessage({type:oi.FOCUS_AT_DUMMY,data:yield jc.focusAtDummy(null==e?void 0:e.id,null==e?void 0:e.padding)})})),[oi.HIGHLIGHT_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.HIGHLIGHT_DUMMIES,data:yield jc.highlightDummies(null==e?void 0:e.ids)})})),[oi.RESET_HIGHLIGHT_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.RESET_HIGHLIGHT_DUMMIES,data:yield jc.resetHighlightDummies()})})),[oi.SET_EDITOR_MODE]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_EDITOR_MODE,data:yield jc.setEditorMode(null==e?void 0:e.mode)})})),[oi.BIND_EDITOR_DRAG]:e=>p(t,null,(function*(){return self.postMessage({type:oi.BIND_EDITOR_DRAG,data:yield jc.bindEditorDrag(null==e?void 0:e.vo)})})),[oi.SET_EDITOR_DRAGGING_OBJECT]:e=>p(t,null,(function*(){return self.postMessage({type:oi.SET_EDITOR_DRAGGING_OBJECT,data:yield jc.setEditorDraggingObject(null==e?void 0:e.vo)})})),[oi.GET_DUMMIES]:e=>p(t,null,(function*(){return self.postMessage({type:oi.GET_DUMMIES,data:yield jc.getDummies(null==e?void 0:e.hasBound)})}))};self.onmessage=function(t){var e,i;const n=Jc[null==(e=t.data)?void 0:e.type];if("function"!=typeof n)throw new Error(`unsupported command: ${null==(i=t.data)?void 0:i.type}`);n(t.data)}}},function(){return e||(0,t[r(t)[0]])((e={exports:{}}).exports,e),e.exports});export default f();