@netless/app-slide 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs.js +34 -34
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +2 -1
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +19 -19
- package/dist/main.iife.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
package/dist/main.cjs.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";var OP=Object.defineProperty;var PT=Object.getOwnPropertySymbols;var DP=Object.prototype.hasOwnProperty,NP=Object.prototype.propertyIsEnumerable;var CT=(
|
|
1
|
+
"use strict";var OP=Object.defineProperty;var PT=Object.getOwnPropertySymbols;var DP=Object.prototype.hasOwnProperty,NP=Object.prototype.propertyIsEnumerable;var CT=(C,L,v)=>L in C?OP(C,L,{enumerable:!0,configurable:!0,writable:!0,value:v}):C[L]=v,RT=(C,L)=>{for(var v in L||(L={}))DP.call(L,v)&&CT(C,v,L[v]);if(PT)for(var v of PT(L))NP.call(L,v)&&CT(C,v,L[v]);return C};Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var jr=function(C){var L={};function v(b){if(L[b])return L[b].exports;var q=L[b]={i:b,l:!1,exports:{}};return C[b].call(q.exports,q,q.exports,v),q.l=!0,q.exports}return v.m=C,v.c=L,v.d=function(b,q,B){v.o(b,q)||Object.defineProperty(b,q,{enumerable:!0,get:B})},v.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},v.t=function(b,q){if(1&q&&(b=v(b)),8&q||4&q&&typeof b=="object"&&b&&b.__esModule)return b;var B=Object.create(null);if(v.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:b}),2&q&&typeof b!="string")for(var ie in b)v.d(B,ie,function(k){return b[k]}.bind(null,ie));return B},v.n=function(b){var q=b&&b.__esModule?function(){return b.default}:function(){return b};return v.d(q,"a",q),q},v.o=function(b,q){return Object.prototype.hasOwnProperty.call(b,q)},v.p="",v(v.s=27)}([function(C,L,v){var b=Object.prototype.hasOwnProperty,q="~";function B(){}function ie(K,le,Ee){this.fn=K,this.context=le,this.once=Ee||!1}function k(K,le,Ee,Xe,Fe){if(typeof Ee!="function")throw new TypeError("The listener must be a function");var S=new ie(Ee,Xe||K,Fe),A=q?q+le:le;return K._events[A]?K._events[A].fn?K._events[A]=[K._events[A],S]:K._events[A].push(S):(K._events[A]=S,K._eventsCount++),K}function oe(K,le){--K._eventsCount==0?K._events=new B:delete K._events[le]}function X(){this._events=new B,this._eventsCount=0}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(q=!1)),X.prototype.eventNames=function(){var K,le,Ee=[];if(this._eventsCount===0)return Ee;for(le in K=this._events)b.call(K,le)&&Ee.push(q?le.slice(1):le);return Object.getOwnPropertySymbols?Ee.concat(Object.getOwnPropertySymbols(K)):Ee},X.prototype.listeners=function(K){var le=q?q+K:K,Ee=this._events[le];if(!Ee)return[];if(Ee.fn)return[Ee.fn];for(var Xe=0,Fe=Ee.length,S=new Array(Fe);Xe<Fe;Xe++)S[Xe]=Ee[Xe].fn;return S},X.prototype.listenerCount=function(K){var le=q?q+K:K,Ee=this._events[le];return Ee?Ee.fn?1:Ee.length:0},X.prototype.emit=function(K,le,Ee,Xe,Fe,S){var A=q?q+K:K;if(!this._events[A])return!1;var O,V,D=this._events[A],z=arguments.length;if(D.fn){switch(D.once&&this.removeListener(K,D.fn,void 0,!0),z){case 1:return D.fn.call(D.context),!0;case 2:return D.fn.call(D.context,le),!0;case 3:return D.fn.call(D.context,le,Ee),!0;case 4:return D.fn.call(D.context,le,Ee,Xe),!0;case 5:return D.fn.call(D.context,le,Ee,Xe,Fe),!0;case 6:return D.fn.call(D.context,le,Ee,Xe,Fe,S),!0}for(V=1,O=new Array(z-1);V<z;V++)O[V-1]=arguments[V];D.fn.apply(D.context,O)}else{var W,ee=D.length;for(V=0;V<ee;V++)switch(D[V].once&&this.removeListener(K,D[V].fn,void 0,!0),z){case 1:D[V].fn.call(D[V].context);break;case 2:D[V].fn.call(D[V].context,le);break;case 3:D[V].fn.call(D[V].context,le,Ee);break;case 4:D[V].fn.call(D[V].context,le,Ee,Xe);break;default:if(!O)for(W=1,O=new Array(z-1);W<z;W++)O[W-1]=arguments[W];D[V].fn.apply(D[V].context,O)}}return!0},X.prototype.on=function(K,le,Ee){return k(this,K,le,Ee,!1)},X.prototype.once=function(K,le,Ee){return k(this,K,le,Ee,!0)},X.prototype.removeListener=function(K,le,Ee,Xe){var Fe=q?q+K:K;if(!this._events[Fe])return this;if(!le)return oe(this,Fe),this;var S=this._events[Fe];if(S.fn)S.fn!==le||Xe&&!S.once||Ee&&S.context!==Ee||oe(this,Fe);else{for(var A=0,O=[],V=S.length;A<V;A++)(S[A].fn!==le||Xe&&!S[A].once||Ee&&S[A].context!==Ee)&&O.push(S[A]);O.length?this._events[Fe]=O.length===1?O[0]:O:oe(this,Fe)}return this},X.prototype.removeAllListeners=function(K){var le;return K?(le=q?q+K:K,this._events[le]&&oe(this,le)):(this._events=new B,this._eventsCount=0),this},X.prototype.off=X.prototype.removeListener,X.prototype.addListener=X.prototype.on,X.prefixed=q,X.EventEmitter=X,C.exports=X},function(C,L,v){(function(b,q){var B;/**
|
|
2
2
|
* @license
|
|
3
3
|
* Lodash <https://lodash.com/>
|
|
4
4
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
5
|
* Released under MIT license <https://lodash.com/license>
|
|
6
6
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
7
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
-
*/(function(){var ie="Expected a function",k="__lodash_placeholder__",oe=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],X="[object Arguments]",K="[object Array]",le="[object Boolean]",Ee="[object Date]",Xe="[object Error]",Fe="[object Function]",S="[object GeneratorFunction]",A="[object Map]",O="[object Number]",j="[object Object]",D="[object RegExp]",z="[object Set]",W="[object String]",ee="[object Symbol]",et="[object WeakMap]",ft="[object ArrayBuffer]",$e="[object DataView]",ae="[object Float32Array]",Ce="[object Float64Array]",Ie="[object Int8Array]",H="[object Int16Array]",be="[object Int32Array]",Me="[object Uint8Array]",Oe="[object Uint16Array]",Se="[object Uint32Array]",Ue=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,at=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rt=/&(?:amp|lt|gt|quot|#39);/g,Qt=/[&<>"']/g,lt=RegExp(rt.source),en=RegExp(Qt.source),Bt=/<%-([\s\S]+?)%>/g,Vt=/<%([\s\S]+?)%>/g,bt=/<%=([\s\S]+?)%>/g,Dn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wn=/^\w*$/,gn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qn=/[\\^$.*+?()[\]{}|]/g,yn=RegExp(qn.source),ai=/^\s+/,Fi=/\s/,Pi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vi=/\{\n\/\* \[wrapped with (.+)\] \*/,Rr=/,? & /,Mp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,rl=/[()=,{}\[\]\/\s]/,Ap=/\\(\\)?/g,Pp=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,uo=/\w*$/,Cp=/^[-+]0x[0-9a-f]+$/i,Rp=/^0b[01]+$/i,Ip=/^\[object .+?Constructor\]$/,Lp=/^0o[0-7]+$/i,Op=/^(?:0|[1-9]\d*)$/,Pu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ko=/($^)/,ol=/['\n\r\u2028\u2029\\]/g,sl="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",al="\\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",fa="[\\ud800-\\udfff]",ma="["+al+"]",Go="["+sl+"]",mi="\\d+",ll="[\\u2700-\\u27bf]",Zn="[a-z\\xdf-\\xf6\\xf8-\\xff]",ul="[^\\ud800-\\udfff"+al+mi+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fc="\\ud83c[\\udffb-\\udfff]",hl="[^\\ud800-\\udfff]",mc="(?:\\ud83c[\\udde6-\\uddff]){2}",Jn="[\\ud800-\\udbff][\\udc00-\\udfff]",Ho="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Dp="(?:"+Zn+"|"+ul+")",Ts="(?:"+Ho+"|"+ul+")",Np="(?:"+Go+"|"+fc+")?",zo="[\\ufe0e\\ufe0f]?"+Np+("(?:\\u200d(?:"+[hl,mc,Jn].join("|")+")[\\ufe0e\\ufe0f]?"+Np+")*"),Fp="(?:"+[ll,mc,Jn].join("|")+")"+zo,Bp="(?:"+[hl+Go+"?",Go,mc,Jn,fa].join("|")+")",cl=RegExp("['\u2019]","g"),Up=RegExp(Go,"g"),Ss=RegExp(fc+"(?="+fc+")|"+Bp+zo,"g"),ho=RegExp([Ho+"?"+Zn+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[ma,Ho,"$"].join("|")+")",Ts+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[ma,Ho+Dp,"$"].join("|")+")",Ho+"?"+Dp+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ho+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mi,Fp].join("|"),"g"),Es=RegExp("[\\u200d\\ud800-\\udfff"+sl+"\\ufe0e\\ufe0f]"),kp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gp=["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"],Hp=-1,dn={};dn[ae]=dn[Ce]=dn[Ie]=dn[H]=dn[be]=dn[Me]=dn["[object Uint8ClampedArray]"]=dn[Oe]=dn[Se]=!0,dn[X]=dn[K]=dn[ft]=dn[le]=dn[$e]=dn[Ee]=dn[Xe]=dn[Fe]=dn[A]=dn[O]=dn[j]=dn[D]=dn[z]=dn[W]=dn[et]=!1;var _n={};_n[X]=_n[K]=_n[ft]=_n[$e]=_n[le]=_n[Ee]=_n[ae]=_n[Ce]=_n[Ie]=_n[H]=_n[be]=_n[A]=_n[O]=_n[j]=_n[D]=_n[z]=_n[W]=_n[ee]=_n[Me]=_n["[object Uint8ClampedArray]"]=_n[Oe]=_n[Se]=!0,_n[Xe]=_n[Fe]=_n[et]=!1;var co={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},er=parseFloat,zp=parseInt,gc=typeof b=="object"&&b&&b.Object===Object&&b,Vp=typeof self=="object"&&self&&self.Object===Object&&self,Nn=gc||Vp||Function("return this")(),Ms=L&&!L.nodeType&&L,ga=Ms&&typeof q=="object"&&q&&!q.nodeType&&q,vc=ga&&ga.exports===Ms,Cu=vc&&gc.process,tr=function(){try{var we=ga&&ga.require&&ga.require("util").types;return we||Cu&&Cu.binding&&Cu.binding("util")}catch{}}(),_c=tr&&tr.isArrayBuffer,yc=tr&&tr.isDate,Ru=tr&&tr.isMap,Iu=tr&&tr.isRegExp,Lu=tr&&tr.isSet,Ou=tr&&tr.isTypedArray;function Bi(we,je,Ze){switch(Ze.length){case 0:return we.call(je);case 1:return we.call(je,Ze[0]);case 2:return we.call(je,Ze[0],Ze[1]);case 3:return we.call(je,Ze[0],Ze[1],Ze[2])}return we.apply(je,Ze)}function xc(we,je,Ze,ct){for(var wt=-1,$t=we==null?0:we.length;++wt<$t;){var zn=we[wt];je(ct,zn,Ze(zn),we)}return ct}function ji(we,je){for(var Ze=-1,ct=we==null?0:we.length;++Ze<ct&&je(we[Ze],Ze,we)!==!1;);return we}function bc(we,je){for(var Ze=we==null?0:we.length;Ze--&&je(we[Ze],Ze,we)!==!1;);return we}function wc(we,je){for(var Ze=-1,ct=we==null?0:we.length;++Ze<ct;)if(!je(we[Ze],Ze,we))return!1;return!0}function Wr(we,je){for(var Ze=-1,ct=we==null?0:we.length,wt=0,$t=[];++Ze<ct;){var zn=we[Ze];je(zn,Ze,we)&&($t[wt++]=zn)}return $t}function va(we,je){return!!(we==null?0:we.length)&&As(we,je,0)>-1}function Du(we,je,Ze){for(var ct=-1,wt=we==null?0:we.length;++ct<wt;)if(Ze(je,we[ct]))return!0;return!1}function Tn(we,je){for(var Ze=-1,ct=we==null?0:we.length,wt=Array(ct);++Ze<ct;)wt[Ze]=je(we[Ze],Ze,we);return wt}function po(we,je){for(var Ze=-1,ct=je.length,wt=we.length;++Ze<ct;)we[wt+Ze]=je[Ze];return we}function Nu(we,je,Ze,ct){var wt=-1,$t=we==null?0:we.length;for(ct&&$t&&(Ze=we[++wt]);++wt<$t;)Ze=je(Ze,we[wt],wt,we);return Ze}function jp(we,je,Ze,ct){var wt=we==null?0:we.length;for(ct&&wt&&(Ze=we[--wt]);wt--;)Ze=je(Ze,we[wt],wt,we);return Ze}function Fu(we,je){for(var Ze=-1,ct=we==null?0:we.length;++Ze<ct;)if(je(we[Ze],Ze,we))return!0;return!1}var Wp=Bu("length");function Tc(we,je,Ze){var ct;return Ze(we,function(wt,$t,zn){if(je(wt,$t,zn))return ct=$t,!1}),ct}function dl(we,je,Ze,ct){for(var wt=we.length,$t=Ze+(ct?1:-1);ct?$t--:++$t<wt;)if(je(we[$t],$t,we))return $t;return-1}function As(we,je,Ze){return je==je?function(ct,wt,$t){for(var zn=$t-1,nr=ct.length;++zn<nr;)if(ct[zn]===wt)return zn;return-1}(we,je,Ze):dl(we,Sc,Ze)}function Xp(we,je,Ze,ct){for(var wt=Ze-1,$t=we.length;++wt<$t;)if(ct(we[wt],je))return wt;return-1}function Sc(we){return we!=we}function Ec(we,je){var Ze=we==null?0:we.length;return Ze?ku(we,je)/Ze:NaN}function Bu(we){return function(je){return je==null?void 0:je[we]}}function Uu(we){return function(je){return we==null?void 0:we[je]}}function Mc(we,je,Ze,ct,wt){return wt(we,function($t,zn,nr){Ze=ct?(ct=!1,$t):je(Ze,$t,zn,nr)}),Ze}function ku(we,je){for(var Ze,ct=-1,wt=we.length;++ct<wt;){var $t=je(we[ct]);$t!==void 0&&(Ze=Ze===void 0?$t:Ze+$t)}return Ze}function Gu(we,je){for(var Ze=-1,ct=Array(we);++Ze<we;)ct[Ze]=je(Ze);return ct}function Ac(we){return we&&we.slice(0,jo(we)+1).replace(ai,"")}function Wi(we){return function(je){return we(je)}}function Hu(we,je){return Tn(je,function(Ze){return we[Ze]})}function _a(we,je){return we.has(je)}function Pc(we,je){for(var Ze=-1,ct=we.length;++Ze<ct&&As(je,we[Ze],0)>-1;);return Ze}function Cc(we,je){for(var Ze=we.length;Ze--&&As(je,we[Ze],0)>-1;);return Ze}function Yp(we,je){for(var Ze=we.length,ct=0;Ze--;)we[Ze]===je&&++ct;return ct}var qp=Uu({\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"}),Zp=Uu({"&":"&","<":"<",">":">",'"':""","'":"'"});function Jp(we){return"\\"+co[we]}function Ps(we){return Es.test(we)}function zu(we){var je=-1,Ze=Array(we.size);return we.forEach(function(ct,wt){Ze[++je]=[wt,ct]}),Ze}function Rc(we,je){return function(Ze){return we(je(Ze))}}function fo(we,je){for(var Ze=-1,ct=we.length,wt=0,$t=[];++Ze<ct;){var zn=we[Ze];zn!==je&&zn!==k||(we[Ze]=k,$t[wt++]=Ze)}return $t}function Vo(we){var je=-1,Ze=Array(we.size);return we.forEach(function(ct){Ze[++je]=ct}),Ze}function pl(we){var je=-1,Ze=Array(we.size);return we.forEach(function(ct){Ze[++je]=[ct,ct]}),Ze}function mo(we){return Ps(we)?function(je){for(var Ze=Ss.lastIndex=0;Ss.test(je);)++Ze;return Ze}(we):Wp(we)}function bi(we){return Ps(we)?function(je){return je.match(Ss)||[]}(we):function(je){return je.split("")}(we)}function jo(we){for(var je=we.length;je--&&Fi.test(we.charAt(je)););return je}var fl=Uu({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Cs=function we(je){var Ze,ct=(je=je==null?Nn:Cs.defaults(Nn.Object(),je,Cs.pick(Nn,Gp))).Array,wt=je.Date,$t=je.Error,zn=je.Function,nr=je.Math,xn=je.Object,ml=je.RegExp,Ic=je.String,Xi=je.TypeError,gl=ct.prototype,Lc=zn.prototype,pr=xn.prototype,vl=je["__core-js_shared__"],Vu=Lc.toString,un=pr.hasOwnProperty,xg=0,$p=(Ze=/[^.]+$/.exec(vl&&vl.keys&&vl.keys.IE_PROTO||""))?"Symbol(src)_1."+Ze:"",ju=pr.toString,bg=Vu.call(xn),wg=Nn._,Tg=ml("^"+Vu.call(un).replace(qn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wu=vc?je.Buffer:void 0,Wo=je.Symbol,Xu=je.Uint8Array,Kp=Wu?Wu.allocUnsafe:void 0,Yu=Rc(xn.getPrototypeOf,xn),Qp=xn.create,ef=pr.propertyIsEnumerable,_l=gl.splice,Rs=Wo?Wo.isConcatSpreadable:void 0,Xr=Wo?Wo.iterator:void 0,Is=Wo?Wo.toStringTag:void 0,qu=function(){try{var h=js(xn,"defineProperty");return h({},"",{}),h}catch{}}(),Sg=je.clearTimeout!==Nn.clearTimeout&&je.clearTimeout,Eg=wt&&wt.now!==Nn.Date.now&&wt.now,Mg=je.setTimeout!==Nn.setTimeout&&je.setTimeout,Zu=nr.ceil,Ju=nr.floor,Oc=xn.getOwnPropertySymbols,Dc=Wu?Wu.isBuffer:void 0,go=je.isFinite,wi=gl.join,$u=Rc(xn.keys,xn),Sn=nr.max,ni=nr.min,ir=wt.now,Ti=je.parseInt,Ku=nr.random,yl=gl.reverse,xl=js(je,"DataView"),ya=js(je,"Map"),Qu=js(je,"Promise"),Ls=js(je,"Set"),Qe=js(je,"WeakMap"),En=js(xn,"create"),vo=Qe&&new Qe,fr={},Ag=Qo(xl),$n=Qo(ya),Nc=Qo(Qu),pn=Qo(Ls),Ir=Qo(Qe),bl=Wo?Wo.prototype:void 0,Os=bl?bl.valueOf:void 0,gi=bl?bl.toString:void 0;function T(h){if(Un(h)&&!Ut(h)&&!(h instanceof Ht)){if(h instanceof In)return h;if(un.call(h,"__wrapped__"))return vf(h)}return new In(h)}var Xo=function(){function h(){}return function(p){if(!Bn(p))return{};if(Qp)return Qp(p);h.prototype=p;var x=new h;return h.prototype=void 0,x}}();function wl(){}function In(h,p){this.__wrapped__=h,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=void 0}function Ht(h){this.__wrapped__=h,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Lr(h){var p=-1,x=h==null?0:h.length;for(this.clear();++p<x;){var E=h[p];this.set(E[0],E[1])}}function Or(h){var p=-1,x=h==null?0:h.length;for(this.clear();++p<x;){var E=h[p];this.set(E[0],E[1])}}function Yi(h){var p=-1,x=h==null?0:h.length;for(this.clear();++p<x;){var E=h[p];this.set(E[0],E[1])}}function mr(h){var p=-1,x=h==null?0:h.length;for(this.__data__=new Yi;++p<x;)this.add(h[p])}function Ci(h){var p=this.__data__=new Or(h);this.size=p.size}function _o(h,p){var x=Ut(h),E=!x&&ts(h),P=!x&&!E&&So(h),V=!x&&!E&&!P&&Xs(h),re=x||E||P||V,ce=re?Gu(h.length,Ic):[],_e=ce.length;for(var He in h)!p&&!un.call(h,He)||re&&(He=="length"||P&&(He=="offset"||He=="parent")||V&&(He=="buffer"||He=="byteLength"||He=="byteOffset")||Ii(He,_e))||ce.push(He);return ce}function yo(h){var p=h.length;return p?h[Jo(0,p-1)]:void 0}function Ds(h,p){return ph(ui(h),xo(p,0,h.length))}function Tl(h){return ph(ui(h))}function xa(h,p,x){(x!==void 0&&!br(h[p],x)||x===void 0&&!(p in h))&&qr(h,p,x)}function Yo(h,p,x){var E=h[p];un.call(h,p)&&br(E,x)&&(x!==void 0||p in h)||qr(h,p,x)}function Yr(h,p){for(var x=h.length;x--;)if(br(h[x][0],p))return x;return-1}function Fc(h,p,x,E){return Ui(h,function(P,V,re){p(E,P,x(P),re)}),E}function tf(h,p){return h&&jn(p,ci(p),h)}function qr(h,p,x){p=="__proto__"&&qu?qu(h,p,{configurable:!0,enumerable:!0,value:x,writable:!0}):h[p]=x}function Sl(h,p){for(var x=-1,E=p.length,P=ct(E),V=h==null;++x<E;)P[x]=V?void 0:md(h,p[x]);return P}function xo(h,p,x){return h==h&&(x!==void 0&&(h=h<=x?h:x),p!==void 0&&(h=h>=p?h:p)),h}function li(h,p,x,E,P,V){var re,ce=1&p,_e=2&p,He=4&p;if(x&&(re=P?x(h,E,P,V):x(h)),re!==void 0)return re;if(!Bn(h))return h;var ze=Ut(h);if(ze){if(re=function(Je){var nt=Je.length,Et=new Je.constructor(nt);return nt&&typeof Je[0]=="string"&&un.call(Je,"index")&&(Et.index=Je.index,Et.input=Je.input),Et}(h),!ce)return ui(h,re)}else{var tt=hi(h),vt=tt==Fe||tt==S;if(So(h))return qc(h,ce);if(tt==j||tt==X||vt&&!P){if(re=_e||vt?{}:Qc(h),!ce)return _e?function(Je,nt){return jn(Je,Ws(Je),nt)}(h,function(Je,nt){return Je&&jn(nt,_i(nt),Je)}(re,h)):function(Je,nt){return jn(Je,yr(Je),nt)}(h,tf(re,h))}else{if(!_n[tt])return P?h:{};re=function(Je,nt,Et){var mt=Je.constructor;switch(nt){case ft:return Zc(Je);case le:case Ee:return new mt(+Je);case $e:return function(It,jt){var Tt=jt?Zc(It.buffer):It.buffer;return new It.constructor(Tt,It.byteOffset,It.byteLength)}(Je,Et);case ae:case Ce:case Ie:case H:case be:case Me:case"[object Uint8ClampedArray]":case Oe:case Se:return Us(Je,Et);case A:return new mt;case O:case W:return new mt(Je);case D:return function(It){var jt=new It.constructor(It.source,uo.exec(It));return jt.lastIndex=It.lastIndex,jt}(Je);case z:return new mt;case ee:return St=Je,Os?xn(Os.call(St)):{}}var St}(h,tt,ce)}}V||(V=new Ci);var yt=V.get(h);if(yt)return yt;V.set(h,re),Df(h)?h.forEach(function(Je){re.add(li(Je,p,x,Je,h,V))}):Of(h)&&h.forEach(function(Je,nt){re.set(nt,li(Je,p,x,nt,h,V))});var Ct=ze?void 0:(He?_e?zs:ki:_e?_i:ci)(h);return ji(Ct||h,function(Je,nt){Ct&&(Je=h[nt=Je]),Yo(re,nt,li(Je,p,x,nt,h,V))}),re}function Zr(h,p,x){var E=x.length;if(h==null)return!E;for(h=xn(h);E--;){var P=x[E],V=p[P],re=h[P];if(re===void 0&&!(P in h)||!V(re))return!1}return!0}function eh(h,p,x){if(typeof h!="function")throw new Xi(ie);return Ll(function(){h.apply(void 0,x)},p)}function qo(h,p,x,E){var P=-1,V=va,re=!0,ce=h.length,_e=[],He=p.length;if(!ce)return _e;x&&(p=Tn(p,Wi(x))),E?(V=Du,re=!1):p.length>=200&&(V=_a,re=!1,p=new mr(p));e:for(;++P<ce;){var ze=h[P],tt=x==null?ze:x(ze);if(ze=E||ze!==0?ze:0,re&&tt==tt){for(var vt=He;vt--;)if(p[vt]===tt)continue e;_e.push(ze)}else V(p,tt,E)||_e.push(ze)}return _e}T.templateSettings={escape:Bt,evaluate:Vt,interpolate:bt,variable:"",imports:{_:T}},T.prototype=wl.prototype,T.prototype.constructor=T,In.prototype=Xo(wl.prototype),In.prototype.constructor=In,Ht.prototype=Xo(wl.prototype),Ht.prototype.constructor=Ht,Lr.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Lr.prototype.delete=function(h){var p=this.has(h)&&delete this.__data__[h];return this.size-=p?1:0,p},Lr.prototype.get=function(h){var p=this.__data__;if(En){var x=p[h];return x==="__lodash_hash_undefined__"?void 0:x}return un.call(p,h)?p[h]:void 0},Lr.prototype.has=function(h){var p=this.__data__;return En?p[h]!==void 0:un.call(p,h)},Lr.prototype.set=function(h,p){var x=this.__data__;return this.size+=this.has(h)?0:1,x[h]=En&&p===void 0?"__lodash_hash_undefined__":p,this},Or.prototype.clear=function(){this.__data__=[],this.size=0},Or.prototype.delete=function(h){var p=this.__data__,x=Yr(p,h);return!(x<0)&&(x==p.length-1?p.pop():_l.call(p,x,1),--this.size,!0)},Or.prototype.get=function(h){var p=this.__data__,x=Yr(p,h);return x<0?void 0:p[x][1]},Or.prototype.has=function(h){return Yr(this.__data__,h)>-1},Or.prototype.set=function(h,p){var x=this.__data__,E=Yr(x,h);return E<0?(++this.size,x.push([h,p])):x[E][1]=p,this},Yi.prototype.clear=function(){this.size=0,this.__data__={hash:new Lr,map:new(ya||Or),string:new Lr}},Yi.prototype.delete=function(h){var p=Oa(this,h).delete(h);return this.size-=p?1:0,p},Yi.prototype.get=function(h){return Oa(this,h).get(h)},Yi.prototype.has=function(h){return Oa(this,h).has(h)},Yi.prototype.set=function(h,p){var x=Oa(this,h),E=x.size;return x.set(h,p),this.size+=x.size==E?0:1,this},mr.prototype.add=mr.prototype.push=function(h){return this.__data__.set(h,"__lodash_hash_undefined__"),this},mr.prototype.has=function(h){return this.__data__.has(h)},Ci.prototype.clear=function(){this.__data__=new Or,this.size=0},Ci.prototype.delete=function(h){var p=this.__data__,x=p.delete(h);return this.size=p.size,x},Ci.prototype.get=function(h){return this.__data__.get(h)},Ci.prototype.has=function(h){return this.__data__.has(h)},Ci.prototype.set=function(h,p){var x=this.__data__;if(x instanceof Or){var E=x.__data__;if(!ya||E.length<199)return E.push([h,p]),this.size=++x.size,this;x=this.__data__=new Yi(E)}return x.set(h,p),this.size=x.size,this};var Ui=Mt(Jr),th=Mt(Bc,!0);function nh(h,p){var x=!0;return Ui(h,function(E,P,V){return x=!!p(E,P,V)}),x}function ba(h,p,x){for(var E=-1,P=h.length;++E<P;){var V=h[E],re=p(V);if(re!=null&&(ce===void 0?re==re&&!lr(re):x(re,ce)))var ce=re,_e=V}return _e}function bo(h,p){var x=[];return Ui(h,function(E,P,V){p(E,P,V)&&x.push(E)}),x}function pt(h,p,x,E,P){var V=-1,re=h.length;for(x||(x=Pg),P||(P=[]);++V<re;){var ce=h[V];p>0&&x(ce)?p>1?pt(ce,p-1,x,E,P):po(P,ce):E||(P[P.length]=ce)}return P}var Zo=Jc(),gr=Jc(!0);function Jr(h,p){return h&&Zo(h,p,ci)}function Bc(h,p){return h&&gr(h,p,ci)}function Dr(h,p){return Wr(p,function(x){return Ur(h[x])})}function $r(h,p){for(var x=0,E=(p=Fr(p,h)).length;h!=null&&x<E;)h=h[xr(p[x++])];return x&&x==E?h:void 0}function qi(h,p,x){var E=p(h);return Ut(h)?E:po(E,x(h))}function Ri(h){return h==null?h===void 0?"[object Undefined]":"[object Null]":Is&&Is in xn(h)?function(p){var x=un.call(p,Is),E=p[Is];try{p[Is]=void 0;var P=!0}catch{}var V=ju.call(p);return P&&(x?p[Is]=E:delete p[Is]),V}(h):function(p){return ju.call(p)}(h)}function ih(h,p){return h>p}function Ns(h,p){return h!=null&&un.call(h,p)}function Uc(h,p){return h!=null&&p in xn(h)}function kc(h,p,x){for(var E=x?Du:va,P=h[0].length,V=h.length,re=V,ce=ct(V),_e=1/0,He=[];re--;){var ze=h[re];re&&p&&(ze=Tn(ze,Wi(p))),_e=ni(ze.length,_e),ce[re]=!x&&(p||P>=120&&ze.length>=120)?new mr(re&&ze):void 0}ze=h[0];var tt=-1,vt=ce[0];e:for(;++tt<P&&He.length<_e;){var yt=ze[tt],Ct=p?p(yt):yt;if(yt=x||yt!==0?yt:0,!(vt?_a(vt,Ct):E(He,Ct,x))){for(re=V;--re;){var Je=ce[re];if(!(Je?_a(Je,Ct):E(h[re],Ct,x)))continue e}vt&&vt.push(Ct),He.push(yt)}}return He}function wa(h,p,x){var E=(h=pf(h,p=Fr(p,h)))==null?h:h[xr(ar(p))];return E==null?void 0:Bi(E,h,x)}function Fs(h){return Un(h)&&Ri(h)==X}function rr(h,p,x,E,P){return h===p||(h==null||p==null||!Un(h)&&!Un(p)?h!=h&&p!=p:function(V,re,ce,_e,He,ze){var tt=Ut(V),vt=Ut(re),yt=tt?K:hi(V),Ct=vt?K:hi(re),Je=(yt=yt==X?j:yt)==j,nt=(Ct=Ct==X?j:Ct)==j,Et=yt==Ct;if(Et&&So(V)){if(!So(re))return!1;tt=!0,Je=!1}if(Et&&!Je)return ze||(ze=new Ci),tt||Xs(V)?Si(V,re,ce,_e,He,ze):function(Tt,Ot,Wn,Ei,Xn,kn,kr){switch(Wn){case $e:if(Tt.byteLength!=Ot.byteLength||Tt.byteOffset!=Ot.byteOffset)return!1;Tt=Tt.buffer,Ot=Ot.buffer;case ft:return!(Tt.byteLength!=Ot.byteLength||!kn(new Xu(Tt),new Xu(Ot)));case le:case Ee:case O:return br(+Tt,+Ot);case Xe:return Tt.name==Ot.name&&Tt.message==Ot.message;case D:case W:return Tt==Ot+"";case A:var no=zu;case z:var is=1&Ei;if(no||(no=Vo),Tt.size!=Ot.size&&!is)return!1;var za=kr.get(Tt);if(za)return za==Ot;Ei|=2,kr.set(Tt,Ot);var rs=Si(no(Tt),no(Ot),Ei,Xn,kn,kr);return kr.delete(Tt),rs;case ee:if(Os)return Os.call(Tt)==Os.call(Ot)}return!1}(V,re,yt,ce,_e,He,ze);if(!(1&ce)){var mt=Je&&un.call(V,"__wrapped__"),St=nt&&un.call(re,"__wrapped__");if(mt||St){var It=mt?V.value():V,jt=St?re.value():re;return ze||(ze=new Ci),He(It,jt,ce,_e,ze)}}return Et?(ze||(ze=new Ci),function(Tt,Ot,Wn,Ei,Xn,kn){var kr=1&Wn,no=ki(Tt),is=no.length,za=ki(Ot).length;if(is!=za&&!kr)return!1;for(var rs=is;rs--;){var io=no[rs];if(!(kr?io in Ot:un.call(Ot,io)))return!1}var Oh=kn.get(Tt),yd=kn.get(Ot);if(Oh&&yd)return Oh==Ot&&yd==Tt;var os=!0;kn.set(Tt,Ot),kn.set(Ot,Tt);for(var Ks=kr;++rs<is;){io=no[rs];var Qs=Tt[io],Va=Ot[io];if(Ei)var ja=kr?Ei(Va,Qs,io,Ot,Tt,kn):Ei(Qs,Va,io,Tt,Ot,kn);if(!(ja===void 0?Qs===Va||Xn(Qs,Va,Wn,Ei,kn):ja)){os=!1;break}Ks||(Ks=io=="constructor")}if(os&&!Ks){var Vl=Tt.constructor,ea=Ot.constructor;Vl==ea||!("constructor"in Tt)||!("constructor"in Ot)||typeof Vl=="function"&&Vl instanceof Vl&&typeof ea=="function"&&ea instanceof ea||(os=!1)}return kn.delete(Tt),kn.delete(Ot),os}(V,re,ce,_e,He,ze)):!1}(h,p,x,E,rr,P))}function Ta(h,p,x,E){var P=x.length,V=P,re=!E;if(h==null)return!V;for(h=xn(h);P--;){var ce=x[P];if(re&&ce[2]?ce[1]!==h[ce[0]]:!(ce[0]in h))return!1}for(;++P<V;){var _e=(ce=x[P])[0],He=h[_e],ze=ce[1];if(re&&ce[2]){if(He===void 0&&!(_e in h))return!1}else{var tt=new Ci;if(E)var vt=E(He,ze,_e,h,p,tt);if(!(vt===void 0?rr(ze,He,3,E,tt):vt))return!1}}return!0}function Sa(h){return!(!Bn(h)||(p=h,$p&&$p in p))&&(Ur(h)?Tg:Ip).test(Qo(h));var p}function nf(h){return typeof h=="function"?h:h==null?Hi:typeof h=="object"?Ut(h)?zc(h[0],h[1]):of(h):Xf(h)}function Gc(h){if(!Il(h))return $u(h);var p=[];for(var x in xn(h))un.call(h,x)&&x!="constructor"&&p.push(x);return p}function rf(h){if(!Bn(h))return function(P){var V=[];if(P!=null)for(var re in xn(P))V.push(re);return V}(h);var p=Il(h),x=[];for(var E in h)(E!="constructor"||!p&&un.call(h,E))&&x.push(E);return x}function rh(h,p){return h<p}function Hc(h,p){var x=-1,E=Zi(h)?ct(h.length):[];return Ui(h,function(P,V,re){E[++x]=p(P,V,re)}),E}function of(h){var p=Kc(h);return p.length==1&&p[0][2]?cf(p[0][0],p[0][1]):function(x){return x===h||Ta(x,h,p)}}function zc(h,p){return dt(h)&&hf(p)?cf(xr(h),p):function(x){var E=md(x,h);return E===void 0&&E===p?Nl(x,h):rr(p,E,3)}}function Xt(h,p,x,E,P){h!==p&&Zo(p,function(V,re){if(P||(P=new Ci),Bn(V))(function(_e,He,ze,tt,vt,yt,Ct){var Je=ed(_e,ze),nt=ed(He,ze),Et=Ct.get(nt);if(Et)return void xa(_e,ze,Et);var mt=yt?yt(Je,nt,ze+"",_e,He,Ct):void 0,St=mt===void 0;if(St){var It=Ut(nt),jt=!It&&So(nt),Tt=!It&&!jt&&Xs(nt);mt=nt,It||jt||Tt?Ut(Je)?mt=Je:An(Je)?mt=ui(Je):jt?(St=!1,mt=qc(nt,!0)):Tt?(St=!1,mt=Us(nt,!0)):mt=[]:Fa(nt)||ts(nt)?(mt=Je,ts(Je)?mt=Uf(Je):Bn(Je)&&!Ur(Je)||(mt=Qc(nt))):St=!1}St&&(Ct.set(nt,mt),vt(mt,nt,tt,yt,Ct),Ct.delete(nt)),xa(_e,ze,mt)})(h,p,re,x,Xt,E,P);else{var ce=E?E(ed(h,re),V,re+"",h,p,P):void 0;ce===void 0&&(ce=V),xa(h,re,ce)}},_i)}function vr(h,p){var x=h.length;if(x)return Ii(p+=p<0?x:0,x)?h[p]:void 0}function Kr(h,p,x){p=p.length?Tn(p,function(P){return Ut(P)?function(V){return $r(V,P.length===1?P[0]:P)}:P}):[Hi];var E=-1;return p=Tn(p,Wi(Pt())),function(P,V){var re=P.length;for(P.sort(V);re--;)P[re]=P[re].value;return P}(Hc(h,function(P,V,re){return{criteria:Tn(p,function(ce){return ce(P)}),index:++E,value:P}}),function(P,V){return function(re,ce,_e){for(var He=-1,ze=re.criteria,tt=ce.criteria,vt=ze.length,yt=_e.length;++He<vt;){var Ct=uf(ze[He],tt[He]);if(Ct){if(He>=yt)return Ct;var Je=_e[He];return Ct*(Je=="desc"?-1:1)}}return re.index-ce.index}(P,V,x)})}function oh(h,p,x){for(var E=-1,P=p.length,V={};++E<P;){var re=p[E],ce=$r(h,re);x(ce,re)&&Mn(V,Fr(re,h),ce)}return V}function Nr(h,p,x,E){var P=E?Xp:As,V=-1,re=p.length,ce=h;for(h===p&&(p=ui(p)),x&&(ce=Tn(h,Wi(x)));++V<re;)for(var _e=0,He=p[V],ze=x?x(He):He;(_e=P(ce,ze,_e,E))>-1;)ce!==h&&_l.call(ce,_e,1),_l.call(h,_e,1);return h}function Bs(h,p){for(var x=h?p.length:0,E=x-1;x--;){var P=p[x];if(x==E||P!==V){var V=P;Ii(P)?_l.call(h,P,1):Ma(h,P)}}return h}function Jo(h,p){return h+Ju(Ku()*(p-h+1))}function sh(h,p){var x="";if(!h||p<1||p>9007199254740991)return x;do p%2&&(x+=h),(p=Ju(p/2))&&(h+=h);while(p);return x}function Yt(h,p){return td(df(h,p,Hi),h+"")}function Vc(h){return yo(to(h))}function jc(h,p){var x=to(h);return ph(x,xo(p,0,x.length))}function Mn(h,p,x,E){if(!Bn(h))return h;for(var P=-1,V=(p=Fr(p,h)).length,re=V-1,ce=h;ce!=null&&++P<V;){var _e=xr(p[P]),He=x;if(_e==="__proto__"||_e==="constructor"||_e==="prototype")return h;if(P!=re){var ze=ce[_e];(He=E?E(ze,_e,ce):void 0)===void 0&&(He=Bn(ze)?ze:Ii(p[P+1])?[]:{})}Yo(ce,_e,He),ce=ce[_e]}return h}var sf=vo?function(h,p){return vo.set(h,p),h}:Hi,vi=qu?function(h,p){return qu(h,"toString",{configurable:!0,enumerable:!1,value:ka(p),writable:!0})}:Hi;function af(h){return ph(to(h))}function Vn(h,p,x){var E=-1,P=h.length;p<0&&(p=-p>P?0:P+p),(x=x>P?P:x)<0&&(x+=P),P=p>x?0:x-p>>>0,p>>>=0;for(var V=ct(P);++E<P;)V[E]=h[E+p];return V}function ah(h,p){var x;return Ui(h,function(E,P,V){return!(x=p(E,P,V))}),!!x}function Ea(h,p,x){var E=0,P=h==null?E:h.length;if(typeof p=="number"&&p==p&&P<=2147483647){for(;E<P;){var V=E+P>>>1,re=h[V];re!==null&&!lr(re)&&(x?re<=p:re<p)?E=V+1:P=V}return P}return El(h,p,Hi,x)}function El(h,p,x,E){var P=0,V=h==null?0:h.length;if(V===0)return 0;for(var re=(p=x(p))!=p,ce=p===null,_e=lr(p),He=p===void 0;P<V;){var ze=Ju((P+V)/2),tt=x(h[ze]),vt=tt!==void 0,yt=tt===null,Ct=tt==tt,Je=lr(tt);if(re)var nt=E||Ct;else nt=He?Ct&&(E||vt):ce?Ct&&vt&&(E||!yt):_e?Ct&&vt&&!yt&&(E||!Je):!yt&&!Je&&(E?tt<=p:tt<p);nt?P=ze+1:V=ze}return ni(V,4294967294)}function lh(h,p){for(var x=-1,E=h.length,P=0,V=[];++x<E;){var re=h[x],ce=p?p(re):re;if(!x||!br(ce,_e)){var _e=ce;V[P++]=re===0?0:re}}return V}function gt(h){return typeof h=="number"?h:lr(h)?NaN:+h}function Kn(h){if(typeof h=="string")return h;if(Ut(h))return Tn(h,Kn)+"";if(lr(h))return gi?gi.call(h):"";var p=h+"";return p=="0"&&1/h==-1/0?"-0":p}function an(h,p,x){var E=-1,P=va,V=h.length,re=!0,ce=[],_e=ce;if(x)re=!1,P=Du;else if(V>=200){var He=p?null:$c(h);if(He)return Vo(He);re=!1,P=_a,_e=new mr}else _e=p?[]:ce;e:for(;++E<V;){var ze=h[E],tt=p?p(ze):ze;if(ze=x||ze!==0?ze:0,re&&tt==tt){for(var vt=_e.length;vt--;)if(_e[vt]===tt)continue e;p&&_e.push(tt),ce.push(ze)}else P(_e,tt,x)||(_e!==ce&&_e.push(tt),ce.push(ze))}return ce}function Ma(h,p){return(h=pf(h,p=Fr(p,h)))==null||delete h[xr(ar(p))]}function Zt(h,p,x,E){return Mn(h,p,x($r(h,p)),E)}function Ml(h,p,x,E){for(var P=h.length,V=E?P:-1;(E?V--:++V<P)&&p(h[V],V,h););return x?Vn(h,E?0:V,E?V+1:P):Vn(h,E?V+1:0,E?P:V)}function Wc(h,p){var x=h;return x instanceof Ht&&(x=x.value()),Nu(p,function(E,P){return P.func.apply(P.thisArg,po([E],P.args))},x)}function uh(h,p,x){var E=h.length;if(E<2)return E?an(h[0]):[];for(var P=-1,V=ct(E);++P<E;)for(var re=h[P],ce=-1;++ce<E;)ce!=P&&(V[P]=qo(V[P]||re,h[ce],p,x));return an(pt(V,1),p,x)}function Xc(h,p,x){for(var E=-1,P=h.length,V=p.length,re={};++E<P;){var ce=E<V?p[E]:void 0;x(re,h[E],ce)}return re}function Aa(h){return An(h)?h:[]}function hh(h){return typeof h=="function"?h:Hi}function Fr(h,p){return Ut(h)?h:dt(h,p)?[h]:fh(on(h))}var lf=Yt;function st(h,p,x){var E=h.length;return x=x===void 0?E:x,!p&&x>=E?h:Vn(h,p,x)}var Yc=Sg||function(h){return Nn.clearTimeout(h)};function qc(h,p){if(p)return h.slice();var x=h.length,E=Kp?Kp(x):new h.constructor(x);return h.copy(E),E}function Zc(h){var p=new h.constructor(h.byteLength);return new Xu(p).set(new Xu(h)),p}function Us(h,p){var x=p?Zc(h.buffer):h.buffer;return new h.constructor(x,h.byteOffset,h.length)}function uf(h,p){if(h!==p){var x=h!==void 0,E=h===null,P=h==h,V=lr(h),re=p!==void 0,ce=p===null,_e=p==p,He=lr(p);if(!ce&&!He&&!V&&h>p||V&&re&&_e&&!ce&&!He||E&&re&&_e||!x&&_e||!P)return 1;if(!E&&!V&&!He&&h<p||He&&x&&P&&!E&&!V||ce&&x&&P||!re&&P||!_e)return-1}return 0}function or(h,p,x,E){for(var P=-1,V=h.length,re=x.length,ce=-1,_e=p.length,He=Sn(V-re,0),ze=ct(_e+He),tt=!E;++ce<_e;)ze[ce]=p[ce];for(;++P<re;)(tt||P<V)&&(ze[x[P]]=h[P]);for(;He--;)ze[ce++]=h[P++];return ze}function ch(h,p,x,E){for(var P=-1,V=h.length,re=-1,ce=x.length,_e=-1,He=p.length,ze=Sn(V-ce,0),tt=ct(ze+He),vt=!E;++P<ze;)tt[P]=h[P];for(var yt=P;++_e<He;)tt[yt+_e]=p[_e];for(;++re<ce;)(vt||P<V)&&(tt[yt+x[re]]=h[P++]);return tt}function ui(h,p){var x=-1,E=h.length;for(p||(p=ct(E));++x<E;)p[x]=h[x];return p}function jn(h,p,x,E){var P=!x;x||(x={});for(var V=-1,re=p.length;++V<re;){var ce=p[V],_e=E?E(x[ce],h[ce],ce,x,h):void 0;_e===void 0&&(_e=h[ce]),P?qr(x,ce,_e):Yo(x,ce,_e)}return x}function $o(h,p){return function(x,E){var P=Ut(x)?xc:Fc,V=p?p():{};return P(x,h,Pt(E,2),V)}}function Fn(h){return Yt(function(p,x){var E=-1,P=x.length,V=P>1?x[P-1]:void 0,re=P>2?x[2]:void 0;for(V=h.length>3&&typeof V=="function"?(P--,V):void 0,re&&Lt(x[0],x[1],re)&&(V=P<3?void 0:V,P=1),p=xn(p);++E<P;){var ce=x[E];ce&&h(p,ce,E,V)}return p})}function Mt(h,p){return function(x,E){if(x==null)return x;if(!Zi(x))return h(x,E);for(var P=x.length,V=p?P:-1,re=xn(x);(p?V--:++V<P)&&E(re[V],V,re)!==!1;);return x}}function Jc(h){return function(p,x,E){for(var P=-1,V=xn(p),re=E(p),ce=re.length;ce--;){var _e=re[h?ce:++P];if(x(V[_e],_e,V)===!1)break}return p}}function ks(h){return function(p){var x=Ps(p=on(p))?bi(p):void 0,E=x?x[0]:p.charAt(0),P=x?st(x,1).join(""):p.slice(1);return E[h]()+P}}function Ko(h){return function(p){return Nu(gd($s(p).replace(cl,"")),h,"")}}function _r(h){return function(){var p=arguments;switch(p.length){case 0:return new h;case 1:return new h(p[0]);case 2:return new h(p[0],p[1]);case 3:return new h(p[0],p[1],p[2]);case 4:return new h(p[0],p[1],p[2],p[3]);case 5:return new h(p[0],p[1],p[2],p[3],p[4]);case 6:return new h(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new h(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var x=Xo(h.prototype),E=h.apply(x,p);return Bn(E)?E:x}}function wo(h){return function(p,x,E){var P=xn(p);if(!Zi(p)){var V=Pt(x,3);p=ci(p),x=function(ce){return V(P[ce],ce,P)}}var re=h(p,x,E);return re>-1?P[V?p[re]:re]:void 0}}function To(h){return eo(function(p){var x=p.length,E=x,P=In.prototype.thru;for(h&&p.reverse();E--;){var V=p[E];if(typeof V!="function")throw new Xi(ie);if(P&&!re&&Vs(V)=="wrapper")var re=new In([],!0)}for(E=re?E:x;++E<x;){var ce=Vs(V=p[E]),_e=ce=="wrapper"?Qn(V):void 0;re=_e&&sr(_e[0])&&_e[1]==424&&!_e[4].length&&_e[9]==1?re[Vs(_e[0])].apply(re,_e[3]):V.length==1&&sr(V)?re[ce]():re.thru(V)}return function(){var He=arguments,ze=He[0];if(re&&He.length==1&&Ut(ze))return re.plant(ze).value();for(var tt=0,vt=x?p[tt].apply(this,He):ze;++tt<x;)vt=p[tt].call(this,vt);return vt}})}function Pa(h,p,x,E,P,V,re,ce,_e,He){var ze=128&p,tt=1&p,vt=2&p,yt=24&p,Ct=512&p,Je=vt?void 0:_r(h);return function nt(){for(var Et=arguments.length,mt=ct(Et),St=Et;St--;)mt[St]=arguments[St];if(yt)var It=Br(nt),jt=Yp(mt,It);if(E&&(mt=or(mt,E,P,yt)),V&&(mt=ch(mt,V,re,yt)),Et-=jt,yt&&Et<He){var Tt=fo(mt,It);return Pl(h,p,Pa,nt.placeholder,x,mt,Tt,ce,_e,He-Et)}var Ot=tt?x:this,Wn=vt?Ot[h]:h;return Et=mt.length,ce?mt=Rg(mt,ce):Ct&&Et>1&&mt.reverse(),ze&&_e<Et&&(mt.length=_e),this&&this!==Nn&&this instanceof nt&&(Wn=Je||_r(Wn)),Wn.apply(Ot,mt)}}function dh(h,p){return function(x,E){return function(P,V,re,ce){return Jr(P,function(_e,He,ze){V(ce,re(_e),He,ze)}),ce}(x,h,p(E),{})}}function Ca(h,p){return function(x,E){var P;if(x===void 0&&E===void 0)return p;if(x!==void 0&&(P=x),E!==void 0){if(P===void 0)return E;typeof x=="string"||typeof E=="string"?(x=Kn(x),E=Kn(E)):(x=gt(x),E=gt(E)),P=h(x,E)}return P}}function Ra(h){return eo(function(p){return p=Tn(p,Wi(Pt())),Yt(function(x){var E=this;return h(p,function(P){return Bi(P,E,x)})})})}function Gs(h,p){var x=(p=p===void 0?" ":Kn(p)).length;if(x<2)return x?sh(p,h):p;var E=sh(p,Zu(h/mo(p)));return Ps(p)?st(bi(E),0,h).join(""):E.slice(0,h)}function Al(h){return function(p,x,E){return E&&typeof E!="number"&&Lt(p,x,E)&&(x=E=void 0),p=Eo(p),x===void 0?(x=p,p=0):x=Eo(x),function(P,V,re,ce){for(var _e=-1,He=Sn(Zu((V-P)/(re||1)),0),ze=ct(He);He--;)ze[ce?He:++_e]=P,P+=re;return ze}(p,x,E=E===void 0?p<x?1:-1:Eo(E),h)}}function Hs(h){return function(p,x){return typeof p=="string"&&typeof x=="string"||(p=ur(p),x=ur(x)),h(p,x)}}function Pl(h,p,x,E,P,V,re,ce,_e,He){var ze=8&p;p|=ze?32:64,4&(p&=~(ze?64:32))||(p&=-4);var tt=[h,p,P,ze?V:void 0,ze?re:void 0,ze?void 0:V,ze?void 0:re,ce,_e,He],vt=x.apply(void 0,tt);return sr(h)&&ff(vt,tt),vt.placeholder=E,mf(vt,h,p)}function Ia(h){var p=nr[h];return function(x,E){if(x=ur(x),(E=E==null?0:ni(qt(E),292))&&go(x)){var P=(on(x)+"e").split("e");return+((P=(on(p(P[0]+"e"+(+P[1]+E)))+"e").split("e"))[0]+"e"+(+P[1]-E))}return p(x)}}var $c=Ls&&1/Vo(new Ls([,-0]))[1]==1/0?function(h){return new Ls(h)}:Ga;function Cl(h){return function(p){var x=hi(p);return x==A?zu(p):x==z?pl(p):function(E,P){return Tn(P,function(V){return[V,E[V]]})}(p,h(p))}}function ln(h,p,x,E,P,V,re,ce){var _e=2&p;if(!_e&&typeof h!="function")throw new Xi(ie);var He=E?E.length:0;if(He||(p&=-97,E=P=void 0),re=re===void 0?re:Sn(qt(re),0),ce=ce===void 0?ce:qt(ce),He-=P?P.length:0,64&p){var ze=E,tt=P;E=P=void 0}var vt=_e?void 0:Qn(h),yt=[h,p,x,E,P,ze,tt,V,re,ce];if(vt&&function(Je,nt){var Et=Je[1],mt=nt[1],St=Et|mt,It=St<131,jt=mt==128&&Et==8||mt==128&&Et==256&&Je[7].length<=nt[8]||mt==384&&nt[7].length<=nt[8]&&Et==8;if(!It&&!jt)return Je;1&mt&&(Je[2]=nt[2],St|=1&Et?0:4);var Tt=nt[3];if(Tt){var Ot=Je[3];Je[3]=Ot?or(Ot,Tt,nt[4]):Tt,Je[4]=Ot?fo(Je[3],k):nt[4]}(Tt=nt[5])&&(Ot=Je[5],Je[5]=Ot?ch(Ot,Tt,nt[6]):Tt,Je[6]=Ot?fo(Je[5],k):nt[6]),(Tt=nt[7])&&(Je[7]=Tt),128&mt&&(Je[8]=Je[8]==null?nt[8]:ni(Je[8],nt[8])),Je[9]==null&&(Je[9]=nt[9]),Je[0]=nt[0],Je[1]=St}(yt,vt),h=yt[0],p=yt[1],x=yt[2],E=yt[3],P=yt[4],!(ce=yt[9]=yt[9]===void 0?_e?0:h.length:Sn(yt[9]-He,0))&&24&p&&(p&=-25),p&&p!=1)Ct=p==8||p==16?function(Je,nt,Et){var mt=_r(Je);return function St(){for(var It=arguments.length,jt=ct(It),Tt=It,Ot=Br(St);Tt--;)jt[Tt]=arguments[Tt];var Wn=It<3&&jt[0]!==Ot&&jt[It-1]!==Ot?[]:fo(jt,Ot);if((It-=Wn.length)<Et)return Pl(Je,nt,Pa,St.placeholder,void 0,jt,Wn,void 0,void 0,Et-It);var Ei=this&&this!==Nn&&this instanceof St?mt:Je;return Bi(Ei,this,jt)}}(h,p,ce):p!=32&&p!=33||P.length?Pa.apply(void 0,yt):function(Je,nt,Et,mt){var St=1&nt,It=_r(Je);return function jt(){for(var Tt=-1,Ot=arguments.length,Wn=-1,Ei=mt.length,Xn=ct(Ei+Ot),kn=this&&this!==Nn&&this instanceof jt?It:Je;++Wn<Ei;)Xn[Wn]=mt[Wn];for(;Ot--;)Xn[Wn++]=arguments[++Tt];return Bi(kn,St?Et:this,Xn)}}(h,p,x,E);else var Ct=function(Je,nt,Et){var mt=1&nt,St=_r(Je);return function It(){var jt=this&&this!==Nn&&this instanceof It?St:Je;return jt.apply(mt?Et:this,arguments)}}(h,p,x);return mf((vt?sf:ff)(Ct,yt),h,p)}function Rl(h,p,x,E){return h===void 0||br(h,pr[x])&&!un.call(E,x)?p:h}function Qr(h,p,x,E,P,V){return Bn(h)&&Bn(p)&&(V.set(p,h),Xt(h,p,void 0,Qr,V),V.delete(p)),h}function La(h){return Fa(h)?void 0:h}function Si(h,p,x,E,P,V){var re=1&x,ce=h.length,_e=p.length;if(ce!=_e&&!(re&&_e>ce))return!1;var He=V.get(h),ze=V.get(p);if(He&&ze)return He==p&&ze==h;var tt=-1,vt=!0,yt=2&x?new mr:void 0;for(V.set(h,p),V.set(p,h);++tt<ce;){var Ct=h[tt],Je=p[tt];if(E)var nt=re?E(Je,Ct,tt,p,h,V):E(Ct,Je,tt,h,p,V);if(nt!==void 0){if(nt)continue;vt=!1;break}if(yt){if(!Fu(p,function(Et,mt){if(!_a(yt,mt)&&(Ct===Et||P(Ct,Et,x,E,V)))return yt.push(mt)})){vt=!1;break}}else if(Ct!==Je&&!P(Ct,Je,x,E,V)){vt=!1;break}}return V.delete(h),V.delete(p),vt}function eo(h){return td(df(h,void 0,rd),h+"")}function ki(h){return qi(h,ci,yr)}function zs(h){return qi(h,_i,Ws)}var Qn=vo?function(h){return vo.get(h)}:Ga;function Vs(h){for(var p=h.name+"",x=fr[p],E=un.call(fr,p)?x.length:0;E--;){var P=x[E],V=P.func;if(V==null||V==h)return P.name}return p}function Br(h){return(un.call(T,"placeholder")?T:h).placeholder}function Pt(){var h=T.iteratee||Mh;return h=h===Mh?nf:h,arguments.length?h(arguments[0],arguments[1]):h}function Oa(h,p){var x,E,P=h.__data__;return((E=typeof(x=p))=="string"||E=="number"||E=="symbol"||E=="boolean"?x!=="__proto__":x===null)?P[typeof p=="string"?"string":"hash"]:P.map}function Kc(h){for(var p=ci(h),x=p.length;x--;){var E=p[x],P=h[E];p[x]=[E,P,hf(P)]}return p}function js(h,p){var x=function(E,P){return E==null?void 0:E[P]}(h,p);return Sa(x)?x:void 0}var yr=Oc?function(h){return h==null?[]:(h=xn(h),Wr(Oc(h),function(p){return ef.call(h,p)}))}:Rh,Ws=Oc?function(h){for(var p=[];h;)po(p,yr(h)),h=Yu(h);return p}:Rh,hi=Ri;function Da(h,p,x){for(var E=-1,P=(p=Fr(p,h)).length,V=!1;++E<P;){var re=xr(p[E]);if(!(V=h!=null&&x(h,re)))break;h=h[re]}return V||++E!=P?V:!!(P=h==null?0:h.length)&&yh(P)&&Ii(re,P)&&(Ut(h)||ts(h))}function Qc(h){return typeof h.constructor!="function"||Il(h)?{}:Xo(Yu(h))}function Pg(h){return Ut(h)||ts(h)||!!(Rs&&h&&h[Rs])}function Ii(h,p){var x=typeof h;return!!(p=p==null?9007199254740991:p)&&(x=="number"||x!="symbol"&&Op.test(h))&&h>-1&&h%1==0&&h<p}function Lt(h,p,x){if(!Bn(x))return!1;var E=typeof p;return!!(E=="number"?Zi(x)&&Ii(p,x.length):E=="string"&&p in x)&&br(x[p],h)}function dt(h,p){if(Ut(h))return!1;var x=typeof h;return!(x!="number"&&x!="symbol"&&x!="boolean"&&h!=null&&!lr(h))||wn.test(h)||!Dn.test(h)||p!=null&&h in xn(p)}function sr(h){var p=Vs(h),x=T[p];if(typeof x!="function"||!(p in Ht.prototype))return!1;if(h===x)return!0;var E=Qn(x);return!!E&&h===E[0]}(xl&&hi(new xl(new ArrayBuffer(1)))!=$e||ya&&hi(new ya)!=A||Qu&&hi(Qu.resolve())!="[object Promise]"||Ls&&hi(new Ls)!=z||Qe&&hi(new Qe)!=et)&&(hi=function(h){var p=Ri(h),x=p==j?h.constructor:void 0,E=x?Qo(x):"";if(E)switch(E){case Ag:return $e;case $n:return A;case Nc:return"[object Promise]";case pn:return z;case Ir:return et}return p});var Cg=vl?Ur:Ha;function Il(h){var p=h&&h.constructor;return h===(typeof p=="function"&&p.prototype||pr)}function hf(h){return h==h&&!Bn(h)}function cf(h,p){return function(x){return x!=null&&x[h]===p&&(p!==void 0||h in xn(x))}}function df(h,p,x){return p=Sn(p===void 0?h.length-1:p,0),function(){for(var E=arguments,P=-1,V=Sn(E.length-p,0),re=ct(V);++P<V;)re[P]=E[p+P];P=-1;for(var ce=ct(p+1);++P<p;)ce[P]=E[P];return ce[p]=x(re),Bi(h,this,ce)}}function pf(h,p){return p.length<2?h:$r(h,Vn(p,0,-1))}function Rg(h,p){for(var x=h.length,E=ni(p.length,x),P=ui(h);E--;){var V=p[E];h[E]=Ii(V,x)?P[V]:void 0}return h}function ed(h,p){if((p!=="constructor"||typeof h[p]!="function")&&p!="__proto__")return h[p]}var ff=gf(sf),Ll=Mg||function(h,p){return Nn.setTimeout(h,p)},td=gf(vi);function mf(h,p,x){var E=p+"";return td(h,function(P,V){var re=V.length;if(!re)return P;var ce=re-1;return V[ce]=(re>1?"& ":"")+V[ce],V=V.join(re>2?", ":" "),P.replace(Pi,`{
|
|
9
|
-
/* [wrapped with `+
|
|
10
|
-
`)}(E,function(P,V){return ji(oe,function(re){var ce="_."+re[0];V&re[1]&&!va(P,ce)&&P.push(ce)}),P.sort()}(function(P){var V=P.match(Vi);return V?V[1].split(Rr):[]}(E),x)))}function gf(h){var p=0,x=0;return function(){var E=ir(),P=16-(E-x);if(x=E,P>0){if(++p>=800)return arguments[0]}else p=0;return h.apply(void 0,arguments)}}function ph(h,p){var x=-1,E=h.length,P=E-1;for(p=p===void 0?E:p;++x<p;){var V=Jo(x,P),re=h[V];h[V]=h[x],h[x]=re}return h.length=p,h}var fh=function(h){var p=Ol(h,function(E){return x.size===500&&x.clear(),E}),x=p.cache;return p}(function(h){var p=[];return h.charCodeAt(0)===46&&p.push(""),h.replace(gn,function(x,E,P,V){p.push(P?V.replace(Ap,"$1"):E||x)}),p});function xr(h){if(typeof h=="string"||lr(h))return h;var p=h+"";return p=="0"&&1/h==-1/0?"-0":p}function Qo(h){if(h!=null){try{return Vu.call(h)}catch{}try{return h+""}catch{}}return""}function vf(h){if(h instanceof Ht)return h.clone();var p=new In(h.__wrapped__,h.__chain__);return p.__actions__=ui(h.__actions__),p.__index__=h.__index__,p.__values__=h.__values__,p}var Ig=Yt(function(h,p){return An(h)?qo(h,pt(p,1,An,!0)):[]}),_f=Yt(function(h,p){var x=ar(p);return An(x)&&(x=void 0),An(h)?qo(h,pt(p,1,An,!0),Pt(x,2)):[]}),yf=Yt(function(h,p){var x=ar(p);return An(x)&&(x=void 0),An(h)?qo(h,pt(p,1,An,!0),void 0,x):[]});function nd(h,p,x){var E=h==null?0:h.length;if(!E)return-1;var P=x==null?0:qt(x);return P<0&&(P=Sn(E+P,0)),dl(h,Pt(p,3),P)}function id(h,p,x){var E=h==null?0:h.length;if(!E)return-1;var P=E-1;return x!==void 0&&(P=qt(x),P=x<0?Sn(E+P,0):ni(P,E-1)),dl(h,Pt(p,3),P,!0)}function rd(h){return(h==null?0:h.length)?pt(h,1):[]}function od(h){return h&&h.length?h[0]:void 0}var Na=Yt(function(h){var p=Tn(h,Aa);return p.length&&p[0]===h[0]?kc(p):[]}),Gi=Yt(function(h){var p=ar(h),x=Tn(h,Aa);return p===ar(x)?p=void 0:x.pop(),x.length&&x[0]===h[0]?kc(x,Pt(p,2)):[]}),Li=Yt(function(h){var p=ar(h),x=Tn(h,Aa);return(p=typeof p=="function"?p:void 0)&&x.pop(),x.length&&x[0]===h[0]?kc(x,void 0,p):[]});function ar(h){var p=h==null?0:h.length;return p?h[p-1]:void 0}var Lg=Yt(xf);function xf(h,p){return h&&h.length&&p&&p.length?Nr(h,p):h}var Og=eo(function(h,p){var x=h==null?0:h.length,E=Sl(h,p);return Bs(h,Tn(p,function(P){return Ii(P,x)?+P:P}).sort(uf)),E});function sd(h){return h==null?h:yl.call(h)}var Dg=Yt(function(h){return an(pt(h,1,An,!0))}),Ng=Yt(function(h){var p=ar(h);return An(p)&&(p=void 0),an(pt(h,1,An,!0),Pt(p,2))}),Fg=Yt(function(h){var p=ar(h);return p=typeof p=="function"?p:void 0,an(pt(h,1,An,!0),void 0,p)});function ad(h){if(!h||!h.length)return[];var p=0;return h=Wr(h,function(x){if(An(x))return p=Sn(x.length,p),!0}),Gu(p,function(x){return Tn(h,Bu(x))})}function bf(h,p){if(!h||!h.length)return[];var x=ad(h);return p==null?x:Tn(x,function(E){return Bi(p,void 0,E)})}var Bg=Yt(function(h,p){return An(h)?qo(h,p):[]}),Ug=Yt(function(h){return uh(Wr(h,An))}),kg=Yt(function(h){var p=ar(h);return An(p)&&(p=void 0),uh(Wr(h,An),Pt(p,2))}),Gg=Yt(function(h){var p=ar(h);return p=typeof p=="function"?p:void 0,uh(Wr(h,An),void 0,p)}),Hg=Yt(ad),zg=Yt(function(h){var p=h.length,x=p>1?h[p-1]:void 0;return x=typeof x=="function"?(h.pop(),x):void 0,bf(h,x)});function wf(h){var p=T(h);return p.__chain__=!0,p}function mh(h,p){return p(h)}var Vg=eo(function(h){var p=h.length,x=p?h[0]:0,E=this.__wrapped__,P=function(V){return Sl(V,h)};return!(p>1||this.__actions__.length)&&E instanceof Ht&&Ii(x)?((E=E.slice(x,+x+(p?1:0))).__actions__.push({func:mh,args:[P],thisArg:void 0}),new In(E,this.__chain__).thru(function(V){return p&&!V.length&&V.push(void 0),V})):this.thru(P)}),jg=$o(function(h,p,x){un.call(h,x)?++h[x]:qr(h,x,1)}),Wg=wo(nd),Xg=wo(id);function Tf(h,p){return(Ut(h)?ji:Ui)(h,Pt(p,3))}function Sf(h,p){return(Ut(h)?bc:th)(h,Pt(p,3))}var Yg=$o(function(h,p,x){un.call(h,x)?h[x].push(p):qr(h,x,[p])}),qg=Yt(function(h,p,x){var E=-1,P=typeof p=="function",V=Zi(h)?ct(h.length):[];return Ui(h,function(re){V[++E]=P?Bi(p,re,x):wa(re,p,x)}),V}),Zg=$o(function(h,p,x){qr(h,x,p)});function gh(h,p){return(Ut(h)?Tn:Hc)(h,Pt(p,3))}var Jg=$o(function(h,p,x){h[x?0:1].push(p)},function(){return[[],[]]}),$g=Yt(function(h,p){if(h==null)return[];var x=p.length;return x>1&&Lt(h,p[0],p[1])?p=[]:x>2&&Lt(p[0],p[1],p[2])&&(p=[p[0]]),Kr(h,pt(p,1),[])}),vh=Eg||function(){return Nn.Date.now()};function Ef(h,p,x){return p=x?void 0:p,ln(h,128,void 0,void 0,void 0,void 0,p=h&&p==null?h.length:p)}function Mf(h,p){var x;if(typeof p!="function")throw new Xi(ie);return h=qt(h),function(){return--h>0&&(x=p.apply(this,arguments)),h<=1&&(p=void 0),x}}var ld=Yt(function(h,p,x){var E=1;if(x.length){var P=fo(x,Br(ld));E|=32}return ln(h,E,p,x,P)}),Af=Yt(function(h,p,x){var E=3;if(x.length){var P=fo(x,Br(Af));E|=32}return ln(p,E,h,x,P)});function Pf(h,p,x){var E,P,V,re,ce,_e,He=0,ze=!1,tt=!1,vt=!0;if(typeof h!="function")throw new Xi(ie);function yt(St){var It=E,jt=P;return E=P=void 0,He=St,re=h.apply(jt,It)}function Ct(St){return He=St,ce=Ll(nt,p),ze?yt(St):re}function Je(St){var It=St-_e;return _e===void 0||It>=p||It<0||tt&&St-He>=V}function nt(){var St=vh();if(Je(St))return Et(St);ce=Ll(nt,function(It){var jt=p-(It-_e);return tt?ni(jt,V-(It-He)):jt}(St))}function Et(St){return ce=void 0,vt&&E?yt(St):(E=P=void 0,re)}function mt(){var St=vh(),It=Je(St);if(E=arguments,P=this,_e=St,It){if(ce===void 0)return Ct(_e);if(tt)return Yc(ce),ce=Ll(nt,p),yt(_e)}return ce===void 0&&(ce=Ll(nt,p)),re}return p=ur(p)||0,Bn(x)&&(ze=!!x.leading,V=(tt="maxWait"in x)?Sn(ur(x.maxWait)||0,p):V,vt="trailing"in x?!!x.trailing:vt),mt.cancel=function(){ce!==void 0&&Yc(ce),He=0,E=_e=P=ce=void 0},mt.flush=function(){return ce===void 0?re:Et(vh())},mt}var Kg=Yt(function(h,p){return eh(h,1,p)}),Qg=Yt(function(h,p,x){return eh(h,ur(p)||0,x)});function Ol(h,p){if(typeof h!="function"||p!=null&&typeof p!="function")throw new Xi(ie);var x=function(){var E=arguments,P=p?p.apply(this,E):E[0],V=x.cache;if(V.has(P))return V.get(P);var re=h.apply(this,E);return x.cache=V.set(P,re)||V,re};return x.cache=new(Ol.Cache||Yi),x}function Dl(h){if(typeof h!="function")throw new Xi(ie);return function(){var p=arguments;switch(p.length){case 0:return!h.call(this);case 1:return!h.call(this,p[0]);case 2:return!h.call(this,p[0],p[1]);case 3:return!h.call(this,p[0],p[1],p[2])}return!h.apply(this,p)}}Ol.Cache=Yi;var ud=lf(function(h,p){var x=(p=p.length==1&&Ut(p[0])?Tn(p[0],Wi(Pt())):Tn(pt(p,1),Wi(Pt()))).length;return Yt(function(E){for(var P=-1,V=ni(E.length,x);++P<V;)E[P]=p[P].call(this,E[P]);return Bi(h,this,E)})}),_h=Yt(function(h,p){return ln(h,32,void 0,p,fo(p,Br(_h)))}),Cf=Yt(function(h,p){return ln(h,64,void 0,p,fo(p,Br(Cf)))}),es=eo(function(h,p){return ln(h,256,void 0,void 0,void 0,p)});function br(h,p){return h===p||h!=h&&p!=p}var ev=Hs(ih),Rf=Hs(function(h,p){return h>=p}),ts=Fs(function(){return arguments}())?Fs:function(h){return Un(h)&&un.call(h,"callee")&&!ef.call(h,"callee")},Ut=ct.isArray,tv=_c?Wi(_c):function(h){return Un(h)&&Ri(h)==ft};function Zi(h){return h!=null&&yh(h.length)&&!Ur(h)}function An(h){return Un(h)&&Zi(h)}var So=Dc||Ha,If=yc?Wi(yc):function(h){return Un(h)&&Ri(h)==Ee};function hd(h){if(!Un(h))return!1;var p=Ri(h);return p==Xe||p=="[object DOMException]"||typeof h.message=="string"&&typeof h.name=="string"&&!Fa(h)}function Ur(h){if(!Bn(h))return!1;var p=Ri(h);return p==Fe||p==S||p=="[object AsyncFunction]"||p=="[object Proxy]"}function Lf(h){return typeof h=="number"&&h==qt(h)}function yh(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=9007199254740991}function Bn(h){var p=typeof h;return h!=null&&(p=="object"||p=="function")}function Un(h){return h!=null&&typeof h=="object"}var Of=Ru?Wi(Ru):function(h){return Un(h)&&hi(h)==A};function cd(h){return typeof h=="number"||Un(h)&&Ri(h)==O}function Fa(h){if(!Un(h)||Ri(h)!=j)return!1;var p=Yu(h);if(p===null)return!0;var x=un.call(p,"constructor")&&p.constructor;return typeof x=="function"&&x instanceof x&&Vu.call(x)==bg}var dd=Iu?Wi(Iu):function(h){return Un(h)&&Ri(h)==D},Df=Lu?Wi(Lu):function(h){return Un(h)&&hi(h)==z};function xh(h){return typeof h=="string"||!Ut(h)&&Un(h)&&Ri(h)==W}function lr(h){return typeof h=="symbol"||Un(h)&&Ri(h)==ee}var Xs=Ou?Wi(Ou):function(h){return Un(h)&&yh(h.length)&&!!dn[Ri(h)]},Nf=Hs(rh),nv=Hs(function(h,p){return h<=p});function Ff(h){if(!h)return[];if(Zi(h))return xh(h)?bi(h):ui(h);if(Xr&&h[Xr])return function(x){for(var E,P=[];!(E=x.next()).done;)P.push(E.value);return P}(h[Xr]());var p=hi(h);return(p==A?zu:p==z?Vo:to)(h)}function Eo(h){return h?(h=ur(h))===1/0||h===-1/0?17976931348623157e292*(h<0?-1:1):h==h?h:0:h===0?h:0}function qt(h){var p=Eo(h),x=p%1;return p==p?x?p-x:p:0}function Bf(h){return h?xo(qt(h),0,4294967295):0}function ur(h){if(typeof h=="number")return h;if(lr(h))return NaN;if(Bn(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=Bn(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=Ac(h);var x=Rp.test(h);return x||Lp.test(h)?zp(h.slice(2),x?2:8):Cp.test(h)?NaN:+h}function Uf(h){return jn(h,_i(h))}function on(h){return h==null?"":Kn(h)}var bh=Fn(function(h,p){if(Il(p)||Zi(p))jn(p,ci(p),h);else for(var x in p)un.call(p,x)&&Yo(h,x,p[x])}),pd=Fn(function(h,p){jn(p,_i(p),h)}),wh=Fn(function(h,p,x,E){jn(p,_i(p),h,E)}),iv=Fn(function(h,p,x,E){jn(p,ci(p),h,E)}),kf=eo(Sl),fd=Yt(function(h,p){h=xn(h);var x=-1,E=p.length,P=E>2?p[2]:void 0;for(P&&Lt(p[0],p[1],P)&&(E=1);++x<E;)for(var V=p[x],re=_i(V),ce=-1,_e=re.length;++ce<_e;){var He=re[ce],ze=h[He];(ze===void 0||br(ze,pr[He])&&!un.call(h,He))&&(h[He]=V[He])}return h}),Ys=Yt(function(h){return h.push(void 0,Qr),Bi(Ba,void 0,h)});function md(h,p,x){var E=h==null?void 0:$r(h,p);return E===void 0?x:E}function Nl(h,p){return h!=null&&Da(h,p,Uc)}var rv=dh(function(h,p,x){p!=null&&typeof p.toString!="function"&&(p=ju.call(p)),h[p]=x},ka(Hi)),ov=dh(function(h,p,x){p!=null&&typeof p.toString!="function"&&(p=ju.call(p)),un.call(h,p)?h[p].push(x):h[p]=[x]},Pt),fn=Yt(wa);function ci(h){return Zi(h)?_o(h):Gc(h)}function _i(h){return Zi(h)?_o(h,!0):rf(h)}var Fl=Fn(function(h,p,x){Xt(h,p,x)}),Ba=Fn(function(h,p,x,E){Xt(h,p,x,E)}),qs=eo(function(h,p){var x={};if(h==null)return x;var E=!1;p=Tn(p,function(V){return V=Fr(V,h),E||(E=V.length>1),V}),jn(h,zs(h),x),E&&(x=li(x,7,La));for(var P=p.length;P--;)Ma(x,p[P]);return x}),ei=eo(function(h,p){return h==null?{}:function(x,E){return oh(x,E,function(P,V){return Nl(x,V)})}(h,p)});function Mo(h,p){if(h==null)return{};var x=Tn(zs(h),function(E){return[E]});return p=Pt(p),oh(h,x,function(E,P){return p(E,P[0])})}var Bl=Cl(ci),Zs=Cl(_i);function to(h){return h==null?[]:Hu(h,ci(h))}var Ua=Ko(function(h,p,x){return p=p.toLowerCase(),h+(x?Js(p):p)});function Js(h){return Gl(on(h).toLowerCase())}function $s(h){return(h=on(h))&&h.replace(Pu,qp).replace(Up,"")}var Ul=Ko(function(h,p,x){return h+(x?"-":"")+p.toLowerCase()}),Gf=Ko(function(h,p,x){return h+(x?" ":"")+p.toLowerCase()}),Th=ks("toLowerCase"),kl=Ko(function(h,p,x){return h+(x?"_":"")+p.toLowerCase()}),Sh=Ko(function(h,p,x){return h+(x?" ":"")+Gl(p)}),Hf=Ko(function(h,p,x){return h+(x?" ":"")+p.toUpperCase()}),Gl=ks("toUpperCase");function gd(h,p,x){return h=on(h),(p=x?void 0:p)===void 0?function(E){return kp.test(E)}(h)?function(E){return E.match(ho)||[]}(h):function(E){return E.match(Mp)||[]}(h):h.match(p)||[]}var Hl=Yt(function(h,p){try{return Bi(h,void 0,p)}catch(x){return hd(x)?x:new $t(x)}}),Eh=eo(function(h,p){return ji(p,function(x){x=xr(x),qr(h,x,ld(h[x],h))}),h});function ka(h){return function(){return h}}var zf=To(),Vf=To(!0);function Hi(h){return h}function Mh(h){return nf(typeof h=="function"?h:li(h,1))}var jf=Yt(function(h,p){return function(x){return wa(x,h,p)}}),sv=Yt(function(h,p){return function(x){return wa(h,x,p)}});function Ah(h,p,x){var E=ci(p),P=Dr(p,E);x!=null||Bn(p)&&(P.length||!E.length)||(x=p,p=h,h=this,P=Dr(p,ci(p)));var V=!(Bn(x)&&"chain"in x&&!x.chain),re=Ur(h);return ji(P,function(ce){var _e=p[ce];h[ce]=_e,re&&(h.prototype[ce]=function(){var He=this.__chain__;if(V||He){var ze=h(this.__wrapped__),tt=ze.__actions__=ui(this.__actions__);return tt.push({func:_e,args:arguments,thisArg:h}),ze.__chain__=He,ze}return _e.apply(h,po([this.value()],arguments))})}),h}function Ga(){}var Ph=Ra(Tn),ns=Ra(wc),Wf=Ra(Fu);function Xf(h){return dt(h)?Bu(xr(h)):function(p){return function(x){return $r(x,p)}}(h)}var Ch=Al(),Yf=Al(!0);function Rh(){return[]}function Ha(){return!1}var zl=Ca(function(h,p){return h+p},0),vd=Ia("ceil"),yi=Ca(function(h,p){return h/p},1),qf=Ia("floor"),Ih,Zf=Ca(function(h,p){return h*p},1),_d=Ia("round"),Lh=Ca(function(h,p){return h-p},0);return T.after=function(h,p){if(typeof p!="function")throw new Xi(ie);return h=qt(h),function(){if(--h<1)return p.apply(this,arguments)}},T.ary=Ef,T.assign=bh,T.assignIn=pd,T.assignInWith=wh,T.assignWith=iv,T.at=kf,T.before=Mf,T.bind=ld,T.bindAll=Eh,T.bindKey=Af,T.castArray=function(){if(!arguments.length)return[];var h=arguments[0];return Ut(h)?h:[h]},T.chain=wf,T.chunk=function(h,p,x){p=(x?Lt(h,p,x):p===void 0)?1:Sn(qt(p),0);var E=h==null?0:h.length;if(!E||p<1)return[];for(var P=0,V=0,re=ct(Zu(E/p));P<E;)re[V++]=Vn(h,P,P+=p);return re},T.compact=function(h){for(var p=-1,x=h==null?0:h.length,E=0,P=[];++p<x;){var V=h[p];V&&(P[E++]=V)}return P},T.concat=function(){var h=arguments.length;if(!h)return[];for(var p=ct(h-1),x=arguments[0],E=h;E--;)p[E-1]=arguments[E];return po(Ut(x)?ui(x):[x],pt(p,1))},T.cond=function(h){var p=h==null?0:h.length,x=Pt();return h=p?Tn(h,function(E){if(typeof E[1]!="function")throw new Xi(ie);return[x(E[0]),E[1]]}):[],Yt(function(E){for(var P=-1;++P<p;){var V=h[P];if(Bi(V[0],this,E))return Bi(V[1],this,E)}})},T.conforms=function(h){return function(p){var x=ci(p);return function(E){return Zr(E,p,x)}}(li(h,1))},T.constant=ka,T.countBy=jg,T.create=function(h,p){var x=Xo(h);return p==null?x:tf(x,p)},T.curry=function h(p,x,E){var P=ln(p,8,void 0,void 0,void 0,void 0,void 0,x=E?void 0:x);return P.placeholder=h.placeholder,P},T.curryRight=function h(p,x,E){var P=ln(p,16,void 0,void 0,void 0,void 0,void 0,x=E?void 0:x);return P.placeholder=h.placeholder,P},T.debounce=Pf,T.defaults=fd,T.defaultsDeep=Ys,T.defer=Kg,T.delay=Qg,T.difference=Ig,T.differenceBy=_f,T.differenceWith=yf,T.drop=function(h,p,x){var E=h==null?0:h.length;return E?Vn(h,(p=x||p===void 0?1:qt(p))<0?0:p,E):[]},T.dropRight=function(h,p,x){var E=h==null?0:h.length;return E?Vn(h,0,(p=E-(p=x||p===void 0?1:qt(p)))<0?0:p):[]},T.dropRightWhile=function(h,p){return h&&h.length?Ml(h,Pt(p,3),!0,!0):[]},T.dropWhile=function(h,p){return h&&h.length?Ml(h,Pt(p,3),!0):[]},T.fill=function(h,p,x,E){var P=h==null?0:h.length;return P?(x&&typeof x!="number"&&Lt(h,p,x)&&(x=0,E=P),function(V,re,ce,_e){var He=V.length;for((ce=qt(ce))<0&&(ce=-ce>He?0:He+ce),(_e=_e===void 0||_e>He?He:qt(_e))<0&&(_e+=He),_e=ce>_e?0:Bf(_e);ce<_e;)V[ce++]=re;return V}(h,p,x,E)):[]},T.filter=function(h,p){return(Ut(h)?Wr:bo)(h,Pt(p,3))},T.flatMap=function(h,p){return pt(gh(h,p),1)},T.flatMapDeep=function(h,p){return pt(gh(h,p),1/0)},T.flatMapDepth=function(h,p,x){return x=x===void 0?1:qt(x),pt(gh(h,p),x)},T.flatten=rd,T.flattenDeep=function(h){return(h==null?0:h.length)?pt(h,1/0):[]},T.flattenDepth=function(h,p){return(h==null?0:h.length)?pt(h,p=p===void 0?1:qt(p)):[]},T.flip=function(h){return ln(h,512)},T.flow=zf,T.flowRight=Vf,T.fromPairs=function(h){for(var p=-1,x=h==null?0:h.length,E={};++p<x;){var P=h[p];E[P[0]]=P[1]}return E},T.functions=function(h){return h==null?[]:Dr(h,ci(h))},T.functionsIn=function(h){return h==null?[]:Dr(h,_i(h))},T.groupBy=Yg,T.initial=function(h){return(h==null?0:h.length)?Vn(h,0,-1):[]},T.intersection=Na,T.intersectionBy=Gi,T.intersectionWith=Li,T.invert=rv,T.invertBy=ov,T.invokeMap=qg,T.iteratee=Mh,T.keyBy=Zg,T.keys=ci,T.keysIn=_i,T.map=gh,T.mapKeys=function(h,p){var x={};return p=Pt(p,3),Jr(h,function(E,P,V){qr(x,p(E,P,V),E)}),x},T.mapValues=function(h,p){var x={};return p=Pt(p,3),Jr(h,function(E,P,V){qr(x,P,p(E,P,V))}),x},T.matches=function(h){return of(li(h,1))},T.matchesProperty=function(h,p){return zc(h,li(p,1))},T.memoize=Ol,T.merge=Fl,T.mergeWith=Ba,T.method=jf,T.methodOf=sv,T.mixin=Ah,T.negate=Dl,T.nthArg=function(h){return h=qt(h),Yt(function(p){return vr(p,h)})},T.omit=qs,T.omitBy=function(h,p){return Mo(h,Dl(Pt(p)))},T.once=function(h){return Mf(2,h)},T.orderBy=function(h,p,x,E){return h==null?[]:(Ut(p)||(p=p==null?[]:[p]),Ut(x=E?void 0:x)||(x=x==null?[]:[x]),Kr(h,p,x))},T.over=Ph,T.overArgs=ud,T.overEvery=ns,T.overSome=Wf,T.partial=_h,T.partialRight=Cf,T.partition=Jg,T.pick=ei,T.pickBy=Mo,T.property=Xf,T.propertyOf=function(h){return function(p){return h==null?void 0:$r(h,p)}},T.pull=Lg,T.pullAll=xf,T.pullAllBy=function(h,p,x){return h&&h.length&&p&&p.length?Nr(h,p,Pt(x,2)):h},T.pullAllWith=function(h,p,x){return h&&h.length&&p&&p.length?Nr(h,p,void 0,x):h},T.pullAt=Og,T.range=Ch,T.rangeRight=Yf,T.rearg=es,T.reject=function(h,p){return(Ut(h)?Wr:bo)(h,Dl(Pt(p,3)))},T.remove=function(h,p){var x=[];if(!h||!h.length)return x;var E=-1,P=[],V=h.length;for(p=Pt(p,3);++E<V;){var re=h[E];p(re,E,h)&&(x.push(re),P.push(E))}return Bs(h,P),x},T.rest=function(h,p){if(typeof h!="function")throw new Xi(ie);return Yt(h,p=p===void 0?p:qt(p))},T.reverse=sd,T.sampleSize=function(h,p,x){return p=(x?Lt(h,p,x):p===void 0)?1:qt(p),(Ut(h)?Ds:jc)(h,p)},T.set=function(h,p,x){return h==null?h:Mn(h,p,x)},T.setWith=function(h,p,x,E){return E=typeof E=="function"?E:void 0,h==null?h:Mn(h,p,x,E)},T.shuffle=function(h){return(Ut(h)?Tl:af)(h)},T.slice=function(h,p,x){var E=h==null?0:h.length;return E?(x&&typeof x!="number"&&Lt(h,p,x)?(p=0,x=E):(p=p==null?0:qt(p),x=x===void 0?E:qt(x)),Vn(h,p,x)):[]},T.sortBy=$g,T.sortedUniq=function(h){return h&&h.length?lh(h):[]},T.sortedUniqBy=function(h,p){return h&&h.length?lh(h,Pt(p,2)):[]},T.split=function(h,p,x){return x&&typeof x!="number"&&Lt(h,p,x)&&(p=x=void 0),(x=x===void 0?4294967295:x>>>0)?(h=on(h))&&(typeof p=="string"||p!=null&&!dd(p))&&!(p=Kn(p))&&Ps(h)?st(bi(h),0,x):h.split(p,x):[]},T.spread=function(h,p){if(typeof h!="function")throw new Xi(ie);return p=p==null?0:Sn(qt(p),0),Yt(function(x){var E=x[p],P=st(x,0,p);return E&&po(P,E),Bi(h,this,P)})},T.tail=function(h){var p=h==null?0:h.length;return p?Vn(h,1,p):[]},T.take=function(h,p,x){return h&&h.length?Vn(h,0,(p=x||p===void 0?1:qt(p))<0?0:p):[]},T.takeRight=function(h,p,x){var E=h==null?0:h.length;return E?Vn(h,(p=E-(p=x||p===void 0?1:qt(p)))<0?0:p,E):[]},T.takeRightWhile=function(h,p){return h&&h.length?Ml(h,Pt(p,3),!1,!0):[]},T.takeWhile=function(h,p){return h&&h.length?Ml(h,Pt(p,3)):[]},T.tap=function(h,p){return p(h),h},T.throttle=function(h,p,x){var E=!0,P=!0;if(typeof h!="function")throw new Xi(ie);return Bn(x)&&(E="leading"in x?!!x.leading:E,P="trailing"in x?!!x.trailing:P),Pf(h,p,{leading:E,maxWait:p,trailing:P})},T.thru=mh,T.toArray=Ff,T.toPairs=Bl,T.toPairsIn=Zs,T.toPath=function(h){return Ut(h)?Tn(h,xr):lr(h)?[h]:ui(fh(on(h)))},T.toPlainObject=Uf,T.transform=function(h,p,x){var E=Ut(h),P=E||So(h)||Xs(h);if(p=Pt(p,4),x==null){var V=h&&h.constructor;x=P?E?new V:[]:Bn(h)&&Ur(V)?Xo(Yu(h)):{}}return(P?ji:Jr)(h,function(re,ce,_e){return p(x,re,ce,_e)}),x},T.unary=function(h){return Ef(h,1)},T.union=Dg,T.unionBy=Ng,T.unionWith=Fg,T.uniq=function(h){return h&&h.length?an(h):[]},T.uniqBy=function(h,p){return h&&h.length?an(h,Pt(p,2)):[]},T.uniqWith=function(h,p){return p=typeof p=="function"?p:void 0,h&&h.length?an(h,void 0,p):[]},T.unset=function(h,p){return h==null||Ma(h,p)},T.unzip=ad,T.unzipWith=bf,T.update=function(h,p,x){return h==null?h:Zt(h,p,hh(x))},T.updateWith=function(h,p,x,E){return E=typeof E=="function"?E:void 0,h==null?h:Zt(h,p,hh(x),E)},T.values=to,T.valuesIn=function(h){return h==null?[]:Hu(h,_i(h))},T.without=Bg,T.words=gd,T.wrap=function(h,p){return _h(hh(p),h)},T.xor=Ug,T.xorBy=kg,T.xorWith=Gg,T.zip=Hg,T.zipObject=function(h,p){return Xc(h||[],p||[],Yo)},T.zipObjectDeep=function(h,p){return Xc(h||[],p||[],Mn)},T.zipWith=zg,T.entries=Bl,T.entriesIn=Zs,T.extend=pd,T.extendWith=wh,Ah(T,T),T.add=zl,T.attempt=Hl,T.camelCase=Ua,T.capitalize=Js,T.ceil=vd,T.clamp=function(h,p,x){return x===void 0&&(x=p,p=void 0),x!==void 0&&(x=(x=ur(x))==x?x:0),p!==void 0&&(p=(p=ur(p))==p?p:0),xo(ur(h),p,x)},T.clone=function(h){return li(h,4)},T.cloneDeep=function(h){return li(h,5)},T.cloneDeepWith=function(h,p){return li(h,5,p=typeof p=="function"?p:void 0)},T.cloneWith=function(h,p){return li(h,4,p=typeof p=="function"?p:void 0)},T.conformsTo=function(h,p){return p==null||Zr(h,p,ci(p))},T.deburr=$s,T.defaultTo=function(h,p){return h==null||h!=h?p:h},T.divide=yi,T.endsWith=function(h,p,x){h=on(h),p=Kn(p);var E=h.length,P=x=x===void 0?E:xo(qt(x),0,E);return(x-=p.length)>=0&&h.slice(x,P)==p},T.eq=br,T.escape=function(h){return(h=on(h))&&en.test(h)?h.replace(Qt,Zp):h},T.escapeRegExp=function(h){return(h=on(h))&&yn.test(h)?h.replace(qn,"\\$&"):h},T.every=function(h,p,x){var E=Ut(h)?wc:nh;return x&&Lt(h,p,x)&&(p=void 0),E(h,Pt(p,3))},T.find=Wg,T.findIndex=nd,T.findKey=function(h,p){return Tc(h,Pt(p,3),Jr)},T.findLast=Xg,T.findLastIndex=id,T.findLastKey=function(h,p){return Tc(h,Pt(p,3),Bc)},T.floor=qf,T.forEach=Tf,T.forEachRight=Sf,T.forIn=function(h,p){return h==null?h:Zo(h,Pt(p,3),_i)},T.forInRight=function(h,p){return h==null?h:gr(h,Pt(p,3),_i)},T.forOwn=function(h,p){return h&&Jr(h,Pt(p,3))},T.forOwnRight=function(h,p){return h&&Bc(h,Pt(p,3))},T.get=md,T.gt=ev,T.gte=Rf,T.has=function(h,p){return h!=null&&Da(h,p,Ns)},T.hasIn=Nl,T.head=od,T.identity=Hi,T.includes=function(h,p,x,E){h=Zi(h)?h:to(h),x=x&&!E?qt(x):0;var P=h.length;return x<0&&(x=Sn(P+x,0)),xh(h)?x<=P&&h.indexOf(p,x)>-1:!!P&&As(h,p,x)>-1},T.indexOf=function(h,p,x){var E=h==null?0:h.length;if(!E)return-1;var P=x==null?0:qt(x);return P<0&&(P=Sn(E+P,0)),As(h,p,P)},T.inRange=function(h,p,x){return p=Eo(p),x===void 0?(x=p,p=0):x=Eo(x),function(E,P,V){return E>=ni(P,V)&&E<Sn(P,V)}(h=ur(h),p,x)},T.invoke=fn,T.isArguments=ts,T.isArray=Ut,T.isArrayBuffer=tv,T.isArrayLike=Zi,T.isArrayLikeObject=An,T.isBoolean=function(h){return h===!0||h===!1||Un(h)&&Ri(h)==le},T.isBuffer=So,T.isDate=If,T.isElement=function(h){return Un(h)&&h.nodeType===1&&!Fa(h)},T.isEmpty=function(h){if(h==null)return!0;if(Zi(h)&&(Ut(h)||typeof h=="string"||typeof h.splice=="function"||So(h)||Xs(h)||ts(h)))return!h.length;var p=hi(h);if(p==A||p==z)return!h.size;if(Il(h))return!Gc(h).length;for(var x in h)if(un.call(h,x))return!1;return!0},T.isEqual=function(h,p){return rr(h,p)},T.isEqualWith=function(h,p,x){var E=(x=typeof x=="function"?x:void 0)?x(h,p):void 0;return E===void 0?rr(h,p,void 0,x):!!E},T.isError=hd,T.isFinite=function(h){return typeof h=="number"&&go(h)},T.isFunction=Ur,T.isInteger=Lf,T.isLength=yh,T.isMap=Of,T.isMatch=function(h,p){return h===p||Ta(h,p,Kc(p))},T.isMatchWith=function(h,p,x){return x=typeof x=="function"?x:void 0,Ta(h,p,Kc(p),x)},T.isNaN=function(h){return cd(h)&&h!=+h},T.isNative=function(h){if(Cg(h))throw new $t("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sa(h)},T.isNil=function(h){return h==null},T.isNull=function(h){return h===null},T.isNumber=cd,T.isObject=Bn,T.isObjectLike=Un,T.isPlainObject=Fa,T.isRegExp=dd,T.isSafeInteger=function(h){return Lf(h)&&h>=-9007199254740991&&h<=9007199254740991},T.isSet=Df,T.isString=xh,T.isSymbol=lr,T.isTypedArray=Xs,T.isUndefined=function(h){return h===void 0},T.isWeakMap=function(h){return Un(h)&&hi(h)==et},T.isWeakSet=function(h){return Un(h)&&Ri(h)=="[object WeakSet]"},T.join=function(h,p){return h==null?"":wi.call(h,p)},T.kebabCase=Ul,T.last=ar,T.lastIndexOf=function(h,p,x){var E=h==null?0:h.length;if(!E)return-1;var P=E;return x!==void 0&&(P=(P=qt(x))<0?Sn(E+P,0):ni(P,E-1)),p==p?function(V,re,ce){for(var _e=ce+1;_e--;)if(V[_e]===re)return _e;return _e}(h,p,P):dl(h,Sc,P,!0)},T.lowerCase=Gf,T.lowerFirst=Th,T.lt=Nf,T.lte=nv,T.max=function(h){return h&&h.length?ba(h,Hi,ih):void 0},T.maxBy=function(h,p){return h&&h.length?ba(h,Pt(p,2),ih):void 0},T.mean=function(h){return Ec(h,Hi)},T.meanBy=function(h,p){return Ec(h,Pt(p,2))},T.min=function(h){return h&&h.length?ba(h,Hi,rh):void 0},T.minBy=function(h,p){return h&&h.length?ba(h,Pt(p,2),rh):void 0},T.stubArray=Rh,T.stubFalse=Ha,T.stubObject=function(){return{}},T.stubString=function(){return""},T.stubTrue=function(){return!0},T.multiply=Zf,T.nth=function(h,p){return h&&h.length?vr(h,qt(p)):void 0},T.noConflict=function(){return Nn._===this&&(Nn._=wg),this},T.noop=Ga,T.now=vh,T.pad=function(h,p,x){h=on(h);var E=(p=qt(p))?mo(h):0;if(!p||E>=p)return h;var P=(p-E)/2;return Gs(Ju(P),x)+h+Gs(Zu(P),x)},T.padEnd=function(h,p,x){h=on(h);var E=(p=qt(p))?mo(h):0;return p&&E<p?h+Gs(p-E,x):h},T.padStart=function(h,p,x){h=on(h);var E=(p=qt(p))?mo(h):0;return p&&E<p?Gs(p-E,x)+h:h},T.parseInt=function(h,p,x){return x||p==null?p=0:p&&(p=+p),Ti(on(h).replace(ai,""),p||0)},T.random=function(h,p,x){if(x&&typeof x!="boolean"&&Lt(h,p,x)&&(p=x=void 0),x===void 0&&(typeof p=="boolean"?(x=p,p=void 0):typeof h=="boolean"&&(x=h,h=void 0)),h===void 0&&p===void 0?(h=0,p=1):(h=Eo(h),p===void 0?(p=h,h=0):p=Eo(p)),h>p){var E=h;h=p,p=E}if(x||h%1||p%1){var P=Ku();return ni(h+P*(p-h+er("1e-"+((P+"").length-1))),p)}return Jo(h,p)},T.reduce=function(h,p,x){var E=Ut(h)?Nu:Mc,P=arguments.length<3;return E(h,Pt(p,4),x,P,Ui)},T.reduceRight=function(h,p,x){var E=Ut(h)?jp:Mc,P=arguments.length<3;return E(h,Pt(p,4),x,P,th)},T.repeat=function(h,p,x){return p=(x?Lt(h,p,x):p===void 0)?1:qt(p),sh(on(h),p)},T.replace=function(){var h=arguments,p=on(h[0]);return h.length<3?p:p.replace(h[1],h[2])},T.result=function(h,p,x){var E=-1,P=(p=Fr(p,h)).length;for(P||(P=1,h=void 0);++E<P;){var V=h==null?void 0:h[xr(p[E])];V===void 0&&(E=P,V=x),h=Ur(V)?V.call(h):V}return h},T.round=_d,T.runInContext=we,T.sample=function(h){return(Ut(h)?yo:Vc)(h)},T.size=function(h){if(h==null)return 0;if(Zi(h))return xh(h)?mo(h):h.length;var p=hi(h);return p==A||p==z?h.size:Gc(h).length},T.snakeCase=kl,T.some=function(h,p,x){var E=Ut(h)?Fu:ah;return x&&Lt(h,p,x)&&(p=void 0),E(h,Pt(p,3))},T.sortedIndex=function(h,p){return Ea(h,p)},T.sortedIndexBy=function(h,p,x){return El(h,p,Pt(x,2))},T.sortedIndexOf=function(h,p){var x=h==null?0:h.length;if(x){var E=Ea(h,p);if(E<x&&br(h[E],p))return E}return-1},T.sortedLastIndex=function(h,p){return Ea(h,p,!0)},T.sortedLastIndexBy=function(h,p,x){return El(h,p,Pt(x,2),!0)},T.sortedLastIndexOf=function(h,p){if(h==null?0:h.length){var x=Ea(h,p,!0)-1;if(br(h[x],p))return x}return-1},T.startCase=Sh,T.startsWith=function(h,p,x){return h=on(h),x=x==null?0:xo(qt(x),0,h.length),p=Kn(p),h.slice(x,x+p.length)==p},T.subtract=Lh,T.sum=function(h){return h&&h.length?ku(h,Hi):0},T.sumBy=function(h,p){return h&&h.length?ku(h,Pt(p,2)):0},T.template=function(h,p,x){var E=T.templateSettings;x&&Lt(h,p,x)&&(p=void 0),h=on(h),p=wh({},p,E,Rl);var P,V,re=wh({},p.imports,E.imports,Rl),ce=ci(re),_e=Hu(re,ce),He=0,ze=p.interpolate||ko,tt="__p += '",vt=ml((p.escape||ko).source+"|"+ze.source+"|"+(ze===bt?Pp:ko).source+"|"+(p.evaluate||ko).source+"|$","g"),yt="//# sourceURL="+(un.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Hp+"]")+`
|
|
8
|
+
*/(function(){var ie="Expected a function",k="__lodash_placeholder__",oe=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],X="[object Arguments]",K="[object Array]",le="[object Boolean]",Ee="[object Date]",Xe="[object Error]",Fe="[object Function]",S="[object GeneratorFunction]",A="[object Map]",O="[object Number]",V="[object Object]",D="[object RegExp]",z="[object Set]",W="[object String]",ee="[object Symbol]",et="[object WeakMap]",ft="[object ArrayBuffer]",$e="[object DataView]",ae="[object Float32Array]",Ce="[object Float64Array]",Ie="[object Int8Array]",H="[object Int16Array]",be="[object Int32Array]",Me="[object Uint8Array]",Oe="[object Uint16Array]",Se="[object Uint32Array]",Ue=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,at=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rt=/&(?:amp|lt|gt|quot|#39);/g,Qt=/[&<>"']/g,lt=RegExp(rt.source),en=RegExp(Qt.source),Bt=/<%-([\s\S]+?)%>/g,Vt=/<%([\s\S]+?)%>/g,bt=/<%=([\s\S]+?)%>/g,Dn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wn=/^\w*$/,gn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qn=/[\\^$.*+?()[\]{}|]/g,yn=RegExp(qn.source),ai=/^\s+/,Fi=/\s/,Pi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vi=/\{\n\/\* \[wrapped with (.+)\] \*/,Rr=/,? & /,Mp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,rl=/[()=,{}\[\]\/\s]/,Ap=/\\(\\)?/g,Pp=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,uo=/\w*$/,Cp=/^[-+]0x[0-9a-f]+$/i,Rp=/^0b[01]+$/i,Ip=/^\[object .+?Constructor\]$/,Lp=/^0o[0-7]+$/i,Op=/^(?:0|[1-9]\d*)$/,Pu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ko=/($^)/,ol=/['\n\r\u2028\u2029\\]/g,sl="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",al="\\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",fa="[\\ud800-\\udfff]",ma="["+al+"]",Go="["+sl+"]",mi="\\d+",ll="[\\u2700-\\u27bf]",Zn="[a-z\\xdf-\\xf6\\xf8-\\xff]",ul="[^\\ud800-\\udfff"+al+mi+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fc="\\ud83c[\\udffb-\\udfff]",hl="[^\\ud800-\\udfff]",mc="(?:\\ud83c[\\udde6-\\uddff]){2}",Jn="[\\ud800-\\udbff][\\udc00-\\udfff]",Ho="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Dp="(?:"+Zn+"|"+ul+")",Ts="(?:"+Ho+"|"+ul+")",Np="(?:"+Go+"|"+fc+")?",zo="[\\ufe0e\\ufe0f]?"+Np+("(?:\\u200d(?:"+[hl,mc,Jn].join("|")+")[\\ufe0e\\ufe0f]?"+Np+")*"),Fp="(?:"+[ll,mc,Jn].join("|")+")"+zo,Bp="(?:"+[hl+Go+"?",Go,mc,Jn,fa].join("|")+")",cl=RegExp("['\u2019]","g"),Up=RegExp(Go,"g"),Ss=RegExp(fc+"(?="+fc+")|"+Bp+zo,"g"),ho=RegExp([Ho+"?"+Zn+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[ma,Ho,"$"].join("|")+")",Ts+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[ma,Ho+Dp,"$"].join("|")+")",Ho+"?"+Dp+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ho+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mi,Fp].join("|"),"g"),Es=RegExp("[\\u200d\\ud800-\\udfff"+sl+"\\ufe0e\\ufe0f]"),kp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gp=["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"],Hp=-1,dn={};dn[ae]=dn[Ce]=dn[Ie]=dn[H]=dn[be]=dn[Me]=dn["[object Uint8ClampedArray]"]=dn[Oe]=dn[Se]=!0,dn[X]=dn[K]=dn[ft]=dn[le]=dn[$e]=dn[Ee]=dn[Xe]=dn[Fe]=dn[A]=dn[O]=dn[V]=dn[D]=dn[z]=dn[W]=dn[et]=!1;var _n={};_n[X]=_n[K]=_n[ft]=_n[$e]=_n[le]=_n[Ee]=_n[ae]=_n[Ce]=_n[Ie]=_n[H]=_n[be]=_n[A]=_n[O]=_n[V]=_n[D]=_n[z]=_n[W]=_n[ee]=_n[Me]=_n["[object Uint8ClampedArray]"]=_n[Oe]=_n[Se]=!0,_n[Xe]=_n[Fe]=_n[et]=!1;var co={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},er=parseFloat,zp=parseInt,gc=typeof b=="object"&&b&&b.Object===Object&&b,Vp=typeof self=="object"&&self&&self.Object===Object&&self,Nn=gc||Vp||Function("return this")(),Ms=L&&!L.nodeType&&L,ga=Ms&&typeof q=="object"&&q&&!q.nodeType&&q,vc=ga&&ga.exports===Ms,Cu=vc&&gc.process,tr=function(){try{var we=ga&&ga.require&&ga.require("util").types;return we||Cu&&Cu.binding&&Cu.binding("util")}catch{}}(),_c=tr&&tr.isArrayBuffer,yc=tr&&tr.isDate,Ru=tr&&tr.isMap,Iu=tr&&tr.isRegExp,Lu=tr&&tr.isSet,Ou=tr&&tr.isTypedArray;function Bi(we,je,Ze){switch(Ze.length){case 0:return we.call(je);case 1:return we.call(je,Ze[0]);case 2:return we.call(je,Ze[0],Ze[1]);case 3:return we.call(je,Ze[0],Ze[1],Ze[2])}return we.apply(je,Ze)}function xc(we,je,Ze,ct){for(var wt=-1,$t=we==null?0:we.length;++wt<$t;){var zn=we[wt];je(ct,zn,Ze(zn),we)}return ct}function ji(we,je){for(var Ze=-1,ct=we==null?0:we.length;++Ze<ct&&je(we[Ze],Ze,we)!==!1;);return we}function bc(we,je){for(var Ze=we==null?0:we.length;Ze--&&je(we[Ze],Ze,we)!==!1;);return we}function wc(we,je){for(var Ze=-1,ct=we==null?0:we.length;++Ze<ct;)if(!je(we[Ze],Ze,we))return!1;return!0}function Wr(we,je){for(var Ze=-1,ct=we==null?0:we.length,wt=0,$t=[];++Ze<ct;){var zn=we[Ze];je(zn,Ze,we)&&($t[wt++]=zn)}return $t}function va(we,je){return!!(we==null?0:we.length)&&As(we,je,0)>-1}function Du(we,je,Ze){for(var ct=-1,wt=we==null?0:we.length;++ct<wt;)if(Ze(je,we[ct]))return!0;return!1}function Tn(we,je){for(var Ze=-1,ct=we==null?0:we.length,wt=Array(ct);++Ze<ct;)wt[Ze]=je(we[Ze],Ze,we);return wt}function po(we,je){for(var Ze=-1,ct=je.length,wt=we.length;++Ze<ct;)we[wt+Ze]=je[Ze];return we}function Nu(we,je,Ze,ct){var wt=-1,$t=we==null?0:we.length;for(ct&&$t&&(Ze=we[++wt]);++wt<$t;)Ze=je(Ze,we[wt],wt,we);return Ze}function jp(we,je,Ze,ct){var wt=we==null?0:we.length;for(ct&&wt&&(Ze=we[--wt]);wt--;)Ze=je(Ze,we[wt],wt,we);return Ze}function Fu(we,je){for(var Ze=-1,ct=we==null?0:we.length;++Ze<ct;)if(je(we[Ze],Ze,we))return!0;return!1}var Wp=Bu("length");function Tc(we,je,Ze){var ct;return Ze(we,function(wt,$t,zn){if(je(wt,$t,zn))return ct=$t,!1}),ct}function dl(we,je,Ze,ct){for(var wt=we.length,$t=Ze+(ct?1:-1);ct?$t--:++$t<wt;)if(je(we[$t],$t,we))return $t;return-1}function As(we,je,Ze){return je==je?function(ct,wt,$t){for(var zn=$t-1,nr=ct.length;++zn<nr;)if(ct[zn]===wt)return zn;return-1}(we,je,Ze):dl(we,Sc,Ze)}function Xp(we,je,Ze,ct){for(var wt=Ze-1,$t=we.length;++wt<$t;)if(ct(we[wt],je))return wt;return-1}function Sc(we){return we!=we}function Ec(we,je){var Ze=we==null?0:we.length;return Ze?ku(we,je)/Ze:NaN}function Bu(we){return function(je){return je==null?void 0:je[we]}}function Uu(we){return function(je){return we==null?void 0:we[je]}}function Mc(we,je,Ze,ct,wt){return wt(we,function($t,zn,nr){Ze=ct?(ct=!1,$t):je(Ze,$t,zn,nr)}),Ze}function ku(we,je){for(var Ze,ct=-1,wt=we.length;++ct<wt;){var $t=je(we[ct]);$t!==void 0&&(Ze=Ze===void 0?$t:Ze+$t)}return Ze}function Gu(we,je){for(var Ze=-1,ct=Array(we);++Ze<we;)ct[Ze]=je(Ze);return ct}function Ac(we){return we&&we.slice(0,jo(we)+1).replace(ai,"")}function Wi(we){return function(je){return we(je)}}function Hu(we,je){return Tn(je,function(Ze){return we[Ze]})}function _a(we,je){return we.has(je)}function Pc(we,je){for(var Ze=-1,ct=we.length;++Ze<ct&&As(je,we[Ze],0)>-1;);return Ze}function Cc(we,je){for(var Ze=we.length;Ze--&&As(je,we[Ze],0)>-1;);return Ze}function Yp(we,je){for(var Ze=we.length,ct=0;Ze--;)we[Ze]===je&&++ct;return ct}var qp=Uu({\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"}),Zp=Uu({"&":"&","<":"<",">":">",'"':""","'":"'"});function Jp(we){return"\\"+co[we]}function Ps(we){return Es.test(we)}function zu(we){var je=-1,Ze=Array(we.size);return we.forEach(function(ct,wt){Ze[++je]=[wt,ct]}),Ze}function Rc(we,je){return function(Ze){return we(je(Ze))}}function fo(we,je){for(var Ze=-1,ct=we.length,wt=0,$t=[];++Ze<ct;){var zn=we[Ze];zn!==je&&zn!==k||(we[Ze]=k,$t[wt++]=Ze)}return $t}function Vo(we){var je=-1,Ze=Array(we.size);return we.forEach(function(ct){Ze[++je]=ct}),Ze}function pl(we){var je=-1,Ze=Array(we.size);return we.forEach(function(ct){Ze[++je]=[ct,ct]}),Ze}function mo(we){return Ps(we)?function(je){for(var Ze=Ss.lastIndex=0;Ss.test(je);)++Ze;return Ze}(we):Wp(we)}function bi(we){return Ps(we)?function(je){return je.match(Ss)||[]}(we):function(je){return je.split("")}(we)}function jo(we){for(var je=we.length;je--&&Fi.test(we.charAt(je)););return je}var fl=Uu({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Cs=function we(je){var Ze,ct=(je=je==null?Nn:Cs.defaults(Nn.Object(),je,Cs.pick(Nn,Gp))).Array,wt=je.Date,$t=je.Error,zn=je.Function,nr=je.Math,xn=je.Object,ml=je.RegExp,Ic=je.String,Xi=je.TypeError,gl=ct.prototype,Lc=zn.prototype,pr=xn.prototype,vl=je["__core-js_shared__"],Vu=Lc.toString,un=pr.hasOwnProperty,xg=0,$p=(Ze=/[^.]+$/.exec(vl&&vl.keys&&vl.keys.IE_PROTO||""))?"Symbol(src)_1."+Ze:"",ju=pr.toString,bg=Vu.call(xn),wg=Nn._,Tg=ml("^"+Vu.call(un).replace(qn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wu=vc?je.Buffer:void 0,Wo=je.Symbol,Xu=je.Uint8Array,Kp=Wu?Wu.allocUnsafe:void 0,Yu=Rc(xn.getPrototypeOf,xn),Qp=xn.create,ef=pr.propertyIsEnumerable,_l=gl.splice,Rs=Wo?Wo.isConcatSpreadable:void 0,Xr=Wo?Wo.iterator:void 0,Is=Wo?Wo.toStringTag:void 0,qu=function(){try{var h=js(xn,"defineProperty");return h({},"",{}),h}catch{}}(),Sg=je.clearTimeout!==Nn.clearTimeout&&je.clearTimeout,Eg=wt&&wt.now!==Nn.Date.now&&wt.now,Mg=je.setTimeout!==Nn.setTimeout&&je.setTimeout,Zu=nr.ceil,Ju=nr.floor,Oc=xn.getOwnPropertySymbols,Dc=Wu?Wu.isBuffer:void 0,go=je.isFinite,wi=gl.join,$u=Rc(xn.keys,xn),Sn=nr.max,ni=nr.min,ir=wt.now,Ti=je.parseInt,Ku=nr.random,yl=gl.reverse,xl=js(je,"DataView"),ya=js(je,"Map"),Qu=js(je,"Promise"),Ls=js(je,"Set"),Qe=js(je,"WeakMap"),En=js(xn,"create"),vo=Qe&&new Qe,fr={},Ag=Qo(xl),$n=Qo(ya),Nc=Qo(Qu),pn=Qo(Ls),Ir=Qo(Qe),bl=Wo?Wo.prototype:void 0,Os=bl?bl.valueOf:void 0,gi=bl?bl.toString:void 0;function T(h){if(Un(h)&&!Ut(h)&&!(h instanceof Ht)){if(h instanceof In)return h;if(un.call(h,"__wrapped__"))return vf(h)}return new In(h)}var Xo=function(){function h(){}return function(p){if(!Bn(p))return{};if(Qp)return Qp(p);h.prototype=p;var x=new h;return h.prototype=void 0,x}}();function wl(){}function In(h,p){this.__wrapped__=h,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=void 0}function Ht(h){this.__wrapped__=h,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Lr(h){var p=-1,x=h==null?0:h.length;for(this.clear();++p<x;){var E=h[p];this.set(E[0],E[1])}}function Or(h){var p=-1,x=h==null?0:h.length;for(this.clear();++p<x;){var E=h[p];this.set(E[0],E[1])}}function Yi(h){var p=-1,x=h==null?0:h.length;for(this.clear();++p<x;){var E=h[p];this.set(E[0],E[1])}}function mr(h){var p=-1,x=h==null?0:h.length;for(this.__data__=new Yi;++p<x;)this.add(h[p])}function Ci(h){var p=this.__data__=new Or(h);this.size=p.size}function _o(h,p){var x=Ut(h),E=!x&&ts(h),P=!x&&!E&&So(h),j=!x&&!E&&!P&&Xs(h),re=x||E||P||j,ce=re?Gu(h.length,Ic):[],_e=ce.length;for(var He in h)!p&&!un.call(h,He)||re&&(He=="length"||P&&(He=="offset"||He=="parent")||j&&(He=="buffer"||He=="byteLength"||He=="byteOffset")||Ii(He,_e))||ce.push(He);return ce}function yo(h){var p=h.length;return p?h[Jo(0,p-1)]:void 0}function Ds(h,p){return ph(ui(h),xo(p,0,h.length))}function Tl(h){return ph(ui(h))}function xa(h,p,x){(x!==void 0&&!br(h[p],x)||x===void 0&&!(p in h))&&qr(h,p,x)}function Yo(h,p,x){var E=h[p];un.call(h,p)&&br(E,x)&&(x!==void 0||p in h)||qr(h,p,x)}function Yr(h,p){for(var x=h.length;x--;)if(br(h[x][0],p))return x;return-1}function Fc(h,p,x,E){return Ui(h,function(P,j,re){p(E,P,x(P),re)}),E}function tf(h,p){return h&&jn(p,ci(p),h)}function qr(h,p,x){p=="__proto__"&&qu?qu(h,p,{configurable:!0,enumerable:!0,value:x,writable:!0}):h[p]=x}function Sl(h,p){for(var x=-1,E=p.length,P=ct(E),j=h==null;++x<E;)P[x]=j?void 0:md(h,p[x]);return P}function xo(h,p,x){return h==h&&(x!==void 0&&(h=h<=x?h:x),p!==void 0&&(h=h>=p?h:p)),h}function li(h,p,x,E,P,j){var re,ce=1&p,_e=2&p,He=4&p;if(x&&(re=P?x(h,E,P,j):x(h)),re!==void 0)return re;if(!Bn(h))return h;var ze=Ut(h);if(ze){if(re=function(Je){var nt=Je.length,Et=new Je.constructor(nt);return nt&&typeof Je[0]=="string"&&un.call(Je,"index")&&(Et.index=Je.index,Et.input=Je.input),Et}(h),!ce)return ui(h,re)}else{var tt=hi(h),vt=tt==Fe||tt==S;if(So(h))return qc(h,ce);if(tt==V||tt==X||vt&&!P){if(re=_e||vt?{}:Qc(h),!ce)return _e?function(Je,nt){return jn(Je,Ws(Je),nt)}(h,function(Je,nt){return Je&&jn(nt,_i(nt),Je)}(re,h)):function(Je,nt){return jn(Je,yr(Je),nt)}(h,tf(re,h))}else{if(!_n[tt])return P?h:{};re=function(Je,nt,Et){var mt=Je.constructor;switch(nt){case ft:return Zc(Je);case le:case Ee:return new mt(+Je);case $e:return function(It,jt){var Tt=jt?Zc(It.buffer):It.buffer;return new It.constructor(Tt,It.byteOffset,It.byteLength)}(Je,Et);case ae:case Ce:case Ie:case H:case be:case Me:case"[object Uint8ClampedArray]":case Oe:case Se:return Us(Je,Et);case A:return new mt;case O:case W:return new mt(Je);case D:return function(It){var jt=new It.constructor(It.source,uo.exec(It));return jt.lastIndex=It.lastIndex,jt}(Je);case z:return new mt;case ee:return St=Je,Os?xn(Os.call(St)):{}}var St}(h,tt,ce)}}j||(j=new Ci);var yt=j.get(h);if(yt)return yt;j.set(h,re),Df(h)?h.forEach(function(Je){re.add(li(Je,p,x,Je,h,j))}):Of(h)&&h.forEach(function(Je,nt){re.set(nt,li(Je,p,x,nt,h,j))});var Ct=ze?void 0:(He?_e?zs:ki:_e?_i:ci)(h);return ji(Ct||h,function(Je,nt){Ct&&(Je=h[nt=Je]),Yo(re,nt,li(Je,p,x,nt,h,j))}),re}function Zr(h,p,x){var E=x.length;if(h==null)return!E;for(h=xn(h);E--;){var P=x[E],j=p[P],re=h[P];if(re===void 0&&!(P in h)||!j(re))return!1}return!0}function eh(h,p,x){if(typeof h!="function")throw new Xi(ie);return Ll(function(){h.apply(void 0,x)},p)}function qo(h,p,x,E){var P=-1,j=va,re=!0,ce=h.length,_e=[],He=p.length;if(!ce)return _e;x&&(p=Tn(p,Wi(x))),E?(j=Du,re=!1):p.length>=200&&(j=_a,re=!1,p=new mr(p));e:for(;++P<ce;){var ze=h[P],tt=x==null?ze:x(ze);if(ze=E||ze!==0?ze:0,re&&tt==tt){for(var vt=He;vt--;)if(p[vt]===tt)continue e;_e.push(ze)}else j(p,tt,E)||_e.push(ze)}return _e}T.templateSettings={escape:Bt,evaluate:Vt,interpolate:bt,variable:"",imports:{_:T}},T.prototype=wl.prototype,T.prototype.constructor=T,In.prototype=Xo(wl.prototype),In.prototype.constructor=In,Ht.prototype=Xo(wl.prototype),Ht.prototype.constructor=Ht,Lr.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Lr.prototype.delete=function(h){var p=this.has(h)&&delete this.__data__[h];return this.size-=p?1:0,p},Lr.prototype.get=function(h){var p=this.__data__;if(En){var x=p[h];return x==="__lodash_hash_undefined__"?void 0:x}return un.call(p,h)?p[h]:void 0},Lr.prototype.has=function(h){var p=this.__data__;return En?p[h]!==void 0:un.call(p,h)},Lr.prototype.set=function(h,p){var x=this.__data__;return this.size+=this.has(h)?0:1,x[h]=En&&p===void 0?"__lodash_hash_undefined__":p,this},Or.prototype.clear=function(){this.__data__=[],this.size=0},Or.prototype.delete=function(h){var p=this.__data__,x=Yr(p,h);return!(x<0)&&(x==p.length-1?p.pop():_l.call(p,x,1),--this.size,!0)},Or.prototype.get=function(h){var p=this.__data__,x=Yr(p,h);return x<0?void 0:p[x][1]},Or.prototype.has=function(h){return Yr(this.__data__,h)>-1},Or.prototype.set=function(h,p){var x=this.__data__,E=Yr(x,h);return E<0?(++this.size,x.push([h,p])):x[E][1]=p,this},Yi.prototype.clear=function(){this.size=0,this.__data__={hash:new Lr,map:new(ya||Or),string:new Lr}},Yi.prototype.delete=function(h){var p=Oa(this,h).delete(h);return this.size-=p?1:0,p},Yi.prototype.get=function(h){return Oa(this,h).get(h)},Yi.prototype.has=function(h){return Oa(this,h).has(h)},Yi.prototype.set=function(h,p){var x=Oa(this,h),E=x.size;return x.set(h,p),this.size+=x.size==E?0:1,this},mr.prototype.add=mr.prototype.push=function(h){return this.__data__.set(h,"__lodash_hash_undefined__"),this},mr.prototype.has=function(h){return this.__data__.has(h)},Ci.prototype.clear=function(){this.__data__=new Or,this.size=0},Ci.prototype.delete=function(h){var p=this.__data__,x=p.delete(h);return this.size=p.size,x},Ci.prototype.get=function(h){return this.__data__.get(h)},Ci.prototype.has=function(h){return this.__data__.has(h)},Ci.prototype.set=function(h,p){var x=this.__data__;if(x instanceof Or){var E=x.__data__;if(!ya||E.length<199)return E.push([h,p]),this.size=++x.size,this;x=this.__data__=new Yi(E)}return x.set(h,p),this.size=x.size,this};var Ui=Mt(Jr),th=Mt(Bc,!0);function nh(h,p){var x=!0;return Ui(h,function(E,P,j){return x=!!p(E,P,j)}),x}function ba(h,p,x){for(var E=-1,P=h.length;++E<P;){var j=h[E],re=p(j);if(re!=null&&(ce===void 0?re==re&&!lr(re):x(re,ce)))var ce=re,_e=j}return _e}function bo(h,p){var x=[];return Ui(h,function(E,P,j){p(E,P,j)&&x.push(E)}),x}function pt(h,p,x,E,P){var j=-1,re=h.length;for(x||(x=Pg),P||(P=[]);++j<re;){var ce=h[j];p>0&&x(ce)?p>1?pt(ce,p-1,x,E,P):po(P,ce):E||(P[P.length]=ce)}return P}var Zo=Jc(),gr=Jc(!0);function Jr(h,p){return h&&Zo(h,p,ci)}function Bc(h,p){return h&&gr(h,p,ci)}function Dr(h,p){return Wr(p,function(x){return Ur(h[x])})}function $r(h,p){for(var x=0,E=(p=Fr(p,h)).length;h!=null&&x<E;)h=h[xr(p[x++])];return x&&x==E?h:void 0}function qi(h,p,x){var E=p(h);return Ut(h)?E:po(E,x(h))}function Ri(h){return h==null?h===void 0?"[object Undefined]":"[object Null]":Is&&Is in xn(h)?function(p){var x=un.call(p,Is),E=p[Is];try{p[Is]=void 0;var P=!0}catch{}var j=ju.call(p);return P&&(x?p[Is]=E:delete p[Is]),j}(h):function(p){return ju.call(p)}(h)}function ih(h,p){return h>p}function Ns(h,p){return h!=null&&un.call(h,p)}function Uc(h,p){return h!=null&&p in xn(h)}function kc(h,p,x){for(var E=x?Du:va,P=h[0].length,j=h.length,re=j,ce=ct(j),_e=1/0,He=[];re--;){var ze=h[re];re&&p&&(ze=Tn(ze,Wi(p))),_e=ni(ze.length,_e),ce[re]=!x&&(p||P>=120&&ze.length>=120)?new mr(re&&ze):void 0}ze=h[0];var tt=-1,vt=ce[0];e:for(;++tt<P&&He.length<_e;){var yt=ze[tt],Ct=p?p(yt):yt;if(yt=x||yt!==0?yt:0,!(vt?_a(vt,Ct):E(He,Ct,x))){for(re=j;--re;){var Je=ce[re];if(!(Je?_a(Je,Ct):E(h[re],Ct,x)))continue e}vt&&vt.push(Ct),He.push(yt)}}return He}function wa(h,p,x){var E=(h=pf(h,p=Fr(p,h)))==null?h:h[xr(ar(p))];return E==null?void 0:Bi(E,h,x)}function Fs(h){return Un(h)&&Ri(h)==X}function rr(h,p,x,E,P){return h===p||(h==null||p==null||!Un(h)&&!Un(p)?h!=h&&p!=p:function(j,re,ce,_e,He,ze){var tt=Ut(j),vt=Ut(re),yt=tt?K:hi(j),Ct=vt?K:hi(re),Je=(yt=yt==X?V:yt)==V,nt=(Ct=Ct==X?V:Ct)==V,Et=yt==Ct;if(Et&&So(j)){if(!So(re))return!1;tt=!0,Je=!1}if(Et&&!Je)return ze||(ze=new Ci),tt||Xs(j)?Si(j,re,ce,_e,He,ze):function(Tt,Ot,Wn,Ei,Xn,kn,kr){switch(Wn){case $e:if(Tt.byteLength!=Ot.byteLength||Tt.byteOffset!=Ot.byteOffset)return!1;Tt=Tt.buffer,Ot=Ot.buffer;case ft:return!(Tt.byteLength!=Ot.byteLength||!kn(new Xu(Tt),new Xu(Ot)));case le:case Ee:case O:return br(+Tt,+Ot);case Xe:return Tt.name==Ot.name&&Tt.message==Ot.message;case D:case W:return Tt==Ot+"";case A:var no=zu;case z:var is=1&Ei;if(no||(no=Vo),Tt.size!=Ot.size&&!is)return!1;var za=kr.get(Tt);if(za)return za==Ot;Ei|=2,kr.set(Tt,Ot);var rs=Si(no(Tt),no(Ot),Ei,Xn,kn,kr);return kr.delete(Tt),rs;case ee:if(Os)return Os.call(Tt)==Os.call(Ot)}return!1}(j,re,yt,ce,_e,He,ze);if(!(1&ce)){var mt=Je&&un.call(j,"__wrapped__"),St=nt&&un.call(re,"__wrapped__");if(mt||St){var It=mt?j.value():j,jt=St?re.value():re;return ze||(ze=new Ci),He(It,jt,ce,_e,ze)}}return Et?(ze||(ze=new Ci),function(Tt,Ot,Wn,Ei,Xn,kn){var kr=1&Wn,no=ki(Tt),is=no.length,za=ki(Ot).length;if(is!=za&&!kr)return!1;for(var rs=is;rs--;){var io=no[rs];if(!(kr?io in Ot:un.call(Ot,io)))return!1}var Oh=kn.get(Tt),yd=kn.get(Ot);if(Oh&&yd)return Oh==Ot&&yd==Tt;var os=!0;kn.set(Tt,Ot),kn.set(Ot,Tt);for(var Ks=kr;++rs<is;){io=no[rs];var Qs=Tt[io],Va=Ot[io];if(Ei)var ja=kr?Ei(Va,Qs,io,Ot,Tt,kn):Ei(Qs,Va,io,Tt,Ot,kn);if(!(ja===void 0?Qs===Va||Xn(Qs,Va,Wn,Ei,kn):ja)){os=!1;break}Ks||(Ks=io=="constructor")}if(os&&!Ks){var Vl=Tt.constructor,ea=Ot.constructor;Vl==ea||!("constructor"in Tt)||!("constructor"in Ot)||typeof Vl=="function"&&Vl instanceof Vl&&typeof ea=="function"&&ea instanceof ea||(os=!1)}return kn.delete(Tt),kn.delete(Ot),os}(j,re,ce,_e,He,ze)):!1}(h,p,x,E,rr,P))}function Ta(h,p,x,E){var P=x.length,j=P,re=!E;if(h==null)return!j;for(h=xn(h);P--;){var ce=x[P];if(re&&ce[2]?ce[1]!==h[ce[0]]:!(ce[0]in h))return!1}for(;++P<j;){var _e=(ce=x[P])[0],He=h[_e],ze=ce[1];if(re&&ce[2]){if(He===void 0&&!(_e in h))return!1}else{var tt=new Ci;if(E)var vt=E(He,ze,_e,h,p,tt);if(!(vt===void 0?rr(ze,He,3,E,tt):vt))return!1}}return!0}function Sa(h){return!(!Bn(h)||(p=h,$p&&$p in p))&&(Ur(h)?Tg:Ip).test(Qo(h));var p}function nf(h){return typeof h=="function"?h:h==null?Hi:typeof h=="object"?Ut(h)?zc(h[0],h[1]):of(h):Xf(h)}function Gc(h){if(!Il(h))return $u(h);var p=[];for(var x in xn(h))un.call(h,x)&&x!="constructor"&&p.push(x);return p}function rf(h){if(!Bn(h))return function(P){var j=[];if(P!=null)for(var re in xn(P))j.push(re);return j}(h);var p=Il(h),x=[];for(var E in h)(E!="constructor"||!p&&un.call(h,E))&&x.push(E);return x}function rh(h,p){return h<p}function Hc(h,p){var x=-1,E=Zi(h)?ct(h.length):[];return Ui(h,function(P,j,re){E[++x]=p(P,j,re)}),E}function of(h){var p=Kc(h);return p.length==1&&p[0][2]?cf(p[0][0],p[0][1]):function(x){return x===h||Ta(x,h,p)}}function zc(h,p){return dt(h)&&hf(p)?cf(xr(h),p):function(x){var E=md(x,h);return E===void 0&&E===p?Nl(x,h):rr(p,E,3)}}function Xt(h,p,x,E,P){h!==p&&Zo(p,function(j,re){if(P||(P=new Ci),Bn(j))(function(_e,He,ze,tt,vt,yt,Ct){var Je=ed(_e,ze),nt=ed(He,ze),Et=Ct.get(nt);if(Et)return void xa(_e,ze,Et);var mt=yt?yt(Je,nt,ze+"",_e,He,Ct):void 0,St=mt===void 0;if(St){var It=Ut(nt),jt=!It&&So(nt),Tt=!It&&!jt&&Xs(nt);mt=nt,It||jt||Tt?Ut(Je)?mt=Je:An(Je)?mt=ui(Je):jt?(St=!1,mt=qc(nt,!0)):Tt?(St=!1,mt=Us(nt,!0)):mt=[]:Fa(nt)||ts(nt)?(mt=Je,ts(Je)?mt=Uf(Je):Bn(Je)&&!Ur(Je)||(mt=Qc(nt))):St=!1}St&&(Ct.set(nt,mt),vt(mt,nt,tt,yt,Ct),Ct.delete(nt)),xa(_e,ze,mt)})(h,p,re,x,Xt,E,P);else{var ce=E?E(ed(h,re),j,re+"",h,p,P):void 0;ce===void 0&&(ce=j),xa(h,re,ce)}},_i)}function vr(h,p){var x=h.length;if(x)return Ii(p+=p<0?x:0,x)?h[p]:void 0}function Kr(h,p,x){p=p.length?Tn(p,function(P){return Ut(P)?function(j){return $r(j,P.length===1?P[0]:P)}:P}):[Hi];var E=-1;return p=Tn(p,Wi(Pt())),function(P,j){var re=P.length;for(P.sort(j);re--;)P[re]=P[re].value;return P}(Hc(h,function(P,j,re){return{criteria:Tn(p,function(ce){return ce(P)}),index:++E,value:P}}),function(P,j){return function(re,ce,_e){for(var He=-1,ze=re.criteria,tt=ce.criteria,vt=ze.length,yt=_e.length;++He<vt;){var Ct=uf(ze[He],tt[He]);if(Ct){if(He>=yt)return Ct;var Je=_e[He];return Ct*(Je=="desc"?-1:1)}}return re.index-ce.index}(P,j,x)})}function oh(h,p,x){for(var E=-1,P=p.length,j={};++E<P;){var re=p[E],ce=$r(h,re);x(ce,re)&&Mn(j,Fr(re,h),ce)}return j}function Nr(h,p,x,E){var P=E?Xp:As,j=-1,re=p.length,ce=h;for(h===p&&(p=ui(p)),x&&(ce=Tn(h,Wi(x)));++j<re;)for(var _e=0,He=p[j],ze=x?x(He):He;(_e=P(ce,ze,_e,E))>-1;)ce!==h&&_l.call(ce,_e,1),_l.call(h,_e,1);return h}function Bs(h,p){for(var x=h?p.length:0,E=x-1;x--;){var P=p[x];if(x==E||P!==j){var j=P;Ii(P)?_l.call(h,P,1):Ma(h,P)}}return h}function Jo(h,p){return h+Ju(Ku()*(p-h+1))}function sh(h,p){var x="";if(!h||p<1||p>9007199254740991)return x;do p%2&&(x+=h),(p=Ju(p/2))&&(h+=h);while(p);return x}function Yt(h,p){return td(df(h,p,Hi),h+"")}function Vc(h){return yo(to(h))}function jc(h,p){var x=to(h);return ph(x,xo(p,0,x.length))}function Mn(h,p,x,E){if(!Bn(h))return h;for(var P=-1,j=(p=Fr(p,h)).length,re=j-1,ce=h;ce!=null&&++P<j;){var _e=xr(p[P]),He=x;if(_e==="__proto__"||_e==="constructor"||_e==="prototype")return h;if(P!=re){var ze=ce[_e];(He=E?E(ze,_e,ce):void 0)===void 0&&(He=Bn(ze)?ze:Ii(p[P+1])?[]:{})}Yo(ce,_e,He),ce=ce[_e]}return h}var sf=vo?function(h,p){return vo.set(h,p),h}:Hi,vi=qu?function(h,p){return qu(h,"toString",{configurable:!0,enumerable:!1,value:ka(p),writable:!0})}:Hi;function af(h){return ph(to(h))}function Vn(h,p,x){var E=-1,P=h.length;p<0&&(p=-p>P?0:P+p),(x=x>P?P:x)<0&&(x+=P),P=p>x?0:x-p>>>0,p>>>=0;for(var j=ct(P);++E<P;)j[E]=h[E+p];return j}function ah(h,p){var x;return Ui(h,function(E,P,j){return!(x=p(E,P,j))}),!!x}function Ea(h,p,x){var E=0,P=h==null?E:h.length;if(typeof p=="number"&&p==p&&P<=2147483647){for(;E<P;){var j=E+P>>>1,re=h[j];re!==null&&!lr(re)&&(x?re<=p:re<p)?E=j+1:P=j}return P}return El(h,p,Hi,x)}function El(h,p,x,E){var P=0,j=h==null?0:h.length;if(j===0)return 0;for(var re=(p=x(p))!=p,ce=p===null,_e=lr(p),He=p===void 0;P<j;){var ze=Ju((P+j)/2),tt=x(h[ze]),vt=tt!==void 0,yt=tt===null,Ct=tt==tt,Je=lr(tt);if(re)var nt=E||Ct;else nt=He?Ct&&(E||vt):ce?Ct&&vt&&(E||!yt):_e?Ct&&vt&&!yt&&(E||!Je):!yt&&!Je&&(E?tt<=p:tt<p);nt?P=ze+1:j=ze}return ni(j,4294967294)}function lh(h,p){for(var x=-1,E=h.length,P=0,j=[];++x<E;){var re=h[x],ce=p?p(re):re;if(!x||!br(ce,_e)){var _e=ce;j[P++]=re===0?0:re}}return j}function gt(h){return typeof h=="number"?h:lr(h)?NaN:+h}function Kn(h){if(typeof h=="string")return h;if(Ut(h))return Tn(h,Kn)+"";if(lr(h))return gi?gi.call(h):"";var p=h+"";return p=="0"&&1/h==-1/0?"-0":p}function an(h,p,x){var E=-1,P=va,j=h.length,re=!0,ce=[],_e=ce;if(x)re=!1,P=Du;else if(j>=200){var He=p?null:$c(h);if(He)return Vo(He);re=!1,P=_a,_e=new mr}else _e=p?[]:ce;e:for(;++E<j;){var ze=h[E],tt=p?p(ze):ze;if(ze=x||ze!==0?ze:0,re&&tt==tt){for(var vt=_e.length;vt--;)if(_e[vt]===tt)continue e;p&&_e.push(tt),ce.push(ze)}else P(_e,tt,x)||(_e!==ce&&_e.push(tt),ce.push(ze))}return ce}function Ma(h,p){return(h=pf(h,p=Fr(p,h)))==null||delete h[xr(ar(p))]}function Zt(h,p,x,E){return Mn(h,p,x($r(h,p)),E)}function Ml(h,p,x,E){for(var P=h.length,j=E?P:-1;(E?j--:++j<P)&&p(h[j],j,h););return x?Vn(h,E?0:j,E?j+1:P):Vn(h,E?j+1:0,E?P:j)}function Wc(h,p){var x=h;return x instanceof Ht&&(x=x.value()),Nu(p,function(E,P){return P.func.apply(P.thisArg,po([E],P.args))},x)}function uh(h,p,x){var E=h.length;if(E<2)return E?an(h[0]):[];for(var P=-1,j=ct(E);++P<E;)for(var re=h[P],ce=-1;++ce<E;)ce!=P&&(j[P]=qo(j[P]||re,h[ce],p,x));return an(pt(j,1),p,x)}function Xc(h,p,x){for(var E=-1,P=h.length,j=p.length,re={};++E<P;){var ce=E<j?p[E]:void 0;x(re,h[E],ce)}return re}function Aa(h){return An(h)?h:[]}function hh(h){return typeof h=="function"?h:Hi}function Fr(h,p){return Ut(h)?h:dt(h,p)?[h]:fh(on(h))}var lf=Yt;function st(h,p,x){var E=h.length;return x=x===void 0?E:x,!p&&x>=E?h:Vn(h,p,x)}var Yc=Sg||function(h){return Nn.clearTimeout(h)};function qc(h,p){if(p)return h.slice();var x=h.length,E=Kp?Kp(x):new h.constructor(x);return h.copy(E),E}function Zc(h){var p=new h.constructor(h.byteLength);return new Xu(p).set(new Xu(h)),p}function Us(h,p){var x=p?Zc(h.buffer):h.buffer;return new h.constructor(x,h.byteOffset,h.length)}function uf(h,p){if(h!==p){var x=h!==void 0,E=h===null,P=h==h,j=lr(h),re=p!==void 0,ce=p===null,_e=p==p,He=lr(p);if(!ce&&!He&&!j&&h>p||j&&re&&_e&&!ce&&!He||E&&re&&_e||!x&&_e||!P)return 1;if(!E&&!j&&!He&&h<p||He&&x&&P&&!E&&!j||ce&&x&&P||!re&&P||!_e)return-1}return 0}function or(h,p,x,E){for(var P=-1,j=h.length,re=x.length,ce=-1,_e=p.length,He=Sn(j-re,0),ze=ct(_e+He),tt=!E;++ce<_e;)ze[ce]=p[ce];for(;++P<re;)(tt||P<j)&&(ze[x[P]]=h[P]);for(;He--;)ze[ce++]=h[P++];return ze}function ch(h,p,x,E){for(var P=-1,j=h.length,re=-1,ce=x.length,_e=-1,He=p.length,ze=Sn(j-ce,0),tt=ct(ze+He),vt=!E;++P<ze;)tt[P]=h[P];for(var yt=P;++_e<He;)tt[yt+_e]=p[_e];for(;++re<ce;)(vt||P<j)&&(tt[yt+x[re]]=h[P++]);return tt}function ui(h,p){var x=-1,E=h.length;for(p||(p=ct(E));++x<E;)p[x]=h[x];return p}function jn(h,p,x,E){var P=!x;x||(x={});for(var j=-1,re=p.length;++j<re;){var ce=p[j],_e=E?E(x[ce],h[ce],ce,x,h):void 0;_e===void 0&&(_e=h[ce]),P?qr(x,ce,_e):Yo(x,ce,_e)}return x}function $o(h,p){return function(x,E){var P=Ut(x)?xc:Fc,j=p?p():{};return P(x,h,Pt(E,2),j)}}function Fn(h){return Yt(function(p,x){var E=-1,P=x.length,j=P>1?x[P-1]:void 0,re=P>2?x[2]:void 0;for(j=h.length>3&&typeof j=="function"?(P--,j):void 0,re&&Lt(x[0],x[1],re)&&(j=P<3?void 0:j,P=1),p=xn(p);++E<P;){var ce=x[E];ce&&h(p,ce,E,j)}return p})}function Mt(h,p){return function(x,E){if(x==null)return x;if(!Zi(x))return h(x,E);for(var P=x.length,j=p?P:-1,re=xn(x);(p?j--:++j<P)&&E(re[j],j,re)!==!1;);return x}}function Jc(h){return function(p,x,E){for(var P=-1,j=xn(p),re=E(p),ce=re.length;ce--;){var _e=re[h?ce:++P];if(x(j[_e],_e,j)===!1)break}return p}}function ks(h){return function(p){var x=Ps(p=on(p))?bi(p):void 0,E=x?x[0]:p.charAt(0),P=x?st(x,1).join(""):p.slice(1);return E[h]()+P}}function Ko(h){return function(p){return Nu(gd($s(p).replace(cl,"")),h,"")}}function _r(h){return function(){var p=arguments;switch(p.length){case 0:return new h;case 1:return new h(p[0]);case 2:return new h(p[0],p[1]);case 3:return new h(p[0],p[1],p[2]);case 4:return new h(p[0],p[1],p[2],p[3]);case 5:return new h(p[0],p[1],p[2],p[3],p[4]);case 6:return new h(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new h(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var x=Xo(h.prototype),E=h.apply(x,p);return Bn(E)?E:x}}function wo(h){return function(p,x,E){var P=xn(p);if(!Zi(p)){var j=Pt(x,3);p=ci(p),x=function(ce){return j(P[ce],ce,P)}}var re=h(p,x,E);return re>-1?P[j?p[re]:re]:void 0}}function To(h){return eo(function(p){var x=p.length,E=x,P=In.prototype.thru;for(h&&p.reverse();E--;){var j=p[E];if(typeof j!="function")throw new Xi(ie);if(P&&!re&&Vs(j)=="wrapper")var re=new In([],!0)}for(E=re?E:x;++E<x;){var ce=Vs(j=p[E]),_e=ce=="wrapper"?Qn(j):void 0;re=_e&&sr(_e[0])&&_e[1]==424&&!_e[4].length&&_e[9]==1?re[Vs(_e[0])].apply(re,_e[3]):j.length==1&&sr(j)?re[ce]():re.thru(j)}return function(){var He=arguments,ze=He[0];if(re&&He.length==1&&Ut(ze))return re.plant(ze).value();for(var tt=0,vt=x?p[tt].apply(this,He):ze;++tt<x;)vt=p[tt].call(this,vt);return vt}})}function Pa(h,p,x,E,P,j,re,ce,_e,He){var ze=128&p,tt=1&p,vt=2&p,yt=24&p,Ct=512&p,Je=vt?void 0:_r(h);return function nt(){for(var Et=arguments.length,mt=ct(Et),St=Et;St--;)mt[St]=arguments[St];if(yt)var It=Br(nt),jt=Yp(mt,It);if(E&&(mt=or(mt,E,P,yt)),j&&(mt=ch(mt,j,re,yt)),Et-=jt,yt&&Et<He){var Tt=fo(mt,It);return Pl(h,p,Pa,nt.placeholder,x,mt,Tt,ce,_e,He-Et)}var Ot=tt?x:this,Wn=vt?Ot[h]:h;return Et=mt.length,ce?mt=Rg(mt,ce):Ct&&Et>1&&mt.reverse(),ze&&_e<Et&&(mt.length=_e),this&&this!==Nn&&this instanceof nt&&(Wn=Je||_r(Wn)),Wn.apply(Ot,mt)}}function dh(h,p){return function(x,E){return function(P,j,re,ce){return Jr(P,function(_e,He,ze){j(ce,re(_e),He,ze)}),ce}(x,h,p(E),{})}}function Ca(h,p){return function(x,E){var P;if(x===void 0&&E===void 0)return p;if(x!==void 0&&(P=x),E!==void 0){if(P===void 0)return E;typeof x=="string"||typeof E=="string"?(x=Kn(x),E=Kn(E)):(x=gt(x),E=gt(E)),P=h(x,E)}return P}}function Ra(h){return eo(function(p){return p=Tn(p,Wi(Pt())),Yt(function(x){var E=this;return h(p,function(P){return Bi(P,E,x)})})})}function Gs(h,p){var x=(p=p===void 0?" ":Kn(p)).length;if(x<2)return x?sh(p,h):p;var E=sh(p,Zu(h/mo(p)));return Ps(p)?st(bi(E),0,h).join(""):E.slice(0,h)}function Al(h){return function(p,x,E){return E&&typeof E!="number"&&Lt(p,x,E)&&(x=E=void 0),p=Eo(p),x===void 0?(x=p,p=0):x=Eo(x),function(P,j,re,ce){for(var _e=-1,He=Sn(Zu((j-P)/(re||1)),0),ze=ct(He);He--;)ze[ce?He:++_e]=P,P+=re;return ze}(p,x,E=E===void 0?p<x?1:-1:Eo(E),h)}}function Hs(h){return function(p,x){return typeof p=="string"&&typeof x=="string"||(p=ur(p),x=ur(x)),h(p,x)}}function Pl(h,p,x,E,P,j,re,ce,_e,He){var ze=8&p;p|=ze?32:64,4&(p&=~(ze?64:32))||(p&=-4);var tt=[h,p,P,ze?j:void 0,ze?re:void 0,ze?void 0:j,ze?void 0:re,ce,_e,He],vt=x.apply(void 0,tt);return sr(h)&&ff(vt,tt),vt.placeholder=E,mf(vt,h,p)}function Ia(h){var p=nr[h];return function(x,E){if(x=ur(x),(E=E==null?0:ni(qt(E),292))&&go(x)){var P=(on(x)+"e").split("e");return+((P=(on(p(P[0]+"e"+(+P[1]+E)))+"e").split("e"))[0]+"e"+(+P[1]-E))}return p(x)}}var $c=Ls&&1/Vo(new Ls([,-0]))[1]==1/0?function(h){return new Ls(h)}:Ga;function Cl(h){return function(p){var x=hi(p);return x==A?zu(p):x==z?pl(p):function(E,P){return Tn(P,function(j){return[j,E[j]]})}(p,h(p))}}function ln(h,p,x,E,P,j,re,ce){var _e=2&p;if(!_e&&typeof h!="function")throw new Xi(ie);var He=E?E.length:0;if(He||(p&=-97,E=P=void 0),re=re===void 0?re:Sn(qt(re),0),ce=ce===void 0?ce:qt(ce),He-=P?P.length:0,64&p){var ze=E,tt=P;E=P=void 0}var vt=_e?void 0:Qn(h),yt=[h,p,x,E,P,ze,tt,j,re,ce];if(vt&&function(Je,nt){var Et=Je[1],mt=nt[1],St=Et|mt,It=St<131,jt=mt==128&&Et==8||mt==128&&Et==256&&Je[7].length<=nt[8]||mt==384&&nt[7].length<=nt[8]&&Et==8;if(!It&&!jt)return Je;1&mt&&(Je[2]=nt[2],St|=1&Et?0:4);var Tt=nt[3];if(Tt){var Ot=Je[3];Je[3]=Ot?or(Ot,Tt,nt[4]):Tt,Je[4]=Ot?fo(Je[3],k):nt[4]}(Tt=nt[5])&&(Ot=Je[5],Je[5]=Ot?ch(Ot,Tt,nt[6]):Tt,Je[6]=Ot?fo(Je[5],k):nt[6]),(Tt=nt[7])&&(Je[7]=Tt),128&mt&&(Je[8]=Je[8]==null?nt[8]:ni(Je[8],nt[8])),Je[9]==null&&(Je[9]=nt[9]),Je[0]=nt[0],Je[1]=St}(yt,vt),h=yt[0],p=yt[1],x=yt[2],E=yt[3],P=yt[4],!(ce=yt[9]=yt[9]===void 0?_e?0:h.length:Sn(yt[9]-He,0))&&24&p&&(p&=-25),p&&p!=1)Ct=p==8||p==16?function(Je,nt,Et){var mt=_r(Je);return function St(){for(var It=arguments.length,jt=ct(It),Tt=It,Ot=Br(St);Tt--;)jt[Tt]=arguments[Tt];var Wn=It<3&&jt[0]!==Ot&&jt[It-1]!==Ot?[]:fo(jt,Ot);if((It-=Wn.length)<Et)return Pl(Je,nt,Pa,St.placeholder,void 0,jt,Wn,void 0,void 0,Et-It);var Ei=this&&this!==Nn&&this instanceof St?mt:Je;return Bi(Ei,this,jt)}}(h,p,ce):p!=32&&p!=33||P.length?Pa.apply(void 0,yt):function(Je,nt,Et,mt){var St=1&nt,It=_r(Je);return function jt(){for(var Tt=-1,Ot=arguments.length,Wn=-1,Ei=mt.length,Xn=ct(Ei+Ot),kn=this&&this!==Nn&&this instanceof jt?It:Je;++Wn<Ei;)Xn[Wn]=mt[Wn];for(;Ot--;)Xn[Wn++]=arguments[++Tt];return Bi(kn,St?Et:this,Xn)}}(h,p,x,E);else var Ct=function(Je,nt,Et){var mt=1&nt,St=_r(Je);return function It(){var jt=this&&this!==Nn&&this instanceof It?St:Je;return jt.apply(mt?Et:this,arguments)}}(h,p,x);return mf((vt?sf:ff)(Ct,yt),h,p)}function Rl(h,p,x,E){return h===void 0||br(h,pr[x])&&!un.call(E,x)?p:h}function Qr(h,p,x,E,P,j){return Bn(h)&&Bn(p)&&(j.set(p,h),Xt(h,p,void 0,Qr,j),j.delete(p)),h}function La(h){return Fa(h)?void 0:h}function Si(h,p,x,E,P,j){var re=1&x,ce=h.length,_e=p.length;if(ce!=_e&&!(re&&_e>ce))return!1;var He=j.get(h),ze=j.get(p);if(He&&ze)return He==p&&ze==h;var tt=-1,vt=!0,yt=2&x?new mr:void 0;for(j.set(h,p),j.set(p,h);++tt<ce;){var Ct=h[tt],Je=p[tt];if(E)var nt=re?E(Je,Ct,tt,p,h,j):E(Ct,Je,tt,h,p,j);if(nt!==void 0){if(nt)continue;vt=!1;break}if(yt){if(!Fu(p,function(Et,mt){if(!_a(yt,mt)&&(Ct===Et||P(Ct,Et,x,E,j)))return yt.push(mt)})){vt=!1;break}}else if(Ct!==Je&&!P(Ct,Je,x,E,j)){vt=!1;break}}return j.delete(h),j.delete(p),vt}function eo(h){return td(df(h,void 0,rd),h+"")}function ki(h){return qi(h,ci,yr)}function zs(h){return qi(h,_i,Ws)}var Qn=vo?function(h){return vo.get(h)}:Ga;function Vs(h){for(var p=h.name+"",x=fr[p],E=un.call(fr,p)?x.length:0;E--;){var P=x[E],j=P.func;if(j==null||j==h)return P.name}return p}function Br(h){return(un.call(T,"placeholder")?T:h).placeholder}function Pt(){var h=T.iteratee||Mh;return h=h===Mh?nf:h,arguments.length?h(arguments[0],arguments[1]):h}function Oa(h,p){var x,E,P=h.__data__;return((E=typeof(x=p))=="string"||E=="number"||E=="symbol"||E=="boolean"?x!=="__proto__":x===null)?P[typeof p=="string"?"string":"hash"]:P.map}function Kc(h){for(var p=ci(h),x=p.length;x--;){var E=p[x],P=h[E];p[x]=[E,P,hf(P)]}return p}function js(h,p){var x=function(E,P){return E==null?void 0:E[P]}(h,p);return Sa(x)?x:void 0}var yr=Oc?function(h){return h==null?[]:(h=xn(h),Wr(Oc(h),function(p){return ef.call(h,p)}))}:Rh,Ws=Oc?function(h){for(var p=[];h;)po(p,yr(h)),h=Yu(h);return p}:Rh,hi=Ri;function Da(h,p,x){for(var E=-1,P=(p=Fr(p,h)).length,j=!1;++E<P;){var re=xr(p[E]);if(!(j=h!=null&&x(h,re)))break;h=h[re]}return j||++E!=P?j:!!(P=h==null?0:h.length)&&yh(P)&&Ii(re,P)&&(Ut(h)||ts(h))}function Qc(h){return typeof h.constructor!="function"||Il(h)?{}:Xo(Yu(h))}function Pg(h){return Ut(h)||ts(h)||!!(Rs&&h&&h[Rs])}function Ii(h,p){var x=typeof h;return!!(p=p==null?9007199254740991:p)&&(x=="number"||x!="symbol"&&Op.test(h))&&h>-1&&h%1==0&&h<p}function Lt(h,p,x){if(!Bn(x))return!1;var E=typeof p;return!!(E=="number"?Zi(x)&&Ii(p,x.length):E=="string"&&p in x)&&br(x[p],h)}function dt(h,p){if(Ut(h))return!1;var x=typeof h;return!(x!="number"&&x!="symbol"&&x!="boolean"&&h!=null&&!lr(h))||wn.test(h)||!Dn.test(h)||p!=null&&h in xn(p)}function sr(h){var p=Vs(h),x=T[p];if(typeof x!="function"||!(p in Ht.prototype))return!1;if(h===x)return!0;var E=Qn(x);return!!E&&h===E[0]}(xl&&hi(new xl(new ArrayBuffer(1)))!=$e||ya&&hi(new ya)!=A||Qu&&hi(Qu.resolve())!="[object Promise]"||Ls&&hi(new Ls)!=z||Qe&&hi(new Qe)!=et)&&(hi=function(h){var p=Ri(h),x=p==V?h.constructor:void 0,E=x?Qo(x):"";if(E)switch(E){case Ag:return $e;case $n:return A;case Nc:return"[object Promise]";case pn:return z;case Ir:return et}return p});var Cg=vl?Ur:Ha;function Il(h){var p=h&&h.constructor;return h===(typeof p=="function"&&p.prototype||pr)}function hf(h){return h==h&&!Bn(h)}function cf(h,p){return function(x){return x!=null&&x[h]===p&&(p!==void 0||h in xn(x))}}function df(h,p,x){return p=Sn(p===void 0?h.length-1:p,0),function(){for(var E=arguments,P=-1,j=Sn(E.length-p,0),re=ct(j);++P<j;)re[P]=E[p+P];P=-1;for(var ce=ct(p+1);++P<p;)ce[P]=E[P];return ce[p]=x(re),Bi(h,this,ce)}}function pf(h,p){return p.length<2?h:$r(h,Vn(p,0,-1))}function Rg(h,p){for(var x=h.length,E=ni(p.length,x),P=ui(h);E--;){var j=p[E];h[E]=Ii(j,x)?P[j]:void 0}return h}function ed(h,p){if((p!=="constructor"||typeof h[p]!="function")&&p!="__proto__")return h[p]}var ff=gf(sf),Ll=Mg||function(h,p){return Nn.setTimeout(h,p)},td=gf(vi);function mf(h,p,x){var E=p+"";return td(h,function(P,j){var re=j.length;if(!re)return P;var ce=re-1;return j[ce]=(re>1?"& ":"")+j[ce],j=j.join(re>2?", ":" "),P.replace(Pi,`{
|
|
9
|
+
/* [wrapped with `+j+`] */
|
|
10
|
+
`)}(E,function(P,j){return ji(oe,function(re){var ce="_."+re[0];j&re[1]&&!va(P,ce)&&P.push(ce)}),P.sort()}(function(P){var j=P.match(Vi);return j?j[1].split(Rr):[]}(E),x)))}function gf(h){var p=0,x=0;return function(){var E=ir(),P=16-(E-x);if(x=E,P>0){if(++p>=800)return arguments[0]}else p=0;return h.apply(void 0,arguments)}}function ph(h,p){var x=-1,E=h.length,P=E-1;for(p=p===void 0?E:p;++x<p;){var j=Jo(x,P),re=h[j];h[j]=h[x],h[x]=re}return h.length=p,h}var fh=function(h){var p=Ol(h,function(E){return x.size===500&&x.clear(),E}),x=p.cache;return p}(function(h){var p=[];return h.charCodeAt(0)===46&&p.push(""),h.replace(gn,function(x,E,P,j){p.push(P?j.replace(Ap,"$1"):E||x)}),p});function xr(h){if(typeof h=="string"||lr(h))return h;var p=h+"";return p=="0"&&1/h==-1/0?"-0":p}function Qo(h){if(h!=null){try{return Vu.call(h)}catch{}try{return h+""}catch{}}return""}function vf(h){if(h instanceof Ht)return h.clone();var p=new In(h.__wrapped__,h.__chain__);return p.__actions__=ui(h.__actions__),p.__index__=h.__index__,p.__values__=h.__values__,p}var Ig=Yt(function(h,p){return An(h)?qo(h,pt(p,1,An,!0)):[]}),_f=Yt(function(h,p){var x=ar(p);return An(x)&&(x=void 0),An(h)?qo(h,pt(p,1,An,!0),Pt(x,2)):[]}),yf=Yt(function(h,p){var x=ar(p);return An(x)&&(x=void 0),An(h)?qo(h,pt(p,1,An,!0),void 0,x):[]});function nd(h,p,x){var E=h==null?0:h.length;if(!E)return-1;var P=x==null?0:qt(x);return P<0&&(P=Sn(E+P,0)),dl(h,Pt(p,3),P)}function id(h,p,x){var E=h==null?0:h.length;if(!E)return-1;var P=E-1;return x!==void 0&&(P=qt(x),P=x<0?Sn(E+P,0):ni(P,E-1)),dl(h,Pt(p,3),P,!0)}function rd(h){return(h==null?0:h.length)?pt(h,1):[]}function od(h){return h&&h.length?h[0]:void 0}var Na=Yt(function(h){var p=Tn(h,Aa);return p.length&&p[0]===h[0]?kc(p):[]}),Gi=Yt(function(h){var p=ar(h),x=Tn(h,Aa);return p===ar(x)?p=void 0:x.pop(),x.length&&x[0]===h[0]?kc(x,Pt(p,2)):[]}),Li=Yt(function(h){var p=ar(h),x=Tn(h,Aa);return(p=typeof p=="function"?p:void 0)&&x.pop(),x.length&&x[0]===h[0]?kc(x,void 0,p):[]});function ar(h){var p=h==null?0:h.length;return p?h[p-1]:void 0}var Lg=Yt(xf);function xf(h,p){return h&&h.length&&p&&p.length?Nr(h,p):h}var Og=eo(function(h,p){var x=h==null?0:h.length,E=Sl(h,p);return Bs(h,Tn(p,function(P){return Ii(P,x)?+P:P}).sort(uf)),E});function sd(h){return h==null?h:yl.call(h)}var Dg=Yt(function(h){return an(pt(h,1,An,!0))}),Ng=Yt(function(h){var p=ar(h);return An(p)&&(p=void 0),an(pt(h,1,An,!0),Pt(p,2))}),Fg=Yt(function(h){var p=ar(h);return p=typeof p=="function"?p:void 0,an(pt(h,1,An,!0),void 0,p)});function ad(h){if(!h||!h.length)return[];var p=0;return h=Wr(h,function(x){if(An(x))return p=Sn(x.length,p),!0}),Gu(p,function(x){return Tn(h,Bu(x))})}function bf(h,p){if(!h||!h.length)return[];var x=ad(h);return p==null?x:Tn(x,function(E){return Bi(p,void 0,E)})}var Bg=Yt(function(h,p){return An(h)?qo(h,p):[]}),Ug=Yt(function(h){return uh(Wr(h,An))}),kg=Yt(function(h){var p=ar(h);return An(p)&&(p=void 0),uh(Wr(h,An),Pt(p,2))}),Gg=Yt(function(h){var p=ar(h);return p=typeof p=="function"?p:void 0,uh(Wr(h,An),void 0,p)}),Hg=Yt(ad),zg=Yt(function(h){var p=h.length,x=p>1?h[p-1]:void 0;return x=typeof x=="function"?(h.pop(),x):void 0,bf(h,x)});function wf(h){var p=T(h);return p.__chain__=!0,p}function mh(h,p){return p(h)}var Vg=eo(function(h){var p=h.length,x=p?h[0]:0,E=this.__wrapped__,P=function(j){return Sl(j,h)};return!(p>1||this.__actions__.length)&&E instanceof Ht&&Ii(x)?((E=E.slice(x,+x+(p?1:0))).__actions__.push({func:mh,args:[P],thisArg:void 0}),new In(E,this.__chain__).thru(function(j){return p&&!j.length&&j.push(void 0),j})):this.thru(P)}),jg=$o(function(h,p,x){un.call(h,x)?++h[x]:qr(h,x,1)}),Wg=wo(nd),Xg=wo(id);function Tf(h,p){return(Ut(h)?ji:Ui)(h,Pt(p,3))}function Sf(h,p){return(Ut(h)?bc:th)(h,Pt(p,3))}var Yg=$o(function(h,p,x){un.call(h,x)?h[x].push(p):qr(h,x,[p])}),qg=Yt(function(h,p,x){var E=-1,P=typeof p=="function",j=Zi(h)?ct(h.length):[];return Ui(h,function(re){j[++E]=P?Bi(p,re,x):wa(re,p,x)}),j}),Zg=$o(function(h,p,x){qr(h,x,p)});function gh(h,p){return(Ut(h)?Tn:Hc)(h,Pt(p,3))}var Jg=$o(function(h,p,x){h[x?0:1].push(p)},function(){return[[],[]]}),$g=Yt(function(h,p){if(h==null)return[];var x=p.length;return x>1&&Lt(h,p[0],p[1])?p=[]:x>2&&Lt(p[0],p[1],p[2])&&(p=[p[0]]),Kr(h,pt(p,1),[])}),vh=Eg||function(){return Nn.Date.now()};function Ef(h,p,x){return p=x?void 0:p,ln(h,128,void 0,void 0,void 0,void 0,p=h&&p==null?h.length:p)}function Mf(h,p){var x;if(typeof p!="function")throw new Xi(ie);return h=qt(h),function(){return--h>0&&(x=p.apply(this,arguments)),h<=1&&(p=void 0),x}}var ld=Yt(function(h,p,x){var E=1;if(x.length){var P=fo(x,Br(ld));E|=32}return ln(h,E,p,x,P)}),Af=Yt(function(h,p,x){var E=3;if(x.length){var P=fo(x,Br(Af));E|=32}return ln(p,E,h,x,P)});function Pf(h,p,x){var E,P,j,re,ce,_e,He=0,ze=!1,tt=!1,vt=!0;if(typeof h!="function")throw new Xi(ie);function yt(St){var It=E,jt=P;return E=P=void 0,He=St,re=h.apply(jt,It)}function Ct(St){return He=St,ce=Ll(nt,p),ze?yt(St):re}function Je(St){var It=St-_e;return _e===void 0||It>=p||It<0||tt&&St-He>=j}function nt(){var St=vh();if(Je(St))return Et(St);ce=Ll(nt,function(It){var jt=p-(It-_e);return tt?ni(jt,j-(It-He)):jt}(St))}function Et(St){return ce=void 0,vt&&E?yt(St):(E=P=void 0,re)}function mt(){var St=vh(),It=Je(St);if(E=arguments,P=this,_e=St,It){if(ce===void 0)return Ct(_e);if(tt)return Yc(ce),ce=Ll(nt,p),yt(_e)}return ce===void 0&&(ce=Ll(nt,p)),re}return p=ur(p)||0,Bn(x)&&(ze=!!x.leading,j=(tt="maxWait"in x)?Sn(ur(x.maxWait)||0,p):j,vt="trailing"in x?!!x.trailing:vt),mt.cancel=function(){ce!==void 0&&Yc(ce),He=0,E=_e=P=ce=void 0},mt.flush=function(){return ce===void 0?re:Et(vh())},mt}var Kg=Yt(function(h,p){return eh(h,1,p)}),Qg=Yt(function(h,p,x){return eh(h,ur(p)||0,x)});function Ol(h,p){if(typeof h!="function"||p!=null&&typeof p!="function")throw new Xi(ie);var x=function(){var E=arguments,P=p?p.apply(this,E):E[0],j=x.cache;if(j.has(P))return j.get(P);var re=h.apply(this,E);return x.cache=j.set(P,re)||j,re};return x.cache=new(Ol.Cache||Yi),x}function Dl(h){if(typeof h!="function")throw new Xi(ie);return function(){var p=arguments;switch(p.length){case 0:return!h.call(this);case 1:return!h.call(this,p[0]);case 2:return!h.call(this,p[0],p[1]);case 3:return!h.call(this,p[0],p[1],p[2])}return!h.apply(this,p)}}Ol.Cache=Yi;var ud=lf(function(h,p){var x=(p=p.length==1&&Ut(p[0])?Tn(p[0],Wi(Pt())):Tn(pt(p,1),Wi(Pt()))).length;return Yt(function(E){for(var P=-1,j=ni(E.length,x);++P<j;)E[P]=p[P].call(this,E[P]);return Bi(h,this,E)})}),_h=Yt(function(h,p){return ln(h,32,void 0,p,fo(p,Br(_h)))}),Cf=Yt(function(h,p){return ln(h,64,void 0,p,fo(p,Br(Cf)))}),es=eo(function(h,p){return ln(h,256,void 0,void 0,void 0,p)});function br(h,p){return h===p||h!=h&&p!=p}var ev=Hs(ih),Rf=Hs(function(h,p){return h>=p}),ts=Fs(function(){return arguments}())?Fs:function(h){return Un(h)&&un.call(h,"callee")&&!ef.call(h,"callee")},Ut=ct.isArray,tv=_c?Wi(_c):function(h){return Un(h)&&Ri(h)==ft};function Zi(h){return h!=null&&yh(h.length)&&!Ur(h)}function An(h){return Un(h)&&Zi(h)}var So=Dc||Ha,If=yc?Wi(yc):function(h){return Un(h)&&Ri(h)==Ee};function hd(h){if(!Un(h))return!1;var p=Ri(h);return p==Xe||p=="[object DOMException]"||typeof h.message=="string"&&typeof h.name=="string"&&!Fa(h)}function Ur(h){if(!Bn(h))return!1;var p=Ri(h);return p==Fe||p==S||p=="[object AsyncFunction]"||p=="[object Proxy]"}function Lf(h){return typeof h=="number"&&h==qt(h)}function yh(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=9007199254740991}function Bn(h){var p=typeof h;return h!=null&&(p=="object"||p=="function")}function Un(h){return h!=null&&typeof h=="object"}var Of=Ru?Wi(Ru):function(h){return Un(h)&&hi(h)==A};function cd(h){return typeof h=="number"||Un(h)&&Ri(h)==O}function Fa(h){if(!Un(h)||Ri(h)!=V)return!1;var p=Yu(h);if(p===null)return!0;var x=un.call(p,"constructor")&&p.constructor;return typeof x=="function"&&x instanceof x&&Vu.call(x)==bg}var dd=Iu?Wi(Iu):function(h){return Un(h)&&Ri(h)==D},Df=Lu?Wi(Lu):function(h){return Un(h)&&hi(h)==z};function xh(h){return typeof h=="string"||!Ut(h)&&Un(h)&&Ri(h)==W}function lr(h){return typeof h=="symbol"||Un(h)&&Ri(h)==ee}var Xs=Ou?Wi(Ou):function(h){return Un(h)&&yh(h.length)&&!!dn[Ri(h)]},Nf=Hs(rh),nv=Hs(function(h,p){return h<=p});function Ff(h){if(!h)return[];if(Zi(h))return xh(h)?bi(h):ui(h);if(Xr&&h[Xr])return function(x){for(var E,P=[];!(E=x.next()).done;)P.push(E.value);return P}(h[Xr]());var p=hi(h);return(p==A?zu:p==z?Vo:to)(h)}function Eo(h){return h?(h=ur(h))===1/0||h===-1/0?17976931348623157e292*(h<0?-1:1):h==h?h:0:h===0?h:0}function qt(h){var p=Eo(h),x=p%1;return p==p?x?p-x:p:0}function Bf(h){return h?xo(qt(h),0,4294967295):0}function ur(h){if(typeof h=="number")return h;if(lr(h))return NaN;if(Bn(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=Bn(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=Ac(h);var x=Rp.test(h);return x||Lp.test(h)?zp(h.slice(2),x?2:8):Cp.test(h)?NaN:+h}function Uf(h){return jn(h,_i(h))}function on(h){return h==null?"":Kn(h)}var bh=Fn(function(h,p){if(Il(p)||Zi(p))jn(p,ci(p),h);else for(var x in p)un.call(p,x)&&Yo(h,x,p[x])}),pd=Fn(function(h,p){jn(p,_i(p),h)}),wh=Fn(function(h,p,x,E){jn(p,_i(p),h,E)}),iv=Fn(function(h,p,x,E){jn(p,ci(p),h,E)}),kf=eo(Sl),fd=Yt(function(h,p){h=xn(h);var x=-1,E=p.length,P=E>2?p[2]:void 0;for(P&&Lt(p[0],p[1],P)&&(E=1);++x<E;)for(var j=p[x],re=_i(j),ce=-1,_e=re.length;++ce<_e;){var He=re[ce],ze=h[He];(ze===void 0||br(ze,pr[He])&&!un.call(h,He))&&(h[He]=j[He])}return h}),Ys=Yt(function(h){return h.push(void 0,Qr),Bi(Ba,void 0,h)});function md(h,p,x){var E=h==null?void 0:$r(h,p);return E===void 0?x:E}function Nl(h,p){return h!=null&&Da(h,p,Uc)}var rv=dh(function(h,p,x){p!=null&&typeof p.toString!="function"&&(p=ju.call(p)),h[p]=x},ka(Hi)),ov=dh(function(h,p,x){p!=null&&typeof p.toString!="function"&&(p=ju.call(p)),un.call(h,p)?h[p].push(x):h[p]=[x]},Pt),fn=Yt(wa);function ci(h){return Zi(h)?_o(h):Gc(h)}function _i(h){return Zi(h)?_o(h,!0):rf(h)}var Fl=Fn(function(h,p,x){Xt(h,p,x)}),Ba=Fn(function(h,p,x,E){Xt(h,p,x,E)}),qs=eo(function(h,p){var x={};if(h==null)return x;var E=!1;p=Tn(p,function(j){return j=Fr(j,h),E||(E=j.length>1),j}),jn(h,zs(h),x),E&&(x=li(x,7,La));for(var P=p.length;P--;)Ma(x,p[P]);return x}),ei=eo(function(h,p){return h==null?{}:function(x,E){return oh(x,E,function(P,j){return Nl(x,j)})}(h,p)});function Mo(h,p){if(h==null)return{};var x=Tn(zs(h),function(E){return[E]});return p=Pt(p),oh(h,x,function(E,P){return p(E,P[0])})}var Bl=Cl(ci),Zs=Cl(_i);function to(h){return h==null?[]:Hu(h,ci(h))}var Ua=Ko(function(h,p,x){return p=p.toLowerCase(),h+(x?Js(p):p)});function Js(h){return Gl(on(h).toLowerCase())}function $s(h){return(h=on(h))&&h.replace(Pu,qp).replace(Up,"")}var Ul=Ko(function(h,p,x){return h+(x?"-":"")+p.toLowerCase()}),Gf=Ko(function(h,p,x){return h+(x?" ":"")+p.toLowerCase()}),Th=ks("toLowerCase"),kl=Ko(function(h,p,x){return h+(x?"_":"")+p.toLowerCase()}),Sh=Ko(function(h,p,x){return h+(x?" ":"")+Gl(p)}),Hf=Ko(function(h,p,x){return h+(x?" ":"")+p.toUpperCase()}),Gl=ks("toUpperCase");function gd(h,p,x){return h=on(h),(p=x?void 0:p)===void 0?function(E){return kp.test(E)}(h)?function(E){return E.match(ho)||[]}(h):function(E){return E.match(Mp)||[]}(h):h.match(p)||[]}var Hl=Yt(function(h,p){try{return Bi(h,void 0,p)}catch(x){return hd(x)?x:new $t(x)}}),Eh=eo(function(h,p){return ji(p,function(x){x=xr(x),qr(h,x,ld(h[x],h))}),h});function ka(h){return function(){return h}}var zf=To(),Vf=To(!0);function Hi(h){return h}function Mh(h){return nf(typeof h=="function"?h:li(h,1))}var jf=Yt(function(h,p){return function(x){return wa(x,h,p)}}),sv=Yt(function(h,p){return function(x){return wa(h,x,p)}});function Ah(h,p,x){var E=ci(p),P=Dr(p,E);x!=null||Bn(p)&&(P.length||!E.length)||(x=p,p=h,h=this,P=Dr(p,ci(p)));var j=!(Bn(x)&&"chain"in x&&!x.chain),re=Ur(h);return ji(P,function(ce){var _e=p[ce];h[ce]=_e,re&&(h.prototype[ce]=function(){var He=this.__chain__;if(j||He){var ze=h(this.__wrapped__),tt=ze.__actions__=ui(this.__actions__);return tt.push({func:_e,args:arguments,thisArg:h}),ze.__chain__=He,ze}return _e.apply(h,po([this.value()],arguments))})}),h}function Ga(){}var Ph=Ra(Tn),ns=Ra(wc),Wf=Ra(Fu);function Xf(h){return dt(h)?Bu(xr(h)):function(p){return function(x){return $r(x,p)}}(h)}var Ch=Al(),Yf=Al(!0);function Rh(){return[]}function Ha(){return!1}var zl=Ca(function(h,p){return h+p},0),vd=Ia("ceil"),yi=Ca(function(h,p){return h/p},1),qf=Ia("floor"),Ih,Zf=Ca(function(h,p){return h*p},1),_d=Ia("round"),Lh=Ca(function(h,p){return h-p},0);return T.after=function(h,p){if(typeof p!="function")throw new Xi(ie);return h=qt(h),function(){if(--h<1)return p.apply(this,arguments)}},T.ary=Ef,T.assign=bh,T.assignIn=pd,T.assignInWith=wh,T.assignWith=iv,T.at=kf,T.before=Mf,T.bind=ld,T.bindAll=Eh,T.bindKey=Af,T.castArray=function(){if(!arguments.length)return[];var h=arguments[0];return Ut(h)?h:[h]},T.chain=wf,T.chunk=function(h,p,x){p=(x?Lt(h,p,x):p===void 0)?1:Sn(qt(p),0);var E=h==null?0:h.length;if(!E||p<1)return[];for(var P=0,j=0,re=ct(Zu(E/p));P<E;)re[j++]=Vn(h,P,P+=p);return re},T.compact=function(h){for(var p=-1,x=h==null?0:h.length,E=0,P=[];++p<x;){var j=h[p];j&&(P[E++]=j)}return P},T.concat=function(){var h=arguments.length;if(!h)return[];for(var p=ct(h-1),x=arguments[0],E=h;E--;)p[E-1]=arguments[E];return po(Ut(x)?ui(x):[x],pt(p,1))},T.cond=function(h){var p=h==null?0:h.length,x=Pt();return h=p?Tn(h,function(E){if(typeof E[1]!="function")throw new Xi(ie);return[x(E[0]),E[1]]}):[],Yt(function(E){for(var P=-1;++P<p;){var j=h[P];if(Bi(j[0],this,E))return Bi(j[1],this,E)}})},T.conforms=function(h){return function(p){var x=ci(p);return function(E){return Zr(E,p,x)}}(li(h,1))},T.constant=ka,T.countBy=jg,T.create=function(h,p){var x=Xo(h);return p==null?x:tf(x,p)},T.curry=function h(p,x,E){var P=ln(p,8,void 0,void 0,void 0,void 0,void 0,x=E?void 0:x);return P.placeholder=h.placeholder,P},T.curryRight=function h(p,x,E){var P=ln(p,16,void 0,void 0,void 0,void 0,void 0,x=E?void 0:x);return P.placeholder=h.placeholder,P},T.debounce=Pf,T.defaults=fd,T.defaultsDeep=Ys,T.defer=Kg,T.delay=Qg,T.difference=Ig,T.differenceBy=_f,T.differenceWith=yf,T.drop=function(h,p,x){var E=h==null?0:h.length;return E?Vn(h,(p=x||p===void 0?1:qt(p))<0?0:p,E):[]},T.dropRight=function(h,p,x){var E=h==null?0:h.length;return E?Vn(h,0,(p=E-(p=x||p===void 0?1:qt(p)))<0?0:p):[]},T.dropRightWhile=function(h,p){return h&&h.length?Ml(h,Pt(p,3),!0,!0):[]},T.dropWhile=function(h,p){return h&&h.length?Ml(h,Pt(p,3),!0):[]},T.fill=function(h,p,x,E){var P=h==null?0:h.length;return P?(x&&typeof x!="number"&&Lt(h,p,x)&&(x=0,E=P),function(j,re,ce,_e){var He=j.length;for((ce=qt(ce))<0&&(ce=-ce>He?0:He+ce),(_e=_e===void 0||_e>He?He:qt(_e))<0&&(_e+=He),_e=ce>_e?0:Bf(_e);ce<_e;)j[ce++]=re;return j}(h,p,x,E)):[]},T.filter=function(h,p){return(Ut(h)?Wr:bo)(h,Pt(p,3))},T.flatMap=function(h,p){return pt(gh(h,p),1)},T.flatMapDeep=function(h,p){return pt(gh(h,p),1/0)},T.flatMapDepth=function(h,p,x){return x=x===void 0?1:qt(x),pt(gh(h,p),x)},T.flatten=rd,T.flattenDeep=function(h){return(h==null?0:h.length)?pt(h,1/0):[]},T.flattenDepth=function(h,p){return(h==null?0:h.length)?pt(h,p=p===void 0?1:qt(p)):[]},T.flip=function(h){return ln(h,512)},T.flow=zf,T.flowRight=Vf,T.fromPairs=function(h){for(var p=-1,x=h==null?0:h.length,E={};++p<x;){var P=h[p];E[P[0]]=P[1]}return E},T.functions=function(h){return h==null?[]:Dr(h,ci(h))},T.functionsIn=function(h){return h==null?[]:Dr(h,_i(h))},T.groupBy=Yg,T.initial=function(h){return(h==null?0:h.length)?Vn(h,0,-1):[]},T.intersection=Na,T.intersectionBy=Gi,T.intersectionWith=Li,T.invert=rv,T.invertBy=ov,T.invokeMap=qg,T.iteratee=Mh,T.keyBy=Zg,T.keys=ci,T.keysIn=_i,T.map=gh,T.mapKeys=function(h,p){var x={};return p=Pt(p,3),Jr(h,function(E,P,j){qr(x,p(E,P,j),E)}),x},T.mapValues=function(h,p){var x={};return p=Pt(p,3),Jr(h,function(E,P,j){qr(x,P,p(E,P,j))}),x},T.matches=function(h){return of(li(h,1))},T.matchesProperty=function(h,p){return zc(h,li(p,1))},T.memoize=Ol,T.merge=Fl,T.mergeWith=Ba,T.method=jf,T.methodOf=sv,T.mixin=Ah,T.negate=Dl,T.nthArg=function(h){return h=qt(h),Yt(function(p){return vr(p,h)})},T.omit=qs,T.omitBy=function(h,p){return Mo(h,Dl(Pt(p)))},T.once=function(h){return Mf(2,h)},T.orderBy=function(h,p,x,E){return h==null?[]:(Ut(p)||(p=p==null?[]:[p]),Ut(x=E?void 0:x)||(x=x==null?[]:[x]),Kr(h,p,x))},T.over=Ph,T.overArgs=ud,T.overEvery=ns,T.overSome=Wf,T.partial=_h,T.partialRight=Cf,T.partition=Jg,T.pick=ei,T.pickBy=Mo,T.property=Xf,T.propertyOf=function(h){return function(p){return h==null?void 0:$r(h,p)}},T.pull=Lg,T.pullAll=xf,T.pullAllBy=function(h,p,x){return h&&h.length&&p&&p.length?Nr(h,p,Pt(x,2)):h},T.pullAllWith=function(h,p,x){return h&&h.length&&p&&p.length?Nr(h,p,void 0,x):h},T.pullAt=Og,T.range=Ch,T.rangeRight=Yf,T.rearg=es,T.reject=function(h,p){return(Ut(h)?Wr:bo)(h,Dl(Pt(p,3)))},T.remove=function(h,p){var x=[];if(!h||!h.length)return x;var E=-1,P=[],j=h.length;for(p=Pt(p,3);++E<j;){var re=h[E];p(re,E,h)&&(x.push(re),P.push(E))}return Bs(h,P),x},T.rest=function(h,p){if(typeof h!="function")throw new Xi(ie);return Yt(h,p=p===void 0?p:qt(p))},T.reverse=sd,T.sampleSize=function(h,p,x){return p=(x?Lt(h,p,x):p===void 0)?1:qt(p),(Ut(h)?Ds:jc)(h,p)},T.set=function(h,p,x){return h==null?h:Mn(h,p,x)},T.setWith=function(h,p,x,E){return E=typeof E=="function"?E:void 0,h==null?h:Mn(h,p,x,E)},T.shuffle=function(h){return(Ut(h)?Tl:af)(h)},T.slice=function(h,p,x){var E=h==null?0:h.length;return E?(x&&typeof x!="number"&&Lt(h,p,x)?(p=0,x=E):(p=p==null?0:qt(p),x=x===void 0?E:qt(x)),Vn(h,p,x)):[]},T.sortBy=$g,T.sortedUniq=function(h){return h&&h.length?lh(h):[]},T.sortedUniqBy=function(h,p){return h&&h.length?lh(h,Pt(p,2)):[]},T.split=function(h,p,x){return x&&typeof x!="number"&&Lt(h,p,x)&&(p=x=void 0),(x=x===void 0?4294967295:x>>>0)?(h=on(h))&&(typeof p=="string"||p!=null&&!dd(p))&&!(p=Kn(p))&&Ps(h)?st(bi(h),0,x):h.split(p,x):[]},T.spread=function(h,p){if(typeof h!="function")throw new Xi(ie);return p=p==null?0:Sn(qt(p),0),Yt(function(x){var E=x[p],P=st(x,0,p);return E&&po(P,E),Bi(h,this,P)})},T.tail=function(h){var p=h==null?0:h.length;return p?Vn(h,1,p):[]},T.take=function(h,p,x){return h&&h.length?Vn(h,0,(p=x||p===void 0?1:qt(p))<0?0:p):[]},T.takeRight=function(h,p,x){var E=h==null?0:h.length;return E?Vn(h,(p=E-(p=x||p===void 0?1:qt(p)))<0?0:p,E):[]},T.takeRightWhile=function(h,p){return h&&h.length?Ml(h,Pt(p,3),!1,!0):[]},T.takeWhile=function(h,p){return h&&h.length?Ml(h,Pt(p,3)):[]},T.tap=function(h,p){return p(h),h},T.throttle=function(h,p,x){var E=!0,P=!0;if(typeof h!="function")throw new Xi(ie);return Bn(x)&&(E="leading"in x?!!x.leading:E,P="trailing"in x?!!x.trailing:P),Pf(h,p,{leading:E,maxWait:p,trailing:P})},T.thru=mh,T.toArray=Ff,T.toPairs=Bl,T.toPairsIn=Zs,T.toPath=function(h){return Ut(h)?Tn(h,xr):lr(h)?[h]:ui(fh(on(h)))},T.toPlainObject=Uf,T.transform=function(h,p,x){var E=Ut(h),P=E||So(h)||Xs(h);if(p=Pt(p,4),x==null){var j=h&&h.constructor;x=P?E?new j:[]:Bn(h)&&Ur(j)?Xo(Yu(h)):{}}return(P?ji:Jr)(h,function(re,ce,_e){return p(x,re,ce,_e)}),x},T.unary=function(h){return Ef(h,1)},T.union=Dg,T.unionBy=Ng,T.unionWith=Fg,T.uniq=function(h){return h&&h.length?an(h):[]},T.uniqBy=function(h,p){return h&&h.length?an(h,Pt(p,2)):[]},T.uniqWith=function(h,p){return p=typeof p=="function"?p:void 0,h&&h.length?an(h,void 0,p):[]},T.unset=function(h,p){return h==null||Ma(h,p)},T.unzip=ad,T.unzipWith=bf,T.update=function(h,p,x){return h==null?h:Zt(h,p,hh(x))},T.updateWith=function(h,p,x,E){return E=typeof E=="function"?E:void 0,h==null?h:Zt(h,p,hh(x),E)},T.values=to,T.valuesIn=function(h){return h==null?[]:Hu(h,_i(h))},T.without=Bg,T.words=gd,T.wrap=function(h,p){return _h(hh(p),h)},T.xor=Ug,T.xorBy=kg,T.xorWith=Gg,T.zip=Hg,T.zipObject=function(h,p){return Xc(h||[],p||[],Yo)},T.zipObjectDeep=function(h,p){return Xc(h||[],p||[],Mn)},T.zipWith=zg,T.entries=Bl,T.entriesIn=Zs,T.extend=pd,T.extendWith=wh,Ah(T,T),T.add=zl,T.attempt=Hl,T.camelCase=Ua,T.capitalize=Js,T.ceil=vd,T.clamp=function(h,p,x){return x===void 0&&(x=p,p=void 0),x!==void 0&&(x=(x=ur(x))==x?x:0),p!==void 0&&(p=(p=ur(p))==p?p:0),xo(ur(h),p,x)},T.clone=function(h){return li(h,4)},T.cloneDeep=function(h){return li(h,5)},T.cloneDeepWith=function(h,p){return li(h,5,p=typeof p=="function"?p:void 0)},T.cloneWith=function(h,p){return li(h,4,p=typeof p=="function"?p:void 0)},T.conformsTo=function(h,p){return p==null||Zr(h,p,ci(p))},T.deburr=$s,T.defaultTo=function(h,p){return h==null||h!=h?p:h},T.divide=yi,T.endsWith=function(h,p,x){h=on(h),p=Kn(p);var E=h.length,P=x=x===void 0?E:xo(qt(x),0,E);return(x-=p.length)>=0&&h.slice(x,P)==p},T.eq=br,T.escape=function(h){return(h=on(h))&&en.test(h)?h.replace(Qt,Zp):h},T.escapeRegExp=function(h){return(h=on(h))&&yn.test(h)?h.replace(qn,"\\$&"):h},T.every=function(h,p,x){var E=Ut(h)?wc:nh;return x&&Lt(h,p,x)&&(p=void 0),E(h,Pt(p,3))},T.find=Wg,T.findIndex=nd,T.findKey=function(h,p){return Tc(h,Pt(p,3),Jr)},T.findLast=Xg,T.findLastIndex=id,T.findLastKey=function(h,p){return Tc(h,Pt(p,3),Bc)},T.floor=qf,T.forEach=Tf,T.forEachRight=Sf,T.forIn=function(h,p){return h==null?h:Zo(h,Pt(p,3),_i)},T.forInRight=function(h,p){return h==null?h:gr(h,Pt(p,3),_i)},T.forOwn=function(h,p){return h&&Jr(h,Pt(p,3))},T.forOwnRight=function(h,p){return h&&Bc(h,Pt(p,3))},T.get=md,T.gt=ev,T.gte=Rf,T.has=function(h,p){return h!=null&&Da(h,p,Ns)},T.hasIn=Nl,T.head=od,T.identity=Hi,T.includes=function(h,p,x,E){h=Zi(h)?h:to(h),x=x&&!E?qt(x):0;var P=h.length;return x<0&&(x=Sn(P+x,0)),xh(h)?x<=P&&h.indexOf(p,x)>-1:!!P&&As(h,p,x)>-1},T.indexOf=function(h,p,x){var E=h==null?0:h.length;if(!E)return-1;var P=x==null?0:qt(x);return P<0&&(P=Sn(E+P,0)),As(h,p,P)},T.inRange=function(h,p,x){return p=Eo(p),x===void 0?(x=p,p=0):x=Eo(x),function(E,P,j){return E>=ni(P,j)&&E<Sn(P,j)}(h=ur(h),p,x)},T.invoke=fn,T.isArguments=ts,T.isArray=Ut,T.isArrayBuffer=tv,T.isArrayLike=Zi,T.isArrayLikeObject=An,T.isBoolean=function(h){return h===!0||h===!1||Un(h)&&Ri(h)==le},T.isBuffer=So,T.isDate=If,T.isElement=function(h){return Un(h)&&h.nodeType===1&&!Fa(h)},T.isEmpty=function(h){if(h==null)return!0;if(Zi(h)&&(Ut(h)||typeof h=="string"||typeof h.splice=="function"||So(h)||Xs(h)||ts(h)))return!h.length;var p=hi(h);if(p==A||p==z)return!h.size;if(Il(h))return!Gc(h).length;for(var x in h)if(un.call(h,x))return!1;return!0},T.isEqual=function(h,p){return rr(h,p)},T.isEqualWith=function(h,p,x){var E=(x=typeof x=="function"?x:void 0)?x(h,p):void 0;return E===void 0?rr(h,p,void 0,x):!!E},T.isError=hd,T.isFinite=function(h){return typeof h=="number"&&go(h)},T.isFunction=Ur,T.isInteger=Lf,T.isLength=yh,T.isMap=Of,T.isMatch=function(h,p){return h===p||Ta(h,p,Kc(p))},T.isMatchWith=function(h,p,x){return x=typeof x=="function"?x:void 0,Ta(h,p,Kc(p),x)},T.isNaN=function(h){return cd(h)&&h!=+h},T.isNative=function(h){if(Cg(h))throw new $t("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sa(h)},T.isNil=function(h){return h==null},T.isNull=function(h){return h===null},T.isNumber=cd,T.isObject=Bn,T.isObjectLike=Un,T.isPlainObject=Fa,T.isRegExp=dd,T.isSafeInteger=function(h){return Lf(h)&&h>=-9007199254740991&&h<=9007199254740991},T.isSet=Df,T.isString=xh,T.isSymbol=lr,T.isTypedArray=Xs,T.isUndefined=function(h){return h===void 0},T.isWeakMap=function(h){return Un(h)&&hi(h)==et},T.isWeakSet=function(h){return Un(h)&&Ri(h)=="[object WeakSet]"},T.join=function(h,p){return h==null?"":wi.call(h,p)},T.kebabCase=Ul,T.last=ar,T.lastIndexOf=function(h,p,x){var E=h==null?0:h.length;if(!E)return-1;var P=E;return x!==void 0&&(P=(P=qt(x))<0?Sn(E+P,0):ni(P,E-1)),p==p?function(j,re,ce){for(var _e=ce+1;_e--;)if(j[_e]===re)return _e;return _e}(h,p,P):dl(h,Sc,P,!0)},T.lowerCase=Gf,T.lowerFirst=Th,T.lt=Nf,T.lte=nv,T.max=function(h){return h&&h.length?ba(h,Hi,ih):void 0},T.maxBy=function(h,p){return h&&h.length?ba(h,Pt(p,2),ih):void 0},T.mean=function(h){return Ec(h,Hi)},T.meanBy=function(h,p){return Ec(h,Pt(p,2))},T.min=function(h){return h&&h.length?ba(h,Hi,rh):void 0},T.minBy=function(h,p){return h&&h.length?ba(h,Pt(p,2),rh):void 0},T.stubArray=Rh,T.stubFalse=Ha,T.stubObject=function(){return{}},T.stubString=function(){return""},T.stubTrue=function(){return!0},T.multiply=Zf,T.nth=function(h,p){return h&&h.length?vr(h,qt(p)):void 0},T.noConflict=function(){return Nn._===this&&(Nn._=wg),this},T.noop=Ga,T.now=vh,T.pad=function(h,p,x){h=on(h);var E=(p=qt(p))?mo(h):0;if(!p||E>=p)return h;var P=(p-E)/2;return Gs(Ju(P),x)+h+Gs(Zu(P),x)},T.padEnd=function(h,p,x){h=on(h);var E=(p=qt(p))?mo(h):0;return p&&E<p?h+Gs(p-E,x):h},T.padStart=function(h,p,x){h=on(h);var E=(p=qt(p))?mo(h):0;return p&&E<p?Gs(p-E,x)+h:h},T.parseInt=function(h,p,x){return x||p==null?p=0:p&&(p=+p),Ti(on(h).replace(ai,""),p||0)},T.random=function(h,p,x){if(x&&typeof x!="boolean"&&Lt(h,p,x)&&(p=x=void 0),x===void 0&&(typeof p=="boolean"?(x=p,p=void 0):typeof h=="boolean"&&(x=h,h=void 0)),h===void 0&&p===void 0?(h=0,p=1):(h=Eo(h),p===void 0?(p=h,h=0):p=Eo(p)),h>p){var E=h;h=p,p=E}if(x||h%1||p%1){var P=Ku();return ni(h+P*(p-h+er("1e-"+((P+"").length-1))),p)}return Jo(h,p)},T.reduce=function(h,p,x){var E=Ut(h)?Nu:Mc,P=arguments.length<3;return E(h,Pt(p,4),x,P,Ui)},T.reduceRight=function(h,p,x){var E=Ut(h)?jp:Mc,P=arguments.length<3;return E(h,Pt(p,4),x,P,th)},T.repeat=function(h,p,x){return p=(x?Lt(h,p,x):p===void 0)?1:qt(p),sh(on(h),p)},T.replace=function(){var h=arguments,p=on(h[0]);return h.length<3?p:p.replace(h[1],h[2])},T.result=function(h,p,x){var E=-1,P=(p=Fr(p,h)).length;for(P||(P=1,h=void 0);++E<P;){var j=h==null?void 0:h[xr(p[E])];j===void 0&&(E=P,j=x),h=Ur(j)?j.call(h):j}return h},T.round=_d,T.runInContext=we,T.sample=function(h){return(Ut(h)?yo:Vc)(h)},T.size=function(h){if(h==null)return 0;if(Zi(h))return xh(h)?mo(h):h.length;var p=hi(h);return p==A||p==z?h.size:Gc(h).length},T.snakeCase=kl,T.some=function(h,p,x){var E=Ut(h)?Fu:ah;return x&&Lt(h,p,x)&&(p=void 0),E(h,Pt(p,3))},T.sortedIndex=function(h,p){return Ea(h,p)},T.sortedIndexBy=function(h,p,x){return El(h,p,Pt(x,2))},T.sortedIndexOf=function(h,p){var x=h==null?0:h.length;if(x){var E=Ea(h,p);if(E<x&&br(h[E],p))return E}return-1},T.sortedLastIndex=function(h,p){return Ea(h,p,!0)},T.sortedLastIndexBy=function(h,p,x){return El(h,p,Pt(x,2),!0)},T.sortedLastIndexOf=function(h,p){if(h==null?0:h.length){var x=Ea(h,p,!0)-1;if(br(h[x],p))return x}return-1},T.startCase=Sh,T.startsWith=function(h,p,x){return h=on(h),x=x==null?0:xo(qt(x),0,h.length),p=Kn(p),h.slice(x,x+p.length)==p},T.subtract=Lh,T.sum=function(h){return h&&h.length?ku(h,Hi):0},T.sumBy=function(h,p){return h&&h.length?ku(h,Pt(p,2)):0},T.template=function(h,p,x){var E=T.templateSettings;x&&Lt(h,p,x)&&(p=void 0),h=on(h),p=wh({},p,E,Rl);var P,j,re=wh({},p.imports,E.imports,Rl),ce=ci(re),_e=Hu(re,ce),He=0,ze=p.interpolate||ko,tt="__p += '",vt=ml((p.escape||ko).source+"|"+ze.source+"|"+(ze===bt?Pp:ko).source+"|"+(p.evaluate||ko).source+"|$","g"),yt="//# sourceURL="+(un.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Hp+"]")+`
|
|
11
11
|
`;h.replace(vt,function(nt,Et,mt,St,It,jt){return mt||(mt=St),tt+=h.slice(He,jt).replace(ol,Jp),Et&&(P=!0,tt+=`' +
|
|
12
12
|
__e(`+Et+`) +
|
|
13
|
-
'`),It&&(
|
|
13
|
+
'`),It&&(j=!0,tt+=`';
|
|
14
14
|
`+It+`;
|
|
15
15
|
__p += '`),mt&&(tt+=`' +
|
|
16
16
|
((__t = (`+mt+`)) == null ? '' : __t) +
|
|
@@ -18,18 +18,18 @@ __p += '`),mt&&(tt+=`' +
|
|
|
18
18
|
`;var Ct=un.call(p,"variable")&&p.variable;if(Ct){if(rl.test(Ct))throw new $t("Invalid `variable` option passed into `_.template`")}else tt=`with (obj) {
|
|
19
19
|
`+tt+`
|
|
20
20
|
}
|
|
21
|
-
`;tt=(
|
|
21
|
+
`;tt=(j?tt.replace(Ue,""):tt).replace(qe,"$1").replace(at,"$1;"),tt="function("+(Ct||"obj")+`) {
|
|
22
22
|
`+(Ct?"":`obj || (obj = {});
|
|
23
|
-
`)+"var __t, __p = ''"+(P?", __e = _.escape":"")+(
|
|
23
|
+
`)+"var __t, __p = ''"+(P?", __e = _.escape":"")+(j?`, __j = Array.prototype.join;
|
|
24
24
|
function print() { __p += __j.call(arguments, '') }
|
|
25
25
|
`:`;
|
|
26
26
|
`)+tt+`return __p
|
|
27
|
-
}`;var Je=Hl(function(){return zn(ce,yt+"return "+tt).apply(void 0,_e)});if(Je.source=tt,hd(Je))throw Je;return Je},T.times=function(h,p){if((h=qt(h))<1||h>9007199254740991)return[];var x=4294967295,E=ni(h,4294967295);h-=4294967295;for(var P=Gu(E,p=Pt(p));++x<h;)p(x);return P},T.toFinite=Eo,T.toInteger=qt,T.toLength=Bf,T.toLower=function(h){return on(h).toLowerCase()},T.toNumber=ur,T.toSafeInteger=function(h){return h?xo(qt(h),-9007199254740991,9007199254740991):h===0?h:0},T.toString=on,T.toUpper=function(h){return on(h).toUpperCase()},T.trim=function(h,p,x){if((h=on(h))&&(x||p===void 0))return Ac(h);if(!h||!(p=Kn(p)))return h;var E=bi(h),P=bi(p);return st(E,Pc(E,P),Cc(E,P)+1).join("")},T.trimEnd=function(h,p,x){if((h=on(h))&&(x||p===void 0))return h.slice(0,jo(h)+1);if(!h||!(p=Kn(p)))return h;var E=bi(h);return st(E,0,Cc(E,bi(p))+1).join("")},T.trimStart=function(h,p,x){if((h=on(h))&&(x||p===void 0))return h.replace(ai,"");if(!h||!(p=Kn(p)))return h;var E=bi(h);return st(E,Pc(E,bi(p))).join("")},T.truncate=function(h,p){var x=30,E="...";if(Bn(p)){var P="separator"in p?p.separator:P;x="length"in p?qt(p.length):x,E="omission"in p?Kn(p.omission):E}var V=(h=on(h)).length;if(Ps(h)){var re=bi(h);V=re.length}if(x>=V)return h;var ce=x-mo(E);if(ce<1)return E;var _e=re?st(re,0,ce).join(""):h.slice(0,ce);if(P===void 0)return _e+E;if(re&&(ce+=_e.length-ce),dd(P)){if(h.slice(ce).search(P)){var He,ze=_e;for(P.global||(P=ml(P.source,on(uo.exec(P))+"g")),P.lastIndex=0;He=P.exec(ze);)var tt=He.index;_e=_e.slice(0,tt===void 0?ce:tt)}}else if(h.indexOf(Kn(P),ce)!=ce){var vt=_e.lastIndexOf(P);vt>-1&&(_e=_e.slice(0,vt))}return _e+E},T.unescape=function(h){return(h=on(h))&<.test(h)?h.replace(rt,fl):h},T.uniqueId=function(h){var p=++xg;return on(h)+p},T.upperCase=Hf,T.upperFirst=Gl,T.each=Tf,T.eachRight=Sf,T.first=od,Ah(T,(Ih={},Jr(T,function(h,p){un.call(T.prototype,p)||(Ih[p]=h)}),Ih),{chain:!1}),T.VERSION="4.17.21",ji(["bind","bindKey","curry","curryRight","partial","partialRight"],function(h){T[h].placeholder=T}),ji(["drop","take"],function(h,p){Ht.prototype[h]=function(x){x=x===void 0?1:Sn(qt(x),0);var E=this.__filtered__&&!p?new Ht(this):this.clone();return E.__filtered__?E.__takeCount__=ni(x,E.__takeCount__):E.__views__.push({size:ni(x,4294967295),type:h+(E.__dir__<0?"Right":"")}),E},Ht.prototype[h+"Right"]=function(x){return this.reverse()[h](x).reverse()}}),ji(["filter","map","takeWhile"],function(h,p){var x=p+1,E=x==1||x==3;Ht.prototype[h]=function(P){var V=this.clone();return V.__iteratees__.push({iteratee:Pt(P,3),type:x}),V.__filtered__=V.__filtered__||E,V}}),ji(["head","last"],function(h,p){var x="take"+(p?"Right":"");Ht.prototype[h]=function(){return this[x](1).value()[0]}}),ji(["initial","tail"],function(h,p){var x="drop"+(p?"":"Right");Ht.prototype[h]=function(){return this.__filtered__?new Ht(this):this[x](1)}}),Ht.prototype.compact=function(){return this.filter(Hi)},Ht.prototype.find=function(h){return this.filter(h).head()},Ht.prototype.findLast=function(h){return this.reverse().find(h)},Ht.prototype.invokeMap=Yt(function(h,p){return typeof h=="function"?new Ht(this):this.map(function(x){return wa(x,h,p)})}),Ht.prototype.reject=function(h){return this.filter(Dl(Pt(h)))},Ht.prototype.slice=function(h,p){h=qt(h);var x=this;return x.__filtered__&&(h>0||p<0)?new Ht(x):(h<0?x=x.takeRight(-h):h&&(x=x.drop(h)),p!==void 0&&(x=(p=qt(p))<0?x.dropRight(-p):x.take(p-h)),x)},Ht.prototype.takeRightWhile=function(h){return this.reverse().takeWhile(h).reverse()},Ht.prototype.toArray=function(){return this.take(4294967295)},Jr(Ht.prototype,function(h,p){var x=/^(?:filter|find|map|reject)|While$/.test(p),E=/^(?:head|last)$/.test(p),P=T[E?"take"+(p=="last"?"Right":""):p],V=E||/^find/.test(p);P&&(T.prototype[p]=function(){var re=this.__wrapped__,ce=E?[1]:arguments,_e=re instanceof Ht,He=ce[0],ze=_e||Ut(re),tt=function(Et){var mt=P.apply(T,po([Et],ce));return E&&vt?mt[0]:mt};ze&&x&&typeof He=="function"&&He.length!=1&&(_e=ze=!1);var vt=this.__chain__,yt=!!this.__actions__.length,Ct=V&&!vt,Je=_e&&!yt;if(!V&&ze){re=Je?re:new Ht(this);var nt=h.apply(re,ce);return nt.__actions__.push({func:mh,args:[tt],thisArg:void 0}),new In(nt,vt)}return Ct&&Je?h.apply(this,ce):(nt=this.thru(tt),Ct?E?nt.value()[0]:nt.value():nt)})}),ji(["pop","push","shift","sort","splice","unshift"],function(h){var p=gl[h],x=/^(?:push|sort|unshift)$/.test(h)?"tap":"thru",E=/^(?:pop|shift)$/.test(h);T.prototype[h]=function(){var P=arguments;if(E&&!this.__chain__){var V=this.value();return p.apply(Ut(V)?V:[],P)}return this[x](function(re){return p.apply(Ut(re)?re:[],P)})}}),Jr(Ht.prototype,function(h,p){var x=T[p];if(x){var E=x.name+"";un.call(fr,E)||(fr[E]=[]),fr[E].push({name:p,func:x})}}),fr[Pa(void 0,2).name]=[{name:"wrapper",func:void 0}],Ht.prototype.clone=function(){var h=new Ht(this.__wrapped__);return h.__actions__=ui(this.__actions__),h.__dir__=this.__dir__,h.__filtered__=this.__filtered__,h.__iteratees__=ui(this.__iteratees__),h.__takeCount__=this.__takeCount__,h.__views__=ui(this.__views__),h},Ht.prototype.reverse=function(){if(this.__filtered__){var h=new Ht(this);h.__dir__=-1,h.__filtered__=!0}else(h=this.clone()).__dir__*=-1;return h},Ht.prototype.value=function(){var h=this.__wrapped__.value(),p=this.__dir__,x=Ut(h),E=p<0,P=x?h.length:0,V=function(jt,Tt,Ot){for(var Wn=-1,Ei=Ot.length;++Wn<Ei;){var Xn=Ot[Wn],kn=Xn.size;switch(Xn.type){case"drop":jt+=kn;break;case"dropRight":Tt-=kn;break;case"take":Tt=ni(Tt,jt+kn);break;case"takeRight":jt=Sn(jt,Tt-kn)}}return{start:jt,end:Tt}}(0,P,this.__views__),re=V.start,ce=V.end,_e=ce-re,He=E?ce:re-1,ze=this.__iteratees__,tt=ze.length,vt=0,yt=ni(_e,this.__takeCount__);if(!x||!E&&P==_e&&yt==_e)return Wc(h,this.__actions__);var Ct=[];e:for(;_e--&&vt<yt;){for(var Je=-1,nt=h[He+=p];++Je<tt;){var Et=ze[Je],mt=Et.iteratee,St=Et.type,It=mt(nt);if(St==2)nt=It;else if(!It){if(St==1)continue e;break e}}Ct[vt++]=nt}return Ct},T.prototype.at=Vg,T.prototype.chain=function(){return wf(this)},T.prototype.commit=function(){return new In(this.value(),this.__chain__)},T.prototype.next=function(){this.__values__===void 0&&(this.__values__=Ff(this.value()));var h=this.__index__>=this.__values__.length;return{done:h,value:h?void 0:this.__values__[this.__index__++]}},T.prototype.plant=function(h){for(var p,x=this;x instanceof wl;){var E=vf(x);E.__index__=0,E.__values__=void 0,p?P.__wrapped__=E:p=E;var P=E;x=x.__wrapped__}return P.__wrapped__=h,p},T.prototype.reverse=function(){var h=this.__wrapped__;if(h instanceof Ht){var p=h;return this.__actions__.length&&(p=new Ht(this)),(p=p.reverse()).__actions__.push({func:mh,args:[sd],thisArg:void 0}),new In(p,this.__chain__)}return this.thru(sd)},T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=function(){return Wc(this.__wrapped__,this.__actions__)},T.prototype.first=T.prototype.head,Xr&&(T.prototype[Xr]=function(){return this}),T}();Nn._=Cs,(B=function(){return Cs}.call(L,v,L,q))===void 0||(q.exports=B)}).call(this)}).call(this,v(4),v(8)(R))},function(R,L,v){Object.defineProperty(L,"__esModule",{value:!0});var b=function(){function oe(X,K){for(var le=0;le<K.length;le++){var Ee=K[le];Ee.enumerable=Ee.enumerable||!1,Ee.configurable=!0,"value"in Ee&&(Ee.writable=!0),Object.defineProperty(X,Ee.key,Ee)}}return function(X,K,le){return K&&oe(X.prototype,K),le&&oe(X,le),X}}();function q(oe,X){if(!(oe instanceof X))throw new TypeError("Cannot call a class as a function")}var B=function(){function oe(X,K,le){K===void 0&&(K=!1),q(this,oe),this._fn=X,this._once=K,this._thisArg=le,this._next=this._prev=this._owner=null}return b(oe,[{key:"detach",value:function(){return this._owner!==null&&(this._owner.detach(this),!0)}}]),oe}();function ie(oe,X){return oe._head?(oe._tail._next=X,X._prev=oe._tail,oe._tail=X):(oe._head=X,oe._tail=X),X._owner=oe,X}var k=function(){function oe(){q(this,oe),this._head=this._tail=void 0}return b(oe,[{key:"handlers",value:function(){var X=!(arguments.length<=0||arguments[0]===void 0)&&arguments[0],K=this._head;if(X)return!!K;for(var le=[];K;)le.push(K),K=K._next;return le}},{key:"has",value:function(X){if(!(X instanceof B))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return X._owner===this}},{key:"dispatch",value:function(){var X=this._head;if(!X)return!1;for(;X;)X._once&&this.detach(X),X._fn.apply(X._thisArg,arguments),X=X._next;return!0}},{key:"add",value:function(X){var K=arguments.length<=1||arguments[1]===void 0?null:arguments[1];if(typeof X!="function")throw new Error("MiniSignal#add(): First arg must be a Function.");return ie(this,new B(X,!1,K))}},{key:"once",value:function(X){var K=arguments.length<=1||arguments[1]===void 0?null:arguments[1];if(typeof X!="function")throw new Error("MiniSignal#once(): First arg must be a Function.");return ie(this,new B(X,!0,K))}},{key:"detach",value:function(X){if(!(X instanceof B))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return X._owner!==this||(X._prev&&(X._prev._next=X._next),X._next&&(X._next._prev=X._prev),X===this._head?(this._head=X._next,X._next===null&&(this._tail=null)):X===this._tail&&(this._tail=X._prev,this._tail._next=null),X._owner=null),this}},{key:"detachAll",value:function(){var X=this._head;if(!X)return this;for(this._head=this._tail=null;X;)X._owner=null,X=X._next;return this}}]),oe}();k.MiniSignalBinding=B,L.default=k,R.exports=L.default},function(R,L,v){var b;(function(q){function B(D,z){var W=(65535&D)+(65535&z);return(D>>16)+(z>>16)+(W>>16)<<16|65535&W}function ie(D,z,W,ee,et,ft){return B(($e=B(B(z,D),B(ee,ft)))<<(ae=et)|$e>>>32-ae,W);var $e,ae}function k(D,z,W,ee,et,ft,$e){return ie(z&W|~z&ee,D,z,et,ft,$e)}function oe(D,z,W,ee,et,ft,$e){return ie(z&ee|W&~ee,D,z,et,ft,$e)}function X(D,z,W,ee,et,ft,$e){return ie(z^W^ee,D,z,et,ft,$e)}function K(D,z,W,ee,et,ft,$e){return ie(W^(z|~ee),D,z,et,ft,$e)}function le(D,z){var W,ee,et,ft,$e;D[z>>5]|=128<<z%32,D[14+(z+64>>>9<<4)]=z;var ae=1732584193,Ce=-271733879,Ie=-1732584194,H=271733878;for(W=0;W<D.length;W+=16)ee=ae,et=Ce,ft=Ie,$e=H,ae=k(ae,Ce,Ie,H,D[W],7,-680876936),H=k(H,ae,Ce,Ie,D[W+1],12,-389564586),Ie=k(Ie,H,ae,Ce,D[W+2],17,606105819),Ce=k(Ce,Ie,H,ae,D[W+3],22,-1044525330),ae=k(ae,Ce,Ie,H,D[W+4],7,-176418897),H=k(H,ae,Ce,Ie,D[W+5],12,1200080426),Ie=k(Ie,H,ae,Ce,D[W+6],17,-1473231341),Ce=k(Ce,Ie,H,ae,D[W+7],22,-45705983),ae=k(ae,Ce,Ie,H,D[W+8],7,1770035416),H=k(H,ae,Ce,Ie,D[W+9],12,-1958414417),Ie=k(Ie,H,ae,Ce,D[W+10],17,-42063),Ce=k(Ce,Ie,H,ae,D[W+11],22,-1990404162),ae=k(ae,Ce,Ie,H,D[W+12],7,1804603682),H=k(H,ae,Ce,Ie,D[W+13],12,-40341101),Ie=k(Ie,H,ae,Ce,D[W+14],17,-1502002290),ae=oe(ae,Ce=k(Ce,Ie,H,ae,D[W+15],22,1236535329),Ie,H,D[W+1],5,-165796510),H=oe(H,ae,Ce,Ie,D[W+6],9,-1069501632),Ie=oe(Ie,H,ae,Ce,D[W+11],14,643717713),Ce=oe(Ce,Ie,H,ae,D[W],20,-373897302),ae=oe(ae,Ce,Ie,H,D[W+5],5,-701558691),H=oe(H,ae,Ce,Ie,D[W+10],9,38016083),Ie=oe(Ie,H,ae,Ce,D[W+15],14,-660478335),Ce=oe(Ce,Ie,H,ae,D[W+4],20,-405537848),ae=oe(ae,Ce,Ie,H,D[W+9],5,568446438),H=oe(H,ae,Ce,Ie,D[W+14],9,-1019803690),Ie=oe(Ie,H,ae,Ce,D[W+3],14,-187363961),Ce=oe(Ce,Ie,H,ae,D[W+8],20,1163531501),ae=oe(ae,Ce,Ie,H,D[W+13],5,-1444681467),H=oe(H,ae,Ce,Ie,D[W+2],9,-51403784),Ie=oe(Ie,H,ae,Ce,D[W+7],14,1735328473),ae=X(ae,Ce=oe(Ce,Ie,H,ae,D[W+12],20,-1926607734),Ie,H,D[W+5],4,-378558),H=X(H,ae,Ce,Ie,D[W+8],11,-2022574463),Ie=X(Ie,H,ae,Ce,D[W+11],16,1839030562),Ce=X(Ce,Ie,H,ae,D[W+14],23,-35309556),ae=X(ae,Ce,Ie,H,D[W+1],4,-1530992060),H=X(H,ae,Ce,Ie,D[W+4],11,1272893353),Ie=X(Ie,H,ae,Ce,D[W+7],16,-155497632),Ce=X(Ce,Ie,H,ae,D[W+10],23,-1094730640),ae=X(ae,Ce,Ie,H,D[W+13],4,681279174),H=X(H,ae,Ce,Ie,D[W],11,-358537222),Ie=X(Ie,H,ae,Ce,D[W+3],16,-722521979),Ce=X(Ce,Ie,H,ae,D[W+6],23,76029189),ae=X(ae,Ce,Ie,H,D[W+9],4,-640364487),H=X(H,ae,Ce,Ie,D[W+12],11,-421815835),Ie=X(Ie,H,ae,Ce,D[W+15],16,530742520),ae=K(ae,Ce=X(Ce,Ie,H,ae,D[W+2],23,-995338651),Ie,H,D[W],6,-198630844),H=K(H,ae,Ce,Ie,D[W+7],10,1126891415),Ie=K(Ie,H,ae,Ce,D[W+14],15,-1416354905),Ce=K(Ce,Ie,H,ae,D[W+5],21,-57434055),ae=K(ae,Ce,Ie,H,D[W+12],6,1700485571),H=K(H,ae,Ce,Ie,D[W+3],10,-1894986606),Ie=K(Ie,H,ae,Ce,D[W+10],15,-1051523),Ce=K(Ce,Ie,H,ae,D[W+1],21,-2054922799),ae=K(ae,Ce,Ie,H,D[W+8],6,1873313359),H=K(H,ae,Ce,Ie,D[W+15],10,-30611744),Ie=K(Ie,H,ae,Ce,D[W+6],15,-1560198380),Ce=K(Ce,Ie,H,ae,D[W+13],21,1309151649),ae=K(ae,Ce,Ie,H,D[W+4],6,-145523070),H=K(H,ae,Ce,Ie,D[W+11],10,-1120210379),Ie=K(Ie,H,ae,Ce,D[W+2],15,718787259),Ce=K(Ce,Ie,H,ae,D[W+9],21,-343485551),ae=B(ae,ee),Ce=B(Ce,et),Ie=B(Ie,ft),H=B(H,$e);return[ae,Ce,Ie,H]}function Ee(D){var z,W="",ee=32*D.length;for(z=0;z<ee;z+=8)W+=String.fromCharCode(D[z>>5]>>>z%32&255);return W}function Xe(D){var z,W=[];for(W[(D.length>>2)-1]=void 0,z=0;z<W.length;z+=1)W[z]=0;var ee=8*D.length;for(z=0;z<ee;z+=8)W[z>>5]|=(255&D.charCodeAt(z/8))<<z%32;return W}function Fe(D){var z,W,ee="";for(W=0;W<D.length;W+=1)z=D.charCodeAt(W),ee+="0123456789abcdef".charAt(z>>>4&15)+"0123456789abcdef".charAt(15&z);return ee}function S(D){return unescape(encodeURIComponent(D))}function A(D){return function(z){return Ee(le(Xe(z),8*z.length))}(S(D))}function O(D,z){return function(W,ee){var et,ft,$e=Xe(W),ae=[],Ce=[];for(ae[15]=Ce[15]=void 0,$e.length>16&&($e=le($e,8*W.length)),et=0;et<16;et+=1)ae[et]=909522486^$e[et],Ce[et]=1549556828^$e[et];return ft=le(ae.concat(Xe(ee)),512+8*ee.length),Ee(le(Ce.concat(ft),640))}(S(D),S(z))}function j(D,z,W){return z?W?O(z,D):Fe(O(z,D)):W?A(D):Fe(A(D))}(b=function(){return j}.call(L,v,L,R))===void 0||(R.exports=b)})()},function(R,L){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}R.exports=v},function(R,L,v){var b=v(21),q=v(22);function B(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}L.parse=D,L.resolve=function(z,W){return D(z,!1,!0).resolve(W)},L.resolveObject=function(z,W){return z?D(z,!1,!0).resolveObject(W):W},L.format=function(z){return q.isString(z)&&(z=D(z)),z instanceof B?z.format():B.prototype.format.call(z)},L.Url=B;var ie=/^([a-z0-9.+-]+:)/i,k=/:[0-9]*$/,oe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,X=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
28
|
-
`," "]),K=["'"].concat(X),le=["%","/","?",";","#"].concat(K),Ee=["/","?","#"],Xe=/^[+a-z0-9A-Z_-]{0,63}$/,Fe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,S={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},j=v(23);function D(z,W,ee){if(z&&q.isObject(z)&&z instanceof B)return z;var et=new B;return et.parse(z,W,ee),et}B.prototype.parse=function(z,W,ee){if(!q.isString(z))throw new TypeError("Parameter 'url' must be a string, not "+typeof z);var et=z.indexOf("?"),ft=et!==-1&&et<z.indexOf("#")?"?":"#",$e=z.split(ft);$e[0]=$e[0].replace(/\\/g,"/");var ae=z=$e.join(ft);if(ae=ae.trim(),!ee&&z.split("#").length===1){var Ce=oe.exec(ae);if(Ce)return this.path=ae,this.href=ae,this.pathname=Ce[1],Ce[2]?(this.search=Ce[2],this.query=W?j.parse(this.search.substr(1)):this.search.substr(1)):W&&(this.search="",this.query={}),this}var Ie=ie.exec(ae);if(Ie){var H=(Ie=Ie[0]).toLowerCase();this.protocol=H,ae=ae.substr(Ie.length)}if(ee||Ie||ae.match(/^\/\/[^@\/]+@[^@\/]+/)){var be=ae.substr(0,2)==="//";!be||Ie&&A[Ie]||(ae=ae.substr(2),this.slashes=!0)}if(!A[Ie]&&(be||Ie&&!O[Ie])){for(var Me,Oe,Se=-1,Ue=0;Ue<Ee.length;Ue++)(qe=ae.indexOf(Ee[Ue]))!==-1&&(Se===-1||qe<Se)&&(Se=qe);for((Oe=Se===-1?ae.lastIndexOf("@"):ae.lastIndexOf("@",Se))!==-1&&(Me=ae.slice(0,Oe),ae=ae.slice(Oe+1),this.auth=decodeURIComponent(Me)),Se=-1,Ue=0;Ue<le.length;Ue++){var qe;(qe=ae.indexOf(le[Ue]))!==-1&&(Se===-1||qe<Se)&&(Se=qe)}Se===-1&&(Se=ae.length),this.host=ae.slice(0,Se),ae=ae.slice(Se),this.parseHost(),this.hostname=this.hostname||"";var at=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!at)for(var rt=this.hostname.split(/\./),Qt=(Ue=0,rt.length);Ue<Qt;Ue++){var lt=rt[Ue];if(lt&&!lt.match(Xe)){for(var en="",Bt=0,Vt=lt.length;Bt<Vt;Bt++)lt.charCodeAt(Bt)>127?en+="x":en+=lt[Bt];if(!en.match(Xe)){var bt=rt.slice(0,Ue),Dn=rt.slice(Ue+1),wn=lt.match(Fe);wn&&(bt.push(wn[1]),Dn.unshift(wn[2])),Dn.length&&(ae="/"+Dn.join(".")+ae),this.hostname=bt.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),at||(this.hostname=b.toASCII(this.hostname));var gn=this.port?":"+this.port:"",qn=this.hostname||"";this.host=qn+gn,this.href+=this.host,at&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ae[0]!=="/"&&(ae="/"+ae))}if(!S[H])for(Ue=0,Qt=K.length;Ue<Qt;Ue++){var yn=K[Ue];if(ae.indexOf(yn)!==-1){var ai=encodeURIComponent(yn);ai===yn&&(ai=escape(yn)),ae=ae.split(yn).join(ai)}}var Fi=ae.indexOf("#");Fi!==-1&&(this.hash=ae.substr(Fi),ae=ae.slice(0,Fi));var Pi=ae.indexOf("?");if(Pi!==-1?(this.search=ae.substr(Pi),this.query=ae.substr(Pi+1),W&&(this.query=j.parse(this.query)),ae=ae.slice(0,Pi)):W&&(this.search="",this.query={}),ae&&(this.pathname=ae),O[H]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){gn=this.pathname||"";var Vi=this.search||"";this.path=gn+Vi}return this.href=this.format(),this},B.prototype.format=function(){var z=this.auth||"";z&&(z=(z=encodeURIComponent(z)).replace(/%3A/i,":"),z+="@");var W=this.protocol||"",ee=this.pathname||"",et=this.hash||"",ft=!1,$e="";this.host?ft=z+this.host:this.hostname&&(ft=z+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(ft+=":"+this.port)),this.query&&q.isObject(this.query)&&Object.keys(this.query).length&&($e=j.stringify(this.query));var ae=this.search||$e&&"?"+$e||"";return W&&W.substr(-1)!==":"&&(W+=":"),this.slashes||(!W||O[W])&&ft!==!1?(ft="//"+(ft||""),ee&&ee.charAt(0)!=="/"&&(ee="/"+ee)):ft||(ft=""),et&&et.charAt(0)!=="#"&&(et="#"+et),ae&&ae.charAt(0)!=="?"&&(ae="?"+ae),W+ft+(ee=ee.replace(/[?#]/g,function(Ce){return encodeURIComponent(Ce)}))+(ae=ae.replace("#","%23"))+et},B.prototype.resolve=function(z){return this.resolveObject(D(z,!1,!0)).format()},B.prototype.resolveObject=function(z){if(q.isString(z)){var W=new B;W.parse(z,!1,!0),z=W}for(var ee=new B,et=Object.keys(this),ft=0;ft<et.length;ft++){var $e=et[ft];ee[$e]=this[$e]}if(ee.hash=z.hash,z.href==="")return ee.href=ee.format(),ee;if(z.slashes&&!z.protocol){for(var ae=Object.keys(z),Ce=0;Ce<ae.length;Ce++){var Ie=ae[Ce];Ie!=="protocol"&&(ee[Ie]=z[Ie])}return O[ee.protocol]&&ee.hostname&&!ee.pathname&&(ee.path=ee.pathname="/"),ee.href=ee.format(),ee}if(z.protocol&&z.protocol!==ee.protocol){if(!O[z.protocol]){for(var H=Object.keys(z),be=0;be<H.length;be++){var Me=H[be];ee[Me]=z[Me]}return ee.href=ee.format(),ee}if(ee.protocol=z.protocol,z.host||A[z.protocol])ee.pathname=z.pathname;else{for(var Oe=(z.pathname||"").split("/");Oe.length&&!(z.host=Oe.shift()););z.host||(z.host=""),z.hostname||(z.hostname=""),Oe[0]!==""&&Oe.unshift(""),Oe.length<2&&Oe.unshift(""),ee.pathname=Oe.join("/")}if(ee.search=z.search,ee.query=z.query,ee.host=z.host||"",ee.auth=z.auth,ee.hostname=z.hostname||z.host,ee.port=z.port,ee.pathname||ee.search){var Se=ee.pathname||"",Ue=ee.search||"";ee.path=Se+Ue}return ee.slashes=ee.slashes||z.slashes,ee.href=ee.format(),ee}var qe=ee.pathname&&ee.pathname.charAt(0)==="/",at=z.host||z.pathname&&z.pathname.charAt(0)==="/",rt=at||qe||ee.host&&z.pathname,Qt=rt,lt=ee.pathname&&ee.pathname.split("/")||[],en=(Oe=z.pathname&&z.pathname.split("/")||[],ee.protocol&&!O[ee.protocol]);if(en&&(ee.hostname="",ee.port=null,ee.host&&(lt[0]===""?lt[0]=ee.host:lt.unshift(ee.host)),ee.host="",z.protocol&&(z.hostname=null,z.port=null,z.host&&(Oe[0]===""?Oe[0]=z.host:Oe.unshift(z.host)),z.host=null),rt=rt&&(Oe[0]===""||lt[0]==="")),at)ee.host=z.host||z.host===""?z.host:ee.host,ee.hostname=z.hostname||z.hostname===""?z.hostname:ee.hostname,ee.search=z.search,ee.query=z.query,lt=Oe;else if(Oe.length)lt||(lt=[]),lt.pop(),lt=lt.concat(Oe),ee.search=z.search,ee.query=z.query;else if(!q.isNullOrUndefined(z.search))return en&&(ee.hostname=ee.host=lt.shift(),(wn=!!(ee.host&&ee.host.indexOf("@")>0)&&ee.host.split("@"))&&(ee.auth=wn.shift(),ee.host=ee.hostname=wn.shift())),ee.search=z.search,ee.query=z.query,q.isNull(ee.pathname)&&q.isNull(ee.search)||(ee.path=(ee.pathname?ee.pathname:"")+(ee.search?ee.search:"")),ee.href=ee.format(),ee;if(!lt.length)return ee.pathname=null,ee.search?ee.path="/"+ee.search:ee.path=null,ee.href=ee.format(),ee;for(var Bt=lt.slice(-1)[0],Vt=(ee.host||z.host||lt.length>1)&&(Bt==="."||Bt==="..")||Bt==="",bt=0,Dn=lt.length;Dn>=0;Dn--)(Bt=lt[Dn])==="."?lt.splice(Dn,1):Bt===".."?(lt.splice(Dn,1),bt++):bt&&(lt.splice(Dn,1),bt--);if(!rt&&!Qt)for(;bt--;bt)lt.unshift("..");!rt||lt[0]===""||lt[0]&<[0].charAt(0)==="/"||lt.unshift(""),Vt&<.join("/").substr(-1)!=="/"&<.push("");var wn,gn=lt[0]===""||lt[0]&<[0].charAt(0)==="/";return en&&(ee.hostname=ee.host=gn?"":lt.length?lt.shift():"",(wn=!!(ee.host&&ee.host.indexOf("@")>0)&&ee.host.split("@"))&&(ee.auth=wn.shift(),ee.host=ee.hostname=wn.shift())),(rt=rt||ee.host&<.length)&&!gn&<.unshift(""),lt.length?ee.pathname=lt.join("/"):(ee.pathname=null,ee.path=null),q.isNull(ee.pathname)&&q.isNull(ee.search)||(ee.path=(ee.pathname?ee.pathname:"")+(ee.search?ee.search:"")),ee.auth=z.auth||ee.auth,ee.slashes=ee.slashes||z.slashes,ee.href=ee.format(),ee},B.prototype.parseHost=function(){var z=this.host,W=k.exec(z);W&&((W=W[0])!==":"&&(this.port=W.substr(1)),z=z.substr(0,z.length-W.length)),z&&(this.hostname=z)}},function(R,L,v){R.exports=function(b,q){if(b){q=q||{};for(var B={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},ie=B.parser[q.strictMode?"strict":"loose"].exec(b),k={},oe=14;oe--;)k[B.key[oe]]=ie[oe]||"";return k[B.q.name]={},k[B.key[12]].replace(B.q.parser,function(X,K,le){K&&(k[B.q.name][K]=le)}),k}}},function(R,L,v){var b=v(26);R.exports=function(q,B){B=B||{};var ie=new b,k=B.inPlace||!1,oe=q.map(function(K){return k?K:{width:K.width,height:K.height,item:K}});oe=oe.sort(function(K,le){return le.width*le.height-K.width*K.height}),ie.fit(oe);var X={width:oe.reduce(function(K,le){return Math.max(K,le.x+le.width)},0),height:oe.reduce(function(K,le){return Math.max(K,le.y+le.height)},0)};return k||(X.items=oe),X}},function(R,L){R.exports=function(v){return v.webpackPolyfill||(v.deprecate=function(){},v.paths=[],v.children||(v.children=[]),Object.defineProperty(v,"loaded",{enumerable:!0,get:function(){return v.l}}),Object.defineProperty(v,"id",{enumerable:!0,get:function(){return v.i}}),v.webpackPolyfill=1),v}},function(R,L,v){var b=Object.prototype.hasOwnProperty,q="~";function B(){}function ie(K,le,Ee){this.fn=K,this.context=le,this.once=Ee||!1}function k(K,le,Ee,Xe,Fe){if(typeof Ee!="function")throw new TypeError("The listener must be a function");var S=new ie(Ee,Xe||K,Fe),A=q?q+le:le;return K._events[A]?K._events[A].fn?K._events[A]=[K._events[A],S]:K._events[A].push(S):(K._events[A]=S,K._eventsCount++),K}function oe(K,le){--K._eventsCount==0?K._events=new B:delete K._events[le]}function X(){this._events=new B,this._eventsCount=0}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(q=!1)),X.prototype.eventNames=function(){var K,le,Ee=[];if(this._eventsCount===0)return Ee;for(le in K=this._events)b.call(K,le)&&Ee.push(q?le.slice(1):le);return Object.getOwnPropertySymbols?Ee.concat(Object.getOwnPropertySymbols(K)):Ee},X.prototype.listeners=function(K){var le=q?q+K:K,Ee=this._events[le];if(!Ee)return[];if(Ee.fn)return[Ee.fn];for(var Xe=0,Fe=Ee.length,S=new Array(Fe);Xe<Fe;Xe++)S[Xe]=Ee[Xe].fn;return S},X.prototype.listenerCount=function(K){var le=q?q+K:K,Ee=this._events[le];return Ee?Ee.fn?1:Ee.length:0},X.prototype.emit=function(K,le,Ee,Xe,Fe,S){var A=q?q+K:K;if(!this._events[A])return!1;var O,j,D=this._events[A],z=arguments.length;if(D.fn){switch(D.once&&this.removeListener(K,D.fn,void 0,!0),z){case 1:return D.fn.call(D.context),!0;case 2:return D.fn.call(D.context,le),!0;case 3:return D.fn.call(D.context,le,Ee),!0;case 4:return D.fn.call(D.context,le,Ee,Xe),!0;case 5:return D.fn.call(D.context,le,Ee,Xe,Fe),!0;case 6:return D.fn.call(D.context,le,Ee,Xe,Fe,S),!0}for(j=1,O=new Array(z-1);j<z;j++)O[j-1]=arguments[j];D.fn.apply(D.context,O)}else{var W,ee=D.length;for(j=0;j<ee;j++)switch(D[j].once&&this.removeListener(K,D[j].fn,void 0,!0),z){case 1:D[j].fn.call(D[j].context);break;case 2:D[j].fn.call(D[j].context,le);break;case 3:D[j].fn.call(D[j].context,le,Ee);break;case 4:D[j].fn.call(D[j].context,le,Ee,Xe);break;default:if(!O)for(W=1,O=new Array(z-1);W<z;W++)O[W-1]=arguments[W];D[j].fn.apply(D[j].context,O)}}return!0},X.prototype.on=function(K,le,Ee){return k(this,K,le,Ee,!1)},X.prototype.once=function(K,le,Ee){return k(this,K,le,Ee,!0)},X.prototype.removeListener=function(K,le,Ee,Xe){var Fe=q?q+K:K;if(!this._events[Fe])return this;if(!le)return oe(this,Fe),this;var S=this._events[Fe];if(S.fn)S.fn!==le||Xe&&!S.once||Ee&&S.context!==Ee||oe(this,Fe);else{for(var A=0,O=[],j=S.length;A<j;A++)(S[A].fn!==le||Xe&&!S[A].once||Ee&&S[A].context!==Ee)&&O.push(S[A]);O.length?this._events[Fe]=O.length===1?O[0]:O:oe(this,Fe)}return this},X.prototype.removeAllListeners=function(K){var le;return K?(le=q?q+K:K,this._events[le]&&oe(this,le)):(this._events=new B,this._eventsCount=0),this},X.prototype.off=X.prototype.removeListener,X.prototype.addListener=X.prototype.on,X.prefixed=q,X.EventEmitter=X,R.exports=X},function(R,L,v){function b(H,be,Me){Me=Me||2;var Oe,Se,Ue,qe,at,rt,Qt,lt=be&&be.length,en=lt?be[0]*Me:H.length,Bt=q(H,0,en,Me,!0),Vt=[];if(!Bt||Bt.next===Bt.prev)return Vt;if(lt&&(Bt=function(Dn,wn,gn,qn){var yn,ai,Fi,Pi,Vi,Rr=[];for(yn=0,ai=wn.length;yn<ai;yn++)Fi=wn[yn]*qn,Pi=yn<ai-1?wn[yn+1]*qn:Dn.length,(Vi=q(Dn,Fi,Pi,qn,!1))===Vi.next&&(Vi.steiner=!0),Rr.push(S(Vi));for(Rr.sort(le),yn=0;yn<Rr.length;yn++)gn=B(gn=Ee(Rr[yn],gn),gn.next);return gn}(H,be,Bt,Me)),H.length>80*Me){Oe=Ue=H[0],Se=qe=H[1];for(var bt=Me;bt<en;bt+=Me)(at=H[bt])<Oe&&(Oe=at),(rt=H[bt+1])<Se&&(Se=rt),at>Ue&&(Ue=at),rt>qe&&(qe=rt);Qt=(Qt=Math.max(Ue-Oe,qe-Se))!==0?1/Qt:0}return ie(Bt,Vt,Me,Oe,Se,Qt),Vt}function q(H,be,Me,Oe,Se){var Ue,qe;if(Se===Ie(H,be,Me,Oe)>0)for(Ue=be;Ue<Me;Ue+=Oe)qe=$e(Ue,H[Ue],H[Ue+1],qe);else for(Ue=Me-Oe;Ue>=be;Ue-=Oe)qe=$e(Ue,H[Ue],H[Ue+1],qe);return qe&&D(qe,qe.next)&&(ae(qe),qe=qe.next),qe}function B(H,be){if(!H)return H;be||(be=H);var Me,Oe=H;do if(Me=!1,Oe.steiner||!D(Oe,Oe.next)&&j(Oe.prev,Oe,Oe.next)!==0)Oe=Oe.next;else{if(ae(Oe),(Oe=be=Oe.prev)===Oe.next)break;Me=!0}while(Me||Oe!==be);return be}function ie(H,be,Me,Oe,Se,Ue,qe){if(H){!qe&&Ue&&function(lt,en,Bt,Vt){var bt=lt;do bt.z===null&&(bt.z=Fe(bt.x,bt.y,en,Bt,Vt)),bt.prevZ=bt.prev,bt.nextZ=bt.next,bt=bt.next;while(bt!==lt);bt.prevZ.nextZ=null,bt.prevZ=null,function(Dn){var wn,gn,qn,yn,ai,Fi,Pi,Vi,Rr=1;do{for(gn=Dn,Dn=null,ai=null,Fi=0;gn;){for(Fi++,qn=gn,Pi=0,wn=0;wn<Rr&&(Pi++,qn=qn.nextZ);wn++);for(Vi=Rr;Pi>0||Vi>0&&qn;)Pi!==0&&(Vi===0||!qn||gn.z<=qn.z)?(yn=gn,gn=gn.nextZ,Pi--):(yn=qn,qn=qn.nextZ,Vi--),ai?ai.nextZ=yn:Dn=yn,yn.prevZ=ai,ai=yn;gn=qn}ai.nextZ=null,Rr*=2}while(Fi>1)}(bt)}(H,Oe,Se,Ue);for(var at,rt,Qt=H;H.prev!==H.next;)if(at=H.prev,rt=H.next,Ue?oe(H,Oe,Se,Ue):k(H))be.push(at.i/Me),be.push(H.i/Me),be.push(rt.i/Me),ae(H),H=rt.next,Qt=rt.next;else if((H=rt)===Qt){qe?qe===1?ie(H=X(B(H),be,Me),be,Me,Oe,Se,Ue,2):qe===2&&K(H,be,Me,Oe,Se,Ue):ie(B(H),be,Me,Oe,Se,Ue,1);break}}}function k(H){var be=H.prev,Me=H,Oe=H.next;if(j(be,Me,Oe)>=0)return!1;for(var Se=H.next.next;Se!==H.prev;){if(A(be.x,be.y,Me.x,Me.y,Oe.x,Oe.y,Se.x,Se.y)&&j(Se.prev,Se,Se.next)>=0)return!1;Se=Se.next}return!0}function oe(H,be,Me,Oe){var Se=H.prev,Ue=H,qe=H.next;if(j(Se,Ue,qe)>=0)return!1;for(var at=Se.x<Ue.x?Se.x<qe.x?Se.x:qe.x:Ue.x<qe.x?Ue.x:qe.x,rt=Se.y<Ue.y?Se.y<qe.y?Se.y:qe.y:Ue.y<qe.y?Ue.y:qe.y,Qt=Se.x>Ue.x?Se.x>qe.x?Se.x:qe.x:Ue.x>qe.x?Ue.x:qe.x,lt=Se.y>Ue.y?Se.y>qe.y?Se.y:qe.y:Ue.y>qe.y?Ue.y:qe.y,en=Fe(at,rt,be,Me,Oe),Bt=Fe(Qt,lt,be,Me,Oe),Vt=H.prevZ,bt=H.nextZ;Vt&&Vt.z>=en&&bt&&bt.z<=Bt;){if(Vt!==H.prev&&Vt!==H.next&&A(Se.x,Se.y,Ue.x,Ue.y,qe.x,qe.y,Vt.x,Vt.y)&&j(Vt.prev,Vt,Vt.next)>=0||(Vt=Vt.prevZ,bt!==H.prev&&bt!==H.next&&A(Se.x,Se.y,Ue.x,Ue.y,qe.x,qe.y,bt.x,bt.y)&&j(bt.prev,bt,bt.next)>=0))return!1;bt=bt.nextZ}for(;Vt&&Vt.z>=en;){if(Vt!==H.prev&&Vt!==H.next&&A(Se.x,Se.y,Ue.x,Ue.y,qe.x,qe.y,Vt.x,Vt.y)&&j(Vt.prev,Vt,Vt.next)>=0)return!1;Vt=Vt.prevZ}for(;bt&&bt.z<=Bt;){if(bt!==H.prev&&bt!==H.next&&A(Se.x,Se.y,Ue.x,Ue.y,qe.x,qe.y,bt.x,bt.y)&&j(bt.prev,bt,bt.next)>=0)return!1;bt=bt.nextZ}return!0}function X(H,be,Me){var Oe=H;do{var Se=Oe.prev,Ue=Oe.next.next;!D(Se,Ue)&&z(Se,Oe,Oe.next,Ue)&&et(Se,Ue)&&et(Ue,Se)&&(be.push(Se.i/Me),be.push(Oe.i/Me),be.push(Ue.i/Me),ae(Oe),ae(Oe.next),Oe=H=Ue),Oe=Oe.next}while(Oe!==H);return B(Oe)}function K(H,be,Me,Oe,Se,Ue){var qe=H;do{for(var at=qe.next.next;at!==qe.prev;){if(qe.i!==at.i&&O(qe,at)){var rt=ft(qe,at);return qe=B(qe,qe.next),rt=B(rt,rt.next),ie(qe,be,Me,Oe,Se,Ue),void ie(rt,be,Me,Oe,Se,Ue)}at=at.next}qe=qe.next}while(qe!==H)}function le(H,be){return H.x-be.x}function Ee(H,be){var Me=function(Ue,qe){var at,rt=qe,Qt=Ue.x,lt=Ue.y,en=-1/0;do{if(lt<=rt.y&<>=rt.next.y&&rt.next.y!==rt.y){var Bt=rt.x+(lt-rt.y)*(rt.next.x-rt.x)/(rt.next.y-rt.y);if(Bt<=Qt&&Bt>en){if(en=Bt,Bt===Qt){if(lt===rt.y)return rt;if(lt===rt.next.y)return rt.next}at=rt.x<rt.next.x?rt:rt.next}}rt=rt.next}while(rt!==qe);if(!at)return null;if(Qt===en)return at;var Vt,bt=at,Dn=at.x,wn=at.y,gn=1/0;rt=at;do Qt>=rt.x&&rt.x>=Dn&&Qt!==rt.x&&A(lt<wn?Qt:en,lt,Dn,wn,lt<wn?en:Qt,lt,rt.x,rt.y)&&(Vt=Math.abs(lt-rt.y)/(Qt-rt.x),et(rt,Ue)&&(Vt<gn||Vt===gn&&(rt.x>at.x||rt.x===at.x&&Xe(at,rt)))&&(at=rt,gn=Vt)),rt=rt.next;while(rt!==bt);return at}(H,be);if(!Me)return be;var Oe=ft(Me,H),Se=B(Me,Me.next);return B(Oe,Oe.next),be===Me?Se:be}function Xe(H,be){return j(H.prev,H,be.prev)<0&&j(be.next,H,H.next)<0}function Fe(H,be,Me,Oe,Se){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=32767*(H-Me)*Se)|H<<8))|H<<4))|H<<2))|H<<1))|(be=1431655765&((be=858993459&((be=252645135&((be=16711935&((be=32767*(be-Oe)*Se)|be<<8))|be<<4))|be<<2))|be<<1))<<1}function S(H){var be=H,Me=H;do(be.x<Me.x||be.x===Me.x&&be.y<Me.y)&&(Me=be),be=be.next;while(be!==H);return Me}function A(H,be,Me,Oe,Se,Ue,qe,at){return(Se-qe)*(be-at)-(H-qe)*(Ue-at)>=0&&(H-qe)*(Oe-at)-(Me-qe)*(be-at)>=0&&(Me-qe)*(Ue-at)-(Se-qe)*(Oe-at)>=0}function O(H,be){return H.next.i!==be.i&&H.prev.i!==be.i&&!function(Me,Oe){var Se=Me;do{if(Se.i!==Me.i&&Se.next.i!==Me.i&&Se.i!==Oe.i&&Se.next.i!==Oe.i&&z(Se,Se.next,Me,Oe))return!0;Se=Se.next}while(Se!==Me);return!1}(H,be)&&(et(H,be)&&et(be,H)&&function(Me,Oe){var Se=Me,Ue=!1,qe=(Me.x+Oe.x)/2,at=(Me.y+Oe.y)/2;do Se.y>at!=Se.next.y>at&&Se.next.y!==Se.y&&qe<(Se.next.x-Se.x)*(at-Se.y)/(Se.next.y-Se.y)+Se.x&&(Ue=!Ue),Se=Se.next;while(Se!==Me);return Ue}(H,be)&&(j(H.prev,H,be.prev)||j(H,be.prev,be))||D(H,be)&&j(H.prev,H,H.next)>0&&j(be.prev,be,be.next)>0)}function j(H,be,Me){return(be.y-H.y)*(Me.x-be.x)-(be.x-H.x)*(Me.y-be.y)}function D(H,be){return H.x===be.x&&H.y===be.y}function z(H,be,Me,Oe){var Se=ee(j(H,be,Me)),Ue=ee(j(H,be,Oe)),qe=ee(j(Me,Oe,H)),at=ee(j(Me,Oe,be));return Se!==Ue&&qe!==at||!(Se!==0||!W(H,Me,be))||!(Ue!==0||!W(H,Oe,be))||!(qe!==0||!W(Me,H,Oe))||!(at!==0||!W(Me,be,Oe))}function W(H,be,Me){return be.x<=Math.max(H.x,Me.x)&&be.x>=Math.min(H.x,Me.x)&&be.y<=Math.max(H.y,Me.y)&&be.y>=Math.min(H.y,Me.y)}function ee(H){return H>0?1:H<0?-1:0}function et(H,be){return j(H.prev,H,H.next)<0?j(H,be,H.next)>=0&&j(H,H.prev,be)>=0:j(H,be,H.prev)<0||j(H,H.next,be)<0}function ft(H,be){var Me=new Ce(H.i,H.x,H.y),Oe=new Ce(be.i,be.x,be.y),Se=H.next,Ue=be.prev;return H.next=be,be.prev=H,Me.next=Se,Se.prev=Me,Oe.next=Me,Me.prev=Oe,Ue.next=Oe,Oe.prev=Ue,Oe}function $e(H,be,Me,Oe){var Se=new Ce(H,be,Me);return Oe?(Se.next=Oe.next,Se.prev=Oe,Oe.next.prev=Se,Oe.next=Se):(Se.prev=Se,Se.next=Se),Se}function ae(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function Ce(H,be,Me){this.i=H,this.x=be,this.y=Me,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ie(H,be,Me,Oe){for(var Se=0,Ue=be,qe=Me-Oe;Ue<Me;Ue+=Oe)Se+=(H[qe]-H[Ue])*(H[Ue+1]+H[qe+1]),qe=Ue;return Se}R.exports=b,R.exports.default=b,b.deviation=function(H,be,Me,Oe){var Se=be&&be.length,Ue=Se?be[0]*Me:H.length,qe=Math.abs(Ie(H,0,Ue,Me));if(Se)for(var at=0,rt=be.length;at<rt;at++){var Qt=be[at]*Me,lt=at<rt-1?be[at+1]*Me:H.length;qe-=Math.abs(Ie(H,Qt,lt,Me))}var en=0;for(at=0;at<Oe.length;at+=3){var Bt=Oe[at]*Me,Vt=Oe[at+1]*Me,bt=Oe[at+2]*Me;en+=Math.abs((H[Bt]-H[bt])*(H[Vt+1]-H[Bt+1])-(H[Bt]-H[Vt])*(H[bt+1]-H[Bt+1]))}return qe===0&&en===0?0:Math.abs((en-qe)/qe)},b.flatten=function(H){for(var be=H[0][0].length,Me={vertices:[],holes:[],dimensions:be},Oe=0,Se=0;Se<H.length;Se++){for(var Ue=0;Ue<H[Se].length;Ue++)for(var qe=0;qe<be;qe++)Me.vertices.push(H[Se][Ue][qe]);Se>0&&(Oe+=H[Se-1].length,Me.holes.push(Oe))}return Me}},function(R,L,v){(function(b){var q=v(12),B=v(13),ie=setTimeout;function k(A){return Boolean(A&&A.length!==void 0)}function oe(){}function X(A){if(!(this instanceof X))throw new TypeError("Promises must be constructed via new");if(typeof A!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],S(A,this)}function K(A,O){for(;A._state===3;)A=A._value;A._state!==0?(A._handled=!0,X._immediateFn(function(){var j=A._state===1?O.onFulfilled:O.onRejected;if(j!==null){var D;try{D=j(A._value)}catch(z){return void Ee(O.promise,z)}le(O.promise,D)}else(A._state===1?le:Ee)(O.promise,A._value)})):A._deferreds.push(O)}function le(A,O){try{if(O===A)throw new TypeError("A promise cannot be resolved with itself.");if(O&&(typeof O=="object"||typeof O=="function")){var j=O.then;if(O instanceof X)return A._state=3,A._value=O,void Xe(A);if(typeof j=="function")return void S((D=j,z=O,function(){D.apply(z,arguments)}),A)}A._state=1,A._value=O,Xe(A)}catch(W){Ee(A,W)}var D,z}function Ee(A,O){A._state=2,A._value=O,Xe(A)}function Xe(A){A._state===2&&A._deferreds.length===0&&X._immediateFn(function(){A._handled||X._unhandledRejectionFn(A._value)});for(var O=0,j=A._deferreds.length;O<j;O++)K(A,A._deferreds[O]);A._deferreds=null}function Fe(A,O,j){this.onFulfilled=typeof A=="function"?A:null,this.onRejected=typeof O=="function"?O:null,this.promise=j}function S(A,O){var j=!1;try{A(function(D){j||(j=!0,le(O,D))},function(D){j||(j=!0,Ee(O,D))})}catch(D){if(j)return;j=!0,Ee(O,D)}}X.prototype.catch=function(A){return this.then(null,A)},X.prototype.then=function(A,O){var j=new this.constructor(oe);return K(this,new Fe(A,O,j)),j},X.prototype.finally=q.a,X.all=function(A){return new X(function(O,j){if(!k(A))return j(new TypeError("Promise.all accepts an array"));var D=Array.prototype.slice.call(A);if(D.length===0)return O([]);var z=D.length;function W(et,ft){try{if(ft&&(typeof ft=="object"||typeof ft=="function")){var $e=ft.then;if(typeof $e=="function")return void $e.call(ft,function(ae){W(et,ae)},j)}D[et]=ft,--z==0&&O(D)}catch(ae){j(ae)}}for(var ee=0;ee<D.length;ee++)W(ee,D[ee])})},X.allSettled=B.a,X.resolve=function(A){return A&&typeof A=="object"&&A.constructor===X?A:new X(function(O){O(A)})},X.reject=function(A){return new X(function(O,j){j(A)})},X.race=function(A){return new X(function(O,j){if(!k(A))return j(new TypeError("Promise.race accepts an array"));for(var D=0,z=A.length;D<z;D++)X.resolve(A[D]).then(O,j)})},X._immediateFn=typeof b=="function"&&function(A){b(A)}||function(A){ie(A,0)},X._unhandledRejectionFn=function(A){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",A)},L.a=X}).call(this,v(18).setImmediate)},function(R,L,v){L.a=function(b){var q=this.constructor;return this.then(function(B){return q.resolve(b()).then(function(){return B})},function(B){return q.resolve(b()).then(function(){return q.reject(B)})})}},function(R,L,v){L.a=function(b){return new this(function(q,B){if(!b||b.length===void 0)return B(new TypeError(typeof b+" "+b+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var ie=Array.prototype.slice.call(b);if(ie.length===0)return q([]);var k=ie.length;function oe(K,le){if(le&&(typeof le=="object"||typeof le=="function")){var Ee=le.then;if(typeof Ee=="function")return void Ee.call(le,function(Xe){oe(K,Xe)},function(Xe){ie[K]={status:"rejected",reason:Xe},--k==0&&q(ie)})}ie[K]={status:"fulfilled",value:le},--k==0&&q(ie)}for(var X=0;X<ie.length;X++)oe(X,ie[X])})}},function(R,L,v){/*
|
|
27
|
+
}`;var Je=Hl(function(){return zn(ce,yt+"return "+tt).apply(void 0,_e)});if(Je.source=tt,hd(Je))throw Je;return Je},T.times=function(h,p){if((h=qt(h))<1||h>9007199254740991)return[];var x=4294967295,E=ni(h,4294967295);h-=4294967295;for(var P=Gu(E,p=Pt(p));++x<h;)p(x);return P},T.toFinite=Eo,T.toInteger=qt,T.toLength=Bf,T.toLower=function(h){return on(h).toLowerCase()},T.toNumber=ur,T.toSafeInteger=function(h){return h?xo(qt(h),-9007199254740991,9007199254740991):h===0?h:0},T.toString=on,T.toUpper=function(h){return on(h).toUpperCase()},T.trim=function(h,p,x){if((h=on(h))&&(x||p===void 0))return Ac(h);if(!h||!(p=Kn(p)))return h;var E=bi(h),P=bi(p);return st(E,Pc(E,P),Cc(E,P)+1).join("")},T.trimEnd=function(h,p,x){if((h=on(h))&&(x||p===void 0))return h.slice(0,jo(h)+1);if(!h||!(p=Kn(p)))return h;var E=bi(h);return st(E,0,Cc(E,bi(p))+1).join("")},T.trimStart=function(h,p,x){if((h=on(h))&&(x||p===void 0))return h.replace(ai,"");if(!h||!(p=Kn(p)))return h;var E=bi(h);return st(E,Pc(E,bi(p))).join("")},T.truncate=function(h,p){var x=30,E="...";if(Bn(p)){var P="separator"in p?p.separator:P;x="length"in p?qt(p.length):x,E="omission"in p?Kn(p.omission):E}var j=(h=on(h)).length;if(Ps(h)){var re=bi(h);j=re.length}if(x>=j)return h;var ce=x-mo(E);if(ce<1)return E;var _e=re?st(re,0,ce).join(""):h.slice(0,ce);if(P===void 0)return _e+E;if(re&&(ce+=_e.length-ce),dd(P)){if(h.slice(ce).search(P)){var He,ze=_e;for(P.global||(P=ml(P.source,on(uo.exec(P))+"g")),P.lastIndex=0;He=P.exec(ze);)var tt=He.index;_e=_e.slice(0,tt===void 0?ce:tt)}}else if(h.indexOf(Kn(P),ce)!=ce){var vt=_e.lastIndexOf(P);vt>-1&&(_e=_e.slice(0,vt))}return _e+E},T.unescape=function(h){return(h=on(h))&<.test(h)?h.replace(rt,fl):h},T.uniqueId=function(h){var p=++xg;return on(h)+p},T.upperCase=Hf,T.upperFirst=Gl,T.each=Tf,T.eachRight=Sf,T.first=od,Ah(T,(Ih={},Jr(T,function(h,p){un.call(T.prototype,p)||(Ih[p]=h)}),Ih),{chain:!1}),T.VERSION="4.17.21",ji(["bind","bindKey","curry","curryRight","partial","partialRight"],function(h){T[h].placeholder=T}),ji(["drop","take"],function(h,p){Ht.prototype[h]=function(x){x=x===void 0?1:Sn(qt(x),0);var E=this.__filtered__&&!p?new Ht(this):this.clone();return E.__filtered__?E.__takeCount__=ni(x,E.__takeCount__):E.__views__.push({size:ni(x,4294967295),type:h+(E.__dir__<0?"Right":"")}),E},Ht.prototype[h+"Right"]=function(x){return this.reverse()[h](x).reverse()}}),ji(["filter","map","takeWhile"],function(h,p){var x=p+1,E=x==1||x==3;Ht.prototype[h]=function(P){var j=this.clone();return j.__iteratees__.push({iteratee:Pt(P,3),type:x}),j.__filtered__=j.__filtered__||E,j}}),ji(["head","last"],function(h,p){var x="take"+(p?"Right":"");Ht.prototype[h]=function(){return this[x](1).value()[0]}}),ji(["initial","tail"],function(h,p){var x="drop"+(p?"":"Right");Ht.prototype[h]=function(){return this.__filtered__?new Ht(this):this[x](1)}}),Ht.prototype.compact=function(){return this.filter(Hi)},Ht.prototype.find=function(h){return this.filter(h).head()},Ht.prototype.findLast=function(h){return this.reverse().find(h)},Ht.prototype.invokeMap=Yt(function(h,p){return typeof h=="function"?new Ht(this):this.map(function(x){return wa(x,h,p)})}),Ht.prototype.reject=function(h){return this.filter(Dl(Pt(h)))},Ht.prototype.slice=function(h,p){h=qt(h);var x=this;return x.__filtered__&&(h>0||p<0)?new Ht(x):(h<0?x=x.takeRight(-h):h&&(x=x.drop(h)),p!==void 0&&(x=(p=qt(p))<0?x.dropRight(-p):x.take(p-h)),x)},Ht.prototype.takeRightWhile=function(h){return this.reverse().takeWhile(h).reverse()},Ht.prototype.toArray=function(){return this.take(4294967295)},Jr(Ht.prototype,function(h,p){var x=/^(?:filter|find|map|reject)|While$/.test(p),E=/^(?:head|last)$/.test(p),P=T[E?"take"+(p=="last"?"Right":""):p],j=E||/^find/.test(p);P&&(T.prototype[p]=function(){var re=this.__wrapped__,ce=E?[1]:arguments,_e=re instanceof Ht,He=ce[0],ze=_e||Ut(re),tt=function(Et){var mt=P.apply(T,po([Et],ce));return E&&vt?mt[0]:mt};ze&&x&&typeof He=="function"&&He.length!=1&&(_e=ze=!1);var vt=this.__chain__,yt=!!this.__actions__.length,Ct=j&&!vt,Je=_e&&!yt;if(!j&&ze){re=Je?re:new Ht(this);var nt=h.apply(re,ce);return nt.__actions__.push({func:mh,args:[tt],thisArg:void 0}),new In(nt,vt)}return Ct&&Je?h.apply(this,ce):(nt=this.thru(tt),Ct?E?nt.value()[0]:nt.value():nt)})}),ji(["pop","push","shift","sort","splice","unshift"],function(h){var p=gl[h],x=/^(?:push|sort|unshift)$/.test(h)?"tap":"thru",E=/^(?:pop|shift)$/.test(h);T.prototype[h]=function(){var P=arguments;if(E&&!this.__chain__){var j=this.value();return p.apply(Ut(j)?j:[],P)}return this[x](function(re){return p.apply(Ut(re)?re:[],P)})}}),Jr(Ht.prototype,function(h,p){var x=T[p];if(x){var E=x.name+"";un.call(fr,E)||(fr[E]=[]),fr[E].push({name:p,func:x})}}),fr[Pa(void 0,2).name]=[{name:"wrapper",func:void 0}],Ht.prototype.clone=function(){var h=new Ht(this.__wrapped__);return h.__actions__=ui(this.__actions__),h.__dir__=this.__dir__,h.__filtered__=this.__filtered__,h.__iteratees__=ui(this.__iteratees__),h.__takeCount__=this.__takeCount__,h.__views__=ui(this.__views__),h},Ht.prototype.reverse=function(){if(this.__filtered__){var h=new Ht(this);h.__dir__=-1,h.__filtered__=!0}else(h=this.clone()).__dir__*=-1;return h},Ht.prototype.value=function(){var h=this.__wrapped__.value(),p=this.__dir__,x=Ut(h),E=p<0,P=x?h.length:0,j=function(jt,Tt,Ot){for(var Wn=-1,Ei=Ot.length;++Wn<Ei;){var Xn=Ot[Wn],kn=Xn.size;switch(Xn.type){case"drop":jt+=kn;break;case"dropRight":Tt-=kn;break;case"take":Tt=ni(Tt,jt+kn);break;case"takeRight":jt=Sn(jt,Tt-kn)}}return{start:jt,end:Tt}}(0,P,this.__views__),re=j.start,ce=j.end,_e=ce-re,He=E?ce:re-1,ze=this.__iteratees__,tt=ze.length,vt=0,yt=ni(_e,this.__takeCount__);if(!x||!E&&P==_e&&yt==_e)return Wc(h,this.__actions__);var Ct=[];e:for(;_e--&&vt<yt;){for(var Je=-1,nt=h[He+=p];++Je<tt;){var Et=ze[Je],mt=Et.iteratee,St=Et.type,It=mt(nt);if(St==2)nt=It;else if(!It){if(St==1)continue e;break e}}Ct[vt++]=nt}return Ct},T.prototype.at=Vg,T.prototype.chain=function(){return wf(this)},T.prototype.commit=function(){return new In(this.value(),this.__chain__)},T.prototype.next=function(){this.__values__===void 0&&(this.__values__=Ff(this.value()));var h=this.__index__>=this.__values__.length;return{done:h,value:h?void 0:this.__values__[this.__index__++]}},T.prototype.plant=function(h){for(var p,x=this;x instanceof wl;){var E=vf(x);E.__index__=0,E.__values__=void 0,p?P.__wrapped__=E:p=E;var P=E;x=x.__wrapped__}return P.__wrapped__=h,p},T.prototype.reverse=function(){var h=this.__wrapped__;if(h instanceof Ht){var p=h;return this.__actions__.length&&(p=new Ht(this)),(p=p.reverse()).__actions__.push({func:mh,args:[sd],thisArg:void 0}),new In(p,this.__chain__)}return this.thru(sd)},T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=function(){return Wc(this.__wrapped__,this.__actions__)},T.prototype.first=T.prototype.head,Xr&&(T.prototype[Xr]=function(){return this}),T}();Nn._=Cs,(B=function(){return Cs}.call(L,v,L,q))===void 0||(q.exports=B)}).call(this)}).call(this,v(4),v(8)(C))},function(C,L,v){Object.defineProperty(L,"__esModule",{value:!0});var b=function(){function oe(X,K){for(var le=0;le<K.length;le++){var Ee=K[le];Ee.enumerable=Ee.enumerable||!1,Ee.configurable=!0,"value"in Ee&&(Ee.writable=!0),Object.defineProperty(X,Ee.key,Ee)}}return function(X,K,le){return K&&oe(X.prototype,K),le&&oe(X,le),X}}();function q(oe,X){if(!(oe instanceof X))throw new TypeError("Cannot call a class as a function")}var B=function(){function oe(X,K,le){K===void 0&&(K=!1),q(this,oe),this._fn=X,this._once=K,this._thisArg=le,this._next=this._prev=this._owner=null}return b(oe,[{key:"detach",value:function(){return this._owner!==null&&(this._owner.detach(this),!0)}}]),oe}();function ie(oe,X){return oe._head?(oe._tail._next=X,X._prev=oe._tail,oe._tail=X):(oe._head=X,oe._tail=X),X._owner=oe,X}var k=function(){function oe(){q(this,oe),this._head=this._tail=void 0}return b(oe,[{key:"handlers",value:function(){var X=!(arguments.length<=0||arguments[0]===void 0)&&arguments[0],K=this._head;if(X)return!!K;for(var le=[];K;)le.push(K),K=K._next;return le}},{key:"has",value:function(X){if(!(X instanceof B))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return X._owner===this}},{key:"dispatch",value:function(){var X=this._head;if(!X)return!1;for(;X;)X._once&&this.detach(X),X._fn.apply(X._thisArg,arguments),X=X._next;return!0}},{key:"add",value:function(X){var K=arguments.length<=1||arguments[1]===void 0?null:arguments[1];if(typeof X!="function")throw new Error("MiniSignal#add(): First arg must be a Function.");return ie(this,new B(X,!1,K))}},{key:"once",value:function(X){var K=arguments.length<=1||arguments[1]===void 0?null:arguments[1];if(typeof X!="function")throw new Error("MiniSignal#once(): First arg must be a Function.");return ie(this,new B(X,!0,K))}},{key:"detach",value:function(X){if(!(X instanceof B))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return X._owner!==this||(X._prev&&(X._prev._next=X._next),X._next&&(X._next._prev=X._prev),X===this._head?(this._head=X._next,X._next===null&&(this._tail=null)):X===this._tail&&(this._tail=X._prev,this._tail._next=null),X._owner=null),this}},{key:"detachAll",value:function(){var X=this._head;if(!X)return this;for(this._head=this._tail=null;X;)X._owner=null,X=X._next;return this}}]),oe}();k.MiniSignalBinding=B,L.default=k,C.exports=L.default},function(C,L,v){var b;(function(q){function B(D,z){var W=(65535&D)+(65535&z);return(D>>16)+(z>>16)+(W>>16)<<16|65535&W}function ie(D,z,W,ee,et,ft){return B(($e=B(B(z,D),B(ee,ft)))<<(ae=et)|$e>>>32-ae,W);var $e,ae}function k(D,z,W,ee,et,ft,$e){return ie(z&W|~z&ee,D,z,et,ft,$e)}function oe(D,z,W,ee,et,ft,$e){return ie(z&ee|W&~ee,D,z,et,ft,$e)}function X(D,z,W,ee,et,ft,$e){return ie(z^W^ee,D,z,et,ft,$e)}function K(D,z,W,ee,et,ft,$e){return ie(W^(z|~ee),D,z,et,ft,$e)}function le(D,z){var W,ee,et,ft,$e;D[z>>5]|=128<<z%32,D[14+(z+64>>>9<<4)]=z;var ae=1732584193,Ce=-271733879,Ie=-1732584194,H=271733878;for(W=0;W<D.length;W+=16)ee=ae,et=Ce,ft=Ie,$e=H,ae=k(ae,Ce,Ie,H,D[W],7,-680876936),H=k(H,ae,Ce,Ie,D[W+1],12,-389564586),Ie=k(Ie,H,ae,Ce,D[W+2],17,606105819),Ce=k(Ce,Ie,H,ae,D[W+3],22,-1044525330),ae=k(ae,Ce,Ie,H,D[W+4],7,-176418897),H=k(H,ae,Ce,Ie,D[W+5],12,1200080426),Ie=k(Ie,H,ae,Ce,D[W+6],17,-1473231341),Ce=k(Ce,Ie,H,ae,D[W+7],22,-45705983),ae=k(ae,Ce,Ie,H,D[W+8],7,1770035416),H=k(H,ae,Ce,Ie,D[W+9],12,-1958414417),Ie=k(Ie,H,ae,Ce,D[W+10],17,-42063),Ce=k(Ce,Ie,H,ae,D[W+11],22,-1990404162),ae=k(ae,Ce,Ie,H,D[W+12],7,1804603682),H=k(H,ae,Ce,Ie,D[W+13],12,-40341101),Ie=k(Ie,H,ae,Ce,D[W+14],17,-1502002290),ae=oe(ae,Ce=k(Ce,Ie,H,ae,D[W+15],22,1236535329),Ie,H,D[W+1],5,-165796510),H=oe(H,ae,Ce,Ie,D[W+6],9,-1069501632),Ie=oe(Ie,H,ae,Ce,D[W+11],14,643717713),Ce=oe(Ce,Ie,H,ae,D[W],20,-373897302),ae=oe(ae,Ce,Ie,H,D[W+5],5,-701558691),H=oe(H,ae,Ce,Ie,D[W+10],9,38016083),Ie=oe(Ie,H,ae,Ce,D[W+15],14,-660478335),Ce=oe(Ce,Ie,H,ae,D[W+4],20,-405537848),ae=oe(ae,Ce,Ie,H,D[W+9],5,568446438),H=oe(H,ae,Ce,Ie,D[W+14],9,-1019803690),Ie=oe(Ie,H,ae,Ce,D[W+3],14,-187363961),Ce=oe(Ce,Ie,H,ae,D[W+8],20,1163531501),ae=oe(ae,Ce,Ie,H,D[W+13],5,-1444681467),H=oe(H,ae,Ce,Ie,D[W+2],9,-51403784),Ie=oe(Ie,H,ae,Ce,D[W+7],14,1735328473),ae=X(ae,Ce=oe(Ce,Ie,H,ae,D[W+12],20,-1926607734),Ie,H,D[W+5],4,-378558),H=X(H,ae,Ce,Ie,D[W+8],11,-2022574463),Ie=X(Ie,H,ae,Ce,D[W+11],16,1839030562),Ce=X(Ce,Ie,H,ae,D[W+14],23,-35309556),ae=X(ae,Ce,Ie,H,D[W+1],4,-1530992060),H=X(H,ae,Ce,Ie,D[W+4],11,1272893353),Ie=X(Ie,H,ae,Ce,D[W+7],16,-155497632),Ce=X(Ce,Ie,H,ae,D[W+10],23,-1094730640),ae=X(ae,Ce,Ie,H,D[W+13],4,681279174),H=X(H,ae,Ce,Ie,D[W],11,-358537222),Ie=X(Ie,H,ae,Ce,D[W+3],16,-722521979),Ce=X(Ce,Ie,H,ae,D[W+6],23,76029189),ae=X(ae,Ce,Ie,H,D[W+9],4,-640364487),H=X(H,ae,Ce,Ie,D[W+12],11,-421815835),Ie=X(Ie,H,ae,Ce,D[W+15],16,530742520),ae=K(ae,Ce=X(Ce,Ie,H,ae,D[W+2],23,-995338651),Ie,H,D[W],6,-198630844),H=K(H,ae,Ce,Ie,D[W+7],10,1126891415),Ie=K(Ie,H,ae,Ce,D[W+14],15,-1416354905),Ce=K(Ce,Ie,H,ae,D[W+5],21,-57434055),ae=K(ae,Ce,Ie,H,D[W+12],6,1700485571),H=K(H,ae,Ce,Ie,D[W+3],10,-1894986606),Ie=K(Ie,H,ae,Ce,D[W+10],15,-1051523),Ce=K(Ce,Ie,H,ae,D[W+1],21,-2054922799),ae=K(ae,Ce,Ie,H,D[W+8],6,1873313359),H=K(H,ae,Ce,Ie,D[W+15],10,-30611744),Ie=K(Ie,H,ae,Ce,D[W+6],15,-1560198380),Ce=K(Ce,Ie,H,ae,D[W+13],21,1309151649),ae=K(ae,Ce,Ie,H,D[W+4],6,-145523070),H=K(H,ae,Ce,Ie,D[W+11],10,-1120210379),Ie=K(Ie,H,ae,Ce,D[W+2],15,718787259),Ce=K(Ce,Ie,H,ae,D[W+9],21,-343485551),ae=B(ae,ee),Ce=B(Ce,et),Ie=B(Ie,ft),H=B(H,$e);return[ae,Ce,Ie,H]}function Ee(D){var z,W="",ee=32*D.length;for(z=0;z<ee;z+=8)W+=String.fromCharCode(D[z>>5]>>>z%32&255);return W}function Xe(D){var z,W=[];for(W[(D.length>>2)-1]=void 0,z=0;z<W.length;z+=1)W[z]=0;var ee=8*D.length;for(z=0;z<ee;z+=8)W[z>>5]|=(255&D.charCodeAt(z/8))<<z%32;return W}function Fe(D){var z,W,ee="";for(W=0;W<D.length;W+=1)z=D.charCodeAt(W),ee+="0123456789abcdef".charAt(z>>>4&15)+"0123456789abcdef".charAt(15&z);return ee}function S(D){return unescape(encodeURIComponent(D))}function A(D){return function(z){return Ee(le(Xe(z),8*z.length))}(S(D))}function O(D,z){return function(W,ee){var et,ft,$e=Xe(W),ae=[],Ce=[];for(ae[15]=Ce[15]=void 0,$e.length>16&&($e=le($e,8*W.length)),et=0;et<16;et+=1)ae[et]=909522486^$e[et],Ce[et]=1549556828^$e[et];return ft=le(ae.concat(Xe(ee)),512+8*ee.length),Ee(le(Ce.concat(ft),640))}(S(D),S(z))}function V(D,z,W){return z?W?O(z,D):Fe(O(z,D)):W?A(D):Fe(A(D))}(b=function(){return V}.call(L,v,L,C))===void 0||(C.exports=b)})()},function(C,L){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}C.exports=v},function(C,L,v){var b=v(21),q=v(22);function B(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}L.parse=D,L.resolve=function(z,W){return D(z,!1,!0).resolve(W)},L.resolveObject=function(z,W){return z?D(z,!1,!0).resolveObject(W):W},L.format=function(z){return q.isString(z)&&(z=D(z)),z instanceof B?z.format():B.prototype.format.call(z)},L.Url=B;var ie=/^([a-z0-9.+-]+:)/i,k=/:[0-9]*$/,oe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,X=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
28
|
+
`," "]),K=["'"].concat(X),le=["%","/","?",";","#"].concat(K),Ee=["/","?","#"],Xe=/^[+a-z0-9A-Z_-]{0,63}$/,Fe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,S={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=v(23);function D(z,W,ee){if(z&&q.isObject(z)&&z instanceof B)return z;var et=new B;return et.parse(z,W,ee),et}B.prototype.parse=function(z,W,ee){if(!q.isString(z))throw new TypeError("Parameter 'url' must be a string, not "+typeof z);var et=z.indexOf("?"),ft=et!==-1&&et<z.indexOf("#")?"?":"#",$e=z.split(ft);$e[0]=$e[0].replace(/\\/g,"/");var ae=z=$e.join(ft);if(ae=ae.trim(),!ee&&z.split("#").length===1){var Ce=oe.exec(ae);if(Ce)return this.path=ae,this.href=ae,this.pathname=Ce[1],Ce[2]?(this.search=Ce[2],this.query=W?V.parse(this.search.substr(1)):this.search.substr(1)):W&&(this.search="",this.query={}),this}var Ie=ie.exec(ae);if(Ie){var H=(Ie=Ie[0]).toLowerCase();this.protocol=H,ae=ae.substr(Ie.length)}if(ee||Ie||ae.match(/^\/\/[^@\/]+@[^@\/]+/)){var be=ae.substr(0,2)==="//";!be||Ie&&A[Ie]||(ae=ae.substr(2),this.slashes=!0)}if(!A[Ie]&&(be||Ie&&!O[Ie])){for(var Me,Oe,Se=-1,Ue=0;Ue<Ee.length;Ue++)(qe=ae.indexOf(Ee[Ue]))!==-1&&(Se===-1||qe<Se)&&(Se=qe);for((Oe=Se===-1?ae.lastIndexOf("@"):ae.lastIndexOf("@",Se))!==-1&&(Me=ae.slice(0,Oe),ae=ae.slice(Oe+1),this.auth=decodeURIComponent(Me)),Se=-1,Ue=0;Ue<le.length;Ue++){var qe;(qe=ae.indexOf(le[Ue]))!==-1&&(Se===-1||qe<Se)&&(Se=qe)}Se===-1&&(Se=ae.length),this.host=ae.slice(0,Se),ae=ae.slice(Se),this.parseHost(),this.hostname=this.hostname||"";var at=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!at)for(var rt=this.hostname.split(/\./),Qt=(Ue=0,rt.length);Ue<Qt;Ue++){var lt=rt[Ue];if(lt&&!lt.match(Xe)){for(var en="",Bt=0,Vt=lt.length;Bt<Vt;Bt++)lt.charCodeAt(Bt)>127?en+="x":en+=lt[Bt];if(!en.match(Xe)){var bt=rt.slice(0,Ue),Dn=rt.slice(Ue+1),wn=lt.match(Fe);wn&&(bt.push(wn[1]),Dn.unshift(wn[2])),Dn.length&&(ae="/"+Dn.join(".")+ae),this.hostname=bt.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),at||(this.hostname=b.toASCII(this.hostname));var gn=this.port?":"+this.port:"",qn=this.hostname||"";this.host=qn+gn,this.href+=this.host,at&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ae[0]!=="/"&&(ae="/"+ae))}if(!S[H])for(Ue=0,Qt=K.length;Ue<Qt;Ue++){var yn=K[Ue];if(ae.indexOf(yn)!==-1){var ai=encodeURIComponent(yn);ai===yn&&(ai=escape(yn)),ae=ae.split(yn).join(ai)}}var Fi=ae.indexOf("#");Fi!==-1&&(this.hash=ae.substr(Fi),ae=ae.slice(0,Fi));var Pi=ae.indexOf("?");if(Pi!==-1?(this.search=ae.substr(Pi),this.query=ae.substr(Pi+1),W&&(this.query=V.parse(this.query)),ae=ae.slice(0,Pi)):W&&(this.search="",this.query={}),ae&&(this.pathname=ae),O[H]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){gn=this.pathname||"";var Vi=this.search||"";this.path=gn+Vi}return this.href=this.format(),this},B.prototype.format=function(){var z=this.auth||"";z&&(z=(z=encodeURIComponent(z)).replace(/%3A/i,":"),z+="@");var W=this.protocol||"",ee=this.pathname||"",et=this.hash||"",ft=!1,$e="";this.host?ft=z+this.host:this.hostname&&(ft=z+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(ft+=":"+this.port)),this.query&&q.isObject(this.query)&&Object.keys(this.query).length&&($e=V.stringify(this.query));var ae=this.search||$e&&"?"+$e||"";return W&&W.substr(-1)!==":"&&(W+=":"),this.slashes||(!W||O[W])&&ft!==!1?(ft="//"+(ft||""),ee&&ee.charAt(0)!=="/"&&(ee="/"+ee)):ft||(ft=""),et&&et.charAt(0)!=="#"&&(et="#"+et),ae&&ae.charAt(0)!=="?"&&(ae="?"+ae),W+ft+(ee=ee.replace(/[?#]/g,function(Ce){return encodeURIComponent(Ce)}))+(ae=ae.replace("#","%23"))+et},B.prototype.resolve=function(z){return this.resolveObject(D(z,!1,!0)).format()},B.prototype.resolveObject=function(z){if(q.isString(z)){var W=new B;W.parse(z,!1,!0),z=W}for(var ee=new B,et=Object.keys(this),ft=0;ft<et.length;ft++){var $e=et[ft];ee[$e]=this[$e]}if(ee.hash=z.hash,z.href==="")return ee.href=ee.format(),ee;if(z.slashes&&!z.protocol){for(var ae=Object.keys(z),Ce=0;Ce<ae.length;Ce++){var Ie=ae[Ce];Ie!=="protocol"&&(ee[Ie]=z[Ie])}return O[ee.protocol]&&ee.hostname&&!ee.pathname&&(ee.path=ee.pathname="/"),ee.href=ee.format(),ee}if(z.protocol&&z.protocol!==ee.protocol){if(!O[z.protocol]){for(var H=Object.keys(z),be=0;be<H.length;be++){var Me=H[be];ee[Me]=z[Me]}return ee.href=ee.format(),ee}if(ee.protocol=z.protocol,z.host||A[z.protocol])ee.pathname=z.pathname;else{for(var Oe=(z.pathname||"").split("/");Oe.length&&!(z.host=Oe.shift()););z.host||(z.host=""),z.hostname||(z.hostname=""),Oe[0]!==""&&Oe.unshift(""),Oe.length<2&&Oe.unshift(""),ee.pathname=Oe.join("/")}if(ee.search=z.search,ee.query=z.query,ee.host=z.host||"",ee.auth=z.auth,ee.hostname=z.hostname||z.host,ee.port=z.port,ee.pathname||ee.search){var Se=ee.pathname||"",Ue=ee.search||"";ee.path=Se+Ue}return ee.slashes=ee.slashes||z.slashes,ee.href=ee.format(),ee}var qe=ee.pathname&&ee.pathname.charAt(0)==="/",at=z.host||z.pathname&&z.pathname.charAt(0)==="/",rt=at||qe||ee.host&&z.pathname,Qt=rt,lt=ee.pathname&&ee.pathname.split("/")||[],en=(Oe=z.pathname&&z.pathname.split("/")||[],ee.protocol&&!O[ee.protocol]);if(en&&(ee.hostname="",ee.port=null,ee.host&&(lt[0]===""?lt[0]=ee.host:lt.unshift(ee.host)),ee.host="",z.protocol&&(z.hostname=null,z.port=null,z.host&&(Oe[0]===""?Oe[0]=z.host:Oe.unshift(z.host)),z.host=null),rt=rt&&(Oe[0]===""||lt[0]==="")),at)ee.host=z.host||z.host===""?z.host:ee.host,ee.hostname=z.hostname||z.hostname===""?z.hostname:ee.hostname,ee.search=z.search,ee.query=z.query,lt=Oe;else if(Oe.length)lt||(lt=[]),lt.pop(),lt=lt.concat(Oe),ee.search=z.search,ee.query=z.query;else if(!q.isNullOrUndefined(z.search))return en&&(ee.hostname=ee.host=lt.shift(),(wn=!!(ee.host&&ee.host.indexOf("@")>0)&&ee.host.split("@"))&&(ee.auth=wn.shift(),ee.host=ee.hostname=wn.shift())),ee.search=z.search,ee.query=z.query,q.isNull(ee.pathname)&&q.isNull(ee.search)||(ee.path=(ee.pathname?ee.pathname:"")+(ee.search?ee.search:"")),ee.href=ee.format(),ee;if(!lt.length)return ee.pathname=null,ee.search?ee.path="/"+ee.search:ee.path=null,ee.href=ee.format(),ee;for(var Bt=lt.slice(-1)[0],Vt=(ee.host||z.host||lt.length>1)&&(Bt==="."||Bt==="..")||Bt==="",bt=0,Dn=lt.length;Dn>=0;Dn--)(Bt=lt[Dn])==="."?lt.splice(Dn,1):Bt===".."?(lt.splice(Dn,1),bt++):bt&&(lt.splice(Dn,1),bt--);if(!rt&&!Qt)for(;bt--;bt)lt.unshift("..");!rt||lt[0]===""||lt[0]&<[0].charAt(0)==="/"||lt.unshift(""),Vt&<.join("/").substr(-1)!=="/"&<.push("");var wn,gn=lt[0]===""||lt[0]&<[0].charAt(0)==="/";return en&&(ee.hostname=ee.host=gn?"":lt.length?lt.shift():"",(wn=!!(ee.host&&ee.host.indexOf("@")>0)&&ee.host.split("@"))&&(ee.auth=wn.shift(),ee.host=ee.hostname=wn.shift())),(rt=rt||ee.host&<.length)&&!gn&<.unshift(""),lt.length?ee.pathname=lt.join("/"):(ee.pathname=null,ee.path=null),q.isNull(ee.pathname)&&q.isNull(ee.search)||(ee.path=(ee.pathname?ee.pathname:"")+(ee.search?ee.search:"")),ee.auth=z.auth||ee.auth,ee.slashes=ee.slashes||z.slashes,ee.href=ee.format(),ee},B.prototype.parseHost=function(){var z=this.host,W=k.exec(z);W&&((W=W[0])!==":"&&(this.port=W.substr(1)),z=z.substr(0,z.length-W.length)),z&&(this.hostname=z)}},function(C,L,v){C.exports=function(b,q){if(b){q=q||{};for(var B={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},ie=B.parser[q.strictMode?"strict":"loose"].exec(b),k={},oe=14;oe--;)k[B.key[oe]]=ie[oe]||"";return k[B.q.name]={},k[B.key[12]].replace(B.q.parser,function(X,K,le){K&&(k[B.q.name][K]=le)}),k}}},function(C,L,v){var b=v(26);C.exports=function(q,B){B=B||{};var ie=new b,k=B.inPlace||!1,oe=q.map(function(K){return k?K:{width:K.width,height:K.height,item:K}});oe=oe.sort(function(K,le){return le.width*le.height-K.width*K.height}),ie.fit(oe);var X={width:oe.reduce(function(K,le){return Math.max(K,le.x+le.width)},0),height:oe.reduce(function(K,le){return Math.max(K,le.y+le.height)},0)};return k||(X.items=oe),X}},function(C,L){C.exports=function(v){return v.webpackPolyfill||(v.deprecate=function(){},v.paths=[],v.children||(v.children=[]),Object.defineProperty(v,"loaded",{enumerable:!0,get:function(){return v.l}}),Object.defineProperty(v,"id",{enumerable:!0,get:function(){return v.i}}),v.webpackPolyfill=1),v}},function(C,L,v){var b=Object.prototype.hasOwnProperty,q="~";function B(){}function ie(K,le,Ee){this.fn=K,this.context=le,this.once=Ee||!1}function k(K,le,Ee,Xe,Fe){if(typeof Ee!="function")throw new TypeError("The listener must be a function");var S=new ie(Ee,Xe||K,Fe),A=q?q+le:le;return K._events[A]?K._events[A].fn?K._events[A]=[K._events[A],S]:K._events[A].push(S):(K._events[A]=S,K._eventsCount++),K}function oe(K,le){--K._eventsCount==0?K._events=new B:delete K._events[le]}function X(){this._events=new B,this._eventsCount=0}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(q=!1)),X.prototype.eventNames=function(){var K,le,Ee=[];if(this._eventsCount===0)return Ee;for(le in K=this._events)b.call(K,le)&&Ee.push(q?le.slice(1):le);return Object.getOwnPropertySymbols?Ee.concat(Object.getOwnPropertySymbols(K)):Ee},X.prototype.listeners=function(K){var le=q?q+K:K,Ee=this._events[le];if(!Ee)return[];if(Ee.fn)return[Ee.fn];for(var Xe=0,Fe=Ee.length,S=new Array(Fe);Xe<Fe;Xe++)S[Xe]=Ee[Xe].fn;return S},X.prototype.listenerCount=function(K){var le=q?q+K:K,Ee=this._events[le];return Ee?Ee.fn?1:Ee.length:0},X.prototype.emit=function(K,le,Ee,Xe,Fe,S){var A=q?q+K:K;if(!this._events[A])return!1;var O,V,D=this._events[A],z=arguments.length;if(D.fn){switch(D.once&&this.removeListener(K,D.fn,void 0,!0),z){case 1:return D.fn.call(D.context),!0;case 2:return D.fn.call(D.context,le),!0;case 3:return D.fn.call(D.context,le,Ee),!0;case 4:return D.fn.call(D.context,le,Ee,Xe),!0;case 5:return D.fn.call(D.context,le,Ee,Xe,Fe),!0;case 6:return D.fn.call(D.context,le,Ee,Xe,Fe,S),!0}for(V=1,O=new Array(z-1);V<z;V++)O[V-1]=arguments[V];D.fn.apply(D.context,O)}else{var W,ee=D.length;for(V=0;V<ee;V++)switch(D[V].once&&this.removeListener(K,D[V].fn,void 0,!0),z){case 1:D[V].fn.call(D[V].context);break;case 2:D[V].fn.call(D[V].context,le);break;case 3:D[V].fn.call(D[V].context,le,Ee);break;case 4:D[V].fn.call(D[V].context,le,Ee,Xe);break;default:if(!O)for(W=1,O=new Array(z-1);W<z;W++)O[W-1]=arguments[W];D[V].fn.apply(D[V].context,O)}}return!0},X.prototype.on=function(K,le,Ee){return k(this,K,le,Ee,!1)},X.prototype.once=function(K,le,Ee){return k(this,K,le,Ee,!0)},X.prototype.removeListener=function(K,le,Ee,Xe){var Fe=q?q+K:K;if(!this._events[Fe])return this;if(!le)return oe(this,Fe),this;var S=this._events[Fe];if(S.fn)S.fn!==le||Xe&&!S.once||Ee&&S.context!==Ee||oe(this,Fe);else{for(var A=0,O=[],V=S.length;A<V;A++)(S[A].fn!==le||Xe&&!S[A].once||Ee&&S[A].context!==Ee)&&O.push(S[A]);O.length?this._events[Fe]=O.length===1?O[0]:O:oe(this,Fe)}return this},X.prototype.removeAllListeners=function(K){var le;return K?(le=q?q+K:K,this._events[le]&&oe(this,le)):(this._events=new B,this._eventsCount=0),this},X.prototype.off=X.prototype.removeListener,X.prototype.addListener=X.prototype.on,X.prefixed=q,X.EventEmitter=X,C.exports=X},function(C,L,v){function b(H,be,Me){Me=Me||2;var Oe,Se,Ue,qe,at,rt,Qt,lt=be&&be.length,en=lt?be[0]*Me:H.length,Bt=q(H,0,en,Me,!0),Vt=[];if(!Bt||Bt.next===Bt.prev)return Vt;if(lt&&(Bt=function(Dn,wn,gn,qn){var yn,ai,Fi,Pi,Vi,Rr=[];for(yn=0,ai=wn.length;yn<ai;yn++)Fi=wn[yn]*qn,Pi=yn<ai-1?wn[yn+1]*qn:Dn.length,(Vi=q(Dn,Fi,Pi,qn,!1))===Vi.next&&(Vi.steiner=!0),Rr.push(S(Vi));for(Rr.sort(le),yn=0;yn<Rr.length;yn++)gn=B(gn=Ee(Rr[yn],gn),gn.next);return gn}(H,be,Bt,Me)),H.length>80*Me){Oe=Ue=H[0],Se=qe=H[1];for(var bt=Me;bt<en;bt+=Me)(at=H[bt])<Oe&&(Oe=at),(rt=H[bt+1])<Se&&(Se=rt),at>Ue&&(Ue=at),rt>qe&&(qe=rt);Qt=(Qt=Math.max(Ue-Oe,qe-Se))!==0?1/Qt:0}return ie(Bt,Vt,Me,Oe,Se,Qt),Vt}function q(H,be,Me,Oe,Se){var Ue,qe;if(Se===Ie(H,be,Me,Oe)>0)for(Ue=be;Ue<Me;Ue+=Oe)qe=$e(Ue,H[Ue],H[Ue+1],qe);else for(Ue=Me-Oe;Ue>=be;Ue-=Oe)qe=$e(Ue,H[Ue],H[Ue+1],qe);return qe&&D(qe,qe.next)&&(ae(qe),qe=qe.next),qe}function B(H,be){if(!H)return H;be||(be=H);var Me,Oe=H;do if(Me=!1,Oe.steiner||!D(Oe,Oe.next)&&V(Oe.prev,Oe,Oe.next)!==0)Oe=Oe.next;else{if(ae(Oe),(Oe=be=Oe.prev)===Oe.next)break;Me=!0}while(Me||Oe!==be);return be}function ie(H,be,Me,Oe,Se,Ue,qe){if(H){!qe&&Ue&&function(lt,en,Bt,Vt){var bt=lt;do bt.z===null&&(bt.z=Fe(bt.x,bt.y,en,Bt,Vt)),bt.prevZ=bt.prev,bt.nextZ=bt.next,bt=bt.next;while(bt!==lt);bt.prevZ.nextZ=null,bt.prevZ=null,function(Dn){var wn,gn,qn,yn,ai,Fi,Pi,Vi,Rr=1;do{for(gn=Dn,Dn=null,ai=null,Fi=0;gn;){for(Fi++,qn=gn,Pi=0,wn=0;wn<Rr&&(Pi++,qn=qn.nextZ);wn++);for(Vi=Rr;Pi>0||Vi>0&&qn;)Pi!==0&&(Vi===0||!qn||gn.z<=qn.z)?(yn=gn,gn=gn.nextZ,Pi--):(yn=qn,qn=qn.nextZ,Vi--),ai?ai.nextZ=yn:Dn=yn,yn.prevZ=ai,ai=yn;gn=qn}ai.nextZ=null,Rr*=2}while(Fi>1)}(bt)}(H,Oe,Se,Ue);for(var at,rt,Qt=H;H.prev!==H.next;)if(at=H.prev,rt=H.next,Ue?oe(H,Oe,Se,Ue):k(H))be.push(at.i/Me),be.push(H.i/Me),be.push(rt.i/Me),ae(H),H=rt.next,Qt=rt.next;else if((H=rt)===Qt){qe?qe===1?ie(H=X(B(H),be,Me),be,Me,Oe,Se,Ue,2):qe===2&&K(H,be,Me,Oe,Se,Ue):ie(B(H),be,Me,Oe,Se,Ue,1);break}}}function k(H){var be=H.prev,Me=H,Oe=H.next;if(V(be,Me,Oe)>=0)return!1;for(var Se=H.next.next;Se!==H.prev;){if(A(be.x,be.y,Me.x,Me.y,Oe.x,Oe.y,Se.x,Se.y)&&V(Se.prev,Se,Se.next)>=0)return!1;Se=Se.next}return!0}function oe(H,be,Me,Oe){var Se=H.prev,Ue=H,qe=H.next;if(V(Se,Ue,qe)>=0)return!1;for(var at=Se.x<Ue.x?Se.x<qe.x?Se.x:qe.x:Ue.x<qe.x?Ue.x:qe.x,rt=Se.y<Ue.y?Se.y<qe.y?Se.y:qe.y:Ue.y<qe.y?Ue.y:qe.y,Qt=Se.x>Ue.x?Se.x>qe.x?Se.x:qe.x:Ue.x>qe.x?Ue.x:qe.x,lt=Se.y>Ue.y?Se.y>qe.y?Se.y:qe.y:Ue.y>qe.y?Ue.y:qe.y,en=Fe(at,rt,be,Me,Oe),Bt=Fe(Qt,lt,be,Me,Oe),Vt=H.prevZ,bt=H.nextZ;Vt&&Vt.z>=en&&bt&&bt.z<=Bt;){if(Vt!==H.prev&&Vt!==H.next&&A(Se.x,Se.y,Ue.x,Ue.y,qe.x,qe.y,Vt.x,Vt.y)&&V(Vt.prev,Vt,Vt.next)>=0||(Vt=Vt.prevZ,bt!==H.prev&&bt!==H.next&&A(Se.x,Se.y,Ue.x,Ue.y,qe.x,qe.y,bt.x,bt.y)&&V(bt.prev,bt,bt.next)>=0))return!1;bt=bt.nextZ}for(;Vt&&Vt.z>=en;){if(Vt!==H.prev&&Vt!==H.next&&A(Se.x,Se.y,Ue.x,Ue.y,qe.x,qe.y,Vt.x,Vt.y)&&V(Vt.prev,Vt,Vt.next)>=0)return!1;Vt=Vt.prevZ}for(;bt&&bt.z<=Bt;){if(bt!==H.prev&&bt!==H.next&&A(Se.x,Se.y,Ue.x,Ue.y,qe.x,qe.y,bt.x,bt.y)&&V(bt.prev,bt,bt.next)>=0)return!1;bt=bt.nextZ}return!0}function X(H,be,Me){var Oe=H;do{var Se=Oe.prev,Ue=Oe.next.next;!D(Se,Ue)&&z(Se,Oe,Oe.next,Ue)&&et(Se,Ue)&&et(Ue,Se)&&(be.push(Se.i/Me),be.push(Oe.i/Me),be.push(Ue.i/Me),ae(Oe),ae(Oe.next),Oe=H=Ue),Oe=Oe.next}while(Oe!==H);return B(Oe)}function K(H,be,Me,Oe,Se,Ue){var qe=H;do{for(var at=qe.next.next;at!==qe.prev;){if(qe.i!==at.i&&O(qe,at)){var rt=ft(qe,at);return qe=B(qe,qe.next),rt=B(rt,rt.next),ie(qe,be,Me,Oe,Se,Ue),void ie(rt,be,Me,Oe,Se,Ue)}at=at.next}qe=qe.next}while(qe!==H)}function le(H,be){return H.x-be.x}function Ee(H,be){var Me=function(Ue,qe){var at,rt=qe,Qt=Ue.x,lt=Ue.y,en=-1/0;do{if(lt<=rt.y&<>=rt.next.y&&rt.next.y!==rt.y){var Bt=rt.x+(lt-rt.y)*(rt.next.x-rt.x)/(rt.next.y-rt.y);if(Bt<=Qt&&Bt>en){if(en=Bt,Bt===Qt){if(lt===rt.y)return rt;if(lt===rt.next.y)return rt.next}at=rt.x<rt.next.x?rt:rt.next}}rt=rt.next}while(rt!==qe);if(!at)return null;if(Qt===en)return at;var Vt,bt=at,Dn=at.x,wn=at.y,gn=1/0;rt=at;do Qt>=rt.x&&rt.x>=Dn&&Qt!==rt.x&&A(lt<wn?Qt:en,lt,Dn,wn,lt<wn?en:Qt,lt,rt.x,rt.y)&&(Vt=Math.abs(lt-rt.y)/(Qt-rt.x),et(rt,Ue)&&(Vt<gn||Vt===gn&&(rt.x>at.x||rt.x===at.x&&Xe(at,rt)))&&(at=rt,gn=Vt)),rt=rt.next;while(rt!==bt);return at}(H,be);if(!Me)return be;var Oe=ft(Me,H),Se=B(Me,Me.next);return B(Oe,Oe.next),be===Me?Se:be}function Xe(H,be){return V(H.prev,H,be.prev)<0&&V(be.next,H,H.next)<0}function Fe(H,be,Me,Oe,Se){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=32767*(H-Me)*Se)|H<<8))|H<<4))|H<<2))|H<<1))|(be=1431655765&((be=858993459&((be=252645135&((be=16711935&((be=32767*(be-Oe)*Se)|be<<8))|be<<4))|be<<2))|be<<1))<<1}function S(H){var be=H,Me=H;do(be.x<Me.x||be.x===Me.x&&be.y<Me.y)&&(Me=be),be=be.next;while(be!==H);return Me}function A(H,be,Me,Oe,Se,Ue,qe,at){return(Se-qe)*(be-at)-(H-qe)*(Ue-at)>=0&&(H-qe)*(Oe-at)-(Me-qe)*(be-at)>=0&&(Me-qe)*(Ue-at)-(Se-qe)*(Oe-at)>=0}function O(H,be){return H.next.i!==be.i&&H.prev.i!==be.i&&!function(Me,Oe){var Se=Me;do{if(Se.i!==Me.i&&Se.next.i!==Me.i&&Se.i!==Oe.i&&Se.next.i!==Oe.i&&z(Se,Se.next,Me,Oe))return!0;Se=Se.next}while(Se!==Me);return!1}(H,be)&&(et(H,be)&&et(be,H)&&function(Me,Oe){var Se=Me,Ue=!1,qe=(Me.x+Oe.x)/2,at=(Me.y+Oe.y)/2;do Se.y>at!=Se.next.y>at&&Se.next.y!==Se.y&&qe<(Se.next.x-Se.x)*(at-Se.y)/(Se.next.y-Se.y)+Se.x&&(Ue=!Ue),Se=Se.next;while(Se!==Me);return Ue}(H,be)&&(V(H.prev,H,be.prev)||V(H,be.prev,be))||D(H,be)&&V(H.prev,H,H.next)>0&&V(be.prev,be,be.next)>0)}function V(H,be,Me){return(be.y-H.y)*(Me.x-be.x)-(be.x-H.x)*(Me.y-be.y)}function D(H,be){return H.x===be.x&&H.y===be.y}function z(H,be,Me,Oe){var Se=ee(V(H,be,Me)),Ue=ee(V(H,be,Oe)),qe=ee(V(Me,Oe,H)),at=ee(V(Me,Oe,be));return Se!==Ue&&qe!==at||!(Se!==0||!W(H,Me,be))||!(Ue!==0||!W(H,Oe,be))||!(qe!==0||!W(Me,H,Oe))||!(at!==0||!W(Me,be,Oe))}function W(H,be,Me){return be.x<=Math.max(H.x,Me.x)&&be.x>=Math.min(H.x,Me.x)&&be.y<=Math.max(H.y,Me.y)&&be.y>=Math.min(H.y,Me.y)}function ee(H){return H>0?1:H<0?-1:0}function et(H,be){return V(H.prev,H,H.next)<0?V(H,be,H.next)>=0&&V(H,H.prev,be)>=0:V(H,be,H.prev)<0||V(H,H.next,be)<0}function ft(H,be){var Me=new Ce(H.i,H.x,H.y),Oe=new Ce(be.i,be.x,be.y),Se=H.next,Ue=be.prev;return H.next=be,be.prev=H,Me.next=Se,Se.prev=Me,Oe.next=Me,Me.prev=Oe,Ue.next=Oe,Oe.prev=Ue,Oe}function $e(H,be,Me,Oe){var Se=new Ce(H,be,Me);return Oe?(Se.next=Oe.next,Se.prev=Oe,Oe.next.prev=Se,Oe.next=Se):(Se.prev=Se,Se.next=Se),Se}function ae(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function Ce(H,be,Me){this.i=H,this.x=be,this.y=Me,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ie(H,be,Me,Oe){for(var Se=0,Ue=be,qe=Me-Oe;Ue<Me;Ue+=Oe)Se+=(H[qe]-H[Ue])*(H[Ue+1]+H[qe+1]),qe=Ue;return Se}C.exports=b,C.exports.default=b,b.deviation=function(H,be,Me,Oe){var Se=be&&be.length,Ue=Se?be[0]*Me:H.length,qe=Math.abs(Ie(H,0,Ue,Me));if(Se)for(var at=0,rt=be.length;at<rt;at++){var Qt=be[at]*Me,lt=at<rt-1?be[at+1]*Me:H.length;qe-=Math.abs(Ie(H,Qt,lt,Me))}var en=0;for(at=0;at<Oe.length;at+=3){var Bt=Oe[at]*Me,Vt=Oe[at+1]*Me,bt=Oe[at+2]*Me;en+=Math.abs((H[Bt]-H[bt])*(H[Vt+1]-H[Bt+1])-(H[Bt]-H[Vt])*(H[bt+1]-H[Bt+1]))}return qe===0&&en===0?0:Math.abs((en-qe)/qe)},b.flatten=function(H){for(var be=H[0][0].length,Me={vertices:[],holes:[],dimensions:be},Oe=0,Se=0;Se<H.length;Se++){for(var Ue=0;Ue<H[Se].length;Ue++)for(var qe=0;qe<be;qe++)Me.vertices.push(H[Se][Ue][qe]);Se>0&&(Oe+=H[Se-1].length,Me.holes.push(Oe))}return Me}},function(C,L,v){(function(b){var q=v(12),B=v(13),ie=setTimeout;function k(A){return Boolean(A&&A.length!==void 0)}function oe(){}function X(A){if(!(this instanceof X))throw new TypeError("Promises must be constructed via new");if(typeof A!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],S(A,this)}function K(A,O){for(;A._state===3;)A=A._value;A._state!==0?(A._handled=!0,X._immediateFn(function(){var V=A._state===1?O.onFulfilled:O.onRejected;if(V!==null){var D;try{D=V(A._value)}catch(z){return void Ee(O.promise,z)}le(O.promise,D)}else(A._state===1?le:Ee)(O.promise,A._value)})):A._deferreds.push(O)}function le(A,O){try{if(O===A)throw new TypeError("A promise cannot be resolved with itself.");if(O&&(typeof O=="object"||typeof O=="function")){var V=O.then;if(O instanceof X)return A._state=3,A._value=O,void Xe(A);if(typeof V=="function")return void S((D=V,z=O,function(){D.apply(z,arguments)}),A)}A._state=1,A._value=O,Xe(A)}catch(W){Ee(A,W)}var D,z}function Ee(A,O){A._state=2,A._value=O,Xe(A)}function Xe(A){A._state===2&&A._deferreds.length===0&&X._immediateFn(function(){A._handled||X._unhandledRejectionFn(A._value)});for(var O=0,V=A._deferreds.length;O<V;O++)K(A,A._deferreds[O]);A._deferreds=null}function Fe(A,O,V){this.onFulfilled=typeof A=="function"?A:null,this.onRejected=typeof O=="function"?O:null,this.promise=V}function S(A,O){var V=!1;try{A(function(D){V||(V=!0,le(O,D))},function(D){V||(V=!0,Ee(O,D))})}catch(D){if(V)return;V=!0,Ee(O,D)}}X.prototype.catch=function(A){return this.then(null,A)},X.prototype.then=function(A,O){var V=new this.constructor(oe);return K(this,new Fe(A,O,V)),V},X.prototype.finally=q.a,X.all=function(A){return new X(function(O,V){if(!k(A))return V(new TypeError("Promise.all accepts an array"));var D=Array.prototype.slice.call(A);if(D.length===0)return O([]);var z=D.length;function W(et,ft){try{if(ft&&(typeof ft=="object"||typeof ft=="function")){var $e=ft.then;if(typeof $e=="function")return void $e.call(ft,function(ae){W(et,ae)},V)}D[et]=ft,--z==0&&O(D)}catch(ae){V(ae)}}for(var ee=0;ee<D.length;ee++)W(ee,D[ee])})},X.allSettled=B.a,X.resolve=function(A){return A&&typeof A=="object"&&A.constructor===X?A:new X(function(O){O(A)})},X.reject=function(A){return new X(function(O,V){V(A)})},X.race=function(A){return new X(function(O,V){if(!k(A))return V(new TypeError("Promise.race accepts an array"));for(var D=0,z=A.length;D<z;D++)X.resolve(A[D]).then(O,V)})},X._immediateFn=typeof b=="function"&&function(A){b(A)}||function(A){ie(A,0)},X._unhandledRejectionFn=function(A){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",A)},L.a=X}).call(this,v(18).setImmediate)},function(C,L,v){L.a=function(b){var q=this.constructor;return this.then(function(B){return q.resolve(b()).then(function(){return B})},function(B){return q.resolve(b()).then(function(){return q.reject(B)})})}},function(C,L,v){L.a=function(b){return new this(function(q,B){if(!b||b.length===void 0)return B(new TypeError(typeof b+" "+b+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var ie=Array.prototype.slice.call(b);if(ie.length===0)return q([]);var k=ie.length;function oe(K,le){if(le&&(typeof le=="object"||typeof le=="function")){var Ee=le.then;if(typeof Ee=="function")return void Ee.call(le,function(Xe){oe(K,Xe)},function(Xe){ie[K]={status:"rejected",reason:Xe},--k==0&&q(ie)})}ie[K]={status:"fulfilled",value:le},--k==0&&q(ie)}for(var X=0;X<ie.length;X++)oe(X,ie[X])})}},function(C,L,v){/*
|
|
29
29
|
object-assign
|
|
30
30
|
(c) Sindre Sorhus
|
|
31
31
|
@license MIT
|
|
32
|
-
*/var b=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;function ie(k){if(k==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(k)}
|
|
32
|
+
*/var b=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;function ie(k){if(k==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(k)}C.exports=function(){try{if(!Object.assign)return!1;var k=new String("abc");if(k[5]="de",Object.getOwnPropertyNames(k)[0]==="5")return!1;for(var oe={},X=0;X<10;X++)oe["_"+String.fromCharCode(X)]=X;if(Object.getOwnPropertyNames(oe).map(function(le){return oe[le]}).join("")!=="0123456789")return!1;var K={};return"abcdefghijklmnopqrst".split("").forEach(function(le){K[le]=le}),Object.keys(Object.assign({},K)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(k,oe){for(var X,K,le=ie(k),Ee=1;Ee<arguments.length;Ee++){for(var Xe in X=Object(arguments[Ee]))q.call(X,Xe)&&(le[Xe]=X[Xe]);if(b){K=b(X);for(var Fe=0;Fe<K.length;Fe++)B.call(X,K[Fe])&&(le[K[Fe]]=X[K[Fe]])}}return le}},function(C,L){C.exports=`precision mediump float;
|
|
33
33
|
attribute vec2 aVertexPosition;
|
|
34
34
|
uniform mat3 projectionMatrix;
|
|
35
35
|
varying vec2 vTextureCoord;
|
|
@@ -46,7 +46,7 @@ void main() {
|
|
|
46
46
|
gl_Position = filterVertexPosition();
|
|
47
47
|
vTextureCoord = filterTextureCoord();
|
|
48
48
|
}
|
|
49
|
-
`},function(
|
|
49
|
+
`},function(C,L){C.exports=`precision mediump float;
|
|
50
50
|
#define KERNEL 7
|
|
51
51
|
varying vec2 vTextureCoord;
|
|
52
52
|
uniform vec4 uShapeFilterArea;
|
|
@@ -70,7 +70,7 @@ void main() {
|
|
|
70
70
|
gl_FragColor = outputColor;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
`},function(
|
|
73
|
+
`},function(C,L,v){(function(b){var q;/*!
|
|
74
74
|
* howler.js v2.2.3
|
|
75
75
|
* howlerjs.com
|
|
76
76
|
*
|
|
@@ -78,11 +78,11 @@ void main() {
|
|
|
78
78
|
* goldfirestudios.com
|
|
79
79
|
*
|
|
80
80
|
* MIT License
|
|
81
|
-
*/(function(){var B=function(){this.init()};B.prototype={init:function(){var S=this||ie;return S._counter=1e3,S._html5AudioPool=[],S.html5PoolSize=10,S._codecs={},S._howls=[],S._muted=!1,S._volume=1,S._canPlayEvent="canplaythrough",S._navigator=typeof window!="undefined"&&window.navigator?window.navigator:null,S.masterGain=null,S.noAudio=!1,S.usingWebAudio=!0,S.autoSuspend=!0,S.ctx=null,S.autoUnlock=!0,S._setup(),S},volume:function(S){var A=this||ie;if(S=parseFloat(S),A.ctx||Fe(),S!==void 0&&S>=0&&S<=1){if(A._volume=S,A._muted)return A;A.usingWebAudio&&A.masterGain.gain.setValueAtTime(S,ie.ctx.currentTime);for(var O=0;O<A._howls.length;O++)if(!A._howls[O]._webAudio)for(var j=A._howls[O]._getSoundIds(),D=0;D<j.length;D++){var z=A._howls[O]._soundById(j[D]);z&&z._node&&(z._node.volume=z._volume*S)}return A}return A._volume},mute:function(S){var A=this||ie;A.ctx||Fe(),A._muted=S,A.usingWebAudio&&A.masterGain.gain.setValueAtTime(S?0:A._volume,ie.ctx.currentTime);for(var O=0;O<A._howls.length;O++)if(!A._howls[O]._webAudio)for(var j=A._howls[O]._getSoundIds(),D=0;D<j.length;D++){var z=A._howls[O]._soundById(j[D]);z&&z._node&&(z._node.muted=!!S||z._muted)}return A},stop:function(){for(var S=this||ie,A=0;A<S._howls.length;A++)S._howls[A].stop();return S},unload:function(){for(var S=this||ie,A=S._howls.length-1;A>=0;A--)S._howls[A].unload();return S.usingWebAudio&&S.ctx&&S.ctx.close!==void 0&&(S.ctx.close(),S.ctx=null,Fe()),S},codecs:function(S){return(this||ie)._codecs[S.replace(/^x-/,"")]},_setup:function(){var S=this||ie;if(S.state=S.ctx&&S.ctx.state||"suspended",S._autoSuspend(),!S.usingWebAudio)if(typeof Audio!="undefined")try{new Audio().oncanplaythrough===void 0&&(S._canPlayEvent="canplay")}catch{S.noAudio=!0}else S.noAudio=!0;try{new Audio().muted&&(S.noAudio=!0)}catch{}return S.noAudio||S._setupCodecs(),S},_setupCodecs:function(){var S=this||ie,A=null;try{A=typeof Audio!="undefined"?new Audio:null}catch{return S}if(!A||typeof A.canPlayType!="function")return S;var O=A.canPlayType("audio/mpeg;").replace(/^no$/,""),j=S._navigator?S._navigator.userAgent:"",D=j.match(/OPR\/([0-6].)/g),z=D&&parseInt(D[0].split("/")[1],10)<33,W=j.indexOf("Safari")!==-1&&j.indexOf("Chrome")===-1,ee=j.match(/Version\/(.*?) /),et=W&&ee&&parseInt(ee[1],10)<15;return S._codecs={mp3:!(z||!O&&!A.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!O,opus:!!A.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!A.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!A.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(A.canPlayType('audio/wav; codecs="1"')||A.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!A.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!A.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(A.canPlayType("audio/x-m4a;")||A.canPlayType("audio/m4a;")||A.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(A.canPlayType("audio/x-m4b;")||A.canPlayType("audio/m4b;")||A.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(A.canPlayType("audio/x-mp4;")||A.canPlayType("audio/mp4;")||A.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(et||!A.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(et||!A.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!A.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(A.canPlayType("audio/x-flac;")||A.canPlayType("audio/flac;")).replace(/^no$/,"")},S},_unlockAudio:function(){var S=this||ie;if(!S._audioUnlocked&&S.ctx){S._audioUnlocked=!1,S.autoUnlock=!1,S._mobileUnloaded||S.ctx.sampleRate===44100||(S._mobileUnloaded=!0,S.unload()),S._scratchBuffer=S.ctx.createBuffer(1,1,22050);var A=function(O){for(;S._html5AudioPool.length<S.html5PoolSize;)try{var j=new Audio;j._unlocked=!0,S._releaseHtml5Audio(j)}catch{S.noAudio=!0;break}for(var D=0;D<S._howls.length;D++)if(!S._howls[D]._webAudio)for(var z=S._howls[D]._getSoundIds(),W=0;W<z.length;W++){var ee=S._howls[D]._soundById(z[W]);ee&&ee._node&&!ee._node._unlocked&&(ee._node._unlocked=!0,ee._node.load())}S._autoResume();var et=S.ctx.createBufferSource();et.buffer=S._scratchBuffer,et.connect(S.ctx.destination),et.start===void 0?et.noteOn(0):et.start(0),typeof S.ctx.resume=="function"&&S.ctx.resume(),et.onended=function(){et.disconnect(0),S._audioUnlocked=!0,document.removeEventListener("touchstart",A,!0),document.removeEventListener("touchend",A,!0),document.removeEventListener("click",A,!0),document.removeEventListener("keydown",A,!0);for(var ft=0;ft<S._howls.length;ft++)S._howls[ft]._emit("unlock")}};return document.addEventListener("touchstart",A,!0),document.addEventListener("touchend",A,!0),document.addEventListener("click",A,!0),document.addEventListener("keydown",A,!0),S}},_obtainHtml5Audio:function(){var S=this||ie;if(S._html5AudioPool.length)return S._html5AudioPool.pop();var A=new Audio().play();return A&&typeof Promise!="undefined"&&(A instanceof Promise||typeof A.then=="function")&&A.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(S){var A=this||ie;return S._unlocked&&A._html5AudioPool.push(S),A},_autoSuspend:function(){var S=this;if(S.autoSuspend&&S.ctx&&S.ctx.suspend!==void 0&&ie.usingWebAudio){for(var A=0;A<S._howls.length;A++)if(S._howls[A]._webAudio){for(var O=0;O<S._howls[A]._sounds.length;O++)if(!S._howls[A]._sounds[O]._paused)return S}return S._suspendTimer&&clearTimeout(S._suspendTimer),S._suspendTimer=setTimeout(function(){if(S.autoSuspend){S._suspendTimer=null,S.state="suspending";var j=function(){S.state="suspended",S._resumeAfterSuspend&&(delete S._resumeAfterSuspend,S._autoResume())};S.ctx.suspend().then(j,j)}},3e4),S}},_autoResume:function(){var S=this;if(S.ctx&&S.ctx.resume!==void 0&&ie.usingWebAudio)return S.state==="running"&&S.ctx.state!=="interrupted"&&S._suspendTimer?(clearTimeout(S._suspendTimer),S._suspendTimer=null):S.state==="suspended"||S.state==="running"&&S.ctx.state==="interrupted"?(S.ctx.resume().then(function(){S.state="running";for(var A=0;A<S._howls.length;A++)S._howls[A]._emit("resume")}),S._suspendTimer&&(clearTimeout(S._suspendTimer),S._suspendTimer=null)):S.state==="suspending"&&(S._resumeAfterSuspend=!0),S}};var ie=new B,k=function(S){S.src&&S.src.length!==0?this.init(S):console.error("An array of source files must be passed with any new Howl.")};k.prototype={init:function(S){var A=this;return ie.ctx||Fe(),A._autoplay=S.autoplay||!1,A._format=typeof S.format!="string"?S.format:[S.format],A._html5=S.html5||!1,A._muted=S.mute||!1,A._loop=S.loop||!1,A._pool=S.pool||5,A._preload=typeof S.preload!="boolean"&&S.preload!=="metadata"||S.preload,A._rate=S.rate||1,A._sprite=S.sprite||{},A._src=typeof S.src!="string"?S.src:[S.src],A._volume=S.volume!==void 0?S.volume:1,A._xhr={method:S.xhr&&S.xhr.method?S.xhr.method:"GET",headers:S.xhr&&S.xhr.headers?S.xhr.headers:null,withCredentials:!(!S.xhr||!S.xhr.withCredentials)&&S.xhr.withCredentials},A._duration=0,A._state="unloaded",A._sounds=[],A._endTimers={},A._queue=[],A._playLock=!1,A._onend=S.onend?[{fn:S.onend}]:[],A._onfade=S.onfade?[{fn:S.onfade}]:[],A._onload=S.onload?[{fn:S.onload}]:[],A._onloaderror=S.onloaderror?[{fn:S.onloaderror}]:[],A._onplayerror=S.onplayerror?[{fn:S.onplayerror}]:[],A._onpause=S.onpause?[{fn:S.onpause}]:[],A._onplay=S.onplay?[{fn:S.onplay}]:[],A._onstop=S.onstop?[{fn:S.onstop}]:[],A._onmute=S.onmute?[{fn:S.onmute}]:[],A._onvolume=S.onvolume?[{fn:S.onvolume}]:[],A._onrate=S.onrate?[{fn:S.onrate}]:[],A._onseek=S.onseek?[{fn:S.onseek}]:[],A._onunlock=S.onunlock?[{fn:S.onunlock}]:[],A._onresume=[],A._webAudio=ie.usingWebAudio&&!A._html5,ie.ctx!==void 0&&ie.ctx&&ie.autoUnlock&&ie._unlockAudio(),ie._howls.push(A),A._autoplay&&A._queue.push({event:"play",action:function(){A.play()}}),A._preload&&A._preload!=="none"&&A.load(),A},load:function(){var S=null;if(ie.noAudio)this._emit("loaderror",null,"No audio support.");else{typeof this._src=="string"&&(this._src=[this._src]);for(var A=0;A<this._src.length;A++){var O,j;if(this._format&&this._format[A])O=this._format[A];else{if(typeof(j=this._src[A])!="string"){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(O=/^data:audio\/([^;,]+);/i.exec(j))||(O=/\.([^.]+)$/.exec(j.split("?",1)[0])),O&&(O=O[1].toLowerCase())}if(O||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),O&&ie.codecs(O)){S=this._src[A];break}}if(S)return this._src=S,this._state="loading",window.location.protocol==="https:"&&S.slice(0,5)==="http:"&&(this._html5=!0,this._webAudio=!1),new oe(this),this._webAudio&&K(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(S,A){var O=this,j=null;if(typeof S=="number")j=S,S=null;else{if(typeof S=="string"&&O._state==="loaded"&&!O._sprite[S])return null;if(S===void 0&&(S="__default",!O._playLock)){for(var D=0,z=0;z<O._sounds.length;z++)O._sounds[z]._paused&&!O._sounds[z]._ended&&(D++,j=O._sounds[z]._id);D===1?S=null:j=null}}var W=j?O._soundById(j):O._inactiveSound();if(!W)return null;if(j&&!S&&(S=W._sprite||"__default"),O._state!=="loaded"){W._sprite=S,W._ended=!1;var ee=W._id;return O._queue.push({event:"play",action:function(){O.play(ee)}}),ee}if(j&&!W._paused)return A||O._loadQueue("play"),W._id;O._webAudio&&ie._autoResume();var et=Math.max(0,W._seek>0?W._seek:O._sprite[S][0]/1e3),ft=Math.max(0,(O._sprite[S][0]+O._sprite[S][1])/1e3-et),$e=1e3*ft/Math.abs(W._rate),ae=O._sprite[S][0]/1e3,Ce=(O._sprite[S][0]+O._sprite[S][1])/1e3;W._sprite=S,W._ended=!1;var Ie=function(){W._paused=!1,W._seek=et,W._start=ae,W._stop=Ce,W._loop=!(!W._loop&&!O._sprite[S][2])};if(!(et>=Ce)){var H=W._node;if(O._webAudio){var be=function(){O._playLock=!1,Ie(),O._refreshBuffer(W);var Ue=W._muted||O._muted?0:W._volume;H.gain.setValueAtTime(Ue,ie.ctx.currentTime),W._playStart=ie.ctx.currentTime,H.bufferSource.start===void 0?W._loop?H.bufferSource.noteGrainOn(0,et,86400):H.bufferSource.noteGrainOn(0,et,ft):W._loop?H.bufferSource.start(0,et,86400):H.bufferSource.start(0,et,ft),$e!==1/0&&(O._endTimers[W._id]=setTimeout(O._ended.bind(O,W),$e)),A||setTimeout(function(){O._emit("play",W._id),O._loadQueue()},0)};ie.state==="running"&&ie.ctx.state!=="interrupted"?be():(O._playLock=!0,O.once("resume",be),O._clearTimer(W._id))}else{var Me=function(){H.currentTime=et,H.muted=W._muted||O._muted||ie._muted||H.muted,H.volume=W._volume*ie.volume(),H.playbackRate=W._rate;try{var Ue=H.play();if(Ue&&typeof Promise!="undefined"&&(Ue instanceof Promise||typeof Ue.then=="function")?(O._playLock=!0,Ie(),Ue.then(function(){O._playLock=!1,H._unlocked=!0,A?O._loadQueue():O._emit("play",W._id)}).catch(function(){O._playLock=!1,O._emit("playerror",W._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),W._ended=!0,W._paused=!0})):A||(O._playLock=!1,Ie(),O._emit("play",W._id)),H.playbackRate=W._rate,H.paused)return void O._emit("playerror",W._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");S!=="__default"||W._loop?O._endTimers[W._id]=setTimeout(O._ended.bind(O,W),$e):(O._endTimers[W._id]=function(){O._ended(W),H.removeEventListener("ended",O._endTimers[W._id],!1)},H.addEventListener("ended",O._endTimers[W._id],!1))}catch(qe){O._emit("playerror",W._id,qe)}};H.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(H.src=O._src,H.load());var Oe=window&&window.ejecta||!H.readyState&&ie._navigator.isCocoonJS;if(H.readyState>=3||Oe)Me();else{O._playLock=!0,O._state="loading";var Se=function(){O._state="loaded",Me(),H.removeEventListener(ie._canPlayEvent,Se,!1)};H.addEventListener(ie._canPlayEvent,Se,!1),O._clearTimer(W._id)}}return W._id}O._ended(W)},pause:function(S){var A=this;if(A._state!=="loaded"||A._playLock)return A._queue.push({event:"pause",action:function(){A.pause(S)}}),A;for(var O=A._getSoundIds(S),j=0;j<O.length;j++){A._clearTimer(O[j]);var D=A._soundById(O[j]);if(D&&!D._paused&&(D._seek=A.seek(O[j]),D._rateSeek=0,D._paused=!0,A._stopFade(O[j]),D._node))if(A._webAudio){if(!D._node.bufferSource)continue;D._node.bufferSource.stop===void 0?D._node.bufferSource.noteOff(0):D._node.bufferSource.stop(0),A._cleanBuffer(D._node)}else isNaN(D._node.duration)&&D._node.duration!==1/0||D._node.pause();arguments[1]||A._emit("pause",D?D._id:null)}return A},stop:function(S,A){var O=this;if(O._state!=="loaded"||O._playLock)return O._queue.push({event:"stop",action:function(){O.stop(S)}}),O;for(var j=O._getSoundIds(S),D=0;D<j.length;D++){O._clearTimer(j[D]);var z=O._soundById(j[D]);z&&(z._seek=z._start||0,z._rateSeek=0,z._paused=!0,z._ended=!0,O._stopFade(j[D]),z._node&&(O._webAudio?z._node.bufferSource&&(z._node.bufferSource.stop===void 0?z._node.bufferSource.noteOff(0):z._node.bufferSource.stop(0),O._cleanBuffer(z._node)):isNaN(z._node.duration)&&z._node.duration!==1/0||(z._node.currentTime=z._start||0,z._node.pause(),z._node.duration===1/0&&O._clearSound(z._node))),A||O._emit("stop",z._id))}return O},mute:function(S,A){var O=this;if(O._state!=="loaded"||O._playLock)return O._queue.push({event:"mute",action:function(){O.mute(S,A)}}),O;if(A===void 0){if(typeof S!="boolean")return O._muted;O._muted=S}for(var j=O._getSoundIds(A),D=0;D<j.length;D++){var z=O._soundById(j[D]);z&&(z._muted=S,z._interval&&O._stopFade(z._id),O._webAudio&&z._node?z._node.gain.setValueAtTime(S?0:z._volume,ie.ctx.currentTime):z._node&&(z._node.muted=!!ie._muted||S),O._emit("mute",z._id))}return O},volume:function(){var S,A,O,j=this,D=arguments;if(D.length===0)return j._volume;if(D.length===1||D.length===2&&D[1]===void 0){var z=j._getSoundIds(),W=z.indexOf(D[0]);W>=0?A=parseInt(D[0],10):S=parseFloat(D[0])}else D.length>=2&&(S=parseFloat(D[0]),A=parseInt(D[1],10));if(!(S!==void 0&&S>=0&&S<=1))return(O=A?j._soundById(A):j._sounds[0])?O._volume:0;if(j._state!=="loaded"||j._playLock)return j._queue.push({event:"volume",action:function(){j.volume.apply(j,D)}}),j;A===void 0&&(j._volume=S),A=j._getSoundIds(A);for(var ee=0;ee<A.length;ee++)(O=j._soundById(A[ee]))&&(O._volume=S,D[2]||j._stopFade(A[ee]),j._webAudio&&O._node&&!O._muted?O._node.gain.setValueAtTime(S,ie.ctx.currentTime):O._node&&!O._muted&&(O._node.volume=S*ie.volume()),j._emit("volume",O._id));return j},fade:function(S,A,O,j){var D=this;if(D._state!=="loaded"||D._playLock)return D._queue.push({event:"fade",action:function(){D.fade(S,A,O,j)}}),D;S=Math.min(Math.max(0,parseFloat(S)),1),A=Math.min(Math.max(0,parseFloat(A)),1),O=parseFloat(O),D.volume(S,j);for(var z=D._getSoundIds(j),W=0;W<z.length;W++){var ee=D._soundById(z[W]);if(ee){if(j||D._stopFade(z[W]),D._webAudio&&!ee._muted){var et=ie.ctx.currentTime,ft=et+O/1e3;ee._volume=S,ee._node.gain.setValueAtTime(S,et),ee._node.gain.linearRampToValueAtTime(A,ft)}D._startFadeInterval(ee,S,A,O,z[W],j===void 0)}}return D},_startFadeInterval:function(S,A,O,j,D,z){var W=this,ee=A,et=O-A,ft=Math.abs(et/.01),$e=Math.max(4,ft>0?j/ft:j),ae=Date.now();S._fadeTo=O,S._interval=setInterval(function(){var Ce=(Date.now()-ae)/j;ae=Date.now(),ee+=et*Ce,ee=Math.round(100*ee)/100,ee=et<0?Math.max(O,ee):Math.min(O,ee),W._webAudio?S._volume=ee:W.volume(ee,S._id,!0),z&&(W._volume=ee),(O<A&&ee<=O||O>A&&ee>=O)&&(clearInterval(S._interval),S._interval=null,S._fadeTo=null,W.volume(O,S._id),W._emit("fade",S._id))},$e)},_stopFade:function(S){var A=this._soundById(S);return A&&A._interval&&(this._webAudio&&A._node.gain.cancelScheduledValues(ie.ctx.currentTime),clearInterval(A._interval),A._interval=null,this.volume(A._fadeTo,S),A._fadeTo=null,this._emit("fade",S)),this},loop:function(){var S,A,O,j=this,D=arguments;if(D.length===0)return j._loop;if(D.length===1){if(typeof D[0]!="boolean")return!!(O=j._soundById(parseInt(D[0],10)))&&O._loop;S=D[0],j._loop=S}else D.length===2&&(S=D[0],A=parseInt(D[1],10));for(var z=j._getSoundIds(A),W=0;W<z.length;W++)(O=j._soundById(z[W]))&&(O._loop=S,j._webAudio&&O._node&&O._node.bufferSource&&(O._node.bufferSource.loop=S,S&&(O._node.bufferSource.loopStart=O._start||0,O._node.bufferSource.loopEnd=O._stop,j.playing(z[W])&&(j.pause(z[W],!0),j.play(z[W],!0)))));return j},rate:function(){var S,A,O,j=this,D=arguments;if(D.length===0)A=j._sounds[0]._id;else if(D.length===1){var z=j._getSoundIds(),W=z.indexOf(D[0]);W>=0?A=parseInt(D[0],10):S=parseFloat(D[0])}else D.length===2&&(S=parseFloat(D[0]),A=parseInt(D[1],10));if(typeof S!="number")return(O=j._soundById(A))?O._rate:j._rate;if(j._state!=="loaded"||j._playLock)return j._queue.push({event:"rate",action:function(){j.rate.apply(j,D)}}),j;A===void 0&&(j._rate=S),A=j._getSoundIds(A);for(var ee=0;ee<A.length;ee++)if(O=j._soundById(A[ee])){j.playing(A[ee])&&(O._rateSeek=j.seek(A[ee]),O._playStart=j._webAudio?ie.ctx.currentTime:O._playStart),O._rate=S,j._webAudio&&O._node&&O._node.bufferSource?O._node.bufferSource.playbackRate.setValueAtTime(S,ie.ctx.currentTime):O._node&&(O._node.playbackRate=S);var et=j.seek(A[ee]),ft=(j._sprite[O._sprite][0]+j._sprite[O._sprite][1])/1e3-et,$e=1e3*ft/Math.abs(O._rate);!j._endTimers[A[ee]]&&O._paused||(j._clearTimer(A[ee]),j._endTimers[A[ee]]=setTimeout(j._ended.bind(j,O),$e)),j._emit("rate",O._id)}return j},seek:function(){var S,A,O=this,j=arguments;if(j.length===0)O._sounds.length&&(A=O._sounds[0]._id);else if(j.length===1){var D=O._getSoundIds(),z=D.indexOf(j[0]);z>=0?A=parseInt(j[0],10):O._sounds.length&&(A=O._sounds[0]._id,S=parseFloat(j[0]))}else j.length===2&&(S=parseFloat(j[0]),A=parseInt(j[1],10));if(A===void 0)return 0;if(typeof S=="number"&&(O._state!=="loaded"||O._playLock))return O._queue.push({event:"seek",action:function(){O.seek.apply(O,j)}}),O;var W=O._soundById(A);if(W){if(!(typeof S=="number"&&S>=0)){if(O._webAudio){var ee=O.playing(A)?ie.ctx.currentTime-W._playStart:0,et=W._rateSeek?W._rateSeek-W._seek:0;return W._seek+(et+ee*Math.abs(W._rate))}return W._node.currentTime}var ft=O.playing(A);ft&&O.pause(A,!0),W._seek=S,W._ended=!1,O._clearTimer(A),O._webAudio||!W._node||isNaN(W._node.duration)||(W._node.currentTime=S);var $e=function(){ft&&O.play(A,!0),O._emit("seek",A)};if(ft&&!O._webAudio){var ae=function(){O._playLock?setTimeout(ae,0):$e()};setTimeout(ae,0)}else $e()}return O},playing:function(S){if(typeof S=="number"){var A=this._soundById(S);return!!A&&!A._paused}for(var O=0;O<this._sounds.length;O++)if(!this._sounds[O]._paused)return!0;return!1},duration:function(S){var A=this._duration,O=this._soundById(S);return O&&(A=this._sprite[O._sprite][1]/1e3),A},state:function(){return this._state},unload:function(){for(var S=this,A=S._sounds,O=0;O<A.length;O++)A[O]._paused||S.stop(A[O]._id),S._webAudio||(S._clearSound(A[O]._node),A[O]._node.removeEventListener("error",A[O]._errorFn,!1),A[O]._node.removeEventListener(ie._canPlayEvent,A[O]._loadFn,!1),A[O]._node.removeEventListener("ended",A[O]._endFn,!1),ie._releaseHtml5Audio(A[O]._node)),delete A[O]._node,S._clearTimer(A[O]._id);var j=ie._howls.indexOf(S);j>=0&&ie._howls.splice(j,1);var D=!0;for(O=0;O<ie._howls.length;O++)if(ie._howls[O]._src===S._src||S._src.indexOf(ie._howls[O]._src)>=0){D=!1;break}return X&&D&&delete X[S._src],ie.noAudio=!1,S._state="unloaded",S._sounds=[],S=null,null},on:function(S,A,O,j){var D=this["_on"+S];return typeof A=="function"&&D.push(j?{id:O,fn:A,once:j}:{id:O,fn:A}),this},off:function(S,A,O){var j=this["_on"+S],D=0;if(typeof A=="number"&&(O=A,A=null),A||O)for(D=0;D<j.length;D++){var z=O===j[D].id;if(A===j[D].fn&&z||!A&&z){j.splice(D,1);break}}else if(S)this["_on"+S]=[];else{var W=Object.keys(this);for(D=0;D<W.length;D++)W[D].indexOf("_on")===0&&Array.isArray(this[W[D]])&&(this[W[D]]=[])}return this},once:function(S,A,O){return this.on(S,A,O,1),this},_emit:function(S,A,O){for(var j=this["_on"+S],D=j.length-1;D>=0;D--)j[D].id&&j[D].id!==A&&S!=="load"||(setTimeout(function(z){z.call(this,A,O)}.bind(this,j[D].fn),0),j[D].once&&this.off(S,j[D].fn,j[D].id));return this._loadQueue(S),this},_loadQueue:function(S){if(this._queue.length>0){var A=this._queue[0];A.event===S&&(this._queue.shift(),this._loadQueue()),S||A.action()}return this},_ended:function(S){var A=S._sprite;if(!this._webAudio&&S._node&&!S._node.paused&&!S._node.ended&&S._node.currentTime<S._stop)return setTimeout(this._ended.bind(this,S),100),this;var O=!(!S._loop&&!this._sprite[A][2]);if(this._emit("end",S._id),!this._webAudio&&O&&this.stop(S._id,!0).play(S._id),this._webAudio&&O){this._emit("play",S._id),S._seek=S._start||0,S._rateSeek=0,S._playStart=ie.ctx.currentTime;var j=1e3*(S._stop-S._start)/Math.abs(S._rate);this._endTimers[S._id]=setTimeout(this._ended.bind(this,S),j)}return this._webAudio&&!O&&(S._paused=!0,S._ended=!0,S._seek=S._start||0,S._rateSeek=0,this._clearTimer(S._id),this._cleanBuffer(S._node),ie._autoSuspend()),this._webAudio||O||this.stop(S._id,!0),this},_clearTimer:function(S){if(this._endTimers[S]){if(typeof this._endTimers[S]!="function")clearTimeout(this._endTimers[S]);else{var A=this._soundById(S);A&&A._node&&A._node.removeEventListener("ended",this._endTimers[S],!1)}delete this._endTimers[S]}return this},_soundById:function(S){for(var A=0;A<this._sounds.length;A++)if(S===this._sounds[A]._id)return this._sounds[A];return null},_inactiveSound:function(){this._drain();for(var S=0;S<this._sounds.length;S++)if(this._sounds[S]._ended)return this._sounds[S].reset();return new oe(this)},_drain:function(){var S=this._pool,A=0,O=0;if(!(this._sounds.length<S)){for(O=0;O<this._sounds.length;O++)this._sounds[O]._ended&&A++;for(O=this._sounds.length-1;O>=0;O--){if(A<=S)return;this._sounds[O]._ended&&(this._webAudio&&this._sounds[O]._node&&this._sounds[O]._node.disconnect(0),this._sounds.splice(O,1),A--)}}},_getSoundIds:function(S){if(S===void 0){for(var A=[],O=0;O<this._sounds.length;O++)A.push(this._sounds[O]._id);return A}return[S]},_refreshBuffer:function(S){return S._node.bufferSource=ie.ctx.createBufferSource(),S._node.bufferSource.buffer=X[this._src],S._panner?S._node.bufferSource.connect(S._panner):S._node.bufferSource.connect(S._node),S._node.bufferSource.loop=S._loop,S._loop&&(S._node.bufferSource.loopStart=S._start||0,S._node.bufferSource.loopEnd=S._stop||0),S._node.bufferSource.playbackRate.setValueAtTime(S._rate,ie.ctx.currentTime),this},_cleanBuffer:function(S){var A=ie._navigator&&ie._navigator.vendor.indexOf("Apple")>=0;if(ie._scratchBuffer&&S.bufferSource&&(S.bufferSource.onended=null,S.bufferSource.disconnect(0),A))try{S.bufferSource.buffer=ie._scratchBuffer}catch{}return S.bufferSource=null,this},_clearSound:function(S){/MSIE |Trident\//.test(ie._navigator&&ie._navigator.userAgent)||(S.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var oe=function(S){this._parent=S,this.init()};oe.prototype={init:function(){var S=this._parent;return this._muted=S._muted,this._loop=S._loop,this._volume=S._volume,this._rate=S._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++ie._counter,S._sounds.push(this),this.create(),this},create:function(){var S=this._parent,A=ie._muted||this._muted||this._parent._muted?0:this._volume;return S._webAudio?(this._node=ie.ctx.createGain===void 0?ie.ctx.createGainNode():ie.ctx.createGain(),this._node.gain.setValueAtTime(A,ie.ctx.currentTime),this._node.paused=!0,this._node.connect(ie.masterGain)):ie.noAudio||(this._node=ie._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(ie._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=S._src,this._node.preload=S._preload===!0?"auto":S._preload,this._node.volume=A*ie.volume(),this._node.load()),this},reset:function(){var S=this._parent;return this._muted=S._muted,this._loop=S._loop,this._volume=S._volume,this._rate=S._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++ie._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var S=this._parent;S._duration=Math.ceil(10*this._node.duration)/10,Object.keys(S._sprite).length===0&&(S._sprite={__default:[0,1e3*S._duration]}),S._state!=="loaded"&&(S._state="loaded",S._emit("load"),S._loadQueue()),this._node.removeEventListener(ie._canPlayEvent,this._loadFn,!1)},_endListener:function(){var S=this._parent;S._duration===1/0&&(S._duration=Math.ceil(10*this._node.duration)/10,S._sprite.__default[1]===1/0&&(S._sprite.__default[1]=1e3*S._duration),S._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var X={},K=function(S){var A=S._src;if(X[A])return S._duration=X[A].duration,void Xe(S);if(/^data:[^;]+;base64,/.test(A)){for(var O=atob(A.split(",")[1]),j=new Uint8Array(O.length),D=0;D<O.length;++D)j[D]=O.charCodeAt(D);Ee(j.buffer,S)}else{var z=new XMLHttpRequest;z.open(S._xhr.method,A,!0),z.withCredentials=S._xhr.withCredentials,z.responseType="arraybuffer",S._xhr.headers&&Object.keys(S._xhr.headers).forEach(function(W){z.setRequestHeader(W,S._xhr.headers[W])}),z.onload=function(){var W=(z.status+"")[0];W==="0"||W==="2"||W==="3"?Ee(z.response,S):S._emit("loaderror",null,"Failed loading audio file with status: "+z.status+".")},z.onerror=function(){S._webAudio&&(S._html5=!0,S._webAudio=!1,S._sounds=[],delete X[A],S.load())},le(z)}},le=function(S){try{S.send()}catch{S.onerror()}},Ee=function(S,A){var O=function(){A._emit("loaderror",null,"Decoding audio data failed.")},j=function(D){D&&A._sounds.length>0?(X[A._src]=D,Xe(A,D)):O()};typeof Promise!="undefined"&&ie.ctx.decodeAudioData.length===1?ie.ctx.decodeAudioData(S).then(j).catch(O):ie.ctx.decodeAudioData(S,j,O)},Xe=function(S,A){A&&!S._duration&&(S._duration=A.duration),Object.keys(S._sprite).length===0&&(S._sprite={__default:[0,1e3*S._duration]}),S._state!=="loaded"&&(S._state="loaded",S._emit("load"),S._loadQueue())},Fe=function(){if(ie.usingWebAudio){try{typeof AudioContext!="undefined"?ie.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?ie.ctx=new webkitAudioContext:ie.usingWebAudio=!1}catch{ie.usingWebAudio=!1}ie.ctx||(ie.usingWebAudio=!1);var S=/iP(hone|od|ad)/.test(ie._navigator&&ie._navigator.platform),A=ie._navigator&&ie._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),O=A?parseInt(A[1],10):null;if(S&&O&&O<9){var j=/safari/.test(ie._navigator&&ie._navigator.userAgent.toLowerCase());ie._navigator&&!j&&(ie.usingWebAudio=!1)}ie.usingWebAudio&&(ie.masterGain=ie.ctx.createGain===void 0?ie.ctx.createGainNode():ie.ctx.createGain(),ie.masterGain.gain.setValueAtTime(ie._muted?0:ie._volume,ie.ctx.currentTime),ie.masterGain.connect(ie.ctx.destination)),ie._setup()}};(q=function(){return{Howler:ie,Howl:k}}.apply(L,[]))===void 0||(R.exports=q),L.Howler=ie,L.Howl=k,b!==void 0?(b.HowlerGlobal=B,b.Howler=ie,b.Howl=k,b.Sound=oe):typeof window!="undefined"&&(window.HowlerGlobal=B,window.Howler=ie,window.Howl=k,window.Sound=oe)})(),function(){var B;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(k){if(!this.ctx||!this.ctx.listener)return this;for(var oe=this._howls.length-1;oe>=0;oe--)this._howls[oe].stereo(k);return this},HowlerGlobal.prototype.pos=function(k,oe,X){return this.ctx&&this.ctx.listener?(oe=typeof oe!="number"?this._pos[1]:oe,X=typeof X!="number"?this._pos[2]:X,typeof k!="number"?this._pos:(this._pos=[k,oe,X],this.ctx.listener.positionX!==void 0?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(k,oe,X,K,le,Ee){if(!this.ctx||!this.ctx.listener)return this;var Xe=this._orientation;return oe=typeof oe!="number"?Xe[1]:oe,X=typeof X!="number"?Xe[2]:X,K=typeof K!="number"?Xe[3]:K,le=typeof le!="number"?Xe[4]:le,Ee=typeof Ee!="number"?Xe[5]:Ee,typeof k!="number"?Xe:(this._orientation=[k,oe,X,K,le,Ee],this.ctx.listener.forwardX!==void 0?(this.ctx.listener.forwardX.setTargetAtTime(k,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(oe,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(X,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(K,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(le,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(Ee,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(k,oe,X,K,le,Ee),this)},Howl.prototype.init=(B=Howl.prototype.init,function(k){return this._orientation=k.orientation||[1,0,0],this._stereo=k.stereo||null,this._pos=k.pos||null,this._pannerAttr={coneInnerAngle:k.coneInnerAngle!==void 0?k.coneInnerAngle:360,coneOuterAngle:k.coneOuterAngle!==void 0?k.coneOuterAngle:360,coneOuterGain:k.coneOuterGain!==void 0?k.coneOuterGain:0,distanceModel:k.distanceModel!==void 0?k.distanceModel:"inverse",maxDistance:k.maxDistance!==void 0?k.maxDistance:1e4,panningModel:k.panningModel!==void 0?k.panningModel:"HRTF",refDistance:k.refDistance!==void 0?k.refDistance:1,rolloffFactor:k.rolloffFactor!==void 0?k.rolloffFactor:1},this._onstereo=k.onstereo?[{fn:k.onstereo}]:[],this._onpos=k.onpos?[{fn:k.onpos}]:[],this._onorientation=k.onorientation?[{fn:k.onorientation}]:[],B.call(this,k)}),Howl.prototype.stereo=function(k,oe){var X=this;if(!X._webAudio)return X;if(X._state!=="loaded")return X._queue.push({event:"stereo",action:function(){X.stereo(k,oe)}}),X;var K=Howler.ctx.createStereoPanner===void 0?"spatial":"stereo";if(oe===void 0){if(typeof k!="number")return X._stereo;X._stereo=k,X._pos=[k,0,0]}for(var le=X._getSoundIds(oe),Ee=0;Ee<le.length;Ee++){var Xe=X._soundById(le[Ee]);if(Xe){if(typeof k!="number")return Xe._stereo;Xe._stereo=k,Xe._pos=[k,0,0],Xe._node&&(Xe._pannerAttr.panningModel="equalpower",Xe._panner&&Xe._panner.pan||ie(Xe,K),K==="spatial"?Xe._panner.positionX!==void 0?(Xe._panner.positionX.setValueAtTime(k,Howler.ctx.currentTime),Xe._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),Xe._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):Xe._panner.setPosition(k,0,0):Xe._panner.pan.setValueAtTime(k,Howler.ctx.currentTime)),X._emit("stereo",Xe._id)}}return X},Howl.prototype.pos=function(k,oe,X,K){var le=this;if(!le._webAudio)return le;if(le._state!=="loaded")return le._queue.push({event:"pos",action:function(){le.pos(k,oe,X,K)}}),le;if(oe=typeof oe!="number"?0:oe,X=typeof X!="number"?-.5:X,K===void 0){if(typeof k!="number")return le._pos;le._pos=[k,oe,X]}for(var Ee=le._getSoundIds(K),Xe=0;Xe<Ee.length;Xe++){var Fe=le._soundById(Ee[Xe]);if(Fe){if(typeof k!="number")return Fe._pos;Fe._pos=[k,oe,X],Fe._node&&(Fe._panner&&!Fe._panner.pan||ie(Fe,"spatial"),Fe._panner.positionX!==void 0?(Fe._panner.positionX.setValueAtTime(k,Howler.ctx.currentTime),Fe._panner.positionY.setValueAtTime(oe,Howler.ctx.currentTime),Fe._panner.positionZ.setValueAtTime(X,Howler.ctx.currentTime)):Fe._panner.setPosition(k,oe,X)),le._emit("pos",Fe._id)}}return le},Howl.prototype.orientation=function(k,oe,X,K){var le=this;if(!le._webAudio)return le;if(le._state!=="loaded")return le._queue.push({event:"orientation",action:function(){le.orientation(k,oe,X,K)}}),le;if(oe=typeof oe!="number"?le._orientation[1]:oe,X=typeof X!="number"?le._orientation[2]:X,K===void 0){if(typeof k!="number")return le._orientation;le._orientation=[k,oe,X]}for(var Ee=le._getSoundIds(K),Xe=0;Xe<Ee.length;Xe++){var Fe=le._soundById(Ee[Xe]);if(Fe){if(typeof k!="number")return Fe._orientation;Fe._orientation=[k,oe,X],Fe._node&&(Fe._panner||(Fe._pos||(Fe._pos=le._pos||[0,0,-.5]),ie(Fe,"spatial")),Fe._panner.orientationX!==void 0?(Fe._panner.orientationX.setValueAtTime(k,Howler.ctx.currentTime),Fe._panner.orientationY.setValueAtTime(oe,Howler.ctx.currentTime),Fe._panner.orientationZ.setValueAtTime(X,Howler.ctx.currentTime)):Fe._panner.setOrientation(k,oe,X)),le._emit("orientation",Fe._id)}}return le},Howl.prototype.pannerAttr=function(){var k,oe,X,K=this,le=arguments;if(!K._webAudio)return K;if(le.length===0)return K._pannerAttr;if(le.length===1){if(typeof le[0]!="object")return(X=K._soundById(parseInt(le[0],10)))?X._pannerAttr:K._pannerAttr;k=le[0],oe===void 0&&(k.pannerAttr||(k.pannerAttr={coneInnerAngle:k.coneInnerAngle,coneOuterAngle:k.coneOuterAngle,coneOuterGain:k.coneOuterGain,distanceModel:k.distanceModel,maxDistance:k.maxDistance,refDistance:k.refDistance,rolloffFactor:k.rolloffFactor,panningModel:k.panningModel}),K._pannerAttr={coneInnerAngle:k.pannerAttr.coneInnerAngle!==void 0?k.pannerAttr.coneInnerAngle:K._coneInnerAngle,coneOuterAngle:k.pannerAttr.coneOuterAngle!==void 0?k.pannerAttr.coneOuterAngle:K._coneOuterAngle,coneOuterGain:k.pannerAttr.coneOuterGain!==void 0?k.pannerAttr.coneOuterGain:K._coneOuterGain,distanceModel:k.pannerAttr.distanceModel!==void 0?k.pannerAttr.distanceModel:K._distanceModel,maxDistance:k.pannerAttr.maxDistance!==void 0?k.pannerAttr.maxDistance:K._maxDistance,refDistance:k.pannerAttr.refDistance!==void 0?k.pannerAttr.refDistance:K._refDistance,rolloffFactor:k.pannerAttr.rolloffFactor!==void 0?k.pannerAttr.rolloffFactor:K._rolloffFactor,panningModel:k.pannerAttr.panningModel!==void 0?k.pannerAttr.panningModel:K._panningModel})}else le.length===2&&(k=le[0],oe=parseInt(le[1],10));for(var Ee=K._getSoundIds(oe),Xe=0;Xe<Ee.length;Xe++)if(X=K._soundById(Ee[Xe])){var Fe=X._pannerAttr;Fe={coneInnerAngle:k.coneInnerAngle!==void 0?k.coneInnerAngle:Fe.coneInnerAngle,coneOuterAngle:k.coneOuterAngle!==void 0?k.coneOuterAngle:Fe.coneOuterAngle,coneOuterGain:k.coneOuterGain!==void 0?k.coneOuterGain:Fe.coneOuterGain,distanceModel:k.distanceModel!==void 0?k.distanceModel:Fe.distanceModel,maxDistance:k.maxDistance!==void 0?k.maxDistance:Fe.maxDistance,refDistance:k.refDistance!==void 0?k.refDistance:Fe.refDistance,rolloffFactor:k.rolloffFactor!==void 0?k.rolloffFactor:Fe.rolloffFactor,panningModel:k.panningModel!==void 0?k.panningModel:Fe.panningModel};var S=X._panner;S?(S.coneInnerAngle=Fe.coneInnerAngle,S.coneOuterAngle=Fe.coneOuterAngle,S.coneOuterGain=Fe.coneOuterGain,S.distanceModel=Fe.distanceModel,S.maxDistance=Fe.maxDistance,S.refDistance=Fe.refDistance,S.rolloffFactor=Fe.rolloffFactor,S.panningModel=Fe.panningModel):(X._pos||(X._pos=K._pos||[0,0,-.5]),ie(X,"spatial"))}return K},Sound.prototype.init=function(k){return function(){var oe=this._parent;this._orientation=oe._orientation,this._stereo=oe._stereo,this._pos=oe._pos,this._pannerAttr=oe._pannerAttr,k.call(this),this._stereo?oe.stereo(this._stereo):this._pos&&oe.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(k){return function(){var oe=this._parent;return this._orientation=oe._orientation,this._stereo=oe._stereo,this._pos=oe._pos,this._pannerAttr=oe._pannerAttr,this._stereo?oe.stereo(this._stereo):this._pos?oe.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,oe._refreshBuffer(this)),k.call(this)}}(Sound.prototype.reset);var ie=function(k,oe){(oe=oe||"spatial")==="spatial"?(k._panner=Howler.ctx.createPanner(),k._panner.coneInnerAngle=k._pannerAttr.coneInnerAngle,k._panner.coneOuterAngle=k._pannerAttr.coneOuterAngle,k._panner.coneOuterGain=k._pannerAttr.coneOuterGain,k._panner.distanceModel=k._pannerAttr.distanceModel,k._panner.maxDistance=k._pannerAttr.maxDistance,k._panner.refDistance=k._pannerAttr.refDistance,k._panner.rolloffFactor=k._pannerAttr.rolloffFactor,k._panner.panningModel=k._pannerAttr.panningModel,k._panner.positionX!==void 0?(k._panner.positionX.setValueAtTime(k._pos[0],Howler.ctx.currentTime),k._panner.positionY.setValueAtTime(k._pos[1],Howler.ctx.currentTime),k._panner.positionZ.setValueAtTime(k._pos[2],Howler.ctx.currentTime)):k._panner.setPosition(k._pos[0],k._pos[1],k._pos[2]),k._panner.orientationX!==void 0?(k._panner.orientationX.setValueAtTime(k._orientation[0],Howler.ctx.currentTime),k._panner.orientationY.setValueAtTime(k._orientation[1],Howler.ctx.currentTime),k._panner.orientationZ.setValueAtTime(k._orientation[2],Howler.ctx.currentTime)):k._panner.setOrientation(k._orientation[0],k._orientation[1],k._orientation[2])):(k._panner=Howler.ctx.createStereoPanner(),k._panner.pan.setValueAtTime(k._stereo,Howler.ctx.currentTime)),k._panner.connect(k._node),k._paused||k._parent.pause(k._id,!0).play(k._id,!0)}}()}).call(this,v(4))},function(R,L,v){(function(b){var q=b!==void 0&&b||typeof self!="undefined"&&self||window,B=Function.prototype.apply;function ie(k,oe){this._id=k,this._clearFn=oe}L.setTimeout=function(){return new ie(B.call(setTimeout,q,arguments),clearTimeout)},L.setInterval=function(){return new ie(B.call(setInterval,q,arguments),clearInterval)},L.clearTimeout=L.clearInterval=function(k){k&&k.close()},ie.prototype.unref=ie.prototype.ref=function(){},ie.prototype.close=function(){this._clearFn.call(q,this._id)},L.enroll=function(k,oe){clearTimeout(k._idleTimeoutId),k._idleTimeout=oe},L.unenroll=function(k){clearTimeout(k._idleTimeoutId),k._idleTimeout=-1},L._unrefActive=L.active=function(k){clearTimeout(k._idleTimeoutId);var oe=k._idleTimeout;oe>=0&&(k._idleTimeoutId=setTimeout(function(){k._onTimeout&&k._onTimeout()},oe))},v(19),L.setImmediate=typeof self!="undefined"&&self.setImmediate||b!==void 0&&b.setImmediate||this&&this.setImmediate,L.clearImmediate=typeof self!="undefined"&&self.clearImmediate||b!==void 0&&b.clearImmediate||this&&this.clearImmediate}).call(this,v(4))},function(R,L,v){(function(b,q){(function(B,ie){if(!B.setImmediate){var k,oe,X,K,le,Ee=1,Xe={},Fe=!1,S=B.document,A=Object.getPrototypeOf&&Object.getPrototypeOf(B);A=A&&A.setTimeout?A:B,{}.toString.call(B.process)==="[object process]"?k=function(D){q.nextTick(function(){j(D)})}:function(){if(B.postMessage&&!B.importScripts){var D=!0,z=B.onmessage;return B.onmessage=function(){D=!1},B.postMessage("","*"),B.onmessage=z,D}}()?(K="setImmediate$"+Math.random()+"$",le=function(D){D.source===B&&typeof D.data=="string"&&D.data.indexOf(K)===0&&j(+D.data.slice(K.length))},B.addEventListener?B.addEventListener("message",le,!1):B.attachEvent("onmessage",le),k=function(D){B.postMessage(K+D,"*")}):B.MessageChannel?((X=new MessageChannel).port1.onmessage=function(D){j(D.data)},k=function(D){X.port2.postMessage(D)}):S&&"onreadystatechange"in S.createElement("script")?(oe=S.documentElement,k=function(D){var z=S.createElement("script");z.onreadystatechange=function(){j(D),z.onreadystatechange=null,oe.removeChild(z),z=null},oe.appendChild(z)}):k=function(D){setTimeout(j,0,D)},A.setImmediate=function(D){typeof D!="function"&&(D=new Function(""+D));for(var z=new Array(arguments.length-1),W=0;W<z.length;W++)z[W]=arguments[W+1];var ee={callback:D,args:z};return Xe[Ee]=ee,k(Ee),Ee++},A.clearImmediate=O}function O(D){delete Xe[D]}function j(D){if(Fe)setTimeout(j,0,D);else{var z=Xe[D];if(z){Fe=!0;try{(function(W){var ee=W.callback,et=W.args;switch(et.length){case 0:ee();break;case 1:ee(et[0]);break;case 2:ee(et[0],et[1]);break;case 3:ee(et[0],et[1],et[2]);break;default:ee.apply(void 0,et)}})(z)}finally{O(D),Fe=!1}}}}})(typeof self=="undefined"?b===void 0?this:b:self)}).call(this,v(4),v(20))},function(R,L){var v,b,q=R.exports={};function B(){throw new Error("setTimeout has not been defined")}function ie(){throw new Error("clearTimeout has not been defined")}function k(A){if(v===setTimeout)return setTimeout(A,0);if((v===B||!v)&&setTimeout)return v=setTimeout,setTimeout(A,0);try{return v(A,0)}catch{try{return v.call(null,A,0)}catch{return v.call(this,A,0)}}}(function(){try{v=typeof setTimeout=="function"?setTimeout:B}catch{v=B}try{b=typeof clearTimeout=="function"?clearTimeout:ie}catch{b=ie}})();var oe,X=[],K=!1,le=-1;function Ee(){K&&oe&&(K=!1,oe.length?X=oe.concat(X):le=-1,X.length&&Xe())}function Xe(){if(!K){var A=k(Ee);K=!0;for(var O=X.length;O;){for(oe=X,X=[];++le<O;)oe&&oe[le].run();le=-1,O=X.length}oe=null,K=!1,function(j){if(b===clearTimeout)return clearTimeout(j);if((b===ie||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(j);try{b(j)}catch{try{return b.call(null,j)}catch{return b.call(this,j)}}}(A)}}function Fe(A,O){this.fun=A,this.array=O}function S(){}q.nextTick=function(A){var O=new Array(arguments.length-1);if(arguments.length>1)for(var j=1;j<arguments.length;j++)O[j-1]=arguments[j];X.push(new Fe(A,O)),X.length!==1||K||k(Xe)},Fe.prototype.run=function(){this.fun.apply(null,this.array)},q.title="browser",q.browser=!0,q.env={},q.argv=[],q.version="",q.versions={},q.on=S,q.addListener=S,q.once=S,q.off=S,q.removeListener=S,q.removeAllListeners=S,q.emit=S,q.prependListener=S,q.prependOnceListener=S,q.listeners=function(A){return[]},q.binding=function(A){throw new Error("process.binding is not supported")},q.cwd=function(){return"/"},q.chdir=function(A){throw new Error("process.chdir is not supported")},q.umask=function(){return 0}},function(R,L,v){(function(b,q){var B;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(ie){L&&L.nodeType,b&&b.nodeType;var k=typeof q=="object"&&q;k.global!==k&&k.window!==k&&k.self;var oe,X=2147483647,K=/^xn--/,le=/[^\x20-\x7E]/,Ee=/[\x2E\u3002\uFF0E\uFF61]/g,Xe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Fe=Math.floor,S=String.fromCharCode;function A($e){throw new RangeError(Xe[$e])}function O($e,ae){for(var Ce=$e.length,Ie=[];Ce--;)Ie[Ce]=ae($e[Ce]);return Ie}function j($e,ae){var Ce=$e.split("@"),Ie="";return Ce.length>1&&(Ie=Ce[0]+"@",$e=Ce[1]),Ie+O(($e=$e.replace(Ee,".")).split("."),ae).join(".")}function D($e){for(var ae,Ce,Ie=[],H=0,be=$e.length;H<be;)(ae=$e.charCodeAt(H++))>=55296&&ae<=56319&&H<be?(64512&(Ce=$e.charCodeAt(H++)))==56320?Ie.push(((1023&ae)<<10)+(1023&Ce)+65536):(Ie.push(ae),H--):Ie.push(ae);return Ie}function z($e){return O($e,function(ae){var Ce="";return ae>65535&&(Ce+=S((ae-=65536)>>>10&1023|55296),ae=56320|1023&ae),Ce+=S(ae)}).join("")}function W($e,ae){return $e+22+75*($e<26)-((ae!=0)<<5)}function ee($e,ae,Ce){var Ie=0;for($e=Ce?Fe($e/700):$e>>1,$e+=Fe($e/ae);$e>455;Ie+=36)$e=Fe($e/35);return Fe(Ie+36*$e/($e+38))}function et($e){var ae,Ce,Ie,H,be,Me,Oe,Se,Ue,qe,at,rt=[],Qt=$e.length,lt=0,en=128,Bt=72;for((Ce=$e.lastIndexOf("-"))<0&&(Ce=0),Ie=0;Ie<Ce;++Ie)$e.charCodeAt(Ie)>=128&&A("not-basic"),rt.push($e.charCodeAt(Ie));for(H=Ce>0?Ce+1:0;H<Qt;){for(be=lt,Me=1,Oe=36;H>=Qt&&A("invalid-input"),((Se=(at=$e.charCodeAt(H++))-48<10?at-22:at-65<26?at-65:at-97<26?at-97:36)>=36||Se>Fe((X-lt)/Me))&&A("overflow"),lt+=Se*Me,!(Se<(Ue=Oe<=Bt?1:Oe>=Bt+26?26:Oe-Bt));Oe+=36)Me>Fe(X/(qe=36-Ue))&&A("overflow"),Me*=qe;Bt=ee(lt-be,ae=rt.length+1,be==0),Fe(lt/ae)>X-en&&A("overflow"),en+=Fe(lt/ae),lt%=ae,rt.splice(lt++,0,en)}return z(rt)}function ft($e){var ae,Ce,Ie,H,be,Me,Oe,Se,Ue,qe,at,rt,Qt,lt,en,Bt=[];for(rt=($e=D($e)).length,ae=128,Ce=0,be=72,Me=0;Me<rt;++Me)(at=$e[Me])<128&&Bt.push(S(at));for(Ie=H=Bt.length,H&&Bt.push("-");Ie<rt;){for(Oe=X,Me=0;Me<rt;++Me)(at=$e[Me])>=ae&&at<Oe&&(Oe=at);for(Oe-ae>Fe((X-Ce)/(Qt=Ie+1))&&A("overflow"),Ce+=(Oe-ae)*Qt,ae=Oe,Me=0;Me<rt;++Me)if((at=$e[Me])<ae&&++Ce>X&&A("overflow"),at==ae){for(Se=Ce,Ue=36;!(Se<(qe=Ue<=be?1:Ue>=be+26?26:Ue-be));Ue+=36)en=Se-qe,lt=36-qe,Bt.push(S(W(qe+en%lt,0))),Se=Fe(en/lt);Bt.push(S(W(Se,0))),be=ee(Ce,Qt,Ie==H),Ce=0,++Ie}++Ce,++ae}return Bt.join("")}oe={version:"1.4.1",ucs2:{decode:D,encode:z},decode:et,encode:ft,toASCII:function($e){return j($e,function(ae){return le.test(ae)?"xn--"+ft(ae):ae})},toUnicode:function($e){return j($e,function(ae){return K.test(ae)?et(ae.slice(4).toLowerCase()):ae})}},(B=function(){return oe}.call(L,v,L,b))===void 0||(b.exports=B)})()}).call(this,v(8)(R),v(4))},function(R,L,v){R.exports={isString:function(b){return typeof b=="string"},isObject:function(b){return typeof b=="object"&&b!==null},isNull:function(b){return b===null},isNullOrUndefined:function(b){return b==null}}},function(R,L,v){L.decode=L.parse=v(24),L.encode=L.stringify=v(25)},function(R,L,v){function b(B,ie){return Object.prototype.hasOwnProperty.call(B,ie)}R.exports=function(B,ie,k,oe){ie=ie||"&",k=k||"=";var X={};if(typeof B!="string"||B.length===0)return X;var K=/\+/g;B=B.split(ie);var le=1e3;oe&&typeof oe.maxKeys=="number"&&(le=oe.maxKeys);var Ee=B.length;le>0&&Ee>le&&(Ee=le);for(var Xe=0;Xe<Ee;++Xe){var Fe,S,A,O,j=B[Xe].replace(K,"%20"),D=j.indexOf(k);D>=0?(Fe=j.substr(0,D),S=j.substr(D+1)):(Fe=j,S=""),A=decodeURIComponent(Fe),O=decodeURIComponent(S),b(X,A)?q(X[A])?X[A].push(O):X[A]=[X[A],O]:X[A]=O}return X};var q=Array.isArray||function(B){return Object.prototype.toString.call(B)==="[object Array]"}},function(R,L,v){var b=function(k){switch(typeof k){case"string":return k;case"boolean":return k?"true":"false";case"number":return isFinite(k)?k:"";default:return""}};R.exports=function(k,oe,X,K){return oe=oe||"&",X=X||"=",k===null&&(k=void 0),typeof k=="object"?B(ie(k),function(le){var Ee=encodeURIComponent(b(le))+X;return q(k[le])?B(k[le],function(Xe){return Ee+encodeURIComponent(b(Xe))}).join(oe):Ee+encodeURIComponent(b(k[le]))}).join(oe):K?encodeURIComponent(b(K))+X+encodeURIComponent(b(k)):""};var q=Array.isArray||function(k){return Object.prototype.toString.call(k)==="[object Array]"};function B(k,oe){if(k.map)return k.map(oe);for(var X=[],K=0;K<k.length;K++)X.push(oe(k[K],K));return X}var ie=Object.keys||function(k){var oe=[];for(var X in k)Object.prototype.hasOwnProperty.call(k,X)&&oe.push(X);return oe}},function(R,L){var v=function(){};v.prototype={fit:function(b){var q,B,ie,k,oe=b.length,X=oe>0?b[0].width:0,K=oe>0?b[0].height:0;for(this.root={x:0,y:0,width:X,height:K},q=0;q<oe;q++)ie=b[q],(B=this.findNode(this.root,ie.width,ie.height))?(k=this.splitNode(B,ie.width,ie.height),ie.x=k.x,ie.y=k.y):(k=this.growNode(ie.width,ie.height),ie.x=k.x,ie.y=k.y)},findNode:function(b,q,B){return b.used?this.findNode(b.right,q,B)||this.findNode(b.down,q,B):q<=b.width&&B<=b.height?b:null},splitNode:function(b,q,B){return b.used=!0,b.down={x:b.x,y:b.y+B,width:b.width,height:b.height-B},b.right={x:b.x+q,y:b.y,width:b.width-q,height:B},b},growNode:function(b,q){var B=b<=this.root.width,ie=q<=this.root.height,k=ie&&this.root.height>=this.root.width+b,oe=B&&this.root.width>=this.root.height+q;return k?this.growRight(b,q):oe?this.growDown(b,q):ie?this.growRight(b,q):B?this.growDown(b,q):null},growRight:function(b,q){var B;return this.root={used:!0,x:0,y:0,width:this.root.width+b,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:b,height:this.root.height}},(B=this.findNode(this.root,b,q))?this.splitNode(B,b,q):null},growDown:function(b,q){var B;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+q,down:{x:0,y:this.root.height,width:this.root.width,height:q},right:this.root},(B=this.findNode(this.root,b,q))?this.splitNode(B,b,q):null}},R.exports=v},function(R,L,v){v.r(L),v.d(L,"SLIDE_EVENTS",function(){return cr}),v.d(L,"Slide",function(){return LP});var b={};v.r(b),v.d(b,"ACESFilmicToneMapping",function(){return Lp}),v.d(b,"AddEquation",function(){return Me}),v.d(b,"AddOperation",function(){return Pp}),v.d(b,"AdditiveAnimationBlendMode",function(){return we}),v.d(b,"AdditiveBlending",function(){return Ce}),v.d(b,"AlphaFormat",function(){return _n}),v.d(b,"AlwaysDepth",function(){return yn}),v.d(b,"AlwaysStencilFunc",function(){return _l}),v.d(b,"AmbientLight",function(){return om}),v.d(b,"AmbientLightProbe",function(){return Cy}),v.d(b,"AnimationClip",function(){return Md}),v.d(b,"AnimationLoader",function(){return xS}),v.d(b,"AnimationMixer",function(){return ky}),v.d(b,"AnimationObjectGroup",function(){return Uy}),v.d(b,"AnimationUtils",function(){return Gn}),v.d(b,"ArcCurve",function(){return kr}),v.d(b,"ArrayCamera",function(){return fd}),v.d(b,"ArrowHelper",function(){return KS}),v.d(b,"Audio",function(){return Ov}),v.d(b,"AudioAnalyser",function(){return Fy}),v.d(b,"AudioContext",function(){return Lv}),v.d(b,"AudioListener",function(){return PS}),v.d(b,"AudioLoader",function(){return Ay}),v.d(b,"AxesHelper",function(){return nx}),v.d(b,"AxisHelper",function(){return CE}),v.d(b,"BackSide",function(){return W}),v.d(b,"BasicDepthPacking",function(){return gl}),v.d(b,"BasicShadowMap",function(){return A}),v.d(b,"BinaryTextureLoader",function(){return DE}),v.d(b,"Bone",function(){return Ph}),v.d(b,"BooleanKeyframeTrack",function(){return Yl}),v.d(b,"BoundingBoxHelper",function(){return RE}),v.d(b,"Box2",function(){return Wh}),v.d(b,"Box3",function(){return In}),v.d(b,"Box3Helper",function(){return JS}),v.d(b,"BoxBufferGeometry",function(){return Qr}),v.d(b,"BoxGeometry",function(){return Qr}),v.d(b,"BoxHelper",function(){return ex}),v.d(b,"BufferAttribute",function(){return Zt}),v.d(b,"BufferGeometry",function(){return Mt}),v.d(b,"BufferGeometryLoader",function(){return wy}),v.d(b,"ByteType",function(){return Fp}),v.d(b,"Cache",function(){return Zl}),v.d(b,"Camera",function(){return zs}),v.d(b,"CameraHelper",function(){return ZS}),v.d(b,"CanvasRenderer",function(){return FE}),v.d(b,"CanvasTexture",function(){return Ct}),v.d(b,"CatmullRomCurve3",function(){return Oh}),v.d(b,"CineonToneMapping",function(){return Ip}),v.d(b,"CircleBufferGeometry",function(){return nt}),v.d(b,"CircleGeometry",function(){return nt}),v.d(b,"ClampToEdgeWrapping",function(){return mi}),v.d(b,"Clock",function(){return Ly}),v.d(b,"Color",function(){return gt}),v.d(b,"ColorKeyframeTrack",function(){return yv}),v.d(b,"CompressedTexture",function(){return yt}),v.d(b,"CompressedTextureLoader",function(){return bS}),v.d(b,"ConeBufferGeometry",function(){return mt}),v.d(b,"ConeGeometry",function(){return mt}),v.d(b,"CubeCamera",function(){return Vs}),v.d(b,"CubeReflectionMapping",function(){return ko}),v.d(b,"CubeRefractionMapping",function(){return ol}),v.d(b,"CubeTexture",function(){return Br}),v.d(b,"CubeTextureLoader",function(){return cy}),v.d(b,"CubeUVReflectionMapping",function(){return fa}),v.d(b,"CubeUVRefractionMapping",function(){return ma}),v.d(b,"CubicBezierCurve",function(){return Qs}),v.d(b,"CubicBezierCurve3",function(){return Va}),v.d(b,"CubicInterpolant",function(){return ay}),v.d(b,"CullFaceBack",function(){return Xe}),v.d(b,"CullFaceFront",function(){return Fe}),v.d(b,"CullFaceFrontBack",function(){return S}),v.d(b,"CullFaceNone",function(){return Ee}),v.d(b,"Curve",function(){return Xn}),v.d(b,"CurvePath",function(){return py}),v.d(b,"CustomBlending",function(){return be}),v.d(b,"CustomToneMapping",function(){return Op}),v.d(b,"CylinderBufferGeometry",function(){return Et}),v.d(b,"CylinderGeometry",function(){return Et}),v.d(b,"Cylindrical",function(){return zS}),v.d(b,"DataTexture",function(){return ns}),v.d(b,"DataTexture2DArray",function(){return fh}),v.d(b,"DataTexture3D",function(){return xr}),v.d(b,"DataTextureLoader",function(){return dy}),v.d(b,"DataUtils",function(){return eE}),v.d(b,"DecrementStencilOp",function(){return ju}),v.d(b,"DecrementWrapStencilOp",function(){return wg}),v.d(b,"DefaultLoadingManager",function(){return hy}),v.d(b,"DepthFormat",function(){return Nn}),v.d(b,"DepthStencilFormat",function(){return Ms}),v.d(b,"DepthTexture",function(){return Je}),v.d(b,"DirectionalLight",function(){return rm}),v.d(b,"DirectionalLightHelper",function(){return qS}),v.d(b,"DiscreteInterpolant",function(){return ly}),v.d(b,"DodecahedronBufferGeometry",function(){return It}),v.d(b,"DodecahedronGeometry",function(){return It}),v.d(b,"DoubleSide",function(){return ee}),v.d(b,"DstAlphaFactor",function(){return Vt}),v.d(b,"DstColorFactor",function(){return Dn}),v.d(b,"DynamicBufferAttribute",function(){return yE}),v.d(b,"DynamicCopyUsage",function(){return Zu}),v.d(b,"DynamicDrawUsage",function(){return Xr}),v.d(b,"DynamicReadUsage",function(){return Sg}),v.d(b,"EdgesGeometry",function(){return Ei}),v.d(b,"EdgesHelper",function(){return IE}),v.d(b,"EllipseCurve",function(){return kn}),v.d(b,"EqualDepth",function(){return Pi}),v.d(b,"EqualStencilFunc",function(){return Xu}),v.d(b,"EquirectangularReflectionMapping",function(){return sl}),v.d(b,"EquirectangularRefractionMapping",function(){return al}),v.d(b,"Euler",function(){return Ns}),v.d(b,"EventDispatcher",function(){return go}),v.d(b,"ExtrudeBufferGeometry",function(){return Ao}),v.d(b,"ExtrudeGeometry",function(){return Ao}),v.d(b,"FaceColors",function(){return lE}),v.d(b,"FileLoader",function(){return Ro}),v.d(b,"FlatShading",function(){return et}),v.d(b,"Float16BufferAttribute",function(){return lf}),v.d(b,"Float32Attribute",function(){return AE}),v.d(b,"Float32BufferAttribute",function(){return st}),v.d(b,"Float64Attribute",function(){return PE}),v.d(b,"Float64BufferAttribute",function(){return Yc}),v.d(b,"FloatType",function(){return ho}),v.d(b,"Fog",function(){return Fl}),v.d(b,"FogExp2",function(){return _i}),v.d(b,"Font",function(){return Iv}),v.d(b,"FontLoader",function(){return ES}),v.d(b,"FrontSide",function(){return z}),v.d(b,"Frustum",function(){return Da}),v.d(b,"GLBufferAttribute",function(){return Hy}),v.d(b,"GLSL1",function(){return Oc}),v.d(b,"GLSL3",function(){return Dc}),v.d(b,"GammaEncoding",function(){return zn}),v.d(b,"GreaterDepth",function(){return Rr}),v.d(b,"GreaterEqualDepth",function(){return Vi}),v.d(b,"GreaterEqualStencilFunc",function(){return ef}),v.d(b,"GreaterStencilFunc",function(){return Yu}),v.d(b,"GridHelper",function(){return $y}),v.d(b,"Group",function(){return Ys}),v.d(b,"HalfFloatType",function(){return Es}),v.d(b,"HemisphereLight",function(){return wv}),v.d(b,"HemisphereLightHelper",function(){return XS}),v.d(b,"HemisphereLightProbe",function(){return Py}),v.d(b,"IcosahedronBufferGeometry",function(){return Nh}),v.d(b,"IcosahedronGeometry",function(){return Nh}),v.d(b,"ImageBitmapLoader",function(){return Ey}),v.d(b,"ImageLoader",function(){return Ad}),v.d(b,"ImageUtils",function(){return fr}),v.d(b,"ImmediateRenderObject",function(){return Xy}),v.d(b,"IncrementStencilOp",function(){return $p}),v.d(b,"IncrementWrapStencilOp",function(){return bg}),v.d(b,"InstancedBufferAttribute",function(){return Rv}),v.d(b,"InstancedBufferGeometry",function(){return Cv}),v.d(b,"InstancedInterleavedBuffer",function(){return Gy}),v.d(b,"InstancedMesh",function(){return vd}),v.d(b,"Int16Attribute",function(){return TE}),v.d(b,"Int16BufferAttribute",function(){return Xc}),v.d(b,"Int32Attribute",function(){return EE}),v.d(b,"Int32BufferAttribute",function(){return hh}),v.d(b,"Int8Attribute",function(){return xE}),v.d(b,"Int8BufferAttribute",function(){return Ml}),v.d(b,"IntType",function(){return Up}),v.d(b,"InterleavedBuffer",function(){return qs}),v.d(b,"InterleavedBufferAttribute",function(){return Mo}),v.d(b,"Interpolant",function(){return ta}),v.d(b,"InterpolateDiscrete",function(){return Vo}),v.d(b,"InterpolateLinear",function(){return pl}),v.d(b,"InterpolateSmooth",function(){return mo}),v.d(b,"InvertStencilOp",function(){return Tg}),v.d(b,"JSONLoader",function(){return BE}),v.d(b,"KeepStencilOp",function(){return un}),v.d(b,"KeyframeTrack",function(){return Po}),v.d(b,"LOD",function(){return Vf}),v.d(b,"LatheBufferGeometry",function(){return Fh}),v.d(b,"LatheGeometry",function(){return Fh}),v.d(b,"Layers",function(){return Uc}),v.d(b,"LensFlare",function(){return kE}),v.d(b,"LessDepth",function(){return ai}),v.d(b,"LessEqualDepth",function(){return Fi}),v.d(b,"LessEqualStencilFunc",function(){return Kp}),v.d(b,"LessStencilFunc",function(){return Wo}),v.d(b,"Light",function(){return Io}),v.d(b,"LightProbe",function(){return Cd}),v.d(b,"Line",function(){return h}),v.d(b,"Line3",function(){return Wy}),v.d(b,"LineBasicMaterial",function(){return yi}),v.d(b,"LineCurve",function(){return ja}),v.d(b,"LineCurve3",function(){return Vl}),v.d(b,"LineDashedMaterial",function(){return vv}),v.d(b,"LineLoop",function(){return P}),v.d(b,"LinePieces",function(){return sE}),v.d(b,"LineSegments",function(){return E}),v.d(b,"LineStrip",function(){return oE}),v.d(b,"LinearEncoding",function(){return wt}),v.d(b,"LinearFilter",function(){return Jn}),v.d(b,"LinearInterpolant",function(){return _v}),v.d(b,"LinearMipMapLinearFilter",function(){return Np}),v.d(b,"LinearMipMapNearestFilter",function(){return Dp}),v.d(b,"LinearMipmapLinearFilter",function(){return Ts}),v.d(b,"LinearMipmapNearestFilter",function(){return Ho}),v.d(b,"LinearToneMapping",function(){return Cp}),v.d(b,"Loader",function(){return Ji}),v.d(b,"LoaderUtils",function(){return sm}),v.d(b,"LoadingManager",function(){return xv}),v.d(b,"LogLuvEncoding",function(){return xn}),v.d(b,"LoopOnce",function(){return zu}),v.d(b,"LoopPingPong",function(){return fo}),v.d(b,"LoopRepeat",function(){return Rc}),v.d(b,"LuminanceAlphaFormat",function(){return gc}),v.d(b,"LuminanceFormat",function(){return zp}),v.d(b,"MOUSE",function(){return K}),v.d(b,"Material",function(){return vi}),v.d(b,"MaterialLoader",function(){return by}),v.d(b,"Math",function(){return Ls}),v.d(b,"MathUtils",function(){return Ls}),v.d(b,"Matrix3",function(){return En}),v.d(b,"Matrix4",function(){return pt}),v.d(b,"MaxEquation",function(){return qe}),v.d(b,"Mesh",function(){return ln}),v.d(b,"MeshBasicMaterial",function(){return Kn}),v.d(b,"MeshDepthMaterial",function(){return on}),v.d(b,"MeshDistanceMaterial",function(){return bh}),v.d(b,"MeshFaceMaterial",function(){return hE}),v.d(b,"MeshLambertMaterial",function(){return im}),v.d(b,"MeshMatcapMaterial",function(){return gv}),v.d(b,"MeshNormalMaterial",function(){return mv}),v.d(b,"MeshPhongMaterial",function(){return nm}),v.d(b,"MeshPhysicalMaterial",function(){return pv}),v.d(b,"MeshStandardMaterial",function(){return tm}),v.d(b,"MeshToonMaterial",function(){return fv}),v.d(b,"MinEquation",function(){return Ue}),v.d(b,"MirroredRepeatWrapping",function(){return ll}),v.d(b,"MixOperation",function(){return Ap}),v.d(b,"MultiMaterial",function(){return cE}),v.d(b,"MultiplyBlending",function(){return H}),v.d(b,"MultiplyOperation",function(){return rl}),v.d(b,"NearestFilter",function(){return Zn}),v.d(b,"NearestMipMapLinearFilter",function(){return mc}),v.d(b,"NearestMipMapNearestFilter",function(){return fc}),v.d(b,"NearestMipmapLinearFilter",function(){return hl}),v.d(b,"NearestMipmapNearestFilter",function(){return ul}),v.d(b,"NeverDepth",function(){return qn}),v.d(b,"NeverStencilFunc",function(){return Wu}),v.d(b,"NoBlending",function(){return $e}),v.d(b,"NoColors",function(){return aE}),v.d(b,"NoToneMapping",function(){return uo}),v.d(b,"NormalAnimationBlendMode",function(){return Cs}),v.d(b,"NormalBlending",function(){return ae}),v.d(b,"NotEqualDepth",function(){return Mp}),v.d(b,"NotEqualStencilFunc",function(){return Qp}),v.d(b,"NumberKeyframeTrack",function(){return Sd}),v.d(b,"Object3D",function(){return Xt}),v.d(b,"ObjectLoader",function(){return wS}),v.d(b,"ObjectSpaceNormalMap",function(){return vl}),v.d(b,"OctahedronBufferGeometry",function(){return jl}),v.d(b,"OctahedronGeometry",function(){return jl}),v.d(b,"OneFactor",function(){return rt}),v.d(b,"OneMinusDstAlphaFactor",function(){return bt}),v.d(b,"OneMinusDstColorFactor",function(){return wn}),v.d(b,"OneMinusSrcAlphaFactor",function(){return Bt}),v.d(b,"OneMinusSrcColorFactor",function(){return lt}),v.d(b,"OrthographicCamera",function(){return jh}),v.d(b,"PCFShadowMap",function(){return O}),v.d(b,"PCFSoftShadowMap",function(){return j}),v.d(b,"PMREMGenerator",function(){return nE}),v.d(b,"ParametricBufferGeometry",function(){return Td}),v.d(b,"ParametricGeometry",function(){return Td}),v.d(b,"Particle",function(){return pE}),v.d(b,"ParticleBasicMaterial",function(){return gE}),v.d(b,"ParticleSystem",function(){return fE}),v.d(b,"ParticleSystemMaterial",function(){return vE}),v.d(b,"Path",function(){return Jl}),v.d(b,"PerspectiveCamera",function(){return Qn}),v.d(b,"Plane",function(){return yr}),v.d(b,"PlaneBufferGeometry",function(){return Ii}),v.d(b,"PlaneGeometry",function(){return Ii}),v.d(b,"PlaneHelper",function(){return $S}),v.d(b,"PointCloud",function(){return dE}),v.d(b,"PointCloudMaterial",function(){return mE}),v.d(b,"PointLight",function(){return Mv}),v.d(b,"PointLightHelper",function(){return jS}),v.d(b,"Points",function(){return ze}),v.d(b,"PointsMaterial",function(){return V}),v.d(b,"PolarGridHelper",function(){return YS}),v.d(b,"PolyhedronBufferGeometry",function(){return St}),v.d(b,"PolyhedronGeometry",function(){return St}),v.d(b,"PositionalAudio",function(){return RS}),v.d(b,"PropertyBinding",function(){return cn}),v.d(b,"PropertyMixer",function(){return By}),v.d(b,"QuadraticBezierCurve",function(){return ea}),v.d(b,"QuadraticBezierCurve3",function(){return av}),v.d(b,"Quaternion",function(){return gi}),v.d(b,"QuaternionKeyframeTrack",function(){return Vh}),v.d(b,"QuaternionLinearInterpolant",function(){return uy}),v.d(b,"REVISION",function(){return X}),v.d(b,"RGBADepthPacking",function(){return Lc}),v.d(b,"RGBAFormat",function(){return er}),v.d(b,"RGBAIntegerFormat",function(){return yc}),v.d(b,"RGBA_ASTC_10x10_Format",function(){return Sc}),v.d(b,"RGBA_ASTC_10x5_Format",function(){return dl}),v.d(b,"RGBA_ASTC_10x6_Format",function(){return As}),v.d(b,"RGBA_ASTC_10x8_Format",function(){return Xp}),v.d(b,"RGBA_ASTC_12x10_Format",function(){return Ec}),v.d(b,"RGBA_ASTC_12x12_Format",function(){return Bu}),v.d(b,"RGBA_ASTC_4x4_Format",function(){return Du}),v.d(b,"RGBA_ASTC_5x4_Format",function(){return Tn}),v.d(b,"RGBA_ASTC_5x5_Format",function(){return po}),v.d(b,"RGBA_ASTC_6x5_Format",function(){return Nu}),v.d(b,"RGBA_ASTC_6x6_Format",function(){return jp}),v.d(b,"RGBA_ASTC_8x5_Format",function(){return Fu}),v.d(b,"RGBA_ASTC_8x6_Format",function(){return Wp}),v.d(b,"RGBA_ASTC_8x8_Format",function(){return Tc}),v.d(b,"RGBA_BPTC_Format",function(){return Uu}),v.d(b,"RGBA_ETC2_EAC_Format",function(){return va}),v.d(b,"RGBA_PVRTC_2BPPV1_Format",function(){return bc}),v.d(b,"RGBA_PVRTC_4BPPV1_Format",function(){return ji}),v.d(b,"RGBA_S3TC_DXT1_Format",function(){return Iu}),v.d(b,"RGBA_S3TC_DXT3_Format",function(){return Lu}),v.d(b,"RGBA_S3TC_DXT5_Format",function(){return Ou}),v.d(b,"RGBDEncoding",function(){return Xi}),v.d(b,"RGBEEncoding",function(){return nr}),v.d(b,"RGBEFormat",function(){return Vp}),v.d(b,"RGBFormat",function(){return co}),v.d(b,"RGBIntegerFormat",function(){return _c}),v.d(b,"RGBM16Encoding",function(){return Ic}),v.d(b,"RGBM7Encoding",function(){return ml}),v.d(b,"RGB_ETC1_Format",function(){return wc}),v.d(b,"RGB_ETC2_Format",function(){return Wr}),v.d(b,"RGB_PVRTC_2BPPV1_Format",function(){return xc}),v.d(b,"RGB_PVRTC_4BPPV1_Format",function(){return Bi}),v.d(b,"RGB_S3TC_DXT1_Format",function(){return Ru}),v.d(b,"RGFormat",function(){return Cu}),v.d(b,"RGIntegerFormat",function(){return tr}),v.d(b,"RawShaderMaterial",function(){return zh}),v.d(b,"Ray",function(){return bo}),v.d(b,"Raycaster",function(){return GS}),v.d(b,"RectAreaLight",function(){return Av}),v.d(b,"RedFormat",function(){return ga}),v.d(b,"RedIntegerFormat",function(){return vc}),v.d(b,"ReinhardToneMapping",function(){return Rp}),v.d(b,"RepeatWrapping",function(){return Go}),v.d(b,"ReplaceStencilOp",function(){return xg}),v.d(b,"ReverseSubtractEquation",function(){return Se}),v.d(b,"RingBufferGeometry",function(){return Bh}),v.d(b,"RingGeometry",function(){return Bh}),v.d(b,"SRGB8_ALPHA8_ASTC_10x10_Format",function(){return Zp}),v.d(b,"SRGB8_ALPHA8_ASTC_10x5_Format",function(){return Cc}),v.d(b,"SRGB8_ALPHA8_ASTC_10x6_Format",function(){return Yp}),v.d(b,"SRGB8_ALPHA8_ASTC_10x8_Format",function(){return qp}),v.d(b,"SRGB8_ALPHA8_ASTC_12x10_Format",function(){return Jp}),v.d(b,"SRGB8_ALPHA8_ASTC_12x12_Format",function(){return Ps}),v.d(b,"SRGB8_ALPHA8_ASTC_4x4_Format",function(){return Mc}),v.d(b,"SRGB8_ALPHA8_ASTC_5x4_Format",function(){return ku}),v.d(b,"SRGB8_ALPHA8_ASTC_5x5_Format",function(){return Gu}),v.d(b,"SRGB8_ALPHA8_ASTC_6x5_Format",function(){return Ac}),v.d(b,"SRGB8_ALPHA8_ASTC_6x6_Format",function(){return Wi}),v.d(b,"SRGB8_ALPHA8_ASTC_8x5_Format",function(){return Hu}),v.d(b,"SRGB8_ALPHA8_ASTC_8x6_Format",function(){return _a}),v.d(b,"SRGB8_ALPHA8_ASTC_8x8_Format",function(){return Pc}),v.d(b,"Scene",function(){return Ba}),v.d(b,"SceneUtils",function(){return UE}),v.d(b,"ShaderChunk",function(){return Lt}),v.d(b,"ShaderLib",function(){return sr}),v.d(b,"ShaderMaterial",function(){return ki}),v.d(b,"ShadowMaterial",function(){return dv}),v.d(b,"Shape",function(){return Xa}),v.d(b,"ShapeBufferGeometry",function(){return Wl}),v.d(b,"ShapeGeometry",function(){return Wl}),v.d(b,"ShapePath",function(){return My}),v.d(b,"ShapeUtils",function(){return ss}),v.d(b,"ShortType",function(){return Bp}),v.d(b,"Skeleton",function(){return Ch}),v.d(b,"SkeletonHelper",function(){return qy}),v.d(b,"SkinnedMesh",function(){return Ga}),v.d(b,"SmoothShading",function(){return ft}),v.d(b,"Sphere",function(){return li}),v.d(b,"SphereBufferGeometry",function(){return Xl}),v.d(b,"SphereGeometry",function(){return Xl}),v.d(b,"Spherical",function(){return HS}),v.d(b,"SphericalHarmonics3",function(){return Pv}),v.d(b,"SplineCurve",function(){return Jf}),v.d(b,"SpotLight",function(){return Sv}),v.d(b,"SpotLightHelper",function(){return VS}),v.d(b,"Sprite",function(){return Hl}),v.d(b,"SpriteMaterial",function(){return Bl}),v.d(b,"SrcAlphaFactor",function(){return en}),v.d(b,"SrcAlphaSaturateFactor",function(){return gn}),v.d(b,"SrcColorFactor",function(){return Qt}),v.d(b,"StaticCopyUsage",function(){return Mg}),v.d(b,"StaticDrawUsage",function(){return Rs}),v.d(b,"StaticReadUsage",function(){return qu}),v.d(b,"StereoCamera",function(){return MS}),v.d(b,"StreamCopyUsage",function(){return Ju}),v.d(b,"StreamDrawUsage",function(){return Is}),v.d(b,"StreamReadUsage",function(){return Eg}),v.d(b,"StringKeyframeTrack",function(){return ql}),v.d(b,"SubtractEquation",function(){return Oe}),v.d(b,"SubtractiveBlending",function(){return Ie}),v.d(b,"TOUCH",function(){return le}),v.d(b,"TangentSpaceNormalMap",function(){return pr}),v.d(b,"TetrahedronBufferGeometry",function(){return Uh}),v.d(b,"TetrahedronGeometry",function(){return Uh}),v.d(b,"TextBufferGeometry",function(){return em}),v.d(b,"TextGeometry",function(){return em}),v.d(b,"Texture",function(){return $n}),v.d(b,"TextureLoader",function(){return bv}),v.d(b,"TorusBufferGeometry",function(){return kh}),v.d(b,"TorusGeometry",function(){return kh}),v.d(b,"TorusKnotBufferGeometry",function(){return Gh}),v.d(b,"TorusKnotGeometry",function(){return Gh}),v.d(b,"Triangle",function(){return Mn}),v.d(b,"TriangleFanDrawMode",function(){return ct}),v.d(b,"TriangleStripDrawMode",function(){return Ze}),v.d(b,"TrianglesDrawMode",function(){return je}),v.d(b,"TubeBufferGeometry",function(){return Hh}),v.d(b,"TubeGeometry",function(){return Hh}),v.d(b,"UVMapping",function(){return Pu}),v.d(b,"Uint16Attribute",function(){return SE}),v.d(b,"Uint16BufferAttribute",function(){return Aa}),v.d(b,"Uint32Attribute",function(){return ME}),v.d(b,"Uint32BufferAttribute",function(){return Fr}),v.d(b,"Uint8Attribute",function(){return bE}),v.d(b,"Uint8BufferAttribute",function(){return Wc}),v.d(b,"Uint8ClampedAttribute",function(){return wE}),v.d(b,"Uint8ClampedBufferAttribute",function(){return uh}),v.d(b,"Uniform",function(){return lm}),v.d(b,"UniformsLib",function(){return dt}),v.d(b,"UniformsUtils",function(){return eo}),v.d(b,"UnsignedByteType",function(){return zo}),v.d(b,"UnsignedInt248Type",function(){return dn}),v.d(b,"UnsignedIntType",function(){return Ss}),v.d(b,"UnsignedShort4444Type",function(){return kp}),v.d(b,"UnsignedShort5551Type",function(){return Gp}),v.d(b,"UnsignedShort565Type",function(){return Hp}),v.d(b,"UnsignedShortType",function(){return cl}),v.d(b,"VSMShadowMap",function(){return D}),v.d(b,"Vector2",function(){return Qe}),v.d(b,"Vector3",function(){return T}),v.d(b,"Vector4",function(){return pn}),v.d(b,"VectorKeyframeTrack",function(){return Ed}),v.d(b,"Vertex",function(){return _E}),v.d(b,"VertexColors",function(){return uE}),v.d(b,"VideoTexture",function(){return vt}),v.d(b,"WebGL1Renderer",function(){return ci}),v.d(b,"WebGLCubeRenderTarget",function(){return Pt}),v.d(b,"WebGLMultipleRenderTargets",function(){return bl}),v.d(b,"WebGLMultisampleRenderTarget",function(){return Os}),v.d(b,"WebGLRenderTarget",function(){return Ir}),v.d(b,"WebGLRenderTargetCube",function(){return NE}),v.d(b,"WebGLRenderer",function(){return fn}),v.d(b,"WebGLUtils",function(){return kf}),v.d(b,"WireframeGeometry",function(){return cv}),v.d(b,"WireframeHelper",function(){return LE}),v.d(b,"WrapAroundEnding",function(){return fl}),v.d(b,"XHRLoader",function(){return OE}),v.d(b,"ZeroCurvatureEnding",function(){return bi}),v.d(b,"ZeroFactor",function(){return at}),v.d(b,"ZeroSlopeEnding",function(){return jo}),v.d(b,"ZeroStencilOp",function(){return Vu}),v.d(b,"sRGBEncoding",function(){return $t});var q={};v.r(q),v.d(q,"isMobile",function(){return ro}),v.d(q,"EventEmitter",function(){return Zh.a}),v.d(q,"earcut",function(){return $v.a}),v.d(q,"BaseTextureCache",function(){return so}),v.d(q,"CanvasRenderTarget",function(){return u0}),v.d(q,"DATA_URI",function(){return Yx}),v.d(q,"ProgramCache",function(){return l0}),v.d(q,"TextureCache",function(){return Er}),v.d(q,"clearTextureCache",function(){return oM}),v.d(q,"correctBlendMode",function(){return r0}),v.d(q,"createIndicesForQuads",function(){return Vx}),v.d(q,"decomposeDataUri",function(){return sM}),v.d(q,"deprecation",function(){return uu}),v.d(q,"destroyTextureCache",function(){return rM}),v.d(q,"determineCrossOrigin",function(){return qx}),v.d(q,"getBufferType",function(){return jx}),v.d(q,"getResolutionOfUrl",function(){return Fd}),v.d(q,"hex2rgb",function(){return ou}),v.d(q,"hex2string",function(){return t0}),v.d(q,"interleaveTypedArrays",function(){return nM}),v.d(q,"isPow2",function(){return s0}),v.d(q,"isWebGLSupported",function(){return Hx}),v.d(q,"log2",function(){return a0}),v.d(q,"nextPow2",function(){return Nd}),v.d(q,"premultiplyBlendMode",function(){return i0}),v.d(q,"premultiplyRgba",function(){return zx}),v.d(q,"premultiplyTint",function(){return xm}),v.d(q,"premultiplyTintToRgba",function(){return o0}),v.d(q,"removeItems",function(){return su}),v.d(q,"rgb2hex",function(){return eM}),v.d(q,"sayHello",function(){return Gx}),v.d(q,"sign",function(){return au}),v.d(q,"skipHello",function(){return KE}),v.d(q,"string2hex",function(){return n0}),v.d(q,"trimCanvas",function(){return Xx}),v.d(q,"uid",function(){return lu}),v.d(q,"url",function(){return ru});var B={};v.r(B),v.d(B,"utils",function(){return q}),v.d(B,"AccessibilityManager",function(){return n1}),v.d(B,"accessibleTarget",function(){return t1}),v.d(B,"InteractionData",function(){return g0}),v.d(B,"InteractionEvent",function(){return o1}),v.d(B,"InteractionManager",function(){return a1}),v.d(B,"InteractionTrackingData",function(){return Tm}),v.d(B,"interactiveTarget",function(){return s1}),v.d(B,"Application",function(){return Xd}),v.d(B,"AbstractBatchRenderer",function(){return B1}),v.d(B,"AbstractMultiResource",function(){return Mm}),v.d(B,"AbstractRenderer",function(){return D1}),v.d(B,"ArrayResource",function(){return v0}),v.d(B,"Attribute",function(){return T0}),v.d(B,"BaseImageResource",function(){return ps}),v.d(B,"BaseRenderTexture",function(){return b0}),v.d(B,"BaseTexture",function(){return vn}),v.d(B,"BatchDrawCall",function(){return km}),v.d(B,"BatchGeometry",function(){return j0}),v.d(B,"BatchPluginFactory",function(){return H1}),v.d(B,"BatchRenderer",function(){return z1}),v.d(B,"BatchShaderGenerator",function(){return U1}),v.d(B,"BatchSystem",function(){return A0}),v.d(B,"BatchTextureArray",function(){return Gm}),v.d(B,"Buffer",function(){return Di}),v.d(B,"BufferResource",function(){return Jh}),v.d(B,"CanvasResource",function(){return Am}),v.d(B,"ContextSystem",function(){return P0}),v.d(B,"CubeResource",function(){return _0}),v.d(B,"Filter",function(){return Pr}),v.d(B,"FilterState",function(){return m1}),v.d(B,"FilterSystem",function(){return M0}),v.d(B,"Framebuffer",function(){return Rm}),v.d(B,"FramebufferSystem",function(){return C0}),v.d(B,"GLFramebuffer",function(){return v1}),v.d(B,"GLProgram",function(){return I1}),v.d(B,"GLTexture",function(){return Um}),v.d(B,"Geometry",function(){return gu}),v.d(B,"GeometrySystem",function(){return I0}),v.d(B,"IGLUniformData",function(){return EM}),v.d(B,"INSTALLED",function(){return Gd}),v.d(B,"ImageBitmapResource",function(){return x0}),v.d(B,"ImageResource",function(){return Pm}),v.d(B,"MaskData",function(){return _1}),v.d(B,"MaskSystem",function(){return O0}),v.d(B,"ObjectRenderer",function(){return Hd}),v.d(B,"Program",function(){return jd}),v.d(B,"ProjectionSystem",function(){return F0}),v.d(B,"Quad",function(){return f1}),v.d(B,"QuadUv",function(){return S0}),v.d(B,"RenderTexture",function(){return Gr}),v.d(B,"RenderTexturePool",function(){return c1}),v.d(B,"RenderTextureSystem",function(){return B0}),v.d(B,"Renderer",function(){return sa}),v.d(B,"Resource",function(){return mu}),v.d(B,"SVGResource",function(){return y0}),v.d(B,"ScissorSystem",function(){return D0}),v.d(B,"Shader",function(){return oa}),v.d(B,"ShaderSystem",function(){return U0}),v.d(B,"SpriteMaskFilter",function(){return C1}),v.d(B,"State",function(){return Ja}),v.d(B,"StateSystem",function(){return k0}),v.d(B,"StencilSystem",function(){return N0}),v.d(B,"System",function(){return Ar}),v.d(B,"Texture",function(){return Nt}),v.d(B,"TextureGCSystem",function(){return G0}),v.d(B,"TextureMatrix",function(){return Bm}),v.d(B,"TextureSystem",function(){return H0}),v.d(B,"TextureUvs",function(){return w0}),v.d(B,"UniformGroup",function(){return Za}),v.d(B,"VideoResource",function(){return Cm}),v.d(B,"ViewableBuffer",function(){return Hm}),v.d(B,"autoDetectRenderer",function(){return N1}),v.d(B,"autoDetectResource",function(){return Em}),v.d(B,"checkMaxIfStatementsInShader",function(){return A1}),v.d(B,"defaultFilterVertex",function(){return V0}),v.d(B,"defaultVertex",function(){return F1}),v.d(B,"resources",function(){return V1}),v.d(B,"systems",function(){return j1}),v.d(B,"uniformParsers",function(){return Nm}),v.d(B,"Extract",function(){return X1}),v.d(B,"AppLoaderPlugin",function(){return tb}),v.d(B,"Loader",function(){return fs}),v.d(B,"LoaderResource",function(){return ao}),v.d(B,"TextureLoader",function(){return eb}),v.d(B,"BlobResource",function(){return rb}),v.d(B,"CompressedTextureLoader",function(){return ob}),v.d(B,"CompressedTextureResource",function(){return jm}),v.d(B,"DDSLoader",function(){return ab}),v.d(B,"FORMATS_TO_COMPONENTS",function(){return ub}),v.d(B,"INTERNAL_FORMATS",function(){return Jt}),v.d(B,"INTERNAL_FORMAT_TO_BYTES_PER_PIXEL",function(){return Yd}),v.d(B,"KTXLoader",function(){return cb}),v.d(B,"TYPES_TO_BYTES_PER_COMPONENT",function(){return Z0}),v.d(B,"TYPES_TO_BYTES_PER_PIXEL",function(){return hb}),v.d(B,"ParticleContainer",function(){return aA}),v.d(B,"ParticleRenderer",function(){return mb}),v.d(B,"BasePrepare",function(){return Rb}),v.d(B,"CountLimiter",function(){return Cb}),v.d(B,"Prepare",function(){return Lb}),v.d(B,"TimeLimiter",function(){return TA}),v.d(B,"Spritesheet",function(){return Ob}),v.d(B,"SpritesheetLoader",function(){return Db}),v.d(B,"TilingSprite",function(){return SA}),v.d(B,"TilingSpriteRenderer",function(){return Ub}),v.d(B,"BitmapFont",function(){return rc}),v.d(B,"BitmapFontData",function(){return ep}),v.d(B,"BitmapFontLoader",function(){return Yb}),v.d(B,"BitmapText",function(){return PA}),v.d(B,"Ticker",function(){return Oi}),v.d(B,"TickerPlugin",function(){return i1}),v.d(B,"UPDATE_PRIORITY",function(){return Mr}),v.d(B,"ALPHA_MODES",function(){return ds}),v.d(B,"BLEND_MODES",function(){return Ft}),v.d(B,"BUFFER_BITS",function(){return Od}),v.d(B,"CLEAR_MODES",function(){return ra}),v.d(B,"DRAW_MODES",function(){return oo}),v.d(B,"ENV",function(){return us}),v.d(B,"FORMATS",function(){return Lo}),v.d(B,"GC_MODES",function(){return ym}),v.d(B,"MASK_TYPES",function(){return Sr}),v.d(B,"MIPMAP_MODES",function(){return ia}),v.d(B,"MSAA_QUALITY",function(){return iu}),v.d(B,"PRECISION",function(){return Oo}),v.d(B,"RENDERER_TYPE",function(){return qh}),v.d(B,"SAMPLER_TYPES",function(){return Dd}),v.d(B,"SCALE_MODES",function(){return hs}),v.d(B,"TARGETS",function(){return qa}),v.d(B,"TYPES",function(){return bn}),v.d(B,"WRAP_MODES",function(){return cs}),v.d(B,"Bounds",function(){return kd}),v.d(B,"Container",function(){return Mi}),v.d(B,"DisplayObject",function(){return fi}),v.d(B,"TemporaryDisplayObject",function(){return f0}),v.d(B,"FillStyle",function(){return J0}),v.d(B,"GRAPHICS_CURVES",function(){return Kh}),v.d(B,"Graphics",function(){return ca}),v.d(B,"GraphicsData",function(){return i_}),v.d(B,"GraphicsGeometry",function(){return Tb}),v.d(B,"LINE_CAP",function(){return ha}),v.d(B,"LINE_JOIN",function(){return ua}),v.d(B,"LineStyle",function(){return Sb}),v.d(B,"graphicsUtils",function(){return hA}),v.d(B,"Circle",function(){return $x}),v.d(B,"DEG_TO_RAD",function(){return Jx}),v.d(B,"Ellipse",function(){return Kx}),v.d(B,"Matrix",function(){return pi}),v.d(B,"ObservablePoint",function(){return hu}),v.d(B,"PI_2",function(){return Bd}),v.d(B,"Point",function(){return oi}),v.d(B,"Polygon",function(){return Ud}),v.d(B,"RAD_TO_DEG",function(){return Zx}),v.d(B,"Rectangle",function(){return nn}),v.d(B,"RoundedRectangle",function(){return h0}),v.d(B,"SHAPES",function(){return ri}),v.d(B,"Transform",function(){return d0}),v.d(B,"groupD8",function(){return Yn}),v.d(B,"Mesh",function(){return xu}),v.d(B,"MeshBatchUvs",function(){return Gb}),v.d(B,"MeshGeometry",function(){return Qd}),v.d(B,"MeshMaterial",function(){return Kd}),v.d(B,"NineSlicePlane",function(){return kA}),v.d(B,"PlaneGeometry",function(){return xw}),v.d(B,"RopeGeometry",function(){return bw}),v.d(B,"SimpleMesh",function(){return UA}),v.d(B,"SimplePlane",function(){return ww}),v.d(B,"SimpleRope",function(){return BA}),v.d(B,"Runner",function(){return zi}),v.d(B,"Sprite",function(){return Hn}),v.d(B,"AnimatedSprite",function(){return f_}),v.d(B,"TEXT_GRADIENT",function(){return ic}),v.d(B,"Text",function(){return Zm}),v.d(B,"TextMetrics",function(){return Hr}),v.d(B,"TextStyle",function(){return yu}),v.d(B,"isMobile",function(){return ro}),v.d(B,"settings",function(){return At}),v.d(B,"VERSION",function(){return GA}),v.d(B,"filters",function(){return np});var ie=v(0),k=v.n(ie),oe=v(1);/**
|
|
81
|
+
*/(function(){var B=function(){this.init()};B.prototype={init:function(){var S=this||ie;return S._counter=1e3,S._html5AudioPool=[],S.html5PoolSize=10,S._codecs={},S._howls=[],S._muted=!1,S._volume=1,S._canPlayEvent="canplaythrough",S._navigator=typeof window!="undefined"&&window.navigator?window.navigator:null,S.masterGain=null,S.noAudio=!1,S.usingWebAudio=!0,S.autoSuspend=!0,S.ctx=null,S.autoUnlock=!0,S._setup(),S},volume:function(S){var A=this||ie;if(S=parseFloat(S),A.ctx||Fe(),S!==void 0&&S>=0&&S<=1){if(A._volume=S,A._muted)return A;A.usingWebAudio&&A.masterGain.gain.setValueAtTime(S,ie.ctx.currentTime);for(var O=0;O<A._howls.length;O++)if(!A._howls[O]._webAudio)for(var V=A._howls[O]._getSoundIds(),D=0;D<V.length;D++){var z=A._howls[O]._soundById(V[D]);z&&z._node&&(z._node.volume=z._volume*S)}return A}return A._volume},mute:function(S){var A=this||ie;A.ctx||Fe(),A._muted=S,A.usingWebAudio&&A.masterGain.gain.setValueAtTime(S?0:A._volume,ie.ctx.currentTime);for(var O=0;O<A._howls.length;O++)if(!A._howls[O]._webAudio)for(var V=A._howls[O]._getSoundIds(),D=0;D<V.length;D++){var z=A._howls[O]._soundById(V[D]);z&&z._node&&(z._node.muted=!!S||z._muted)}return A},stop:function(){for(var S=this||ie,A=0;A<S._howls.length;A++)S._howls[A].stop();return S},unload:function(){for(var S=this||ie,A=S._howls.length-1;A>=0;A--)S._howls[A].unload();return S.usingWebAudio&&S.ctx&&S.ctx.close!==void 0&&(S.ctx.close(),S.ctx=null,Fe()),S},codecs:function(S){return(this||ie)._codecs[S.replace(/^x-/,"")]},_setup:function(){var S=this||ie;if(S.state=S.ctx&&S.ctx.state||"suspended",S._autoSuspend(),!S.usingWebAudio)if(typeof Audio!="undefined")try{new Audio().oncanplaythrough===void 0&&(S._canPlayEvent="canplay")}catch{S.noAudio=!0}else S.noAudio=!0;try{new Audio().muted&&(S.noAudio=!0)}catch{}return S.noAudio||S._setupCodecs(),S},_setupCodecs:function(){var S=this||ie,A=null;try{A=typeof Audio!="undefined"?new Audio:null}catch{return S}if(!A||typeof A.canPlayType!="function")return S;var O=A.canPlayType("audio/mpeg;").replace(/^no$/,""),V=S._navigator?S._navigator.userAgent:"",D=V.match(/OPR\/([0-6].)/g),z=D&&parseInt(D[0].split("/")[1],10)<33,W=V.indexOf("Safari")!==-1&&V.indexOf("Chrome")===-1,ee=V.match(/Version\/(.*?) /),et=W&&ee&&parseInt(ee[1],10)<15;return S._codecs={mp3:!(z||!O&&!A.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!O,opus:!!A.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!A.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!A.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(A.canPlayType('audio/wav; codecs="1"')||A.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!A.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!A.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(A.canPlayType("audio/x-m4a;")||A.canPlayType("audio/m4a;")||A.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(A.canPlayType("audio/x-m4b;")||A.canPlayType("audio/m4b;")||A.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(A.canPlayType("audio/x-mp4;")||A.canPlayType("audio/mp4;")||A.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(et||!A.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(et||!A.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!A.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(A.canPlayType("audio/x-flac;")||A.canPlayType("audio/flac;")).replace(/^no$/,"")},S},_unlockAudio:function(){var S=this||ie;if(!S._audioUnlocked&&S.ctx){S._audioUnlocked=!1,S.autoUnlock=!1,S._mobileUnloaded||S.ctx.sampleRate===44100||(S._mobileUnloaded=!0,S.unload()),S._scratchBuffer=S.ctx.createBuffer(1,1,22050);var A=function(O){for(;S._html5AudioPool.length<S.html5PoolSize;)try{var V=new Audio;V._unlocked=!0,S._releaseHtml5Audio(V)}catch{S.noAudio=!0;break}for(var D=0;D<S._howls.length;D++)if(!S._howls[D]._webAudio)for(var z=S._howls[D]._getSoundIds(),W=0;W<z.length;W++){var ee=S._howls[D]._soundById(z[W]);ee&&ee._node&&!ee._node._unlocked&&(ee._node._unlocked=!0,ee._node.load())}S._autoResume();var et=S.ctx.createBufferSource();et.buffer=S._scratchBuffer,et.connect(S.ctx.destination),et.start===void 0?et.noteOn(0):et.start(0),typeof S.ctx.resume=="function"&&S.ctx.resume(),et.onended=function(){et.disconnect(0),S._audioUnlocked=!0,document.removeEventListener("touchstart",A,!0),document.removeEventListener("touchend",A,!0),document.removeEventListener("click",A,!0),document.removeEventListener("keydown",A,!0);for(var ft=0;ft<S._howls.length;ft++)S._howls[ft]._emit("unlock")}};return document.addEventListener("touchstart",A,!0),document.addEventListener("touchend",A,!0),document.addEventListener("click",A,!0),document.addEventListener("keydown",A,!0),S}},_obtainHtml5Audio:function(){var S=this||ie;if(S._html5AudioPool.length)return S._html5AudioPool.pop();var A=new Audio().play();return A&&typeof Promise!="undefined"&&(A instanceof Promise||typeof A.then=="function")&&A.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(S){var A=this||ie;return S._unlocked&&A._html5AudioPool.push(S),A},_autoSuspend:function(){var S=this;if(S.autoSuspend&&S.ctx&&S.ctx.suspend!==void 0&&ie.usingWebAudio){for(var A=0;A<S._howls.length;A++)if(S._howls[A]._webAudio){for(var O=0;O<S._howls[A]._sounds.length;O++)if(!S._howls[A]._sounds[O]._paused)return S}return S._suspendTimer&&clearTimeout(S._suspendTimer),S._suspendTimer=setTimeout(function(){if(S.autoSuspend){S._suspendTimer=null,S.state="suspending";var V=function(){S.state="suspended",S._resumeAfterSuspend&&(delete S._resumeAfterSuspend,S._autoResume())};S.ctx.suspend().then(V,V)}},3e4),S}},_autoResume:function(){var S=this;if(S.ctx&&S.ctx.resume!==void 0&&ie.usingWebAudio)return S.state==="running"&&S.ctx.state!=="interrupted"&&S._suspendTimer?(clearTimeout(S._suspendTimer),S._suspendTimer=null):S.state==="suspended"||S.state==="running"&&S.ctx.state==="interrupted"?(S.ctx.resume().then(function(){S.state="running";for(var A=0;A<S._howls.length;A++)S._howls[A]._emit("resume")}),S._suspendTimer&&(clearTimeout(S._suspendTimer),S._suspendTimer=null)):S.state==="suspending"&&(S._resumeAfterSuspend=!0),S}};var ie=new B,k=function(S){S.src&&S.src.length!==0?this.init(S):console.error("An array of source files must be passed with any new Howl.")};k.prototype={init:function(S){var A=this;return ie.ctx||Fe(),A._autoplay=S.autoplay||!1,A._format=typeof S.format!="string"?S.format:[S.format],A._html5=S.html5||!1,A._muted=S.mute||!1,A._loop=S.loop||!1,A._pool=S.pool||5,A._preload=typeof S.preload!="boolean"&&S.preload!=="metadata"||S.preload,A._rate=S.rate||1,A._sprite=S.sprite||{},A._src=typeof S.src!="string"?S.src:[S.src],A._volume=S.volume!==void 0?S.volume:1,A._xhr={method:S.xhr&&S.xhr.method?S.xhr.method:"GET",headers:S.xhr&&S.xhr.headers?S.xhr.headers:null,withCredentials:!(!S.xhr||!S.xhr.withCredentials)&&S.xhr.withCredentials},A._duration=0,A._state="unloaded",A._sounds=[],A._endTimers={},A._queue=[],A._playLock=!1,A._onend=S.onend?[{fn:S.onend}]:[],A._onfade=S.onfade?[{fn:S.onfade}]:[],A._onload=S.onload?[{fn:S.onload}]:[],A._onloaderror=S.onloaderror?[{fn:S.onloaderror}]:[],A._onplayerror=S.onplayerror?[{fn:S.onplayerror}]:[],A._onpause=S.onpause?[{fn:S.onpause}]:[],A._onplay=S.onplay?[{fn:S.onplay}]:[],A._onstop=S.onstop?[{fn:S.onstop}]:[],A._onmute=S.onmute?[{fn:S.onmute}]:[],A._onvolume=S.onvolume?[{fn:S.onvolume}]:[],A._onrate=S.onrate?[{fn:S.onrate}]:[],A._onseek=S.onseek?[{fn:S.onseek}]:[],A._onunlock=S.onunlock?[{fn:S.onunlock}]:[],A._onresume=[],A._webAudio=ie.usingWebAudio&&!A._html5,ie.ctx!==void 0&&ie.ctx&&ie.autoUnlock&&ie._unlockAudio(),ie._howls.push(A),A._autoplay&&A._queue.push({event:"play",action:function(){A.play()}}),A._preload&&A._preload!=="none"&&A.load(),A},load:function(){var S=null;if(ie.noAudio)this._emit("loaderror",null,"No audio support.");else{typeof this._src=="string"&&(this._src=[this._src]);for(var A=0;A<this._src.length;A++){var O,V;if(this._format&&this._format[A])O=this._format[A];else{if(typeof(V=this._src[A])!="string"){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(O=/^data:audio\/([^;,]+);/i.exec(V))||(O=/\.([^.]+)$/.exec(V.split("?",1)[0])),O&&(O=O[1].toLowerCase())}if(O||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),O&&ie.codecs(O)){S=this._src[A];break}}if(S)return this._src=S,this._state="loading",window.location.protocol==="https:"&&S.slice(0,5)==="http:"&&(this._html5=!0,this._webAudio=!1),new oe(this),this._webAudio&&K(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(S,A){var O=this,V=null;if(typeof S=="number")V=S,S=null;else{if(typeof S=="string"&&O._state==="loaded"&&!O._sprite[S])return null;if(S===void 0&&(S="__default",!O._playLock)){for(var D=0,z=0;z<O._sounds.length;z++)O._sounds[z]._paused&&!O._sounds[z]._ended&&(D++,V=O._sounds[z]._id);D===1?S=null:V=null}}var W=V?O._soundById(V):O._inactiveSound();if(!W)return null;if(V&&!S&&(S=W._sprite||"__default"),O._state!=="loaded"){W._sprite=S,W._ended=!1;var ee=W._id;return O._queue.push({event:"play",action:function(){O.play(ee)}}),ee}if(V&&!W._paused)return A||O._loadQueue("play"),W._id;O._webAudio&&ie._autoResume();var et=Math.max(0,W._seek>0?W._seek:O._sprite[S][0]/1e3),ft=Math.max(0,(O._sprite[S][0]+O._sprite[S][1])/1e3-et),$e=1e3*ft/Math.abs(W._rate),ae=O._sprite[S][0]/1e3,Ce=(O._sprite[S][0]+O._sprite[S][1])/1e3;W._sprite=S,W._ended=!1;var Ie=function(){W._paused=!1,W._seek=et,W._start=ae,W._stop=Ce,W._loop=!(!W._loop&&!O._sprite[S][2])};if(!(et>=Ce)){var H=W._node;if(O._webAudio){var be=function(){O._playLock=!1,Ie(),O._refreshBuffer(W);var Ue=W._muted||O._muted?0:W._volume;H.gain.setValueAtTime(Ue,ie.ctx.currentTime),W._playStart=ie.ctx.currentTime,H.bufferSource.start===void 0?W._loop?H.bufferSource.noteGrainOn(0,et,86400):H.bufferSource.noteGrainOn(0,et,ft):W._loop?H.bufferSource.start(0,et,86400):H.bufferSource.start(0,et,ft),$e!==1/0&&(O._endTimers[W._id]=setTimeout(O._ended.bind(O,W),$e)),A||setTimeout(function(){O._emit("play",W._id),O._loadQueue()},0)};ie.state==="running"&&ie.ctx.state!=="interrupted"?be():(O._playLock=!0,O.once("resume",be),O._clearTimer(W._id))}else{var Me=function(){H.currentTime=et,H.muted=W._muted||O._muted||ie._muted||H.muted,H.volume=W._volume*ie.volume(),H.playbackRate=W._rate;try{var Ue=H.play();if(Ue&&typeof Promise!="undefined"&&(Ue instanceof Promise||typeof Ue.then=="function")?(O._playLock=!0,Ie(),Ue.then(function(){O._playLock=!1,H._unlocked=!0,A?O._loadQueue():O._emit("play",W._id)}).catch(function(){O._playLock=!1,O._emit("playerror",W._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),W._ended=!0,W._paused=!0})):A||(O._playLock=!1,Ie(),O._emit("play",W._id)),H.playbackRate=W._rate,H.paused)return void O._emit("playerror",W._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");S!=="__default"||W._loop?O._endTimers[W._id]=setTimeout(O._ended.bind(O,W),$e):(O._endTimers[W._id]=function(){O._ended(W),H.removeEventListener("ended",O._endTimers[W._id],!1)},H.addEventListener("ended",O._endTimers[W._id],!1))}catch(qe){O._emit("playerror",W._id,qe)}};H.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(H.src=O._src,H.load());var Oe=window&&window.ejecta||!H.readyState&&ie._navigator.isCocoonJS;if(H.readyState>=3||Oe)Me();else{O._playLock=!0,O._state="loading";var Se=function(){O._state="loaded",Me(),H.removeEventListener(ie._canPlayEvent,Se,!1)};H.addEventListener(ie._canPlayEvent,Se,!1),O._clearTimer(W._id)}}return W._id}O._ended(W)},pause:function(S){var A=this;if(A._state!=="loaded"||A._playLock)return A._queue.push({event:"pause",action:function(){A.pause(S)}}),A;for(var O=A._getSoundIds(S),V=0;V<O.length;V++){A._clearTimer(O[V]);var D=A._soundById(O[V]);if(D&&!D._paused&&(D._seek=A.seek(O[V]),D._rateSeek=0,D._paused=!0,A._stopFade(O[V]),D._node))if(A._webAudio){if(!D._node.bufferSource)continue;D._node.bufferSource.stop===void 0?D._node.bufferSource.noteOff(0):D._node.bufferSource.stop(0),A._cleanBuffer(D._node)}else isNaN(D._node.duration)&&D._node.duration!==1/0||D._node.pause();arguments[1]||A._emit("pause",D?D._id:null)}return A},stop:function(S,A){var O=this;if(O._state!=="loaded"||O._playLock)return O._queue.push({event:"stop",action:function(){O.stop(S)}}),O;for(var V=O._getSoundIds(S),D=0;D<V.length;D++){O._clearTimer(V[D]);var z=O._soundById(V[D]);z&&(z._seek=z._start||0,z._rateSeek=0,z._paused=!0,z._ended=!0,O._stopFade(V[D]),z._node&&(O._webAudio?z._node.bufferSource&&(z._node.bufferSource.stop===void 0?z._node.bufferSource.noteOff(0):z._node.bufferSource.stop(0),O._cleanBuffer(z._node)):isNaN(z._node.duration)&&z._node.duration!==1/0||(z._node.currentTime=z._start||0,z._node.pause(),z._node.duration===1/0&&O._clearSound(z._node))),A||O._emit("stop",z._id))}return O},mute:function(S,A){var O=this;if(O._state!=="loaded"||O._playLock)return O._queue.push({event:"mute",action:function(){O.mute(S,A)}}),O;if(A===void 0){if(typeof S!="boolean")return O._muted;O._muted=S}for(var V=O._getSoundIds(A),D=0;D<V.length;D++){var z=O._soundById(V[D]);z&&(z._muted=S,z._interval&&O._stopFade(z._id),O._webAudio&&z._node?z._node.gain.setValueAtTime(S?0:z._volume,ie.ctx.currentTime):z._node&&(z._node.muted=!!ie._muted||S),O._emit("mute",z._id))}return O},volume:function(){var S,A,O,V=this,D=arguments;if(D.length===0)return V._volume;if(D.length===1||D.length===2&&D[1]===void 0){var z=V._getSoundIds(),W=z.indexOf(D[0]);W>=0?A=parseInt(D[0],10):S=parseFloat(D[0])}else D.length>=2&&(S=parseFloat(D[0]),A=parseInt(D[1],10));if(!(S!==void 0&&S>=0&&S<=1))return(O=A?V._soundById(A):V._sounds[0])?O._volume:0;if(V._state!=="loaded"||V._playLock)return V._queue.push({event:"volume",action:function(){V.volume.apply(V,D)}}),V;A===void 0&&(V._volume=S),A=V._getSoundIds(A);for(var ee=0;ee<A.length;ee++)(O=V._soundById(A[ee]))&&(O._volume=S,D[2]||V._stopFade(A[ee]),V._webAudio&&O._node&&!O._muted?O._node.gain.setValueAtTime(S,ie.ctx.currentTime):O._node&&!O._muted&&(O._node.volume=S*ie.volume()),V._emit("volume",O._id));return V},fade:function(S,A,O,V){var D=this;if(D._state!=="loaded"||D._playLock)return D._queue.push({event:"fade",action:function(){D.fade(S,A,O,V)}}),D;S=Math.min(Math.max(0,parseFloat(S)),1),A=Math.min(Math.max(0,parseFloat(A)),1),O=parseFloat(O),D.volume(S,V);for(var z=D._getSoundIds(V),W=0;W<z.length;W++){var ee=D._soundById(z[W]);if(ee){if(V||D._stopFade(z[W]),D._webAudio&&!ee._muted){var et=ie.ctx.currentTime,ft=et+O/1e3;ee._volume=S,ee._node.gain.setValueAtTime(S,et),ee._node.gain.linearRampToValueAtTime(A,ft)}D._startFadeInterval(ee,S,A,O,z[W],V===void 0)}}return D},_startFadeInterval:function(S,A,O,V,D,z){var W=this,ee=A,et=O-A,ft=Math.abs(et/.01),$e=Math.max(4,ft>0?V/ft:V),ae=Date.now();S._fadeTo=O,S._interval=setInterval(function(){var Ce=(Date.now()-ae)/V;ae=Date.now(),ee+=et*Ce,ee=Math.round(100*ee)/100,ee=et<0?Math.max(O,ee):Math.min(O,ee),W._webAudio?S._volume=ee:W.volume(ee,S._id,!0),z&&(W._volume=ee),(O<A&&ee<=O||O>A&&ee>=O)&&(clearInterval(S._interval),S._interval=null,S._fadeTo=null,W.volume(O,S._id),W._emit("fade",S._id))},$e)},_stopFade:function(S){var A=this._soundById(S);return A&&A._interval&&(this._webAudio&&A._node.gain.cancelScheduledValues(ie.ctx.currentTime),clearInterval(A._interval),A._interval=null,this.volume(A._fadeTo,S),A._fadeTo=null,this._emit("fade",S)),this},loop:function(){var S,A,O,V=this,D=arguments;if(D.length===0)return V._loop;if(D.length===1){if(typeof D[0]!="boolean")return!!(O=V._soundById(parseInt(D[0],10)))&&O._loop;S=D[0],V._loop=S}else D.length===2&&(S=D[0],A=parseInt(D[1],10));for(var z=V._getSoundIds(A),W=0;W<z.length;W++)(O=V._soundById(z[W]))&&(O._loop=S,V._webAudio&&O._node&&O._node.bufferSource&&(O._node.bufferSource.loop=S,S&&(O._node.bufferSource.loopStart=O._start||0,O._node.bufferSource.loopEnd=O._stop,V.playing(z[W])&&(V.pause(z[W],!0),V.play(z[W],!0)))));return V},rate:function(){var S,A,O,V=this,D=arguments;if(D.length===0)A=V._sounds[0]._id;else if(D.length===1){var z=V._getSoundIds(),W=z.indexOf(D[0]);W>=0?A=parseInt(D[0],10):S=parseFloat(D[0])}else D.length===2&&(S=parseFloat(D[0]),A=parseInt(D[1],10));if(typeof S!="number")return(O=V._soundById(A))?O._rate:V._rate;if(V._state!=="loaded"||V._playLock)return V._queue.push({event:"rate",action:function(){V.rate.apply(V,D)}}),V;A===void 0&&(V._rate=S),A=V._getSoundIds(A);for(var ee=0;ee<A.length;ee++)if(O=V._soundById(A[ee])){V.playing(A[ee])&&(O._rateSeek=V.seek(A[ee]),O._playStart=V._webAudio?ie.ctx.currentTime:O._playStart),O._rate=S,V._webAudio&&O._node&&O._node.bufferSource?O._node.bufferSource.playbackRate.setValueAtTime(S,ie.ctx.currentTime):O._node&&(O._node.playbackRate=S);var et=V.seek(A[ee]),ft=(V._sprite[O._sprite][0]+V._sprite[O._sprite][1])/1e3-et,$e=1e3*ft/Math.abs(O._rate);!V._endTimers[A[ee]]&&O._paused||(V._clearTimer(A[ee]),V._endTimers[A[ee]]=setTimeout(V._ended.bind(V,O),$e)),V._emit("rate",O._id)}return V},seek:function(){var S,A,O=this,V=arguments;if(V.length===0)O._sounds.length&&(A=O._sounds[0]._id);else if(V.length===1){var D=O._getSoundIds(),z=D.indexOf(V[0]);z>=0?A=parseInt(V[0],10):O._sounds.length&&(A=O._sounds[0]._id,S=parseFloat(V[0]))}else V.length===2&&(S=parseFloat(V[0]),A=parseInt(V[1],10));if(A===void 0)return 0;if(typeof S=="number"&&(O._state!=="loaded"||O._playLock))return O._queue.push({event:"seek",action:function(){O.seek.apply(O,V)}}),O;var W=O._soundById(A);if(W){if(!(typeof S=="number"&&S>=0)){if(O._webAudio){var ee=O.playing(A)?ie.ctx.currentTime-W._playStart:0,et=W._rateSeek?W._rateSeek-W._seek:0;return W._seek+(et+ee*Math.abs(W._rate))}return W._node.currentTime}var ft=O.playing(A);ft&&O.pause(A,!0),W._seek=S,W._ended=!1,O._clearTimer(A),O._webAudio||!W._node||isNaN(W._node.duration)||(W._node.currentTime=S);var $e=function(){ft&&O.play(A,!0),O._emit("seek",A)};if(ft&&!O._webAudio){var ae=function(){O._playLock?setTimeout(ae,0):$e()};setTimeout(ae,0)}else $e()}return O},playing:function(S){if(typeof S=="number"){var A=this._soundById(S);return!!A&&!A._paused}for(var O=0;O<this._sounds.length;O++)if(!this._sounds[O]._paused)return!0;return!1},duration:function(S){var A=this._duration,O=this._soundById(S);return O&&(A=this._sprite[O._sprite][1]/1e3),A},state:function(){return this._state},unload:function(){for(var S=this,A=S._sounds,O=0;O<A.length;O++)A[O]._paused||S.stop(A[O]._id),S._webAudio||(S._clearSound(A[O]._node),A[O]._node.removeEventListener("error",A[O]._errorFn,!1),A[O]._node.removeEventListener(ie._canPlayEvent,A[O]._loadFn,!1),A[O]._node.removeEventListener("ended",A[O]._endFn,!1),ie._releaseHtml5Audio(A[O]._node)),delete A[O]._node,S._clearTimer(A[O]._id);var V=ie._howls.indexOf(S);V>=0&&ie._howls.splice(V,1);var D=!0;for(O=0;O<ie._howls.length;O++)if(ie._howls[O]._src===S._src||S._src.indexOf(ie._howls[O]._src)>=0){D=!1;break}return X&&D&&delete X[S._src],ie.noAudio=!1,S._state="unloaded",S._sounds=[],S=null,null},on:function(S,A,O,V){var D=this["_on"+S];return typeof A=="function"&&D.push(V?{id:O,fn:A,once:V}:{id:O,fn:A}),this},off:function(S,A,O){var V=this["_on"+S],D=0;if(typeof A=="number"&&(O=A,A=null),A||O)for(D=0;D<V.length;D++){var z=O===V[D].id;if(A===V[D].fn&&z||!A&&z){V.splice(D,1);break}}else if(S)this["_on"+S]=[];else{var W=Object.keys(this);for(D=0;D<W.length;D++)W[D].indexOf("_on")===0&&Array.isArray(this[W[D]])&&(this[W[D]]=[])}return this},once:function(S,A,O){return this.on(S,A,O,1),this},_emit:function(S,A,O){for(var V=this["_on"+S],D=V.length-1;D>=0;D--)V[D].id&&V[D].id!==A&&S!=="load"||(setTimeout(function(z){z.call(this,A,O)}.bind(this,V[D].fn),0),V[D].once&&this.off(S,V[D].fn,V[D].id));return this._loadQueue(S),this},_loadQueue:function(S){if(this._queue.length>0){var A=this._queue[0];A.event===S&&(this._queue.shift(),this._loadQueue()),S||A.action()}return this},_ended:function(S){var A=S._sprite;if(!this._webAudio&&S._node&&!S._node.paused&&!S._node.ended&&S._node.currentTime<S._stop)return setTimeout(this._ended.bind(this,S),100),this;var O=!(!S._loop&&!this._sprite[A][2]);if(this._emit("end",S._id),!this._webAudio&&O&&this.stop(S._id,!0).play(S._id),this._webAudio&&O){this._emit("play",S._id),S._seek=S._start||0,S._rateSeek=0,S._playStart=ie.ctx.currentTime;var V=1e3*(S._stop-S._start)/Math.abs(S._rate);this._endTimers[S._id]=setTimeout(this._ended.bind(this,S),V)}return this._webAudio&&!O&&(S._paused=!0,S._ended=!0,S._seek=S._start||0,S._rateSeek=0,this._clearTimer(S._id),this._cleanBuffer(S._node),ie._autoSuspend()),this._webAudio||O||this.stop(S._id,!0),this},_clearTimer:function(S){if(this._endTimers[S]){if(typeof this._endTimers[S]!="function")clearTimeout(this._endTimers[S]);else{var A=this._soundById(S);A&&A._node&&A._node.removeEventListener("ended",this._endTimers[S],!1)}delete this._endTimers[S]}return this},_soundById:function(S){for(var A=0;A<this._sounds.length;A++)if(S===this._sounds[A]._id)return this._sounds[A];return null},_inactiveSound:function(){this._drain();for(var S=0;S<this._sounds.length;S++)if(this._sounds[S]._ended)return this._sounds[S].reset();return new oe(this)},_drain:function(){var S=this._pool,A=0,O=0;if(!(this._sounds.length<S)){for(O=0;O<this._sounds.length;O++)this._sounds[O]._ended&&A++;for(O=this._sounds.length-1;O>=0;O--){if(A<=S)return;this._sounds[O]._ended&&(this._webAudio&&this._sounds[O]._node&&this._sounds[O]._node.disconnect(0),this._sounds.splice(O,1),A--)}}},_getSoundIds:function(S){if(S===void 0){for(var A=[],O=0;O<this._sounds.length;O++)A.push(this._sounds[O]._id);return A}return[S]},_refreshBuffer:function(S){return S._node.bufferSource=ie.ctx.createBufferSource(),S._node.bufferSource.buffer=X[this._src],S._panner?S._node.bufferSource.connect(S._panner):S._node.bufferSource.connect(S._node),S._node.bufferSource.loop=S._loop,S._loop&&(S._node.bufferSource.loopStart=S._start||0,S._node.bufferSource.loopEnd=S._stop||0),S._node.bufferSource.playbackRate.setValueAtTime(S._rate,ie.ctx.currentTime),this},_cleanBuffer:function(S){var A=ie._navigator&&ie._navigator.vendor.indexOf("Apple")>=0;if(ie._scratchBuffer&&S.bufferSource&&(S.bufferSource.onended=null,S.bufferSource.disconnect(0),A))try{S.bufferSource.buffer=ie._scratchBuffer}catch{}return S.bufferSource=null,this},_clearSound:function(S){/MSIE |Trident\//.test(ie._navigator&&ie._navigator.userAgent)||(S.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var oe=function(S){this._parent=S,this.init()};oe.prototype={init:function(){var S=this._parent;return this._muted=S._muted,this._loop=S._loop,this._volume=S._volume,this._rate=S._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++ie._counter,S._sounds.push(this),this.create(),this},create:function(){var S=this._parent,A=ie._muted||this._muted||this._parent._muted?0:this._volume;return S._webAudio?(this._node=ie.ctx.createGain===void 0?ie.ctx.createGainNode():ie.ctx.createGain(),this._node.gain.setValueAtTime(A,ie.ctx.currentTime),this._node.paused=!0,this._node.connect(ie.masterGain)):ie.noAudio||(this._node=ie._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(ie._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=S._src,this._node.preload=S._preload===!0?"auto":S._preload,this._node.volume=A*ie.volume(),this._node.load()),this},reset:function(){var S=this._parent;return this._muted=S._muted,this._loop=S._loop,this._volume=S._volume,this._rate=S._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++ie._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var S=this._parent;S._duration=Math.ceil(10*this._node.duration)/10,Object.keys(S._sprite).length===0&&(S._sprite={__default:[0,1e3*S._duration]}),S._state!=="loaded"&&(S._state="loaded",S._emit("load"),S._loadQueue()),this._node.removeEventListener(ie._canPlayEvent,this._loadFn,!1)},_endListener:function(){var S=this._parent;S._duration===1/0&&(S._duration=Math.ceil(10*this._node.duration)/10,S._sprite.__default[1]===1/0&&(S._sprite.__default[1]=1e3*S._duration),S._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var X={},K=function(S){var A=S._src;if(X[A])return S._duration=X[A].duration,void Xe(S);if(/^data:[^;]+;base64,/.test(A)){for(var O=atob(A.split(",")[1]),V=new Uint8Array(O.length),D=0;D<O.length;++D)V[D]=O.charCodeAt(D);Ee(V.buffer,S)}else{var z=new XMLHttpRequest;z.open(S._xhr.method,A,!0),z.withCredentials=S._xhr.withCredentials,z.responseType="arraybuffer",S._xhr.headers&&Object.keys(S._xhr.headers).forEach(function(W){z.setRequestHeader(W,S._xhr.headers[W])}),z.onload=function(){var W=(z.status+"")[0];W==="0"||W==="2"||W==="3"?Ee(z.response,S):S._emit("loaderror",null,"Failed loading audio file with status: "+z.status+".")},z.onerror=function(){S._webAudio&&(S._html5=!0,S._webAudio=!1,S._sounds=[],delete X[A],S.load())},le(z)}},le=function(S){try{S.send()}catch{S.onerror()}},Ee=function(S,A){var O=function(){A._emit("loaderror",null,"Decoding audio data failed.")},V=function(D){D&&A._sounds.length>0?(X[A._src]=D,Xe(A,D)):O()};typeof Promise!="undefined"&&ie.ctx.decodeAudioData.length===1?ie.ctx.decodeAudioData(S).then(V).catch(O):ie.ctx.decodeAudioData(S,V,O)},Xe=function(S,A){A&&!S._duration&&(S._duration=A.duration),Object.keys(S._sprite).length===0&&(S._sprite={__default:[0,1e3*S._duration]}),S._state!=="loaded"&&(S._state="loaded",S._emit("load"),S._loadQueue())},Fe=function(){if(ie.usingWebAudio){try{typeof AudioContext!="undefined"?ie.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?ie.ctx=new webkitAudioContext:ie.usingWebAudio=!1}catch{ie.usingWebAudio=!1}ie.ctx||(ie.usingWebAudio=!1);var S=/iP(hone|od|ad)/.test(ie._navigator&&ie._navigator.platform),A=ie._navigator&&ie._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),O=A?parseInt(A[1],10):null;if(S&&O&&O<9){var V=/safari/.test(ie._navigator&&ie._navigator.userAgent.toLowerCase());ie._navigator&&!V&&(ie.usingWebAudio=!1)}ie.usingWebAudio&&(ie.masterGain=ie.ctx.createGain===void 0?ie.ctx.createGainNode():ie.ctx.createGain(),ie.masterGain.gain.setValueAtTime(ie._muted?0:ie._volume,ie.ctx.currentTime),ie.masterGain.connect(ie.ctx.destination)),ie._setup()}};(q=function(){return{Howler:ie,Howl:k}}.apply(L,[]))===void 0||(C.exports=q),L.Howler=ie,L.Howl=k,b!==void 0?(b.HowlerGlobal=B,b.Howler=ie,b.Howl=k,b.Sound=oe):typeof window!="undefined"&&(window.HowlerGlobal=B,window.Howler=ie,window.Howl=k,window.Sound=oe)})(),function(){var B;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(k){if(!this.ctx||!this.ctx.listener)return this;for(var oe=this._howls.length-1;oe>=0;oe--)this._howls[oe].stereo(k);return this},HowlerGlobal.prototype.pos=function(k,oe,X){return this.ctx&&this.ctx.listener?(oe=typeof oe!="number"?this._pos[1]:oe,X=typeof X!="number"?this._pos[2]:X,typeof k!="number"?this._pos:(this._pos=[k,oe,X],this.ctx.listener.positionX!==void 0?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(k,oe,X,K,le,Ee){if(!this.ctx||!this.ctx.listener)return this;var Xe=this._orientation;return oe=typeof oe!="number"?Xe[1]:oe,X=typeof X!="number"?Xe[2]:X,K=typeof K!="number"?Xe[3]:K,le=typeof le!="number"?Xe[4]:le,Ee=typeof Ee!="number"?Xe[5]:Ee,typeof k!="number"?Xe:(this._orientation=[k,oe,X,K,le,Ee],this.ctx.listener.forwardX!==void 0?(this.ctx.listener.forwardX.setTargetAtTime(k,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(oe,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(X,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(K,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(le,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(Ee,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(k,oe,X,K,le,Ee),this)},Howl.prototype.init=(B=Howl.prototype.init,function(k){return this._orientation=k.orientation||[1,0,0],this._stereo=k.stereo||null,this._pos=k.pos||null,this._pannerAttr={coneInnerAngle:k.coneInnerAngle!==void 0?k.coneInnerAngle:360,coneOuterAngle:k.coneOuterAngle!==void 0?k.coneOuterAngle:360,coneOuterGain:k.coneOuterGain!==void 0?k.coneOuterGain:0,distanceModel:k.distanceModel!==void 0?k.distanceModel:"inverse",maxDistance:k.maxDistance!==void 0?k.maxDistance:1e4,panningModel:k.panningModel!==void 0?k.panningModel:"HRTF",refDistance:k.refDistance!==void 0?k.refDistance:1,rolloffFactor:k.rolloffFactor!==void 0?k.rolloffFactor:1},this._onstereo=k.onstereo?[{fn:k.onstereo}]:[],this._onpos=k.onpos?[{fn:k.onpos}]:[],this._onorientation=k.onorientation?[{fn:k.onorientation}]:[],B.call(this,k)}),Howl.prototype.stereo=function(k,oe){var X=this;if(!X._webAudio)return X;if(X._state!=="loaded")return X._queue.push({event:"stereo",action:function(){X.stereo(k,oe)}}),X;var K=Howler.ctx.createStereoPanner===void 0?"spatial":"stereo";if(oe===void 0){if(typeof k!="number")return X._stereo;X._stereo=k,X._pos=[k,0,0]}for(var le=X._getSoundIds(oe),Ee=0;Ee<le.length;Ee++){var Xe=X._soundById(le[Ee]);if(Xe){if(typeof k!="number")return Xe._stereo;Xe._stereo=k,Xe._pos=[k,0,0],Xe._node&&(Xe._pannerAttr.panningModel="equalpower",Xe._panner&&Xe._panner.pan||ie(Xe,K),K==="spatial"?Xe._panner.positionX!==void 0?(Xe._panner.positionX.setValueAtTime(k,Howler.ctx.currentTime),Xe._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),Xe._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):Xe._panner.setPosition(k,0,0):Xe._panner.pan.setValueAtTime(k,Howler.ctx.currentTime)),X._emit("stereo",Xe._id)}}return X},Howl.prototype.pos=function(k,oe,X,K){var le=this;if(!le._webAudio)return le;if(le._state!=="loaded")return le._queue.push({event:"pos",action:function(){le.pos(k,oe,X,K)}}),le;if(oe=typeof oe!="number"?0:oe,X=typeof X!="number"?-.5:X,K===void 0){if(typeof k!="number")return le._pos;le._pos=[k,oe,X]}for(var Ee=le._getSoundIds(K),Xe=0;Xe<Ee.length;Xe++){var Fe=le._soundById(Ee[Xe]);if(Fe){if(typeof k!="number")return Fe._pos;Fe._pos=[k,oe,X],Fe._node&&(Fe._panner&&!Fe._panner.pan||ie(Fe,"spatial"),Fe._panner.positionX!==void 0?(Fe._panner.positionX.setValueAtTime(k,Howler.ctx.currentTime),Fe._panner.positionY.setValueAtTime(oe,Howler.ctx.currentTime),Fe._panner.positionZ.setValueAtTime(X,Howler.ctx.currentTime)):Fe._panner.setPosition(k,oe,X)),le._emit("pos",Fe._id)}}return le},Howl.prototype.orientation=function(k,oe,X,K){var le=this;if(!le._webAudio)return le;if(le._state!=="loaded")return le._queue.push({event:"orientation",action:function(){le.orientation(k,oe,X,K)}}),le;if(oe=typeof oe!="number"?le._orientation[1]:oe,X=typeof X!="number"?le._orientation[2]:X,K===void 0){if(typeof k!="number")return le._orientation;le._orientation=[k,oe,X]}for(var Ee=le._getSoundIds(K),Xe=0;Xe<Ee.length;Xe++){var Fe=le._soundById(Ee[Xe]);if(Fe){if(typeof k!="number")return Fe._orientation;Fe._orientation=[k,oe,X],Fe._node&&(Fe._panner||(Fe._pos||(Fe._pos=le._pos||[0,0,-.5]),ie(Fe,"spatial")),Fe._panner.orientationX!==void 0?(Fe._panner.orientationX.setValueAtTime(k,Howler.ctx.currentTime),Fe._panner.orientationY.setValueAtTime(oe,Howler.ctx.currentTime),Fe._panner.orientationZ.setValueAtTime(X,Howler.ctx.currentTime)):Fe._panner.setOrientation(k,oe,X)),le._emit("orientation",Fe._id)}}return le},Howl.prototype.pannerAttr=function(){var k,oe,X,K=this,le=arguments;if(!K._webAudio)return K;if(le.length===0)return K._pannerAttr;if(le.length===1){if(typeof le[0]!="object")return(X=K._soundById(parseInt(le[0],10)))?X._pannerAttr:K._pannerAttr;k=le[0],oe===void 0&&(k.pannerAttr||(k.pannerAttr={coneInnerAngle:k.coneInnerAngle,coneOuterAngle:k.coneOuterAngle,coneOuterGain:k.coneOuterGain,distanceModel:k.distanceModel,maxDistance:k.maxDistance,refDistance:k.refDistance,rolloffFactor:k.rolloffFactor,panningModel:k.panningModel}),K._pannerAttr={coneInnerAngle:k.pannerAttr.coneInnerAngle!==void 0?k.pannerAttr.coneInnerAngle:K._coneInnerAngle,coneOuterAngle:k.pannerAttr.coneOuterAngle!==void 0?k.pannerAttr.coneOuterAngle:K._coneOuterAngle,coneOuterGain:k.pannerAttr.coneOuterGain!==void 0?k.pannerAttr.coneOuterGain:K._coneOuterGain,distanceModel:k.pannerAttr.distanceModel!==void 0?k.pannerAttr.distanceModel:K._distanceModel,maxDistance:k.pannerAttr.maxDistance!==void 0?k.pannerAttr.maxDistance:K._maxDistance,refDistance:k.pannerAttr.refDistance!==void 0?k.pannerAttr.refDistance:K._refDistance,rolloffFactor:k.pannerAttr.rolloffFactor!==void 0?k.pannerAttr.rolloffFactor:K._rolloffFactor,panningModel:k.pannerAttr.panningModel!==void 0?k.pannerAttr.panningModel:K._panningModel})}else le.length===2&&(k=le[0],oe=parseInt(le[1],10));for(var Ee=K._getSoundIds(oe),Xe=0;Xe<Ee.length;Xe++)if(X=K._soundById(Ee[Xe])){var Fe=X._pannerAttr;Fe={coneInnerAngle:k.coneInnerAngle!==void 0?k.coneInnerAngle:Fe.coneInnerAngle,coneOuterAngle:k.coneOuterAngle!==void 0?k.coneOuterAngle:Fe.coneOuterAngle,coneOuterGain:k.coneOuterGain!==void 0?k.coneOuterGain:Fe.coneOuterGain,distanceModel:k.distanceModel!==void 0?k.distanceModel:Fe.distanceModel,maxDistance:k.maxDistance!==void 0?k.maxDistance:Fe.maxDistance,refDistance:k.refDistance!==void 0?k.refDistance:Fe.refDistance,rolloffFactor:k.rolloffFactor!==void 0?k.rolloffFactor:Fe.rolloffFactor,panningModel:k.panningModel!==void 0?k.panningModel:Fe.panningModel};var S=X._panner;S?(S.coneInnerAngle=Fe.coneInnerAngle,S.coneOuterAngle=Fe.coneOuterAngle,S.coneOuterGain=Fe.coneOuterGain,S.distanceModel=Fe.distanceModel,S.maxDistance=Fe.maxDistance,S.refDistance=Fe.refDistance,S.rolloffFactor=Fe.rolloffFactor,S.panningModel=Fe.panningModel):(X._pos||(X._pos=K._pos||[0,0,-.5]),ie(X,"spatial"))}return K},Sound.prototype.init=function(k){return function(){var oe=this._parent;this._orientation=oe._orientation,this._stereo=oe._stereo,this._pos=oe._pos,this._pannerAttr=oe._pannerAttr,k.call(this),this._stereo?oe.stereo(this._stereo):this._pos&&oe.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(k){return function(){var oe=this._parent;return this._orientation=oe._orientation,this._stereo=oe._stereo,this._pos=oe._pos,this._pannerAttr=oe._pannerAttr,this._stereo?oe.stereo(this._stereo):this._pos?oe.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,oe._refreshBuffer(this)),k.call(this)}}(Sound.prototype.reset);var ie=function(k,oe){(oe=oe||"spatial")==="spatial"?(k._panner=Howler.ctx.createPanner(),k._panner.coneInnerAngle=k._pannerAttr.coneInnerAngle,k._panner.coneOuterAngle=k._pannerAttr.coneOuterAngle,k._panner.coneOuterGain=k._pannerAttr.coneOuterGain,k._panner.distanceModel=k._pannerAttr.distanceModel,k._panner.maxDistance=k._pannerAttr.maxDistance,k._panner.refDistance=k._pannerAttr.refDistance,k._panner.rolloffFactor=k._pannerAttr.rolloffFactor,k._panner.panningModel=k._pannerAttr.panningModel,k._panner.positionX!==void 0?(k._panner.positionX.setValueAtTime(k._pos[0],Howler.ctx.currentTime),k._panner.positionY.setValueAtTime(k._pos[1],Howler.ctx.currentTime),k._panner.positionZ.setValueAtTime(k._pos[2],Howler.ctx.currentTime)):k._panner.setPosition(k._pos[0],k._pos[1],k._pos[2]),k._panner.orientationX!==void 0?(k._panner.orientationX.setValueAtTime(k._orientation[0],Howler.ctx.currentTime),k._panner.orientationY.setValueAtTime(k._orientation[1],Howler.ctx.currentTime),k._panner.orientationZ.setValueAtTime(k._orientation[2],Howler.ctx.currentTime)):k._panner.setOrientation(k._orientation[0],k._orientation[1],k._orientation[2])):(k._panner=Howler.ctx.createStereoPanner(),k._panner.pan.setValueAtTime(k._stereo,Howler.ctx.currentTime)),k._panner.connect(k._node),k._paused||k._parent.pause(k._id,!0).play(k._id,!0)}}()}).call(this,v(4))},function(C,L,v){(function(b){var q=b!==void 0&&b||typeof self!="undefined"&&self||window,B=Function.prototype.apply;function ie(k,oe){this._id=k,this._clearFn=oe}L.setTimeout=function(){return new ie(B.call(setTimeout,q,arguments),clearTimeout)},L.setInterval=function(){return new ie(B.call(setInterval,q,arguments),clearInterval)},L.clearTimeout=L.clearInterval=function(k){k&&k.close()},ie.prototype.unref=ie.prototype.ref=function(){},ie.prototype.close=function(){this._clearFn.call(q,this._id)},L.enroll=function(k,oe){clearTimeout(k._idleTimeoutId),k._idleTimeout=oe},L.unenroll=function(k){clearTimeout(k._idleTimeoutId),k._idleTimeout=-1},L._unrefActive=L.active=function(k){clearTimeout(k._idleTimeoutId);var oe=k._idleTimeout;oe>=0&&(k._idleTimeoutId=setTimeout(function(){k._onTimeout&&k._onTimeout()},oe))},v(19),L.setImmediate=typeof self!="undefined"&&self.setImmediate||b!==void 0&&b.setImmediate||this&&this.setImmediate,L.clearImmediate=typeof self!="undefined"&&self.clearImmediate||b!==void 0&&b.clearImmediate||this&&this.clearImmediate}).call(this,v(4))},function(C,L,v){(function(b,q){(function(B,ie){if(!B.setImmediate){var k,oe,X,K,le,Ee=1,Xe={},Fe=!1,S=B.document,A=Object.getPrototypeOf&&Object.getPrototypeOf(B);A=A&&A.setTimeout?A:B,{}.toString.call(B.process)==="[object process]"?k=function(D){q.nextTick(function(){V(D)})}:function(){if(B.postMessage&&!B.importScripts){var D=!0,z=B.onmessage;return B.onmessage=function(){D=!1},B.postMessage("","*"),B.onmessage=z,D}}()?(K="setImmediate$"+Math.random()+"$",le=function(D){D.source===B&&typeof D.data=="string"&&D.data.indexOf(K)===0&&V(+D.data.slice(K.length))},B.addEventListener?B.addEventListener("message",le,!1):B.attachEvent("onmessage",le),k=function(D){B.postMessage(K+D,"*")}):B.MessageChannel?((X=new MessageChannel).port1.onmessage=function(D){V(D.data)},k=function(D){X.port2.postMessage(D)}):S&&"onreadystatechange"in S.createElement("script")?(oe=S.documentElement,k=function(D){var z=S.createElement("script");z.onreadystatechange=function(){V(D),z.onreadystatechange=null,oe.removeChild(z),z=null},oe.appendChild(z)}):k=function(D){setTimeout(V,0,D)},A.setImmediate=function(D){typeof D!="function"&&(D=new Function(""+D));for(var z=new Array(arguments.length-1),W=0;W<z.length;W++)z[W]=arguments[W+1];var ee={callback:D,args:z};return Xe[Ee]=ee,k(Ee),Ee++},A.clearImmediate=O}function O(D){delete Xe[D]}function V(D){if(Fe)setTimeout(V,0,D);else{var z=Xe[D];if(z){Fe=!0;try{(function(W){var ee=W.callback,et=W.args;switch(et.length){case 0:ee();break;case 1:ee(et[0]);break;case 2:ee(et[0],et[1]);break;case 3:ee(et[0],et[1],et[2]);break;default:ee.apply(void 0,et)}})(z)}finally{O(D),Fe=!1}}}}})(typeof self=="undefined"?b===void 0?this:b:self)}).call(this,v(4),v(20))},function(C,L){var v,b,q=C.exports={};function B(){throw new Error("setTimeout has not been defined")}function ie(){throw new Error("clearTimeout has not been defined")}function k(A){if(v===setTimeout)return setTimeout(A,0);if((v===B||!v)&&setTimeout)return v=setTimeout,setTimeout(A,0);try{return v(A,0)}catch{try{return v.call(null,A,0)}catch{return v.call(this,A,0)}}}(function(){try{v=typeof setTimeout=="function"?setTimeout:B}catch{v=B}try{b=typeof clearTimeout=="function"?clearTimeout:ie}catch{b=ie}})();var oe,X=[],K=!1,le=-1;function Ee(){K&&oe&&(K=!1,oe.length?X=oe.concat(X):le=-1,X.length&&Xe())}function Xe(){if(!K){var A=k(Ee);K=!0;for(var O=X.length;O;){for(oe=X,X=[];++le<O;)oe&&oe[le].run();le=-1,O=X.length}oe=null,K=!1,function(V){if(b===clearTimeout)return clearTimeout(V);if((b===ie||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(V);try{b(V)}catch{try{return b.call(null,V)}catch{return b.call(this,V)}}}(A)}}function Fe(A,O){this.fun=A,this.array=O}function S(){}q.nextTick=function(A){var O=new Array(arguments.length-1);if(arguments.length>1)for(var V=1;V<arguments.length;V++)O[V-1]=arguments[V];X.push(new Fe(A,O)),X.length!==1||K||k(Xe)},Fe.prototype.run=function(){this.fun.apply(null,this.array)},q.title="browser",q.browser=!0,q.env={},q.argv=[],q.version="",q.versions={},q.on=S,q.addListener=S,q.once=S,q.off=S,q.removeListener=S,q.removeAllListeners=S,q.emit=S,q.prependListener=S,q.prependOnceListener=S,q.listeners=function(A){return[]},q.binding=function(A){throw new Error("process.binding is not supported")},q.cwd=function(){return"/"},q.chdir=function(A){throw new Error("process.chdir is not supported")},q.umask=function(){return 0}},function(C,L,v){(function(b,q){var B;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(ie){L&&L.nodeType,b&&b.nodeType;var k=typeof q=="object"&&q;k.global!==k&&k.window!==k&&k.self;var oe,X=2147483647,K=/^xn--/,le=/[^\x20-\x7E]/,Ee=/[\x2E\u3002\uFF0E\uFF61]/g,Xe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Fe=Math.floor,S=String.fromCharCode;function A($e){throw new RangeError(Xe[$e])}function O($e,ae){for(var Ce=$e.length,Ie=[];Ce--;)Ie[Ce]=ae($e[Ce]);return Ie}function V($e,ae){var Ce=$e.split("@"),Ie="";return Ce.length>1&&(Ie=Ce[0]+"@",$e=Ce[1]),Ie+O(($e=$e.replace(Ee,".")).split("."),ae).join(".")}function D($e){for(var ae,Ce,Ie=[],H=0,be=$e.length;H<be;)(ae=$e.charCodeAt(H++))>=55296&&ae<=56319&&H<be?(64512&(Ce=$e.charCodeAt(H++)))==56320?Ie.push(((1023&ae)<<10)+(1023&Ce)+65536):(Ie.push(ae),H--):Ie.push(ae);return Ie}function z($e){return O($e,function(ae){var Ce="";return ae>65535&&(Ce+=S((ae-=65536)>>>10&1023|55296),ae=56320|1023&ae),Ce+=S(ae)}).join("")}function W($e,ae){return $e+22+75*($e<26)-((ae!=0)<<5)}function ee($e,ae,Ce){var Ie=0;for($e=Ce?Fe($e/700):$e>>1,$e+=Fe($e/ae);$e>455;Ie+=36)$e=Fe($e/35);return Fe(Ie+36*$e/($e+38))}function et($e){var ae,Ce,Ie,H,be,Me,Oe,Se,Ue,qe,at,rt=[],Qt=$e.length,lt=0,en=128,Bt=72;for((Ce=$e.lastIndexOf("-"))<0&&(Ce=0),Ie=0;Ie<Ce;++Ie)$e.charCodeAt(Ie)>=128&&A("not-basic"),rt.push($e.charCodeAt(Ie));for(H=Ce>0?Ce+1:0;H<Qt;){for(be=lt,Me=1,Oe=36;H>=Qt&&A("invalid-input"),((Se=(at=$e.charCodeAt(H++))-48<10?at-22:at-65<26?at-65:at-97<26?at-97:36)>=36||Se>Fe((X-lt)/Me))&&A("overflow"),lt+=Se*Me,!(Se<(Ue=Oe<=Bt?1:Oe>=Bt+26?26:Oe-Bt));Oe+=36)Me>Fe(X/(qe=36-Ue))&&A("overflow"),Me*=qe;Bt=ee(lt-be,ae=rt.length+1,be==0),Fe(lt/ae)>X-en&&A("overflow"),en+=Fe(lt/ae),lt%=ae,rt.splice(lt++,0,en)}return z(rt)}function ft($e){var ae,Ce,Ie,H,be,Me,Oe,Se,Ue,qe,at,rt,Qt,lt,en,Bt=[];for(rt=($e=D($e)).length,ae=128,Ce=0,be=72,Me=0;Me<rt;++Me)(at=$e[Me])<128&&Bt.push(S(at));for(Ie=H=Bt.length,H&&Bt.push("-");Ie<rt;){for(Oe=X,Me=0;Me<rt;++Me)(at=$e[Me])>=ae&&at<Oe&&(Oe=at);for(Oe-ae>Fe((X-Ce)/(Qt=Ie+1))&&A("overflow"),Ce+=(Oe-ae)*Qt,ae=Oe,Me=0;Me<rt;++Me)if((at=$e[Me])<ae&&++Ce>X&&A("overflow"),at==ae){for(Se=Ce,Ue=36;!(Se<(qe=Ue<=be?1:Ue>=be+26?26:Ue-be));Ue+=36)en=Se-qe,lt=36-qe,Bt.push(S(W(qe+en%lt,0))),Se=Fe(en/lt);Bt.push(S(W(Se,0))),be=ee(Ce,Qt,Ie==H),Ce=0,++Ie}++Ce,++ae}return Bt.join("")}oe={version:"1.4.1",ucs2:{decode:D,encode:z},decode:et,encode:ft,toASCII:function($e){return V($e,function(ae){return le.test(ae)?"xn--"+ft(ae):ae})},toUnicode:function($e){return V($e,function(ae){return K.test(ae)?et(ae.slice(4).toLowerCase()):ae})}},(B=function(){return oe}.call(L,v,L,b))===void 0||(b.exports=B)})()}).call(this,v(8)(C),v(4))},function(C,L,v){C.exports={isString:function(b){return typeof b=="string"},isObject:function(b){return typeof b=="object"&&b!==null},isNull:function(b){return b===null},isNullOrUndefined:function(b){return b==null}}},function(C,L,v){L.decode=L.parse=v(24),L.encode=L.stringify=v(25)},function(C,L,v){function b(B,ie){return Object.prototype.hasOwnProperty.call(B,ie)}C.exports=function(B,ie,k,oe){ie=ie||"&",k=k||"=";var X={};if(typeof B!="string"||B.length===0)return X;var K=/\+/g;B=B.split(ie);var le=1e3;oe&&typeof oe.maxKeys=="number"&&(le=oe.maxKeys);var Ee=B.length;le>0&&Ee>le&&(Ee=le);for(var Xe=0;Xe<Ee;++Xe){var Fe,S,A,O,V=B[Xe].replace(K,"%20"),D=V.indexOf(k);D>=0?(Fe=V.substr(0,D),S=V.substr(D+1)):(Fe=V,S=""),A=decodeURIComponent(Fe),O=decodeURIComponent(S),b(X,A)?q(X[A])?X[A].push(O):X[A]=[X[A],O]:X[A]=O}return X};var q=Array.isArray||function(B){return Object.prototype.toString.call(B)==="[object Array]"}},function(C,L,v){var b=function(k){switch(typeof k){case"string":return k;case"boolean":return k?"true":"false";case"number":return isFinite(k)?k:"";default:return""}};C.exports=function(k,oe,X,K){return oe=oe||"&",X=X||"=",k===null&&(k=void 0),typeof k=="object"?B(ie(k),function(le){var Ee=encodeURIComponent(b(le))+X;return q(k[le])?B(k[le],function(Xe){return Ee+encodeURIComponent(b(Xe))}).join(oe):Ee+encodeURIComponent(b(k[le]))}).join(oe):K?encodeURIComponent(b(K))+X+encodeURIComponent(b(k)):""};var q=Array.isArray||function(k){return Object.prototype.toString.call(k)==="[object Array]"};function B(k,oe){if(k.map)return k.map(oe);for(var X=[],K=0;K<k.length;K++)X.push(oe(k[K],K));return X}var ie=Object.keys||function(k){var oe=[];for(var X in k)Object.prototype.hasOwnProperty.call(k,X)&&oe.push(X);return oe}},function(C,L){var v=function(){};v.prototype={fit:function(b){var q,B,ie,k,oe=b.length,X=oe>0?b[0].width:0,K=oe>0?b[0].height:0;for(this.root={x:0,y:0,width:X,height:K},q=0;q<oe;q++)ie=b[q],(B=this.findNode(this.root,ie.width,ie.height))?(k=this.splitNode(B,ie.width,ie.height),ie.x=k.x,ie.y=k.y):(k=this.growNode(ie.width,ie.height),ie.x=k.x,ie.y=k.y)},findNode:function(b,q,B){return b.used?this.findNode(b.right,q,B)||this.findNode(b.down,q,B):q<=b.width&&B<=b.height?b:null},splitNode:function(b,q,B){return b.used=!0,b.down={x:b.x,y:b.y+B,width:b.width,height:b.height-B},b.right={x:b.x+q,y:b.y,width:b.width-q,height:B},b},growNode:function(b,q){var B=b<=this.root.width,ie=q<=this.root.height,k=ie&&this.root.height>=this.root.width+b,oe=B&&this.root.width>=this.root.height+q;return k?this.growRight(b,q):oe?this.growDown(b,q):ie?this.growRight(b,q):B?this.growDown(b,q):null},growRight:function(b,q){var B;return this.root={used:!0,x:0,y:0,width:this.root.width+b,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:b,height:this.root.height}},(B=this.findNode(this.root,b,q))?this.splitNode(B,b,q):null},growDown:function(b,q){var B;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+q,down:{x:0,y:this.root.height,width:this.root.width,height:q},right:this.root},(B=this.findNode(this.root,b,q))?this.splitNode(B,b,q):null}},C.exports=v},function(C,L,v){v.r(L),v.d(L,"SLIDE_EVENTS",function(){return cr}),v.d(L,"Slide",function(){return LP});var b={};v.r(b),v.d(b,"ACESFilmicToneMapping",function(){return Lp}),v.d(b,"AddEquation",function(){return Me}),v.d(b,"AddOperation",function(){return Pp}),v.d(b,"AdditiveAnimationBlendMode",function(){return we}),v.d(b,"AdditiveBlending",function(){return Ce}),v.d(b,"AlphaFormat",function(){return _n}),v.d(b,"AlwaysDepth",function(){return yn}),v.d(b,"AlwaysStencilFunc",function(){return _l}),v.d(b,"AmbientLight",function(){return om}),v.d(b,"AmbientLightProbe",function(){return Cy}),v.d(b,"AnimationClip",function(){return Md}),v.d(b,"AnimationLoader",function(){return xS}),v.d(b,"AnimationMixer",function(){return ky}),v.d(b,"AnimationObjectGroup",function(){return Uy}),v.d(b,"AnimationUtils",function(){return Gn}),v.d(b,"ArcCurve",function(){return kr}),v.d(b,"ArrayCamera",function(){return fd}),v.d(b,"ArrowHelper",function(){return KS}),v.d(b,"Audio",function(){return Ov}),v.d(b,"AudioAnalyser",function(){return Fy}),v.d(b,"AudioContext",function(){return Lv}),v.d(b,"AudioListener",function(){return PS}),v.d(b,"AudioLoader",function(){return Ay}),v.d(b,"AxesHelper",function(){return nx}),v.d(b,"AxisHelper",function(){return CE}),v.d(b,"BackSide",function(){return W}),v.d(b,"BasicDepthPacking",function(){return gl}),v.d(b,"BasicShadowMap",function(){return A}),v.d(b,"BinaryTextureLoader",function(){return DE}),v.d(b,"Bone",function(){return Ph}),v.d(b,"BooleanKeyframeTrack",function(){return Yl}),v.d(b,"BoundingBoxHelper",function(){return RE}),v.d(b,"Box2",function(){return Wh}),v.d(b,"Box3",function(){return In}),v.d(b,"Box3Helper",function(){return JS}),v.d(b,"BoxBufferGeometry",function(){return Qr}),v.d(b,"BoxGeometry",function(){return Qr}),v.d(b,"BoxHelper",function(){return ex}),v.d(b,"BufferAttribute",function(){return Zt}),v.d(b,"BufferGeometry",function(){return Mt}),v.d(b,"BufferGeometryLoader",function(){return wy}),v.d(b,"ByteType",function(){return Fp}),v.d(b,"Cache",function(){return Zl}),v.d(b,"Camera",function(){return zs}),v.d(b,"CameraHelper",function(){return ZS}),v.d(b,"CanvasRenderer",function(){return FE}),v.d(b,"CanvasTexture",function(){return Ct}),v.d(b,"CatmullRomCurve3",function(){return Oh}),v.d(b,"CineonToneMapping",function(){return Ip}),v.d(b,"CircleBufferGeometry",function(){return nt}),v.d(b,"CircleGeometry",function(){return nt}),v.d(b,"ClampToEdgeWrapping",function(){return mi}),v.d(b,"Clock",function(){return Ly}),v.d(b,"Color",function(){return gt}),v.d(b,"ColorKeyframeTrack",function(){return yv}),v.d(b,"CompressedTexture",function(){return yt}),v.d(b,"CompressedTextureLoader",function(){return bS}),v.d(b,"ConeBufferGeometry",function(){return mt}),v.d(b,"ConeGeometry",function(){return mt}),v.d(b,"CubeCamera",function(){return Vs}),v.d(b,"CubeReflectionMapping",function(){return ko}),v.d(b,"CubeRefractionMapping",function(){return ol}),v.d(b,"CubeTexture",function(){return Br}),v.d(b,"CubeTextureLoader",function(){return cy}),v.d(b,"CubeUVReflectionMapping",function(){return fa}),v.d(b,"CubeUVRefractionMapping",function(){return ma}),v.d(b,"CubicBezierCurve",function(){return Qs}),v.d(b,"CubicBezierCurve3",function(){return Va}),v.d(b,"CubicInterpolant",function(){return ay}),v.d(b,"CullFaceBack",function(){return Xe}),v.d(b,"CullFaceFront",function(){return Fe}),v.d(b,"CullFaceFrontBack",function(){return S}),v.d(b,"CullFaceNone",function(){return Ee}),v.d(b,"Curve",function(){return Xn}),v.d(b,"CurvePath",function(){return py}),v.d(b,"CustomBlending",function(){return be}),v.d(b,"CustomToneMapping",function(){return Op}),v.d(b,"CylinderBufferGeometry",function(){return Et}),v.d(b,"CylinderGeometry",function(){return Et}),v.d(b,"Cylindrical",function(){return zS}),v.d(b,"DataTexture",function(){return ns}),v.d(b,"DataTexture2DArray",function(){return fh}),v.d(b,"DataTexture3D",function(){return xr}),v.d(b,"DataTextureLoader",function(){return dy}),v.d(b,"DataUtils",function(){return eE}),v.d(b,"DecrementStencilOp",function(){return ju}),v.d(b,"DecrementWrapStencilOp",function(){return wg}),v.d(b,"DefaultLoadingManager",function(){return hy}),v.d(b,"DepthFormat",function(){return Nn}),v.d(b,"DepthStencilFormat",function(){return Ms}),v.d(b,"DepthTexture",function(){return Je}),v.d(b,"DirectionalLight",function(){return rm}),v.d(b,"DirectionalLightHelper",function(){return qS}),v.d(b,"DiscreteInterpolant",function(){return ly}),v.d(b,"DodecahedronBufferGeometry",function(){return It}),v.d(b,"DodecahedronGeometry",function(){return It}),v.d(b,"DoubleSide",function(){return ee}),v.d(b,"DstAlphaFactor",function(){return Vt}),v.d(b,"DstColorFactor",function(){return Dn}),v.d(b,"DynamicBufferAttribute",function(){return yE}),v.d(b,"DynamicCopyUsage",function(){return Zu}),v.d(b,"DynamicDrawUsage",function(){return Xr}),v.d(b,"DynamicReadUsage",function(){return Sg}),v.d(b,"EdgesGeometry",function(){return Ei}),v.d(b,"EdgesHelper",function(){return IE}),v.d(b,"EllipseCurve",function(){return kn}),v.d(b,"EqualDepth",function(){return Pi}),v.d(b,"EqualStencilFunc",function(){return Xu}),v.d(b,"EquirectangularReflectionMapping",function(){return sl}),v.d(b,"EquirectangularRefractionMapping",function(){return al}),v.d(b,"Euler",function(){return Ns}),v.d(b,"EventDispatcher",function(){return go}),v.d(b,"ExtrudeBufferGeometry",function(){return Ao}),v.d(b,"ExtrudeGeometry",function(){return Ao}),v.d(b,"FaceColors",function(){return lE}),v.d(b,"FileLoader",function(){return Ro}),v.d(b,"FlatShading",function(){return et}),v.d(b,"Float16BufferAttribute",function(){return lf}),v.d(b,"Float32Attribute",function(){return AE}),v.d(b,"Float32BufferAttribute",function(){return st}),v.d(b,"Float64Attribute",function(){return PE}),v.d(b,"Float64BufferAttribute",function(){return Yc}),v.d(b,"FloatType",function(){return ho}),v.d(b,"Fog",function(){return Fl}),v.d(b,"FogExp2",function(){return _i}),v.d(b,"Font",function(){return Iv}),v.d(b,"FontLoader",function(){return ES}),v.d(b,"FrontSide",function(){return z}),v.d(b,"Frustum",function(){return Da}),v.d(b,"GLBufferAttribute",function(){return Hy}),v.d(b,"GLSL1",function(){return Oc}),v.d(b,"GLSL3",function(){return Dc}),v.d(b,"GammaEncoding",function(){return zn}),v.d(b,"GreaterDepth",function(){return Rr}),v.d(b,"GreaterEqualDepth",function(){return Vi}),v.d(b,"GreaterEqualStencilFunc",function(){return ef}),v.d(b,"GreaterStencilFunc",function(){return Yu}),v.d(b,"GridHelper",function(){return $y}),v.d(b,"Group",function(){return Ys}),v.d(b,"HalfFloatType",function(){return Es}),v.d(b,"HemisphereLight",function(){return wv}),v.d(b,"HemisphereLightHelper",function(){return XS}),v.d(b,"HemisphereLightProbe",function(){return Py}),v.d(b,"IcosahedronBufferGeometry",function(){return Nh}),v.d(b,"IcosahedronGeometry",function(){return Nh}),v.d(b,"ImageBitmapLoader",function(){return Ey}),v.d(b,"ImageLoader",function(){return Ad}),v.d(b,"ImageUtils",function(){return fr}),v.d(b,"ImmediateRenderObject",function(){return Xy}),v.d(b,"IncrementStencilOp",function(){return $p}),v.d(b,"IncrementWrapStencilOp",function(){return bg}),v.d(b,"InstancedBufferAttribute",function(){return Rv}),v.d(b,"InstancedBufferGeometry",function(){return Cv}),v.d(b,"InstancedInterleavedBuffer",function(){return Gy}),v.d(b,"InstancedMesh",function(){return vd}),v.d(b,"Int16Attribute",function(){return TE}),v.d(b,"Int16BufferAttribute",function(){return Xc}),v.d(b,"Int32Attribute",function(){return EE}),v.d(b,"Int32BufferAttribute",function(){return hh}),v.d(b,"Int8Attribute",function(){return xE}),v.d(b,"Int8BufferAttribute",function(){return Ml}),v.d(b,"IntType",function(){return Up}),v.d(b,"InterleavedBuffer",function(){return qs}),v.d(b,"InterleavedBufferAttribute",function(){return Mo}),v.d(b,"Interpolant",function(){return ta}),v.d(b,"InterpolateDiscrete",function(){return Vo}),v.d(b,"InterpolateLinear",function(){return pl}),v.d(b,"InterpolateSmooth",function(){return mo}),v.d(b,"InvertStencilOp",function(){return Tg}),v.d(b,"JSONLoader",function(){return BE}),v.d(b,"KeepStencilOp",function(){return un}),v.d(b,"KeyframeTrack",function(){return Po}),v.d(b,"LOD",function(){return Vf}),v.d(b,"LatheBufferGeometry",function(){return Fh}),v.d(b,"LatheGeometry",function(){return Fh}),v.d(b,"Layers",function(){return Uc}),v.d(b,"LensFlare",function(){return kE}),v.d(b,"LessDepth",function(){return ai}),v.d(b,"LessEqualDepth",function(){return Fi}),v.d(b,"LessEqualStencilFunc",function(){return Kp}),v.d(b,"LessStencilFunc",function(){return Wo}),v.d(b,"Light",function(){return Io}),v.d(b,"LightProbe",function(){return Cd}),v.d(b,"Line",function(){return h}),v.d(b,"Line3",function(){return Wy}),v.d(b,"LineBasicMaterial",function(){return yi}),v.d(b,"LineCurve",function(){return ja}),v.d(b,"LineCurve3",function(){return Vl}),v.d(b,"LineDashedMaterial",function(){return vv}),v.d(b,"LineLoop",function(){return P}),v.d(b,"LinePieces",function(){return sE}),v.d(b,"LineSegments",function(){return E}),v.d(b,"LineStrip",function(){return oE}),v.d(b,"LinearEncoding",function(){return wt}),v.d(b,"LinearFilter",function(){return Jn}),v.d(b,"LinearInterpolant",function(){return _v}),v.d(b,"LinearMipMapLinearFilter",function(){return Np}),v.d(b,"LinearMipMapNearestFilter",function(){return Dp}),v.d(b,"LinearMipmapLinearFilter",function(){return Ts}),v.d(b,"LinearMipmapNearestFilter",function(){return Ho}),v.d(b,"LinearToneMapping",function(){return Cp}),v.d(b,"Loader",function(){return Ji}),v.d(b,"LoaderUtils",function(){return sm}),v.d(b,"LoadingManager",function(){return xv}),v.d(b,"LogLuvEncoding",function(){return xn}),v.d(b,"LoopOnce",function(){return zu}),v.d(b,"LoopPingPong",function(){return fo}),v.d(b,"LoopRepeat",function(){return Rc}),v.d(b,"LuminanceAlphaFormat",function(){return gc}),v.d(b,"LuminanceFormat",function(){return zp}),v.d(b,"MOUSE",function(){return K}),v.d(b,"Material",function(){return vi}),v.d(b,"MaterialLoader",function(){return by}),v.d(b,"Math",function(){return Ls}),v.d(b,"MathUtils",function(){return Ls}),v.d(b,"Matrix3",function(){return En}),v.d(b,"Matrix4",function(){return pt}),v.d(b,"MaxEquation",function(){return qe}),v.d(b,"Mesh",function(){return ln}),v.d(b,"MeshBasicMaterial",function(){return Kn}),v.d(b,"MeshDepthMaterial",function(){return on}),v.d(b,"MeshDistanceMaterial",function(){return bh}),v.d(b,"MeshFaceMaterial",function(){return hE}),v.d(b,"MeshLambertMaterial",function(){return im}),v.d(b,"MeshMatcapMaterial",function(){return gv}),v.d(b,"MeshNormalMaterial",function(){return mv}),v.d(b,"MeshPhongMaterial",function(){return nm}),v.d(b,"MeshPhysicalMaterial",function(){return pv}),v.d(b,"MeshStandardMaterial",function(){return tm}),v.d(b,"MeshToonMaterial",function(){return fv}),v.d(b,"MinEquation",function(){return Ue}),v.d(b,"MirroredRepeatWrapping",function(){return ll}),v.d(b,"MixOperation",function(){return Ap}),v.d(b,"MultiMaterial",function(){return cE}),v.d(b,"MultiplyBlending",function(){return H}),v.d(b,"MultiplyOperation",function(){return rl}),v.d(b,"NearestFilter",function(){return Zn}),v.d(b,"NearestMipMapLinearFilter",function(){return mc}),v.d(b,"NearestMipMapNearestFilter",function(){return fc}),v.d(b,"NearestMipmapLinearFilter",function(){return hl}),v.d(b,"NearestMipmapNearestFilter",function(){return ul}),v.d(b,"NeverDepth",function(){return qn}),v.d(b,"NeverStencilFunc",function(){return Wu}),v.d(b,"NoBlending",function(){return $e}),v.d(b,"NoColors",function(){return aE}),v.d(b,"NoToneMapping",function(){return uo}),v.d(b,"NormalAnimationBlendMode",function(){return Cs}),v.d(b,"NormalBlending",function(){return ae}),v.d(b,"NotEqualDepth",function(){return Mp}),v.d(b,"NotEqualStencilFunc",function(){return Qp}),v.d(b,"NumberKeyframeTrack",function(){return Sd}),v.d(b,"Object3D",function(){return Xt}),v.d(b,"ObjectLoader",function(){return wS}),v.d(b,"ObjectSpaceNormalMap",function(){return vl}),v.d(b,"OctahedronBufferGeometry",function(){return jl}),v.d(b,"OctahedronGeometry",function(){return jl}),v.d(b,"OneFactor",function(){return rt}),v.d(b,"OneMinusDstAlphaFactor",function(){return bt}),v.d(b,"OneMinusDstColorFactor",function(){return wn}),v.d(b,"OneMinusSrcAlphaFactor",function(){return Bt}),v.d(b,"OneMinusSrcColorFactor",function(){return lt}),v.d(b,"OrthographicCamera",function(){return jh}),v.d(b,"PCFShadowMap",function(){return O}),v.d(b,"PCFSoftShadowMap",function(){return V}),v.d(b,"PMREMGenerator",function(){return nE}),v.d(b,"ParametricBufferGeometry",function(){return Td}),v.d(b,"ParametricGeometry",function(){return Td}),v.d(b,"Particle",function(){return pE}),v.d(b,"ParticleBasicMaterial",function(){return gE}),v.d(b,"ParticleSystem",function(){return fE}),v.d(b,"ParticleSystemMaterial",function(){return vE}),v.d(b,"Path",function(){return Jl}),v.d(b,"PerspectiveCamera",function(){return Qn}),v.d(b,"Plane",function(){return yr}),v.d(b,"PlaneBufferGeometry",function(){return Ii}),v.d(b,"PlaneGeometry",function(){return Ii}),v.d(b,"PlaneHelper",function(){return $S}),v.d(b,"PointCloud",function(){return dE}),v.d(b,"PointCloudMaterial",function(){return mE}),v.d(b,"PointLight",function(){return Mv}),v.d(b,"PointLightHelper",function(){return jS}),v.d(b,"Points",function(){return ze}),v.d(b,"PointsMaterial",function(){return j}),v.d(b,"PolarGridHelper",function(){return YS}),v.d(b,"PolyhedronBufferGeometry",function(){return St}),v.d(b,"PolyhedronGeometry",function(){return St}),v.d(b,"PositionalAudio",function(){return RS}),v.d(b,"PropertyBinding",function(){return cn}),v.d(b,"PropertyMixer",function(){return By}),v.d(b,"QuadraticBezierCurve",function(){return ea}),v.d(b,"QuadraticBezierCurve3",function(){return av}),v.d(b,"Quaternion",function(){return gi}),v.d(b,"QuaternionKeyframeTrack",function(){return Vh}),v.d(b,"QuaternionLinearInterpolant",function(){return uy}),v.d(b,"REVISION",function(){return X}),v.d(b,"RGBADepthPacking",function(){return Lc}),v.d(b,"RGBAFormat",function(){return er}),v.d(b,"RGBAIntegerFormat",function(){return yc}),v.d(b,"RGBA_ASTC_10x10_Format",function(){return Sc}),v.d(b,"RGBA_ASTC_10x5_Format",function(){return dl}),v.d(b,"RGBA_ASTC_10x6_Format",function(){return As}),v.d(b,"RGBA_ASTC_10x8_Format",function(){return Xp}),v.d(b,"RGBA_ASTC_12x10_Format",function(){return Ec}),v.d(b,"RGBA_ASTC_12x12_Format",function(){return Bu}),v.d(b,"RGBA_ASTC_4x4_Format",function(){return Du}),v.d(b,"RGBA_ASTC_5x4_Format",function(){return Tn}),v.d(b,"RGBA_ASTC_5x5_Format",function(){return po}),v.d(b,"RGBA_ASTC_6x5_Format",function(){return Nu}),v.d(b,"RGBA_ASTC_6x6_Format",function(){return jp}),v.d(b,"RGBA_ASTC_8x5_Format",function(){return Fu}),v.d(b,"RGBA_ASTC_8x6_Format",function(){return Wp}),v.d(b,"RGBA_ASTC_8x8_Format",function(){return Tc}),v.d(b,"RGBA_BPTC_Format",function(){return Uu}),v.d(b,"RGBA_ETC2_EAC_Format",function(){return va}),v.d(b,"RGBA_PVRTC_2BPPV1_Format",function(){return bc}),v.d(b,"RGBA_PVRTC_4BPPV1_Format",function(){return ji}),v.d(b,"RGBA_S3TC_DXT1_Format",function(){return Iu}),v.d(b,"RGBA_S3TC_DXT3_Format",function(){return Lu}),v.d(b,"RGBA_S3TC_DXT5_Format",function(){return Ou}),v.d(b,"RGBDEncoding",function(){return Xi}),v.d(b,"RGBEEncoding",function(){return nr}),v.d(b,"RGBEFormat",function(){return Vp}),v.d(b,"RGBFormat",function(){return co}),v.d(b,"RGBIntegerFormat",function(){return _c}),v.d(b,"RGBM16Encoding",function(){return Ic}),v.d(b,"RGBM7Encoding",function(){return ml}),v.d(b,"RGB_ETC1_Format",function(){return wc}),v.d(b,"RGB_ETC2_Format",function(){return Wr}),v.d(b,"RGB_PVRTC_2BPPV1_Format",function(){return xc}),v.d(b,"RGB_PVRTC_4BPPV1_Format",function(){return Bi}),v.d(b,"RGB_S3TC_DXT1_Format",function(){return Ru}),v.d(b,"RGFormat",function(){return Cu}),v.d(b,"RGIntegerFormat",function(){return tr}),v.d(b,"RawShaderMaterial",function(){return zh}),v.d(b,"Ray",function(){return bo}),v.d(b,"Raycaster",function(){return GS}),v.d(b,"RectAreaLight",function(){return Av}),v.d(b,"RedFormat",function(){return ga}),v.d(b,"RedIntegerFormat",function(){return vc}),v.d(b,"ReinhardToneMapping",function(){return Rp}),v.d(b,"RepeatWrapping",function(){return Go}),v.d(b,"ReplaceStencilOp",function(){return xg}),v.d(b,"ReverseSubtractEquation",function(){return Se}),v.d(b,"RingBufferGeometry",function(){return Bh}),v.d(b,"RingGeometry",function(){return Bh}),v.d(b,"SRGB8_ALPHA8_ASTC_10x10_Format",function(){return Zp}),v.d(b,"SRGB8_ALPHA8_ASTC_10x5_Format",function(){return Cc}),v.d(b,"SRGB8_ALPHA8_ASTC_10x6_Format",function(){return Yp}),v.d(b,"SRGB8_ALPHA8_ASTC_10x8_Format",function(){return qp}),v.d(b,"SRGB8_ALPHA8_ASTC_12x10_Format",function(){return Jp}),v.d(b,"SRGB8_ALPHA8_ASTC_12x12_Format",function(){return Ps}),v.d(b,"SRGB8_ALPHA8_ASTC_4x4_Format",function(){return Mc}),v.d(b,"SRGB8_ALPHA8_ASTC_5x4_Format",function(){return ku}),v.d(b,"SRGB8_ALPHA8_ASTC_5x5_Format",function(){return Gu}),v.d(b,"SRGB8_ALPHA8_ASTC_6x5_Format",function(){return Ac}),v.d(b,"SRGB8_ALPHA8_ASTC_6x6_Format",function(){return Wi}),v.d(b,"SRGB8_ALPHA8_ASTC_8x5_Format",function(){return Hu}),v.d(b,"SRGB8_ALPHA8_ASTC_8x6_Format",function(){return _a}),v.d(b,"SRGB8_ALPHA8_ASTC_8x8_Format",function(){return Pc}),v.d(b,"Scene",function(){return Ba}),v.d(b,"SceneUtils",function(){return UE}),v.d(b,"ShaderChunk",function(){return Lt}),v.d(b,"ShaderLib",function(){return sr}),v.d(b,"ShaderMaterial",function(){return ki}),v.d(b,"ShadowMaterial",function(){return dv}),v.d(b,"Shape",function(){return Xa}),v.d(b,"ShapeBufferGeometry",function(){return Wl}),v.d(b,"ShapeGeometry",function(){return Wl}),v.d(b,"ShapePath",function(){return My}),v.d(b,"ShapeUtils",function(){return ss}),v.d(b,"ShortType",function(){return Bp}),v.d(b,"Skeleton",function(){return Ch}),v.d(b,"SkeletonHelper",function(){return qy}),v.d(b,"SkinnedMesh",function(){return Ga}),v.d(b,"SmoothShading",function(){return ft}),v.d(b,"Sphere",function(){return li}),v.d(b,"SphereBufferGeometry",function(){return Xl}),v.d(b,"SphereGeometry",function(){return Xl}),v.d(b,"Spherical",function(){return HS}),v.d(b,"SphericalHarmonics3",function(){return Pv}),v.d(b,"SplineCurve",function(){return Jf}),v.d(b,"SpotLight",function(){return Sv}),v.d(b,"SpotLightHelper",function(){return VS}),v.d(b,"Sprite",function(){return Hl}),v.d(b,"SpriteMaterial",function(){return Bl}),v.d(b,"SrcAlphaFactor",function(){return en}),v.d(b,"SrcAlphaSaturateFactor",function(){return gn}),v.d(b,"SrcColorFactor",function(){return Qt}),v.d(b,"StaticCopyUsage",function(){return Mg}),v.d(b,"StaticDrawUsage",function(){return Rs}),v.d(b,"StaticReadUsage",function(){return qu}),v.d(b,"StereoCamera",function(){return MS}),v.d(b,"StreamCopyUsage",function(){return Ju}),v.d(b,"StreamDrawUsage",function(){return Is}),v.d(b,"StreamReadUsage",function(){return Eg}),v.d(b,"StringKeyframeTrack",function(){return ql}),v.d(b,"SubtractEquation",function(){return Oe}),v.d(b,"SubtractiveBlending",function(){return Ie}),v.d(b,"TOUCH",function(){return le}),v.d(b,"TangentSpaceNormalMap",function(){return pr}),v.d(b,"TetrahedronBufferGeometry",function(){return Uh}),v.d(b,"TetrahedronGeometry",function(){return Uh}),v.d(b,"TextBufferGeometry",function(){return em}),v.d(b,"TextGeometry",function(){return em}),v.d(b,"Texture",function(){return $n}),v.d(b,"TextureLoader",function(){return bv}),v.d(b,"TorusBufferGeometry",function(){return kh}),v.d(b,"TorusGeometry",function(){return kh}),v.d(b,"TorusKnotBufferGeometry",function(){return Gh}),v.d(b,"TorusKnotGeometry",function(){return Gh}),v.d(b,"Triangle",function(){return Mn}),v.d(b,"TriangleFanDrawMode",function(){return ct}),v.d(b,"TriangleStripDrawMode",function(){return Ze}),v.d(b,"TrianglesDrawMode",function(){return je}),v.d(b,"TubeBufferGeometry",function(){return Hh}),v.d(b,"TubeGeometry",function(){return Hh}),v.d(b,"UVMapping",function(){return Pu}),v.d(b,"Uint16Attribute",function(){return SE}),v.d(b,"Uint16BufferAttribute",function(){return Aa}),v.d(b,"Uint32Attribute",function(){return ME}),v.d(b,"Uint32BufferAttribute",function(){return Fr}),v.d(b,"Uint8Attribute",function(){return bE}),v.d(b,"Uint8BufferAttribute",function(){return Wc}),v.d(b,"Uint8ClampedAttribute",function(){return wE}),v.d(b,"Uint8ClampedBufferAttribute",function(){return uh}),v.d(b,"Uniform",function(){return lm}),v.d(b,"UniformsLib",function(){return dt}),v.d(b,"UniformsUtils",function(){return eo}),v.d(b,"UnsignedByteType",function(){return zo}),v.d(b,"UnsignedInt248Type",function(){return dn}),v.d(b,"UnsignedIntType",function(){return Ss}),v.d(b,"UnsignedShort4444Type",function(){return kp}),v.d(b,"UnsignedShort5551Type",function(){return Gp}),v.d(b,"UnsignedShort565Type",function(){return Hp}),v.d(b,"UnsignedShortType",function(){return cl}),v.d(b,"VSMShadowMap",function(){return D}),v.d(b,"Vector2",function(){return Qe}),v.d(b,"Vector3",function(){return T}),v.d(b,"Vector4",function(){return pn}),v.d(b,"VectorKeyframeTrack",function(){return Ed}),v.d(b,"Vertex",function(){return _E}),v.d(b,"VertexColors",function(){return uE}),v.d(b,"VideoTexture",function(){return vt}),v.d(b,"WebGL1Renderer",function(){return ci}),v.d(b,"WebGLCubeRenderTarget",function(){return Pt}),v.d(b,"WebGLMultipleRenderTargets",function(){return bl}),v.d(b,"WebGLMultisampleRenderTarget",function(){return Os}),v.d(b,"WebGLRenderTarget",function(){return Ir}),v.d(b,"WebGLRenderTargetCube",function(){return NE}),v.d(b,"WebGLRenderer",function(){return fn}),v.d(b,"WebGLUtils",function(){return kf}),v.d(b,"WireframeGeometry",function(){return cv}),v.d(b,"WireframeHelper",function(){return LE}),v.d(b,"WrapAroundEnding",function(){return fl}),v.d(b,"XHRLoader",function(){return OE}),v.d(b,"ZeroCurvatureEnding",function(){return bi}),v.d(b,"ZeroFactor",function(){return at}),v.d(b,"ZeroSlopeEnding",function(){return jo}),v.d(b,"ZeroStencilOp",function(){return Vu}),v.d(b,"sRGBEncoding",function(){return $t});var q={};v.r(q),v.d(q,"isMobile",function(){return ro}),v.d(q,"EventEmitter",function(){return Zh.a}),v.d(q,"earcut",function(){return $v.a}),v.d(q,"BaseTextureCache",function(){return so}),v.d(q,"CanvasRenderTarget",function(){return u0}),v.d(q,"DATA_URI",function(){return Yx}),v.d(q,"ProgramCache",function(){return l0}),v.d(q,"TextureCache",function(){return Er}),v.d(q,"clearTextureCache",function(){return oM}),v.d(q,"correctBlendMode",function(){return r0}),v.d(q,"createIndicesForQuads",function(){return Vx}),v.d(q,"decomposeDataUri",function(){return sM}),v.d(q,"deprecation",function(){return uu}),v.d(q,"destroyTextureCache",function(){return rM}),v.d(q,"determineCrossOrigin",function(){return qx}),v.d(q,"getBufferType",function(){return jx}),v.d(q,"getResolutionOfUrl",function(){return Fd}),v.d(q,"hex2rgb",function(){return ou}),v.d(q,"hex2string",function(){return t0}),v.d(q,"interleaveTypedArrays",function(){return nM}),v.d(q,"isPow2",function(){return s0}),v.d(q,"isWebGLSupported",function(){return Hx}),v.d(q,"log2",function(){return a0}),v.d(q,"nextPow2",function(){return Nd}),v.d(q,"premultiplyBlendMode",function(){return i0}),v.d(q,"premultiplyRgba",function(){return zx}),v.d(q,"premultiplyTint",function(){return xm}),v.d(q,"premultiplyTintToRgba",function(){return o0}),v.d(q,"removeItems",function(){return su}),v.d(q,"rgb2hex",function(){return eM}),v.d(q,"sayHello",function(){return Gx}),v.d(q,"sign",function(){return au}),v.d(q,"skipHello",function(){return KE}),v.d(q,"string2hex",function(){return n0}),v.d(q,"trimCanvas",function(){return Xx}),v.d(q,"uid",function(){return lu}),v.d(q,"url",function(){return ru});var B={};v.r(B),v.d(B,"utils",function(){return q}),v.d(B,"AccessibilityManager",function(){return n1}),v.d(B,"accessibleTarget",function(){return t1}),v.d(B,"InteractionData",function(){return g0}),v.d(B,"InteractionEvent",function(){return o1}),v.d(B,"InteractionManager",function(){return a1}),v.d(B,"InteractionTrackingData",function(){return Tm}),v.d(B,"interactiveTarget",function(){return s1}),v.d(B,"Application",function(){return Xd}),v.d(B,"AbstractBatchRenderer",function(){return B1}),v.d(B,"AbstractMultiResource",function(){return Mm}),v.d(B,"AbstractRenderer",function(){return D1}),v.d(B,"ArrayResource",function(){return v0}),v.d(B,"Attribute",function(){return T0}),v.d(B,"BaseImageResource",function(){return ps}),v.d(B,"BaseRenderTexture",function(){return b0}),v.d(B,"BaseTexture",function(){return vn}),v.d(B,"BatchDrawCall",function(){return km}),v.d(B,"BatchGeometry",function(){return j0}),v.d(B,"BatchPluginFactory",function(){return H1}),v.d(B,"BatchRenderer",function(){return z1}),v.d(B,"BatchShaderGenerator",function(){return U1}),v.d(B,"BatchSystem",function(){return A0}),v.d(B,"BatchTextureArray",function(){return Gm}),v.d(B,"Buffer",function(){return Di}),v.d(B,"BufferResource",function(){return Jh}),v.d(B,"CanvasResource",function(){return Am}),v.d(B,"ContextSystem",function(){return P0}),v.d(B,"CubeResource",function(){return _0}),v.d(B,"Filter",function(){return Pr}),v.d(B,"FilterState",function(){return m1}),v.d(B,"FilterSystem",function(){return M0}),v.d(B,"Framebuffer",function(){return Rm}),v.d(B,"FramebufferSystem",function(){return C0}),v.d(B,"GLFramebuffer",function(){return v1}),v.d(B,"GLProgram",function(){return I1}),v.d(B,"GLTexture",function(){return Um}),v.d(B,"Geometry",function(){return gu}),v.d(B,"GeometrySystem",function(){return I0}),v.d(B,"IGLUniformData",function(){return EM}),v.d(B,"INSTALLED",function(){return Gd}),v.d(B,"ImageBitmapResource",function(){return x0}),v.d(B,"ImageResource",function(){return Pm}),v.d(B,"MaskData",function(){return _1}),v.d(B,"MaskSystem",function(){return O0}),v.d(B,"ObjectRenderer",function(){return Hd}),v.d(B,"Program",function(){return jd}),v.d(B,"ProjectionSystem",function(){return F0}),v.d(B,"Quad",function(){return f1}),v.d(B,"QuadUv",function(){return S0}),v.d(B,"RenderTexture",function(){return Gr}),v.d(B,"RenderTexturePool",function(){return c1}),v.d(B,"RenderTextureSystem",function(){return B0}),v.d(B,"Renderer",function(){return sa}),v.d(B,"Resource",function(){return mu}),v.d(B,"SVGResource",function(){return y0}),v.d(B,"ScissorSystem",function(){return D0}),v.d(B,"Shader",function(){return oa}),v.d(B,"ShaderSystem",function(){return U0}),v.d(B,"SpriteMaskFilter",function(){return C1}),v.d(B,"State",function(){return Ja}),v.d(B,"StateSystem",function(){return k0}),v.d(B,"StencilSystem",function(){return N0}),v.d(B,"System",function(){return Ar}),v.d(B,"Texture",function(){return Nt}),v.d(B,"TextureGCSystem",function(){return G0}),v.d(B,"TextureMatrix",function(){return Bm}),v.d(B,"TextureSystem",function(){return H0}),v.d(B,"TextureUvs",function(){return w0}),v.d(B,"UniformGroup",function(){return Za}),v.d(B,"VideoResource",function(){return Cm}),v.d(B,"ViewableBuffer",function(){return Hm}),v.d(B,"autoDetectRenderer",function(){return N1}),v.d(B,"autoDetectResource",function(){return Em}),v.d(B,"checkMaxIfStatementsInShader",function(){return A1}),v.d(B,"defaultFilterVertex",function(){return V0}),v.d(B,"defaultVertex",function(){return F1}),v.d(B,"resources",function(){return V1}),v.d(B,"systems",function(){return j1}),v.d(B,"uniformParsers",function(){return Nm}),v.d(B,"Extract",function(){return X1}),v.d(B,"AppLoaderPlugin",function(){return tb}),v.d(B,"Loader",function(){return fs}),v.d(B,"LoaderResource",function(){return ao}),v.d(B,"TextureLoader",function(){return eb}),v.d(B,"BlobResource",function(){return rb}),v.d(B,"CompressedTextureLoader",function(){return ob}),v.d(B,"CompressedTextureResource",function(){return jm}),v.d(B,"DDSLoader",function(){return ab}),v.d(B,"FORMATS_TO_COMPONENTS",function(){return ub}),v.d(B,"INTERNAL_FORMATS",function(){return Jt}),v.d(B,"INTERNAL_FORMAT_TO_BYTES_PER_PIXEL",function(){return Yd}),v.d(B,"KTXLoader",function(){return cb}),v.d(B,"TYPES_TO_BYTES_PER_COMPONENT",function(){return Z0}),v.d(B,"TYPES_TO_BYTES_PER_PIXEL",function(){return hb}),v.d(B,"ParticleContainer",function(){return aA}),v.d(B,"ParticleRenderer",function(){return mb}),v.d(B,"BasePrepare",function(){return Rb}),v.d(B,"CountLimiter",function(){return Cb}),v.d(B,"Prepare",function(){return Lb}),v.d(B,"TimeLimiter",function(){return TA}),v.d(B,"Spritesheet",function(){return Ob}),v.d(B,"SpritesheetLoader",function(){return Db}),v.d(B,"TilingSprite",function(){return SA}),v.d(B,"TilingSpriteRenderer",function(){return Ub}),v.d(B,"BitmapFont",function(){return rc}),v.d(B,"BitmapFontData",function(){return ep}),v.d(B,"BitmapFontLoader",function(){return Yb}),v.d(B,"BitmapText",function(){return PA}),v.d(B,"Ticker",function(){return Oi}),v.d(B,"TickerPlugin",function(){return i1}),v.d(B,"UPDATE_PRIORITY",function(){return Mr}),v.d(B,"ALPHA_MODES",function(){return ds}),v.d(B,"BLEND_MODES",function(){return Ft}),v.d(B,"BUFFER_BITS",function(){return Od}),v.d(B,"CLEAR_MODES",function(){return ra}),v.d(B,"DRAW_MODES",function(){return oo}),v.d(B,"ENV",function(){return us}),v.d(B,"FORMATS",function(){return Lo}),v.d(B,"GC_MODES",function(){return ym}),v.d(B,"MASK_TYPES",function(){return Sr}),v.d(B,"MIPMAP_MODES",function(){return ia}),v.d(B,"MSAA_QUALITY",function(){return iu}),v.d(B,"PRECISION",function(){return Oo}),v.d(B,"RENDERER_TYPE",function(){return qh}),v.d(B,"SAMPLER_TYPES",function(){return Dd}),v.d(B,"SCALE_MODES",function(){return hs}),v.d(B,"TARGETS",function(){return qa}),v.d(B,"TYPES",function(){return bn}),v.d(B,"WRAP_MODES",function(){return cs}),v.d(B,"Bounds",function(){return kd}),v.d(B,"Container",function(){return Mi}),v.d(B,"DisplayObject",function(){return fi}),v.d(B,"TemporaryDisplayObject",function(){return f0}),v.d(B,"FillStyle",function(){return J0}),v.d(B,"GRAPHICS_CURVES",function(){return Kh}),v.d(B,"Graphics",function(){return ca}),v.d(B,"GraphicsData",function(){return i_}),v.d(B,"GraphicsGeometry",function(){return Tb}),v.d(B,"LINE_CAP",function(){return ha}),v.d(B,"LINE_JOIN",function(){return ua}),v.d(B,"LineStyle",function(){return Sb}),v.d(B,"graphicsUtils",function(){return hA}),v.d(B,"Circle",function(){return $x}),v.d(B,"DEG_TO_RAD",function(){return Jx}),v.d(B,"Ellipse",function(){return Kx}),v.d(B,"Matrix",function(){return pi}),v.d(B,"ObservablePoint",function(){return hu}),v.d(B,"PI_2",function(){return Bd}),v.d(B,"Point",function(){return oi}),v.d(B,"Polygon",function(){return Ud}),v.d(B,"RAD_TO_DEG",function(){return Zx}),v.d(B,"Rectangle",function(){return nn}),v.d(B,"RoundedRectangle",function(){return h0}),v.d(B,"SHAPES",function(){return ri}),v.d(B,"Transform",function(){return d0}),v.d(B,"groupD8",function(){return Yn}),v.d(B,"Mesh",function(){return xu}),v.d(B,"MeshBatchUvs",function(){return Gb}),v.d(B,"MeshGeometry",function(){return Qd}),v.d(B,"MeshMaterial",function(){return Kd}),v.d(B,"NineSlicePlane",function(){return kA}),v.d(B,"PlaneGeometry",function(){return xw}),v.d(B,"RopeGeometry",function(){return bw}),v.d(B,"SimpleMesh",function(){return UA}),v.d(B,"SimplePlane",function(){return ww}),v.d(B,"SimpleRope",function(){return BA}),v.d(B,"Runner",function(){return zi}),v.d(B,"Sprite",function(){return Hn}),v.d(B,"AnimatedSprite",function(){return f_}),v.d(B,"TEXT_GRADIENT",function(){return ic}),v.d(B,"Text",function(){return Zm}),v.d(B,"TextMetrics",function(){return Hr}),v.d(B,"TextStyle",function(){return yu}),v.d(B,"isMobile",function(){return ro}),v.d(B,"settings",function(){return At}),v.d(B,"VERSION",function(){return GA}),v.d(B,"filters",function(){return np});var ie=v(0),k=v.n(ie),oe=v(1);/**
|
|
82
82
|
* @license
|
|
83
83
|
* Copyright 2010-2021 Three.js Authors
|
|
84
84
|
* SPDX-License-Identifier: MIT
|
|
85
|
-
*/const X="130",K={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},le={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ee=0,Xe=1,Fe=2,S=3,A=0,O=1,j=2,D=3,z=0,W=1,ee=2,et=1,ft=2,$e=0,ae=1,Ce=2,Ie=3,H=4,be=5,Me=100,Oe=101,Se=102,Ue=103,qe=104,at=200,rt=201,Qt=202,lt=203,en=204,Bt=205,Vt=206,bt=207,Dn=208,wn=209,gn=210,qn=0,yn=1,ai=2,Fi=3,Pi=4,Vi=5,Rr=6,Mp=7,rl=0,Ap=1,Pp=2,uo=0,Cp=1,Rp=2,Ip=3,Lp=4,Op=5,Pu=300,ko=301,ol=302,sl=303,al=304,fa=306,ma=307,Go=1e3,mi=1001,ll=1002,Zn=1003,ul=1004,fc=1004,hl=1005,mc=1005,Jn=1006,Ho=1007,Dp=1007,Ts=1008,Np=1008,zo=1009,Fp=1010,Bp=1011,cl=1012,Up=1013,Ss=1014,ho=1015,Es=1016,kp=1017,Gp=1018,Hp=1019,dn=1020,_n=1021,co=1022,er=1023,zp=1024,gc=1025,Vp=er,Nn=1026,Ms=1027,ga=1028,vc=1029,Cu=1030,tr=1031,_c=1032,yc=1033,Ru=33776,Iu=33777,Lu=33778,Ou=33779,Bi=35840,xc=35841,ji=35842,bc=35843,wc=36196,Wr=37492,va=37496,Du=37808,Tn=37809,po=37810,Nu=37811,jp=37812,Fu=37813,Wp=37814,Tc=37815,dl=37816,As=37817,Xp=37818,Sc=37819,Ec=37820,Bu=37821,Uu=36492,Mc=37840,ku=37841,Gu=37842,Ac=37843,Wi=37844,Hu=37845,_a=37846,Pc=37847,Cc=37848,Yp=37849,qp=37850,Zp=37851,Jp=37852,Ps=37853,zu=2200,Rc=2201,fo=2202,Vo=2300,pl=2301,mo=2302,bi=2400,jo=2401,fl=2402,Cs=2500,we=2501,je=0,Ze=1,ct=2,wt=3e3,$t=3001,zn=3007,nr=3002,xn=3003,ml=3004,Ic=3005,Xi=3006,gl=3200,Lc=3201,pr=0,vl=1,Vu=0,un=7680,xg=7681,$p=7682,ju=7683,bg=34055,wg=34056,Tg=5386,Wu=512,Wo=513,Xu=514,Kp=515,Yu=516,Qp=517,ef=518,_l=519,Rs=35044,Xr=35048,Is=35040,qu=35045,Sg=35049,Eg=35041,Mg=35046,Zu=35050,Ju=35042,Oc="100",Dc="300 es";class go{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const n=this._listeners[e];if(n!==void 0){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const n=t.slice(0);for(let i=0,o=n.length;i<o;i++)n[i].call(this,e);e.target=null}}}const wi=[];for(let r=0;r<256;r++)wi[r]=(r<16?"0":"")+r.toString(16);let $u=1234567;const Sn=Math.PI/180,ni=180/Math.PI;function ir(){const r=4294967295*Math.random()|0,e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(wi[255&r]+wi[r>>8&255]+wi[r>>16&255]+wi[r>>24&255]+"-"+wi[255&e]+wi[e>>8&255]+"-"+wi[e>>16&15|64]+wi[e>>24&255]+"-"+wi[63&t|128]+wi[t>>8&255]+"-"+wi[t>>16&255]+wi[t>>24&255]+wi[255&n]+wi[n>>8&255]+wi[n>>16&255]+wi[n>>24&255]).toUpperCase()}function Ti(r,e,t){return Math.max(e,Math.min(t,r))}function Ku(r,e){return(r%e+e)%e}function yl(r,e,t){return(1-t)*r+t*e}function xl(r){return(r&r-1)==0&&r!==0}function ya(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Qu(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}var Ls=Object.freeze({__proto__:null,DEG2RAD:Sn,RAD2DEG:ni,generateUUID:ir,clamp:Ti,euclideanModulo:Ku,mapLinear:function(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)},inverseLerp:function(r,e,t){return r!==e?(t-r)/(e-r):0},lerp:yl,damp:function(r,e,t,n){return yl(r,e,1-Math.exp(-t*n))},pingpong:function(r,e=1){return e-Math.abs(Ku(r,2*e)-e)},smoothstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e))*r*(3-2*r)},smootherstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e))*r*r*(r*(6*r-15)+10)},randInt:function(r,e){return r+Math.floor(Math.random()*(e-r+1))},randFloat:function(r,e){return r+Math.random()*(e-r)},randFloatSpread:function(r){return r*(.5-Math.random())},seededRandom:function(r){return r!==void 0&&($u=r%2147483647),$u=16807*$u%2147483647,($u-1)/2147483646},degToRad:function(r){return r*Sn},radToDeg:function(r){return r*ni},isPowerOfTwo:xl,ceilPowerOfTwo:ya,floorPowerOfTwo:Qu,setQuaternionFromProperEuler:function(r,e,t,n,i){const o=Math.cos,s=Math.sin,a=o(t/2),l=s(t/2),u=o((e+n)/2),c=s((e+n)/2),d=o((e-n)/2),f=s((e-n)/2),m=o((n-e)/2),g=s((n-e)/2);switch(i){case"XYX":r.set(a*c,l*d,l*f,a*u);break;case"YZY":r.set(l*f,a*c,l*d,a*u);break;case"ZXZ":r.set(l*d,l*f,a*c,a*u);break;case"XZX":r.set(a*c,l*g,l*m,a*u);break;case"YXY":r.set(l*m,a*c,l*g,a*u);break;case"ZYZ":r.set(l*g,l*m,a*c,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}});class Qe{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.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}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),o=this.x-e.x,s=this.y-e.y;return this.x=o*n-s*i+e.x,this.y=o*i+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}Qe.prototype.isVector2=!0;class En{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,o,s,a,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=a,c[3]=t,c[4]=o,c[5]=l,c[6]=n,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,o=this.elements,s=n[0],a=n[3],l=n[6],u=n[1],c=n[4],d=n[7],f=n[2],m=n[5],g=n[8],_=i[0],y=i[3],w=i[6],M=i[1],I=i[4],F=i[7],C=i[2],U=i[5],N=i[8];return o[0]=s*_+a*M+l*C,o[3]=s*y+a*I+l*U,o[6]=s*w+a*F+l*N,o[1]=u*_+c*M+d*C,o[4]=u*y+c*I+d*U,o[7]=u*w+c*F+d*N,o[2]=f*_+m*M+g*C,o[5]=f*y+m*I+g*U,o[8]=f*w+m*F+g*N,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return t*s*c-t*a*u-n*o*c+n*a*l+i*o*u-i*s*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=c*s-a*u,f=a*l-c*o,m=u*o-s*l,g=t*d+n*f+i*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return e[0]=d*_,e[1]=(i*u-c*n)*_,e[2]=(a*n-i*s)*_,e[3]=f*_,e[4]=(c*t-i*l)*_,e[5]=(i*o-a*t)*_,e[6]=m*_,e[7]=(n*l-u*t)*_,e[8]=(s*t-n*o)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,o,s,a){const l=Math.cos(o),u=Math.sin(o);return this.set(n*l,n*u,-n*(l*s+u*a)+s+e,-i*u,i*l,-i*(-u*s+l*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],u=i[4],c=i[7];return i[0]=t*o+n*l,i[3]=t*s+n*u,i[6]=t*a+n*c,i[1]=-n*o+t*l,i[4]=-n*s+t*u,i[7]=-n*a+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let vo;En.prototype.isMatrix3=!0;class fr{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{vo===void 0&&(vo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),vo.width=e.width,vo.height=e.height;const n=vo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=vo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let Ag=0;class $n extends go{constructor(e=$n.DEFAULT_IMAGE,t=$n.DEFAULT_MAPPING,n=mi,i=mi,o=Jn,s=Ts,a=er,l=zo,u=1,c=wt){super(),Object.defineProperty(this,"id",{value:Ag++}),this.uuid=ir(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=o,this.minFilter=s,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=l,this.offset=new Qe(0,0),this.repeat=new Qe(1,1),this.center=new Qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new En,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){const i=this.image;if(i.uuid===void 0&&(i.uuid=ir()),!t&&e.images[i.uuid]===void 0){let o;if(Array.isArray(i)){o=[];for(let s=0,a=i.length;s<a;s++)i[s].isDataTexture?o.push(Nc(i[s].image)):o.push(Nc(i[s]))}else o=Nc(i);e.images[i.uuid]={uuid:i.uuid,url:o}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Pu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Go:e.x=e.x-Math.floor(e.x);break;case mi:e.x=e.x<0?0:1;break;case ll:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Go:e.y=e.y-Math.floor(e.y);break;case mi:e.y=e.y<0?0:1;break;case ll:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}}function Nc(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?fr.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}$n.DEFAULT_IMAGE=void 0,$n.DEFAULT_MAPPING=Pu,$n.prototype.isTexture=!0;class pn{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i+s[12]*o,this.y=s[1]*t+s[5]*n+s[9]*i+s[13]*o,this.z=s[2]*t+s[6]*n+s[10]*i+s[14]*o,this.w=s[3]*t+s[7]*n+s[11]*i+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,o;const s=e.elements,a=s[0],l=s[4],u=s[8],c=s[1],d=s[5],f=s[9],m=s[2],g=s[6],_=s[10];if(Math.abs(l-c)<.01&&Math.abs(u-m)<.01&&Math.abs(f-g)<.01){if(Math.abs(l+c)<.1&&Math.abs(u+m)<.1&&Math.abs(f+g)<.1&&Math.abs(a+d+_-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(a+1)/2,M=(d+1)/2,I=(_+1)/2,F=(l+c)/4,C=(u+m)/4,U=(f+g)/4;return w>M&&w>I?w<.01?(n=0,i=.707106781,o=.707106781):(n=Math.sqrt(w),i=F/n,o=C/n):M>I?M<.01?(n=.707106781,i=0,o=.707106781):(i=Math.sqrt(M),n=F/i,o=U/i):I<.01?(n=.707106781,i=.707106781,o=0):(o=Math.sqrt(I),n=C/o,i=U/o),this.set(n,i,o,t),this}let y=Math.sqrt((g-f)*(g-f)+(u-m)*(u-m)+(c-l)*(c-l));return Math.abs(y)<.001&&(y=1),this.x=(g-f)/y,this.y=(u-m)/y,this.z=(c-l)/y,this.w=Math.acos((a+d+_-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),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.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}pn.prototype.isVector4=!0;class Ir extends go{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new pn(0,0,e,t),this.scissorTest=!1,this.viewport=new pn(0,0,e,t),this.texture=new $n(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=n.generateMipmaps!==void 0&&n.generateMipmaps,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Jn,this.depthBuffer=n.depthBuffer===void 0||n.depthBuffer,this.stencilBuffer=n.stencilBuffer!==void 0&&n.stencilBuffer,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=RT({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Ir.prototype.isWebGLRenderTarget=!0;class bl extends Ir{constructor(e,t,n){super(e,t);const i=this.texture;this.texture=[];for(let o=0;o<n;o++)this.texture[o]=i.clone()}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,o=this.texture.length;i<o;i++)this.texture[i].image.width=e,this.texture[i].image.height=t,this.texture[i].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone();return this}}bl.prototype.isWebGLMultipleRenderTargets=!0;class Os extends Ir{constructor(e,t,n){super(e,t,n),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}Os.prototype.isWebGLMultisampleRenderTarget=!0;class gi{constructor(e=0,t=0,n=0,i=1){this._x=e,this._y=t,this._z=n,this._w=i}static slerp(e,t,n,i){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,i)}static slerpFlat(e,t,n,i,o,s,a){let l=n[i+0],u=n[i+1],c=n[i+2],d=n[i+3];const f=o[s+0],m=o[s+1],g=o[s+2],_=o[s+3];if(a===0)return e[t+0]=l,e[t+1]=u,e[t+2]=c,void(e[t+3]=d);if(a===1)return e[t+0]=f,e[t+1]=m,e[t+2]=g,void(e[t+3]=_);if(d!==_||l!==f||u!==m||c!==g){let y=1-a;const w=l*f+u*m+c*g+d*_,M=w>=0?1:-1,I=1-w*w;if(I>Number.EPSILON){const C=Math.sqrt(I),U=Math.atan2(C,w*M);y=Math.sin(y*U)/C,a=Math.sin(a*U)/C}const F=a*M;if(l=l*y+f*F,u=u*y+m*F,c=c*y+g*F,d=d*y+_*F,y===1-a){const C=1/Math.sqrt(l*l+u*u+c*c+d*d);l*=C,u*=C,c*=C,d*=C}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,i,o,s){const a=n[i],l=n[i+1],u=n[i+2],c=n[i+3],d=o[s],f=o[s+1],m=o[s+2],g=o[s+3];return e[t]=a*g+c*d+l*m-u*f,e[t+1]=l*g+c*f+u*d-a*m,e[t+2]=u*g+c*m+a*f-l*d,e[t+3]=c*g-a*d-l*f-u*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,i=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,u=a(n/2),c=a(i/2),d=a(o/2),f=l(n/2),m=l(i/2),g=l(o/2);switch(s){case"XYZ":this._x=f*c*d+u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d-f*m*g;break;case"YXZ":this._x=f*c*d+u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d+f*m*g;break;case"ZXY":this._x=f*c*d-u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d-f*m*g;break;case"ZYX":this._x=f*c*d-u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d+f*m*g;break;case"YZX":this._x=f*c*d+u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d-f*m*g;break;case"XZY":this._x=f*c*d-u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d+f*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],o=t[8],s=t[1],a=t[5],l=t[9],u=t[2],c=t[6],d=t[10],f=n+a+d;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(c-l)*m,this._y=(o-u)*m,this._z=(s-i)*m}else if(n>a&&n>d){const m=2*Math.sqrt(1+n-a-d);this._w=(c-l)/m,this._x=.25*m,this._y=(i+s)/m,this._z=(o+u)/m}else if(a>d){const m=2*Math.sqrt(1+a-n-d);this._w=(o-u)/m,this._x=(i+s)/m,this._y=.25*m,this._z=(l+c)/m}else{const m=2*Math.sqrt(1+d-n-a);this._w=(s-i)/m,this._x=(o+u)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ti(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,o=e._z,s=e._w,a=t._x,l=t._y,u=t._z,c=t._w;return this._x=n*c+s*a+i*u-o*l,this._y=i*c+s*l+o*a-n*u,this._z=o*c+s*u+n*l-i*a,this._w=s*c-n*a-i*l-o*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,o=this._z,s=this._w;let a=s*e._w+n*e._x+i*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=n,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*s+t*this._w,this._x=m*n+t*this._x,this._y=m*i+t*this._y,this._z=m*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),c=Math.atan2(u,a),d=Math.sin((1-t)*c)/u,f=Math.sin(t*c)/u;return this._w=s*d+this._w*f,this._x=n*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}gi.prototype.isQuaternion=!0;class T{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(wl.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(wl.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*i,this.y=o[1]*t+o[4]*n+o[7]*i,this.z=o[2]*t+o[5]*n+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,o=e.elements,s=1/(o[3]*t+o[7]*n+o[11]*i+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*i+o[12])*s,this.y=(o[1]*t+o[5]*n+o[9]*i+o[13])*s,this.z=(o[2]*t+o[6]*n+o[10]*i+o[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,u=l*t+s*i-a*n,c=l*n+a*t-o*i,d=l*i+o*n-s*t,f=-o*t-s*n-a*i;return this.x=u*l+f*-o+c*-a-d*-s,this.y=c*l+f*-s+d*-o-u*-a,this.z=d*l+f*-a+u*-s-c*-o,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i,this.y=o[1]*t+o[5]*n+o[9]*i,this.z=o[2]*t+o[6]*n+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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}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.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,o=e.z,s=t.x,a=t.y,l=t.z;return this.x=i*l-o*a,this.y=o*s-n*l,this.z=n*a-i*s,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Xo.copy(this).projectOnVector(e),this.sub(Xo)}reflect(e){return this.sub(Xo.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Ti(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}T.prototype.isVector3=!0;const Xo=new T,wl=new gi;class In{constructor(e=new T(1/0,1/0,1/0),t=new T(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=e.length;l<u;l+=3){const c=e[l],d=e[l+1],f=e[l+2];c<t&&(t=c),d<n&&(n=d),f<i&&(i=f),c>o&&(o=c),d>s&&(s=d),f>a&&(a=f)}return this.min.set(t,n,i),this.max.set(o,s,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=e.count;l<u;l++){const c=e.getX(l),d=e.getY(l),f=e.getZ(l);c<t&&(t=c),d<n&&(n=d),f<i&&(i=f),c>o&&(o=c),d>s&&(s=d),f>a&&(a=f)}return this.min.set(t,n,i),this.max.set(o,s,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Lr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;t!==void 0&&(t.boundingBox===null&&t.computeBoundingBox(),Or.copy(t.boundingBox),Or.applyMatrix4(e.matrixWorld),this.union(Or));const n=e.children;for(let i=0,o=n.length;i<o;i++)this.expandByObject(n[i]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Lr),Lr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Tl),xa.subVectors(this.max,Tl),Yi.subVectors(e.a,Tl),mr.subVectors(e.b,Tl),Ci.subVectors(e.c,Tl),_o.subVectors(mr,Yi),yo.subVectors(Ci,mr),Ds.subVectors(Yi,Ci);let t=[0,-_o.z,_o.y,0,-yo.z,yo.y,0,-Ds.z,Ds.y,_o.z,0,-_o.x,yo.z,0,-yo.x,Ds.z,0,-Ds.x,-_o.y,_o.x,0,-yo.y,yo.x,0,-Ds.y,Ds.x,0];return!!Fc(t,Yi,mr,Ci,xa)&&(t=[1,0,0,0,1,0,0,0,1],!!Fc(t,Yi,mr,Ci,xa)&&(Yo.crossVectors(_o,yo),t=[Yo.x,Yo.y,Yo.z],Fc(t,Yi,mr,Ci,xa)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Lr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Lr).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Ht[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ht[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ht[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ht[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ht[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ht[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ht[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ht[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ht)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}In.prototype.isBox3=!0;const Ht=[new T,new T,new T,new T,new T,new T,new T,new T],Lr=new T,Or=new In,Yi=new T,mr=new T,Ci=new T,_o=new T,yo=new T,Ds=new T,Tl=new T,xa=new T,Yo=new T,Yr=new T;function Fc(r,e,t,n,i){for(let o=0,s=r.length-3;o<=s;o+=3){Yr.fromArray(r,o);const a=i.x*Math.abs(Yr.x)+i.y*Math.abs(Yr.y)+i.z*Math.abs(Yr.z),l=e.dot(Yr),u=t.dot(Yr),c=n.dot(Yr);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>a)return!1}return!0}const tf=new In,qr=new T,Sl=new T,xo=new T;class li{constructor(e=new T,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):tf.setFromPoints(e).getCenter(n);let i=0;for(let o=0,s=e.length;o<s;o++)i=Math.max(i,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){xo.subVectors(e,this.center);const t=xo.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=.5*(n-this.radius);this.center.add(xo.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return Sl.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(qr.copy(e.center).add(Sl)),this.expandByPoint(qr.copy(e.center).sub(Sl)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Zr=new T,eh=new T,qo=new T,Ui=new T,th=new T,nh=new T,ba=new T;class bo{constructor(e=new T,t=new T(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Zr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Zr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Zr.copy(this.direction).multiplyScalar(t).add(this.origin),Zr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){eh.copy(e).add(t).multiplyScalar(.5),qo.copy(t).sub(e).normalize(),Ui.copy(this.origin).sub(eh);const o=.5*e.distanceTo(t),s=-this.direction.dot(qo),a=Ui.dot(this.direction),l=-Ui.dot(qo),u=Ui.lengthSq(),c=Math.abs(1-s*s);let d,f,m,g;if(c>0)if(d=s*l-a,f=s*a-l,g=o*c,d>=0)if(f>=-g)if(f<=g){const _=1/c;d*=_,f*=_,m=d*(d+s*f+2*a)+f*(s*d+f+2*l)+u}else f=o,d=Math.max(0,-(s*f+a)),m=-d*d+f*(f+2*l)+u;else f=-o,d=Math.max(0,-(s*f+a)),m=-d*d+f*(f+2*l)+u;else f<=-g?(d=Math.max(0,-(-s*o+a)),f=d>0?-o:Math.min(Math.max(-o,-l),o),m=-d*d+f*(f+2*l)+u):f<=g?(d=0,f=Math.min(Math.max(-o,-l),o),m=f*(f+2*l)+u):(d=Math.max(0,-(s*o+a)),f=d>0?o:Math.min(Math.max(-o,-l),o),m=-d*d+f*(f+2*l)+u);else f=s>0?-o:o,d=Math.max(0,-(s*f+a)),m=-d*d+f*(f+2*l)+u;return n&&n.copy(this.direction).multiplyScalar(d).add(this.origin),i&&i.copy(qo).multiplyScalar(f).add(eh),m}intersectSphere(e,t){Zr.subVectors(e.center,this.origin);const n=Zr.dot(this.direction),i=Zr.dot(Zr)-n*n,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=n-s,l=n+s;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0?!0:e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,o,s,a,l;const u=1/this.direction.x,c=1/this.direction.y,d=1/this.direction.z,f=this.origin;return u>=0?(n=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(n=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(o=(e.min.y-f.y)*c,s=(e.max.y-f.y)*c):(o=(e.max.y-f.y)*c,s=(e.min.y-f.y)*c),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),d>=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),n>l||a>i?null:((a>n||n!=n)&&(n=a),(l<i||i!=i)&&(i=l),i<0?null:this.at(n>=0?n:i,t)))}intersectsBox(e){return this.intersectBox(e,Zr)!==null}intersectTriangle(e,t,n,i,o){th.subVectors(t,e),nh.subVectors(n,e),ba.crossVectors(th,nh);let s,a=this.direction.dot(ba);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Ui.subVectors(this.origin,e);const l=s*this.direction.dot(nh.crossVectors(Ui,nh));if(l<0)return null;const u=s*this.direction.dot(th.cross(Ui));if(u<0||l+u>a)return null;const c=-s*Ui.dot(ba);return c<0?null:this.at(c/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class pt{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,o,s,a,l,u,c,d,f,m,g,_,y){const w=this.elements;return w[0]=e,w[4]=t,w[8]=n,w[12]=i,w[1]=o,w[5]=s,w[9]=a,w[13]=l,w[2]=u,w[6]=c,w[10]=d,w[14]=f,w[3]=m,w[7]=g,w[11]=_,w[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new pt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Zo.setFromMatrixColumn(e,0).length(),o=1/Zo.setFromMatrixColumn(e,1).length(),s=1/Zo.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,i=e.y,o=e.z,s=Math.cos(n),a=Math.sin(n),l=Math.cos(i),u=Math.sin(i),c=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=s*c,m=s*d,g=a*c,_=a*d;t[0]=l*c,t[4]=-l*d,t[8]=u,t[1]=m+g*u,t[5]=f-_*u,t[9]=-a*l,t[2]=_-f*u,t[6]=g+m*u,t[10]=s*l}else if(e.order==="YXZ"){const f=l*c,m=l*d,g=u*c,_=u*d;t[0]=f+_*a,t[4]=g*a-m,t[8]=s*u,t[1]=s*d,t[5]=s*c,t[9]=-a,t[2]=m*a-g,t[6]=_+f*a,t[10]=s*l}else if(e.order==="ZXY"){const f=l*c,m=l*d,g=u*c,_=u*d;t[0]=f-_*a,t[4]=-s*d,t[8]=g+m*a,t[1]=m+g*a,t[5]=s*c,t[9]=_-f*a,t[2]=-s*u,t[6]=a,t[10]=s*l}else if(e.order==="ZYX"){const f=s*c,m=s*d,g=a*c,_=a*d;t[0]=l*c,t[4]=g*u-m,t[8]=f*u+_,t[1]=l*d,t[5]=_*u+f,t[9]=m*u-g,t[2]=-u,t[6]=a*l,t[10]=s*l}else if(e.order==="YZX"){const f=s*l,m=s*u,g=a*l,_=a*u;t[0]=l*c,t[4]=_-f*d,t[8]=g*d+m,t[1]=d,t[5]=s*c,t[9]=-a*c,t[2]=-u*c,t[6]=m*d+g,t[10]=f-_*d}else if(e.order==="XZY"){const f=s*l,m=s*u,g=a*l,_=a*u;t[0]=l*c,t[4]=-d,t[8]=u*c,t[1]=f*d+_,t[5]=s*c,t[9]=m*d-g,t[2]=g*d-m,t[6]=a*c,t[10]=_*d+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Jr,e,Bc)}lookAt(e,t,n){const i=this.elements;return qi.subVectors(e,t),qi.lengthSq()===0&&(qi.z=1),qi.normalize(),Dr.crossVectors(n,qi),Dr.lengthSq()===0&&(Math.abs(n.z)===1?qi.x+=1e-4:qi.z+=1e-4,qi.normalize(),Dr.crossVectors(n,qi)),Dr.normalize(),$r.crossVectors(qi,Dr),i[0]=Dr.x,i[4]=$r.x,i[8]=qi.x,i[1]=Dr.y,i[5]=$r.y,i[9]=qi.y,i[2]=Dr.z,i[6]=$r.z,i[10]=qi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,o=this.elements,s=n[0],a=n[4],l=n[8],u=n[12],c=n[1],d=n[5],f=n[9],m=n[13],g=n[2],_=n[6],y=n[10],w=n[14],M=n[3],I=n[7],F=n[11],C=n[15],U=i[0],N=i[4],G=i[8],he=i[12],ne=i[1],Z=i[5],Q=i[9],$=i[13],se=i[2],me=i[6],ge=i[10],de=i[14],fe=i[3],Re=i[7],ke=i[11],Be=i[15];return o[0]=s*U+a*ne+l*se+u*fe,o[4]=s*N+a*Z+l*me+u*Re,o[8]=s*G+a*Q+l*ge+u*ke,o[12]=s*he+a*$+l*de+u*Be,o[1]=c*U+d*ne+f*se+m*fe,o[5]=c*N+d*Z+f*me+m*Re,o[9]=c*G+d*Q+f*ge+m*ke,o[13]=c*he+d*$+f*de+m*Be,o[2]=g*U+_*ne+y*se+w*fe,o[6]=g*N+_*Z+y*me+w*Re,o[10]=g*G+_*Q+y*ge+w*ke,o[14]=g*he+_*$+y*de+w*Be,o[3]=M*U+I*ne+F*se+C*fe,o[7]=M*N+I*Z+F*me+C*Re,o[11]=M*G+I*Q+F*ge+C*ke,o[15]=M*he+I*$+F*de+C*Be,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],u=e[13],c=e[2],d=e[6],f=e[10],m=e[14];return e[3]*(+o*l*d-i*u*d-o*a*f+n*u*f+i*a*m-n*l*m)+e[7]*(+t*l*m-t*u*f+o*s*f-i*s*m+i*u*c-o*l*c)+e[11]*(+t*u*d-t*a*m-o*s*d+n*s*m+o*a*c-n*u*c)+e[15]*(-i*a*c-t*l*d+t*a*f+i*s*d-n*s*f+n*l*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],m=e[11],g=e[12],_=e[13],y=e[14],w=e[15],M=d*y*u-_*f*u+_*l*m-a*y*m-d*l*w+a*f*w,I=g*f*u-c*y*u-g*l*m+s*y*m+c*l*w-s*f*w,F=c*_*u-g*d*u+g*a*m-s*_*m-c*a*w+s*d*w,C=g*d*l-c*_*l-g*a*f+s*_*f+c*a*y-s*d*y,U=t*M+n*I+i*F+o*C;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/U;return e[0]=M*N,e[1]=(_*f*o-d*y*o-_*i*m+n*y*m+d*i*w-n*f*w)*N,e[2]=(a*y*o-_*l*o+_*i*u-n*y*u-a*i*w+n*l*w)*N,e[3]=(d*l*o-a*f*o-d*i*u+n*f*u+a*i*m-n*l*m)*N,e[4]=I*N,e[5]=(c*y*o-g*f*o+g*i*m-t*y*m-c*i*w+t*f*w)*N,e[6]=(g*l*o-s*y*o-g*i*u+t*y*u+s*i*w-t*l*w)*N,e[7]=(s*f*o-c*l*o+c*i*u-t*f*u-s*i*m+t*l*m)*N,e[8]=F*N,e[9]=(g*d*o-c*_*o-g*n*m+t*_*m+c*n*w-t*d*w)*N,e[10]=(s*_*o-g*a*o+g*n*u-t*_*u-s*n*w+t*a*w)*N,e[11]=(c*a*o-s*d*o-c*n*u+t*d*u+s*n*m-t*a*m)*N,e[12]=C*N,e[13]=(c*_*i-g*d*i+g*n*f-t*_*f-c*n*y+t*d*y)*N,e[14]=(g*a*i-s*_*i-g*n*l+t*_*l+s*n*y-t*a*y)*N,e[15]=(s*d*i-c*a*i+c*n*l-t*d*l-s*n*f+t*a*f)*N,this}scale(e){const t=this.elements,n=e.x,i=e.y,o=e.z;return t[0]*=n,t[4]*=i,t[8]*=o,t[1]*=n,t[5]*=i,t[9]*=o,t[2]*=n,t[6]*=i,t[10]*=o,t[3]*=n,t[7]*=i,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),o=1-n,s=e.x,a=e.y,l=e.z,u=o*s,c=o*a;return this.set(u*s+n,u*a-i*l,u*l+i*a,0,u*a+i*l,c*a+n,c*l-i*s,0,u*l-i*a,c*l+i*s,o*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,o,s){return this.set(1,n,o,0,e,1,s,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,o=t._x,s=t._y,a=t._z,l=t._w,u=o+o,c=s+s,d=a+a,f=o*u,m=o*c,g=o*d,_=s*c,y=s*d,w=a*d,M=l*u,I=l*c,F=l*d,C=n.x,U=n.y,N=n.z;return i[0]=(1-(_+w))*C,i[1]=(m+F)*C,i[2]=(g-I)*C,i[3]=0,i[4]=(m-F)*U,i[5]=(1-(f+w))*U,i[6]=(y+M)*U,i[7]=0,i[8]=(g+I)*N,i[9]=(y-M)*N,i[10]=(1-(f+_))*N,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let o=Zo.set(i[0],i[1],i[2]).length();const s=Zo.set(i[4],i[5],i[6]).length(),a=Zo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],gr.copy(this);const l=1/o,u=1/s,c=1/a;return gr.elements[0]*=l,gr.elements[1]*=l,gr.elements[2]*=l,gr.elements[4]*=u,gr.elements[5]*=u,gr.elements[6]*=u,gr.elements[8]*=c,gr.elements[9]*=c,gr.elements[10]*=c,t.setFromRotationMatrix(gr),n.x=o,n.y=s,n.z=a,this}makePerspective(e,t,n,i,o,s){s===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,l=2*o/(t-e),u=2*o/(n-i),c=(t+e)/(t-e),d=(n+i)/(n-i),f=-(s+o)/(s-o),m=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=f,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,o,s){const a=this.elements,l=1/(t-e),u=1/(n-i),c=1/(s-o),d=(t+e)*l,f=(n+i)*u,m=(s+o)*c;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-f,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-m,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}pt.prototype.isMatrix4=!0;const Zo=new T,gr=new pt,Jr=new T(0,0,0),Bc=new T(1,1,1),Dr=new T,$r=new T,qi=new T,Ri=new pt,ih=new gi;class Ns{constructor(e=0,t=0,n=0,i=Ns.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,o=i[0],s=i[4],a=i[8],l=i[1],u=i[5],c=i[9],d=i[2],f=i[6],m=i[10];switch(t){case"XYZ":this._y=Math.asin(Ti(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,m),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Ti(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(Ti(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Ti(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Ti(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-Ti(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Ri.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ri,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ih.setFromEuler(this),this.setFromQuaternion(ih,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new T(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Ns.prototype.isEuler=!0,Ns.DefaultOrder="XYZ",Ns.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Uc{constructor(){this.mask=1}set(e){this.mask=1<<e|0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!=0}}let kc=0;const wa=new T,Fs=new gi,rr=new pt,Ta=new T,Sa=new T,nf=new T,Gc=new gi,rf=new T(1,0,0),rh=new T(0,1,0),Hc=new T(0,0,1),of={type:"added"},zc={type:"removed"};class Xt extends go{constructor(){super(),Object.defineProperty(this,"id",{value:kc++}),this.uuid=ir(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Xt.DefaultUp.clone();const e=new T,t=new Ns,n=new gi,i=new T(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new pt},normalMatrix:{value:new En}}),this.matrix=new pt,this.matrixWorld=new pt,this.matrixAutoUpdate=Xt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Uc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Fs.setFromAxisAngle(e,t),this.quaternion.multiply(Fs),this}rotateOnWorldAxis(e,t){return Fs.setFromAxisAngle(e,t),this.quaternion.premultiply(Fs),this}rotateX(e){return this.rotateOnAxis(rf,e)}rotateY(e){return this.rotateOnAxis(rh,e)}rotateZ(e){return this.rotateOnAxis(Hc,e)}translateOnAxis(e,t){return wa.copy(e).applyQuaternion(this.quaternion),this.position.add(wa.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(rf,e)}translateY(e){return this.translateOnAxis(rh,e)}translateZ(e){return this.translateOnAxis(Hc,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(rr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ta.copy(e):Ta.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Sa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?rr.lookAt(Sa,Ta,this.up):rr.lookAt(Ta,Sa,this.up),this.quaternion.setFromRotationMatrix(rr),i&&(rr.extractRotation(i.matrixWorld),Fs.setFromRotationMatrix(rr),this.quaternion.premultiply(Fs.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(of)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(zc)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(zc)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),rr.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),rr.multiply(e.parent.matrixWorld)),e.applyMatrix4(rr),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Sa,e,nf),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Sa,Gc,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let o=0,s=i.length;o<s;o++)i[o].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u<c;u++){const d=l[u];o(e.shapes,d)}else o(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,u=this.material.length;l<u;l++)a.push(o(e.materials,this.material[l]));i.material=a}else i.material=o(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];i.animations.push(o(e.animations,l))}}if(t){const a=s(e.geometries),l=s(e.materials),u=s(e.textures),c=s(e.images),d=s(e.shapes),f=s(e.skeletons),m=s(e.animations);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),u.length>0&&(n.textures=u),c.length>0&&(n.images=c),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),m.length>0&&(n.animations=m)}return n.object=i,n;function s(a){const l=[];for(const u in a){const c=a[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Xt.DefaultUp=new T(0,1,0),Xt.DefaultMatrixAutoUpdate=!0,Xt.prototype.isObject3D=!0;const vr=new T,Kr=new T,oh=new T,Nr=new T,Bs=new T,Jo=new T,sh=new T,Yt=new T,Vc=new T,jc=new T;class Mn{constructor(e=new T,t=new T,n=new T){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),vr.subVectors(e,t),i.cross(vr);const o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,t,n,i,o){vr.subVectors(i,t),Kr.subVectors(n,t),oh.subVectors(e,t);const s=vr.dot(vr),a=vr.dot(Kr),l=vr.dot(oh),u=Kr.dot(Kr),c=Kr.dot(oh),d=s*u-a*a;if(d===0)return o.set(-2,-1,-1);const f=1/d,m=(u*l-a*c)*f,g=(s*c-a*l)*f;return o.set(1-m-g,g,m)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Nr),Nr.x>=0&&Nr.y>=0&&Nr.x+Nr.y<=1}static getUV(e,t,n,i,o,s,a,l){return this.getBarycoord(e,t,n,i,Nr),l.set(0,0),l.addScaledVector(o,Nr.x),l.addScaledVector(s,Nr.y),l.addScaledVector(a,Nr.z),l}static isFrontFacing(e,t,n,i){return vr.subVectors(n,t),Kr.subVectors(e,t),vr.cross(Kr).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return vr.subVectors(this.c,this.b),Kr.subVectors(this.a,this.b),.5*vr.cross(Kr).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Mn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Mn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,o){return Mn.getUV(e,this.a,this.b,this.c,t,n,i,o)}containsPoint(e){return Mn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Mn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,o=this.c;let s,a;Bs.subVectors(i,n),Jo.subVectors(o,n),Yt.subVectors(e,n);const l=Bs.dot(Yt),u=Jo.dot(Yt);if(l<=0&&u<=0)return t.copy(n);Vc.subVectors(e,i);const c=Bs.dot(Vc),d=Jo.dot(Vc);if(c>=0&&d<=c)return t.copy(i);const f=l*d-c*u;if(f<=0&&l>=0&&c<=0)return s=l/(l-c),t.copy(n).addScaledVector(Bs,s);jc.subVectors(e,o);const m=Bs.dot(jc),g=Jo.dot(jc);if(g>=0&&m<=g)return t.copy(o);const _=m*u-l*g;if(_<=0&&u>=0&&g<=0)return a=u/(u-g),t.copy(n).addScaledVector(Jo,a);const y=c*g-m*d;if(y<=0&&d-c>=0&&m-g>=0)return sh.subVectors(o,i),a=(d-c)/(d-c+(m-g)),t.copy(i).addScaledVector(sh,a);const w=1/(y+_+f);return s=_*w,a=f*w,t.copy(n).addScaledVector(Bs,s).addScaledVector(Jo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let sf=0;class vi extends go{constructor(){super(),Object.defineProperty(this,"id",{value:sf++}),this.uuid=ir(),this.name="",this.type="Material",this.fog=!0,this.blending=ae,this.side=z,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=en,this.blendDst=Bt,this.blendEquation=Me,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Fi,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_l,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=un,this.stencilZFail=un,this.stencilZPass=un,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===et;continue}const i=this[t];i!==void 0?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ae&&(n.blending=this.blending),this.side!==z&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),t){const o=i(e.textures),s=i(e.images);o.length>0&&(n.textures=o),s.length>0&&(n.images=s)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let o=0;o!==i;++o)n[o]=t[o].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}vi.prototype.isMaterial=!0;const af={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},Vn={h:0,s:0,l:0},ah={h:0,s:0,l:0};function Ea(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+6*(e-r)*t:t<.5?e:t<2/3?r+6*(e-r)*(2/3-t):r}function El(r){return r<.04045?.0773993808*r:Math.pow(.9478672986*r+.0521327014,2.4)}function lh(r){return r<.0031308?12.92*r:1.055*Math.pow(r,.41666)-.055}class gt{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=Ku(e,1),t=Ti(t,0,1),n=Ti(n,0,1),t===0)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,o=2*n-i;this.r=Ea(o,i,e+1/3),this.g=Ea(o,i,e),this.b=Ea(o,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i;const o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,u=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,u)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=n[1],o=i.length;if(o===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(o===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=af[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=El(e.r),this.g=El(e.g),this.b=El(e.b),this}copyLinearToSRGB(e){return this.r=lh(e.r),this.g=lh(e.g),this.b=lh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,n=this.g,i=this.b,o=Math.max(t,n,i),s=Math.min(t,n,i);let a,l;const u=(s+o)/2;if(s===o)a=0,l=0;else{const c=o-s;switch(l=u<=.5?c/(o+s):c/(2-o-s),o){case t:a=(n-i)/c+(n<i?6:0);break;case n:a=(i-t)/c+2;break;case i:a=(t-n)/c+4}a/=6}return e.h=a,e.s=l,e.l=u,e}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(e,t,n){return this.getHSL(Vn),Vn.h+=e,Vn.s+=t,Vn.l+=n,this.setHSL(Vn.h,Vn.s,Vn.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Vn),e.getHSL(ah);const n=yl(Vn.h,ah.h,t),i=yl(Vn.s,ah.s,t),o=yl(Vn.l,ah.l,t);return this.setHSL(n,i,o),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),e.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}gt.NAMES=af,gt.prototype.isColor=!0,gt.prototype.r=1,gt.prototype.g=1,gt.prototype.b=1;class Kn extends vi{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new gt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=rl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this}}Kn.prototype.isMeshBasicMaterial=!0;const an=new T,Ma=new Qe;class Zt{constructor(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n===!0,this.usage=Rs,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,o=this.itemSize;i<o;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),s=new gt),t[n++]=s.r,t[n++]=s.g,t[n++]=s.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),s=new Qe),t[n++]=s.x,t[n++]=s.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),s=new T),t[n++]=s.x,t[n++]=s.y,t[n++]=s.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),s=new pn),t[n++]=s.x,t[n++]=s.y,t[n++]=s.z,t[n++]=s.w}return this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Ma.fromBufferAttribute(this,t),Ma.applyMatrix3(e),this.setXY(t,Ma.x,Ma.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.applyMatrix3(e),this.setXYZ(t,an.x,an.y,an.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)an.x=this.getX(t),an.y=this.getY(t),an.z=this.getZ(t),an.applyMatrix4(e),this.setXYZ(t,an.x,an.y,an.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)an.x=this.getX(t),an.y=this.getY(t),an.z=this.getZ(t),an.applyNormalMatrix(e),this.setXYZ(t,an.x,an.y,an.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)an.x=this.getX(t),an.y=this.getY(t),an.z=this.getZ(t),an.transformDirection(e),this.setXYZ(t,an.x,an.y,an.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,o){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=o,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Rs&&(e.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(e.updateRange=this.updateRange),e}}Zt.prototype.isBufferAttribute=!0;class Ml extends Zt{constructor(e,t,n){super(new Int8Array(e),t,n)}}class Wc extends Zt{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class uh extends Zt{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class Xc extends Zt{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Aa extends Zt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class hh extends Zt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Fr extends Zt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class lf extends Zt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}lf.prototype.isFloat16BufferAttribute=!0;class st extends Zt{constructor(e,t,n){super(new Float32Array(e),t,n)}}class Yc extends Zt{constructor(e,t,n){super(new Float64Array(e),t,n)}}function qc(r){if(r.length===0)return-1/0;let e=r[0];for(let t=1,n=r.length;t<n;++t)r[t]>e&&(e=r[t]);return e}const Zc={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Us(r,e){return new Zc[r](e)}let uf=0;const or=new pt,ch=new Xt,ui=new T,jn=new In,$o=new In,Fn=new T;class Mt extends go{constructor(){super(),Object.defineProperty(this,"id",{value:uf++}),this.uuid=ir(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(qc(e)>65535?Fr:Aa)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const o=new En().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return or.makeRotationFromQuaternion(e),this.applyMatrix4(or),this}rotateX(e){return or.makeRotationX(e),this.applyMatrix4(or),this}rotateY(e){return or.makeRotationY(e),this.applyMatrix4(or),this}rotateZ(e){return or.makeRotationZ(e),this.applyMatrix4(or),this}translate(e,t,n){return or.makeTranslation(e,t,n),this.applyMatrix4(or),this}scale(e,t,n){return or.makeScale(e,t,n),this.applyMatrix4(or),this}lookAt(e){return ch.lookAt(e),ch.updateMatrix(),this.applyMatrix4(ch.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ui).negate(),this.translate(ui.x,ui.y,ui.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const o=e[n];t.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new st(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new In);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new T(-1/0,-1/0,-1/0),new T(1/0,1/0,1/0));if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const o=t[n];jn.setFromBufferAttribute(o),this.morphTargetsRelative?(Fn.addVectors(this.boundingBox.min,jn.min),this.boundingBox.expandByPoint(Fn),Fn.addVectors(this.boundingBox.max,jn.max),this.boundingBox.expandByPoint(Fn)):(this.boundingBox.expandByPoint(jn.min),this.boundingBox.expandByPoint(jn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new li);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new T,1/0);if(e){const n=this.boundingSphere.center;if(jn.setFromBufferAttribute(e),t)for(let o=0,s=t.length;o<s;o++){const a=t[o];$o.setFromBufferAttribute(a),this.morphTargetsRelative?(Fn.addVectors(jn.min,$o.min),jn.expandByPoint(Fn),Fn.addVectors(jn.max,$o.max),jn.expandByPoint(Fn)):(jn.expandByPoint($o.min),jn.expandByPoint($o.max))}jn.getCenter(n);let i=0;for(let o=0,s=e.count;o<s;o++)Fn.fromBufferAttribute(e,o),i=Math.max(i,n.distanceToSquared(Fn));if(t)for(let o=0,s=t.length;o<s;o++){const a=t[o],l=this.morphTargetsRelative;for(let u=0,c=a.count;u<c;u++)Fn.fromBufferAttribute(a,u),l&&(ui.fromBufferAttribute(e,u),Fn.add(ui)),i=Math.max(i,n.distanceToSquared(Fn))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeFaceNormals(){}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,i=t.position.array,o=t.normal.array,s=t.uv.array,a=i.length/3;t.tangent===void 0&&this.setAttribute("tangent",new Zt(new Float32Array(4*a),4));const l=t.tangent.array,u=[],c=[];for(let ne=0;ne<a;ne++)u[ne]=new T,c[ne]=new T;const d=new T,f=new T,m=new T,g=new Qe,_=new Qe,y=new Qe,w=new T,M=new T;function I(ne,Z,Q){d.fromArray(i,3*ne),f.fromArray(i,3*Z),m.fromArray(i,3*Q),g.fromArray(s,2*ne),_.fromArray(s,2*Z),y.fromArray(s,2*Q),f.sub(d),m.sub(d),_.sub(g),y.sub(g);const $=1/(_.x*y.y-y.x*_.y);isFinite($)&&(w.copy(f).multiplyScalar(y.y).addScaledVector(m,-_.y).multiplyScalar($),M.copy(m).multiplyScalar(_.x).addScaledVector(f,-y.x).multiplyScalar($),u[ne].add(w),u[Z].add(w),u[Q].add(w),c[ne].add(M),c[Z].add(M),c[Q].add(M))}let F=this.groups;F.length===0&&(F=[{start:0,count:n.length}]);for(let ne=0,Z=F.length;ne<Z;++ne){const Q=F[ne],$=Q.start;for(let se=$,me=$+Q.count;se<me;se+=3)I(n[se+0],n[se+1],n[se+2])}const C=new T,U=new T,N=new T,G=new T;function he(ne){N.fromArray(o,3*ne),G.copy(N);const Z=u[ne];C.copy(Z),C.sub(N.multiplyScalar(N.dot(Z))).normalize(),U.crossVectors(G,Z);const Q=U.dot(c[ne])<0?-1:1;l[4*ne]=C.x,l[4*ne+1]=C.y,l[4*ne+2]=C.z,l[4*ne+3]=Q}for(let ne=0,Z=F.length;ne<Z;++ne){const Q=F[ne],$=Q.start;for(let se=$,me=$+Q.count;se<me;se+=3)he(n[se+0]),he(n[se+1]),he(n[se+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Zt(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let f=0,m=n.count;f<m;f++)n.setXYZ(f,0,0,0);const i=new T,o=new T,s=new T,a=new T,l=new T,u=new T,c=new T,d=new T;if(e)for(let f=0,m=e.count;f<m;f+=3){const g=e.getX(f+0),_=e.getX(f+1),y=e.getX(f+2);i.fromBufferAttribute(t,g),o.fromBufferAttribute(t,_),s.fromBufferAttribute(t,y),c.subVectors(s,o),d.subVectors(i,o),c.cross(d),a.fromBufferAttribute(n,g),l.fromBufferAttribute(n,_),u.fromBufferAttribute(n,y),a.add(c),l.add(c),u.add(c),n.setXYZ(g,a.x,a.y,a.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(y,u.x,u.y,u.z)}else for(let f=0,m=t.count;f<m;f+=3)i.fromBufferAttribute(t,f+0),o.fromBufferAttribute(t,f+1),s.fromBufferAttribute(t,f+2),c.subVectors(s,o),d.subVectors(i,o),c.cross(d),n.setXYZ(f+0,c.x,c.y,c.z),n.setXYZ(f+1,c.x,c.y,c.z),n.setXYZ(f+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);t===void 0&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const i in n){if(e.attributes[i]===void 0)continue;const o=n[i].array,s=e.attributes[i],a=s.array,l=s.itemSize*t,u=Math.min(a.length,o.length-l);for(let c=0,d=l;c<u;c++,d++)o[d]=a[c]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Fn.fromBufferAttribute(e,t),Fn.normalize(),e.setXYZ(t,Fn.x,Fn.y,Fn.z)}toNonIndexed(){function e(a,l){const u=a.array,c=a.itemSize,d=a.normalized,f=new u.constructor(l.length*c);let m=0,g=0;for(let _=0,y=l.length;_<y;_++){m=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*c;for(let w=0;w<c;w++)f[g++]=u[m++]}return new Zt(f,c,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Mt,n=this.index.array,i=this.attributes;for(const a in i){const l=e(i[a],n);t.setAttribute(a,l)}const o=this.morphAttributes;for(const a in o){const l=[],u=o[a];for(let c=0,d=u.length;c<d;c++){const f=e(u[c],n);l.push(f)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,l=s.length;a<l;a++){const u=s[a];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const u=n[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let d=0,f=u.length;d<f;d++){const m=u[d];c.push(m.toJSON(e.data))}c.length>0&&(i[l]=c,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new Mt().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(t))}const o=e.morphAttributes;for(const u in o){const c=[],d=o[u];for(let f=0,m=d.length;f<m;f++)c.push(d[f].clone(t));this.morphAttributes[u]=c}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let u=0,c=s.length;u<c;u++){const d=s[u];this.addGroup(d.start,d.count,d.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}Mt.prototype.isBufferGeometry=!0;const Jc=new pt,ks=new bo,Ko=new li,_r=new T,wo=new T,To=new T,Pa=new T,dh=new T,Ca=new T,Ra=new T,Gs=new T,Al=new T,Hs=new Qe,Pl=new Qe,Ia=new Qe,$c=new T,Cl=new T;class ln extends Xt{constructor(e=new Mt,t=new Kn){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o<s;o++){const a=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,i=this.material,o=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),Ko.copy(n.boundingSphere),Ko.applyMatrix4(o),e.ray.intersectsSphere(Ko)===!1)||(Jc.copy(o).invert(),ks.copy(e.ray).applyMatrix4(Jc),n.boundingBox!==null&&ks.intersectsBox(n.boundingBox)===!1))return;let s;if(n.isBufferGeometry){const a=n.index,l=n.attributes.position,u=n.morphAttributes.position,c=n.morphTargetsRelative,d=n.attributes.uv,f=n.attributes.uv2,m=n.groups,g=n.drawRange;if(a!==null)if(Array.isArray(i))for(let _=0,y=m.length;_<y;_++){const w=m[_],M=i[w.materialIndex];for(let I=Math.max(w.start,g.start),F=Math.min(w.start+w.count,g.start+g.count);I<F;I+=3){const C=a.getX(I),U=a.getX(I+1),N=a.getX(I+2);s=Rl(this,M,e,ks,l,u,c,d,f,C,U,N),s&&(s.faceIndex=Math.floor(I/3),s.face.materialIndex=w.materialIndex,t.push(s))}}else for(let _=Math.max(0,g.start),y=Math.min(a.count,g.start+g.count);_<y;_+=3){const w=a.getX(_),M=a.getX(_+1),I=a.getX(_+2);s=Rl(this,i,e,ks,l,u,c,d,f,w,M,I),s&&(s.faceIndex=Math.floor(_/3),t.push(s))}else if(l!==void 0)if(Array.isArray(i))for(let _=0,y=m.length;_<y;_++){const w=m[_],M=i[w.materialIndex];for(let I=Math.max(w.start,g.start),F=Math.min(w.start+w.count,g.start+g.count);I<F;I+=3)s=Rl(this,M,e,ks,l,u,c,d,f,I,I+1,I+2),s&&(s.faceIndex=Math.floor(I/3),s.face.materialIndex=w.materialIndex,t.push(s))}else for(let _=Math.max(0,g.start),y=Math.min(l.count,g.start+g.count);_<y;_+=3)s=Rl(this,i,e,ks,l,u,c,d,f,_,_+1,_+2),s&&(s.faceIndex=Math.floor(_/3),t.push(s))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function Rl(r,e,t,n,i,o,s,a,l,u,c,d){_r.fromBufferAttribute(i,u),wo.fromBufferAttribute(i,c),To.fromBufferAttribute(i,d);const f=r.morphTargetInfluences;if(e.morphTargets&&o&&f){Ra.set(0,0,0),Gs.set(0,0,0),Al.set(0,0,0);for(let g=0,_=o.length;g<_;g++){const y=f[g],w=o[g];y!==0&&(Pa.fromBufferAttribute(w,u),dh.fromBufferAttribute(w,c),Ca.fromBufferAttribute(w,d),s?(Ra.addScaledVector(Pa,y),Gs.addScaledVector(dh,y),Al.addScaledVector(Ca,y)):(Ra.addScaledVector(Pa.sub(_r),y),Gs.addScaledVector(dh.sub(wo),y),Al.addScaledVector(Ca.sub(To),y)))}_r.add(Ra),wo.add(Gs),To.add(Al)}r.isSkinnedMesh&&(r.boneTransform(u,_r),r.boneTransform(c,wo),r.boneTransform(d,To));const m=function(g,_,y,w,M,I,F,C){let U;if(U=_.side===W?w.intersectTriangle(F,I,M,!0,C):w.intersectTriangle(M,I,F,_.side!==ee,C),U===null)return null;Cl.copy(C),Cl.applyMatrix4(g.matrixWorld);const N=y.ray.origin.distanceTo(Cl);return N<y.near||N>y.far?null:{distance:N,point:Cl.clone(),object:g}}(r,e,t,n,_r,wo,To,$c);if(m){a&&(Hs.fromBufferAttribute(a,u),Pl.fromBufferAttribute(a,c),Ia.fromBufferAttribute(a,d),m.uv=Mn.getUV($c,_r,wo,To,Hs,Pl,Ia,new Qe)),l&&(Hs.fromBufferAttribute(l,u),Pl.fromBufferAttribute(l,c),Ia.fromBufferAttribute(l,d),m.uv2=Mn.getUV($c,_r,wo,To,Hs,Pl,Ia,new Qe));const g={a:u,b:c,c:d,normal:new T,materialIndex:0};Mn.getNormal(_r,wo,To,g.normal),m.face=g}return m}ln.prototype.isMesh=!0;class Qr extends Mt{constructor(e=1,t=1,n=1,i=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:o,depthSegments:s};const a=this;i=Math.floor(i),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],c=[],d=[];let f=0,m=0;function g(_,y,w,M,I,F,C,U,N,G,he){const ne=F/N,Z=C/G,Q=F/2,$=C/2,se=U/2,me=N+1,ge=G+1;let de=0,fe=0;const Re=new T;for(let ke=0;ke<ge;ke++){const Be=ke*Z-$;for(let J=0;J<me;J++){const te=J*ne-Q;Re[_]=te*M,Re[y]=Be*I,Re[w]=se,u.push(Re.x,Re.y,Re.z),Re[_]=0,Re[y]=0,Re[w]=U>0?1:-1,c.push(Re.x,Re.y,Re.z),d.push(J/N),d.push(1-ke/G),de+=1}}for(let ke=0;ke<G;ke++)for(let Be=0;Be<N;Be++){const J=f+Be+me*ke,te=f+Be+me*(ke+1),Ae=f+(Be+1)+me*(ke+1),Ne=f+(Be+1)+me*ke;l.push(J,te,Ne),l.push(te,Ae,Ne),fe+=6}a.addGroup(m,fe,he),m+=fe,f+=de}g("z","y","x",-1,-1,n,t,e,s,o,0),g("z","y","x",1,-1,n,t,-e,s,o,1),g("x","z","y",1,1,e,n,t,i,s,2),g("x","z","y",1,-1,e,n,-t,i,s,3),g("x","y","z",1,-1,e,t,n,i,o,4),g("x","y","z",-1,-1,e,t,-n,i,o,5),this.setIndex(l),this.setAttribute("position",new st(u,3)),this.setAttribute("normal",new st(c,3)),this.setAttribute("uv",new st(d,2))}static fromJSON(e){return new Qr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function La(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function Si(r){const e={};for(let t=0;t<r.length;t++){const n=La(r[t]);for(const i in n)e[i]=n[i]}return e}const eo={clone:La,merge:Si};class ki extends vi{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
|
|
85
|
+
*/const X="130",K={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},le={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ee=0,Xe=1,Fe=2,S=3,A=0,O=1,V=2,D=3,z=0,W=1,ee=2,et=1,ft=2,$e=0,ae=1,Ce=2,Ie=3,H=4,be=5,Me=100,Oe=101,Se=102,Ue=103,qe=104,at=200,rt=201,Qt=202,lt=203,en=204,Bt=205,Vt=206,bt=207,Dn=208,wn=209,gn=210,qn=0,yn=1,ai=2,Fi=3,Pi=4,Vi=5,Rr=6,Mp=7,rl=0,Ap=1,Pp=2,uo=0,Cp=1,Rp=2,Ip=3,Lp=4,Op=5,Pu=300,ko=301,ol=302,sl=303,al=304,fa=306,ma=307,Go=1e3,mi=1001,ll=1002,Zn=1003,ul=1004,fc=1004,hl=1005,mc=1005,Jn=1006,Ho=1007,Dp=1007,Ts=1008,Np=1008,zo=1009,Fp=1010,Bp=1011,cl=1012,Up=1013,Ss=1014,ho=1015,Es=1016,kp=1017,Gp=1018,Hp=1019,dn=1020,_n=1021,co=1022,er=1023,zp=1024,gc=1025,Vp=er,Nn=1026,Ms=1027,ga=1028,vc=1029,Cu=1030,tr=1031,_c=1032,yc=1033,Ru=33776,Iu=33777,Lu=33778,Ou=33779,Bi=35840,xc=35841,ji=35842,bc=35843,wc=36196,Wr=37492,va=37496,Du=37808,Tn=37809,po=37810,Nu=37811,jp=37812,Fu=37813,Wp=37814,Tc=37815,dl=37816,As=37817,Xp=37818,Sc=37819,Ec=37820,Bu=37821,Uu=36492,Mc=37840,ku=37841,Gu=37842,Ac=37843,Wi=37844,Hu=37845,_a=37846,Pc=37847,Cc=37848,Yp=37849,qp=37850,Zp=37851,Jp=37852,Ps=37853,zu=2200,Rc=2201,fo=2202,Vo=2300,pl=2301,mo=2302,bi=2400,jo=2401,fl=2402,Cs=2500,we=2501,je=0,Ze=1,ct=2,wt=3e3,$t=3001,zn=3007,nr=3002,xn=3003,ml=3004,Ic=3005,Xi=3006,gl=3200,Lc=3201,pr=0,vl=1,Vu=0,un=7680,xg=7681,$p=7682,ju=7683,bg=34055,wg=34056,Tg=5386,Wu=512,Wo=513,Xu=514,Kp=515,Yu=516,Qp=517,ef=518,_l=519,Rs=35044,Xr=35048,Is=35040,qu=35045,Sg=35049,Eg=35041,Mg=35046,Zu=35050,Ju=35042,Oc="100",Dc="300 es";class go{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const n=this._listeners[e];if(n!==void 0){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const n=t.slice(0);for(let i=0,o=n.length;i<o;i++)n[i].call(this,e);e.target=null}}}const wi=[];for(let r=0;r<256;r++)wi[r]=(r<16?"0":"")+r.toString(16);let $u=1234567;const Sn=Math.PI/180,ni=180/Math.PI;function ir(){const r=4294967295*Math.random()|0,e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(wi[255&r]+wi[r>>8&255]+wi[r>>16&255]+wi[r>>24&255]+"-"+wi[255&e]+wi[e>>8&255]+"-"+wi[e>>16&15|64]+wi[e>>24&255]+"-"+wi[63&t|128]+wi[t>>8&255]+"-"+wi[t>>16&255]+wi[t>>24&255]+wi[255&n]+wi[n>>8&255]+wi[n>>16&255]+wi[n>>24&255]).toUpperCase()}function Ti(r,e,t){return Math.max(e,Math.min(t,r))}function Ku(r,e){return(r%e+e)%e}function yl(r,e,t){return(1-t)*r+t*e}function xl(r){return(r&r-1)==0&&r!==0}function ya(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Qu(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}var Ls=Object.freeze({__proto__:null,DEG2RAD:Sn,RAD2DEG:ni,generateUUID:ir,clamp:Ti,euclideanModulo:Ku,mapLinear:function(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)},inverseLerp:function(r,e,t){return r!==e?(t-r)/(e-r):0},lerp:yl,damp:function(r,e,t,n){return yl(r,e,1-Math.exp(-t*n))},pingpong:function(r,e=1){return e-Math.abs(Ku(r,2*e)-e)},smoothstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e))*r*(3-2*r)},smootherstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e))*r*r*(r*(6*r-15)+10)},randInt:function(r,e){return r+Math.floor(Math.random()*(e-r+1))},randFloat:function(r,e){return r+Math.random()*(e-r)},randFloatSpread:function(r){return r*(.5-Math.random())},seededRandom:function(r){return r!==void 0&&($u=r%2147483647),$u=16807*$u%2147483647,($u-1)/2147483646},degToRad:function(r){return r*Sn},radToDeg:function(r){return r*ni},isPowerOfTwo:xl,ceilPowerOfTwo:ya,floorPowerOfTwo:Qu,setQuaternionFromProperEuler:function(r,e,t,n,i){const o=Math.cos,s=Math.sin,a=o(t/2),l=s(t/2),u=o((e+n)/2),c=s((e+n)/2),d=o((e-n)/2),f=s((e-n)/2),m=o((n-e)/2),g=s((n-e)/2);switch(i){case"XYX":r.set(a*c,l*d,l*f,a*u);break;case"YZY":r.set(l*f,a*c,l*d,a*u);break;case"ZXZ":r.set(l*d,l*f,a*c,a*u);break;case"XZX":r.set(a*c,l*g,l*m,a*u);break;case"YXY":r.set(l*m,a*c,l*g,a*u);break;case"ZYZ":r.set(l*g,l*m,a*c,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}});class Qe{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.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}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),o=this.x-e.x,s=this.y-e.y;return this.x=o*n-s*i+e.x,this.y=o*i+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}Qe.prototype.isVector2=!0;class En{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,o,s,a,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=a,c[3]=t,c[4]=o,c[5]=l,c[6]=n,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,o=this.elements,s=n[0],a=n[3],l=n[6],u=n[1],c=n[4],d=n[7],f=n[2],m=n[5],g=n[8],_=i[0],y=i[3],w=i[6],M=i[1],I=i[4],F=i[7],R=i[2],U=i[5],N=i[8];return o[0]=s*_+a*M+l*R,o[3]=s*y+a*I+l*U,o[6]=s*w+a*F+l*N,o[1]=u*_+c*M+d*R,o[4]=u*y+c*I+d*U,o[7]=u*w+c*F+d*N,o[2]=f*_+m*M+g*R,o[5]=f*y+m*I+g*U,o[8]=f*w+m*F+g*N,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return t*s*c-t*a*u-n*o*c+n*a*l+i*o*u-i*s*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=c*s-a*u,f=a*l-c*o,m=u*o-s*l,g=t*d+n*f+i*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return e[0]=d*_,e[1]=(i*u-c*n)*_,e[2]=(a*n-i*s)*_,e[3]=f*_,e[4]=(c*t-i*l)*_,e[5]=(i*o-a*t)*_,e[6]=m*_,e[7]=(n*l-u*t)*_,e[8]=(s*t-n*o)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,o,s,a){const l=Math.cos(o),u=Math.sin(o);return this.set(n*l,n*u,-n*(l*s+u*a)+s+e,-i*u,i*l,-i*(-u*s+l*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],u=i[4],c=i[7];return i[0]=t*o+n*l,i[3]=t*s+n*u,i[6]=t*a+n*c,i[1]=-n*o+t*l,i[4]=-n*s+t*u,i[7]=-n*a+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let vo;En.prototype.isMatrix3=!0;class fr{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{vo===void 0&&(vo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),vo.width=e.width,vo.height=e.height;const n=vo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=vo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let Ag=0;class $n extends go{constructor(e=$n.DEFAULT_IMAGE,t=$n.DEFAULT_MAPPING,n=mi,i=mi,o=Jn,s=Ts,a=er,l=zo,u=1,c=wt){super(),Object.defineProperty(this,"id",{value:Ag++}),this.uuid=ir(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=o,this.minFilter=s,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=l,this.offset=new Qe(0,0),this.repeat=new Qe(1,1),this.center=new Qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new En,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){const i=this.image;if(i.uuid===void 0&&(i.uuid=ir()),!t&&e.images[i.uuid]===void 0){let o;if(Array.isArray(i)){o=[];for(let s=0,a=i.length;s<a;s++)i[s].isDataTexture?o.push(Nc(i[s].image)):o.push(Nc(i[s]))}else o=Nc(i);e.images[i.uuid]={uuid:i.uuid,url:o}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Pu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Go:e.x=e.x-Math.floor(e.x);break;case mi:e.x=e.x<0?0:1;break;case ll:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Go:e.y=e.y-Math.floor(e.y);break;case mi:e.y=e.y<0?0:1;break;case ll:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}}function Nc(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?fr.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}$n.DEFAULT_IMAGE=void 0,$n.DEFAULT_MAPPING=Pu,$n.prototype.isTexture=!0;class pn{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i+s[12]*o,this.y=s[1]*t+s[5]*n+s[9]*i+s[13]*o,this.z=s[2]*t+s[6]*n+s[10]*i+s[14]*o,this.w=s[3]*t+s[7]*n+s[11]*i+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,o;const s=e.elements,a=s[0],l=s[4],u=s[8],c=s[1],d=s[5],f=s[9],m=s[2],g=s[6],_=s[10];if(Math.abs(l-c)<.01&&Math.abs(u-m)<.01&&Math.abs(f-g)<.01){if(Math.abs(l+c)<.1&&Math.abs(u+m)<.1&&Math.abs(f+g)<.1&&Math.abs(a+d+_-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(a+1)/2,M=(d+1)/2,I=(_+1)/2,F=(l+c)/4,R=(u+m)/4,U=(f+g)/4;return w>M&&w>I?w<.01?(n=0,i=.707106781,o=.707106781):(n=Math.sqrt(w),i=F/n,o=R/n):M>I?M<.01?(n=.707106781,i=0,o=.707106781):(i=Math.sqrt(M),n=F/i,o=U/i):I<.01?(n=.707106781,i=.707106781,o=0):(o=Math.sqrt(I),n=R/o,i=U/o),this.set(n,i,o,t),this}let y=Math.sqrt((g-f)*(g-f)+(u-m)*(u-m)+(c-l)*(c-l));return Math.abs(y)<.001&&(y=1),this.x=(g-f)/y,this.y=(u-m)/y,this.z=(c-l)/y,this.w=Math.acos((a+d+_-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),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.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}pn.prototype.isVector4=!0;class Ir extends go{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new pn(0,0,e,t),this.scissorTest=!1,this.viewport=new pn(0,0,e,t),this.texture=new $n(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=n.generateMipmaps!==void 0&&n.generateMipmaps,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Jn,this.depthBuffer=n.depthBuffer===void 0||n.depthBuffer,this.stencilBuffer=n.stencilBuffer!==void 0&&n.stencilBuffer,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=RT({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Ir.prototype.isWebGLRenderTarget=!0;class bl extends Ir{constructor(e,t,n){super(e,t);const i=this.texture;this.texture=[];for(let o=0;o<n;o++)this.texture[o]=i.clone()}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,o=this.texture.length;i<o;i++)this.texture[i].image.width=e,this.texture[i].image.height=t,this.texture[i].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone();return this}}bl.prototype.isWebGLMultipleRenderTargets=!0;class Os extends Ir{constructor(e,t,n){super(e,t,n),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}Os.prototype.isWebGLMultisampleRenderTarget=!0;class gi{constructor(e=0,t=0,n=0,i=1){this._x=e,this._y=t,this._z=n,this._w=i}static slerp(e,t,n,i){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,i)}static slerpFlat(e,t,n,i,o,s,a){let l=n[i+0],u=n[i+1],c=n[i+2],d=n[i+3];const f=o[s+0],m=o[s+1],g=o[s+2],_=o[s+3];if(a===0)return e[t+0]=l,e[t+1]=u,e[t+2]=c,void(e[t+3]=d);if(a===1)return e[t+0]=f,e[t+1]=m,e[t+2]=g,void(e[t+3]=_);if(d!==_||l!==f||u!==m||c!==g){let y=1-a;const w=l*f+u*m+c*g+d*_,M=w>=0?1:-1,I=1-w*w;if(I>Number.EPSILON){const R=Math.sqrt(I),U=Math.atan2(R,w*M);y=Math.sin(y*U)/R,a=Math.sin(a*U)/R}const F=a*M;if(l=l*y+f*F,u=u*y+m*F,c=c*y+g*F,d=d*y+_*F,y===1-a){const R=1/Math.sqrt(l*l+u*u+c*c+d*d);l*=R,u*=R,c*=R,d*=R}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,i,o,s){const a=n[i],l=n[i+1],u=n[i+2],c=n[i+3],d=o[s],f=o[s+1],m=o[s+2],g=o[s+3];return e[t]=a*g+c*d+l*m-u*f,e[t+1]=l*g+c*f+u*d-a*m,e[t+2]=u*g+c*m+a*f-l*d,e[t+3]=c*g-a*d-l*f-u*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,i=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,u=a(n/2),c=a(i/2),d=a(o/2),f=l(n/2),m=l(i/2),g=l(o/2);switch(s){case"XYZ":this._x=f*c*d+u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d-f*m*g;break;case"YXZ":this._x=f*c*d+u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d+f*m*g;break;case"ZXY":this._x=f*c*d-u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d-f*m*g;break;case"ZYX":this._x=f*c*d-u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d+f*m*g;break;case"YZX":this._x=f*c*d+u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d-f*m*g;break;case"XZY":this._x=f*c*d-u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d+f*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],o=t[8],s=t[1],a=t[5],l=t[9],u=t[2],c=t[6],d=t[10],f=n+a+d;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(c-l)*m,this._y=(o-u)*m,this._z=(s-i)*m}else if(n>a&&n>d){const m=2*Math.sqrt(1+n-a-d);this._w=(c-l)/m,this._x=.25*m,this._y=(i+s)/m,this._z=(o+u)/m}else if(a>d){const m=2*Math.sqrt(1+a-n-d);this._w=(o-u)/m,this._x=(i+s)/m,this._y=.25*m,this._z=(l+c)/m}else{const m=2*Math.sqrt(1+d-n-a);this._w=(s-i)/m,this._x=(o+u)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ti(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,o=e._z,s=e._w,a=t._x,l=t._y,u=t._z,c=t._w;return this._x=n*c+s*a+i*u-o*l,this._y=i*c+s*l+o*a-n*u,this._z=o*c+s*u+n*l-i*a,this._w=s*c-n*a-i*l-o*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,o=this._z,s=this._w;let a=s*e._w+n*e._x+i*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=n,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*s+t*this._w,this._x=m*n+t*this._x,this._y=m*i+t*this._y,this._z=m*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),c=Math.atan2(u,a),d=Math.sin((1-t)*c)/u,f=Math.sin(t*c)/u;return this._w=s*d+this._w*f,this._x=n*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}gi.prototype.isQuaternion=!0;class T{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(wl.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(wl.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*i,this.y=o[1]*t+o[4]*n+o[7]*i,this.z=o[2]*t+o[5]*n+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,o=e.elements,s=1/(o[3]*t+o[7]*n+o[11]*i+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*i+o[12])*s,this.y=(o[1]*t+o[5]*n+o[9]*i+o[13])*s,this.z=(o[2]*t+o[6]*n+o[10]*i+o[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,u=l*t+s*i-a*n,c=l*n+a*t-o*i,d=l*i+o*n-s*t,f=-o*t-s*n-a*i;return this.x=u*l+f*-o+c*-a-d*-s,this.y=c*l+f*-s+d*-o-u*-a,this.z=d*l+f*-a+u*-s-c*-o,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i,this.y=o[1]*t+o[5]*n+o[9]*i,this.z=o[2]*t+o[6]*n+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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}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.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,o=e.z,s=t.x,a=t.y,l=t.z;return this.x=i*l-o*a,this.y=o*s-n*l,this.z=n*a-i*s,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Xo.copy(this).projectOnVector(e),this.sub(Xo)}reflect(e){return this.sub(Xo.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Ti(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}T.prototype.isVector3=!0;const Xo=new T,wl=new gi;class In{constructor(e=new T(1/0,1/0,1/0),t=new T(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=e.length;l<u;l+=3){const c=e[l],d=e[l+1],f=e[l+2];c<t&&(t=c),d<n&&(n=d),f<i&&(i=f),c>o&&(o=c),d>s&&(s=d),f>a&&(a=f)}return this.min.set(t,n,i),this.max.set(o,s,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=e.count;l<u;l++){const c=e.getX(l),d=e.getY(l),f=e.getZ(l);c<t&&(t=c),d<n&&(n=d),f<i&&(i=f),c>o&&(o=c),d>s&&(s=d),f>a&&(a=f)}return this.min.set(t,n,i),this.max.set(o,s,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Lr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;t!==void 0&&(t.boundingBox===null&&t.computeBoundingBox(),Or.copy(t.boundingBox),Or.applyMatrix4(e.matrixWorld),this.union(Or));const n=e.children;for(let i=0,o=n.length;i<o;i++)this.expandByObject(n[i]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Lr),Lr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Tl),xa.subVectors(this.max,Tl),Yi.subVectors(e.a,Tl),mr.subVectors(e.b,Tl),Ci.subVectors(e.c,Tl),_o.subVectors(mr,Yi),yo.subVectors(Ci,mr),Ds.subVectors(Yi,Ci);let t=[0,-_o.z,_o.y,0,-yo.z,yo.y,0,-Ds.z,Ds.y,_o.z,0,-_o.x,yo.z,0,-yo.x,Ds.z,0,-Ds.x,-_o.y,_o.x,0,-yo.y,yo.x,0,-Ds.y,Ds.x,0];return!!Fc(t,Yi,mr,Ci,xa)&&(t=[1,0,0,0,1,0,0,0,1],!!Fc(t,Yi,mr,Ci,xa)&&(Yo.crossVectors(_o,yo),t=[Yo.x,Yo.y,Yo.z],Fc(t,Yi,mr,Ci,xa)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Lr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Lr).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Ht[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ht[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ht[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ht[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ht[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ht[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ht[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ht[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ht)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}In.prototype.isBox3=!0;const Ht=[new T,new T,new T,new T,new T,new T,new T,new T],Lr=new T,Or=new In,Yi=new T,mr=new T,Ci=new T,_o=new T,yo=new T,Ds=new T,Tl=new T,xa=new T,Yo=new T,Yr=new T;function Fc(r,e,t,n,i){for(let o=0,s=r.length-3;o<=s;o+=3){Yr.fromArray(r,o);const a=i.x*Math.abs(Yr.x)+i.y*Math.abs(Yr.y)+i.z*Math.abs(Yr.z),l=e.dot(Yr),u=t.dot(Yr),c=n.dot(Yr);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>a)return!1}return!0}const tf=new In,qr=new T,Sl=new T,xo=new T;class li{constructor(e=new T,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):tf.setFromPoints(e).getCenter(n);let i=0;for(let o=0,s=e.length;o<s;o++)i=Math.max(i,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){xo.subVectors(e,this.center);const t=xo.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=.5*(n-this.radius);this.center.add(xo.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return Sl.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(qr.copy(e.center).add(Sl)),this.expandByPoint(qr.copy(e.center).sub(Sl)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Zr=new T,eh=new T,qo=new T,Ui=new T,th=new T,nh=new T,ba=new T;class bo{constructor(e=new T,t=new T(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Zr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Zr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Zr.copy(this.direction).multiplyScalar(t).add(this.origin),Zr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){eh.copy(e).add(t).multiplyScalar(.5),qo.copy(t).sub(e).normalize(),Ui.copy(this.origin).sub(eh);const o=.5*e.distanceTo(t),s=-this.direction.dot(qo),a=Ui.dot(this.direction),l=-Ui.dot(qo),u=Ui.lengthSq(),c=Math.abs(1-s*s);let d,f,m,g;if(c>0)if(d=s*l-a,f=s*a-l,g=o*c,d>=0)if(f>=-g)if(f<=g){const _=1/c;d*=_,f*=_,m=d*(d+s*f+2*a)+f*(s*d+f+2*l)+u}else f=o,d=Math.max(0,-(s*f+a)),m=-d*d+f*(f+2*l)+u;else f=-o,d=Math.max(0,-(s*f+a)),m=-d*d+f*(f+2*l)+u;else f<=-g?(d=Math.max(0,-(-s*o+a)),f=d>0?-o:Math.min(Math.max(-o,-l),o),m=-d*d+f*(f+2*l)+u):f<=g?(d=0,f=Math.min(Math.max(-o,-l),o),m=f*(f+2*l)+u):(d=Math.max(0,-(s*o+a)),f=d>0?o:Math.min(Math.max(-o,-l),o),m=-d*d+f*(f+2*l)+u);else f=s>0?-o:o,d=Math.max(0,-(s*f+a)),m=-d*d+f*(f+2*l)+u;return n&&n.copy(this.direction).multiplyScalar(d).add(this.origin),i&&i.copy(qo).multiplyScalar(f).add(eh),m}intersectSphere(e,t){Zr.subVectors(e.center,this.origin);const n=Zr.dot(this.direction),i=Zr.dot(Zr)-n*n,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=n-s,l=n+s;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0?!0:e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,o,s,a,l;const u=1/this.direction.x,c=1/this.direction.y,d=1/this.direction.z,f=this.origin;return u>=0?(n=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(n=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(o=(e.min.y-f.y)*c,s=(e.max.y-f.y)*c):(o=(e.max.y-f.y)*c,s=(e.min.y-f.y)*c),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),d>=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),n>l||a>i?null:((a>n||n!=n)&&(n=a),(l<i||i!=i)&&(i=l),i<0?null:this.at(n>=0?n:i,t)))}intersectsBox(e){return this.intersectBox(e,Zr)!==null}intersectTriangle(e,t,n,i,o){th.subVectors(t,e),nh.subVectors(n,e),ba.crossVectors(th,nh);let s,a=this.direction.dot(ba);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Ui.subVectors(this.origin,e);const l=s*this.direction.dot(nh.crossVectors(Ui,nh));if(l<0)return null;const u=s*this.direction.dot(th.cross(Ui));if(u<0||l+u>a)return null;const c=-s*Ui.dot(ba);return c<0?null:this.at(c/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class pt{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,o,s,a,l,u,c,d,f,m,g,_,y){const w=this.elements;return w[0]=e,w[4]=t,w[8]=n,w[12]=i,w[1]=o,w[5]=s,w[9]=a,w[13]=l,w[2]=u,w[6]=c,w[10]=d,w[14]=f,w[3]=m,w[7]=g,w[11]=_,w[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new pt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Zo.setFromMatrixColumn(e,0).length(),o=1/Zo.setFromMatrixColumn(e,1).length(),s=1/Zo.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,i=e.y,o=e.z,s=Math.cos(n),a=Math.sin(n),l=Math.cos(i),u=Math.sin(i),c=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=s*c,m=s*d,g=a*c,_=a*d;t[0]=l*c,t[4]=-l*d,t[8]=u,t[1]=m+g*u,t[5]=f-_*u,t[9]=-a*l,t[2]=_-f*u,t[6]=g+m*u,t[10]=s*l}else if(e.order==="YXZ"){const f=l*c,m=l*d,g=u*c,_=u*d;t[0]=f+_*a,t[4]=g*a-m,t[8]=s*u,t[1]=s*d,t[5]=s*c,t[9]=-a,t[2]=m*a-g,t[6]=_+f*a,t[10]=s*l}else if(e.order==="ZXY"){const f=l*c,m=l*d,g=u*c,_=u*d;t[0]=f-_*a,t[4]=-s*d,t[8]=g+m*a,t[1]=m+g*a,t[5]=s*c,t[9]=_-f*a,t[2]=-s*u,t[6]=a,t[10]=s*l}else if(e.order==="ZYX"){const f=s*c,m=s*d,g=a*c,_=a*d;t[0]=l*c,t[4]=g*u-m,t[8]=f*u+_,t[1]=l*d,t[5]=_*u+f,t[9]=m*u-g,t[2]=-u,t[6]=a*l,t[10]=s*l}else if(e.order==="YZX"){const f=s*l,m=s*u,g=a*l,_=a*u;t[0]=l*c,t[4]=_-f*d,t[8]=g*d+m,t[1]=d,t[5]=s*c,t[9]=-a*c,t[2]=-u*c,t[6]=m*d+g,t[10]=f-_*d}else if(e.order==="XZY"){const f=s*l,m=s*u,g=a*l,_=a*u;t[0]=l*c,t[4]=-d,t[8]=u*c,t[1]=f*d+_,t[5]=s*c,t[9]=m*d-g,t[2]=g*d-m,t[6]=a*c,t[10]=_*d+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Jr,e,Bc)}lookAt(e,t,n){const i=this.elements;return qi.subVectors(e,t),qi.lengthSq()===0&&(qi.z=1),qi.normalize(),Dr.crossVectors(n,qi),Dr.lengthSq()===0&&(Math.abs(n.z)===1?qi.x+=1e-4:qi.z+=1e-4,qi.normalize(),Dr.crossVectors(n,qi)),Dr.normalize(),$r.crossVectors(qi,Dr),i[0]=Dr.x,i[4]=$r.x,i[8]=qi.x,i[1]=Dr.y,i[5]=$r.y,i[9]=qi.y,i[2]=Dr.z,i[6]=$r.z,i[10]=qi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,o=this.elements,s=n[0],a=n[4],l=n[8],u=n[12],c=n[1],d=n[5],f=n[9],m=n[13],g=n[2],_=n[6],y=n[10],w=n[14],M=n[3],I=n[7],F=n[11],R=n[15],U=i[0],N=i[4],G=i[8],he=i[12],ne=i[1],Z=i[5],Q=i[9],$=i[13],se=i[2],me=i[6],ge=i[10],de=i[14],fe=i[3],Re=i[7],ke=i[11],Be=i[15];return o[0]=s*U+a*ne+l*se+u*fe,o[4]=s*N+a*Z+l*me+u*Re,o[8]=s*G+a*Q+l*ge+u*ke,o[12]=s*he+a*$+l*de+u*Be,o[1]=c*U+d*ne+f*se+m*fe,o[5]=c*N+d*Z+f*me+m*Re,o[9]=c*G+d*Q+f*ge+m*ke,o[13]=c*he+d*$+f*de+m*Be,o[2]=g*U+_*ne+y*se+w*fe,o[6]=g*N+_*Z+y*me+w*Re,o[10]=g*G+_*Q+y*ge+w*ke,o[14]=g*he+_*$+y*de+w*Be,o[3]=M*U+I*ne+F*se+R*fe,o[7]=M*N+I*Z+F*me+R*Re,o[11]=M*G+I*Q+F*ge+R*ke,o[15]=M*he+I*$+F*de+R*Be,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],u=e[13],c=e[2],d=e[6],f=e[10],m=e[14];return e[3]*(+o*l*d-i*u*d-o*a*f+n*u*f+i*a*m-n*l*m)+e[7]*(+t*l*m-t*u*f+o*s*f-i*s*m+i*u*c-o*l*c)+e[11]*(+t*u*d-t*a*m-o*s*d+n*s*m+o*a*c-n*u*c)+e[15]*(-i*a*c-t*l*d+t*a*f+i*s*d-n*s*f+n*l*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],m=e[11],g=e[12],_=e[13],y=e[14],w=e[15],M=d*y*u-_*f*u+_*l*m-a*y*m-d*l*w+a*f*w,I=g*f*u-c*y*u-g*l*m+s*y*m+c*l*w-s*f*w,F=c*_*u-g*d*u+g*a*m-s*_*m-c*a*w+s*d*w,R=g*d*l-c*_*l-g*a*f+s*_*f+c*a*y-s*d*y,U=t*M+n*I+i*F+o*R;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/U;return e[0]=M*N,e[1]=(_*f*o-d*y*o-_*i*m+n*y*m+d*i*w-n*f*w)*N,e[2]=(a*y*o-_*l*o+_*i*u-n*y*u-a*i*w+n*l*w)*N,e[3]=(d*l*o-a*f*o-d*i*u+n*f*u+a*i*m-n*l*m)*N,e[4]=I*N,e[5]=(c*y*o-g*f*o+g*i*m-t*y*m-c*i*w+t*f*w)*N,e[6]=(g*l*o-s*y*o-g*i*u+t*y*u+s*i*w-t*l*w)*N,e[7]=(s*f*o-c*l*o+c*i*u-t*f*u-s*i*m+t*l*m)*N,e[8]=F*N,e[9]=(g*d*o-c*_*o-g*n*m+t*_*m+c*n*w-t*d*w)*N,e[10]=(s*_*o-g*a*o+g*n*u-t*_*u-s*n*w+t*a*w)*N,e[11]=(c*a*o-s*d*o-c*n*u+t*d*u+s*n*m-t*a*m)*N,e[12]=R*N,e[13]=(c*_*i-g*d*i+g*n*f-t*_*f-c*n*y+t*d*y)*N,e[14]=(g*a*i-s*_*i-g*n*l+t*_*l+s*n*y-t*a*y)*N,e[15]=(s*d*i-c*a*i+c*n*l-t*d*l-s*n*f+t*a*f)*N,this}scale(e){const t=this.elements,n=e.x,i=e.y,o=e.z;return t[0]*=n,t[4]*=i,t[8]*=o,t[1]*=n,t[5]*=i,t[9]*=o,t[2]*=n,t[6]*=i,t[10]*=o,t[3]*=n,t[7]*=i,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),o=1-n,s=e.x,a=e.y,l=e.z,u=o*s,c=o*a;return this.set(u*s+n,u*a-i*l,u*l+i*a,0,u*a+i*l,c*a+n,c*l-i*s,0,u*l-i*a,c*l+i*s,o*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,o,s){return this.set(1,n,o,0,e,1,s,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,o=t._x,s=t._y,a=t._z,l=t._w,u=o+o,c=s+s,d=a+a,f=o*u,m=o*c,g=o*d,_=s*c,y=s*d,w=a*d,M=l*u,I=l*c,F=l*d,R=n.x,U=n.y,N=n.z;return i[0]=(1-(_+w))*R,i[1]=(m+F)*R,i[2]=(g-I)*R,i[3]=0,i[4]=(m-F)*U,i[5]=(1-(f+w))*U,i[6]=(y+M)*U,i[7]=0,i[8]=(g+I)*N,i[9]=(y-M)*N,i[10]=(1-(f+_))*N,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let o=Zo.set(i[0],i[1],i[2]).length();const s=Zo.set(i[4],i[5],i[6]).length(),a=Zo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],gr.copy(this);const l=1/o,u=1/s,c=1/a;return gr.elements[0]*=l,gr.elements[1]*=l,gr.elements[2]*=l,gr.elements[4]*=u,gr.elements[5]*=u,gr.elements[6]*=u,gr.elements[8]*=c,gr.elements[9]*=c,gr.elements[10]*=c,t.setFromRotationMatrix(gr),n.x=o,n.y=s,n.z=a,this}makePerspective(e,t,n,i,o,s){s===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,l=2*o/(t-e),u=2*o/(n-i),c=(t+e)/(t-e),d=(n+i)/(n-i),f=-(s+o)/(s-o),m=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=f,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,o,s){const a=this.elements,l=1/(t-e),u=1/(n-i),c=1/(s-o),d=(t+e)*l,f=(n+i)*u,m=(s+o)*c;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-f,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-m,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}pt.prototype.isMatrix4=!0;const Zo=new T,gr=new pt,Jr=new T(0,0,0),Bc=new T(1,1,1),Dr=new T,$r=new T,qi=new T,Ri=new pt,ih=new gi;class Ns{constructor(e=0,t=0,n=0,i=Ns.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,o=i[0],s=i[4],a=i[8],l=i[1],u=i[5],c=i[9],d=i[2],f=i[6],m=i[10];switch(t){case"XYZ":this._y=Math.asin(Ti(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,m),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Ti(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(Ti(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Ti(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Ti(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-Ti(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Ri.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ri,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ih.setFromEuler(this),this.setFromQuaternion(ih,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new T(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Ns.prototype.isEuler=!0,Ns.DefaultOrder="XYZ",Ns.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Uc{constructor(){this.mask=1}set(e){this.mask=1<<e|0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!=0}}let kc=0;const wa=new T,Fs=new gi,rr=new pt,Ta=new T,Sa=new T,nf=new T,Gc=new gi,rf=new T(1,0,0),rh=new T(0,1,0),Hc=new T(0,0,1),of={type:"added"},zc={type:"removed"};class Xt extends go{constructor(){super(),Object.defineProperty(this,"id",{value:kc++}),this.uuid=ir(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Xt.DefaultUp.clone();const e=new T,t=new Ns,n=new gi,i=new T(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new pt},normalMatrix:{value:new En}}),this.matrix=new pt,this.matrixWorld=new pt,this.matrixAutoUpdate=Xt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Uc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Fs.setFromAxisAngle(e,t),this.quaternion.multiply(Fs),this}rotateOnWorldAxis(e,t){return Fs.setFromAxisAngle(e,t),this.quaternion.premultiply(Fs),this}rotateX(e){return this.rotateOnAxis(rf,e)}rotateY(e){return this.rotateOnAxis(rh,e)}rotateZ(e){return this.rotateOnAxis(Hc,e)}translateOnAxis(e,t){return wa.copy(e).applyQuaternion(this.quaternion),this.position.add(wa.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(rf,e)}translateY(e){return this.translateOnAxis(rh,e)}translateZ(e){return this.translateOnAxis(Hc,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(rr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ta.copy(e):Ta.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Sa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?rr.lookAt(Sa,Ta,this.up):rr.lookAt(Ta,Sa,this.up),this.quaternion.setFromRotationMatrix(rr),i&&(rr.extractRotation(i.matrixWorld),Fs.setFromRotationMatrix(rr),this.quaternion.premultiply(Fs.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(of)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(zc)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(zc)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),rr.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),rr.multiply(e.parent.matrixWorld)),e.applyMatrix4(rr),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Sa,e,nf),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Sa,Gc,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let o=0,s=i.length;o<s;o++)i[o].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u<c;u++){const d=l[u];o(e.shapes,d)}else o(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,u=this.material.length;l<u;l++)a.push(o(e.materials,this.material[l]));i.material=a}else i.material=o(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];i.animations.push(o(e.animations,l))}}if(t){const a=s(e.geometries),l=s(e.materials),u=s(e.textures),c=s(e.images),d=s(e.shapes),f=s(e.skeletons),m=s(e.animations);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),u.length>0&&(n.textures=u),c.length>0&&(n.images=c),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),m.length>0&&(n.animations=m)}return n.object=i,n;function s(a){const l=[];for(const u in a){const c=a[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Xt.DefaultUp=new T(0,1,0),Xt.DefaultMatrixAutoUpdate=!0,Xt.prototype.isObject3D=!0;const vr=new T,Kr=new T,oh=new T,Nr=new T,Bs=new T,Jo=new T,sh=new T,Yt=new T,Vc=new T,jc=new T;class Mn{constructor(e=new T,t=new T,n=new T){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),vr.subVectors(e,t),i.cross(vr);const o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,t,n,i,o){vr.subVectors(i,t),Kr.subVectors(n,t),oh.subVectors(e,t);const s=vr.dot(vr),a=vr.dot(Kr),l=vr.dot(oh),u=Kr.dot(Kr),c=Kr.dot(oh),d=s*u-a*a;if(d===0)return o.set(-2,-1,-1);const f=1/d,m=(u*l-a*c)*f,g=(s*c-a*l)*f;return o.set(1-m-g,g,m)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Nr),Nr.x>=0&&Nr.y>=0&&Nr.x+Nr.y<=1}static getUV(e,t,n,i,o,s,a,l){return this.getBarycoord(e,t,n,i,Nr),l.set(0,0),l.addScaledVector(o,Nr.x),l.addScaledVector(s,Nr.y),l.addScaledVector(a,Nr.z),l}static isFrontFacing(e,t,n,i){return vr.subVectors(n,t),Kr.subVectors(e,t),vr.cross(Kr).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return vr.subVectors(this.c,this.b),Kr.subVectors(this.a,this.b),.5*vr.cross(Kr).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Mn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Mn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,o){return Mn.getUV(e,this.a,this.b,this.c,t,n,i,o)}containsPoint(e){return Mn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Mn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,o=this.c;let s,a;Bs.subVectors(i,n),Jo.subVectors(o,n),Yt.subVectors(e,n);const l=Bs.dot(Yt),u=Jo.dot(Yt);if(l<=0&&u<=0)return t.copy(n);Vc.subVectors(e,i);const c=Bs.dot(Vc),d=Jo.dot(Vc);if(c>=0&&d<=c)return t.copy(i);const f=l*d-c*u;if(f<=0&&l>=0&&c<=0)return s=l/(l-c),t.copy(n).addScaledVector(Bs,s);jc.subVectors(e,o);const m=Bs.dot(jc),g=Jo.dot(jc);if(g>=0&&m<=g)return t.copy(o);const _=m*u-l*g;if(_<=0&&u>=0&&g<=0)return a=u/(u-g),t.copy(n).addScaledVector(Jo,a);const y=c*g-m*d;if(y<=0&&d-c>=0&&m-g>=0)return sh.subVectors(o,i),a=(d-c)/(d-c+(m-g)),t.copy(i).addScaledVector(sh,a);const w=1/(y+_+f);return s=_*w,a=f*w,t.copy(n).addScaledVector(Bs,s).addScaledVector(Jo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let sf=0;class vi extends go{constructor(){super(),Object.defineProperty(this,"id",{value:sf++}),this.uuid=ir(),this.name="",this.type="Material",this.fog=!0,this.blending=ae,this.side=z,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=en,this.blendDst=Bt,this.blendEquation=Me,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Fi,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_l,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=un,this.stencilZFail=un,this.stencilZPass=un,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===et;continue}const i=this[t];i!==void 0?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ae&&(n.blending=this.blending),this.side!==z&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),t){const o=i(e.textures),s=i(e.images);o.length>0&&(n.textures=o),s.length>0&&(n.images=s)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let o=0;o!==i;++o)n[o]=t[o].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}vi.prototype.isMaterial=!0;const af={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},Vn={h:0,s:0,l:0},ah={h:0,s:0,l:0};function Ea(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+6*(e-r)*t:t<.5?e:t<2/3?r+6*(e-r)*(2/3-t):r}function El(r){return r<.04045?.0773993808*r:Math.pow(.9478672986*r+.0521327014,2.4)}function lh(r){return r<.0031308?12.92*r:1.055*Math.pow(r,.41666)-.055}class gt{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=Ku(e,1),t=Ti(t,0,1),n=Ti(n,0,1),t===0)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,o=2*n-i;this.r=Ea(o,i,e+1/3),this.g=Ea(o,i,e),this.b=Ea(o,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i;const o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,u=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,u)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=n[1],o=i.length;if(o===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(o===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=af[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=El(e.r),this.g=El(e.g),this.b=El(e.b),this}copyLinearToSRGB(e){return this.r=lh(e.r),this.g=lh(e.g),this.b=lh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,n=this.g,i=this.b,o=Math.max(t,n,i),s=Math.min(t,n,i);let a,l;const u=(s+o)/2;if(s===o)a=0,l=0;else{const c=o-s;switch(l=u<=.5?c/(o+s):c/(2-o-s),o){case t:a=(n-i)/c+(n<i?6:0);break;case n:a=(i-t)/c+2;break;case i:a=(t-n)/c+4}a/=6}return e.h=a,e.s=l,e.l=u,e}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(e,t,n){return this.getHSL(Vn),Vn.h+=e,Vn.s+=t,Vn.l+=n,this.setHSL(Vn.h,Vn.s,Vn.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Vn),e.getHSL(ah);const n=yl(Vn.h,ah.h,t),i=yl(Vn.s,ah.s,t),o=yl(Vn.l,ah.l,t);return this.setHSL(n,i,o),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),e.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}gt.NAMES=af,gt.prototype.isColor=!0,gt.prototype.r=1,gt.prototype.g=1,gt.prototype.b=1;class Kn extends vi{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new gt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=rl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this}}Kn.prototype.isMeshBasicMaterial=!0;const an=new T,Ma=new Qe;class Zt{constructor(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n===!0,this.usage=Rs,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,o=this.itemSize;i<o;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),s=new gt),t[n++]=s.r,t[n++]=s.g,t[n++]=s.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),s=new Qe),t[n++]=s.x,t[n++]=s.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),s=new T),t[n++]=s.x,t[n++]=s.y,t[n++]=s.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),s=new pn),t[n++]=s.x,t[n++]=s.y,t[n++]=s.z,t[n++]=s.w}return this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Ma.fromBufferAttribute(this,t),Ma.applyMatrix3(e),this.setXY(t,Ma.x,Ma.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)an.fromBufferAttribute(this,t),an.applyMatrix3(e),this.setXYZ(t,an.x,an.y,an.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)an.x=this.getX(t),an.y=this.getY(t),an.z=this.getZ(t),an.applyMatrix4(e),this.setXYZ(t,an.x,an.y,an.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)an.x=this.getX(t),an.y=this.getY(t),an.z=this.getZ(t),an.applyNormalMatrix(e),this.setXYZ(t,an.x,an.y,an.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)an.x=this.getX(t),an.y=this.getY(t),an.z=this.getZ(t),an.transformDirection(e),this.setXYZ(t,an.x,an.y,an.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,o){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=o,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Rs&&(e.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(e.updateRange=this.updateRange),e}}Zt.prototype.isBufferAttribute=!0;class Ml extends Zt{constructor(e,t,n){super(new Int8Array(e),t,n)}}class Wc extends Zt{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class uh extends Zt{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class Xc extends Zt{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Aa extends Zt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class hh extends Zt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Fr extends Zt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class lf extends Zt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}lf.prototype.isFloat16BufferAttribute=!0;class st extends Zt{constructor(e,t,n){super(new Float32Array(e),t,n)}}class Yc extends Zt{constructor(e,t,n){super(new Float64Array(e),t,n)}}function qc(r){if(r.length===0)return-1/0;let e=r[0];for(let t=1,n=r.length;t<n;++t)r[t]>e&&(e=r[t]);return e}const Zc={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Us(r,e){return new Zc[r](e)}let uf=0;const or=new pt,ch=new Xt,ui=new T,jn=new In,$o=new In,Fn=new T;class Mt extends go{constructor(){super(),Object.defineProperty(this,"id",{value:uf++}),this.uuid=ir(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(qc(e)>65535?Fr:Aa)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const o=new En().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return or.makeRotationFromQuaternion(e),this.applyMatrix4(or),this}rotateX(e){return or.makeRotationX(e),this.applyMatrix4(or),this}rotateY(e){return or.makeRotationY(e),this.applyMatrix4(or),this}rotateZ(e){return or.makeRotationZ(e),this.applyMatrix4(or),this}translate(e,t,n){return or.makeTranslation(e,t,n),this.applyMatrix4(or),this}scale(e,t,n){return or.makeScale(e,t,n),this.applyMatrix4(or),this}lookAt(e){return ch.lookAt(e),ch.updateMatrix(),this.applyMatrix4(ch.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ui).negate(),this.translate(ui.x,ui.y,ui.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const o=e[n];t.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new st(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new In);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new T(-1/0,-1/0,-1/0),new T(1/0,1/0,1/0));if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const o=t[n];jn.setFromBufferAttribute(o),this.morphTargetsRelative?(Fn.addVectors(this.boundingBox.min,jn.min),this.boundingBox.expandByPoint(Fn),Fn.addVectors(this.boundingBox.max,jn.max),this.boundingBox.expandByPoint(Fn)):(this.boundingBox.expandByPoint(jn.min),this.boundingBox.expandByPoint(jn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new li);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new T,1/0);if(e){const n=this.boundingSphere.center;if(jn.setFromBufferAttribute(e),t)for(let o=0,s=t.length;o<s;o++){const a=t[o];$o.setFromBufferAttribute(a),this.morphTargetsRelative?(Fn.addVectors(jn.min,$o.min),jn.expandByPoint(Fn),Fn.addVectors(jn.max,$o.max),jn.expandByPoint(Fn)):(jn.expandByPoint($o.min),jn.expandByPoint($o.max))}jn.getCenter(n);let i=0;for(let o=0,s=e.count;o<s;o++)Fn.fromBufferAttribute(e,o),i=Math.max(i,n.distanceToSquared(Fn));if(t)for(let o=0,s=t.length;o<s;o++){const a=t[o],l=this.morphTargetsRelative;for(let u=0,c=a.count;u<c;u++)Fn.fromBufferAttribute(a,u),l&&(ui.fromBufferAttribute(e,u),Fn.add(ui)),i=Math.max(i,n.distanceToSquared(Fn))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeFaceNormals(){}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,i=t.position.array,o=t.normal.array,s=t.uv.array,a=i.length/3;t.tangent===void 0&&this.setAttribute("tangent",new Zt(new Float32Array(4*a),4));const l=t.tangent.array,u=[],c=[];for(let ne=0;ne<a;ne++)u[ne]=new T,c[ne]=new T;const d=new T,f=new T,m=new T,g=new Qe,_=new Qe,y=new Qe,w=new T,M=new T;function I(ne,Z,Q){d.fromArray(i,3*ne),f.fromArray(i,3*Z),m.fromArray(i,3*Q),g.fromArray(s,2*ne),_.fromArray(s,2*Z),y.fromArray(s,2*Q),f.sub(d),m.sub(d),_.sub(g),y.sub(g);const $=1/(_.x*y.y-y.x*_.y);isFinite($)&&(w.copy(f).multiplyScalar(y.y).addScaledVector(m,-_.y).multiplyScalar($),M.copy(m).multiplyScalar(_.x).addScaledVector(f,-y.x).multiplyScalar($),u[ne].add(w),u[Z].add(w),u[Q].add(w),c[ne].add(M),c[Z].add(M),c[Q].add(M))}let F=this.groups;F.length===0&&(F=[{start:0,count:n.length}]);for(let ne=0,Z=F.length;ne<Z;++ne){const Q=F[ne],$=Q.start;for(let se=$,me=$+Q.count;se<me;se+=3)I(n[se+0],n[se+1],n[se+2])}const R=new T,U=new T,N=new T,G=new T;function he(ne){N.fromArray(o,3*ne),G.copy(N);const Z=u[ne];R.copy(Z),R.sub(N.multiplyScalar(N.dot(Z))).normalize(),U.crossVectors(G,Z);const Q=U.dot(c[ne])<0?-1:1;l[4*ne]=R.x,l[4*ne+1]=R.y,l[4*ne+2]=R.z,l[4*ne+3]=Q}for(let ne=0,Z=F.length;ne<Z;++ne){const Q=F[ne],$=Q.start;for(let se=$,me=$+Q.count;se<me;se+=3)he(n[se+0]),he(n[se+1]),he(n[se+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Zt(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let f=0,m=n.count;f<m;f++)n.setXYZ(f,0,0,0);const i=new T,o=new T,s=new T,a=new T,l=new T,u=new T,c=new T,d=new T;if(e)for(let f=0,m=e.count;f<m;f+=3){const g=e.getX(f+0),_=e.getX(f+1),y=e.getX(f+2);i.fromBufferAttribute(t,g),o.fromBufferAttribute(t,_),s.fromBufferAttribute(t,y),c.subVectors(s,o),d.subVectors(i,o),c.cross(d),a.fromBufferAttribute(n,g),l.fromBufferAttribute(n,_),u.fromBufferAttribute(n,y),a.add(c),l.add(c),u.add(c),n.setXYZ(g,a.x,a.y,a.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(y,u.x,u.y,u.z)}else for(let f=0,m=t.count;f<m;f+=3)i.fromBufferAttribute(t,f+0),o.fromBufferAttribute(t,f+1),s.fromBufferAttribute(t,f+2),c.subVectors(s,o),d.subVectors(i,o),c.cross(d),n.setXYZ(f+0,c.x,c.y,c.z),n.setXYZ(f+1,c.x,c.y,c.z),n.setXYZ(f+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);t===void 0&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const i in n){if(e.attributes[i]===void 0)continue;const o=n[i].array,s=e.attributes[i],a=s.array,l=s.itemSize*t,u=Math.min(a.length,o.length-l);for(let c=0,d=l;c<u;c++,d++)o[d]=a[c]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Fn.fromBufferAttribute(e,t),Fn.normalize(),e.setXYZ(t,Fn.x,Fn.y,Fn.z)}toNonIndexed(){function e(a,l){const u=a.array,c=a.itemSize,d=a.normalized,f=new u.constructor(l.length*c);let m=0,g=0;for(let _=0,y=l.length;_<y;_++){m=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*c;for(let w=0;w<c;w++)f[g++]=u[m++]}return new Zt(f,c,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Mt,n=this.index.array,i=this.attributes;for(const a in i){const l=e(i[a],n);t.setAttribute(a,l)}const o=this.morphAttributes;for(const a in o){const l=[],u=o[a];for(let c=0,d=u.length;c<d;c++){const f=e(u[c],n);l.push(f)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,l=s.length;a<l;a++){const u=s[a];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const u=n[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let d=0,f=u.length;d<f;d++){const m=u[d];c.push(m.toJSON(e.data))}c.length>0&&(i[l]=c,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new Mt().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(t))}const o=e.morphAttributes;for(const u in o){const c=[],d=o[u];for(let f=0,m=d.length;f<m;f++)c.push(d[f].clone(t));this.morphAttributes[u]=c}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let u=0,c=s.length;u<c;u++){const d=s[u];this.addGroup(d.start,d.count,d.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}Mt.prototype.isBufferGeometry=!0;const Jc=new pt,ks=new bo,Ko=new li,_r=new T,wo=new T,To=new T,Pa=new T,dh=new T,Ca=new T,Ra=new T,Gs=new T,Al=new T,Hs=new Qe,Pl=new Qe,Ia=new Qe,$c=new T,Cl=new T;class ln extends Xt{constructor(e=new Mt,t=new Kn){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o<s;o++){const a=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,i=this.material,o=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),Ko.copy(n.boundingSphere),Ko.applyMatrix4(o),e.ray.intersectsSphere(Ko)===!1)||(Jc.copy(o).invert(),ks.copy(e.ray).applyMatrix4(Jc),n.boundingBox!==null&&ks.intersectsBox(n.boundingBox)===!1))return;let s;if(n.isBufferGeometry){const a=n.index,l=n.attributes.position,u=n.morphAttributes.position,c=n.morphTargetsRelative,d=n.attributes.uv,f=n.attributes.uv2,m=n.groups,g=n.drawRange;if(a!==null)if(Array.isArray(i))for(let _=0,y=m.length;_<y;_++){const w=m[_],M=i[w.materialIndex];for(let I=Math.max(w.start,g.start),F=Math.min(w.start+w.count,g.start+g.count);I<F;I+=3){const R=a.getX(I),U=a.getX(I+1),N=a.getX(I+2);s=Rl(this,M,e,ks,l,u,c,d,f,R,U,N),s&&(s.faceIndex=Math.floor(I/3),s.face.materialIndex=w.materialIndex,t.push(s))}}else for(let _=Math.max(0,g.start),y=Math.min(a.count,g.start+g.count);_<y;_+=3){const w=a.getX(_),M=a.getX(_+1),I=a.getX(_+2);s=Rl(this,i,e,ks,l,u,c,d,f,w,M,I),s&&(s.faceIndex=Math.floor(_/3),t.push(s))}else if(l!==void 0)if(Array.isArray(i))for(let _=0,y=m.length;_<y;_++){const w=m[_],M=i[w.materialIndex];for(let I=Math.max(w.start,g.start),F=Math.min(w.start+w.count,g.start+g.count);I<F;I+=3)s=Rl(this,M,e,ks,l,u,c,d,f,I,I+1,I+2),s&&(s.faceIndex=Math.floor(I/3),s.face.materialIndex=w.materialIndex,t.push(s))}else for(let _=Math.max(0,g.start),y=Math.min(l.count,g.start+g.count);_<y;_+=3)s=Rl(this,i,e,ks,l,u,c,d,f,_,_+1,_+2),s&&(s.faceIndex=Math.floor(_/3),t.push(s))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function Rl(r,e,t,n,i,o,s,a,l,u,c,d){_r.fromBufferAttribute(i,u),wo.fromBufferAttribute(i,c),To.fromBufferAttribute(i,d);const f=r.morphTargetInfluences;if(e.morphTargets&&o&&f){Ra.set(0,0,0),Gs.set(0,0,0),Al.set(0,0,0);for(let g=0,_=o.length;g<_;g++){const y=f[g],w=o[g];y!==0&&(Pa.fromBufferAttribute(w,u),dh.fromBufferAttribute(w,c),Ca.fromBufferAttribute(w,d),s?(Ra.addScaledVector(Pa,y),Gs.addScaledVector(dh,y),Al.addScaledVector(Ca,y)):(Ra.addScaledVector(Pa.sub(_r),y),Gs.addScaledVector(dh.sub(wo),y),Al.addScaledVector(Ca.sub(To),y)))}_r.add(Ra),wo.add(Gs),To.add(Al)}r.isSkinnedMesh&&(r.boneTransform(u,_r),r.boneTransform(c,wo),r.boneTransform(d,To));const m=function(g,_,y,w,M,I,F,R){let U;if(U=_.side===W?w.intersectTriangle(F,I,M,!0,R):w.intersectTriangle(M,I,F,_.side!==ee,R),U===null)return null;Cl.copy(R),Cl.applyMatrix4(g.matrixWorld);const N=y.ray.origin.distanceTo(Cl);return N<y.near||N>y.far?null:{distance:N,point:Cl.clone(),object:g}}(r,e,t,n,_r,wo,To,$c);if(m){a&&(Hs.fromBufferAttribute(a,u),Pl.fromBufferAttribute(a,c),Ia.fromBufferAttribute(a,d),m.uv=Mn.getUV($c,_r,wo,To,Hs,Pl,Ia,new Qe)),l&&(Hs.fromBufferAttribute(l,u),Pl.fromBufferAttribute(l,c),Ia.fromBufferAttribute(l,d),m.uv2=Mn.getUV($c,_r,wo,To,Hs,Pl,Ia,new Qe));const g={a:u,b:c,c:d,normal:new T,materialIndex:0};Mn.getNormal(_r,wo,To,g.normal),m.face=g}return m}ln.prototype.isMesh=!0;class Qr extends Mt{constructor(e=1,t=1,n=1,i=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:o,depthSegments:s};const a=this;i=Math.floor(i),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],c=[],d=[];let f=0,m=0;function g(_,y,w,M,I,F,R,U,N,G,he){const ne=F/N,Z=R/G,Q=F/2,$=R/2,se=U/2,me=N+1,ge=G+1;let de=0,fe=0;const Re=new T;for(let ke=0;ke<ge;ke++){const Be=ke*Z-$;for(let J=0;J<me;J++){const te=J*ne-Q;Re[_]=te*M,Re[y]=Be*I,Re[w]=se,u.push(Re.x,Re.y,Re.z),Re[_]=0,Re[y]=0,Re[w]=U>0?1:-1,c.push(Re.x,Re.y,Re.z),d.push(J/N),d.push(1-ke/G),de+=1}}for(let ke=0;ke<G;ke++)for(let Be=0;Be<N;Be++){const J=f+Be+me*ke,te=f+Be+me*(ke+1),Ae=f+(Be+1)+me*(ke+1),Ne=f+(Be+1)+me*ke;l.push(J,te,Ne),l.push(te,Ae,Ne),fe+=6}a.addGroup(m,fe,he),m+=fe,f+=de}g("z","y","x",-1,-1,n,t,e,s,o,0),g("z","y","x",1,-1,n,t,-e,s,o,1),g("x","z","y",1,1,e,n,t,i,s,2),g("x","z","y",1,-1,e,n,-t,i,s,3),g("x","y","z",1,-1,e,t,n,i,o,4),g("x","y","z",-1,-1,e,t,-n,i,o,5),this.setIndex(l),this.setAttribute("position",new st(u,3)),this.setAttribute("normal",new st(c,3)),this.setAttribute("uv",new st(d,2))}static fromJSON(e){return new Qr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function La(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function Si(r){const e={};for(let t=0;t<r.length;t++){const n=La(r[t]);for(const i in n)e[i]=n[i]}return e}const eo={clone:La,merge:Si};class ki extends vi{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
|
|
86
86
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
87
87
|
}`,this.fragmentShader=`void main() {
|
|
88
88
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
@@ -121,7 +121,7 @@ void main() {
|
|
|
121
121
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
122
122
|
|
|
123
123
|
}
|
|
124
|
-
`},i=new Qr(5,5,5),o=new ki({name:"CubemapFromEquirect",uniforms:La(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:W,blending:$e});o.uniforms.tEquirect.value=t;const s=new ln(i,o),a=t.minFilter;return t.minFilter===Ts&&(t.minFilter=Jn),new Vs(1,10,this).update(e,s),t.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,n,i){const o=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,n,i);e.setRenderTarget(o)}}Pt.prototype.isWebGLCubeRenderTarget=!0;const Oa=new T,Kc=new T,js=new En;class yr{constructor(e=new T(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Oa.subVectors(n,t).cross(Kc.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(Oa),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:t.copy(n).multiplyScalar(o).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||js.getNormalMatrix(e),i=this.coplanarPoint(Oa).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}yr.prototype.isPlane=!0;const Ws=new li,hi=new T;class Da{constructor(e=new yr,t=new yr,n=new yr,i=new yr,o=new yr,s=new yr){this.planes=[e,t,n,i,o,s]}set(e,t,n,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,i=n[0],o=n[1],s=n[2],a=n[3],l=n[4],u=n[5],c=n[6],d=n[7],f=n[8],m=n[9],g=n[10],_=n[11],y=n[12],w=n[13],M=n[14],I=n[15];return t[0].setComponents(a-i,d-l,_-f,I-y).normalize(),t[1].setComponents(a+i,d+l,_+f,I+y).normalize(),t[2].setComponents(a+o,d+u,_+m,I+w).normalize(),t[3].setComponents(a-o,d-u,_-m,I-w).normalize(),t[4].setComponents(a-s,d-c,_-g,I-M).normalize(),t[5].setComponents(a+s,d+c,_+g,I+M).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Ws.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ws)}intersectsSprite(e){return Ws.center.set(0,0,0),Ws.radius=.7071067811865476,Ws.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ws)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(hi.x=i.normal.x>0?e.max.x:e.min.x,hi.y=i.normal.y>0?e.max.y:e.min.y,hi.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(hi)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Qc(){let r=null,e=!1,t=null,n=null;function i(o,s){t(o,s),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){r=o}}}function Pg(r,e){const t=e.isWebGL2,n=new WeakMap;return{get:function(i){return i.isInterleavedBufferAttribute&&(i=i.data),n.get(i)},remove:function(i){i.isInterleavedBufferAttribute&&(i=i.data);const o=n.get(i);o&&(r.deleteBuffer(o.buffer),n.delete(i))},update:function(i,o){if(i.isGLBufferAttribute){const a=n.get(i);return void((!a||a.version<i.version)&&n.set(i,{buffer:i.buffer,type:i.type,bytesPerElement:i.elementSize,version:i.version}))}i.isInterleavedBufferAttribute&&(i=i.data);const s=n.get(i);s===void 0?n.set(i,function(a,l){const u=a.array,c=a.usage,d=r.createBuffer();r.bindBuffer(l,d),r.bufferData(l,u,c),a.onUploadCallback();let f=5126;return u instanceof Float32Array?f=5126:u instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):u instanceof Uint16Array?a.isFloat16BufferAttribute?t?f=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):f=5123:u instanceof Int16Array?f=5122:u instanceof Uint32Array?f=5125:u instanceof Int32Array?f=5124:u instanceof Int8Array?f=5120:(u instanceof Uint8Array||u instanceof Uint8ClampedArray)&&(f=5121),{buffer:d,type:f,bytesPerElement:u.BYTES_PER_ELEMENT,version:a.version}}(i,o)):s.version<i.version&&(function(a,l,u){const c=l.array,d=l.updateRange;r.bindBuffer(u,a),d.count===-1?r.bufferSubData(u,0,c):(t?r.bufferSubData(u,d.offset*c.BYTES_PER_ELEMENT,c,d.offset,d.count):r.bufferSubData(u,d.offset*c.BYTES_PER_ELEMENT,c.subarray(d.offset,d.offset+d.count)),d.count=-1)}(s.buffer,i,o),s.version=i.version)}}}class Ii extends Mt{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const o=e/2,s=t/2,a=Math.floor(n),l=Math.floor(i),u=a+1,c=l+1,d=e/a,f=t/l,m=[],g=[],_=[],y=[];for(let w=0;w<c;w++){const M=w*f-s;for(let I=0;I<u;I++){const F=I*d-o;g.push(F,-M,0),_.push(0,0,1),y.push(I/a),y.push(1-w/l)}}for(let w=0;w<l;w++)for(let M=0;M<a;M++){const I=M+u*w,F=M+u*(w+1),
|
|
124
|
+
`},i=new Qr(5,5,5),o=new ki({name:"CubemapFromEquirect",uniforms:La(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:W,blending:$e});o.uniforms.tEquirect.value=t;const s=new ln(i,o),a=t.minFilter;return t.minFilter===Ts&&(t.minFilter=Jn),new Vs(1,10,this).update(e,s),t.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,n,i){const o=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,n,i);e.setRenderTarget(o)}}Pt.prototype.isWebGLCubeRenderTarget=!0;const Oa=new T,Kc=new T,js=new En;class yr{constructor(e=new T(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Oa.subVectors(n,t).cross(Kc.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(Oa),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:t.copy(n).multiplyScalar(o).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||js.getNormalMatrix(e),i=this.coplanarPoint(Oa).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}yr.prototype.isPlane=!0;const Ws=new li,hi=new T;class Da{constructor(e=new yr,t=new yr,n=new yr,i=new yr,o=new yr,s=new yr){this.planes=[e,t,n,i,o,s]}set(e,t,n,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,i=n[0],o=n[1],s=n[2],a=n[3],l=n[4],u=n[5],c=n[6],d=n[7],f=n[8],m=n[9],g=n[10],_=n[11],y=n[12],w=n[13],M=n[14],I=n[15];return t[0].setComponents(a-i,d-l,_-f,I-y).normalize(),t[1].setComponents(a+i,d+l,_+f,I+y).normalize(),t[2].setComponents(a+o,d+u,_+m,I+w).normalize(),t[3].setComponents(a-o,d-u,_-m,I-w).normalize(),t[4].setComponents(a-s,d-c,_-g,I-M).normalize(),t[5].setComponents(a+s,d+c,_+g,I+M).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Ws.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ws)}intersectsSprite(e){return Ws.center.set(0,0,0),Ws.radius=.7071067811865476,Ws.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ws)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(hi.x=i.normal.x>0?e.max.x:e.min.x,hi.y=i.normal.y>0?e.max.y:e.min.y,hi.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(hi)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Qc(){let r=null,e=!1,t=null,n=null;function i(o,s){t(o,s),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){r=o}}}function Pg(r,e){const t=e.isWebGL2,n=new WeakMap;return{get:function(i){return i.isInterleavedBufferAttribute&&(i=i.data),n.get(i)},remove:function(i){i.isInterleavedBufferAttribute&&(i=i.data);const o=n.get(i);o&&(r.deleteBuffer(o.buffer),n.delete(i))},update:function(i,o){if(i.isGLBufferAttribute){const a=n.get(i);return void((!a||a.version<i.version)&&n.set(i,{buffer:i.buffer,type:i.type,bytesPerElement:i.elementSize,version:i.version}))}i.isInterleavedBufferAttribute&&(i=i.data);const s=n.get(i);s===void 0?n.set(i,function(a,l){const u=a.array,c=a.usage,d=r.createBuffer();r.bindBuffer(l,d),r.bufferData(l,u,c),a.onUploadCallback();let f=5126;return u instanceof Float32Array?f=5126:u instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):u instanceof Uint16Array?a.isFloat16BufferAttribute?t?f=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):f=5123:u instanceof Int16Array?f=5122:u instanceof Uint32Array?f=5125:u instanceof Int32Array?f=5124:u instanceof Int8Array?f=5120:(u instanceof Uint8Array||u instanceof Uint8ClampedArray)&&(f=5121),{buffer:d,type:f,bytesPerElement:u.BYTES_PER_ELEMENT,version:a.version}}(i,o)):s.version<i.version&&(function(a,l,u){const c=l.array,d=l.updateRange;r.bindBuffer(u,a),d.count===-1?r.bufferSubData(u,0,c):(t?r.bufferSubData(u,d.offset*c.BYTES_PER_ELEMENT,c,d.offset,d.count):r.bufferSubData(u,d.offset*c.BYTES_PER_ELEMENT,c.subarray(d.offset,d.offset+d.count)),d.count=-1)}(s.buffer,i,o),s.version=i.version)}}}class Ii extends Mt{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const o=e/2,s=t/2,a=Math.floor(n),l=Math.floor(i),u=a+1,c=l+1,d=e/a,f=t/l,m=[],g=[],_=[],y=[];for(let w=0;w<c;w++){const M=w*f-s;for(let I=0;I<u;I++){const F=I*d-o;g.push(F,-M,0),_.push(0,0,1),y.push(I/a),y.push(1-w/l)}}for(let w=0;w<l;w++)for(let M=0;M<a;M++){const I=M+u*w,F=M+u*(w+1),R=M+1+u*(w+1),U=M+1+u*w;m.push(I,F,U),m.push(F,R,U)}this.setIndex(m),this.setAttribute("position",new st(g,3)),this.setAttribute("normal",new st(_,3)),this.setAttribute("uv",new st(y,2))}static fromJSON(e){return new Ii(e.width,e.height,e.widthSegments,e.heightSegments)}}const Lt={alphamap_fragment:`#ifdef USE_ALPHAMAP
|
|
125
125
|
diffuseColor.a *= texture2D( alphaMap, vUv ).g;
|
|
126
126
|
#endif`,alphamap_pars_fragment:`#ifdef USE_ALPHAMAP
|
|
127
127
|
uniform sampler2D alphaMap;
|
|
@@ -2925,14 +2925,14 @@ void main() {
|
|
|
2925
2925
|
#include <logdepthbuf_vertex>
|
|
2926
2926
|
#include <clipping_planes_vertex>
|
|
2927
2927
|
#include <fog_vertex>
|
|
2928
|
-
}`},dt={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new En},uv2Transform:{value:new En},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Qe(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new En}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new Qe(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new En}}},sr={basic:{uniforms:Si([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.fog]),vertexShader:Lt.meshbasic_vert,fragmentShader:Lt.meshbasic_frag},lambert:{uniforms:Si([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.fog,dt.lights,{emissive:{value:new gt(0)}}]),vertexShader:Lt.meshlambert_vert,fragmentShader:Lt.meshlambert_frag},phong:{uniforms:Si([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:Lt.meshphong_vert,fragmentShader:Lt.meshphong_frag},standard:{uniforms:Si([dt.common,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.roughnessmap,dt.metalnessmap,dt.fog,dt.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Lt.meshphysical_vert,fragmentShader:Lt.meshphysical_frag},toon:{uniforms:Si([dt.common,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.gradientmap,dt.fog,dt.lights,{emissive:{value:new gt(0)}}]),vertexShader:Lt.meshtoon_vert,fragmentShader:Lt.meshtoon_frag},matcap:{uniforms:Si([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,{matcap:{value:null}}]),vertexShader:Lt.meshmatcap_vert,fragmentShader:Lt.meshmatcap_frag},points:{uniforms:Si([dt.points,dt.fog]),vertexShader:Lt.points_vert,fragmentShader:Lt.points_frag},dashed:{uniforms:Si([dt.common,dt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Lt.linedashed_vert,fragmentShader:Lt.linedashed_frag},depth:{uniforms:Si([dt.common,dt.displacementmap]),vertexShader:Lt.depth_vert,fragmentShader:Lt.depth_frag},normal:{uniforms:Si([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,{opacity:{value:1}}]),vertexShader:Lt.normal_vert,fragmentShader:Lt.normal_frag},sprite:{uniforms:Si([dt.sprite,dt.fog]),vertexShader:Lt.sprite_vert,fragmentShader:Lt.sprite_frag},background:{uniforms:{uvTransform:{value:new En},t2D:{value:null}},vertexShader:Lt.background_vert,fragmentShader:Lt.background_frag},cube:{uniforms:Si([dt.envmap,{opacity:{value:1}}]),vertexShader:Lt.cube_vert,fragmentShader:Lt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Lt.equirect_vert,fragmentShader:Lt.equirect_frag},distanceRGBA:{uniforms:Si([dt.common,dt.displacementmap,{referencePosition:{value:new T},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Lt.distanceRGBA_vert,fragmentShader:Lt.distanceRGBA_frag},shadow:{uniforms:Si([dt.lights,dt.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:Lt.shadow_vert,fragmentShader:Lt.shadow_frag}};function Cg(r,e,t,n,i){const o=new gt(0);let s,a,l=0,u=null,c=0,d=null;function f(m,g){t.buffers.color.setClear(m.r,m.g,m.b,g,i)}return{getClearColor:function(){return o},setClearColor:function(m,g=1){o.set(m),l=g,f(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,f(o,l)},render:function(m,g){let _=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=e.get(y));const w=r.xr,M=w.getSession&&w.getSession();M&&M.environmentBlendMode==="additive"&&(y=null),y===null?f(o,l):y&&y.isColor&&(f(y,1),_=!0),(r.autoClear||_)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===fa)?(a===void 0&&(a=new ln(new Qr(1,1,1),new ki({name:"BackgroundCubeMaterial",uniforms:La(sr.cube.uniforms),vertexShader:sr.cube.vertexShader,fragmentShader:sr.cube.fragmentShader,side:W,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(I,F,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),a.material.uniforms.envMap.value=y,a.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y._needsFlipEnvMap?-1:1,u===y&&c===y.version&&d===r.toneMapping||(a.material.needsUpdate=!0,u=y,c=y.version,d=r.toneMapping),m.unshift(a,a.geometry,a.material,0,0,null)):y&&y.isTexture&&(s===void 0&&(s=new ln(new Ii(2,2),new ki({name:"BackgroundMaterial",uniforms:La(sr.background.uniforms),vertexShader:sr.background.vertexShader,fragmentShader:sr.background.fragmentShader,side:z,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(s)),s.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),s.material.uniforms.uvTransform.value.copy(y.matrix),u===y&&c===y.version&&d===r.toneMapping||(s.material.needsUpdate=!0,u=y,c=y.version,d=r.toneMapping),m.unshift(s,s.geometry,s.material,0,0,null))}}}function Il(r,e,t,n){const i=r.getParameter(34921),o=n.isWebGL2?null:e.get("OES_vertex_array_object"),s=n.isWebGL2||o!==null,a={},l=f(null);let u=l;function c(F){return n.isWebGL2?r.bindVertexArray(F):o.bindVertexArrayOES(F)}function d(F){return n.isWebGL2?r.deleteVertexArray(F):o.deleteVertexArrayOES(F)}function f(F){const C=[],U=[],N=[];for(let G=0;G<i;G++)C[G]=0,U[G]=0,N[G]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:C,enabledAttributes:U,attributeDivisors:N,object:F,attributes:{},index:null}}function m(){const F=u.newAttributes;for(let C=0,U=F.length;C<U;C++)F[C]=0}function g(F){_(F,0)}function _(F,C){const U=u.newAttributes,N=u.enabledAttributes,G=u.attributeDivisors;U[F]=1,N[F]===0&&(r.enableVertexAttribArray(F),N[F]=1),G[F]!==C&&((n.isWebGL2?r:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](F,C),G[F]=C)}function y(){const F=u.newAttributes,C=u.enabledAttributes;for(let U=0,N=C.length;U<N;U++)C[U]!==F[U]&&(r.disableVertexAttribArray(U),C[U]=0)}function w(F,C,U,N,G,he){n.isWebGL2!==!0||U!==5124&&U!==5125?r.vertexAttribPointer(F,C,U,N,G,he):r.vertexAttribIPointer(F,C,U,G,he)}function M(){I(),u!==l&&(u=l,c(u.object))}function I(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(F,C,U,N,G){let he=!1;if(s){const ne=function(Z,Q,$){const se=$.wireframe===!0;let me=a[Z.id];me===void 0&&(me={},a[Z.id]=me);let ge=me[Q.id];ge===void 0&&(ge={},me[Q.id]=ge);let de=ge[se];return de===void 0&&(de=f(n.isWebGL2?r.createVertexArray():o.createVertexArrayOES()),ge[se]=de),de}(N,U,C);u!==ne&&(u=ne,c(u.object)),he=function(Z,Q){const $=u.attributes,se=Z.attributes;let me=0;for(const ge in se){const de=$[ge],fe=se[ge];if(de===void 0||de.attribute!==fe||de.data!==fe.data)return!0;me++}return u.attributesNum!==me||u.index!==Q}(N,G),he&&function(Z,Q){const $={},se=Z.attributes;let me=0;for(const ge in se){const de=se[ge],fe={};fe.attribute=de,de.data&&(fe.data=de.data),$[ge]=fe,me++}u.attributes=$,u.attributesNum=me,u.index=Q}(N,G)}else{const ne=C.wireframe===!0;u.geometry===N.id&&u.program===U.id&&u.wireframe===ne||(u.geometry=N.id,u.program=U.id,u.wireframe=ne,he=!0)}F.isInstancedMesh===!0&&(he=!0),G!==null&&t.update(G,34963),he&&(function(ne,Z,Q,$){if(n.isWebGL2===!1&&(ne.isInstancedMesh||$.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;m();const se=$.attributes,me=Q.getAttributes(),ge=Z.defaultAttributeValues;for(const de in me){const fe=me[de];if(fe>=0){const Re=se[de];if(Re!==void 0){const ke=Re.normalized,Be=Re.itemSize,J=t.get(Re);if(J===void 0)continue;const te=J.buffer,Ae=J.type,Ne=J.bytesPerElement;if(Re.isInterleavedBufferAttribute){const Te=Re.data,Ge=Te.stride,Ye=Re.offset;Te&&Te.isInstancedInterleavedBuffer?(_(fe,Te.meshPerAttribute),$._maxInstanceCount===void 0&&($._maxInstanceCount=Te.meshPerAttribute*Te.count)):g(fe),r.bindBuffer(34962,te),w(fe,Be,Ae,ke,Ge*Ne,Ye*Ne)}else Re.isInstancedBufferAttribute?(_(fe,Re.meshPerAttribute),$._maxInstanceCount===void 0&&($._maxInstanceCount=Re.meshPerAttribute*Re.count)):g(fe),r.bindBuffer(34962,te),w(fe,Be,Ae,ke,0,0)}else if(de==="instanceMatrix"){const ke=t.get(ne.instanceMatrix);if(ke===void 0)continue;const Be=ke.buffer,J=ke.type;_(fe+0,1),_(fe+1,1),_(fe+2,1),_(fe+3,1),r.bindBuffer(34962,Be),r.vertexAttribPointer(fe+0,4,J,!1,64,0),r.vertexAttribPointer(fe+1,4,J,!1,64,16),r.vertexAttribPointer(fe+2,4,J,!1,64,32),r.vertexAttribPointer(fe+3,4,J,!1,64,48)}else if(de==="instanceColor"){const ke=t.get(ne.instanceColor);if(ke===void 0)continue;const Be=ke.buffer,J=ke.type;_(fe,1),r.bindBuffer(34962,Be),r.vertexAttribPointer(fe,3,J,!1,12,0)}else if(ge!==void 0){const ke=ge[de];if(ke!==void 0)switch(ke.length){case 2:r.vertexAttrib2fv(fe,ke);break;case 3:r.vertexAttrib3fv(fe,ke);break;case 4:r.vertexAttrib4fv(fe,ke);break;default:r.vertexAttrib1fv(fe,ke)}}}}y()}(F,C,U,N),G!==null&&r.bindBuffer(34963,t.get(G).buffer))},reset:M,resetDefaultState:I,dispose:function(){M();for(const F in a){const C=a[F];for(const U in C){const N=C[U];for(const G in N)d(N[G].object),delete N[G];delete C[U]}delete a[F]}},releaseStatesOfGeometry:function(F){if(a[F.id]===void 0)return;const C=a[F.id];for(const U in C){const N=C[U];for(const G in N)d(N[G].object),delete N[G];delete C[U]}delete a[F.id]},releaseStatesOfProgram:function(F){for(const C in a){const U=a[C];if(U[F.id]===void 0)continue;const N=U[F.id];for(const G in N)d(N[G].object),delete N[G];delete U[F.id]}},initAttributes:m,enableAttribute:g,disableUnusedAttributes:y}}function hf(r,e,t,n){const i=n.isWebGL2;let o;this.setMode=function(s){o=s},this.render=function(s,a){r.drawArrays(o,s,a),t.update(a,o,1)},this.renderInstances=function(s,a,l){if(l===0)return;let u,c;if(i)u=r,c="drawArraysInstanced";else if(u=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",u===null)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](o,s,a,l),t.update(a,o,l)}}function cf(r,e,t){let n;function i(F){if(F==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";F="mediump"}return F==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext;let s=t.precision!==void 0?t.precision:"highp";const a=i(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,c=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),m=r.getParameter(34076),g=r.getParameter(34921),_=r.getParameter(36347),y=r.getParameter(36348),w=r.getParameter(36349),M=d>0,I=o||e.has("OES_texture_float");return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:function(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const F=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:i,precision:s,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:_,maxVaryings:y,maxFragmentUniforms:w,vertexTextures:M,floatFragmentTextures:I,floatVertexTextures:M&&I,maxSamples:o?r.getParameter(36183):0}}function df(r){const e=this;let t=null,n=0,i=!1,o=!1;const s=new yr,a=new En,l={value:null,needsUpdate:!1};function u(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(d,f,m,g){const _=d!==null?d.length:0;let y=null;if(_!==0){if(y=l.value,g!==!0||y===null){const w=m+4*_,M=f.matrixWorldInverse;a.getNormalMatrix(M),(y===null||y.length<w)&&(y=new Float32Array(w));for(let I=0,F=m;I!==_;++I,F+=4)s.copy(d[I]).applyMatrix4(M,a),s.normal.toArray(y,F),y[F+3]=s.constant}l.value=y,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,y}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f,m){const g=d.length!==0||f||n!==0||i;return i=f,t=c(d,m,0),n=d.length,g},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1,u()},this.setState=function(d,f,m){const g=d.clippingPlanes,_=d.clipIntersection,y=d.clipShadows,w=r.get(d);if(!i||g===null||g.length===0||o&&!y)o?c(null):u();else{const M=o?0:n,I=4*M;let F=w.clippingState||null;l.value=F,F=c(g,f,I,m);for(let C=0;C!==I;++C)F[C]=t[C];w.clippingState=F,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=M}}}function pf(r){let e=new WeakMap;function t(i,o){return o===sl?i.mapping=ko:o===al&&(i.mapping=ol),i}function n(i){const o=i.target;o.removeEventListener("dispose",n);const s=e.get(o);s!==void 0&&(e.delete(o),s.dispose())}return{get:function(i){if(i&&i.isTexture){const o=i.mapping;if(o===sl||o===al){if(e.has(i))return t(e.get(i).texture,i.mapping);{const s=i.image;if(s&&s.height>0){const a=r.getRenderTarget(),l=new Pt(s.height/2);return l.fromEquirectangularTexture(r,i),e.set(i,l),r.setRenderTarget(a),i.addEventListener("dispose",n),t(l.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap}}}function Rg(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(n){n.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float")},get:function(n){const i=t(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function ed(r,e,t,n){const i={},o=new WeakMap;function s(l){const u=l.target;u.index!==null&&e.remove(u.index);for(const d in u.attributes)e.remove(u.attributes[d]);u.removeEventListener("dispose",s),delete i[u.id];const c=o.get(u);c&&(e.remove(c),o.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,t.memory.geometries--}function a(l){const u=[],c=l.index,d=l.attributes.position;let f=0;if(c!==null){const _=c.array;f=c.version;for(let y=0,w=_.length;y<w;y+=3){const M=_[y+0],I=_[y+1],F=_[y+2];u.push(M,I,I,F,F,M)}}else{const _=d.array;f=d.version;for(let y=0,w=_.length/3-1;y<w;y+=3){const M=y+0,I=y+1,F=y+2;u.push(M,I,I,F,F,M)}}const m=new(qc(u)>65535?Fr:Aa)(u,1);m.version=f;const g=o.get(l);g&&e.remove(g),o.set(l,m)}return{get:function(l,u){return i[u.id]===!0||(u.addEventListener("dispose",s),i[u.id]=!0,t.memory.geometries++),u},update:function(l){const u=l.attributes;for(const d in u)e.update(u[d],34962);const c=l.morphAttributes;for(const d in c){const f=c[d];for(let m=0,g=f.length;m<g;m++)e.update(f[m],34962)}},getWireframeAttribute:function(l){const u=o.get(l);if(u){const c=l.index;c!==null&&u.version<c.version&&a(l)}else a(l);return o.get(l)}}}function ff(r,e,t,n){const i=n.isWebGL2;let o,s,a;this.setMode=function(l){o=l},this.setIndex=function(l){s=l.type,a=l.bytesPerElement},this.render=function(l,u){r.drawElements(o,u,s,l*a),t.update(u,o,1)},this.renderInstances=function(l,u,c){if(c===0)return;let d,f;if(i)d=r,f="drawElementsInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawElementsInstancedANGLE",d===null)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");d[f](o,u,s,l*a,c),t.update(u,o,c)}}function Ll(r){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,i){switch(e.calls++,n){case 4:e.triangles+=i*(t/3);break;case 1:e.lines+=i*(t/2);break;case 3:e.lines+=i*(t-1);break;case 2:e.lines+=i*t;break;case 0:e.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function td(r,e){return r[0]-e[0]}function mf(r,e){return Math.abs(e[1])-Math.abs(r[1])}function gf(r){const e={},t=new Float32Array(8),n=[];for(let i=0;i<8;i++)n[i]=[i,0];return{update:function(i,o,s,a){const l=i.morphTargetInfluences,u=l===void 0?0:l.length;let c=e[o.id];if(c===void 0||c.length!==u){c=[];for(let _=0;_<u;_++)c[_]=[_,0];e[o.id]=c}for(let _=0;_<u;_++){const y=c[_];y[0]=_,y[1]=l[_]}c.sort(mf);for(let _=0;_<8;_++)_<u&&c[_][1]?(n[_][0]=c[_][0],n[_][1]=c[_][1]):(n[_][0]=Number.MAX_SAFE_INTEGER,n[_][1]=0);n.sort(td);const d=s.morphTargets&&o.morphAttributes.position,f=s.morphNormals&&o.morphAttributes.normal;let m=0;for(let _=0;_<8;_++){const y=n[_],w=y[0],M=y[1];w!==Number.MAX_SAFE_INTEGER&&M?(d&&o.getAttribute("morphTarget"+_)!==d[w]&&o.setAttribute("morphTarget"+_,d[w]),f&&o.getAttribute("morphNormal"+_)!==f[w]&&o.setAttribute("morphNormal"+_,f[w]),t[_]=M,m+=M):(d&&o.hasAttribute("morphTarget"+_)===!0&&o.deleteAttribute("morphTarget"+_),f&&o.hasAttribute("morphNormal"+_)===!0&&o.deleteAttribute("morphNormal"+_),t[_]=0)}const g=o.morphTargetsRelative?1:1-m;a.getUniforms().setValue(r,"morphTargetBaseInfluence",g),a.getUniforms().setValue(r,"morphTargetInfluences",t)}}}function ph(r,e,t,n){let i=new WeakMap;function o(s){const a=s.target;a.removeEventListener("dispose",o),t.remove(a.instanceMatrix),a.instanceColor!==null&&t.remove(a.instanceColor)}return{update:function(s){const a=n.render.frame,l=s.geometry,u=e.get(s,l);return i.get(u)!==a&&(e.update(u),i.set(u,a)),s.isInstancedMesh&&(s.hasEventListener("dispose",o)===!1&&s.addEventListener("dispose",o),t.update(s.instanceMatrix,34962),s.instanceColor!==null&&t.update(s.instanceColor,34962)),u},dispose:function(){i=new WeakMap}}}sr.physical={uniforms:Si([sr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Qe(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new gt(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Qe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new gt(0)}}]),vertexShader:Lt.meshphysical_vert,fragmentShader:Lt.meshphysical_frag};class fh extends $n{constructor(e=null,t=1,n=1,i=1){super(null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=Zn,this.minFilter=Zn,this.wrapR=mi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}fh.prototype.isDataTexture2DArray=!0;class xr extends $n{constructor(e=null,t=1,n=1,i=1){super(null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=Zn,this.minFilter=Zn,this.wrapR=mi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}xr.prototype.isDataTexture3D=!0;const Qo=new $n,vf=new fh,Ig=new xr,_f=new Br,yf=[],nd=[],id=new Float32Array(16),rd=new Float32Array(9),od=new Float32Array(4);function Na(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let o=yf[i];if(o===void 0&&(o=new Float32Array(i),yf[i]=o),e!==0){n.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=t,r[s].toArray(o,a)}return o}function Gi(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function Li(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function ar(r,e){let t=nd[e];t===void 0&&(t=new Int32Array(e),nd[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function Lg(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function xf(r,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y||(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Gi(t,e))return;r.uniform2fv(this.addr,e),Li(t,e)}}function Og(r,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y&&t[2]===e.z||(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)t[0]===e.r&&t[1]===e.g&&t[2]===e.b||(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Gi(t,e))return;r.uniform3fv(this.addr,e),Li(t,e)}}function sd(r,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y&&t[2]===e.z&&t[3]===e.w||(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Gi(t,e))return;r.uniform4fv(this.addr,e),Li(t,e)}}function Dg(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Gi(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),Li(t,e)}else{if(Gi(t,n))return;od.set(n),r.uniformMatrix2fv(this.addr,!1,od),Li(t,n)}}function Ng(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Gi(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),Li(t,e)}else{if(Gi(t,n))return;rd.set(n),r.uniformMatrix3fv(this.addr,!1,rd),Li(t,n)}}function Fg(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Gi(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),Li(t,e)}else{if(Gi(t,n))return;id.set(n),r.uniformMatrix4fv(this.addr,!1,id),Li(t,n)}}function ad(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function bf(r,e){const t=this.cache;Gi(t,e)||(r.uniform2iv(this.addr,e),Li(t,e))}function Bg(r,e){const t=this.cache;Gi(t,e)||(r.uniform3iv(this.addr,e),Li(t,e))}function Ug(r,e){const t=this.cache;Gi(t,e)||(r.uniform4iv(this.addr,e),Li(t,e))}function kg(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function Gg(r,e){const t=this.cache;Gi(t,e)||(r.uniform2uiv(this.addr,e),Li(t,e))}function Hg(r,e){const t=this.cache;Gi(t,e)||(r.uniform3uiv(this.addr,e),Li(t,e))}function zg(r,e){const t=this.cache;Gi(t,e)||(r.uniform4uiv(this.addr,e),Li(t,e))}function wf(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.safeSetTexture2D(e||Qo,i)}function mh(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Ig,i)}function Vg(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.safeSetTextureCube(e||_f,i)}function jg(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||vf,i)}function Wg(r,e){r.uniform1fv(this.addr,e)}function Xg(r,e){const t=Na(e,this.size,2);r.uniform2fv(this.addr,t)}function Tf(r,e){const t=Na(e,this.size,3);r.uniform3fv(this.addr,t)}function Sf(r,e){const t=Na(e,this.size,4);r.uniform4fv(this.addr,t)}function Yg(r,e){const t=Na(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function qg(r,e){const t=Na(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function Zg(r,e){const t=Na(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function gh(r,e){r.uniform1iv(this.addr,e)}function Jg(r,e){r.uniform2iv(this.addr,e)}function $g(r,e){r.uniform3iv(this.addr,e)}function vh(r,e){r.uniform4iv(this.addr,e)}function Ef(r,e){r.uniform1uiv(this.addr,e)}function Mf(r,e){r.uniform2uiv(this.addr,e)}function ld(r,e){r.uniform3uiv(this.addr,e)}function Af(r,e){r.uniform4uiv(this.addr,e)}function Pf(r,e,t){const n=e.length,i=ar(t,n);r.uniform1iv(this.addr,i);for(let o=0;o!==n;++o)t.safeSetTexture2D(e[o]||Qo,i[o])}function Kg(r,e,t){const n=e.length,i=ar(t,n);r.uniform1iv(this.addr,i);for(let o=0;o!==n;++o)t.safeSetTextureCube(e[o]||_f,i[o])}function Qg(r,e,t){this.id=r,this.addr=t,this.cache=[],this.setValue=function(n){switch(n){case 5126:return Lg;case 35664:return xf;case 35665:return Og;case 35666:return sd;case 35674:return Dg;case 35675:return Ng;case 35676:return Fg;case 5124:case 35670:return ad;case 35667:case 35671:return bf;case 35668:case 35672:return Bg;case 35669:case 35673:return Ug;case 5125:return kg;case 36294:return Gg;case 36295:return Hg;case 36296:return zg;case 35678:case 36198:case 36298:case 36306:case 35682:return wf;case 35679:case 36299:case 36307:return mh;case 35680:case 36300:case 36308:case 36293:return Vg;case 36289:case 36303:case 36311:case 36292:return jg}}(e.type)}function Ol(r,e,t){this.id=r,this.addr=t,this.cache=[],this.size=e.size,this.setValue=function(n){switch(n){case 5126:return Wg;case 35664:return Xg;case 35665:return Tf;case 35666:return Sf;case 35674:return Yg;case 35675:return qg;case 35676:return Zg;case 5124:case 35670:return gh;case 35667:case 35671:return Jg;case 35668:case 35672:return $g;case 35669:case 35673:return vh;case 5125:return Ef;case 36294:return Mf;case 36295:return ld;case 36296:return Af;case 35678:case 36198:case 36298:case 36306:case 35682:return Pf;case 35680:case 36300:case 36308:case 36293:return Kg}}(e.type)}function Dl(r){this.id=r,this.seq=[],this.map={}}Ol.prototype.updateCache=function(r){const e=this.cache;r instanceof Float32Array&&e.length!==r.length&&(this.cache=new Float32Array(r.length)),Li(e,r)},Dl.prototype.setValue=function(r,e,t){const n=this.seq;for(let i=0,o=n.length;i!==o;++i){const s=n[i];s.setValue(r,e[s.id],t)}};const ud=/(\w+)(\])?(\[|\.)?/g;function _h(r,e){r.seq.push(e),r.map[e.id]=e}function Cf(r,e,t){const n=r.name,i=n.length;for(ud.lastIndex=0;;){const o=ud.exec(n),s=ud.lastIndex;let a=o[1];const l=o[2]==="]",u=o[3];if(l&&(a|=0),u===void 0||u==="["&&s+2===i){_h(t,u===void 0?new Qg(a,r,e):new Ol(a,r,e));break}{let c=t.map[a];c===void 0&&(c=new Dl(a),_h(t,c)),t=c}}}function es(r,e){this.seq=[],this.map={};const t=r.getProgramParameter(e,35718);for(let n=0;n<t;++n){const i=r.getActiveUniform(e,n);Cf(i,r.getUniformLocation(e,i.name),this)}}function br(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}es.prototype.setValue=function(r,e,t,n){const i=this.map[e];i!==void 0&&i.setValue(r,t,n)},es.prototype.setOptional=function(r,e,t){const n=e[t];n!==void 0&&this.setValue(r,t,n)},es.upload=function(r,e,t,n){for(let i=0,o=e.length;i!==o;++i){const s=e[i],a=t[s.id];a.needsUpdate!==!1&&s.setValue(r,a.value,n)}},es.seqWithValue=function(r,e){const t=[];for(let n=0,i=r.length;n!==i;++n){const o=r[n];o.id in e&&t.push(o)}return t};let ev=0;function Rf(r){switch(r){case wt:return["Linear","( value )"];case $t:return["sRGB","( value )"];case nr:return["RGBE","( value )"];case ml:return["RGBM","( value, 7.0 )"];case Ic:return["RGBM","( value, 16.0 )"];case Xi:return["RGBD","( value, 256.0 )"];case zn:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case xn:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",r),["Linear","( value )"]}}function ts(r,e,t){const n=r.getShaderParameter(e,35713),i=r.getShaderInfoLog(e).trim();return n&&i===""?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+t+`
|
|
2928
|
+
}`},dt={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new En},uv2Transform:{value:new En},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Qe(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new En}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new Qe(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new En}}},sr={basic:{uniforms:Si([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.fog]),vertexShader:Lt.meshbasic_vert,fragmentShader:Lt.meshbasic_frag},lambert:{uniforms:Si([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.fog,dt.lights,{emissive:{value:new gt(0)}}]),vertexShader:Lt.meshlambert_vert,fragmentShader:Lt.meshlambert_frag},phong:{uniforms:Si([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:Lt.meshphong_vert,fragmentShader:Lt.meshphong_frag},standard:{uniforms:Si([dt.common,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.roughnessmap,dt.metalnessmap,dt.fog,dt.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Lt.meshphysical_vert,fragmentShader:Lt.meshphysical_frag},toon:{uniforms:Si([dt.common,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.gradientmap,dt.fog,dt.lights,{emissive:{value:new gt(0)}}]),vertexShader:Lt.meshtoon_vert,fragmentShader:Lt.meshtoon_frag},matcap:{uniforms:Si([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,{matcap:{value:null}}]),vertexShader:Lt.meshmatcap_vert,fragmentShader:Lt.meshmatcap_frag},points:{uniforms:Si([dt.points,dt.fog]),vertexShader:Lt.points_vert,fragmentShader:Lt.points_frag},dashed:{uniforms:Si([dt.common,dt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Lt.linedashed_vert,fragmentShader:Lt.linedashed_frag},depth:{uniforms:Si([dt.common,dt.displacementmap]),vertexShader:Lt.depth_vert,fragmentShader:Lt.depth_frag},normal:{uniforms:Si([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,{opacity:{value:1}}]),vertexShader:Lt.normal_vert,fragmentShader:Lt.normal_frag},sprite:{uniforms:Si([dt.sprite,dt.fog]),vertexShader:Lt.sprite_vert,fragmentShader:Lt.sprite_frag},background:{uniforms:{uvTransform:{value:new En},t2D:{value:null}},vertexShader:Lt.background_vert,fragmentShader:Lt.background_frag},cube:{uniforms:Si([dt.envmap,{opacity:{value:1}}]),vertexShader:Lt.cube_vert,fragmentShader:Lt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Lt.equirect_vert,fragmentShader:Lt.equirect_frag},distanceRGBA:{uniforms:Si([dt.common,dt.displacementmap,{referencePosition:{value:new T},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Lt.distanceRGBA_vert,fragmentShader:Lt.distanceRGBA_frag},shadow:{uniforms:Si([dt.lights,dt.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:Lt.shadow_vert,fragmentShader:Lt.shadow_frag}};function Cg(r,e,t,n,i){const o=new gt(0);let s,a,l=0,u=null,c=0,d=null;function f(m,g){t.buffers.color.setClear(m.r,m.g,m.b,g,i)}return{getClearColor:function(){return o},setClearColor:function(m,g=1){o.set(m),l=g,f(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,f(o,l)},render:function(m,g){let _=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=e.get(y));const w=r.xr,M=w.getSession&&w.getSession();M&&M.environmentBlendMode==="additive"&&(y=null),y===null?f(o,l):y&&y.isColor&&(f(y,1),_=!0),(r.autoClear||_)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===fa)?(a===void 0&&(a=new ln(new Qr(1,1,1),new ki({name:"BackgroundCubeMaterial",uniforms:La(sr.cube.uniforms),vertexShader:sr.cube.vertexShader,fragmentShader:sr.cube.fragmentShader,side:W,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(I,F,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),a.material.uniforms.envMap.value=y,a.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y._needsFlipEnvMap?-1:1,u===y&&c===y.version&&d===r.toneMapping||(a.material.needsUpdate=!0,u=y,c=y.version,d=r.toneMapping),m.unshift(a,a.geometry,a.material,0,0,null)):y&&y.isTexture&&(s===void 0&&(s=new ln(new Ii(2,2),new ki({name:"BackgroundMaterial",uniforms:La(sr.background.uniforms),vertexShader:sr.background.vertexShader,fragmentShader:sr.background.fragmentShader,side:z,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(s)),s.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),s.material.uniforms.uvTransform.value.copy(y.matrix),u===y&&c===y.version&&d===r.toneMapping||(s.material.needsUpdate=!0,u=y,c=y.version,d=r.toneMapping),m.unshift(s,s.geometry,s.material,0,0,null))}}}function Il(r,e,t,n){const i=r.getParameter(34921),o=n.isWebGL2?null:e.get("OES_vertex_array_object"),s=n.isWebGL2||o!==null,a={},l=f(null);let u=l;function c(F){return n.isWebGL2?r.bindVertexArray(F):o.bindVertexArrayOES(F)}function d(F){return n.isWebGL2?r.deleteVertexArray(F):o.deleteVertexArrayOES(F)}function f(F){const R=[],U=[],N=[];for(let G=0;G<i;G++)R[G]=0,U[G]=0,N[G]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:U,attributeDivisors:N,object:F,attributes:{},index:null}}function m(){const F=u.newAttributes;for(let R=0,U=F.length;R<U;R++)F[R]=0}function g(F){_(F,0)}function _(F,R){const U=u.newAttributes,N=u.enabledAttributes,G=u.attributeDivisors;U[F]=1,N[F]===0&&(r.enableVertexAttribArray(F),N[F]=1),G[F]!==R&&((n.isWebGL2?r:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](F,R),G[F]=R)}function y(){const F=u.newAttributes,R=u.enabledAttributes;for(let U=0,N=R.length;U<N;U++)R[U]!==F[U]&&(r.disableVertexAttribArray(U),R[U]=0)}function w(F,R,U,N,G,he){n.isWebGL2!==!0||U!==5124&&U!==5125?r.vertexAttribPointer(F,R,U,N,G,he):r.vertexAttribIPointer(F,R,U,G,he)}function M(){I(),u!==l&&(u=l,c(u.object))}function I(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(F,R,U,N,G){let he=!1;if(s){const ne=function(Z,Q,$){const se=$.wireframe===!0;let me=a[Z.id];me===void 0&&(me={},a[Z.id]=me);let ge=me[Q.id];ge===void 0&&(ge={},me[Q.id]=ge);let de=ge[se];return de===void 0&&(de=f(n.isWebGL2?r.createVertexArray():o.createVertexArrayOES()),ge[se]=de),de}(N,U,R);u!==ne&&(u=ne,c(u.object)),he=function(Z,Q){const $=u.attributes,se=Z.attributes;let me=0;for(const ge in se){const de=$[ge],fe=se[ge];if(de===void 0||de.attribute!==fe||de.data!==fe.data)return!0;me++}return u.attributesNum!==me||u.index!==Q}(N,G),he&&function(Z,Q){const $={},se=Z.attributes;let me=0;for(const ge in se){const de=se[ge],fe={};fe.attribute=de,de.data&&(fe.data=de.data),$[ge]=fe,me++}u.attributes=$,u.attributesNum=me,u.index=Q}(N,G)}else{const ne=R.wireframe===!0;u.geometry===N.id&&u.program===U.id&&u.wireframe===ne||(u.geometry=N.id,u.program=U.id,u.wireframe=ne,he=!0)}F.isInstancedMesh===!0&&(he=!0),G!==null&&t.update(G,34963),he&&(function(ne,Z,Q,$){if(n.isWebGL2===!1&&(ne.isInstancedMesh||$.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;m();const se=$.attributes,me=Q.getAttributes(),ge=Z.defaultAttributeValues;for(const de in me){const fe=me[de];if(fe>=0){const Re=se[de];if(Re!==void 0){const ke=Re.normalized,Be=Re.itemSize,J=t.get(Re);if(J===void 0)continue;const te=J.buffer,Ae=J.type,Ne=J.bytesPerElement;if(Re.isInterleavedBufferAttribute){const Te=Re.data,Ge=Te.stride,Ye=Re.offset;Te&&Te.isInstancedInterleavedBuffer?(_(fe,Te.meshPerAttribute),$._maxInstanceCount===void 0&&($._maxInstanceCount=Te.meshPerAttribute*Te.count)):g(fe),r.bindBuffer(34962,te),w(fe,Be,Ae,ke,Ge*Ne,Ye*Ne)}else Re.isInstancedBufferAttribute?(_(fe,Re.meshPerAttribute),$._maxInstanceCount===void 0&&($._maxInstanceCount=Re.meshPerAttribute*Re.count)):g(fe),r.bindBuffer(34962,te),w(fe,Be,Ae,ke,0,0)}else if(de==="instanceMatrix"){const ke=t.get(ne.instanceMatrix);if(ke===void 0)continue;const Be=ke.buffer,J=ke.type;_(fe+0,1),_(fe+1,1),_(fe+2,1),_(fe+3,1),r.bindBuffer(34962,Be),r.vertexAttribPointer(fe+0,4,J,!1,64,0),r.vertexAttribPointer(fe+1,4,J,!1,64,16),r.vertexAttribPointer(fe+2,4,J,!1,64,32),r.vertexAttribPointer(fe+3,4,J,!1,64,48)}else if(de==="instanceColor"){const ke=t.get(ne.instanceColor);if(ke===void 0)continue;const Be=ke.buffer,J=ke.type;_(fe,1),r.bindBuffer(34962,Be),r.vertexAttribPointer(fe,3,J,!1,12,0)}else if(ge!==void 0){const ke=ge[de];if(ke!==void 0)switch(ke.length){case 2:r.vertexAttrib2fv(fe,ke);break;case 3:r.vertexAttrib3fv(fe,ke);break;case 4:r.vertexAttrib4fv(fe,ke);break;default:r.vertexAttrib1fv(fe,ke)}}}}y()}(F,R,U,N),G!==null&&r.bindBuffer(34963,t.get(G).buffer))},reset:M,resetDefaultState:I,dispose:function(){M();for(const F in a){const R=a[F];for(const U in R){const N=R[U];for(const G in N)d(N[G].object),delete N[G];delete R[U]}delete a[F]}},releaseStatesOfGeometry:function(F){if(a[F.id]===void 0)return;const R=a[F.id];for(const U in R){const N=R[U];for(const G in N)d(N[G].object),delete N[G];delete R[U]}delete a[F.id]},releaseStatesOfProgram:function(F){for(const R in a){const U=a[R];if(U[F.id]===void 0)continue;const N=U[F.id];for(const G in N)d(N[G].object),delete N[G];delete U[F.id]}},initAttributes:m,enableAttribute:g,disableUnusedAttributes:y}}function hf(r,e,t,n){const i=n.isWebGL2;let o;this.setMode=function(s){o=s},this.render=function(s,a){r.drawArrays(o,s,a),t.update(a,o,1)},this.renderInstances=function(s,a,l){if(l===0)return;let u,c;if(i)u=r,c="drawArraysInstanced";else if(u=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",u===null)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](o,s,a,l),t.update(a,o,l)}}function cf(r,e,t){let n;function i(F){if(F==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";F="mediump"}return F==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext;let s=t.precision!==void 0?t.precision:"highp";const a=i(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,c=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),m=r.getParameter(34076),g=r.getParameter(34921),_=r.getParameter(36347),y=r.getParameter(36348),w=r.getParameter(36349),M=d>0,I=o||e.has("OES_texture_float");return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:function(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const F=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:i,precision:s,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:_,maxVaryings:y,maxFragmentUniforms:w,vertexTextures:M,floatFragmentTextures:I,floatVertexTextures:M&&I,maxSamples:o?r.getParameter(36183):0}}function df(r){const e=this;let t=null,n=0,i=!1,o=!1;const s=new yr,a=new En,l={value:null,needsUpdate:!1};function u(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(d,f,m,g){const _=d!==null?d.length:0;let y=null;if(_!==0){if(y=l.value,g!==!0||y===null){const w=m+4*_,M=f.matrixWorldInverse;a.getNormalMatrix(M),(y===null||y.length<w)&&(y=new Float32Array(w));for(let I=0,F=m;I!==_;++I,F+=4)s.copy(d[I]).applyMatrix4(M,a),s.normal.toArray(y,F),y[F+3]=s.constant}l.value=y,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,y}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f,m){const g=d.length!==0||f||n!==0||i;return i=f,t=c(d,m,0),n=d.length,g},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1,u()},this.setState=function(d,f,m){const g=d.clippingPlanes,_=d.clipIntersection,y=d.clipShadows,w=r.get(d);if(!i||g===null||g.length===0||o&&!y)o?c(null):u();else{const M=o?0:n,I=4*M;let F=w.clippingState||null;l.value=F,F=c(g,f,I,m);for(let R=0;R!==I;++R)F[R]=t[R];w.clippingState=F,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=M}}}function pf(r){let e=new WeakMap;function t(i,o){return o===sl?i.mapping=ko:o===al&&(i.mapping=ol),i}function n(i){const o=i.target;o.removeEventListener("dispose",n);const s=e.get(o);s!==void 0&&(e.delete(o),s.dispose())}return{get:function(i){if(i&&i.isTexture){const o=i.mapping;if(o===sl||o===al){if(e.has(i))return t(e.get(i).texture,i.mapping);{const s=i.image;if(s&&s.height>0){const a=r.getRenderTarget(),l=new Pt(s.height/2);return l.fromEquirectangularTexture(r,i),e.set(i,l),r.setRenderTarget(a),i.addEventListener("dispose",n),t(l.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap}}}function Rg(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(n){n.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float")},get:function(n){const i=t(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function ed(r,e,t,n){const i={},o=new WeakMap;function s(l){const u=l.target;u.index!==null&&e.remove(u.index);for(const d in u.attributes)e.remove(u.attributes[d]);u.removeEventListener("dispose",s),delete i[u.id];const c=o.get(u);c&&(e.remove(c),o.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,t.memory.geometries--}function a(l){const u=[],c=l.index,d=l.attributes.position;let f=0;if(c!==null){const _=c.array;f=c.version;for(let y=0,w=_.length;y<w;y+=3){const M=_[y+0],I=_[y+1],F=_[y+2];u.push(M,I,I,F,F,M)}}else{const _=d.array;f=d.version;for(let y=0,w=_.length/3-1;y<w;y+=3){const M=y+0,I=y+1,F=y+2;u.push(M,I,I,F,F,M)}}const m=new(qc(u)>65535?Fr:Aa)(u,1);m.version=f;const g=o.get(l);g&&e.remove(g),o.set(l,m)}return{get:function(l,u){return i[u.id]===!0||(u.addEventListener("dispose",s),i[u.id]=!0,t.memory.geometries++),u},update:function(l){const u=l.attributes;for(const d in u)e.update(u[d],34962);const c=l.morphAttributes;for(const d in c){const f=c[d];for(let m=0,g=f.length;m<g;m++)e.update(f[m],34962)}},getWireframeAttribute:function(l){const u=o.get(l);if(u){const c=l.index;c!==null&&u.version<c.version&&a(l)}else a(l);return o.get(l)}}}function ff(r,e,t,n){const i=n.isWebGL2;let o,s,a;this.setMode=function(l){o=l},this.setIndex=function(l){s=l.type,a=l.bytesPerElement},this.render=function(l,u){r.drawElements(o,u,s,l*a),t.update(u,o,1)},this.renderInstances=function(l,u,c){if(c===0)return;let d,f;if(i)d=r,f="drawElementsInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawElementsInstancedANGLE",d===null)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");d[f](o,u,s,l*a,c),t.update(u,o,c)}}function Ll(r){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,i){switch(e.calls++,n){case 4:e.triangles+=i*(t/3);break;case 1:e.lines+=i*(t/2);break;case 3:e.lines+=i*(t-1);break;case 2:e.lines+=i*t;break;case 0:e.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function td(r,e){return r[0]-e[0]}function mf(r,e){return Math.abs(e[1])-Math.abs(r[1])}function gf(r){const e={},t=new Float32Array(8),n=[];for(let i=0;i<8;i++)n[i]=[i,0];return{update:function(i,o,s,a){const l=i.morphTargetInfluences,u=l===void 0?0:l.length;let c=e[o.id];if(c===void 0||c.length!==u){c=[];for(let _=0;_<u;_++)c[_]=[_,0];e[o.id]=c}for(let _=0;_<u;_++){const y=c[_];y[0]=_,y[1]=l[_]}c.sort(mf);for(let _=0;_<8;_++)_<u&&c[_][1]?(n[_][0]=c[_][0],n[_][1]=c[_][1]):(n[_][0]=Number.MAX_SAFE_INTEGER,n[_][1]=0);n.sort(td);const d=s.morphTargets&&o.morphAttributes.position,f=s.morphNormals&&o.morphAttributes.normal;let m=0;for(let _=0;_<8;_++){const y=n[_],w=y[0],M=y[1];w!==Number.MAX_SAFE_INTEGER&&M?(d&&o.getAttribute("morphTarget"+_)!==d[w]&&o.setAttribute("morphTarget"+_,d[w]),f&&o.getAttribute("morphNormal"+_)!==f[w]&&o.setAttribute("morphNormal"+_,f[w]),t[_]=M,m+=M):(d&&o.hasAttribute("morphTarget"+_)===!0&&o.deleteAttribute("morphTarget"+_),f&&o.hasAttribute("morphNormal"+_)===!0&&o.deleteAttribute("morphNormal"+_),t[_]=0)}const g=o.morphTargetsRelative?1:1-m;a.getUniforms().setValue(r,"morphTargetBaseInfluence",g),a.getUniforms().setValue(r,"morphTargetInfluences",t)}}}function ph(r,e,t,n){let i=new WeakMap;function o(s){const a=s.target;a.removeEventListener("dispose",o),t.remove(a.instanceMatrix),a.instanceColor!==null&&t.remove(a.instanceColor)}return{update:function(s){const a=n.render.frame,l=s.geometry,u=e.get(s,l);return i.get(u)!==a&&(e.update(u),i.set(u,a)),s.isInstancedMesh&&(s.hasEventListener("dispose",o)===!1&&s.addEventListener("dispose",o),t.update(s.instanceMatrix,34962),s.instanceColor!==null&&t.update(s.instanceColor,34962)),u},dispose:function(){i=new WeakMap}}}sr.physical={uniforms:Si([sr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Qe(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new gt(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Qe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new gt(0)}}]),vertexShader:Lt.meshphysical_vert,fragmentShader:Lt.meshphysical_frag};class fh extends $n{constructor(e=null,t=1,n=1,i=1){super(null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=Zn,this.minFilter=Zn,this.wrapR=mi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}fh.prototype.isDataTexture2DArray=!0;class xr extends $n{constructor(e=null,t=1,n=1,i=1){super(null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=Zn,this.minFilter=Zn,this.wrapR=mi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}xr.prototype.isDataTexture3D=!0;const Qo=new $n,vf=new fh,Ig=new xr,_f=new Br,yf=[],nd=[],id=new Float32Array(16),rd=new Float32Array(9),od=new Float32Array(4);function Na(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let o=yf[i];if(o===void 0&&(o=new Float32Array(i),yf[i]=o),e!==0){n.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=t,r[s].toArray(o,a)}return o}function Gi(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function Li(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function ar(r,e){let t=nd[e];t===void 0&&(t=new Int32Array(e),nd[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function Lg(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function xf(r,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y||(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Gi(t,e))return;r.uniform2fv(this.addr,e),Li(t,e)}}function Og(r,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y&&t[2]===e.z||(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)t[0]===e.r&&t[1]===e.g&&t[2]===e.b||(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Gi(t,e))return;r.uniform3fv(this.addr,e),Li(t,e)}}function sd(r,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y&&t[2]===e.z&&t[3]===e.w||(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Gi(t,e))return;r.uniform4fv(this.addr,e),Li(t,e)}}function Dg(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Gi(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),Li(t,e)}else{if(Gi(t,n))return;od.set(n),r.uniformMatrix2fv(this.addr,!1,od),Li(t,n)}}function Ng(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Gi(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),Li(t,e)}else{if(Gi(t,n))return;rd.set(n),r.uniformMatrix3fv(this.addr,!1,rd),Li(t,n)}}function Fg(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Gi(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),Li(t,e)}else{if(Gi(t,n))return;id.set(n),r.uniformMatrix4fv(this.addr,!1,id),Li(t,n)}}function ad(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function bf(r,e){const t=this.cache;Gi(t,e)||(r.uniform2iv(this.addr,e),Li(t,e))}function Bg(r,e){const t=this.cache;Gi(t,e)||(r.uniform3iv(this.addr,e),Li(t,e))}function Ug(r,e){const t=this.cache;Gi(t,e)||(r.uniform4iv(this.addr,e),Li(t,e))}function kg(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function Gg(r,e){const t=this.cache;Gi(t,e)||(r.uniform2uiv(this.addr,e),Li(t,e))}function Hg(r,e){const t=this.cache;Gi(t,e)||(r.uniform3uiv(this.addr,e),Li(t,e))}function zg(r,e){const t=this.cache;Gi(t,e)||(r.uniform4uiv(this.addr,e),Li(t,e))}function wf(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.safeSetTexture2D(e||Qo,i)}function mh(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Ig,i)}function Vg(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.safeSetTextureCube(e||_f,i)}function jg(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||vf,i)}function Wg(r,e){r.uniform1fv(this.addr,e)}function Xg(r,e){const t=Na(e,this.size,2);r.uniform2fv(this.addr,t)}function Tf(r,e){const t=Na(e,this.size,3);r.uniform3fv(this.addr,t)}function Sf(r,e){const t=Na(e,this.size,4);r.uniform4fv(this.addr,t)}function Yg(r,e){const t=Na(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function qg(r,e){const t=Na(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function Zg(r,e){const t=Na(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function gh(r,e){r.uniform1iv(this.addr,e)}function Jg(r,e){r.uniform2iv(this.addr,e)}function $g(r,e){r.uniform3iv(this.addr,e)}function vh(r,e){r.uniform4iv(this.addr,e)}function Ef(r,e){r.uniform1uiv(this.addr,e)}function Mf(r,e){r.uniform2uiv(this.addr,e)}function ld(r,e){r.uniform3uiv(this.addr,e)}function Af(r,e){r.uniform4uiv(this.addr,e)}function Pf(r,e,t){const n=e.length,i=ar(t,n);r.uniform1iv(this.addr,i);for(let o=0;o!==n;++o)t.safeSetTexture2D(e[o]||Qo,i[o])}function Kg(r,e,t){const n=e.length,i=ar(t,n);r.uniform1iv(this.addr,i);for(let o=0;o!==n;++o)t.safeSetTextureCube(e[o]||_f,i[o])}function Qg(r,e,t){this.id=r,this.addr=t,this.cache=[],this.setValue=function(n){switch(n){case 5126:return Lg;case 35664:return xf;case 35665:return Og;case 35666:return sd;case 35674:return Dg;case 35675:return Ng;case 35676:return Fg;case 5124:case 35670:return ad;case 35667:case 35671:return bf;case 35668:case 35672:return Bg;case 35669:case 35673:return Ug;case 5125:return kg;case 36294:return Gg;case 36295:return Hg;case 36296:return zg;case 35678:case 36198:case 36298:case 36306:case 35682:return wf;case 35679:case 36299:case 36307:return mh;case 35680:case 36300:case 36308:case 36293:return Vg;case 36289:case 36303:case 36311:case 36292:return jg}}(e.type)}function Ol(r,e,t){this.id=r,this.addr=t,this.cache=[],this.size=e.size,this.setValue=function(n){switch(n){case 5126:return Wg;case 35664:return Xg;case 35665:return Tf;case 35666:return Sf;case 35674:return Yg;case 35675:return qg;case 35676:return Zg;case 5124:case 35670:return gh;case 35667:case 35671:return Jg;case 35668:case 35672:return $g;case 35669:case 35673:return vh;case 5125:return Ef;case 36294:return Mf;case 36295:return ld;case 36296:return Af;case 35678:case 36198:case 36298:case 36306:case 35682:return Pf;case 35680:case 36300:case 36308:case 36293:return Kg}}(e.type)}function Dl(r){this.id=r,this.seq=[],this.map={}}Ol.prototype.updateCache=function(r){const e=this.cache;r instanceof Float32Array&&e.length!==r.length&&(this.cache=new Float32Array(r.length)),Li(e,r)},Dl.prototype.setValue=function(r,e,t){const n=this.seq;for(let i=0,o=n.length;i!==o;++i){const s=n[i];s.setValue(r,e[s.id],t)}};const ud=/(\w+)(\])?(\[|\.)?/g;function _h(r,e){r.seq.push(e),r.map[e.id]=e}function Cf(r,e,t){const n=r.name,i=n.length;for(ud.lastIndex=0;;){const o=ud.exec(n),s=ud.lastIndex;let a=o[1];const l=o[2]==="]",u=o[3];if(l&&(a|=0),u===void 0||u==="["&&s+2===i){_h(t,u===void 0?new Qg(a,r,e):new Ol(a,r,e));break}{let c=t.map[a];c===void 0&&(c=new Dl(a),_h(t,c)),t=c}}}function es(r,e){this.seq=[],this.map={};const t=r.getProgramParameter(e,35718);for(let n=0;n<t;++n){const i=r.getActiveUniform(e,n);Cf(i,r.getUniformLocation(e,i.name),this)}}function br(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}es.prototype.setValue=function(r,e,t,n){const i=this.map[e];i!==void 0&&i.setValue(r,t,n)},es.prototype.setOptional=function(r,e,t){const n=e[t];n!==void 0&&this.setValue(r,t,n)},es.upload=function(r,e,t,n){for(let i=0,o=e.length;i!==o;++i){const s=e[i],a=t[s.id];a.needsUpdate!==!1&&s.setValue(r,a.value,n)}},es.seqWithValue=function(r,e){const t=[];for(let n=0,i=r.length;n!==i;++n){const o=r[n];o.id in e&&t.push(o)}return t};let ev=0;function Rf(r){switch(r){case wt:return["Linear","( value )"];case $t:return["sRGB","( value )"];case nr:return["RGBE","( value )"];case ml:return["RGBM","( value, 7.0 )"];case Ic:return["RGBM","( value, 16.0 )"];case Xi:return["RGBD","( value, 256.0 )"];case zn:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case xn:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",r),["Linear","( value )"]}}function ts(r,e,t){const n=r.getShaderParameter(e,35713),i=r.getShaderInfoLog(e).trim();return n&&i===""?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+t+`
|
|
2929
2929
|
`+i+function(o){const s=o.split(`
|
|
2930
2930
|
`);for(let a=0;a<s.length;a++)s[a]=a+1+": "+s[a];return s.join(`
|
|
2931
2931
|
`)}(r.getShaderSource(e))}function Ut(r,e){const t=Rf(e);return"vec4 "+r+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function tv(r,e){const t=Rf(e);return"vec4 "+r+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function Zi(r,e){let t;switch(e){case Cp:t="Linear";break;case Rp:t="Reinhard";break;case Ip:t="OptimizedCineon";break;case Lp:t="ACESFilmic";break;case Op:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function An(r){return r!==""}function So(r,e){return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function If(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const hd=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ur(r){return r.replace(hd,Lf)}function Lf(r,e){const t=Lt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return Ur(t)}const yh=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Bn=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Un(r){return r.replace(Bn,cd).replace(yh,Of)}function Of(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),cd(r,e,t,n)}function cd(r,e,t,n){let i="";for(let o=parseInt(e);o<parseInt(t);o++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return i}function Fa(r){let e="precision "+r.precision+` float;
|
|
2932
2932
|
precision `+r.precision+" int;";return r.precision==="highp"?e+=`
|
|
2933
2933
|
#define HIGH_PRECISION`:r.precision==="mediump"?e+=`
|
|
2934
2934
|
#define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
|
|
2935
|
-
#define LOW_PRECISION`),e}function dd(r,e,t,n){const i=r.getContext(),o=t.defines;let s=t.vertexShader,a=t.fragmentShader;const l=function(G){let he="SHADOWMAP_TYPE_BASIC";return G.shadowMapType===O?he="SHADOWMAP_TYPE_PCF":G.shadowMapType===
|
|
2935
|
+
#define LOW_PRECISION`),e}function dd(r,e,t,n){const i=r.getContext(),o=t.defines;let s=t.vertexShader,a=t.fragmentShader;const l=function(G){let he="SHADOWMAP_TYPE_BASIC";return G.shadowMapType===O?he="SHADOWMAP_TYPE_PCF":G.shadowMapType===V?he="SHADOWMAP_TYPE_PCF_SOFT":G.shadowMapType===D&&(he="SHADOWMAP_TYPE_VSM"),he}(t),u=function(G){let he="ENVMAP_TYPE_CUBE";if(G.envMap)switch(G.envMapMode){case ko:case ol:he="ENVMAP_TYPE_CUBE";break;case fa:case ma:he="ENVMAP_TYPE_CUBE_UV"}return he}(t),c=function(G){let he="ENVMAP_MODE_REFLECTION";if(G.envMap)switch(G.envMapMode){case ol:case ma:he="ENVMAP_MODE_REFRACTION"}return he}(t),d=function(G){let he="ENVMAP_BLENDING_NONE";if(G.envMap)switch(G.combine){case rl:he="ENVMAP_BLENDING_MULTIPLY";break;case Ap:he="ENVMAP_BLENDING_MIX";break;case Pp:he="ENVMAP_BLENDING_ADD"}return he}(t),f=r.gammaFactor>0?r.gammaFactor:1,m=t.isWebGL2?"":function(G){return[G.extensionDerivatives||G.envMapCubeUV||G.bumpMap||G.tangentSpaceNormalMap||G.clearcoatNormalMap||G.flatShading||G.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(G.extensionFragDepth||G.logarithmicDepthBuffer)&&G.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",G.extensionDrawBuffers&&G.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(G.extensionShaderTextureLOD||G.envMap||G.transmission>0)&&G.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(An).join(`
|
|
2936
2936
|
`)}(t),g=function(G){const he=[];for(const ne in G){const Z=G[ne];Z!==!1&&he.push("#define "+ne+" "+Z)}return he.join(`
|
|
2937
2937
|
`)}(o),_=i.createProgram();let y,w,M=t.glslVersion?"#version "+t.glslVersion+`
|
|
2938
2938
|
`:"";t.isRawShaderMaterial?(y=[g].filter(An).join(`
|
|
@@ -2948,7 +2948,7 @@ precision `+r.precision+" int;";return r.precision==="highp"?e+=`
|
|
|
2948
2948
|
`)+`
|
|
2949
2949
|
`+y,w=["#define varying in",t.glslVersion===Dc?"":"out highp vec4 pc_fragColor;",t.glslVersion===Dc?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
|
|
2950
2950
|
`)+`
|
|
2951
|
-
`+w);const I=M+w+a,F=br(i,35633,M+y+s),C=br(i,35632,I);if(i.attachShader(_,F),i.attachShader(_,C),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_),r.debug.checkShaderErrors){const G=i.getProgramInfoLog(_).trim(),he=i.getShaderInfoLog(F).trim(),ne=i.getShaderInfoLog(C).trim();let Z=!0,Q=!0;if(i.getProgramParameter(_,35714)===!1){Z=!1;const $=ts(i,F,"vertex"),se=ts(i,C,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(_,35715),"gl.getProgramInfoLog",G,$,se)}else G!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",G):he!==""&&ne!==""||(Q=!1);Q&&(this.diagnostics={runnable:Z,programLog:G,vertexShader:{log:he,prefix:y},fragmentShader:{log:ne,prefix:w}})}let U,N;return i.deleteShader(F),i.deleteShader(C),this.getUniforms=function(){return U===void 0&&(U=new es(i,_)),U},this.getAttributes=function(){return N===void 0&&(N=function(G,he){const ne={},Z=G.getProgramParameter(he,35721);for(let Q=0;Q<Z;Q++){const $=G.getActiveAttrib(he,Q).name;ne[$]=G.getAttribLocation(he,$)}return ne}(i,_)),N},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.name=t.shaderName,this.id=ev++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=F,this.fragmentShader=C,this}function Df(r,e,t,n,i,o){const s=[],a=n.isWebGL2,l=n.logarithmicDepthBuffer,u=n.floatVertexTextures,c=n.maxVertexUniforms,d=n.vertexTextures;let f=n.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},g=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function _(y){let w;return y&&y.isTexture?w=y.encoding:y&&y.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),w=y.texture.encoding):w=wt,w}return{getParameters:function(y,w,M,I,F){const C=I.fog,U=y.isMeshStandardMaterial?I.environment:null,N=e.get(y.envMap||U),G=m[y.type],he=F.isSkinnedMesh?function($){const se=$.skeleton.bones;if(u)return 1024;{const me=c,ge=Math.floor((me-20)/4),de=Math.min(ge,se.length);return de<se.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+se.length+" bones. This GPU supports "+de+"."),0):de}}(F):0;let ne,Z;if(y.precision!==null&&(f=n.getMaxPrecision(y.precision),f!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",f,"instead.")),G){const $=sr[G];ne=$.vertexShader,Z=$.fragmentShader}else ne=y.vertexShader,Z=y.fragmentShader;const Q=r.getRenderTarget();return{isWebGL2:a,shaderID:G,shaderName:y.type,vertexShader:ne,fragmentShader:Z,defines:y.defines,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:f,instancing:F.isInstancedMesh===!0,instancingColor:F.isInstancedMesh===!0&&F.instanceColor!==null,supportsVertexTextures:d,outputEncoding:Q!==null?_(Q.texture):r.outputEncoding,map:!!y.map,mapEncoding:_(y.map),matcap:!!y.matcap,matcapEncoding:_(y.matcap),envMap:!!N,envMapMode:N&&N.mapping,envMapEncoding:_(N),envMapCubeUV:!!N&&(N.mapping===fa||N.mapping===ma),lightMap:!!y.lightMap,lightMapEncoding:_(y.lightMap),aoMap:!!y.aoMap,emissiveMap:!!y.emissiveMap,emissiveMapEncoding:_(y.emissiveMap),bumpMap:!!y.bumpMap,normalMap:!!y.normalMap,objectSpaceNormalMap:y.normalMapType===vl,tangentSpaceNormalMap:y.normalMapType===pr,clearcoatMap:!!y.clearcoatMap,clearcoatRoughnessMap:!!y.clearcoatRoughnessMap,clearcoatNormalMap:!!y.clearcoatNormalMap,displacementMap:!!y.displacementMap,roughnessMap:!!y.roughnessMap,metalnessMap:!!y.metalnessMap,specularMap:!!y.specularMap,alphaMap:!!y.alphaMap,gradientMap:!!y.gradientMap,sheen:!!y.sheen,transmission:!!y.transmission,transmissionMap:!!y.transmissionMap,thicknessMap:!!y.thicknessMap,combine:y.combine,vertexTangents:y.normalMap&&y.vertexTangents,vertexColors:y.vertexColors,vertexAlphas:y.vertexColors===!0&&F.geometry&&F.geometry.attributes.color&&F.geometry.attributes.color.itemSize===4,vertexUvs:!!(y.map||y.bumpMap||y.normalMap||y.specularMap||y.alphaMap||y.emissiveMap||y.roughnessMap||y.metalnessMap||y.clearcoatMap||y.clearcoatRoughnessMap||y.clearcoatNormalMap||y.displacementMap||y.transmissionMap||y.thicknessMap),uvsVertexOnly:!(y.map||y.bumpMap||y.normalMap||y.specularMap||y.alphaMap||y.emissiveMap||y.roughnessMap||y.metalnessMap||y.clearcoatNormalMap||y.transmission||y.transmissionMap||y.thicknessMap||!y.displacementMap),fog:!!C,useFog:y.fog,fogExp2:C&&C.isFogExp2,flatShading:!!y.flatShading,sizeAttenuation:y.sizeAttenuation,logarithmicDepthBuffer:l,skinning:F.isSkinnedMesh===!0&&he>0,maxBones:he,useVertexTexture:u,morphTargets:y.morphTargets,morphNormals:y.morphNormals,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:y.dithering,shadowMapEnabled:r.shadowMap.enabled&&M.length>0,shadowMapType:r.shadowMap.type,toneMapping:y.toneMapped?r.toneMapping:uo,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:y.premultipliedAlpha,alphaTest:y.alphaTest,doubleSided:y.side===ee,flipSided:y.side===W,depthPacking:y.depthPacking!==void 0&&y.depthPacking,index0AttributeName:y.index0AttributeName,extensionDerivatives:y.extensions&&y.extensions.derivatives,extensionFragDepth:y.extensions&&y.extensions.fragDepth,extensionDrawBuffers:y.extensions&&y.extensions.drawBuffers,extensionShaderTextureLOD:y.extensions&&y.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||t.has("EXT_frag_depth"),rendererExtensionDrawBuffers:a||t.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||t.has("EXT_shader_texture_lod"),customProgramCacheKey:y.customProgramCacheKey()}},getProgramCacheKey:function(y){const w=[];if(y.shaderID?w.push(y.shaderID):(w.push(y.fragmentShader),w.push(y.vertexShader)),y.defines!==void 0)for(const M in y.defines)w.push(M),w.push(y.defines[M]);if(y.isRawShaderMaterial===!1){for(let M=0;M<g.length;M++)w.push(y[g[M]]);w.push(r.outputEncoding),w.push(r.gammaFactor)}return w.push(y.customProgramCacheKey),w.join()},getUniforms:function(y){const w=m[y.type];let M;if(w){const I=sr[w];M=eo.clone(I.uniforms)}else M=y.uniforms;return M},acquireProgram:function(y,w){let M;for(let I=0,F=s.length;I<F;I++){const C=s[I];if(C.cacheKey===w){M=C,++M.usedTimes;break}}return M===void 0&&(M=new dd(r,w,y,i),s.push(M)),M},releaseProgram:function(y){if(--y.usedTimes==0){const w=s.indexOf(y);s[w]=s[s.length-1],s.pop(),y.destroy()}},programs:s}}function xh(){let r=new WeakMap;return{get:function(e){let t=r.get(e);return t===void 0&&(t={},r.set(e,t)),t},remove:function(e){r.delete(e)},update:function(e,t,n){r.get(e)[t]=n},dispose:function(){r=new WeakMap}}}function lr(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.program!==e.program?r.program.id-e.program.id:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function Xs(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Nf(r){const e=[];let t=0;const n=[],i=[],o=[],s={id:-1};function a(l,u,c,d,f,m){let g=e[t];const _=r.get(c);return g===void 0?(g={id:l.id,object:l,geometry:u,material:c,program:_.program||s,groupOrder:d,renderOrder:l.renderOrder,z:f,group:m},e[t]=g):(g.id=l.id,g.object=l,g.geometry=u,g.material=c,g.program=_.program||s,g.groupOrder=d,g.renderOrder=l.renderOrder,g.z=f,g.group=m),t++,g}return{opaque:n,transmissive:i,transparent:o,init:function(){t=0,n.length=0,i.length=0,o.length=0},push:function(l,u,c,d,f,m){const g=a(l,u,c,d,f,m);c.transmission>0?i.push(g):c.transparent===!0?o.push(g):n.push(g)},unshift:function(l,u,c,d,f,m){const g=a(l,u,c,d,f,m);c.transmission>0?i.unshift(g):c.transparent===!0?o.unshift(g):n.unshift(g)},finish:function(){for(let l=t,u=e.length;l<u;l++){const c=e[l];if(c.id===null)break;c.id=null,c.object=null,c.geometry=null,c.material=null,c.program=null,c.group=null}},sort:function(l,u){n.length>1&&n.sort(l||lr),i.length>1&&i.sort(u||Xs),o.length>1&&o.sort(u||Xs)}}}function nv(r){let e=new WeakMap;return{get:function(t,n){let i;return e.has(t)===!1?(i=new Nf(r),e.set(t,[i])):n>=e.get(t).length?(i=new Nf(r),e.get(t).push(i)):i=e.get(t)[n],i},dispose:function(){e=new WeakMap}}}function Ff(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new T,color:new gt};break;case"SpotLight":t={position:new T,direction:new T,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new T,color:new gt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new T,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":t={color:new gt,position:new T,halfWidth:new T,halfHeight:new T}}return r[e.id]=t,t}}}let Eo=0;function qt(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function Bf(r,e){const t=new Ff,n=function(){const l={};return{get:function(u){if(l[u.id]!==void 0)return l[u.id];let c;switch(u.type){case"DirectionalLight":case"SpotLight":c={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe};break;case"PointLight":c={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe,shadowCameraNear:1,shadowCameraFar:1e3}}return l[u.id]=c,c}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let l=0;l<9;l++)i.probe.push(new T);const o=new T,s=new pt,a=new pt;return{setup:function(l){let u=0,c=0,d=0;for(let C=0;C<9;C++)i.probe[C].set(0,0,0);let f=0,m=0,g=0,_=0,y=0,w=0,M=0,I=0;l.sort(qt);for(let C=0,U=l.length;C<U;C++){const N=l[C],G=N.color,he=N.intensity,ne=N.distance,Z=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)u+=G.r*he,c+=G.g*he,d+=G.b*he;else if(N.isLightProbe)for(let Q=0;Q<9;Q++)i.probe[Q].addScaledVector(N.sh.coefficients[Q],he);else if(N.isDirectionalLight){const Q=t.get(N);if(Q.color.copy(N.color).multiplyScalar(N.intensity),N.castShadow){const $=N.shadow,se=n.get(N);se.shadowBias=$.bias,se.shadowNormalBias=$.normalBias,se.shadowRadius=$.radius,se.shadowMapSize=$.mapSize,i.directionalShadow[f]=se,i.directionalShadowMap[f]=Z,i.directionalShadowMatrix[f]=N.shadow.matrix,w++}i.directional[f]=Q,f++}else if(N.isSpotLight){const Q=t.get(N);if(Q.position.setFromMatrixPosition(N.matrixWorld),Q.color.copy(G).multiplyScalar(he),Q.distance=ne,Q.coneCos=Math.cos(N.angle),Q.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),Q.decay=N.decay,N.castShadow){const $=N.shadow,se=n.get(N);se.shadowBias=$.bias,se.shadowNormalBias=$.normalBias,se.shadowRadius=$.radius,se.shadowMapSize=$.mapSize,i.spotShadow[g]=se,i.spotShadowMap[g]=Z,i.spotShadowMatrix[g]=N.shadow.matrix,I++}i.spot[g]=Q,g++}else if(N.isRectAreaLight){const Q=t.get(N);Q.color.copy(G).multiplyScalar(he),Q.halfWidth.set(.5*N.width,0,0),Q.halfHeight.set(0,.5*N.height,0),i.rectArea[_]=Q,_++}else if(N.isPointLight){const Q=t.get(N);if(Q.color.copy(N.color).multiplyScalar(N.intensity),Q.distance=N.distance,Q.decay=N.decay,N.castShadow){const $=N.shadow,se=n.get(N);se.shadowBias=$.bias,se.shadowNormalBias=$.normalBias,se.shadowRadius=$.radius,se.shadowMapSize=$.mapSize,se.shadowCameraNear=$.camera.near,se.shadowCameraFar=$.camera.far,i.pointShadow[m]=se,i.pointShadowMap[m]=Z,i.pointShadowMatrix[m]=N.shadow.matrix,M++}i.point[m]=Q,m++}else if(N.isHemisphereLight){const Q=t.get(N);Q.skyColor.copy(N.color).multiplyScalar(he),Q.groundColor.copy(N.groundColor).multiplyScalar(he),i.hemi[y]=Q,y++}}_>0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=dt.LTC_FLOAT_1,i.rectAreaLTC2=dt.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=dt.LTC_HALF_1,i.rectAreaLTC2=dt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=u,i.ambient[1]=c,i.ambient[2]=d;const F=i.hash;F.directionalLength===f&&F.pointLength===m&&F.spotLength===g&&F.rectAreaLength===_&&F.hemiLength===y&&F.numDirectionalShadows===w&&F.numPointShadows===M&&F.numSpotShadows===I||(i.directional.length=f,i.spot.length=g,i.rectArea.length=_,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=w,i.directionalShadowMap.length=w,i.pointShadow.length=M,i.pointShadowMap.length=M,i.spotShadow.length=I,i.spotShadowMap.length=I,i.directionalShadowMatrix.length=w,i.pointShadowMatrix.length=M,i.spotShadowMatrix.length=I,F.directionalLength=f,F.pointLength=m,F.spotLength=g,F.rectAreaLength=_,F.hemiLength=y,F.numDirectionalShadows=w,F.numPointShadows=M,F.numSpotShadows=I,i.version=Eo++)},setupView:function(l,u){let c=0,d=0,f=0,m=0,g=0;const _=u.matrixWorldInverse;for(let y=0,w=l.length;y<w;y++){const M=l[y];if(M.isDirectionalLight){const I=i.directional[c];I.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),I.direction.sub(o),I.direction.transformDirection(_),c++}else if(M.isSpotLight){const I=i.spot[f];I.position.setFromMatrixPosition(M.matrixWorld),I.position.applyMatrix4(_),I.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),I.direction.sub(o),I.direction.transformDirection(_),f++}else if(M.isRectAreaLight){const I=i.rectArea[m];I.position.setFromMatrixPosition(M.matrixWorld),I.position.applyMatrix4(_),a.identity(),s.copy(M.matrixWorld),s.premultiply(_),a.extractRotation(s),I.halfWidth.set(.5*M.width,0,0),I.halfHeight.set(0,.5*M.height,0),I.halfWidth.applyMatrix4(a),I.halfHeight.applyMatrix4(a),m++}else if(M.isPointLight){const I=i.point[d];I.position.setFromMatrixPosition(M.matrixWorld),I.position.applyMatrix4(_),d++}else if(M.isHemisphereLight){const I=i.hemi[g];I.direction.setFromMatrixPosition(M.matrixWorld),I.direction.transformDirection(_),I.direction.normalize(),g++}}},state:i}}function ur(r,e){const t=new Bf(r,e),n=[],i=[];return{init:function(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:t},setupLights:function(){t.setup(n)},setupLightsView:function(o){t.setupView(n,o)},pushLight:function(o){n.push(o)},pushShadow:function(o){i.push(o)}}}function Uf(r,e){let t=new WeakMap;return{get:function(n,i=0){let o;return t.has(n)===!1?(o=new ur(r,e),t.set(n,[o])):i>=t.get(n).length?(o=new ur(r,e),t.get(n).push(o)):o=t.get(n)[i],o},dispose:function(){t=new WeakMap}}}class on extends vi{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=gl,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}on.prototype.isMeshDepthMaterial=!0;class bh extends vi{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new T,this.nearDistance=1,this.farDistance=1e3,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}bh.prototype.isMeshDistanceMaterial=!0;function pd(r,e,t){let n=new Da;const i=new Qe,o=new Qe,s=new pn,a=[],l=[],u={},c=t.maxTextureSize,d={0:W,1:z,2:ee},f=new ki({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Qe},radius:{value:4}},vertexShader:`void main() {
|
|
2951
|
+
`+w);const I=M+w+a,F=br(i,35633,M+y+s),R=br(i,35632,I);if(i.attachShader(_,F),i.attachShader(_,R),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_),r.debug.checkShaderErrors){const G=i.getProgramInfoLog(_).trim(),he=i.getShaderInfoLog(F).trim(),ne=i.getShaderInfoLog(R).trim();let Z=!0,Q=!0;if(i.getProgramParameter(_,35714)===!1){Z=!1;const $=ts(i,F,"vertex"),se=ts(i,R,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(_,35715),"gl.getProgramInfoLog",G,$,se)}else G!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",G):he!==""&&ne!==""||(Q=!1);Q&&(this.diagnostics={runnable:Z,programLog:G,vertexShader:{log:he,prefix:y},fragmentShader:{log:ne,prefix:w}})}let U,N;return i.deleteShader(F),i.deleteShader(R),this.getUniforms=function(){return U===void 0&&(U=new es(i,_)),U},this.getAttributes=function(){return N===void 0&&(N=function(G,he){const ne={},Z=G.getProgramParameter(he,35721);for(let Q=0;Q<Z;Q++){const $=G.getActiveAttrib(he,Q).name;ne[$]=G.getAttribLocation(he,$)}return ne}(i,_)),N},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.name=t.shaderName,this.id=ev++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=F,this.fragmentShader=R,this}function Df(r,e,t,n,i,o){const s=[],a=n.isWebGL2,l=n.logarithmicDepthBuffer,u=n.floatVertexTextures,c=n.maxVertexUniforms,d=n.vertexTextures;let f=n.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},g=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function _(y){let w;return y&&y.isTexture?w=y.encoding:y&&y.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),w=y.texture.encoding):w=wt,w}return{getParameters:function(y,w,M,I,F){const R=I.fog,U=y.isMeshStandardMaterial?I.environment:null,N=e.get(y.envMap||U),G=m[y.type],he=F.isSkinnedMesh?function($){const se=$.skeleton.bones;if(u)return 1024;{const me=c,ge=Math.floor((me-20)/4),de=Math.min(ge,se.length);return de<se.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+se.length+" bones. This GPU supports "+de+"."),0):de}}(F):0;let ne,Z;if(y.precision!==null&&(f=n.getMaxPrecision(y.precision),f!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",f,"instead.")),G){const $=sr[G];ne=$.vertexShader,Z=$.fragmentShader}else ne=y.vertexShader,Z=y.fragmentShader;const Q=r.getRenderTarget();return{isWebGL2:a,shaderID:G,shaderName:y.type,vertexShader:ne,fragmentShader:Z,defines:y.defines,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:f,instancing:F.isInstancedMesh===!0,instancingColor:F.isInstancedMesh===!0&&F.instanceColor!==null,supportsVertexTextures:d,outputEncoding:Q!==null?_(Q.texture):r.outputEncoding,map:!!y.map,mapEncoding:_(y.map),matcap:!!y.matcap,matcapEncoding:_(y.matcap),envMap:!!N,envMapMode:N&&N.mapping,envMapEncoding:_(N),envMapCubeUV:!!N&&(N.mapping===fa||N.mapping===ma),lightMap:!!y.lightMap,lightMapEncoding:_(y.lightMap),aoMap:!!y.aoMap,emissiveMap:!!y.emissiveMap,emissiveMapEncoding:_(y.emissiveMap),bumpMap:!!y.bumpMap,normalMap:!!y.normalMap,objectSpaceNormalMap:y.normalMapType===vl,tangentSpaceNormalMap:y.normalMapType===pr,clearcoatMap:!!y.clearcoatMap,clearcoatRoughnessMap:!!y.clearcoatRoughnessMap,clearcoatNormalMap:!!y.clearcoatNormalMap,displacementMap:!!y.displacementMap,roughnessMap:!!y.roughnessMap,metalnessMap:!!y.metalnessMap,specularMap:!!y.specularMap,alphaMap:!!y.alphaMap,gradientMap:!!y.gradientMap,sheen:!!y.sheen,transmission:!!y.transmission,transmissionMap:!!y.transmissionMap,thicknessMap:!!y.thicknessMap,combine:y.combine,vertexTangents:y.normalMap&&y.vertexTangents,vertexColors:y.vertexColors,vertexAlphas:y.vertexColors===!0&&F.geometry&&F.geometry.attributes.color&&F.geometry.attributes.color.itemSize===4,vertexUvs:!!(y.map||y.bumpMap||y.normalMap||y.specularMap||y.alphaMap||y.emissiveMap||y.roughnessMap||y.metalnessMap||y.clearcoatMap||y.clearcoatRoughnessMap||y.clearcoatNormalMap||y.displacementMap||y.transmissionMap||y.thicknessMap),uvsVertexOnly:!(y.map||y.bumpMap||y.normalMap||y.specularMap||y.alphaMap||y.emissiveMap||y.roughnessMap||y.metalnessMap||y.clearcoatNormalMap||y.transmission||y.transmissionMap||y.thicknessMap||!y.displacementMap),fog:!!R,useFog:y.fog,fogExp2:R&&R.isFogExp2,flatShading:!!y.flatShading,sizeAttenuation:y.sizeAttenuation,logarithmicDepthBuffer:l,skinning:F.isSkinnedMesh===!0&&he>0,maxBones:he,useVertexTexture:u,morphTargets:y.morphTargets,morphNormals:y.morphNormals,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:y.dithering,shadowMapEnabled:r.shadowMap.enabled&&M.length>0,shadowMapType:r.shadowMap.type,toneMapping:y.toneMapped?r.toneMapping:uo,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:y.premultipliedAlpha,alphaTest:y.alphaTest,doubleSided:y.side===ee,flipSided:y.side===W,depthPacking:y.depthPacking!==void 0&&y.depthPacking,index0AttributeName:y.index0AttributeName,extensionDerivatives:y.extensions&&y.extensions.derivatives,extensionFragDepth:y.extensions&&y.extensions.fragDepth,extensionDrawBuffers:y.extensions&&y.extensions.drawBuffers,extensionShaderTextureLOD:y.extensions&&y.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||t.has("EXT_frag_depth"),rendererExtensionDrawBuffers:a||t.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||t.has("EXT_shader_texture_lod"),customProgramCacheKey:y.customProgramCacheKey()}},getProgramCacheKey:function(y){const w=[];if(y.shaderID?w.push(y.shaderID):(w.push(y.fragmentShader),w.push(y.vertexShader)),y.defines!==void 0)for(const M in y.defines)w.push(M),w.push(y.defines[M]);if(y.isRawShaderMaterial===!1){for(let M=0;M<g.length;M++)w.push(y[g[M]]);w.push(r.outputEncoding),w.push(r.gammaFactor)}return w.push(y.customProgramCacheKey),w.join()},getUniforms:function(y){const w=m[y.type];let M;if(w){const I=sr[w];M=eo.clone(I.uniforms)}else M=y.uniforms;return M},acquireProgram:function(y,w){let M;for(let I=0,F=s.length;I<F;I++){const R=s[I];if(R.cacheKey===w){M=R,++M.usedTimes;break}}return M===void 0&&(M=new dd(r,w,y,i),s.push(M)),M},releaseProgram:function(y){if(--y.usedTimes==0){const w=s.indexOf(y);s[w]=s[s.length-1],s.pop(),y.destroy()}},programs:s}}function xh(){let r=new WeakMap;return{get:function(e){let t=r.get(e);return t===void 0&&(t={},r.set(e,t)),t},remove:function(e){r.delete(e)},update:function(e,t,n){r.get(e)[t]=n},dispose:function(){r=new WeakMap}}}function lr(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.program!==e.program?r.program.id-e.program.id:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function Xs(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Nf(r){const e=[];let t=0;const n=[],i=[],o=[],s={id:-1};function a(l,u,c,d,f,m){let g=e[t];const _=r.get(c);return g===void 0?(g={id:l.id,object:l,geometry:u,material:c,program:_.program||s,groupOrder:d,renderOrder:l.renderOrder,z:f,group:m},e[t]=g):(g.id=l.id,g.object=l,g.geometry=u,g.material=c,g.program=_.program||s,g.groupOrder=d,g.renderOrder=l.renderOrder,g.z=f,g.group=m),t++,g}return{opaque:n,transmissive:i,transparent:o,init:function(){t=0,n.length=0,i.length=0,o.length=0},push:function(l,u,c,d,f,m){const g=a(l,u,c,d,f,m);c.transmission>0?i.push(g):c.transparent===!0?o.push(g):n.push(g)},unshift:function(l,u,c,d,f,m){const g=a(l,u,c,d,f,m);c.transmission>0?i.unshift(g):c.transparent===!0?o.unshift(g):n.unshift(g)},finish:function(){for(let l=t,u=e.length;l<u;l++){const c=e[l];if(c.id===null)break;c.id=null,c.object=null,c.geometry=null,c.material=null,c.program=null,c.group=null}},sort:function(l,u){n.length>1&&n.sort(l||lr),i.length>1&&i.sort(u||Xs),o.length>1&&o.sort(u||Xs)}}}function nv(r){let e=new WeakMap;return{get:function(t,n){let i;return e.has(t)===!1?(i=new Nf(r),e.set(t,[i])):n>=e.get(t).length?(i=new Nf(r),e.get(t).push(i)):i=e.get(t)[n],i},dispose:function(){e=new WeakMap}}}function Ff(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new T,color:new gt};break;case"SpotLight":t={position:new T,direction:new T,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new T,color:new gt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new T,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":t={color:new gt,position:new T,halfWidth:new T,halfHeight:new T}}return r[e.id]=t,t}}}let Eo=0;function qt(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function Bf(r,e){const t=new Ff,n=function(){const l={};return{get:function(u){if(l[u.id]!==void 0)return l[u.id];let c;switch(u.type){case"DirectionalLight":case"SpotLight":c={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe};break;case"PointLight":c={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe,shadowCameraNear:1,shadowCameraFar:1e3}}return l[u.id]=c,c}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let l=0;l<9;l++)i.probe.push(new T);const o=new T,s=new pt,a=new pt;return{setup:function(l){let u=0,c=0,d=0;for(let R=0;R<9;R++)i.probe[R].set(0,0,0);let f=0,m=0,g=0,_=0,y=0,w=0,M=0,I=0;l.sort(qt);for(let R=0,U=l.length;R<U;R++){const N=l[R],G=N.color,he=N.intensity,ne=N.distance,Z=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)u+=G.r*he,c+=G.g*he,d+=G.b*he;else if(N.isLightProbe)for(let Q=0;Q<9;Q++)i.probe[Q].addScaledVector(N.sh.coefficients[Q],he);else if(N.isDirectionalLight){const Q=t.get(N);if(Q.color.copy(N.color).multiplyScalar(N.intensity),N.castShadow){const $=N.shadow,se=n.get(N);se.shadowBias=$.bias,se.shadowNormalBias=$.normalBias,se.shadowRadius=$.radius,se.shadowMapSize=$.mapSize,i.directionalShadow[f]=se,i.directionalShadowMap[f]=Z,i.directionalShadowMatrix[f]=N.shadow.matrix,w++}i.directional[f]=Q,f++}else if(N.isSpotLight){const Q=t.get(N);if(Q.position.setFromMatrixPosition(N.matrixWorld),Q.color.copy(G).multiplyScalar(he),Q.distance=ne,Q.coneCos=Math.cos(N.angle),Q.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),Q.decay=N.decay,N.castShadow){const $=N.shadow,se=n.get(N);se.shadowBias=$.bias,se.shadowNormalBias=$.normalBias,se.shadowRadius=$.radius,se.shadowMapSize=$.mapSize,i.spotShadow[g]=se,i.spotShadowMap[g]=Z,i.spotShadowMatrix[g]=N.shadow.matrix,I++}i.spot[g]=Q,g++}else if(N.isRectAreaLight){const Q=t.get(N);Q.color.copy(G).multiplyScalar(he),Q.halfWidth.set(.5*N.width,0,0),Q.halfHeight.set(0,.5*N.height,0),i.rectArea[_]=Q,_++}else if(N.isPointLight){const Q=t.get(N);if(Q.color.copy(N.color).multiplyScalar(N.intensity),Q.distance=N.distance,Q.decay=N.decay,N.castShadow){const $=N.shadow,se=n.get(N);se.shadowBias=$.bias,se.shadowNormalBias=$.normalBias,se.shadowRadius=$.radius,se.shadowMapSize=$.mapSize,se.shadowCameraNear=$.camera.near,se.shadowCameraFar=$.camera.far,i.pointShadow[m]=se,i.pointShadowMap[m]=Z,i.pointShadowMatrix[m]=N.shadow.matrix,M++}i.point[m]=Q,m++}else if(N.isHemisphereLight){const Q=t.get(N);Q.skyColor.copy(N.color).multiplyScalar(he),Q.groundColor.copy(N.groundColor).multiplyScalar(he),i.hemi[y]=Q,y++}}_>0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=dt.LTC_FLOAT_1,i.rectAreaLTC2=dt.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=dt.LTC_HALF_1,i.rectAreaLTC2=dt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=u,i.ambient[1]=c,i.ambient[2]=d;const F=i.hash;F.directionalLength===f&&F.pointLength===m&&F.spotLength===g&&F.rectAreaLength===_&&F.hemiLength===y&&F.numDirectionalShadows===w&&F.numPointShadows===M&&F.numSpotShadows===I||(i.directional.length=f,i.spot.length=g,i.rectArea.length=_,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=w,i.directionalShadowMap.length=w,i.pointShadow.length=M,i.pointShadowMap.length=M,i.spotShadow.length=I,i.spotShadowMap.length=I,i.directionalShadowMatrix.length=w,i.pointShadowMatrix.length=M,i.spotShadowMatrix.length=I,F.directionalLength=f,F.pointLength=m,F.spotLength=g,F.rectAreaLength=_,F.hemiLength=y,F.numDirectionalShadows=w,F.numPointShadows=M,F.numSpotShadows=I,i.version=Eo++)},setupView:function(l,u){let c=0,d=0,f=0,m=0,g=0;const _=u.matrixWorldInverse;for(let y=0,w=l.length;y<w;y++){const M=l[y];if(M.isDirectionalLight){const I=i.directional[c];I.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),I.direction.sub(o),I.direction.transformDirection(_),c++}else if(M.isSpotLight){const I=i.spot[f];I.position.setFromMatrixPosition(M.matrixWorld),I.position.applyMatrix4(_),I.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),I.direction.sub(o),I.direction.transformDirection(_),f++}else if(M.isRectAreaLight){const I=i.rectArea[m];I.position.setFromMatrixPosition(M.matrixWorld),I.position.applyMatrix4(_),a.identity(),s.copy(M.matrixWorld),s.premultiply(_),a.extractRotation(s),I.halfWidth.set(.5*M.width,0,0),I.halfHeight.set(0,.5*M.height,0),I.halfWidth.applyMatrix4(a),I.halfHeight.applyMatrix4(a),m++}else if(M.isPointLight){const I=i.point[d];I.position.setFromMatrixPosition(M.matrixWorld),I.position.applyMatrix4(_),d++}else if(M.isHemisphereLight){const I=i.hemi[g];I.direction.setFromMatrixPosition(M.matrixWorld),I.direction.transformDirection(_),I.direction.normalize(),g++}}},state:i}}function ur(r,e){const t=new Bf(r,e),n=[],i=[];return{init:function(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:t},setupLights:function(){t.setup(n)},setupLightsView:function(o){t.setupView(n,o)},pushLight:function(o){n.push(o)},pushShadow:function(o){i.push(o)}}}function Uf(r,e){let t=new WeakMap;return{get:function(n,i=0){let o;return t.has(n)===!1?(o=new ur(r,e),t.set(n,[o])):i>=t.get(n).length?(o=new ur(r,e),t.get(n).push(o)):o=t.get(n)[i],o},dispose:function(){t=new WeakMap}}}class on extends vi{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=gl,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}on.prototype.isMeshDepthMaterial=!0;class bh extends vi{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new T,this.nearDistance=1,this.farDistance=1e3,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}bh.prototype.isMeshDistanceMaterial=!0;function pd(r,e,t){let n=new Da;const i=new Qe,o=new Qe,s=new pn,a=[],l=[],u={},c=t.maxTextureSize,d={0:W,1:z,2:ee},f=new ki({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Qe},radius:{value:4}},vertexShader:`void main() {
|
|
2952
2952
|
gl_Position = vec4( position, 1.0 );
|
|
2953
2953
|
}`,fragmentShader:`uniform sampler2D shadow_pass;
|
|
2954
2954
|
uniform vec2 resolution;
|
|
@@ -2973,8 +2973,8 @@ void main() {
|
|
|
2973
2973
|
squared_mean = squared_mean * HALF_SAMPLE_RATE;
|
|
2974
2974
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
2975
2975
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
2976
|
-
}`}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new Mt;g.setAttribute("position",new Zt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new ln(g,f),y=this;function w(U,N){const G=e.update(_);f.uniforms.shadow_pass.value=U.map.texture,f.uniforms.resolution.value=U.mapSize,f.uniforms.radius.value=U.radius,r.setRenderTarget(U.mapPass),r.clear(),r.renderBufferDirect(N,null,G,f,_,null),m.uniforms.shadow_pass.value=U.mapPass.texture,m.uniforms.resolution.value=U.mapSize,m.uniforms.radius.value=U.radius,r.setRenderTarget(U.map),r.clear(),r.renderBufferDirect(N,null,G,m,_,null)}function M(U){const N=U<<0;let G=a[N];return G===void 0&&(G=new on({depthPacking:Lc,morphTargets:U}),a[N]=G),G}function I(U){const N=U<<0;let G=l[N];return G===void 0&&(G=new bh({morphTargets:U}),l[N]=G),G}function F(U,N,G,he,ne,Z,Q){let $=null,se=M,me=U.customDepthMaterial;if(he.isPointLight===!0&&(se=I,me=U.customDistanceMaterial),me===void 0){let ge=!1;G.morphTargets===!0&&(ge=N.morphAttributes&&N.morphAttributes.position&&N.morphAttributes.position.length>0),$=se(ge)}else $=me;if(r.localClippingEnabled&&G.clipShadows===!0&&G.clippingPlanes.length!==0){const ge=$.uuid,de=G.uuid;let fe=u[ge];fe===void 0&&(fe={},u[ge]=fe);let Re=fe[de];Re===void 0&&(Re=$.clone(),fe[de]=Re),$=Re}return $.visible=G.visible,$.wireframe=G.wireframe,$.side=Q===D?G.shadowSide!==null?G.shadowSide:G.side:G.shadowSide!==null?G.shadowSide:d[G.side],$.clipShadows=G.clipShadows,$.clippingPlanes=G.clippingPlanes,$.clipIntersection=G.clipIntersection,$.wireframeLinewidth=G.wireframeLinewidth,$.linewidth=G.linewidth,he.isPointLight===!0&&$.isMeshDistanceMaterial===!0&&($.referencePosition.setFromMatrixPosition(he.matrixWorld),$.nearDistance=ne,$.farDistance=Z),$}function C(U,N,G,he,ne){if(U.visible===!1)return;if(U.layers.test(N.layers)&&(U.isMesh||U.isLine||U.isPoints)&&(U.castShadow||U.receiveShadow&&ne===D)&&(!U.frustumCulled||n.intersectsObject(U))){U.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,U.matrixWorld);const Q=e.update(U),$=U.material;if(Array.isArray($)){const se=Q.groups;for(let me=0,ge=se.length;me<ge;me++){const de=se[me],fe=$[de.materialIndex];if(fe&&fe.visible){const Re=F(U,Q,fe,he,G.near,G.far,ne);r.renderBufferDirect(G,null,Q,Re,U,de)}}}else if($.visible){const se=F(U,Q,$,he,G.near,G.far,ne);r.renderBufferDirect(G,null,Q,se,U,null)}}const Z=U.children;for(let Q=0,$=Z.length;Q<$;Q++)C(Z[Q],N,G,he,ne)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=O,this.render=function(U,N,G){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||U.length===0)return;const he=r.getRenderTarget(),ne=r.getActiveCubeFace(),Z=r.getActiveMipmapLevel(),Q=r.state;Q.setBlending($e),Q.buffers.color.setClear(1,1,1,1),Q.buffers.depth.setTest(!0),Q.setScissorTest(!1);for(let $=0,se=U.length;$<se;$++){const me=U[$],ge=me.shadow;if(ge===void 0){console.warn("THREE.WebGLShadowMap:",me,"has no shadow.");continue}if(ge.autoUpdate===!1&&ge.needsUpdate===!1)continue;i.copy(ge.mapSize);const de=ge.getFrameExtents();if(i.multiply(de),o.copy(ge.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/de.x),i.x=o.x*de.x,ge.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/de.y),i.y=o.y*de.y,ge.mapSize.y=o.y)),ge.map===null&&!ge.isPointLightShadow&&this.type===D){const Re={minFilter:Jn,magFilter:Jn,format:er};ge.map=new Ir(i.x,i.y,Re),ge.map.texture.name=me.name+".shadowMap",ge.mapPass=new Ir(i.x,i.y,Re),ge.camera.updateProjectionMatrix()}if(ge.map===null){const Re={minFilter:Zn,magFilter:Zn,format:er};ge.map=new Ir(i.x,i.y,Re),ge.map.texture.name=me.name+".shadowMap",ge.camera.updateProjectionMatrix()}r.setRenderTarget(ge.map),r.clear();const fe=ge.getViewportCount();for(let Re=0;Re<fe;Re++){const ke=ge.getViewport(Re);s.set(o.x*ke.x,o.y*ke.y,o.x*ke.z,o.y*ke.w),Q.viewport(s),ge.updateMatrices(me,Re),n=ge.getFrustum(),C(N,G,ge.camera,me,this.type)}ge.isPointLightShadow||this.type!==D||w(ge,G),ge.needsUpdate=!1}y.needsUpdate=!1,r.setRenderTarget(he,ne,Z)}}function wh(r,e,t){const n=t.isWebGL2,i=new function(){let Y=!1;const pe=new pn;let ye=null;const xe=new pn(0,0,0,0);return{setMask:function(De){ye===De||Y||(r.colorMask(De,De,De,De),ye=De)},setLocked:function(De){Y=De},setClear:function(De,ht,xt,_t,Gt){Gt===!0&&(De*=_t,ht*=_t,xt*=_t),pe.set(De,ht,xt,_t),xe.equals(pe)===!1&&(r.clearColor(De,ht,xt,_t),xe.copy(pe))},reset:function(){Y=!1,ye=null,xe.set(-1,0,0,0)}}},o=new function(){let Y=!1,pe=null,ye=null,xe=null;return{setTest:function(De){De?Be(2929):J(2929)},setMask:function(De){pe===De||Y||(r.depthMask(De),pe=De)},setFunc:function(De){if(ye!==De){if(De)switch(De){case qn:r.depthFunc(512);break;case yn:r.depthFunc(519);break;case ai:r.depthFunc(513);break;case Fi:r.depthFunc(515);break;case Pi:r.depthFunc(514);break;case Vi:r.depthFunc(518);break;case Rr:r.depthFunc(516);break;case Mp:r.depthFunc(517);break;default:r.depthFunc(515)}else r.depthFunc(515);ye=De}},setLocked:function(De){Y=De},setClear:function(De){xe!==De&&(r.clearDepth(De),xe=De)},reset:function(){Y=!1,pe=null,ye=null,xe=null}}},s=new function(){let Y=!1,pe=null,ye=null,xe=null,De=null,ht=null,xt=null,_t=null,Gt=null;return{setTest:function(Wt){Y||(Wt?Be(2960):J(2960))},setMask:function(Wt){pe===Wt||Y||(r.stencilMask(Wt),pe=Wt)},setFunc:function(Wt,si,Cn){ye===Wt&&xe===si&&De===Cn||(r.stencilFunc(Wt,si,Cn),ye=Wt,xe=si,De=Cn)},setOp:function(Wt,si,Cn){ht===Wt&&xt===si&&_t===Cn||(r.stencilOp(Wt,si,Cn),ht=Wt,xt=si,_t=Cn)},setLocked:function(Wt){Y=Wt},setClear:function(Wt){Gt!==Wt&&(r.clearStencil(Wt),Gt=Wt)},reset:function(){Y=!1,pe=null,ye=null,xe=null,De=null,ht=null,xt=null,_t=null,Gt=null}}};let a={},l=null,u={},c=null,d=!1,f=null,m=null,g=null,_=null,y=null,w=null,M=null,I=!1,F=null,C=null,U=null,N=null,G=null;const he=r.getParameter(35661);let ne=!1,Z=0;const Q=r.getParameter(7938);Q.indexOf("WebGL")!==-1?(Z=parseFloat(/^WebGL (\d)/.exec(Q)[1]),ne=Z>=1):Q.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),ne=Z>=2);let $=null,se={};const me=r.getParameter(3088),ge=r.getParameter(2978),de=new pn().fromArray(me),fe=new pn().fromArray(ge);function Re(Y,pe,ye){const xe=new Uint8Array(4),De=r.createTexture();r.bindTexture(Y,De),r.texParameteri(Y,10241,9728),r.texParameteri(Y,10240,9728);for(let ht=0;ht<ye;ht++)r.texImage2D(pe+ht,0,6408,1,1,0,6408,5121,xe);return De}const ke={};function Be(Y){a[Y]!==!0&&(r.enable(Y),a[Y]=!0)}function J(Y){a[Y]!==!1&&(r.disable(Y),a[Y]=!1)}ke[3553]=Re(3553,3553,1),ke[34067]=Re(34067,34069,6),i.setClear(0,0,0,1),o.setClear(1),s.setClear(0),Be(2929),o.setFunc(Fi),Te(!1),Ge(Xe),Be(2884),Ne($e);const te={[Me]:32774,[Oe]:32778,[Se]:32779};if(n)te[Ue]=32775,te[qe]=32776;else{const Y=e.get("EXT_blend_minmax");Y!==null&&(te[Ue]=Y.MIN_EXT,te[qe]=Y.MAX_EXT)}const Ae={[at]:0,[rt]:1,[Qt]:768,[en]:770,[gn]:776,[Dn]:774,[Vt]:772,[lt]:769,[Bt]:771,[wn]:775,[bt]:773};function Ne(Y,pe,ye,xe,De,ht,xt,_t){if(Y!==$e){if(d===!1&&(Be(3042),d=!0),Y===be)De=De||pe,ht=ht||ye,xt=xt||xe,pe===m&&De===y||(r.blendEquationSeparate(te[pe],te[De]),m=pe,y=De),ye===g&&xe===_&&ht===w&&xt===M||(r.blendFuncSeparate(Ae[ye],Ae[xe],Ae[ht],Ae[xt]),g=ye,_=xe,w=ht,M=xt),f=Y,I=null;else if(Y!==f||_t!==I){if(m===Me&&y===Me||(r.blendEquation(32774),m=Me,y=Me),_t)switch(Y){case ae:r.blendFuncSeparate(1,771,1,771);break;case Ce:r.blendFunc(1,1);break;case Ie:r.blendFuncSeparate(0,0,769,771);break;case H:r.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",Y)}else switch(Y){case ae:r.blendFuncSeparate(770,771,1,771);break;case Ce:r.blendFunc(770,1);break;case Ie:r.blendFunc(0,769);break;case H:r.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",Y)}g=null,_=null,w=null,M=null,f=Y,I=_t}}else d===!0&&(J(3042),d=!1)}function Te(Y){F!==Y&&(Y?r.frontFace(2304):r.frontFace(2305),F=Y)}function Ge(Y){Y!==Ee?(Be(2884),Y!==C&&(Y===Xe?r.cullFace(1029):Y===Fe?r.cullFace(1028):r.cullFace(1032))):J(2884),C=Y}function Ye(Y,pe,ye){Y?(Be(32823),N===pe&&G===ye||(r.polygonOffset(pe,ye),N=pe,G=ye)):J(32823)}function ve(Y){Y===void 0&&(Y=33984+he-1),$!==Y&&(r.activeTexture(Y),$=Y)}return{buffers:{color:i,depth:o,stencil:s},enable:Be,disable:J,bindFramebuffer:function(Y,pe){return pe===null&&l!==null&&(pe=l),u[Y]!==pe&&(r.bindFramebuffer(Y,pe),u[Y]=pe,n&&(Y===36009&&(u[36160]=pe),Y===36160&&(u[36009]=pe)),!0)},bindXRFramebuffer:function(Y){Y!==l&&(r.bindFramebuffer(36160,Y),l=Y)},useProgram:function(Y){return c!==Y&&(r.useProgram(Y),c=Y,!0)},setBlending:Ne,setMaterial:function(Y,pe){Y.side===ee?J(2884):Be(2884);let ye=Y.side===W;pe&&(ye=!ye),Te(ye),Y.blending===ae&&Y.transparent===!1?Ne($e):Ne(Y.blending,Y.blendEquation,Y.blendSrc,Y.blendDst,Y.blendEquationAlpha,Y.blendSrcAlpha,Y.blendDstAlpha,Y.premultipliedAlpha),o.setFunc(Y.depthFunc),o.setTest(Y.depthTest),o.setMask(Y.depthWrite),i.setMask(Y.colorWrite);const xe=Y.stencilWrite;s.setTest(xe),xe&&(s.setMask(Y.stencilWriteMask),s.setFunc(Y.stencilFunc,Y.stencilRef,Y.stencilFuncMask),s.setOp(Y.stencilFail,Y.stencilZFail,Y.stencilZPass)),Ye(Y.polygonOffset,Y.polygonOffsetFactor,Y.polygonOffsetUnits),Y.alphaToCoverage===!0?Be(32926):J(32926)},setFlipSided:Te,setCullFace:Ge,setLineWidth:function(Y){Y!==U&&(ne&&r.lineWidth(Y),U=Y)},setPolygonOffset:Ye,setScissorTest:function(Y){Y?Be(3089):J(3089)},activeTexture:ve,bindTexture:function(Y,pe){$===null&&ve();let ye=se[$];ye===void 0&&(ye={type:void 0,texture:void 0},se[$]=ye),ye.type===Y&&ye.texture===pe||(r.bindTexture(Y,pe||ke[Y]),ye.type=Y,ye.texture=pe)},unbindTexture:function(){const Y=se[$];Y!==void 0&&Y.type!==void 0&&(r.bindTexture(Y.type,null),Y.type=void 0,Y.texture=void 0)},compressedTexImage2D:function(){try{r.compressedTexImage2D.apply(r,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},texImage2D:function(){try{r.texImage2D.apply(r,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},texImage3D:function(){try{r.texImage3D.apply(r,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},scissor:function(Y){de.equals(Y)===!1&&(r.scissor(Y.x,Y.y,Y.z,Y.w),de.copy(Y))},viewport:function(Y){fe.equals(Y)===!1&&(r.viewport(Y.x,Y.y,Y.z,Y.w),fe.copy(Y))},reset:function(){r.disable(3042),r.disable(2884),r.disable(2929),r.disable(32823),r.disable(3089),r.disable(2960),r.disable(32926),r.blendEquation(32774),r.blendFunc(1,0),r.blendFuncSeparate(1,0,1,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(513),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(519,0,4294967295),r.stencilOp(7680,7680,7680),r.clearStencil(0),r.cullFace(1029),r.frontFace(2305),r.polygonOffset(0,0),r.activeTexture(33984),r.bindFramebuffer(36160,null),n===!0&&(r.bindFramebuffer(36009,null),r.bindFramebuffer(36008,null)),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),a={},$=null,se={},l=null,u={},c=null,d=!1,f=null,m=null,g=null,_=null,y=null,w=null,M=null,I=!1,F=null,C=null,U=null,N=null,G=null,de.set(0,0,r.canvas.width,r.canvas.height),fe.set(0,0,r.canvas.width,r.canvas.height),i.reset(),o.reset(),s.reset()}}}function iv(r,e,t,n,i,o,s){const a=i.isWebGL2,l=i.maxTextures,u=i.maxCubemapSize,c=i.maxTextureSize,d=i.maxSamples,f=new WeakMap;let m,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(J,te){return g?new OffscreenCanvas(J,te):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(J,te,Ae,Ne){let Te=1;if((J.width>Ne||J.height>Ne)&&(Te=Ne/Math.max(J.width,J.height)),Te<1||te===!0){if(typeof HTMLImageElement!="undefined"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&J instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&J instanceof ImageBitmap){const Ge=te?Qu:Math.floor,Ye=Ge(Te*J.width),ve=Ge(Te*J.height);m===void 0&&(m=_(Ye,ve));const Y=Ae?_(Ye,ve):m;return Y.width=Ye,Y.height=ve,Y.getContext("2d").drawImage(J,0,0,Ye,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+Ye+"x"+ve+")."),Y}return"data"in J&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),J}return J}function w(J){return xl(J.width)&&xl(J.height)}function M(J,te){return J.generateMipmaps&&te&&J.minFilter!==Zn&&J.minFilter!==Jn}function I(J,te,Ae,Ne,Te=1){r.generateMipmap(J),n.get(te).__maxMipLevel=Math.log2(Math.max(Ae,Ne,Te))}function F(J,te,Ae){if(a===!1)return te;if(J!==null){if(r[J]!==void 0)return r[J];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+J+"'")}let Ne=te;return te===6403&&(Ae===5126&&(Ne=33326),Ae===5131&&(Ne=33325),Ae===5121&&(Ne=33321)),te===6407&&(Ae===5126&&(Ne=34837),Ae===5131&&(Ne=34843),Ae===5121&&(Ne=32849)),te===6408&&(Ae===5126&&(Ne=34836),Ae===5131&&(Ne=34842),Ae===5121&&(Ne=32856)),Ne!==33325&&Ne!==33326&&Ne!==34842&&Ne!==34836||e.get("EXT_color_buffer_float"),Ne}function C(J){return J===Zn||J===ul||J===hl?9728:9729}function U(J){const te=J.target;te.removeEventListener("dispose",U),function(Ae){const Ne=n.get(Ae);Ne.__webglInit!==void 0&&(r.deleteTexture(Ne.__webglTexture),n.remove(Ae))}(te),te.isVideoTexture&&f.delete(te),s.memory.textures--}function N(J){const te=J.target;te.removeEventListener("dispose",N),function(Ae){const Ne=Ae.texture,Te=n.get(Ae),Ge=n.get(Ne);if(!!Ae){if(Ge.__webglTexture!==void 0&&(r.deleteTexture(Ge.__webglTexture),s.memory.textures--),Ae.depthTexture&&Ae.depthTexture.dispose(),Ae.isWebGLCubeRenderTarget)for(let Ye=0;Ye<6;Ye++)r.deleteFramebuffer(Te.__webglFramebuffer[Ye]),Te.__webglDepthbuffer&&r.deleteRenderbuffer(Te.__webglDepthbuffer[Ye]);else r.deleteFramebuffer(Te.__webglFramebuffer),Te.__webglDepthbuffer&&r.deleteRenderbuffer(Te.__webglDepthbuffer),Te.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Te.__webglMultisampledFramebuffer),Te.__webglColorRenderbuffer&&r.deleteRenderbuffer(Te.__webglColorRenderbuffer),Te.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Te.__webglDepthRenderbuffer);if(Ae.isWebGLMultipleRenderTargets)for(let Ye=0,ve=Ne.length;Ye<ve;Ye++){const Y=n.get(Ne[Ye]);Y.__webglTexture&&(r.deleteTexture(Y.__webglTexture),s.memory.textures--),n.remove(Ne[Ye])}n.remove(Ne),n.remove(Ae)}}(te)}let G=0;function he(J,te){const Ae=n.get(J);if(J.isVideoTexture&&function(Ne){const Te=s.render.frame;f.get(Ne)!==Te&&(f.set(Ne,Te),Ne.update())}(J),J.version>0&&Ae.__version!==J.version){const Ne=J.image;if(Ne===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Ne.complete!==!1)return void me(Ae,J,te);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}t.activeTexture(33984+te),t.bindTexture(3553,Ae.__webglTexture)}function ne(J,te){const Ae=n.get(J);J.version>0&&Ae.__version!==J.version?function(Ne,Te,Ge){if(Te.image.length!==6)return;se(Ne,Te),t.activeTexture(33984+Ge),t.bindTexture(34067,Ne.__webglTexture),r.pixelStorei(37440,Te.flipY),r.pixelStorei(37441,Te.premultiplyAlpha),r.pixelStorei(3317,Te.unpackAlignment),r.pixelStorei(37443,0);const Ye=Te&&(Te.isCompressedTexture||Te.image[0].isCompressedTexture),ve=Te.image[0]&&Te.image[0].isDataTexture,Y=[];for(let _t=0;_t<6;_t++)Y[_t]=Ye||ve?ve?Te.image[_t].image:Te.image[_t]:y(Te.image[_t],!1,!0,u);const pe=Y[0],ye=w(pe)||a,xe=o.convert(Te.format),De=o.convert(Te.type),ht=F(Te.internalFormat,xe,De);let xt;if($(34067,Te,ye),Ye){for(let _t=0;_t<6;_t++){xt=Y[_t].mipmaps;for(let Gt=0;Gt<xt.length;Gt++){const Wt=xt[Gt];Te.format!==er&&Te.format!==co?xe!==null?t.compressedTexImage2D(34069+_t,Gt,ht,Wt.width,Wt.height,0,Wt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+_t,Gt,ht,Wt.width,Wt.height,0,xe,De,Wt.data)}}Ne.__maxMipLevel=xt.length-1}else{xt=Te.mipmaps;for(let _t=0;_t<6;_t++)if(ve){t.texImage2D(34069+_t,0,ht,Y[_t].width,Y[_t].height,0,xe,De,Y[_t].data);for(let Gt=0;Gt<xt.length;Gt++){const Wt=xt[Gt].image[_t].image;t.texImage2D(34069+_t,Gt+1,ht,Wt.width,Wt.height,0,xe,De,Wt.data)}}else{t.texImage2D(34069+_t,0,ht,xe,De,Y[_t]);for(let Gt=0;Gt<xt.length;Gt++){const Wt=xt[Gt];t.texImage2D(34069+_t,Gt+1,ht,xe,De,Wt.image[_t])}}Ne.__maxMipLevel=xt.length}M(Te,ye)&&I(34067,Te,pe.width,pe.height),Ne.__version=Te.version,Te.onUpdate&&Te.onUpdate(Te)}(Ae,J,te):(t.activeTexture(33984+te),t.bindTexture(34067,Ae.__webglTexture))}const Z={[Go]:10497,[mi]:33071,[ll]:33648},Q={[Zn]:9728,[ul]:9984,[hl]:9986,[Jn]:9729,[Ho]:9985,[Ts]:9987};function $(J,te,Ae){if(Ae?(r.texParameteri(J,10242,Z[te.wrapS]),r.texParameteri(J,10243,Z[te.wrapT]),J!==32879&&J!==35866||r.texParameteri(J,32882,Z[te.wrapR]),r.texParameteri(J,10240,Q[te.magFilter]),r.texParameteri(J,10241,Q[te.minFilter])):(r.texParameteri(J,10242,33071),r.texParameteri(J,10243,33071),J!==32879&&J!==35866||r.texParameteri(J,32882,33071),te.wrapS===mi&&te.wrapT===mi||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(J,10240,C(te.magFilter)),r.texParameteri(J,10241,C(te.minFilter)),te.minFilter!==Zn&&te.minFilter!==Jn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Ne=e.get("EXT_texture_filter_anisotropic");if(te.type===ho&&e.has("OES_texture_float_linear")===!1||a===!1&&te.type===Es&&e.has("OES_texture_half_float_linear")===!1)return;(te.anisotropy>1||n.get(te).__currentAnisotropy)&&(r.texParameterf(J,Ne.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(te.anisotropy,i.getMaxAnisotropy())),n.get(te).__currentAnisotropy=te.anisotropy)}}function se(J,te){J.__webglInit===void 0&&(J.__webglInit=!0,te.addEventListener("dispose",U),J.__webglTexture=r.createTexture(),s.memory.textures++)}function me(J,te,Ae){let Ne=3553;te.isDataTexture2DArray&&(Ne=35866),te.isDataTexture3D&&(Ne=32879),se(J,te),t.activeTexture(33984+Ae),t.bindTexture(Ne,J.__webglTexture),r.pixelStorei(37440,te.flipY),r.pixelStorei(37441,te.premultiplyAlpha),r.pixelStorei(3317,te.unpackAlignment),r.pixelStorei(37443,0);const Te=function(De){return!a&&(De.wrapS!==mi||De.wrapT!==mi||De.minFilter!==Zn&&De.minFilter!==Jn)}(te)&&w(te.image)===!1,Ge=y(te.image,Te,!1,c),Ye=w(Ge)||a,ve=o.convert(te.format);let Y,pe=o.convert(te.type),ye=F(te.internalFormat,ve,pe);$(Ne,te,Ye);const xe=te.mipmaps;if(te.isDepthTexture)ye=6402,a?ye=te.type===ho?36012:te.type===Ss?33190:te.type===dn?35056:33189:te.type===ho&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),te.format===Nn&&ye===6402&&te.type!==cl&&te.type!==Ss&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),te.type=cl,pe=o.convert(te.type)),te.format===Ms&&ye===6402&&(ye=34041,te.type!==dn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),te.type=dn,pe=o.convert(te.type))),t.texImage2D(3553,0,ye,Ge.width,Ge.height,0,ve,pe,null);else if(te.isDataTexture)if(xe.length>0&&Ye){for(let De=0,ht=xe.length;De<ht;De++)Y=xe[De],t.texImage2D(3553,De,ye,Y.width,Y.height,0,ve,pe,Y.data);te.generateMipmaps=!1,J.__maxMipLevel=xe.length-1}else t.texImage2D(3553,0,ye,Ge.width,Ge.height,0,ve,pe,Ge.data),J.__maxMipLevel=0;else if(te.isCompressedTexture){for(let De=0,ht=xe.length;De<ht;De++)Y=xe[De],te.format!==er&&te.format!==co?ve!==null?t.compressedTexImage2D(3553,De,ye,Y.width,Y.height,0,Y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,De,ye,Y.width,Y.height,0,ve,pe,Y.data);J.__maxMipLevel=xe.length-1}else if(te.isDataTexture2DArray)t.texImage3D(35866,0,ye,Ge.width,Ge.height,Ge.depth,0,ve,pe,Ge.data),J.__maxMipLevel=0;else if(te.isDataTexture3D)t.texImage3D(32879,0,ye,Ge.width,Ge.height,Ge.depth,0,ve,pe,Ge.data),J.__maxMipLevel=0;else if(xe.length>0&&Ye){for(let De=0,ht=xe.length;De<ht;De++)Y=xe[De],t.texImage2D(3553,De,ye,ve,pe,Y);te.generateMipmaps=!1,J.__maxMipLevel=xe.length-1}else t.texImage2D(3553,0,ye,ve,pe,Ge),J.__maxMipLevel=0;M(te,Ye)&&I(Ne,te,Ge.width,Ge.height),J.__version=te.version,te.onUpdate&&te.onUpdate(te)}function ge(J,te,Ae,Ne,Te){const Ge=o.convert(Ae.format),Ye=o.convert(Ae.type),ve=F(Ae.internalFormat,Ge,Ye);Te===32879||Te===35866?t.texImage3D(Te,0,ve,te.width,te.height,te.depth,0,Ge,Ye,null):t.texImage2D(Te,0,ve,te.width,te.height,0,Ge,Ye,null),t.bindFramebuffer(36160,J),r.framebufferTexture2D(36160,Ne,Te,n.get(Ae).__webglTexture,0),t.bindFramebuffer(36160,null)}function de(J,te,Ae){if(r.bindRenderbuffer(36161,J),te.depthBuffer&&!te.stencilBuffer){let Ne=33189;if(Ae){const Te=te.depthTexture;Te&&Te.isDepthTexture&&(Te.type===ho?Ne=36012:Te.type===Ss&&(Ne=33190));const Ge=Re(te);r.renderbufferStorageMultisample(36161,Ge,Ne,te.width,te.height)}else r.renderbufferStorage(36161,Ne,te.width,te.height);r.framebufferRenderbuffer(36160,36096,36161,J)}else if(te.depthBuffer&&te.stencilBuffer){if(Ae){const Ne=Re(te);r.renderbufferStorageMultisample(36161,Ne,35056,te.width,te.height)}else r.renderbufferStorage(36161,34041,te.width,te.height);r.framebufferRenderbuffer(36160,33306,36161,J)}else{const Ne=te.isWebGLMultipleRenderTargets===!0?te.texture[0]:te.texture,Te=o.convert(Ne.format),Ge=o.convert(Ne.type),Ye=F(Ne.internalFormat,Te,Ge);if(Ae){const ve=Re(te);r.renderbufferStorageMultisample(36161,ve,Ye,te.width,te.height)}else r.renderbufferStorage(36161,Ye,te.width,te.height)}r.bindRenderbuffer(36161,null)}function fe(J){const te=n.get(J),Ae=J.isWebGLCubeRenderTarget===!0;if(J.depthTexture){if(Ae)throw new Error("target.depthTexture not supported in Cube render targets");(function(Ne,Te){if(Te&&Te.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,Ne),!Te.depthTexture||!Te.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(Te.depthTexture).__webglTexture&&Te.depthTexture.image.width===Te.width&&Te.depthTexture.image.height===Te.height||(Te.depthTexture.image.width=Te.width,Te.depthTexture.image.height=Te.height,Te.depthTexture.needsUpdate=!0),he(Te.depthTexture,0);const Ge=n.get(Te.depthTexture).__webglTexture;if(Te.depthTexture.format===Nn)r.framebufferTexture2D(36160,36096,3553,Ge,0);else{if(Te.depthTexture.format!==Ms)throw new Error("Unknown depthTexture format");r.framebufferTexture2D(36160,33306,3553,Ge,0)}})(te.__webglFramebuffer,J)}else if(Ae){te.__webglDepthbuffer=[];for(let Ne=0;Ne<6;Ne++)t.bindFramebuffer(36160,te.__webglFramebuffer[Ne]),te.__webglDepthbuffer[Ne]=r.createRenderbuffer(),de(te.__webglDepthbuffer[Ne],J,!1)}else t.bindFramebuffer(36160,te.__webglFramebuffer),te.__webglDepthbuffer=r.createRenderbuffer(),de(te.__webglDepthbuffer,J,!1);t.bindFramebuffer(36160,null)}function Re(J){return a&&J.isWebGLMultisampleRenderTarget?Math.min(d,J.samples):0}let ke=!1,Be=!1;this.allocateTextureUnit=function(){const J=G;return J>=l&&console.warn("THREE.WebGLTextures: Trying to use "+J+" texture units while this GPU supports only "+l),G+=1,J},this.resetTextureUnits=function(){G=0},this.setTexture2D=he,this.setTexture2DArray=function(J,te){const Ae=n.get(J);J.version>0&&Ae.__version!==J.version?me(Ae,J,te):(t.activeTexture(33984+te),t.bindTexture(35866,Ae.__webglTexture))},this.setTexture3D=function(J,te){const Ae=n.get(J);J.version>0&&Ae.__version!==J.version?me(Ae,J,te):(t.activeTexture(33984+te),t.bindTexture(32879,Ae.__webglTexture))},this.setTextureCube=ne,this.setupRenderTarget=function(J){const te=J.texture,Ae=n.get(J),Ne=n.get(te);J.addEventListener("dispose",N),J.isWebGLMultipleRenderTargets!==!0&&(Ne.__webglTexture=r.createTexture(),Ne.__version=te.version,s.memory.textures++);const Te=J.isWebGLCubeRenderTarget===!0,Ge=J.isWebGLMultipleRenderTargets===!0,Ye=J.isWebGLMultisampleRenderTarget===!0,ve=te.isDataTexture3D||te.isDataTexture2DArray,Y=w(J)||a;if(!a||te.format!==co||te.type!==ho&&te.type!==Es||(te.format=er,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),Te){Ae.__webglFramebuffer=[];for(let pe=0;pe<6;pe++)Ae.__webglFramebuffer[pe]=r.createFramebuffer()}else if(Ae.__webglFramebuffer=r.createFramebuffer(),Ge)if(i.drawBuffers){const pe=J.texture;for(let ye=0,xe=pe.length;ye<xe;ye++){const De=n.get(pe[ye]);De.__webglTexture===void 0&&(De.__webglTexture=r.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(Ye)if(a){Ae.__webglMultisampledFramebuffer=r.createFramebuffer(),Ae.__webglColorRenderbuffer=r.createRenderbuffer(),r.bindRenderbuffer(36161,Ae.__webglColorRenderbuffer);const pe=o.convert(te.format),ye=o.convert(te.type),xe=F(te.internalFormat,pe,ye),De=Re(J);r.renderbufferStorageMultisample(36161,De,xe,J.width,J.height),t.bindFramebuffer(36160,Ae.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064,36161,Ae.__webglColorRenderbuffer),r.bindRenderbuffer(36161,null),J.depthBuffer&&(Ae.__webglDepthRenderbuffer=r.createRenderbuffer(),de(Ae.__webglDepthRenderbuffer,J,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(Te){t.bindTexture(34067,Ne.__webglTexture),$(34067,te,Y);for(let pe=0;pe<6;pe++)ge(Ae.__webglFramebuffer[pe],J,te,36064,34069+pe);M(te,Y)&&I(34067,te,J.width,J.height),t.bindTexture(34067,null)}else if(Ge){const pe=J.texture;for(let ye=0,xe=pe.length;ye<xe;ye++){const De=pe[ye],ht=n.get(De);t.bindTexture(3553,ht.__webglTexture),$(3553,De,Y),ge(Ae.__webglFramebuffer,J,De,36064+ye,3553),M(De,Y)&&I(3553,De,J.width,J.height)}t.bindTexture(3553,null)}else{let pe=3553;ve&&(a?pe=te.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(pe,Ne.__webglTexture),$(pe,te,Y),ge(Ae.__webglFramebuffer,J,te,36064,pe),M(te,Y)&&I(pe,te,J.width,J.height,J.depth),t.bindTexture(pe,null)}J.depthBuffer&&fe(J)},this.updateRenderTargetMipmap=function(J){const te=w(J)||a,Ae=J.isWebGLMultipleRenderTargets===!0?J.texture:[J.texture];for(let Ne=0,Te=Ae.length;Ne<Te;Ne++){const Ge=Ae[Ne];if(M(Ge,te)){const Ye=J.isWebGLCubeRenderTarget?34067:3553,ve=n.get(Ge).__webglTexture;t.bindTexture(Ye,ve),I(Ye,Ge,J.width,J.height),t.bindTexture(Ye,null)}}},this.updateMultisampleRenderTarget=function(J){if(J.isWebGLMultisampleRenderTarget)if(a){const te=J.width,Ae=J.height;let Ne=16384;J.depthBuffer&&(Ne|=256),J.stencilBuffer&&(Ne|=1024);const Te=n.get(J);t.bindFramebuffer(36008,Te.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,Te.__webglFramebuffer),r.blitFramebuffer(0,0,te,Ae,0,0,te,Ae,Ne,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,Te.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(J,te){J&&J.isWebGLRenderTarget&&(ke===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ke=!0),J=J.texture),he(J,te)},this.safeSetTextureCube=function(J,te){J&&J.isWebGLCubeRenderTarget&&(Be===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Be=!0),J=J.texture),ne(J,te)}}function kf(r,e,t){const n=t.isWebGL2;return{convert:function(i){let o;if(i===zo)return 5121;if(i===kp)return 32819;if(i===Gp)return 32820;if(i===Hp)return 33635;if(i===Fp)return 5120;if(i===Bp)return 5122;if(i===cl)return 5123;if(i===Up)return 5124;if(i===Ss)return 5125;if(i===ho)return 5126;if(i===Es)return n?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(i===_n)return 6406;if(i===co)return 6407;if(i===er)return 6408;if(i===zp)return 6409;if(i===gc)return 6410;if(i===Nn)return 6402;if(i===Ms)return 34041;if(i===ga)return 6403;if(i===vc)return 36244;if(i===Cu)return 33319;if(i===tr)return 33320;if(i===_c)return 36248;if(i===yc)return 36249;if(i===Ru||i===Iu||i===Lu||i===Ou){if(o=e.get("WEBGL_compressed_texture_s3tc"),o===null)return null;if(i===Ru)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Iu)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Lu)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Ou)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(i===Bi||i===xc||i===ji||i===bc){if(o=e.get("WEBGL_compressed_texture_pvrtc"),o===null)return null;if(i===Bi)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===xc)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===ji)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===bc)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===wc)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((i===Wr||i===va)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(i===Wr)return o.COMPRESSED_RGB8_ETC2;if(i===va)return o.COMPRESSED_RGBA8_ETC2_EAC}return i===Du||i===Tn||i===po||i===Nu||i===jp||i===Fu||i===Wp||i===Tc||i===dl||i===As||i===Xp||i===Sc||i===Ec||i===Bu||i===Mc||i===ku||i===Gu||i===Ac||i===Wi||i===Hu||i===_a||i===Pc||i===Cc||i===Yp||i===qp||i===Zp||i===Jp||i===Ps?(o=e.get("WEBGL_compressed_texture_astc"),o!==null?i:null):i===Uu?(o=e.get("EXT_texture_compression_bptc"),o!==null?i:null):i===dn?n?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class fd extends Qn{constructor(e=[]){super(),this.cameras=e}}fd.prototype.isArrayCamera=!0;class Ys extends Xt{constructor(){super(),this.type="Group"}}Ys.prototype.isGroup=!0;const md={type:"move"};class Nl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ys,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ys,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new T,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new T),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ys,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new T,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new T),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(i=t.getPose(e.targetRaySpace,n),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(md))),u&&e.hand){s=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,n);if(u.joints[_.jointName]===void 0){const M=new Ys;M.matrixAutoUpdate=!1,M.visible=!1,u.joints[_.jointName]=M,u.add(M)}const w=u.joints[_.jointName];y!==null&&(w.matrix.fromArray(y.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.jointRadius=y.radius),w.visible=y!==null}const c=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],f=c.position.distanceTo(d.position),m=.02,g=.005;u.inputState.pinching&&f>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=m-g&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,n),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}}class rv extends go{constructor(e,t){super();const n=this,i=e.state;let o=null,s=1,a=null,l="local-floor",u=null,c=null,d=null,f=null;const m=[],g=new Map,_=new Qn;_.layers.enable(1),_.viewport=new pn;const y=new Qn;y.layers.enable(2),y.viewport=new pn;const w=[_,y],M=new fd;M.layers.enable(1),M.layers.enable(2);let I=null,F=null;function C($){const se=g.get($.inputSource);se&&se.dispatchEvent({type:$.type,data:$.inputSource})}function U(){g.forEach(function($,se){$.disconnect(se)}),g.clear(),I=null,F=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),Q.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function N($){const se=o.inputSources;for(let me=0;me<m.length;me++)g.set(se[me],m[me]);for(let me=0;me<$.removed.length;me++){const ge=$.removed[me],de=g.get(ge);de&&(de.dispatchEvent({type:"disconnected",data:ge}),g.delete(ge))}for(let me=0;me<$.added.length;me++){const ge=$.added[me],de=g.get(ge);de&&de.dispatchEvent({type:"connected",data:ge})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function($){let se=m[$];return se===void 0&&(se=new Nl,m[$]=se),se.getTargetRaySpace()},this.getControllerGrip=function($){let se=m[$];return se===void 0&&(se=new Nl,m[$]=se),se.getGripSpace()},this.getHand=function($){let se=m[$];return se===void 0&&(se=new Nl,m[$]=se),se.getHandSpace()},this.setFramebufferScaleFactor=function($){s=$,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function($){l=$,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return o},this.setSession=async function($){if(o=$,o!==null){o.addEventListener("select",C),o.addEventListener("selectstart",C),o.addEventListener("selectend",C),o.addEventListener("squeeze",C),o.addEventListener("squeezestart",C),o.addEventListener("squeezeend",C),o.addEventListener("end",U),o.addEventListener("inputsourceschange",N);const se=t.getContextAttributes();if(se.xrCompatible!==!0&&await t.makeXRCompatible(),o.renderState.layers===void 0){const me={antialias:se.antialias,alpha:se.alpha,depth:se.depth,stencil:se.stencil,framebufferScaleFactor:s},ge=new XRWebGLLayer(o,t,me);o.updateRenderState({baseLayer:ge})}else{let me=0;se.depth&&(me=se.stencil?34041:6402);const ge={colorFormat:se.alpha?6408:6407,depthFormat:me,scaleFactor:s};c=new XRWebGLBinding(o,t),f=c.createProjectionLayer(ge),d=t.createFramebuffer(),o.updateRenderState({layers:[f]})}a=await o.requestReferenceSpace(l),Q.setContext(o),Q.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const G=new T,he=new T;function ne($,se){se===null?$.matrixWorld.copy($.matrix):$.matrixWorld.multiplyMatrices(se.matrixWorld,$.matrix),$.matrixWorldInverse.copy($.matrixWorld).invert()}this.updateCamera=function($){if(o===null)return;M.near=y.near=_.near=$.near,M.far=y.far=_.far=$.far,I===M.near&&F===M.far||(o.updateRenderState({depthNear:M.near,depthFar:M.far}),I=M.near,F=M.far);const se=$.parent,me=M.cameras;ne(M,se);for(let de=0;de<me.length;de++)ne(me[de],se);M.matrixWorld.decompose(M.position,M.quaternion,M.scale),$.position.copy(M.position),$.quaternion.copy(M.quaternion),$.scale.copy(M.scale),$.matrix.copy(M.matrix),$.matrixWorld.copy(M.matrixWorld);const ge=$.children;for(let de=0,fe=ge.length;de<fe;de++)ge[de].updateMatrixWorld(!0);me.length===2?function(de,fe,Re){G.setFromMatrixPosition(fe.matrixWorld),he.setFromMatrixPosition(Re.matrixWorld);const ke=G.distanceTo(he),Be=fe.projectionMatrix.elements,J=Re.projectionMatrix.elements,te=Be[14]/(Be[10]-1),Ae=Be[14]/(Be[10]+1),Ne=(Be[9]+1)/Be[5],Te=(Be[9]-1)/Be[5],Ge=(Be[8]-1)/Be[0],Ye=(J[8]+1)/J[0],ve=te*Ge,Y=te*Ye,pe=ke/(-Ge+Ye),ye=pe*-Ge;fe.matrixWorld.decompose(de.position,de.quaternion,de.scale),de.translateX(ye),de.translateZ(pe),de.matrixWorld.compose(de.position,de.quaternion,de.scale),de.matrixWorldInverse.copy(de.matrixWorld).invert();const xe=te+pe,De=Ae+pe,ht=ve-ye,xt=Y+(ke-ye),_t=Ne*Ae/De*xe,Gt=Te*Ae/De*xe;de.projectionMatrix.makePerspective(ht,xt,_t,Gt,xe,De)}(M,_,y):M.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return M};let Z=null;const Q=new Qc;Q.setAnimationLoop(function($,se){if(u=se.getViewerPose(a),u!==null){const ge=u.views,de=o.renderState.baseLayer;o.renderState.layers===void 0&&i.bindXRFramebuffer(de.framebuffer);let fe=!1;ge.length!==M.cameras.length&&(M.cameras.length=0,fe=!0);for(let Re=0;Re<ge.length;Re++){const ke=ge[Re];let Be=null;if(o.renderState.layers===void 0)Be=de.getViewport(ke);else{const te=c.getViewSubImage(f,ke);i.bindXRFramebuffer(d),t.framebufferTexture2D(36160,36064,3553,te.colorTexture,0),te.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,te.depthStencilTexture,0),Be=te.viewport}const J=w[Re];J.matrix.fromArray(ke.transform.matrix),J.projectionMatrix.fromArray(ke.projectionMatrix),J.viewport.set(Be.x,Be.y,Be.width,Be.height),Re===0&&M.matrix.copy(J.matrix),fe===!0&&M.cameras.push(J)}}const me=o.inputSources;for(let ge=0;ge<m.length;ge++){const de=m[ge],fe=me[ge];de.update(fe,se,a)}Z&&Z($,se)}),this.setAnimationLoop=function($){Z=$},this.dispose=function(){}}}function ov(r){function e(n,i){n.opacity.value=i.opacity,i.color&&n.diffuse.value.copy(i.color),i.emissive&&n.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(n.map.value=i.map),i.alphaMap&&(n.alphaMap.value=i.alphaMap),i.specularMap&&(n.specularMap.value=i.specularMap);const o=r.get(i).envMap;if(o){n.envMap.value=o,n.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,n.reflectivity.value=i.reflectivity,n.refractionRatio.value=i.refractionRatio;const l=r.get(o).__maxMipLevel;l!==void 0&&(n.maxMipLevel.value=l)}let s,a;i.lightMap&&(n.lightMap.value=i.lightMap,n.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(n.aoMap.value=i.aoMap,n.aoMapIntensity.value=i.aoMapIntensity),i.map?s=i.map:i.specularMap?s=i.specularMap:i.displacementMap?s=i.displacementMap:i.normalMap?s=i.normalMap:i.bumpMap?s=i.bumpMap:i.roughnessMap?s=i.roughnessMap:i.metalnessMap?s=i.metalnessMap:i.alphaMap?s=i.alphaMap:i.emissiveMap?s=i.emissiveMap:i.clearcoatMap?s=i.clearcoatMap:i.clearcoatNormalMap?s=i.clearcoatNormalMap:i.clearcoatRoughnessMap&&(s=i.clearcoatRoughnessMap),s!==void 0&&(s.isWebGLRenderTarget&&(s=s.texture),s.matrixAutoUpdate===!0&&s.updateMatrix(),n.uvTransform.value.copy(s.matrix)),i.aoMap?a=i.aoMap:i.lightMap&&(a=i.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function t(n,i){n.roughness.value=i.roughness,n.metalness.value=i.metalness,i.roughnessMap&&(n.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(n.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(n.emissiveMap.value=i.emissiveMap),i.bumpMap&&(n.bumpMap.value=i.bumpMap,n.bumpScale.value=i.bumpScale,i.side===W&&(n.bumpScale.value*=-1)),i.normalMap&&(n.normalMap.value=i.normalMap,n.normalScale.value.copy(i.normalScale),i.side===W&&n.normalScale.value.negate()),i.displacementMap&&(n.displacementMap.value=i.displacementMap,n.displacementScale.value=i.displacementScale,n.displacementBias.value=i.displacementBias),r.get(i).envMap&&(n.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms:function(n,i){n.fogColor.value.copy(i.color),i.isFog?(n.fogNear.value=i.near,n.fogFar.value=i.far):i.isFogExp2&&(n.fogDensity.value=i.density)},refreshMaterialUniforms:function(n,i,o,s,a){i.isMeshBasicMaterial?e(n,i):i.isMeshLambertMaterial?(e(n,i),function(l,u){u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap)}(n,i)):i.isMeshToonMaterial?(e(n,i),function(l,u){u.gradientMap&&(l.gradientMap.value=u.gradientMap),u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===W&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===W&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isMeshPhongMaterial?(e(n,i),function(l,u){l.specular.value.copy(u.specular),l.shininess.value=Math.max(u.shininess,1e-4),u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===W&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===W&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isMeshStandardMaterial?(e(n,i),i.isMeshPhysicalMaterial?function(l,u,c){t(l,u),l.reflectivity.value=u.reflectivity,l.clearcoat.value=u.clearcoat,l.clearcoatRoughness.value=u.clearcoatRoughness,u.sheen&&l.sheen.value.copy(u.sheen),u.clearcoatMap&&(l.clearcoatMap.value=u.clearcoatMap),u.clearcoatRoughnessMap&&(l.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap),u.clearcoatNormalMap&&(l.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),l.clearcoatNormalMap.value=u.clearcoatNormalMap,u.side===W&&l.clearcoatNormalScale.value.negate()),l.transmission.value=u.transmission,u.transmissionMap&&(l.transmissionMap.value=u.transmissionMap),u.transmission>0&&(l.transmissionSamplerMap.value=c.texture,l.transmissionSamplerSize.value.set(c.width,c.height)),l.thickness.value=u.thickness,u.thicknessMap&&(l.thicknessMap.value=u.thicknessMap),l.attenuationDistance.value=u.attenuationDistance,l.attenuationColor.value.copy(u.attenuationColor)}(n,i,a):t(n,i)):i.isMeshMatcapMaterial?(e(n,i),function(l,u){u.matcap&&(l.matcap.value=u.matcap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===W&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===W&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isMeshDepthMaterial?(e(n,i),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isMeshDistanceMaterial?(e(n,i),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias),l.referencePosition.value.copy(u.referencePosition),l.nearDistance.value=u.nearDistance,l.farDistance.value=u.farDistance}(n,i)):i.isMeshNormalMaterial?(e(n,i),function(l,u){u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===W&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===W&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isLineBasicMaterial?(function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity}(n,i),i.isLineDashedMaterial&&function(l,u){l.dashSize.value=u.dashSize,l.totalSize.value=u.dashSize+u.gapSize,l.scale.value=u.scale}(n,i)):i.isPointsMaterial?function(l,u,c,d){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.size.value=u.size*c,l.scale.value=.5*d,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let f;u.map?f=u.map:u.alphaMap&&(f=u.alphaMap),f!==void 0&&(f.matrixAutoUpdate===!0&&f.updateMatrix(),l.uvTransform.value.copy(f.matrix))}(n,i,o,s):i.isSpriteMaterial?function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.rotation.value=u.rotation,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let c;u.map?c=u.map:u.alphaMap&&(c=u.alphaMap),c!==void 0&&(c.matrixAutoUpdate===!0&&c.updateMatrix(),l.uvTransform.value.copy(c.matrix))}(n,i):i.isShadowMaterial?(n.color.value.copy(i.color),n.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function fn(r={}){const e=r.canvas!==void 0?r.canvas:function(){const ue=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return ue.style.display="block",ue}(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0&&r.alpha,i=r.depth===void 0||r.depth,o=r.stencil===void 0||r.stencil,s=r.antialias!==void 0&&r.antialias,a=r.premultipliedAlpha===void 0||r.premultipliedAlpha,l=r.preserveDrawingBuffer!==void 0&&r.preserveDrawingBuffer,u=r.powerPreference!==void 0?r.powerPreference:"default",c=r.failIfMajorPerformanceCaveat!==void 0&&r.failIfMajorPerformanceCaveat;let d=null,f=null;const m=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=wt,this.physicallyCorrectLights=!1,this.toneMapping=uo,this.toneMappingExposure=1;const _=this;let y=!1,w=0,M=0,I=null,F=-1,C=null;const U=new pn,N=new pn;let G=null,he=e.width,ne=e.height,Z=1,Q=null,$=null;const se=new pn(0,0,he,ne),me=new pn(0,0,he,ne);let ge=!1;const de=[],fe=new Da;let Re=!1,ke=!1,Be=null;const J=new pt,te=new T,Ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ne(){return I===null?Z:1}let Te,Ge,Ye,ve,Y,pe,ye,xe,De,ht,xt,_t,Gt,Wt,si,Cn,Bo,vp,_p,yp,dr,Cr,it=t;function _T(ue,Ve){for(let Le=0;Le<ue.length;Le++){const We=ue[Le],ot=e.getContext(We,Ve);if(ot!==null)return ot}return null}try{const ue={alpha:n,depth:i,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:c};if(e.addEventListener("webglcontextlost",xT,!1),e.addEventListener("webglcontextrestored",bT,!1),it===null){const Ve=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&Ve.shift(),it=_T(Ve,ue),it===null)throw _T(Ve)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}it.getShaderPrecisionFormat===void 0&&(it.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ue){throw console.error("THREE.WebGLRenderer: "+ue.message),ue}function yT(){Te=new Rg(it),Ge=new cf(it,Te,r),Te.init(Ge),dr=new kf(it,Te,Ge),Ye=new wh(it,Te,Ge),de[0]=1029,ve=new Ll(it),Y=new xh,pe=new iv(it,Te,Ye,Y,Ge,dr,ve),ye=new pf(_),xe=new Pg(it,Ge),Cr=new Il(it,Te,xe,Ge),De=new ed(it,xe,ve,Cr),ht=new ph(it,De,xe,ve),vp=new gf(it),si=new df(Y),xt=new Df(_,ye,Te,Ge,Cr,si),_t=new ov(Y),Gt=new nv(Y),Wt=new Uf(Te,Ge),Bo=new Cg(_,ye,Ye,ht,a),Cn=new pd(_,ht,Ge),_p=new hf(it,Te,ve,Ge),yp=new ff(it,Te,ve,Ge),ve.programs=xt.programs,_.capabilities=Ge,_.extensions=Te,_.properties=Y,_.renderLists=Gt,_.shadowMap=Cn,_.state=Ye,_.info=ve}yT();const zr=new rv(_,it);function xT(ue){ue.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function bT(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const ue=ve.autoReset,Ve=Cn.enabled,Le=Cn.autoUpdate,We=Cn.needsUpdate,ot=Cn.type;yT(),ve.autoReset=ue,Cn.enabled=Ve,Cn.autoUpdate=Le,Cn.needsUpdate=We,Cn.type=ot}function wT(ue){const Ve=ue.target;Ve.removeEventListener("dispose",wT),function(Le){(function(We){const ot=Y.get(We).programs;ot!==void 0&&ot.forEach(function(hn){xt.releaseProgram(hn)})})(Le),Y.remove(Le)}(Ve)}this.xr=zr,this.getContext=function(){return it},this.getContextAttributes=function(){return it.getContextAttributes()},this.forceContextLoss=function(){const ue=Te.get("WEBGL_lose_context");ue&&ue.loseContext()},this.forceContextRestore=function(){const ue=Te.get("WEBGL_lose_context");ue&&ue.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(ue){ue!==void 0&&(Z=ue,this.setSize(he,ne,!1))},this.getSize=function(ue){return ue.set(he,ne)},this.setSize=function(ue,Ve,Le){zr.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(he=ue,ne=Ve,e.width=Math.floor(ue*Z),e.height=Math.floor(Ve*Z),Le!==!1&&(e.style.width=ue+"px",e.style.height=Ve+"px"),this.setViewport(0,0,ue,Ve))},this.getDrawingBufferSize=function(ue){return ue.set(he*Z,ne*Z).floor()},this.setDrawingBufferSize=function(ue,Ve,Le){he=ue,ne=Ve,Z=Le,e.width=Math.floor(ue*Le),e.height=Math.floor(Ve*Le),this.setViewport(0,0,ue,Ve)},this.getCurrentViewport=function(ue){return ue.copy(U)},this.getViewport=function(ue){return ue.copy(se)},this.setViewport=function(ue,Ve,Le,We){ue.isVector4?se.set(ue.x,ue.y,ue.z,ue.w):se.set(ue,Ve,Le,We),Ye.viewport(U.copy(se).multiplyScalar(Z).floor())},this.getScissor=function(ue){return ue.copy(me)},this.setScissor=function(ue,Ve,Le,We){ue.isVector4?me.set(ue.x,ue.y,ue.z,ue.w):me.set(ue,Ve,Le,We),Ye.scissor(N.copy(me).multiplyScalar(Z).floor())},this.getScissorTest=function(){return ge},this.setScissorTest=function(ue){Ye.setScissorTest(ge=ue)},this.setOpaqueSort=function(ue){Q=ue},this.setTransparentSort=function(ue){$=ue},this.getClearColor=function(ue){return ue.copy(Bo.getClearColor())},this.setClearColor=function(){Bo.setClearColor.apply(Bo,arguments)},this.getClearAlpha=function(){return Bo.getClearAlpha()},this.setClearAlpha=function(){Bo.setClearAlpha.apply(Bo,arguments)},this.clear=function(ue,Ve,Le){let We=0;(ue===void 0||ue)&&(We|=16384),(Ve===void 0||Ve)&&(We|=256),(Le===void 0||Le)&&(We|=1024),it.clear(We)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",xT,!1),e.removeEventListener("webglcontextrestored",bT,!1),Gt.dispose(),Wt.dispose(),Y.dispose(),ye.dispose(),ht.dispose(),Cr.dispose(),zr.dispose(),zr.removeEventListener("sessionstart",TT),zr.removeEventListener("sessionend",ST),Be&&(Be.dispose(),Be=null),Su.stop()},this.renderBufferImmediate=function(ue,Ve){Cr.initAttributes();const Le=Y.get(ue);ue.hasPositions&&!Le.position&&(Le.position=it.createBuffer()),ue.hasNormals&&!Le.normal&&(Le.normal=it.createBuffer()),ue.hasUvs&&!Le.uv&&(Le.uv=it.createBuffer()),ue.hasColors&&!Le.color&&(Le.color=it.createBuffer());const We=Ve.getAttributes();ue.hasPositions&&(it.bindBuffer(34962,Le.position),it.bufferData(34962,ue.positionArray,35048),Cr.enableAttribute(We.position),it.vertexAttribPointer(We.position,3,5126,!1,0,0)),ue.hasNormals&&(it.bindBuffer(34962,Le.normal),it.bufferData(34962,ue.normalArray,35048),Cr.enableAttribute(We.normal),it.vertexAttribPointer(We.normal,3,5126,!1,0,0)),ue.hasUvs&&(it.bindBuffer(34962,Le.uv),it.bufferData(34962,ue.uvArray,35048),Cr.enableAttribute(We.uv),it.vertexAttribPointer(We.uv,2,5126,!1,0,0)),ue.hasColors&&(it.bindBuffer(34962,Le.color),it.bufferData(34962,ue.colorArray,35048),Cr.enableAttribute(We.color),it.vertexAttribPointer(We.color,3,5126,!1,0,0)),Cr.disableUnusedAttributes(),it.drawArrays(4,0,ue.count),ue.count=0},this.renderBufferDirect=function(ue,Ve,Le,We,ot,hn){Ve===null&&(Ve=Ae);const zt=ot.isMesh&&ot.matrixWorld.determinant()<0,ut=AT(ue,Ve,We,ot);Ye.setMaterial(We,zt);let Kt=Le.index;const Rt=Le.attributes.position;if(Kt===null){if(Rt===void 0||Rt.count===0)return}else if(Kt.count===0)return;let sn,kt=1;We.wireframe===!0&&(Kt=De.getWireframeAttribute(Le),kt=2),(We.morphTargets||We.morphNormals)&&vp.update(ot,Le,We,ut),Cr.setup(ot,We,ut,Le,Kt);let rn=_p;Kt!==null&&(sn=xe.get(Kt),rn=yp,rn.setIndex(sn));const xi=Kt!==null?Kt.count:Rt.count,On=Le.drawRange.start*kt,Uo=Le.drawRange.count*kt,Rn=hn!==null?hn.start*kt:0,bs=hn!==null?hn.count*kt:1/0,Ai=Math.max(On,Rn),Vr=Math.min(xi,On+Uo,Rn+bs)-1,Qi=Math.max(0,Vr-Ai+1);if(Qi!==0){if(ot.isMesh)We.wireframe===!0?(Ye.setLineWidth(We.wireframeLinewidth*Ne()),rn.setMode(1)):rn.setMode(4);else if(ot.isLine){let xp=We.linewidth;xp===void 0&&(xp=1),Ye.setLineWidth(xp*Ne()),ot.isLineSegments?rn.setMode(1):ot.isLineLoop?rn.setMode(2):rn.setMode(3)}else ot.isPoints?rn.setMode(0):ot.isSprite&&rn.setMode(4);if(ot.isInstancedMesh)rn.renderInstances(Ai,Qi,ot.count);else if(Le.isInstancedBufferGeometry){const xp=Math.min(Le.instanceCount,Le._maxInstanceCount);rn.renderInstances(Ai,Qi,xp)}else rn.render(Ai,Qi)}},this.compile=function(ue,Ve){f=Wt.get(ue),f.init(),ue.traverseVisible(function(Le){Le.isLight&&Le.layers.test(Ve.layers)&&(f.pushLight(Le),Le.castShadow&&f.pushShadow(Le))}),f.setupLights(),ue.traverse(function(Le){const We=Le.material;if(We)if(Array.isArray(We))for(let ot=0;ot<We.length;ot++)G_(We[ot],ue,Le);else G_(We,ue,Le)})};let k_=null;function TT(){Su.stop()}function ST(){Su.start()}const Su=new Qc;function pg(ue,Ve,Le){const We=Ve.isScene===!0?Ve.overrideMaterial:null;for(let ot=0,hn=ue.length;ot<hn;ot++){const zt=ue[ot],ut=zt.object,Kt=zt.geometry,Rt=We===null?zt.material:We,sn=zt.group;if(Le.isArrayCamera){const kt=Le.cameras;for(let rn=0,xi=kt.length;rn<xi;rn++){const On=kt[rn];ut.layers.test(On.layers)&&(Ye.viewport(U.copy(On.viewport)),f.setupLightsView(On),ET(ut,Ve,On,Kt,Rt,sn))}}else ET(ut,Ve,Le,Kt,Rt,sn)}}function ET(ue,Ve,Le,We,ot,hn){if(ue.onBeforeRender(_,Ve,Le,We,ot,hn),ue.modelViewMatrix.multiplyMatrices(Le.matrixWorldInverse,ue.matrixWorld),ue.normalMatrix.getNormalMatrix(ue.modelViewMatrix),ue.isImmediateRenderObject){const zt=AT(Le,Ve,ot,ue);Ye.setMaterial(ot),Cr.reset(),function(ut,Kt){ut.render(function(Rt){_.renderBufferImmediate(Rt,Kt)})}(ue,zt)}else ot.transparent===!0&&ot.side===ee?(ot.side=W,ot.needsUpdate=!0,_.renderBufferDirect(Le,Ve,We,ot,ue,hn),ot.side=z,ot.needsUpdate=!0,_.renderBufferDirect(Le,Ve,We,ot,ue,hn),ot.side=ee):_.renderBufferDirect(Le,Ve,We,ot,ue,hn);ue.onAfterRender(_,Ve,Le,We,ot,hn)}function G_(ue,Ve,Le){Ve.isScene!==!0&&(Ve=Ae);const We=Y.get(ue),ot=f.state.lights,hn=f.state.shadowsArray,zt=ot.state.version,ut=xt.getParameters(ue,ot.state,hn,Ve,Le),Kt=xt.getProgramCacheKey(ut);let Rt=We.programs;We.environment=ue.isMeshStandardMaterial?Ve.environment:null,We.fog=Ve.fog,We.envMap=ye.get(ue.envMap||We.environment),Rt===void 0&&(ue.addEventListener("dispose",wT),Rt=new Map,We.programs=Rt);let sn=Rt.get(Kt);if(sn!==void 0){if(We.currentProgram===sn&&We.lightsStateVersion===zt)return MT(ue,ut),sn}else ut.uniforms=xt.getUniforms(ue),ue.onBuild(ut,_),ue.onBeforeCompile(ut,_),sn=xt.acquireProgram(ut,Kt),Rt.set(Kt,sn),We.uniforms=ut.uniforms;const kt=We.uniforms;(ue.isShaderMaterial||ue.isRawShaderMaterial)&&ue.clipping!==!0||(kt.clippingPlanes=si.uniform),MT(ue,ut),We.needsLights=function(On){return On.isMeshLambertMaterial||On.isMeshToonMaterial||On.isMeshPhongMaterial||On.isMeshStandardMaterial||On.isShadowMaterial||On.isShaderMaterial&&On.lights===!0}(ue),We.lightsStateVersion=zt,We.needsLights&&(kt.ambientLightColor.value=ot.state.ambient,kt.lightProbe.value=ot.state.probe,kt.directionalLights.value=ot.state.directional,kt.directionalLightShadows.value=ot.state.directionalShadow,kt.spotLights.value=ot.state.spot,kt.spotLightShadows.value=ot.state.spotShadow,kt.rectAreaLights.value=ot.state.rectArea,kt.ltc_1.value=ot.state.rectAreaLTC1,kt.ltc_2.value=ot.state.rectAreaLTC2,kt.pointLights.value=ot.state.point,kt.pointLightShadows.value=ot.state.pointShadow,kt.hemisphereLights.value=ot.state.hemi,kt.directionalShadowMap.value=ot.state.directionalShadowMap,kt.directionalShadowMatrix.value=ot.state.directionalShadowMatrix,kt.spotShadowMap.value=ot.state.spotShadowMap,kt.spotShadowMatrix.value=ot.state.spotShadowMatrix,kt.pointShadowMap.value=ot.state.pointShadowMap,kt.pointShadowMatrix.value=ot.state.pointShadowMatrix);const rn=sn.getUniforms(),xi=es.seqWithValue(rn.seq,kt);return We.currentProgram=sn,We.uniformsList=xi,sn}function MT(ue,Ve){const Le=Y.get(ue);Le.outputEncoding=Ve.outputEncoding,Le.instancing=Ve.instancing,Le.skinning=Ve.skinning,Le.numClippingPlanes=Ve.numClippingPlanes,Le.numIntersection=Ve.numClipIntersection,Le.vertexAlphas=Ve.vertexAlphas}function AT(ue,Ve,Le,We){Ve.isScene!==!0&&(Ve=Ae),pe.resetTextureUnits();const ot=Ve.fog,hn=Le.isMeshStandardMaterial?Ve.environment:null,zt=I===null?_.outputEncoding:I.texture.encoding,ut=ye.get(Le.envMap||hn),Kt=Le.vertexColors===!0&&We.geometry&&We.geometry.attributes.color&&We.geometry.attributes.color.itemSize===4,Rt=Y.get(Le),sn=f.state.lights;if(Re===!0&&(ke===!0||ue!==C)){const Qi=ue===C&&Le.id===F;si.setState(Le,ue,Qi)}let kt=!1;Le.version===Rt.__version?Rt.needsLights&&Rt.lightsStateVersion!==sn.state.version||Rt.outputEncoding!==zt||We.isInstancedMesh&&Rt.instancing===!1?kt=!0:We.isInstancedMesh||Rt.instancing!==!0?We.isSkinnedMesh&&Rt.skinning===!1?kt=!0:We.isSkinnedMesh||Rt.skinning!==!0?Rt.envMap!==ut||Le.fog&&Rt.fog!==ot?kt=!0:Rt.numClippingPlanes===void 0||Rt.numClippingPlanes===si.numPlanes&&Rt.numIntersection===si.numIntersection?Rt.vertexAlphas!==Kt&&(kt=!0):kt=!0:kt=!0:kt=!0:(kt=!0,Rt.__version=Le.version);let rn=Rt.currentProgram;kt===!0&&(rn=G_(Le,Ve,We));let xi=!1,On=!1,Uo=!1;const Rn=rn.getUniforms(),bs=Rt.uniforms;if(Ye.useProgram(rn.program)&&(xi=!0,On=!0,Uo=!0),Le.id!==F&&(F=Le.id,On=!0),xi||C!==ue){if(Rn.setValue(it,"projectionMatrix",ue.projectionMatrix),Ge.logarithmicDepthBuffer&&Rn.setValue(it,"logDepthBufFC",2/(Math.log(ue.far+1)/Math.LN2)),C!==ue&&(C=ue,On=!0,Uo=!0),Le.isShaderMaterial||Le.isMeshPhongMaterial||Le.isMeshToonMaterial||Le.isMeshStandardMaterial||Le.envMap){const Qi=Rn.map.cameraPosition;Qi!==void 0&&Qi.setValue(it,te.setFromMatrixPosition(ue.matrixWorld))}(Le.isMeshPhongMaterial||Le.isMeshToonMaterial||Le.isMeshLambertMaterial||Le.isMeshBasicMaterial||Le.isMeshStandardMaterial||Le.isShaderMaterial)&&Rn.setValue(it,"isOrthographic",ue.isOrthographicCamera===!0),(Le.isMeshPhongMaterial||Le.isMeshToonMaterial||Le.isMeshLambertMaterial||Le.isMeshBasicMaterial||Le.isMeshStandardMaterial||Le.isShaderMaterial||Le.isShadowMaterial||We.isSkinnedMesh)&&Rn.setValue(it,"viewMatrix",ue.matrixWorldInverse)}if(We.isSkinnedMesh){Rn.setOptional(it,We,"bindMatrix"),Rn.setOptional(it,We,"bindMatrixInverse");const Qi=We.skeleton;Qi&&(Ge.floatVertexTextures?(Qi.boneTexture===null&&Qi.computeBoneTexture(),Rn.setValue(it,"boneTexture",Qi.boneTexture,pe),Rn.setValue(it,"boneTextureSize",Qi.boneTextureSize)):Rn.setOptional(it,Qi,"boneMatrices"))}var Ai,Vr;return(On||Rt.receiveShadow!==We.receiveShadow)&&(Rt.receiveShadow=We.receiveShadow,Rn.setValue(it,"receiveShadow",We.receiveShadow)),On&&(Rn.setValue(it,"toneMappingExposure",_.toneMappingExposure),Rt.needsLights&&(Vr=Uo,(Ai=bs).ambientLightColor.needsUpdate=Vr,Ai.lightProbe.needsUpdate=Vr,Ai.directionalLights.needsUpdate=Vr,Ai.directionalLightShadows.needsUpdate=Vr,Ai.pointLights.needsUpdate=Vr,Ai.pointLightShadows.needsUpdate=Vr,Ai.spotLights.needsUpdate=Vr,Ai.spotLightShadows.needsUpdate=Vr,Ai.rectAreaLights.needsUpdate=Vr,Ai.hemisphereLights.needsUpdate=Vr),ot&&Le.fog&&_t.refreshFogUniforms(bs,ot),_t.refreshMaterialUniforms(bs,Le,Z,ne,Be),es.upload(it,Rt.uniformsList,bs,pe)),Le.isShaderMaterial&&Le.uniformsNeedUpdate===!0&&(es.upload(it,Rt.uniformsList,bs,pe),Le.uniformsNeedUpdate=!1),Le.isSpriteMaterial&&Rn.setValue(it,"center",We.center),Rn.setValue(it,"modelViewMatrix",We.modelViewMatrix),Rn.setValue(it,"normalMatrix",We.normalMatrix),Rn.setValue(it,"modelMatrix",We.matrixWorld),rn}Su.setAnimationLoop(function(ue){k_&&k_(ue)}),typeof window!="undefined"&&Su.setContext(window),this.setAnimationLoop=function(ue){k_=ue,zr.setAnimationLoop(ue),ue===null?Su.stop():Su.start()},zr.addEventListener("sessionstart",TT),zr.addEventListener("sessionend",ST),this.render=function(ue,Ve){if(Ve!==void 0&&Ve.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(y===!0)return;ue.autoUpdate===!0&&ue.updateMatrixWorld(),Ve.parent===null&&Ve.updateMatrixWorld(),zr.enabled===!0&&zr.isPresenting===!0&&(zr.cameraAutoUpdate===!0&&zr.updateCamera(Ve),Ve=zr.getCamera()),ue.isScene===!0&&ue.onBeforeRender(_,ue,Ve,I),f=Wt.get(ue,g.length),f.init(),g.push(f),J.multiplyMatrices(Ve.projectionMatrix,Ve.matrixWorldInverse),fe.setFromProjectionMatrix(J),ke=this.localClippingEnabled,Re=si.init(this.clippingPlanes,ke,Ve),d=Gt.get(ue,m.length),d.init(),m.push(d),function zt(ut,Kt,Rt,sn){if(ut.visible===!1)return;if(ut.layers.test(Kt.layers)){if(ut.isGroup)Rt=ut.renderOrder;else if(ut.isLOD)ut.autoUpdate===!0&&ut.update(Kt);else if(ut.isLight)f.pushLight(ut),ut.castShadow&&f.pushShadow(ut);else if(ut.isSprite){if(!ut.frustumCulled||fe.intersectsSprite(ut)){sn&&te.setFromMatrixPosition(ut.matrixWorld).applyMatrix4(J);const rn=ht.update(ut),xi=ut.material;xi.visible&&d.push(ut,rn,xi,Rt,te.z,null)}}else if(ut.isImmediateRenderObject)sn&&te.setFromMatrixPosition(ut.matrixWorld).applyMatrix4(J),d.push(ut,null,ut.material,Rt,te.z,null);else if((ut.isMesh||ut.isLine||ut.isPoints)&&(ut.isSkinnedMesh&&ut.skeleton.frame!==ve.render.frame&&(ut.skeleton.update(),ut.skeleton.frame=ve.render.frame),!ut.frustumCulled||fe.intersectsObject(ut))){sn&&te.setFromMatrixPosition(ut.matrixWorld).applyMatrix4(J);const rn=ht.update(ut),xi=ut.material;if(Array.isArray(xi)){const On=rn.groups;for(let Uo=0,Rn=On.length;Uo<Rn;Uo++){const bs=On[Uo],Ai=xi[bs.materialIndex];Ai&&Ai.visible&&d.push(ut,rn,Ai,Rt,te.z,bs)}}else xi.visible&&d.push(ut,rn,xi,Rt,te.z,null)}}const kt=ut.children;for(let rn=0,xi=kt.length;rn<xi;rn++)zt(kt[rn],Kt,Rt,sn)}(ue,Ve,0,_.sortObjects),d.finish(),_.sortObjects===!0&&d.sort(Q,$),Re===!0&&si.beginShadows();const Le=f.state.shadowsArray;Cn.render(Le,ue,Ve),f.setupLights(),f.setupLightsView(Ve),Re===!0&&si.endShadows(),this.info.autoReset===!0&&this.info.reset(),Bo.render(d,ue);const We=d.opaque,ot=d.transmissive,hn=d.transparent;We.length>0&&pg(We,ue,Ve),ot.length>0&&function(zt,ut,Kt,Rt){if(Be===null){const rn=s===!0&&Ge.isWebGL2===!0;Be=new(rn?Os:Ir)(1024,1024,{generateMipmaps:!0,type:dr.convert(Es)!==null?Es:zo,minFilter:Ts,magFilter:Zn,wrapS:mi,wrapT:mi})}const sn=_.getRenderTarget();_.setRenderTarget(Be),_.clear();const kt=_.toneMapping;_.toneMapping=uo,pg(zt,Kt,Rt),_.toneMapping=kt,pe.updateMultisampleRenderTarget(Be),pe.updateRenderTargetMipmap(Be),_.setRenderTarget(sn),pg(ut,Kt,Rt)}(We,ot,ue,Ve),hn.length>0&&pg(hn,ue,Ve),I!==null&&(pe.updateMultisampleRenderTarget(I),pe.updateRenderTargetMipmap(I)),ue.isScene===!0&&ue.onAfterRender(_,ue,Ve),Ye.buffers.depth.setTest(!0),Ye.buffers.depth.setMask(!0),Ye.buffers.color.setMask(!0),Ye.setPolygonOffset(!1),Cr.resetDefaultState(),F=-1,C=null,g.pop(),f=g.length>0?g[g.length-1]:null,m.pop(),d=m.length>0?m[m.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return I},this.setRenderTarget=function(ue,Ve=0,Le=0){I=ue,w=Ve,M=Le,ue&&Y.get(ue).__webglFramebuffer===void 0&&pe.setupRenderTarget(ue);let We=null,ot=!1,hn=!1;if(ue){const zt=ue.texture;(zt.isDataTexture3D||zt.isDataTexture2DArray)&&(hn=!0);const ut=Y.get(ue).__webglFramebuffer;ue.isWebGLCubeRenderTarget?(We=ut[Ve],ot=!0):We=ue.isWebGLMultisampleRenderTarget?Y.get(ue).__webglMultisampledFramebuffer:ut,U.copy(ue.viewport),N.copy(ue.scissor),G=ue.scissorTest}else U.copy(se).multiplyScalar(Z).floor(),N.copy(me).multiplyScalar(Z).floor(),G=ge;if(Ye.bindFramebuffer(36160,We)&&Ge.drawBuffers){let zt=!1;if(ue)if(ue.isWebGLMultipleRenderTargets){const ut=ue.texture;if(de.length!==ut.length||de[0]!==36064){for(let Kt=0,Rt=ut.length;Kt<Rt;Kt++)de[Kt]=36064+Kt;de.length=ut.length,zt=!0}}else de.length===1&&de[0]===36064||(de[0]=36064,de.length=1,zt=!0);else de.length===1&&de[0]===1029||(de[0]=1029,de.length=1,zt=!0);zt&&(Ge.isWebGL2?it.drawBuffers(de):Te.get("WEBGL_draw_buffers").drawBuffersWEBGL(de))}if(Ye.viewport(U),Ye.scissor(N),Ye.setScissorTest(G),ot){const zt=Y.get(ue.texture);it.framebufferTexture2D(36160,36064,34069+Ve,zt.__webglTexture,Le)}else if(hn){const zt=Y.get(ue.texture),ut=Ve||0;it.framebufferTextureLayer(36160,36064,zt.__webglTexture,Le||0,ut)}},this.readRenderTargetPixels=function(ue,Ve,Le,We,ot,hn,zt){if(!ue||!ue.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ut=Y.get(ue).__webglFramebuffer;if(ue.isWebGLCubeRenderTarget&&zt!==void 0&&(ut=ut[zt]),ut){Ye.bindFramebuffer(36160,ut);try{const Kt=ue.texture,Rt=Kt.format,sn=Kt.type;if(Rt!==er&&dr.convert(Rt)!==it.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const kt=sn===Es&&(Te.has("EXT_color_buffer_half_float")||Ge.isWebGL2&&Te.has("EXT_color_buffer_float"));if(!(sn===zo||dr.convert(sn)===it.getParameter(35738)||sn===ho&&(Ge.isWebGL2||Te.has("OES_texture_float")||Te.has("WEBGL_color_buffer_float"))||kt))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");it.checkFramebufferStatus(36160)===36053?Ve>=0&&Ve<=ue.width-We&&Le>=0&&Le<=ue.height-ot&&it.readPixels(Ve,Le,We,ot,dr.convert(Rt),dr.convert(sn),hn):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Kt=I!==null?Y.get(I).__webglFramebuffer:null;Ye.bindFramebuffer(36160,Kt)}}},this.copyFramebufferToTexture=function(ue,Ve,Le=0){const We=Math.pow(2,-Le),ot=Math.floor(Ve.image.width*We),hn=Math.floor(Ve.image.height*We);let zt=dr.convert(Ve.format);Ge.isWebGL2&&(zt===6407&&(zt=32849),zt===6408&&(zt=32856)),pe.setTexture2D(Ve,0),it.copyTexImage2D(3553,Le,zt,ue.x,ue.y,ot,hn,0),Ye.unbindTexture()},this.copyTextureToTexture=function(ue,Ve,Le,We=0){const ot=Ve.image.width,hn=Ve.image.height,zt=dr.convert(Le.format),ut=dr.convert(Le.type);pe.setTexture2D(Le,0),it.pixelStorei(37440,Le.flipY),it.pixelStorei(37441,Le.premultiplyAlpha),it.pixelStorei(3317,Le.unpackAlignment),Ve.isDataTexture?it.texSubImage2D(3553,We,ue.x,ue.y,ot,hn,zt,ut,Ve.image.data):Ve.isCompressedTexture?it.compressedTexSubImage2D(3553,We,ue.x,ue.y,Ve.mipmaps[0].width,Ve.mipmaps[0].height,zt,Ve.mipmaps[0].data):it.texSubImage2D(3553,We,ue.x,ue.y,zt,ut,Ve.image),We===0&&Le.generateMipmaps&&it.generateMipmap(3553),Ye.unbindTexture()},this.copyTextureToTexture3D=function(ue,Ve,Le,We,ot=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const hn=ue.max.x-ue.min.x+1,zt=ue.max.y-ue.min.y+1,ut=ue.max.z-ue.min.z+1,Kt=dr.convert(We.format),Rt=dr.convert(We.type);let sn;if(We.isDataTexture3D)pe.setTexture3D(We,0),sn=32879;else{if(!We.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");pe.setTexture2DArray(We,0),sn=35866}it.pixelStorei(37440,We.flipY),it.pixelStorei(37441,We.premultiplyAlpha),it.pixelStorei(3317,We.unpackAlignment);const kt=it.getParameter(3314),rn=it.getParameter(32878),xi=it.getParameter(3316),On=it.getParameter(3315),Uo=it.getParameter(32877),Rn=Le.isCompressedTexture?Le.mipmaps[0]:Le.image;it.pixelStorei(3314,Rn.width),it.pixelStorei(32878,Rn.height),it.pixelStorei(3316,ue.min.x),it.pixelStorei(3315,ue.min.y),it.pixelStorei(32877,ue.min.z),Le.isDataTexture||Le.isDataTexture3D?it.texSubImage3D(sn,ot,Ve.x,Ve.y,Ve.z,hn,zt,ut,Kt,Rt,Rn.data):Le.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),it.compressedTexSubImage3D(sn,ot,Ve.x,Ve.y,Ve.z,hn,zt,ut,Kt,Rn.data)):it.texSubImage3D(sn,ot,Ve.x,Ve.y,Ve.z,hn,zt,ut,Kt,Rt,Rn),it.pixelStorei(3314,kt),it.pixelStorei(32878,rn),it.pixelStorei(3316,xi),it.pixelStorei(3315,On),it.pixelStorei(32877,Uo),ot===0&&We.generateMipmaps&&it.generateMipmap(sn),Ye.unbindTexture()},this.initTexture=function(ue){pe.setTexture2D(ue,0),Ye.unbindTexture()},this.resetState=function(){w=0,M=0,I=null,Ye.reset(),Cr.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class ci extends fn{}ci.prototype.isWebGL1Renderer=!0;class _i{constructor(e,t=25e-5){this.name="",this.color=new gt(e),this.density=t}clone(){return new _i(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}_i.prototype.isFogExp2=!0;class Fl{constructor(e,t=1,n=1e3){this.name="",this.color=new gt(e),this.near=t,this.far=n}clone(){return new Fl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Fl.prototype.isFog=!0;class Ba extends Xt{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}Ba.prototype.isScene=!0;class qs{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Rs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ir()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,o=this.stride;i<o;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ir()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ir()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}qs.prototype.isInterleavedBuffer=!0;const ei=new T;class Mo{constructor(e,t,n,i=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ei.x=this.getX(t),ei.y=this.getY(t),ei.z=this.getZ(t),ei.applyMatrix4(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ei.x=this.getX(t),ei.y=this.getY(t),ei.z=this.getZ(t),ei.applyNormalMatrix(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ei.x=this.getX(t),ei.y=this.getY(t),ei.z=this.getZ(t),ei.transformDirection(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,o){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=o,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[i+o])}return new Zt(new this.array.constructor(t),this.itemSize,this.normalized)}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Mo(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[i+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Mo.prototype.isInterleavedBufferAttribute=!0;class Bl extends vi{constructor(e){super(),this.type="SpriteMaterial",this.color=new gt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Zs;Bl.prototype.isSpriteMaterial=!0;const to=new T,Ua=new T,Js=new T,$s=new Qe,Ul=new Qe,Gf=new pt,Th=new T,kl=new T,Sh=new T,Hf=new Qe,Gl=new Qe,gd=new Qe;class Hl extends Xt{constructor(e){if(super(),this.type="Sprite",Zs===void 0){Zs=new Mt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new qs(t,5);Zs.setIndex([0,1,2,0,2,3]),Zs.setAttribute("position",new Mo(n,3,0,!1)),Zs.setAttribute("uv",new Mo(n,2,3,!1))}this.geometry=Zs,this.material=e!==void 0?e:new Bl,this.center=new Qe(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ua.setFromMatrixScale(this.matrixWorld),Gf.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Js.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ua.multiplyScalar(-Js.z);const n=this.material.rotation;let i,o;n!==0&&(o=Math.cos(n),i=Math.sin(n));const s=this.center;Eh(Th.set(-.5,-.5,0),Js,s,Ua,i,o),Eh(kl.set(.5,-.5,0),Js,s,Ua,i,o),Eh(Sh.set(.5,.5,0),Js,s,Ua,i,o),Hf.set(0,0),Gl.set(1,0),gd.set(1,1);let a=e.ray.intersectTriangle(Th,kl,Sh,!1,to);if(a===null&&(Eh(kl.set(-.5,.5,0),Js,s,Ua,i,o),Gl.set(0,1),a=e.ray.intersectTriangle(Th,Sh,kl,!1,to),a===null))return;const l=e.ray.origin.distanceTo(to);l<e.near||l>e.far||t.push({distance:l,point:to.clone(),uv:Mn.getUV(to,Th,kl,Sh,Hf,Gl,gd,new Qe),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Eh(r,e,t,n,i,o){$s.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Ul.x=o*$s.x-i*$s.y,Ul.y=i*$s.x+o*$s.y):Ul.copy($s),r.copy(e),r.x+=Ul.x,r.y+=Ul.y,r.applyMatrix4(Gf)}Hl.prototype.isSprite=!0;const ka=new T,zf=new T;class Vf extends Xt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const o=t[n];this.addLevel(o.object.clone(),o.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){ka.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(ka);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){ka.setFromMatrixPosition(e.matrixWorld),zf.setFromMatrixPosition(this.matrixWorld);const n=ka.distanceTo(zf)/e.zoom;let i,o;for(t[0].object.visible=!0,i=1,o=t.length;i<o&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;i<o;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,o=n.length;i<o;i++){const s=n[i];t.object.levels.push({object:s.object.uuid,distance:s.distance})}return t}}const Hi=new T,Mh=new pn,jf=new pn,sv=new T,Ah=new pt;class Ga extends ln{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new pt,this.bindMatrixInverse=new pt}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new pn,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);const o=1/e.manhattanLength();o!==1/0?e.multiplyScalar(o):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,i=this.geometry;Mh.fromBufferAttribute(i.attributes.skinIndex,e),jf.fromBufferAttribute(i.attributes.skinWeight,e),Hi.fromBufferAttribute(i.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let o=0;o<4;o++){const s=jf.getComponent(o);if(s!==0){const a=Mh.getComponent(o);Ah.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(sv.copy(Hi).applyMatrix4(Ah),s)}}return t.applyMatrix4(this.bindMatrixInverse)}}Ga.prototype.isSkinnedMesh=!0;class Ph extends Xt{constructor(){super(),this.type="Bone"}}Ph.prototype.isBone=!0;class ns extends $n{constructor(e=null,t=1,n=1,i,o,s,a,l,u=Zn,c=Zn,d,f){super(null,s,a,l,u,c,i,o,d,f),this.image={data:e,width:t,height:n},this.magFilter=u,this.minFilter=c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}ns.prototype.isDataTexture=!0;const Wf=new pt,Xf=new pt;class Ch{constructor(e=[],t=[]){this.uuid=ir(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new pt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new pt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let o=0,s=e.length;o<s;o++){const a=e[o]?e[o].matrixWorld:Xf;Wf.multiplyMatrices(a,t[o]),Wf.toArray(n,16*o)}i!==null&&(i.needsUpdate=!0)}clone(){return new Ch(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=ya(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new ns(t,e,e,er,ho);return this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const o=e.bones[n];let s=t[o];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",o),s=new Ph),this.bones.push(s),this.boneInverses.push(new pt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,o=t.length;i<o;i++){const s=t[i];e.bones.push(s.uuid);const a=n[i];e.boneInverses.push(a.toArray())}return e}}const Yf=new pt,Rh=new pt,Ha=[],zl=new ln;class vd extends ln{constructor(e,t,n){super(e,t),this.instanceMatrix=new Zt(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,i=this.count;if(zl.geometry=this.geometry,zl.material=this.material,zl.material!==void 0)for(let o=0;o<i;o++){this.getMatrixAt(o,Yf),Rh.multiplyMatrices(n,Yf),zl.matrixWorld=Rh,zl.raycast(e,Ha);for(let s=0,a=Ha.length;s<a;s++){const l=Ha[s];l.instanceId=o,l.object=this,t.push(l)}Ha.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Zt(new Float32Array(3*this.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}vd.prototype.isInstancedMesh=!0;class yi extends vi{constructor(e){super(),this.type="LineBasicMaterial",this.color=new gt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}yi.prototype.isLineBasicMaterial=!0;const qf=new T,Ih=new T,Zf=new pt,_d=new bo,Lh=new li;class h extends Xt{constructor(e=new Mt,t=new yi){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,o=t.count;i<o;i++)qf.fromBufferAttribute(t,i-1),Ih.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=qf.distanceTo(Ih);e.setAttribute("lineDistance",new st(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,o=e.params.Line.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Lh.copy(n.boundingSphere),Lh.applyMatrix4(i),Lh.radius+=o,e.ray.intersectsSphere(Lh)===!1)return;Zf.copy(i).invert(),_d.copy(e.ray).applyMatrix4(Zf);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,u=new T,c=new T,d=new T,f=new T,m=this.isLineSegments?2:1;if(n.isBufferGeometry){const g=n.index,_=n.attributes.position;if(g!==null)for(let y=Math.max(0,s.start),w=Math.min(g.count,s.start+s.count)-1;y<w;y+=m){const M=g.getX(y),I=g.getX(y+1);if(u.fromBufferAttribute(_,M),c.fromBufferAttribute(_,I),_d.distanceSqToSegment(u,c,f,d)>l)continue;f.applyMatrix4(this.matrixWorld);const F=e.ray.origin.distanceTo(f);F<e.near||F>e.far||t.push({distance:F,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(let y=Math.max(0,s.start),w=Math.min(_.count,s.start+s.count)-1;y<w;y+=m){if(u.fromBufferAttribute(_,y),c.fromBufferAttribute(_,y+1),_d.distanceSqToSegment(u,c,f,d)>l)continue;f.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(f);M<e.near||M>e.far||t.push({distance:M,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o<s;o++){const a=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}h.prototype.isLine=!0;const p=new T,x=new T;class E extends h{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,o=t.count;i<o;i+=2)p.fromBufferAttribute(t,i),x.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+p.distanceTo(x);e.setAttribute("lineDistance",new st(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}E.prototype.isLineSegments=!0;class P extends h{constructor(e,t){super(e,t),this.type="LineLoop"}}P.prototype.isLineLoop=!0;class V extends vi{constructor(e){super(),this.type="PointsMaterial",this.color=new gt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}V.prototype.isPointsMaterial=!0;const re=new pt,ce=new bo,_e=new li,He=new T;class ze extends Xt{constructor(e=new Mt,t=new V){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,o=e.params.Points.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_e.copy(n.boundingSphere),_e.applyMatrix4(i),_e.radius+=o,e.ray.intersectsSphere(_e)===!1)return;re.copy(i).invert(),ce.copy(e.ray).applyMatrix4(re);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const u=n.index,c=n.attributes.position;if(u!==null)for(let d=Math.max(0,s.start),f=Math.min(u.count,s.start+s.count);d<f;d++){const m=u.getX(d);He.fromBufferAttribute(c,m),tt(He,m,l,i,e,t,this)}else for(let d=Math.max(0,s.start),f=Math.min(c.count,s.start+s.count);d<f;d++)He.fromBufferAttribute(c,d),tt(He,d,l,i,e,t,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o<s;o++){const a=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function tt(r,e,t,n,i,o,s){const a=ce.distanceSqToPoint(r);if(a<t){const l=new T;ce.closestPointToPoint(r,l),l.applyMatrix4(n);const u=i.ray.origin.distanceTo(l);if(u<i.near||u>i.far)return;o.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:s})}}ze.prototype.isPoints=!0;class vt extends $n{constructor(e,t,n,i,o,s,a,l,u){super(e,t,n,i,o,s,a,l,u),this.format=a!==void 0?a:co,this.minFilter=s!==void 0?s:Jn,this.magFilter=o!==void 0?o:Jn,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(function d(){c.needsUpdate=!0,e.requestVideoFrameCallback(d)})}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!("requestVideoFrameCallback"in e)&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}vt.prototype.isVideoTexture=!0;class yt extends $n{constructor(e,t,n,i,o,s,a,l,u,c,d,f){super(null,s,a,l,u,c,i,o,d,f),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}yt.prototype.isCompressedTexture=!0;class Ct extends $n{constructor(e,t,n,i,o,s,a,l,u){super(e,t,n,i,o,s,a,l,u),this.needsUpdate=!0}}Ct.prototype.isCanvasTexture=!0;class Je extends $n{constructor(e,t,n,i,o,s,a,l,u,c){if((c=c!==void 0?c:Nn)!==Nn&&c!==Ms)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&c===Nn&&(n=cl),n===void 0&&c===Ms&&(n=dn),super(null,i,o,s,a,l,c,n,u),this.image={width:e,height:t},this.magFilter=a!==void 0?a:Zn,this.minFilter=l!==void 0?l:Zn,this.flipY=!1,this.generateMipmaps=!1}}Je.prototype.isDepthTexture=!0;class nt extends Mt{constructor(e=1,t=8,n=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const o=[],s=[],a=[],l=[],u=new T,c=new Qe;s.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,f=3;d<=t;d++,f+=3){const m=n+d/t*i;u.x=e*Math.cos(m),u.y=e*Math.sin(m),s.push(u.x,u.y,u.z),a.push(0,0,1),c.x=(s[f]/e+1)/2,c.y=(s[f+1]/e+1)/2,l.push(c.x,c.y)}for(let d=1;d<=t;d++)o.push(d,d+1,0);this.setIndex(o),this.setAttribute("position",new st(s,3)),this.setAttribute("normal",new st(a,3)),this.setAttribute("uv",new st(l,2))}static fromJSON(e){return new nt(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Et extends Mt{constructor(e=1,t=1,n=1,i=8,o=1,s=!1,a=0,l=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:o,openEnded:s,thetaStart:a,thetaLength:l};const u=this;i=Math.floor(i),o=Math.floor(o);const c=[],d=[],f=[],m=[];let g=0;const _=[],y=n/2;let w=0;function M(I){const F=g,C=new Qe,U=new T;let N=0;const G=I===!0?e:t,he=I===!0?1:-1;for(let Z=1;Z<=i;Z++)d.push(0,y*he,0),f.push(0,he,0),m.push(.5,.5),g++;const ne=g;for(let Z=0;Z<=i;Z++){const Q=Z/i*l+a,$=Math.cos(Q),se=Math.sin(Q);U.x=G*se,U.y=y*he,U.z=G*$,d.push(U.x,U.y,U.z),f.push(0,he,0),C.x=.5*$+.5,C.y=.5*se*he+.5,m.push(C.x,C.y),g++}for(let Z=0;Z<i;Z++){const Q=F+Z,$=ne+Z;I===!0?c.push($,$+1,Q):c.push($+1,$,Q),N+=3}u.addGroup(w,N,I===!0?1:2),w+=N}(function(){const I=new T,F=new T;let C=0;const U=(t-e)/n;for(let N=0;N<=o;N++){const G=[],he=N/o,ne=he*(t-e)+e;for(let Z=0;Z<=i;Z++){const Q=Z/i,$=Q*l+a,se=Math.sin($),me=Math.cos($);F.x=ne*se,F.y=-he*n+y,F.z=ne*me,d.push(F.x,F.y,F.z),I.set(se,U,me).normalize(),f.push(I.x,I.y,I.z),m.push(Q,1-he),G.push(g++)}_.push(G)}for(let N=0;N<i;N++)for(let G=0;G<o;G++){const he=_[G][N],ne=_[G+1][N],Z=_[G+1][N+1],Q=_[G][N+1];c.push(he,ne,Q),c.push(ne,Z,Q),C+=6}u.addGroup(w,C,0),w+=C})(),s===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(c),this.setAttribute("position",new st(d,3)),this.setAttribute("normal",new st(f,3)),this.setAttribute("uv",new st(m,2))}static fromJSON(e){return new Et(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class mt extends Et{constructor(e=1,t=1,n=8,i=1,o=!1,s=0,a=2*Math.PI){super(0,e,t,n,i,o,s,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:o,thetaStart:s,thetaLength:a}}static fromJSON(e){return new mt(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class St extends Mt{constructor(e,t,n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const o=[],s=[];function a(f,m,g,_){const y=_+1,w=[];for(let M=0;M<=y;M++){w[M]=[];const I=f.clone().lerp(g,M/y),F=m.clone().lerp(g,M/y),C=y-M;for(let U=0;U<=C;U++)w[M][U]=U===0&&M===y?I:I.clone().lerp(F,U/C)}for(let M=0;M<y;M++)for(let I=0;I<2*(y-M)-1;I++){const F=Math.floor(I/2);I%2==0?(l(w[M][F+1]),l(w[M+1][F]),l(w[M][F])):(l(w[M][F+1]),l(w[M+1][F+1]),l(w[M+1][F]))}}function l(f){o.push(f.x,f.y,f.z)}function u(f,m){const g=3*f;m.x=e[g+0],m.y=e[g+1],m.z=e[g+2]}function c(f,m,g,_){_<0&&f.x===1&&(s[m]=f.x-1),g.x===0&&g.z===0&&(s[m]=_/2/Math.PI+.5)}function d(f){return Math.atan2(f.z,-f.x)}(function(f){const m=new T,g=new T,_=new T;for(let y=0;y<t.length;y+=3)u(t[y+0],m),u(t[y+1],g),u(t[y+2],_),a(m,g,_,f)})(i),function(f){const m=new T;for(let g=0;g<o.length;g+=3)m.x=o[g+0],m.y=o[g+1],m.z=o[g+2],m.normalize().multiplyScalar(f),o[g+0]=m.x,o[g+1]=m.y,o[g+2]=m.z}(n),function(){const f=new T;for(let g=0;g<o.length;g+=3){f.x=o[g+0],f.y=o[g+1],f.z=o[g+2];const _=d(f)/2/Math.PI+.5,y=(m=f,Math.atan2(-m.y,Math.sqrt(m.x*m.x+m.z*m.z))/Math.PI+.5);s.push(_,1-y)}var m;(function(){const g=new T,_=new T,y=new T,w=new T,M=new Qe,I=new Qe,F=new Qe;for(let C=0,U=0;C<o.length;C+=9,U+=6){g.set(o[C+0],o[C+1],o[C+2]),_.set(o[C+3],o[C+4],o[C+5]),y.set(o[C+6],o[C+7],o[C+8]),M.set(s[U+0],s[U+1]),I.set(s[U+2],s[U+3]),F.set(s[U+4],s[U+5]),w.copy(g).add(_).add(y).divideScalar(3);const N=d(w);c(M,U+0,g,N),c(I,U+2,_,N),c(F,U+4,y,N)}})(),function(){for(let g=0;g<s.length;g+=6){const _=s[g+0],y=s[g+2],w=s[g+4],M=Math.max(_,y,w),I=Math.min(_,y,w);M>.9&&I<.1&&(_<.2&&(s[g+0]+=1),y<.2&&(s[g+2]+=1),w<.2&&(s[g+4]+=1))}}()}(),this.setAttribute("position",new st(o,3)),this.setAttribute("normal",new st(o.slice(),3)),this.setAttribute("uv",new st(s,2)),i===0?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new St(e.vertices,e.indices,e.radius,e.details)}}class It extends St{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new It(e.radius,e.detail)}}const jt=new T,Tt=new T,Ot=new T,Wn=new Mn;class Ei extends Mt{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const n=Math.pow(10,4),i=Math.cos(Sn*t),o=e.getIndex(),s=e.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],u=["a","b","c"],c=new Array(3),d={},f=[];for(let m=0;m<a;m+=3){o?(l[0]=o.getX(m),l[1]=o.getX(m+1),l[2]=o.getX(m+2)):(l[0]=m,l[1]=m+1,l[2]=m+2);const{a:g,b:_,c:y}=Wn;if(g.fromBufferAttribute(s,l[0]),_.fromBufferAttribute(s,l[1]),y.fromBufferAttribute(s,l[2]),Wn.getNormal(Ot),c[0]=`${Math.round(g.x*n)},${Math.round(g.y*n)},${Math.round(g.z*n)}`,c[1]=`${Math.round(_.x*n)},${Math.round(_.y*n)},${Math.round(_.z*n)}`,c[2]=`${Math.round(y.x*n)},${Math.round(y.y*n)},${Math.round(y.z*n)}`,c[0]!==c[1]&&c[1]!==c[2]&&c[2]!==c[0])for(let w=0;w<3;w++){const M=(w+1)%3,I=c[w],F=c[M],C=Wn[u[w]],U=Wn[u[M]],N=`${I}_${F}`,G=`${F}_${I}`;G in d&&d[G]?(Ot.dot(d[G].normal)<=i&&(f.push(C.x,C.y,C.z),f.push(U.x,U.y,U.z)),d[G]=null):N in d||(d[N]={index0:l[w],index1:l[M],normal:Ot.clone()})}}for(const m in d)if(d[m]){const{index0:g,index1:_}=d[m];jt.fromBufferAttribute(s,g),Tt.fromBufferAttribute(s,_),f.push(jt.x,jt.y,jt.z),f.push(Tt.x,Tt.y,Tt.z)}this.setAttribute("position",new st(f,3))}}class Xn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),o=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),o+=n.distanceTo(i),t.push(o),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const o=n.length;let s;s=t||e*n[o-1];let a,l=0,u=o-1;for(;l<=u;)if(i=Math.floor(l+(u-l)/2),a=n[i]-s,a<0)l=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(i=u,n[i]===s)return i/(o-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(o-1)}getTangent(e,t){let n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);const o=this.getPoint(n),s=this.getPoint(i),a=t||(o.isVector2?new Qe:new T);return a.copy(s).sub(o).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new T,i=[],o=[],s=[],a=new T,l=new pt;for(let m=0;m<=e;m++){const g=m/e;i[m]=this.getTangentAt(g,new T),i[m].normalize()}o[0]=new T,s[0]=new T;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),d=Math.abs(i[0].y),f=Math.abs(i[0].z);c<=u&&(u=c,n.set(1,0,0)),d<=u&&(u=d,n.set(0,1,0)),f<=u&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),o[0].crossVectors(i[0],a),s[0].crossVectors(i[0],o[0]);for(let m=1;m<=e;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(Ti(i[m-1].dot(i[m]),-1,1));o[m].applyMatrix4(l.makeRotationAxis(a,g))}s[m].crossVectors(i[m],o[m])}if(t===!0){let m=Math.acos(Ti(o[0].dot(o[e]),-1,1));m/=e,i[0].dot(a.crossVectors(o[0],o[e]))>0&&(m=-m);for(let g=1;g<=e;g++)o[g].applyMatrix4(l.makeRotationAxis(i[g],m*g)),s[g].crossVectors(i[g],o[g])}return{tangents:i,normals:o,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class kn extends Xn{constructor(e=0,t=0,n=1,i=1,o=0,s=2*Math.PI,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new Qe,i=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=i;for(;o>i;)o-=i;o<Number.EPSILON&&(o=s?0:i),this.aClockwise!==!0||s||(o===i?o=-i:o-=i);const a=this.aStartAngle+e*o;let l=this.aX+this.xRadius*Math.cos(a),u=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const c=Math.cos(this.aRotation),d=Math.sin(this.aRotation),f=l-this.aX,m=u-this.aY;l=f*c-m*d+this.aX,u=f*d+m*c+this.aY}return n.set(l,u)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}kn.prototype.isEllipseCurve=!0;class kr extends kn{constructor(e,t,n,i,o,s){super(e,t,n,n,i,o,s),this.type="ArcCurve"}}function no(){let r=0,e=0,t=0,n=0;function i(o,s,a,l){r=o,e=a,t=-3*o+3*s-2*a-l,n=2*o-2*s+a+l}return{initCatmullRom:function(o,s,a,l,u){i(s,a,u*(a-o),u*(l-s))},initNonuniformCatmullRom:function(o,s,a,l,u,c,d){let f=(s-o)/u-(a-o)/(u+c)+(a-s)/c,m=(a-s)/c-(l-s)/(c+d)+(l-a)/d;f*=c,m*=c,i(s,a,f,m)},calc:function(o){const s=o*o;return r+e*o+t*s+n*(s*o)}}}kr.prototype.isArcCurve=!0;const is=new T,za=new no,rs=new no,io=new no;class Oh extends Xn{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new T){const n=t,i=this.points,o=i.length,s=(o-(this.closed?0:1))*e;let a,l,u=Math.floor(s),c=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/o)+1)*o:c===0&&u===o-1&&(u=o-2,c=1),this.closed||u>0?a=i[(u-1)%o]:(is.subVectors(i[0],i[1]).add(i[0]),a=is);const d=i[u%o],f=i[(u+1)%o];if(this.closed||u+2<o?l=i[(u+2)%o]:(is.subVectors(i[o-1],i[o-2]).add(i[o-1]),l=is),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let g=Math.pow(a.distanceToSquared(d),m),_=Math.pow(d.distanceToSquared(f),m),y=Math.pow(f.distanceToSquared(l),m);_<1e-4&&(_=1),g<1e-4&&(g=_),y<1e-4&&(y=_),za.initNonuniformCatmullRom(a.x,d.x,f.x,l.x,g,_,y),rs.initNonuniformCatmullRom(a.y,d.y,f.y,l.y,g,_,y),io.initNonuniformCatmullRom(a.z,d.z,f.z,l.z,g,_,y)}else this.curveType==="catmullrom"&&(za.initCatmullRom(a.x,d.x,f.x,l.x,this.tension),rs.initCatmullRom(a.y,d.y,f.y,l.y,this.tension),io.initCatmullRom(a.z,d.z,f.z,l.z,this.tension));return n.set(za.calc(c),rs.calc(c),io.calc(c)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new T().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function yd(r,e,t,n,i){const o=.5*(n-e),s=.5*(i-t),a=r*r;return(2*t-2*n+o+s)*(r*a)+(-3*t+3*n-2*o-s)*a+o*r+t}function os(r,e,t,n){return function(i,o){const s=1-i;return s*s*o}(r,e)+function(i,o){return 2*(1-i)*i*o}(r,t)+function(i,o){return i*i*o}(r,n)}function Ks(r,e,t,n,i){return function(o,s){const a=1-o;return a*a*a*s}(r,e)+function(o,s){const a=1-o;return 3*a*a*o*s}(r,t)+function(o,s){return 3*(1-o)*o*o*s}(r,n)+function(o,s){return o*o*o*s}(r,i)}Oh.prototype.isCatmullRomCurve3=!0;class Qs extends Xn{constructor(e=new Qe,t=new Qe,n=new Qe,i=new Qe){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Qe){const n=t,i=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(Ks(e,i.x,o.x,s.x,a.x),Ks(e,i.y,o.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Qs.prototype.isCubicBezierCurve=!0;class Va extends Xn{constructor(e=new T,t=new T,n=new T,i=new T){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new T){const n=t,i=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(Ks(e,i.x,o.x,s.x,a.x),Ks(e,i.y,o.y,s.y,a.y),Ks(e,i.z,o.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Va.prototype.isCubicBezierCurve3=!0;class ja extends Xn{constructor(e=new Qe,t=new Qe){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Qe){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new Qe;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}ja.prototype.isLineCurve=!0;class Vl extends Xn{constructor(e=new T,t=new T){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new T){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ea extends Xn{constructor(e=new Qe,t=new Qe,n=new Qe){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Qe){const n=t,i=this.v0,o=this.v1,s=this.v2;return n.set(os(e,i.x,o.x,s.x),os(e,i.y,o.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}ea.prototype.isQuadraticBezierCurve=!0;class av extends Xn{constructor(e=new T,t=new T,n=new T){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new T){const n=t,i=this.v0,o=this.v1,s=this.v2;return n.set(os(e,i.x,o.x,s.x),os(e,i.y,o.y,s.y),os(e,i.z,o.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}av.prototype.isQuadraticBezierCurve3=!0;class Jf extends Xn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Qe){const n=t,i=this.points,o=(i.length-1)*e,s=Math.floor(o),a=o-s,l=i[s===0?s:s-1],u=i[s],c=i[s>i.length-2?i.length-1:s+1],d=i[s>i.length-3?i.length-1:s+2];return n.set(yd(a,l.x,u.x,c.x,d.x),yd(a,l.y,u.y,c.y,d.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Qe().fromArray(i))}return this}}Jf.prototype.isSplineCurve=!0;var lv=Object.freeze({__proto__:null,ArcCurve:kr,CatmullRomCurve3:Oh,CubicBezierCurve:Qs,CubicBezierCurve3:Va,EllipseCurve:kn,LineCurve:ja,LineCurve3:Vl,QuadraticBezierCurve:ea,QuadraticBezierCurve3:av,SplineCurve:Jf});const aS=function(r,e,t=2){const n=e&&e.length,i=n?e[0]*t:r.length;let o=ey(r,0,i,t,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u,c,d,f,m;if(n&&(o=function(g,_,y,w){const M=[];let I,F,C,U,N;for(I=0,F=_.length;I<F;I++)C=_[I]*w,U=I<F-1?_[I+1]*w:g.length,N=ey(g,C,U,w,!1),N===N.next&&(N.steiner=!0),M.push(mS(N));for(M.sort(dS),I=0;I<M.length;I++)pS(M[I],y),y=Wa(y,y.next);return y}(r,e,o,t)),r.length>80*t){a=u=r[0],l=c=r[1];for(let g=t;g<i;g+=t)d=r[g],f=r[g+1],d<a&&(a=d),f<l&&(l=f),d>u&&(u=d),f>c&&(c=f);m=Math.max(u-a,c-l),m=m!==0?1/m:0}return xd(o,s,t,a,l,m),s};function ey(r,e,t,n,i){let o,s;if(i===function(a,l,u,c){let d=0;for(let f=l,m=u-c;f<u;f+=c)d+=(a[m]-a[f])*(a[f+1]+a[m+1]),m=f;return d}(r,e,t,n)>0)for(o=e;o<t;o+=n)s=iy(o,r[o],r[o+1],s);else for(o=t-n;o>=e;o-=n)s=iy(o,r[o],r[o+1],s);return s&&$f(s,s.next)&&(wd(s),s=s.next),s}function Wa(r,e){if(!r)return r;e||(e=r);let t,n=r;do if(t=!1,n.steiner||!$f(n,n.next)&&ti(n.prev,n,n.next)!==0)n=n.next;else{if(wd(n),n=e=n.prev,n===n.next)break;t=!0}while(t||n!==e);return e}function xd(r,e,t,n,i,o,s){if(!r)return;!s&&o&&function(c,d,f,m){let g=c;do g.z===null&&(g.z=uv(g.x,g.y,d,f,m)),g.prevZ=g.prev,g.nextZ=g.next,g=g.next;while(g!==c);g.prevZ.nextZ=null,g.prevZ=null,function(_){let y,w,M,I,F,C,U,N,G=1;do{for(w=_,_=null,F=null,C=0;w;){for(C++,M=w,U=0,y=0;y<G&&(U++,M=M.nextZ,M);y++);for(N=G;U>0||N>0&&M;)U!==0&&(N===0||!M||w.z<=M.z)?(I=w,w=w.nextZ,U--):(I=M,M=M.nextZ,N--),F?F.nextZ=I:_=I,I.prevZ=F,F=I;w=M}F.nextZ=null,G*=2}while(C>1)}(g)}(r,n,i,o);let a,l,u=r;for(;r.prev!==r.next;)if(a=r.prev,l=r.next,o?uS(r,n,i,o):lS(r))e.push(a.i/t),e.push(r.i/t),e.push(l.i/t),wd(r),r=l.next,u=l.next;else if((r=l)===u){s?s===1?xd(r=hS(Wa(r),e,t),e,t,n,i,o,2):s===2&&cS(r,e,t,n,i,o):xd(Wa(r),e,t,n,i,o,1);break}}function lS(r){const e=r.prev,t=r,n=r.next;if(ti(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Dh(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&ti(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function uS(r,e,t,n){const i=r.prev,o=r,s=r.next;if(ti(i,o,s)>=0)return!1;const a=i.x<o.x?i.x<s.x?i.x:s.x:o.x<s.x?o.x:s.x,l=i.y<o.y?i.y<s.y?i.y:s.y:o.y<s.y?o.y:s.y,u=i.x>o.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,c=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,d=uv(a,l,e,t,n),f=uv(u,c,e,t,n);let m=r.prevZ,g=r.nextZ;for(;m&&m.z>=d&&g&&g.z<=f;){if(m!==r.prev&&m!==r.next&&Dh(i.x,i.y,o.x,o.y,s.x,s.y,m.x,m.y)&&ti(m.prev,m,m.next)>=0||(m=m.prevZ,g!==r.prev&&g!==r.next&&Dh(i.x,i.y,o.x,o.y,s.x,s.y,g.x,g.y)&&ti(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;m&&m.z>=d;){if(m!==r.prev&&m!==r.next&&Dh(i.x,i.y,o.x,o.y,s.x,s.y,m.x,m.y)&&ti(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;g&&g.z<=f;){if(g!==r.prev&&g!==r.next&&Dh(i.x,i.y,o.x,o.y,s.x,s.y,g.x,g.y)&&ti(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function hS(r,e,t){let n=r;do{const i=n.prev,o=n.next.next;!$f(i,o)&&ty(i,n,n.next,o)&&bd(i,o)&&bd(o,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(o.i/t),wd(n),wd(n.next),n=r=o),n=n.next}while(n!==r);return Wa(n)}function cS(r,e,t,n,i,o){let s=r;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&gS(s,a)){let l=ny(s,a);return s=Wa(s,s.next),l=Wa(l,l.next),xd(s,e,t,n,i,o),void xd(l,e,t,n,i,o)}a=a.next}s=s.next}while(s!==r)}function dS(r,e){return r.x-e.x}function pS(r,e){if(e=function(t,n){let i=n;const o=t.x,s=t.y;let a,l=-1/0;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){const g=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(g<=o&&g>l){if(l=g,g===o){if(s===i.y)return i;if(s===i.next.y)return i.next}a=i.x<i.next.x?i:i.next}}i=i.next}while(i!==n);if(!a)return null;if(o===l)return a;const u=a,c=a.x,d=a.y;let f,m=1/0;i=a;do o>=i.x&&i.x>=c&&o!==i.x&&Dh(s<d?o:l,s,c,d,s<d?l:o,s,i.x,i.y)&&(f=Math.abs(s-i.y)/(o-i.x),bd(i,t)&&(f<m||f===m&&(i.x>a.x||i.x===a.x&&fS(a,i)))&&(a=i,m=f)),i=i.next;while(i!==u);return a}(r,e)){const t=ny(e,r);Wa(e,e.next),Wa(t,t.next)}}function fS(r,e){return ti(r.prev,r,e.prev)<0&&ti(e.next,r,r.next)<0}function uv(r,e,t,n,i){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=32767*(r-t)*i)|r<<8))|r<<4))|r<<2))|r<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function mS(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function Dh(r,e,t,n,i,o,s,a){return(i-s)*(e-a)-(r-s)*(o-a)>=0&&(r-s)*(n-a)-(t-s)*(e-a)>=0&&(t-s)*(o-a)-(i-s)*(n-a)>=0}function gS(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!function(t,n){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==n.i&&i.next.i!==n.i&&ty(i,i.next,t,n))return!0;i=i.next}while(i!==t);return!1}(r,e)&&(bd(r,e)&&bd(e,r)&&function(t,n){let i=t,o=!1;const s=(t.x+n.x)/2,a=(t.y+n.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&s<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(o=!o),i=i.next;while(i!==t);return o}(r,e)&&(ti(r.prev,r,e.prev)||ti(r,e.prev,e))||$f(r,e)&&ti(r.prev,r,r.next)>0&&ti(e.prev,e,e.next)>0)}function ti(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function $f(r,e){return r.x===e.x&&r.y===e.y}function ty(r,e,t,n){const i=Qf(ti(r,e,t)),o=Qf(ti(r,e,n)),s=Qf(ti(t,n,r)),a=Qf(ti(t,n,e));return i!==o&&s!==a||!(i!==0||!Kf(r,t,e))||!(o!==0||!Kf(r,n,e))||!(s!==0||!Kf(t,r,n))||!(a!==0||!Kf(t,e,n))}function Kf(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function Qf(r){return r>0?1:r<0?-1:0}function bd(r,e){return ti(r.prev,r,r.next)<0?ti(r,e,r.next)>=0&&ti(r,r.prev,e)>=0:ti(r,e,r.prev)<0||ti(r,r.next,e)<0}function ny(r,e){const t=new hv(r.i,r.x,r.y),n=new hv(e.i,e.x,e.y),i=r.next,o=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}function iy(r,e,t,n){const i=new hv(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function wd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function hv(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ss{static area(e){const t=e.length;let n=0;for(let i=t-1,o=0;o<t;i=o++)n+=e[i].x*e[o].y-e[o].x*e[i].y;return .5*n}static isClockWise(e){return ss.area(e)<0}static triangulateShape(e,t){const n=[],i=[],o=[];ry(e),oy(n,e);let s=e.length;t.forEach(ry);for(let l=0;l<t.length;l++)i.push(s),s+=t[l].length,oy(n,t[l]);const a=aS(n,i);for(let l=0;l<a.length;l+=3)o.push(a.slice(l,l+3));return o}}function ry(r){const e=r.length;e>2&&r[e-1].equals(r[0])&&r.pop()}function oy(r,e){for(let t=0;t<e.length;t++)r.push(e[t].x),r.push(e[t].y)}class Ao extends Mt{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],o=[];for(let a=0,l=e.length;a<l;a++)s(e[a]);function s(a){const l=[],u=t.curveSegments!==void 0?t.curveSegments:12,c=t.steps!==void 0?t.steps:1;let d=t.depth!==void 0?t.depth:100,f=t.bevelEnabled===void 0||t.bevelEnabled,m=t.bevelThickness!==void 0?t.bevelThickness:6,g=t.bevelSize!==void 0?t.bevelSize:m-2,_=t.bevelOffset!==void 0?t.bevelOffset:0,y=t.bevelSegments!==void 0?t.bevelSegments:3;const w=t.extrudePath,M=t.UVGenerator!==void 0?t.UVGenerator:vS;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=t.amount);let I,F,C,U,N,G=!1;w&&(I=w.getSpacedPoints(c),G=!0,f=!1,F=w.computeFrenetFrames(c,!1),C=new T,U=new T,N=new T),f||(y=0,m=0,g=0,_=0);const he=a.extractPoints(u);let ne=he.shape;const Z=he.holes;if(!ss.isClockWise(ne)){ne=ne.reverse();for(let ve=0,Y=Z.length;ve<Y;ve++){const pe=Z[ve];ss.isClockWise(pe)&&(Z[ve]=pe.reverse())}}const Q=ss.triangulateShape(ne,Z),$=ne;for(let ve=0,Y=Z.length;ve<Y;ve++){const pe=Z[ve];ne=ne.concat(pe)}function se(ve,Y,pe){return Y||console.error("THREE.ExtrudeGeometry: vec does not exist"),Y.clone().multiplyScalar(pe).add(ve)}const me=ne.length,ge=Q.length;function de(ve,Y,pe){let ye,xe,De;const ht=ve.x-Y.x,xt=ve.y-Y.y,_t=pe.x-ve.x,Gt=pe.y-ve.y,Wt=ht*ht+xt*xt,si=ht*Gt-xt*_t;if(Math.abs(si)>Number.EPSILON){const Cn=Math.sqrt(Wt),Bo=Math.sqrt(_t*_t+Gt*Gt),vp=Y.x-xt/Cn,_p=Y.y+ht/Cn,yp=((pe.x-Gt/Bo-vp)*Gt-(pe.y+_t/Bo-_p)*_t)/(ht*Gt-xt*_t);ye=vp+ht*yp-ve.x,xe=_p+xt*yp-ve.y;const dr=ye*ye+xe*xe;if(dr<=2)return new Qe(ye,xe);De=Math.sqrt(dr/2)}else{let Cn=!1;ht>Number.EPSILON?_t>Number.EPSILON&&(Cn=!0):ht<-Number.EPSILON?_t<-Number.EPSILON&&(Cn=!0):Math.sign(xt)===Math.sign(Gt)&&(Cn=!0),Cn?(ye=-xt,xe=ht,De=Math.sqrt(Wt)):(ye=ht,xe=xt,De=Math.sqrt(Wt/2))}return new Qe(ye/De,xe/De)}const fe=[];for(let ve=0,Y=$.length,pe=Y-1,ye=ve+1;ve<Y;ve++,pe++,ye++)pe===Y&&(pe=0),ye===Y&&(ye=0),fe[ve]=de($[ve],$[pe],$[ye]);const Re=[];let ke,Be=fe.concat();for(let ve=0,Y=Z.length;ve<Y;ve++){const pe=Z[ve];ke=[];for(let ye=0,xe=pe.length,De=xe-1,ht=ye+1;ye<xe;ye++,De++,ht++)De===xe&&(De=0),ht===xe&&(ht=0),ke[ye]=de(pe[ye],pe[De],pe[ht]);Re.push(ke),Be=Be.concat(ke)}for(let ve=0;ve<y;ve++){const Y=ve/y,pe=m*Math.cos(Y*Math.PI/2),ye=g*Math.sin(Y*Math.PI/2)+_;for(let xe=0,De=$.length;xe<De;xe++){const ht=se($[xe],fe[xe],ye);Ae(ht.x,ht.y,-pe)}for(let xe=0,De=Z.length;xe<De;xe++){const ht=Z[xe];ke=Re[xe];for(let xt=0,_t=ht.length;xt<_t;xt++){const Gt=se(ht[xt],ke[xt],ye);Ae(Gt.x,Gt.y,-pe)}}}const J=g+_;for(let ve=0;ve<me;ve++){const Y=f?se(ne[ve],Be[ve],J):ne[ve];G?(U.copy(F.normals[0]).multiplyScalar(Y.x),C.copy(F.binormals[0]).multiplyScalar(Y.y),N.copy(I[0]).add(U).add(C),Ae(N.x,N.y,N.z)):Ae(Y.x,Y.y,0)}for(let ve=1;ve<=c;ve++)for(let Y=0;Y<me;Y++){const pe=f?se(ne[Y],Be[Y],J):ne[Y];G?(U.copy(F.normals[ve]).multiplyScalar(pe.x),C.copy(F.binormals[ve]).multiplyScalar(pe.y),N.copy(I[ve]).add(U).add(C),Ae(N.x,N.y,N.z)):Ae(pe.x,pe.y,d/c*ve)}for(let ve=y-1;ve>=0;ve--){const Y=ve/y,pe=m*Math.cos(Y*Math.PI/2),ye=g*Math.sin(Y*Math.PI/2)+_;for(let xe=0,De=$.length;xe<De;xe++){const ht=se($[xe],fe[xe],ye);Ae(ht.x,ht.y,d+pe)}for(let xe=0,De=Z.length;xe<De;xe++){const ht=Z[xe];ke=Re[xe];for(let xt=0,_t=ht.length;xt<_t;xt++){const Gt=se(ht[xt],ke[xt],ye);G?Ae(Gt.x,Gt.y+I[c-1].y,I[c-1].x+pe):Ae(Gt.x,Gt.y,d+pe)}}}function te(ve,Y){let pe=ve.length;for(;--pe>=0;){const ye=pe;let xe=pe-1;xe<0&&(xe=ve.length-1);for(let De=0,ht=c+2*y;De<ht;De++){const xt=me*De,_t=me*(De+1);Te(Y+ye+xt,Y+xe+xt,Y+xe+_t,Y+ye+_t)}}}function Ae(ve,Y,pe){l.push(ve),l.push(Y),l.push(pe)}function Ne(ve,Y,pe){Ge(ve),Ge(Y),Ge(pe);const ye=i.length/3,xe=M.generateTopUV(n,i,ye-3,ye-2,ye-1);Ye(xe[0]),Ye(xe[1]),Ye(xe[2])}function Te(ve,Y,pe,ye){Ge(ve),Ge(Y),Ge(ye),Ge(Y),Ge(pe),Ge(ye);const xe=i.length/3,De=M.generateSideWallUV(n,i,xe-6,xe-3,xe-2,xe-1);Ye(De[0]),Ye(De[1]),Ye(De[3]),Ye(De[1]),Ye(De[2]),Ye(De[3])}function Ge(ve){i.push(l[3*ve+0]),i.push(l[3*ve+1]),i.push(l[3*ve+2])}function Ye(ve){o.push(ve.x),o.push(ve.y)}(function(){const ve=i.length/3;if(f){let Y=0,pe=me*Y;for(let ye=0;ye<ge;ye++){const xe=Q[ye];Ne(xe[2]+pe,xe[1]+pe,xe[0]+pe)}Y=c+2*y,pe=me*Y;for(let ye=0;ye<ge;ye++){const xe=Q[ye];Ne(xe[0]+pe,xe[1]+pe,xe[2]+pe)}}else{for(let Y=0;Y<ge;Y++){const pe=Q[Y];Ne(pe[2],pe[1],pe[0])}for(let Y=0;Y<ge;Y++){const pe=Q[Y];Ne(pe[0]+me*c,pe[1]+me*c,pe[2]+me*c)}}n.addGroup(ve,i.length/3-ve,0)})(),function(){const ve=i.length/3;let Y=0;te($,Y),Y+=$.length;for(let pe=0,ye=Z.length;pe<ye;pe++){const xe=Z[pe];te(xe,Y),Y+=xe.length}n.addGroup(ve,i.length/3-ve,1)}()}this.setAttribute("position",new st(i,3)),this.setAttribute("uv",new st(o,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(t,n,i){if(i.shapes=[],Array.isArray(t))for(let o=0,s=t.length;o<s;o++){const a=t[o];i.shapes.push(a.uuid)}else i.shapes.push(t.uuid);return n.extrudePath!==void 0&&(i.options.extrudePath=n.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let o=0,s=e.shapes.length;o<s;o++){const a=t[e.shapes[o]];n.push(a)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new lv[i.type]().fromJSON(i)),new Ao(n,e.options)}}const vS={generateTopUV:function(r,e,t,n,i){const o=e[3*t],s=e[3*t+1],a=e[3*n],l=e[3*n+1],u=e[3*i],c=e[3*i+1];return[new Qe(o,s),new Qe(a,l),new Qe(u,c)]},generateSideWallUV:function(r,e,t,n,i,o){const s=e[3*t],a=e[3*t+1],l=e[3*t+2],u=e[3*n],c=e[3*n+1],d=e[3*n+2],f=e[3*i],m=e[3*i+1],g=e[3*i+2],_=e[3*o],y=e[3*o+1],w=e[3*o+2];return Math.abs(a-c)<Math.abs(s-u)?[new Qe(s,1-l),new Qe(u,1-d),new Qe(f,1-g),new Qe(_,1-w)]:[new Qe(a,1-l),new Qe(c,1-d),new Qe(m,1-g),new Qe(y,1-w)]}};class Nh extends St{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Nh(e.radius,e.detail)}}class Fh extends Mt{constructor(e,t=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=Ti(i,0,2*Math.PI);const o=[],s=[],a=[],l=1/t,u=new T,c=new Qe;for(let d=0;d<=t;d++){const f=n+d*l*i,m=Math.sin(f),g=Math.cos(f);for(let _=0;_<=e.length-1;_++)u.x=e[_].x*m,u.y=e[_].y,u.z=e[_].x*g,s.push(u.x,u.y,u.z),c.x=d/t,c.y=_/(e.length-1),a.push(c.x,c.y)}for(let d=0;d<t;d++)for(let f=0;f<e.length-1;f++){const m=f+d*e.length,g=m,_=m+e.length,y=m+e.length+1,w=m+1;o.push(g,_,w),o.push(_,y,w)}if(this.setIndex(o),this.setAttribute("position",new st(s,3)),this.setAttribute("uv",new st(a,2)),this.computeVertexNormals(),i===2*Math.PI){const d=this.attributes.normal.array,f=new T,m=new T,g=new T,_=t*e.length*3;for(let y=0,w=0;y<e.length;y++,w+=3)f.x=d[w+0],f.y=d[w+1],f.z=d[w+2],m.x=d[_+w+0],m.y=d[_+w+1],m.z=d[_+w+2],g.addVectors(f,m).normalize(),d[w+0]=d[_+w+0]=g.x,d[w+1]=d[_+w+1]=g.y,d[w+2]=d[_+w+2]=g.z}}static fromJSON(e){return new Fh(e.points,e.segments,e.phiStart,e.phiLength)}}class jl extends St{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new jl(e.radius,e.detail)}}class Td extends Mt{constructor(e,t,n){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};const i=[],o=[],s=[],a=[],l=1e-5,u=new T,c=new T,d=new T,f=new T,m=new T;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const g=t+1;for(let _=0;_<=n;_++){const y=_/n;for(let w=0;w<=t;w++){const M=w/t;e(M,y,c),o.push(c.x,c.y,c.z),M-l>=0?(e(M-l,y,d),f.subVectors(c,d)):(e(M+l,y,d),f.subVectors(d,c)),y-l>=0?(e(M,y-l,d),m.subVectors(c,d)):(e(M,y+l,d),m.subVectors(d,c)),u.crossVectors(f,m).normalize(),s.push(u.x,u.y,u.z),a.push(M,y)}}for(let _=0;_<n;_++)for(let y=0;y<t;y++){const w=_*g+y,M=_*g+y+1,I=(_+1)*g+y+1,F=(_+1)*g+y;i.push(w,M,F),i.push(M,I,F)}this.setIndex(i),this.setAttribute("position",new st(o,3)),this.setAttribute("normal",new st(s,3)),this.setAttribute("uv",new st(a,2))}}class Bh extends Mt{constructor(e=.5,t=1,n=8,i=1,o=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:o,thetaLength:s},n=Math.max(3,n);const a=[],l=[],u=[],c=[];let d=e;const f=(t-e)/(i=Math.max(1,i)),m=new T,g=new Qe;for(let _=0;_<=i;_++){for(let y=0;y<=n;y++){const w=o+y/n*s;m.x=d*Math.cos(w),m.y=d*Math.sin(w),l.push(m.x,m.y,m.z),u.push(0,0,1),g.x=(m.x/t+1)/2,g.y=(m.y/t+1)/2,c.push(g.x,g.y)}d+=f}for(let _=0;_<i;_++){const y=_*(n+1);for(let w=0;w<n;w++){const M=w+y,I=M,F=M+n+1,C=M+n+2,U=M+1;a.push(I,F,U),a.push(F,C,U)}}this.setIndex(a),this.setAttribute("position",new st(l,3)),this.setAttribute("normal",new st(u,3)),this.setAttribute("uv",new st(c,2))}static fromJSON(e){return new Bh(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Wl extends Mt{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],o=[],s=[];let a=0,l=0;if(Array.isArray(e)===!1)u(e);else for(let c=0;c<e.length;c++)u(e[c]),this.addGroup(a,l,c),a+=l,l=0;function u(c){const d=i.length/3,f=c.extractPoints(t);let m=f.shape;const g=f.holes;ss.isClockWise(m)===!1&&(m=m.reverse());for(let y=0,w=g.length;y<w;y++){const M=g[y];ss.isClockWise(M)===!0&&(g[y]=M.reverse())}const _=ss.triangulateShape(m,g);for(let y=0,w=g.length;y<w;y++){const M=g[y];m=m.concat(M)}for(let y=0,w=m.length;y<w;y++){const M=m[y];i.push(M.x,M.y,0),o.push(0,0,1),s.push(M.x,M.y)}for(let y=0,w=_.length;y<w;y++){const M=_[y],I=M[0]+d,F=M[1]+d,C=M[2]+d;n.push(I,F,C),l+=3}}this.setIndex(n),this.setAttribute("position",new st(i,3)),this.setAttribute("normal",new st(o,3)),this.setAttribute("uv",new st(s,2))}toJSON(){const e=super.toJSON();return function(t,n){if(n.shapes=[],Array.isArray(t))for(let i=0,o=t.length;i<o;i++){const s=t[i];n.shapes.push(s.uuid)}else n.shapes.push(t.uuid);return n}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let i=0,o=e.shapes.length;i<o;i++){const s=t[e.shapes[i]];n.push(s)}return new Wl(n,e.curveSegments)}}class Xl extends Mt{constructor(e=1,t=8,n=6,i=0,o=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:o,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(s+a,Math.PI);let u=0;const c=[],d=new T,f=new T,m=[],g=[],_=[],y=[];for(let w=0;w<=n;w++){const M=[],I=w/n;let F=0;w==0&&s==0?F=.5/t:w==n&&l==Math.PI&&(F=-.5/t);for(let C=0;C<=t;C++){const U=C/t;d.x=-e*Math.cos(i+U*o)*Math.sin(s+I*a),d.y=e*Math.cos(s+I*a),d.z=e*Math.sin(i+U*o)*Math.sin(s+I*a),g.push(d.x,d.y,d.z),f.copy(d).normalize(),_.push(f.x,f.y,f.z),y.push(U+F,1-I),M.push(u++)}c.push(M)}for(let w=0;w<n;w++)for(let M=0;M<t;M++){const I=c[w][M+1],F=c[w][M],C=c[w+1][M],U=c[w+1][M+1];(w!==0||s>0)&&m.push(I,F,U),(w!==n-1||l<Math.PI)&&m.push(F,C,U)}this.setIndex(m),this.setAttribute("position",new st(g,3)),this.setAttribute("normal",new st(_,3)),this.setAttribute("uv",new st(y,2))}static fromJSON(e){return new Xl(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Uh extends St{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Uh(e.radius,e.detail)}}class em extends Ao{constructor(e,t={}){const n=t.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Mt;const i=n.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(i,t),this.type="TextGeometry"}}class kh extends Mt{constructor(e=1,t=.4,n=8,i=6,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:o},n=Math.floor(n),i=Math.floor(i);const s=[],a=[],l=[],u=[],c=new T,d=new T,f=new T;for(let m=0;m<=n;m++)for(let g=0;g<=i;g++){const _=g/i*o,y=m/n*Math.PI*2;d.x=(e+t*Math.cos(y))*Math.cos(_),d.y=(e+t*Math.cos(y))*Math.sin(_),d.z=t*Math.sin(y),a.push(d.x,d.y,d.z),c.x=e*Math.cos(_),c.y=e*Math.sin(_),f.subVectors(d,c).normalize(),l.push(f.x,f.y,f.z),u.push(g/i),u.push(m/n)}for(let m=1;m<=n;m++)for(let g=1;g<=i;g++){const _=(i+1)*m+g-1,y=(i+1)*(m-1)+g-1,w=(i+1)*(m-1)+g,M=(i+1)*m+g;s.push(_,y,M),s.push(y,w,M)}this.setIndex(s),this.setAttribute("position",new st(a,3)),this.setAttribute("normal",new st(l,3)),this.setAttribute("uv",new st(u,2))}static fromJSON(e){return new kh(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Gh extends Mt{constructor(e=1,t=.4,n=64,i=8,o=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:o,q:s},n=Math.floor(n),i=Math.floor(i);const a=[],l=[],u=[],c=[],d=new T,f=new T,m=new T,g=new T,_=new T,y=new T,w=new T;for(let I=0;I<=n;++I){const F=I/n*o*Math.PI*2;M(F,o,s,e,m),M(F+.01,o,s,e,g),y.subVectors(g,m),w.addVectors(g,m),_.crossVectors(y,w),w.crossVectors(_,y),_.normalize(),w.normalize();for(let C=0;C<=i;++C){const U=C/i*Math.PI*2,N=-t*Math.cos(U),G=t*Math.sin(U);d.x=m.x+(N*w.x+G*_.x),d.y=m.y+(N*w.y+G*_.y),d.z=m.z+(N*w.z+G*_.z),l.push(d.x,d.y,d.z),f.subVectors(d,m).normalize(),u.push(f.x,f.y,f.z),c.push(I/n),c.push(C/i)}}for(let I=1;I<=n;I++)for(let F=1;F<=i;F++){const C=(i+1)*(I-1)+(F-1),U=(i+1)*I+(F-1),N=(i+1)*I+F,G=(i+1)*(I-1)+F;a.push(C,U,G),a.push(U,N,G)}function M(I,F,C,U,N){const G=Math.cos(I),he=Math.sin(I),ne=C/F*I,Z=Math.cos(ne);N.x=U*(2+Z)*.5*G,N.y=U*(2+Z)*he*.5,N.z=U*Math.sin(ne)*.5}this.setIndex(a),this.setAttribute("position",new st(l,3)),this.setAttribute("normal",new st(u,3)),this.setAttribute("uv",new st(c,2))}static fromJSON(e){return new Gh(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Hh extends Mt{constructor(e,t=64,n=1,i=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:o};const s=e.computeFrenetFrames(t,o);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new T,l=new T,u=new Qe;let c=new T;const d=[],f=[],m=[],g=[];function _(y){c=e.getPointAt(y/t,c);const w=s.normals[y],M=s.binormals[y];for(let I=0;I<=i;I++){const F=I/i*Math.PI*2,C=Math.sin(F),U=-Math.cos(F);l.x=U*w.x+C*M.x,l.y=U*w.y+C*M.y,l.z=U*w.z+C*M.z,l.normalize(),f.push(l.x,l.y,l.z),a.x=c.x+n*l.x,a.y=c.y+n*l.y,a.z=c.z+n*l.z,d.push(a.x,a.y,a.z)}}(function(){for(let y=0;y<t;y++)_(y);_(o===!1?t:0),function(){for(let y=0;y<=t;y++)for(let w=0;w<=i;w++)u.x=y/t,u.y=w/i,m.push(u.x,u.y)}(),function(){for(let y=1;y<=t;y++)for(let w=1;w<=i;w++){const M=(i+1)*(y-1)+(w-1),I=(i+1)*y+(w-1),F=(i+1)*y+w,C=(i+1)*(y-1)+w;g.push(M,I,C),g.push(I,F,C)}}()})(),this.setIndex(g),this.setAttribute("position",new st(d,3)),this.setAttribute("normal",new st(f,3)),this.setAttribute("uv",new st(m,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Hh(new lv[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class cv extends Mt{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const t=[],n=[0,0],i={},o=new T;if(e.index!==null){const s=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let u=0,c=l.length;u<c;++u){const d=l[u],f=d.start;for(let m=f,g=f+d.count;m<g;m+=3)for(let _=0;_<3;_++){const y=a.getX(m+_),w=a.getX(m+(_+1)%3);n[0]=Math.min(y,w),n[1]=Math.max(y,w);const M=n[0]+","+n[1];i[M]===void 0&&(i[M]={index1:n[0],index2:n[1]})}}for(const u in i){const c=i[u];o.fromBufferAttribute(s,c.index1),t.push(o.x,o.y,o.z),o.fromBufferAttribute(s,c.index2),t.push(o.x,o.y,o.z)}}else{const s=e.attributes.position;for(let a=0,l=s.count/3;a<l;a++)for(let u=0;u<3;u++){const c=3*a+u;o.fromBufferAttribute(s,c),t.push(o.x,o.y,o.z);const d=3*a+(u+1)%3;o.fromBufferAttribute(s,d),t.push(o.x,o.y,o.z)}}this.setAttribute("position",new st(t,3))}}var sy=Object.freeze({__proto__:null,BoxGeometry:Qr,BoxBufferGeometry:Qr,CircleGeometry:nt,CircleBufferGeometry:nt,ConeGeometry:mt,ConeBufferGeometry:mt,CylinderGeometry:Et,CylinderBufferGeometry:Et,DodecahedronGeometry:It,DodecahedronBufferGeometry:It,EdgesGeometry:Ei,ExtrudeGeometry:Ao,ExtrudeBufferGeometry:Ao,IcosahedronGeometry:Nh,IcosahedronBufferGeometry:Nh,LatheGeometry:Fh,LatheBufferGeometry:Fh,OctahedronGeometry:jl,OctahedronBufferGeometry:jl,ParametricGeometry:Td,ParametricBufferGeometry:Td,PlaneGeometry:Ii,PlaneBufferGeometry:Ii,PolyhedronGeometry:St,PolyhedronBufferGeometry:St,RingGeometry:Bh,RingBufferGeometry:Bh,ShapeGeometry:Wl,ShapeBufferGeometry:Wl,SphereGeometry:Xl,SphereBufferGeometry:Xl,TetrahedronGeometry:Uh,TetrahedronBufferGeometry:Uh,TextGeometry:em,TextBufferGeometry:em,TorusGeometry:kh,TorusBufferGeometry:kh,TorusKnotGeometry:Gh,TorusKnotBufferGeometry:Gh,TubeGeometry:Hh,TubeBufferGeometry:Hh,WireframeGeometry:cv});class dv extends vi{constructor(e){super(),this.type="ShadowMaterial",this.color=new gt(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}dv.prototype.isShadowMaterial=!0;class zh extends ki{constructor(e){super(e),this.type="RawShaderMaterial"}}zh.prototype.isRawShaderMaterial=!0;class tm extends vi{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new gt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}tm.prototype.isMeshStandardMaterial=!0;class pv extends tm{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Qe(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=Ti(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new gt(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new gt).copy(e.sheen):this.sheen=null,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this}}pv.prototype.isMeshPhysicalMaterial=!0;class nm extends vi{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new gt(16777215),this.specular=new gt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=rl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}nm.prototype.isMeshPhongMaterial=!0;class fv extends vi{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new gt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}fv.prototype.isMeshToonMaterial=!0;class mv extends vi{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}mv.prototype.isMeshNormalMaterial=!0;class im extends vi{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new gt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=rl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}im.prototype.isMeshLambertMaterial=!0;class gv extends vi{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new gt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}gv.prototype.isMeshMatcapMaterial=!0;class vv extends yi{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}vv.prototype.isLineDashedMaterial=!0;var _S=Object.freeze({__proto__:null,ShadowMaterial:dv,SpriteMaterial:Bl,RawShaderMaterial:zh,ShaderMaterial:ki,PointsMaterial:V,MeshPhysicalMaterial:pv,MeshStandardMaterial:tm,MeshPhongMaterial:nm,MeshToonMaterial:fv,MeshNormalMaterial:mv,MeshLambertMaterial:im,MeshDepthMaterial:on,MeshDistanceMaterial:bh,MeshBasicMaterial:Kn,MeshMatcapMaterial:gv,LineDashedMaterial:vv,LineBasicMaterial:yi,Material:vi});const Gn={arraySlice:function(r,e,t){return Gn.isTypedArray(r)?new r.constructor(r.subarray(e,t!==void 0?t:r.length)):r.slice(e,t)},convertArray:function(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)},isTypedArray:function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},getKeyframeOrder:function(r){const e=r.length,t=new Array(e);for(let n=0;n!==e;++n)t[n]=n;return t.sort(function(n,i){return r[n]-r[i]}),t},sortedArray:function(r,e,t){const n=r.length,i=new r.constructor(n);for(let o=0,s=0;s!==n;++o){const a=t[o]*e;for(let l=0;l!==e;++l)i[s++]=r[a+l]}return i},flattenJSON:function(r,e,t,n){let i=1,o=r[0];for(;o!==void 0&&o[n]===void 0;)o=r[i++];if(o===void 0)return;let s=o[n];if(s!==void 0)if(Array.isArray(s))do s=o[n],s!==void 0&&(e.push(o.time),t.push.apply(t,s)),o=r[i++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[n],s!==void 0&&(e.push(o.time),s.toArray(t,t.length)),o=r[i++];while(o!==void 0);else do s=o[n],s!==void 0&&(e.push(o.time),t.push(s)),o=r[i++];while(o!==void 0)},subclip:function(r,e,t,n,i=30){const o=r.clone();o.name=e;const s=[];for(let l=0;l<o.tracks.length;++l){const u=o.tracks[l],c=u.getValueSize(),d=[],f=[];for(let m=0;m<u.times.length;++m){const g=u.times[m]*i;if(!(g<t||g>=n)){d.push(u.times[m]);for(let _=0;_<c;++_)f.push(u.values[m*c+_])}}d.length!==0&&(u.times=Gn.convertArray(d,u.times.constructor),u.values=Gn.convertArray(f,u.values.constructor),s.push(u))}o.tracks=s;let a=1/0;for(let l=0;l<o.tracks.length;++l)a>o.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l<o.tracks.length;++l)o.tracks[l].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(r,e=0,t=r,n=30){n<=0&&(n=30);const i=t.tracks.length,o=e/n;for(let s=0;s<i;++s){const a=t.tracks[s],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const u=r.tracks.find(function(w){return w.name===a.name&&w.ValueTypeName===l});if(u===void 0)continue;let c=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=d/3);let f=0;const m=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=m/3);const g=a.times.length-1;let _;if(o<=a.times[0]){const w=c,M=d-c;_=Gn.arraySlice(a.values,w,M)}else if(o>=a.times[g]){const w=g*d+c,M=w+d-c;_=Gn.arraySlice(a.values,w,M)}else{const w=a.createInterpolant(),M=c,I=d-c;w.evaluate(o),_=Gn.arraySlice(w.resultBuffer,M,I)}l==="quaternion"&&new gi().fromArray(_).normalize().conjugate().toArray(_);const y=u.times.length;for(let w=0;w<y;++w){const M=w*m+f;if(l==="quaternion")gi.multiplyQuaternionsFlat(u.values,M,_,0,u.values,M);else{const I=m-2*f;for(let F=0;F<I;++F)u.values[M+F]-=_[F]}}}return r.blendMode=we,r}};class ta{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],o=t[n-1];e:{t:{let s;n:{i:if(!(e<i)){for(let a=n+2;;){if(i===void 0){if(e<o)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,o)}if(n===a)break;if(o=i,i=t[++n],e<i)break t}s=t.length;break n}if(e>=o)break e;{const a=t[1];e<a&&(n=2,o=a);for(let l=n-2;;){if(o===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===l)break;if(i=o,o=t[--n-1],e>=o)break t}s=n,n=0}}for(;n<s;){const a=n+s>>>1;e<t[a]?s=a:n=a+1}if(i=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(i===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,o,e)}this._cachedIndex=n,this.intervalChanged_(n,o,i)}return this.interpolate_(n,o,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i;for(let s=0;s!==i;++s)t[s]=n[o+s];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ta.prototype.beforeStart_=ta.prototype.copySampleValue_,ta.prototype.afterEnd_=ta.prototype.copySampleValue_;class ay extends ta{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:bi,endingEnd:bi}}intervalChanged_(e,t,n){const i=this.parameterPositions;let o=e-2,s=e+1,a=i[o],l=i[s];if(a===void 0)switch(this.getSettings_().endingStart){case jo:o=e,a=2*t-n;break;case fl:o=i.length-2,a=t+i[o]-i[o+1];break;default:o=e,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case jo:s=e,l=2*n-t;break;case fl:s=1,l=n+i[1]-i[0];break;default:s=e-1,l=t}const u=.5*(n-t),c=this.valueSize;this._weightPrev=u/(t-a),this._weightNext=u/(l-n),this._offsetPrev=o*c,this._offsetNext=s*c}interpolate_(e,t,n,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,c=this._offsetPrev,d=this._offsetNext,f=this._weightPrev,m=this._weightNext,g=(n-t)/(i-t),_=g*g,y=_*g,w=-f*y+2*f*_-f*g,M=(1+f)*y+(-1.5-2*f)*_+(-.5+f)*g+1,I=(-1-m)*y+(1.5+m)*_+.5*g,F=m*y-m*_;for(let C=0;C!==a;++C)o[C]=w*s[c+C]+M*s[u+C]+I*s[l+C]+F*s[d+C];return o}}class _v extends ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,c=(n-t)/(i-t),d=1-c;for(let f=0;f!==a;++f)o[f]=s[u+f]*d+s[l+f]*c;return o}}class ly extends ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Po{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Gn.convertArray(t,this.TimeBufferType),this.values=Gn.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Gn.convertArray(e.times,Array),values:Gn.convertArray(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new ly(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new _v(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new ay(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Vo:t=this.InterpolantFactoryMethodDiscrete;break;case pl:t=this.InterpolantFactoryMethodLinear;break;case mo:t=this.InterpolantFactoryMethodSmooth}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Vo;case this.InterpolantFactoryMethodLinear:return pl;case this.InterpolantFactoryMethodSmooth:return mo}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let o=0,s=i-1;for(;o!==i&&n[o]<e;)++o;for(;s!==-1&&n[s]>t;)--s;if(++s,o!==0||s!==i){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=Gn.arraySlice(n,o,s),this.values=Gn.arraySlice(this.values,o*a,s*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,o=n.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==o;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,s),e=!1;break}s=l}if(i!==void 0&&Gn.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){const u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=Gn.arraySlice(this.times),t=Gn.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===mo,o=e.length-1;let s=1;for(let a=1;a<o;++a){let l=!1;const u=e[a];if(u!==e[a+1]&&(a!==1||u!==e[0]))if(i)l=!0;else{const c=a*n,d=c-n,f=c+n;for(let m=0;m!==n;++m){const g=t[c+m];if(g!==t[d+m]||g!==t[f+m]){l=!0;break}}}if(l){if(a!==s){e[s]=e[a];const c=a*n,d=s*n;for(let f=0;f!==n;++f)t[d+f]=t[c+f]}++s}}if(o>0){e[s]=e[o];for(let a=o*n,l=s*n,u=0;u!==n;++u)t[l+u]=t[a+u];++s}return s!==e.length?(this.times=Gn.arraySlice(e,0,s),this.values=Gn.arraySlice(t,0,s*n)):(this.times=e,this.values=t),this}clone(){const e=Gn.arraySlice(this.times,0),t=Gn.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Po.prototype.TimeBufferType=Float32Array,Po.prototype.ValueBufferType=Float32Array,Po.prototype.DefaultInterpolation=pl;class Yl extends Po{}Yl.prototype.ValueTypeName="bool",Yl.prototype.ValueBufferType=Array,Yl.prototype.DefaultInterpolation=Vo,Yl.prototype.InterpolantFactoryMethodLinear=void 0,Yl.prototype.InterpolantFactoryMethodSmooth=void 0;class yv extends Po{}yv.prototype.ValueTypeName="color";class Sd extends Po{}Sd.prototype.ValueTypeName="number";class uy extends ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t);let u=e*a;for(let c=u+a;u!==c;u+=4)gi.slerpFlat(o,0,s,u-a,s,u,l);return o}}class Vh extends Po{InterpolantFactoryMethodLinear(e){return new uy(this.times,this.values,this.getValueSize(),e)}}Vh.prototype.ValueTypeName="quaternion",Vh.prototype.DefaultInterpolation=pl,Vh.prototype.InterpolantFactoryMethodSmooth=void 0;class ql extends Po{}ql.prototype.ValueTypeName="string",ql.prototype.ValueBufferType=Array,ql.prototype.DefaultInterpolation=Vo,ql.prototype.InterpolantFactoryMethodLinear=void 0,ql.prototype.InterpolantFactoryMethodSmooth=void 0;class Ed extends Po{}Ed.prototype.ValueTypeName="vector";class Md{constructor(e,t=-1,n,i=Cs){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=ir(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let s=0,a=n.length;s!==a;++s)t.push(yS(n[s]).scale(i));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,s=n.length;o!==s;++o)t.push(Po.toJSON(n[o]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const o=t.length,s=[];for(let a=0;a<o;a++){let l=[],u=[];l.push((a+o-1)%o,a,(a+1)%o),u.push(0,1,0);const c=Gn.getKeyframeOrder(l);l=Gn.sortedArray(l,1,c),u=Gn.sortedArray(u,1,c),i||l[0]!==0||(l.push(o),u.push(u[0])),s.push(new Sd(".morphTargetInfluences["+t[a].name+"]",l,u).scale(1/n))}return new this(e,-1,s)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},o=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const u=e[a],c=u.name.match(o);if(c&&c.length>1){const d=c[1];let f=i[d];f||(i[d]=f=[]),f.push(u)}}const s=[];for(const a in i)s.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(c,d,f,m,g){if(f.length!==0){const _=[],y=[];Gn.flattenJSON(f,_,y,m),_.length!==0&&g.push(new c(d,_,y))}},i=[],o=e.name||"default",s=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let c=0;c<u.length;c++){const d=u[c].keys;if(d&&d.length!==0)if(d[0].morphTargets){const f={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let g=0;g<d[m].morphTargets.length;g++)f[d[m].morphTargets[g]]=-1;for(const g in f){const _=[],y=[];for(let w=0;w!==d[m].morphTargets.length;++w){const M=d[m];_.push(M.time),y.push(M.morphTarget===g?1:0)}i.push(new Sd(".morphTargetInfluence["+g+"]",_,y))}l=f.length*(s||1)}else{const f=".bones["+t[c].name+"]";n(Ed,f+".position",d,"pos",i),n(Vh,f+".quaternion",d,"rot",i),n(Ed,f+".scale",d,"scl",i)}}return i.length===0?null:new this(o,l,i,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function yS(r){if(r.type===void 0)throw new Error("THREE.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 Sd;case"vector":case"vector2":case"vector3":case"vector4":return Ed;case"color":return yv;case"quaternion":return Vh;case"bool":case"boolean":return Yl;case"string":return ql}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(r.type);if(r.times===void 0){const t=[],n=[];Gn.flattenJSON(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const Zl={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class xv{constructor(e,t,n){const i=this;let o=!1,s=0,a=0,l;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(c){a++,o===!1&&i.onStart!==void 0&&i.onStart(c,s,a),o=!0},this.itemEnd=function(c){s++,i.onProgress!==void 0&&i.onProgress(c,s,a),s===a&&(o=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(c){i.onError!==void 0&&i.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,d){return u.push(c,d),this},this.removeHandler=function(c){const d=u.indexOf(c);return d!==-1&&u.splice(d,2),this},this.getHandler=function(c){for(let d=0,f=u.length;d<f;d+=2){const m=u[d],g=u[d+1];if(m.global&&(m.lastIndex=0),m.test(c))return g}return null}}}const hy=new xv;class Ji{constructor(e){this.manager=e!==void 0?e:hy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,o){n.load(e,i,t,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Co={};class Ro extends Ji{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=Zl.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;if(Co[e]!==void 0)return void Co[e].push({onLoad:t,onProgress:n,onError:i});const a=e.match(/^data:(.*?)(;base64)?,(.*)$/);let l;if(a){const u=a[1],c=!!a[2];let d=a[3];d=decodeURIComponent(d),c&&(d=atob(d));try{let f;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const g=new Uint8Array(d.length);for(let y=0;y<d.length;y++)g[y]=d.charCodeAt(y);f=m==="blob"?new Blob([g.buffer],{type:u}):g.buffer;break;case"document":f=new DOMParser().parseFromString(d,u);break;case"json":f=JSON.parse(d);break;default:f=d}setTimeout(function(){t&&t(f),o.manager.itemEnd(e)},0)}catch(f){setTimeout(function(){i&&i(f),o.manager.itemError(e),o.manager.itemEnd(e)},0)}}else{Co[e]=[],Co[e].push({onLoad:t,onProgress:n,onError:i}),l=new XMLHttpRequest,l.open("GET",e,!0),l.addEventListener("load",function(u){const c=this.response,d=Co[e];if(delete Co[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Zl.add(e,c);for(let f=0,m=d.length;f<m;f++){const g=d[f];g.onLoad&&g.onLoad(c)}o.manager.itemEnd(e)}else{for(let f=0,m=d.length;f<m;f++){const g=d[f];g.onError&&g.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)}},!1),l.addEventListener("progress",function(u){const c=Co[e];for(let d=0,f=c.length;d<f;d++){const m=c[d];m.onProgress&&m.onProgress(u)}},!1),l.addEventListener("error",function(u){const c=Co[e];delete Co[e];for(let d=0,f=c.length;d<f;d++){const m=c[d];m.onError&&m.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)},!1),l.addEventListener("abort",function(u){const c=Co[e];delete Co[e];for(let d=0,f=c.length;d<f;d++){const m=c[d];m.onError&&m.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)},!1),this.responseType!==void 0&&(l.responseType=this.responseType),this.withCredentials!==void 0&&(l.withCredentials=this.withCredentials),l.overrideMimeType&&l.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const u in this.requestHeader)l.setRequestHeader(u,this.requestHeader[u]);l.send(null)}return o.manager.itemStart(e),l}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class xS extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new Ro(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{t(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Md.parse(e[n]);t.push(i)}return t}}class bS extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=[],a=new yt,l=new Ro(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(o.withCredentials);let u=0;function c(d){l.load(e[d],function(f){const m=o.parse(f,!0);s[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},u+=1,u===6&&(m.mipmapCount===1&&(a.minFilter=Jn),a.image=s,a.format=m.format,a.needsUpdate=!0,t&&t(a))},n,i)}if(Array.isArray(e))for(let d=0,f=e.length;d<f;++d)c(d);else l.load(e,function(d){const f=o.parse(d,!0);if(f.isCubemap){const m=f.mipmaps.length/f.mipmapCount;for(let g=0;g<m;g++){s[g]={mipmaps:[]};for(let _=0;_<f.mipmapCount;_++)s[g].mipmaps.push(f.mipmaps[g*f.mipmapCount+_]),s[g].format=f.format,s[g].width=f.width,s[g].height=f.height}a.image=s}else a.image.width=f.width,a.image.height=f.height,a.mipmaps=f.mipmaps;f.mipmapCount===1&&(a.minFilter=Jn),a.format=f.format,a.needsUpdate=!0,t&&t(a)},n,i);return a}}class Ad extends Ji{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=Zl.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function l(){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),Zl.add(e,this),t&&t(this),o.manager.itemEnd(e)}function u(c){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),i&&i(c),o.manager.itemError(e),o.manager.itemEnd(e)}return a.addEventListener("load",l,!1),a.addEventListener("error",u,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(e),a.src=e,a}}class cy extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=new Br,s=new Ad(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function l(u){s.load(e[u],function(c){o.images[u]=c,a++,a===6&&(o.needsUpdate=!0,t&&t(o))},void 0,i)}for(let u=0;u<e.length;++u)l(u);return o}}class dy extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new ns,a=new Ro(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(o.withCredentials),a.load(e,function(l){const u=o.parse(l);u&&(u.image!==void 0?s.image=u.image:u.data!==void 0&&(s.image.width=u.width,s.image.height=u.height,s.image.data=u.data),s.wrapS=u.wrapS!==void 0?u.wrapS:mi,s.wrapT=u.wrapT!==void 0?u.wrapT:mi,s.magFilter=u.magFilter!==void 0?u.magFilter:Jn,s.minFilter=u.minFilter!==void 0?u.minFilter:Jn,s.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.encoding!==void 0&&(s.encoding=u.encoding),u.flipY!==void 0&&(s.flipY=u.flipY),u.format!==void 0&&(s.format=u.format),u.type!==void 0&&(s.type=u.type),u.mipmaps!==void 0&&(s.mipmaps=u.mipmaps,s.minFilter=Ts),u.mipmapCount===1&&(s.minFilter=Jn),u.generateMipmaps!==void 0&&(s.generateMipmaps=u.generateMipmaps),s.needsUpdate=!0,t&&t(s,u))},n,i),s}}class bv extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=new $n,s=new Ad(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(a){o.image=a;const l=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;o.format=l?co:er,o.needsUpdate=!0,t!==void 0&&t(o)},n,i),o}}class py extends Xn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ja(t,e))}getPoint(e){const t=e*this.getLength(),n=this.getCurveLengths();let i=0;for(;i<n.length;){if(n[i]>=t){const o=n[i]-t,s=this.curves[i],a=s.getLength(),l=a===0?0:1-o/a;return s.getPointAt(l)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,o=this.curves;i<o.length;i++){const s=o[i],a=s&&s.isEllipseCurve?2*e:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?e*s.points.length:e,l=s.getPoints(a);for(let u=0;u<l.length;u++){const c=l[u];n&&n.equals(c)||(t.push(c),n=c)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(new lv[i.type]().fromJSON(i))}return this}}class Jl extends py{constructor(e){super(),this.type="Path",this.currentPoint=new Qe,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new ja(this.currentPoint.clone(),new Qe(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const o=new ea(this.currentPoint.clone(),new Qe(e,t),new Qe(n,i));return this.curves.push(o),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,o,s){const a=new Qs(this.currentPoint.clone(),new Qe(e,t),new Qe(n,i),new Qe(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Jf(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,o,s){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,i,o,s),this}absarc(e,t,n,i,o,s){return this.absellipse(e,t,n,n,i,o,s),this}ellipse(e,t,n,i,o,s,a,l){const u=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+u,t+c,n,i,o,s,a,l),this}absellipse(e,t,n,i,o,s,a,l){const u=new kn(e,t,n,i,o,s,a,l);if(this.curves.length>0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Xa extends Jl{constructor(e){super(e),this.uuid=ir(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(new Jl().fromJSON(i))}return this}}class Io extends Xt{constructor(e,t=1){super(),this.type="Light",this.color=new gt(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}Io.prototype.isLight=!0;class wv extends Io{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(Xt.DefaultUp),this.updateMatrix(),this.groundColor=new gt(t)}copy(e){return Io.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}wv.prototype.isHemisphereLight=!0;const fy=new pt,my=new T,gy=new T;class Tv{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Qe(512,512),this.map=null,this.mapPass=null,this.matrix=new pt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Da,this._frameExtents=new Qe(1,1),this._viewportCount=1,this._viewports=[new pn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;my.setFromMatrixPosition(e.matrixWorld),t.position.copy(my),gy.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(gy),t.updateMatrixWorld(),fy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(fy),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),this.mapSize.x===512&&this.mapSize.y===512||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class vy extends Tv{constructor(){super(new Qn(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=2*ni*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;n===t.fov&&i===t.aspect&&o===t.far||(t.fov=n,t.aspect=i,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}vy.prototype.isSpotLightShadow=!0;class Sv extends Io{constructor(e,t,n=0,i=Math.PI/3,o=0,s=1){super(e,t),this.type="SpotLight",this.position.copy(Xt.DefaultUp),this.updateMatrix(),this.target=new Xt,this.distance=n,this.angle=i,this.penumbra=o,this.decay=s,this.shadow=new vy}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Sv.prototype.isSpotLight=!0;const _y=new pt,Pd=new T,Ev=new T;class yy extends Tv{constructor(){super(new Qn(90,1,.5,500)),this._frameExtents=new Qe(4,2),this._viewportCount=6,this._viewports=[new pn(2,1,1,1),new pn(0,1,1,1),new pn(3,1,1,1),new pn(1,1,1,1),new pn(3,0,1,1),new pn(1,0,1,1)],this._cubeDirections=[new T(1,0,0),new T(-1,0,0),new T(0,0,1),new T(0,0,-1),new T(0,1,0),new T(0,-1,0)],this._cubeUps=[new T(0,1,0),new T(0,1,0),new T(0,1,0),new T(0,1,0),new T(0,0,1),new T(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,o=e.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),Pd.setFromMatrixPosition(e.matrixWorld),n.position.copy(Pd),Ev.copy(n.position),Ev.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Ev),n.updateMatrixWorld(),i.makeTranslation(-Pd.x,-Pd.y,-Pd.z),_y.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_y)}}yy.prototype.isPointLightShadow=!0;class Mv extends Io{constructor(e,t,n=0,i=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new yy}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Mv.prototype.isPointLight=!0;class jh extends zs{constructor(e=-1,t=1,n=1,i=-1,o=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=n-e,s=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}jh.prototype.isOrthographicCamera=!0;class xy extends Tv{constructor(){super(new jh(-5,5,5,-5,.5,500))}}xy.prototype.isDirectionalLightShadow=!0;class rm extends Io{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Xt.DefaultUp),this.updateMatrix(),this.target=new Xt,this.shadow=new xy}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}rm.prototype.isDirectionalLight=!0;class om extends Io{constructor(e,t){super(e,t),this.type="AmbientLight"}}om.prototype.isAmbientLight=!0;class Av extends Io{constructor(e,t,n=10,i=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=i}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Av.prototype.isRectAreaLight=!0;class Pv{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new T)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,o=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*i),t.addScaledVector(s[2],.488603*o),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*i*1.092548),t.addScaledVector(s[5],i*o*1.092548),t.addScaledVector(s[6],.315392*(3*o*o-1)),t.addScaledVector(s[7],n*o*1.092548),t.addScaledVector(s[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,o=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*i),t.addScaledVector(s[2],1.023328*o),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*i),t.addScaledVector(s[5],.858086*i*o),t.addScaledVector(s[6],.743125*o*o-.247708),t.addScaledVector(s[7],.858086*n*o),t.addScaledVector(s[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}static getBasisAt(e,t){const n=e.x,i=e.y,o=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*o,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*o,t[6]=.315392*(3*o*o-1),t[7]=1.092548*n*o,t[8]=.546274*(n*n-i*i)}}Pv.prototype.isSphericalHarmonics3=!0;class Cd extends Io{constructor(e=new Pv,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Cd.prototype.isLightProbe=!0;class by extends Ji{constructor(e){super(e),this.textures={}}load(e,t,n,i){const o=this,s=new Ro(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(a){try{t(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},n,i)}parse(e){const t=this.textures;function n(o){return t[o]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",o),t[o]}const i=new _S[e.type];if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=new gt().setHex(e.sheen)),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==1&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(i.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(i.morphNormals=e.morphNormals),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(i.vertexTangents=e.vertexTangents),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const s=e.uniforms[o];switch(i.uniforms[o]={},s.type){case"t":i.uniforms[o].value=n(s.value);break;case"c":i.uniforms[o].value=new gt().setHex(s.value);break;case"v2":i.uniforms[o].value=new Qe().fromArray(s.value);break;case"v3":i.uniforms[o].value=new T().fromArray(s.value);break;case"v4":i.uniforms[o].value=new pn().fromArray(s.value);break;case"m3":i.uniforms[o].value=new En().fromArray(s.value);break;case"m4":i.uniforms[o].value=new pt().fromArray(s.value);break;default:i.uniforms[o].value=s.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const o in e.extensions)i.extensions[o]=e.extensions[o];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),i.normalScale=new Qe().fromArray(o)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Qe().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}}class sm{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class Cv extends Mt{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Cv.prototype.isInstancedBufferGeometry=!0;class Rv extends Zt{constructor(e,t,n,i=1){typeof n=="number"&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Rv.prototype.isInstancedBufferAttribute=!0;class wy extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new Ro(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(a){try{t(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(d,f){if(t[f]!==void 0)return t[f];const m=d.interleavedBuffers[f],g=function(w,M){if(n[M]!==void 0)return n[M];const I=w.arrayBuffers[M],F=new Uint32Array(I).buffer;return n[M]=F,F}(d,m.buffer),_=Us(m.type,g),y=new qs(_,m.stride);return y.uuid=m.uuid,t[f]=y,y}const o=e.isInstancedBufferGeometry?new Cv:new Mt,s=e.data.index;if(s!==void 0){const d=Us(s.type,s.array);o.setIndex(new Zt(d,1))}const a=e.data.attributes;for(const d in a){const f=a[d];let m;if(f.isInterleavedBufferAttribute){const g=i(e.data,f.data);m=new Mo(g,f.itemSize,f.offset,f.normalized)}else{const g=Us(f.type,f.array);m=new(f.isInstancedBufferAttribute?Rv:Zt)(g,f.itemSize,f.normalized)}f.name!==void 0&&(m.name=f.name),f.usage!==void 0&&m.setUsage(f.usage),f.updateRange!==void 0&&(m.updateRange.offset=f.updateRange.offset,m.updateRange.count=f.updateRange.count),o.setAttribute(d,m)}const l=e.data.morphAttributes;if(l)for(const d in l){const f=l[d],m=[];for(let g=0,_=f.length;g<_;g++){const y=f[g];let w;if(y.isInterleavedBufferAttribute){const M=i(e.data,y.data);w=new Mo(M,y.itemSize,y.offset,y.normalized)}else{const M=Us(y.type,y.array);w=new Zt(M,y.itemSize,y.normalized)}y.name!==void 0&&(w.name=y.name),m.push(w)}o.morphAttributes[d]=m}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const u=e.data.groups||e.data.drawcalls||e.data.offsets;if(u!==void 0)for(let d=0,f=u.length;d!==f;++d){const m=u[d];o.addGroup(m.start,m.count,m.materialIndex)}const c=e.data.boundingSphere;if(c!==void 0){const d=new T;c.center!==void 0&&d.fromArray(c.center),o.boundingSphere=new li(d,c.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class wS extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=this.path===""?sm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const a=new Ro(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let u=null;try{u=JSON.parse(l)}catch(d){return i!==void 0&&i(d),void console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message)}const c=u.metadata;c!==void 0&&c.type!==void 0&&c.type.toLowerCase()!=="geometry"?o.parse(u,t):console.error("THREE.ObjectLoader: Can't load "+e)},n,i)}async loadAsync(e,t){const n=this.path===""?sm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const i=new Ro(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);const o=await i.loadAsync(e,t),s=JSON.parse(o),a=s.metadata;if(a===void 0||a.type===void 0||a.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(s)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),o=this.parseGeometries(e.geometries,i),s=this.parseImages(e.images,function(){t!==void 0&&t(u)}),a=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,a),u=this.parseObject(e.object,o,l,a,n),c=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,c),t!==void 0){let d=!1;for(const f in s)if(s[f]instanceof HTMLImageElement){d=!0;break}d===!1&&t(u)}return u}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),o=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,o),a=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,i,a,s,t),u=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,u),l}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const o=new Xa().fromJSON(e[n]);t[o.uuid]=o}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(o){o.isBone&&(i[o.uuid]=o)}),e!==void 0)for(let o=0,s=e.length;o<s;o++){const a=new Ch().fromJSON(e[o],i);n[a.uuid]=a}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new wy;for(let o=0,s=e.length;o<s;o++){let a;const l=e[o];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(l);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:l.type in sy?a=sy[l.type].fromJSON(l,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),a.isBufferGeometry===!0&&l.userData!==void 0&&(a.userData=l.userData),n[l.uuid]=a}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const o=new by;o.setTextures(t);for(let s=0,a=e.length;s<a;s++){const l=e[s];if(l.type==="MultiMaterial"){const u=[];for(let c=0;c<l.materials.length;c++){const d=l.materials[c];n[d.uuid]===void 0&&(n[d.uuid]=o.parse(d)),u.push(n[d.uuid])}i[l.uuid]=u}else n[l.uuid]===void 0&&(n[l.uuid]=o.parse(l)),i[l.uuid]=n[l.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const i=e[n],o=Md.parse(i);t[o.uuid]=o}return t}parseImages(e,t){const n=this,i={};let o;function s(a){if(typeof a=="string"){const l=a;return function(u){return n.manager.itemStart(u),o.load(u,function(){n.manager.itemEnd(u)},void 0,function(){n.manager.itemError(u),n.manager.itemEnd(u)})}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:n.resourcePath+l)}return a.data?{data:Us(a.type,a.data),width:a.width,height:a.height}:null}if(e!==void 0&&e.length>0){const a=new xv(t);o=new Ad(a),o.setCrossOrigin(this.crossOrigin);for(let l=0,u=e.length;l<u;l++){const c=e[l],d=c.url;if(Array.isArray(d)){i[c.uuid]=[];for(let f=0,m=d.length;f<m;f++){const g=s(d[f]);g!==null&&(g instanceof HTMLImageElement?i[c.uuid].push(g):i[c.uuid].push(new ns(g.data,g.width,g.height)))}}else{const f=s(c.url);f!==null&&(i[c.uuid]=f)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function o(s){if(typeof s=="string"){const a=s,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await i.loadAsync(l)}return s.data?{data:Us(s.type,s.data),width:s.width,height:s.height}:null}if(e!==void 0&&e.length>0){i=new Ad(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,a=e.length;s<a;s++){const l=e[s],u=l.url;if(Array.isArray(u)){n[l.uuid]=[];for(let c=0,d=u.length;c<d;c++){const f=u[c],m=await o(f);m!==null&&(m instanceof HTMLImageElement?n[l.uuid].push(m):n[l.uuid].push(new ns(m.data,m.width,m.height)))}}else{const c=await o(l.url);c!==null&&(n[l.uuid]=c)}}}return n}parseTextures(e,t){function n(o,s){return typeof o=="number"?o:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",o),s[o])}const i={};if(e!==void 0)for(let o=0,s=e.length;o<s;o++){const a=e[o];let l;a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const u=t[a.image];Array.isArray(u)?(l=new Br(u),u.length===6&&(l.needsUpdate=!0)):(l=u&&u.data?new ns(u.data,u.width,u.height):new $n(u),u&&(l.needsUpdate=!0)),l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),a.mapping!==void 0&&(l.mapping=n(a.mapping,TS)),a.offset!==void 0&&l.offset.fromArray(a.offset),a.repeat!==void 0&&l.repeat.fromArray(a.repeat),a.center!==void 0&&l.center.fromArray(a.center),a.rotation!==void 0&&(l.rotation=a.rotation),a.wrap!==void 0&&(l.wrapS=n(a.wrap[0],Ty),l.wrapT=n(a.wrap[1],Ty)),a.format!==void 0&&(l.format=a.format),a.type!==void 0&&(l.type=a.type),a.encoding!==void 0&&(l.encoding=a.encoding),a.minFilter!==void 0&&(l.minFilter=n(a.minFilter,Sy)),a.magFilter!==void 0&&(l.magFilter=n(a.magFilter,Sy)),a.anisotropy!==void 0&&(l.anisotropy=a.anisotropy),a.flipY!==void 0&&(l.flipY=a.flipY),a.premultiplyAlpha!==void 0&&(l.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(l.unpackAlignment=a.unpackAlignment),i[a.uuid]=l}return i}parseObject(e,t,n,i,o){let s,a,l;function u(f){return t[f]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",f),t[f]}function c(f){if(f!==void 0){if(Array.isArray(f)){const m=[];for(let g=0,_=f.length;g<_;g++){const y=f[g];n[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),m.push(n[y])}return m}return n[f]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",f),n[f]}}function d(f){return i[f]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",f),i[f]}switch(e.type){case"Scene":s=new Ba,e.background!==void 0&&(Number.isInteger(e.background)?s.background=new gt(e.background):s.background=d(e.background)),e.environment!==void 0&&(s.environment=d(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?s.fog=new Fl(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(s.fog=new _i(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":s=new Qn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(s.focus=e.focus),e.zoom!==void 0&&(s.zoom=e.zoom),e.filmGauge!==void 0&&(s.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(s.filmOffset=e.filmOffset),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new jh(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(s.zoom=e.zoom),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new om(e.color,e.intensity);break;case"DirectionalLight":s=new rm(e.color,e.intensity);break;case"PointLight":s=new Mv(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new Av(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new Sv(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new wv(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=new Cd().fromJSON(e);break;case"SkinnedMesh":a=u(e.geometry),l=c(e.material),s=new Ga(a,l),e.bindMode!==void 0&&(s.bindMode=e.bindMode),e.bindMatrix!==void 0&&s.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(s.skeleton=e.skeleton);break;case"Mesh":a=u(e.geometry),l=c(e.material),s=new ln(a,l);break;case"InstancedMesh":a=u(e.geometry),l=c(e.material);const f=e.count,m=e.instanceMatrix,g=e.instanceColor;s=new vd(a,l,f),s.instanceMatrix=new Zt(new Float32Array(m.array),16),g!==void 0&&(s.instanceColor=new Zt(new Float32Array(g.array),g.itemSize));break;case"LOD":s=new Vf;break;case"Line":s=new h(u(e.geometry),c(e.material));break;case"LineLoop":s=new P(u(e.geometry),c(e.material));break;case"LineSegments":s=new E(u(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new ze(u(e.geometry),c(e.material));break;case"Sprite":s=new Hl(c(e.material));break;case"Group":s=new Ys;break;case"Bone":s=new Ph;break;default:s=new Xt}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const f=e.children;for(let m=0;m<f.length;m++)s.add(this.parseObject(f[m],t,n,i,o))}if(e.animations!==void 0){const f=e.animations;for(let m=0;m<f.length;m++){const g=f[m];s.animations.push(o[g])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(s.autoUpdate=e.autoUpdate);const f=e.levels;for(let m=0;m<f.length;m++){const g=f[m],_=s.getObjectByProperty("uuid",g.object);_!==void 0&&s.addLevel(_,g.distance)}}return s}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const i=t[n.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(i,n.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const TS={UVMapping:Pu,CubeReflectionMapping:ko,CubeRefractionMapping:ol,EquirectangularReflectionMapping:sl,EquirectangularRefractionMapping:al,CubeUVReflectionMapping:fa,CubeUVRefractionMapping:ma},Ty={RepeatWrapping:Go,ClampToEdgeWrapping:mi,MirroredRepeatWrapping:ll},Sy={NearestFilter:Zn,NearestMipmapNearestFilter:ul,NearestMipmapLinearFilter:hl,LinearFilter:Jn,LinearMipmapNearestFilter:Ho,LinearMipmapLinearFilter:Ts};class Ey extends Ji{constructor(e){super(e),typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=Zl.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(l){Zl.add(e,l),t&&t(l),o.manager.itemEnd(e)}).catch(function(l){i&&i(l),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}Ey.prototype.isImageBitmapLoader=!0;class My{constructor(){this.type="ShapePath",this.color=new gt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Jl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,o,s){return this.currentPath.bezierCurveTo(e,t,n,i,o,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(M){const I=[];for(let F=0,C=M.length;F<C;F++){const U=M[F],N=new Xa;N.curves=U.curves,I.push(N)}return I}function i(M,I){const F=I.length;let C=!1;for(let U=F-1,N=0;N<F;U=N++){let G=I[U],he=I[N],ne=he.x-G.x,Z=he.y-G.y;if(Math.abs(Z)>Number.EPSILON){if(Z<0&&(G=I[N],ne=-ne,he=I[U],Z=-Z),M.y<G.y||M.y>he.y)continue;if(M.y===G.y){if(M.x===G.x)return!0}else{const Q=Z*(M.x-G.x)-ne*(M.y-G.y);if(Q===0)return!0;if(Q<0)continue;C=!C}}else{if(M.y!==G.y)continue;if(he.x<=M.x&&M.x<=G.x||G.x<=M.x&&M.x<=he.x)return!0}}return C}const o=ss.isClockWise,s=this.subPaths;if(s.length===0)return[];if(t===!0)return n(s);let a,l,u;const c=[];if(s.length===1)return l=s[0],u=new Xa,u.curves=l.curves,c.push(u),c;let d=!o(s[0].getPoints());d=e?!d:d;const f=[],m=[];let g,_,y=[],w=0;m[w]=void 0,y[w]=[];for(let M=0,I=s.length;M<I;M++)l=s[M],g=l.getPoints(),a=o(g),a=e?!a:a,a?(!d&&m[w]&&w++,m[w]={s:new Xa,p:g},m[w].s.curves=l.curves,d&&w++,y[w]=[]):y[w].push({h:l,p:g[0]});if(!m[0])return n(s);if(m.length>1){let M=!1;const I=[];for(let F=0,C=m.length;F<C;F++)f[F]=[];for(let F=0,C=m.length;F<C;F++){const U=y[F];for(let N=0;N<U.length;N++){const G=U[N];let he=!0;for(let ne=0;ne<m.length;ne++)i(G.p,m[ne].p)&&(F!==ne&&I.push({froms:F,tos:ne,hole:N}),he?(he=!1,f[ne].push(G)):M=!0);he&&f[F].push(G)}}I.length>0&&(M||(y=f))}for(let M=0,I=m.length;M<I;M++){u=m[M].s,c.push(u),_=y[M];for(let F=0,C=_.length;F<C;F++)u.holes.push(_[F].h)}return c}}class Iv{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],i=function(o,s,a){const l=Array.from(o),u=s/a.resolution,c=(a.boundingBox.yMax-a.boundingBox.yMin+a.underlineThickness)*u,d=[];let f=0,m=0;for(let g=0;g<l.length;g++){const _=l[g];if(_===`
|
|
2977
|
-
`)f=0,m-=c;else{const y=SS(_,u,f,m,a);f+=y.offsetX,d.push(y.path)}}return d}(e,t,this.data);for(let o=0,s=i.length;o<s;o++)Array.prototype.push.apply(n,i[o].toShapes());return n}}function SS(r,e,t,n,i){const o=i.glyphs[r]||i.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+r+'" does not exists in font family '+i.familyName+".");const s=new My;let a,l,u,c,d,f,m,g;if(o.o){const _=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let y=0,w=_.length;y<w;)switch(_[y++]){case"m":a=_[y++]*e+t,l=_[y++]*e+n,s.moveTo(a,l);break;case"l":a=_[y++]*e+t,l=_[y++]*e+n,s.lineTo(a,l);break;case"q":u=_[y++]*e+t,c=_[y++]*e+n,d=_[y++]*e+t,f=_[y++]*e+n,s.quadraticCurveTo(d,f,u,c);break;case"b":u=_[y++]*e+t,c=_[y++]*e+n,d=_[y++]*e+t,f=_[y++]*e+n,m=_[y++]*e+t,g=_[y++]*e+n,s.bezierCurveTo(d,f,m,g,u,c)}}return{offsetX:o.ha*e,path:s}}Iv.prototype.isFont=!0;class ES extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new Ro(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(a){let l;try{l=JSON.parse(a)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),l=JSON.parse(a.substring(65,a.length-2))}const u=o.parse(l);t&&t(u)},n,i)}parse(e){return new Iv(e)}}let am;const Lv={getContext:function(){return am===void 0&&(am=new(window.AudioContext||window.webkitAudioContext)),am},setContext:function(r){am=r}};class Ay extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new Ro(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{const l=a.slice(0);Lv.getContext().decodeAudioData(l,function(u){t(u)})}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},n,i)}}class Py extends Cd{constructor(e,t,n=1){super(void 0,n);const i=new gt().set(e),o=new gt().set(t),s=new T(i.r,i.g,i.b),a=new T(o.r,o.g,o.b),l=Math.sqrt(Math.PI),u=l*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(s).sub(a).multiplyScalar(u)}}Py.prototype.isHemisphereLightProbe=!0;class Cy extends Cd{constructor(e,t=1){super(void 0,t);const n=new gt().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Cy.prototype.isAmbientLightProbe=!0;const Ry=new pt,Iy=new pt;class MS{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;const n=e.projectionMatrix.clone(),i=t.eyeSep/2,o=i*t.near/t.focus,s=t.near*Math.tan(Sn*t.fov*.5)/t.zoom;let a,l;Iy.elements[12]=-i,Ry.elements[12]=i,a=-s*t.aspect+o,l=s*t.aspect+o,n.elements[0]=2*t.near/(l-a),n.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(n),a=-s*t.aspect-o,l=s*t.aspect-o,n.elements[0]=2*t.near/(l-a),n.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Iy),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Ry)}}class Ly{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Oy(),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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Oy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Oy(){return(typeof performance=="undefined"?Date:performance).now()}const $l=new T,Dy=new gi,AS=new T,Kl=new T;class PS extends Xt{constructor(){super(),this.type="AudioListener",this.context=Lv.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ly}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose($l,Dy,AS),Kl.set(0,0,-1).applyQuaternion(Dy),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime($l.x,i),t.positionY.linearRampToValueAtTime($l.y,i),t.positionZ.linearRampToValueAtTime($l.z,i),t.forwardX.linearRampToValueAtTime(Kl.x,i),t.forwardY.linearRampToValueAtTime(Kl.y,i),t.forwardZ.linearRampToValueAtTime(Kl.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition($l.x,$l.y,$l.z),t.setOrientation(Kl.x,Kl.y,Kl.z,n.x,n.y,n.z)}}class Ov extends Xt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl!==!1)return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(this.hasPlaybackControl!==!1)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl!==!1)return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl!==!1)return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Ql=new T,Ny=new gi,CS=new T,eu=new T;class RS extends Ov{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Ql,Ny,CS),eu.set(0,0,1).applyQuaternion(Ny);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Ql.x,n),t.positionY.linearRampToValueAtTime(Ql.y,n),t.positionZ.linearRampToValueAtTime(Ql.z,n),t.orientationX.linearRampToValueAtTime(eu.x,n),t.orientationY.linearRampToValueAtTime(eu.y,n),t.orientationZ.linearRampToValueAtTime(eu.z,n)}else t.setPosition(Ql.x,Ql.y,Ql.z),t.setOrientation(eu.x,eu.y,eu.z)}}class Fy{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class By{constructor(e,t,n){let i,o,s;switch(this.binding=e,this.valueSize=n,t){case"quaternion":i=this._slerp,o=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":i=this._select,o=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:i=this._lerp,o=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=o,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,o=e*i+i;let s=this.cumulativeWeight;if(s===0){for(let a=0;a!==i;++a)n[o+a]=n[a];s=t}else{s+=t;const a=t/s;this._mixBufferRegion(n,o,0,a,i)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,o=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,o<1){const l=t*this._origIndex;this._mixBufferRegion(n,i,l,1-o,t)}s>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let o=n,s=i;o!==s;++o)t[o]=t[i+o%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,o){if(i>=.5)for(let s=0;s!==o;++s)e[t+s]=e[n+s]}_slerp(e,t,n,i){gi.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,o){const s=this._workIndex*o;gi.multiplyQuaternionsFlat(e,s,e,t,e,n),gi.slerpFlat(e,t,e,t,e,s,i)}_lerp(e,t,n,i,o){const s=1-i;for(let a=0;a!==o;++a){const l=t+a;e[l]=e[l]*s+e[n+a]*i}}_lerpAdditive(e,t,n,i,o){for(let s=0;s!==o;++s){const a=t+s;e[a]=e[a]+e[n+s]*i}}}const IS=new RegExp("[\\[\\]\\.:\\/]","g"),LS="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",OS=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),DS=/(WCOD+)?/.source.replace("WCOD",LS),NS=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),FS=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),BS=new RegExp("^"+OS+DS+NS+FS+"$"),US=["material","materials","bones"];class cn{constructor(e,t,n){this.path=t,this.parsedPath=n||cn.parseTrackName(t),this.node=cn.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new cn.Composite(e,t,n):new cn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(IS,"")}static parseTrackName(e){const t=BS.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=n.nodeName.substring(i+1);US.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(o){for(let s=0;s<o.length;s++){const a=o[s];if(a.name===t||a.uuid===t)return a;const l=n(a.children);if(l)return l}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.node[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let o=t.propertyIndex;if(e||(e=cn.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let u=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let c=0;c<e.length;c++)if(e[c].name===u){u=c;break}break;default:if(e[n]===void 0)return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(u!==void 0){if(e[u]===void 0)return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[u]}}const s=e[i];if(s===void 0){const u=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e)}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(o!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);e.morphTargetDictionary[o]!==void 0&&(o=e.morphTargetDictionary[o])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=o}else s.fromArray!==void 0&&s.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}cn.Composite=class{constructor(r,e,t){const n=t||cn.parseTrackName(e);this._targetGroup=r,this._bindings=r.subscribe_(e,n)}getValue(r,e){this.bind();const t=this._targetGroup.nCachedObjects_,n=this._bindings[t];n!==void 0&&n.getValue(r,e)}setValue(r,e){const t=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=t.length;n!==i;++n)t[n].setValue(r,e)}bind(){const r=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=r.length;e!==t;++e)r[e].bind()}unbind(){const r=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=r.length;e!==t;++e)r[e].unbind()}},cn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},cn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},cn.prototype.GetterByBindingType=[cn.prototype._getValue_direct,cn.prototype._getValue_array,cn.prototype._getValue_arrayElement,cn.prototype._getValue_toArray],cn.prototype.SetterByBindingTypeAndVersioning=[[cn.prototype._setValue_direct,cn.prototype._setValue_direct_setNeedsUpdate,cn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[cn.prototype._setValue_array,cn.prototype._setValue_array_setNeedsUpdate,cn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[cn.prototype._setValue_arrayElement,cn.prototype._setValue_arrayElement_setNeedsUpdate,cn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[cn.prototype._setValue_fromArray,cn.prototype._setValue_fromArray_setNeedsUpdate,cn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Uy{constructor(){this.uuid=ir(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,o=this._bindings,s=o.length;let a,l=e.length,u=this.nCachedObjects_;for(let c=0,d=arguments.length;c!==d;++c){const f=arguments[c],m=f.uuid;let g=t[m];if(g===void 0){g=l++,t[m]=g,e.push(f);for(let _=0,y=s;_!==y;++_)o[_].push(new cn(f,n[_],i[_]))}else if(g<u){a=e[g];const _=--u,y=e[_];t[y.uuid]=g,e[g]=y,t[m]=_,e[_]=f;for(let w=0,M=s;w!==M;++w){const I=o[w],F=I[_];let C=I[g];I[g]=F,C===void 0&&(C=new cn(f,n[w],i[w])),I[_]=C}}else e[g]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let o=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){const l=arguments[s],u=l.uuid,c=t[u];if(c!==void 0&&c>=o){const d=o++,f=e[d];t[f.uuid]=c,e[c]=f,t[u]=d,e[d]=l;for(let m=0,g=i;m!==g;++m){const _=n[m],y=_[d],w=_[c];_[c]=y,_[d]=w}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let o=this.nCachedObjects_,s=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a].uuid,c=t[u];if(c!==void 0)if(delete t[u],c<o){const d=--o,f=e[d],m=--s,g=e[m];t[f.uuid]=c,e[c]=f,t[g.uuid]=d,e[d]=g,e.pop();for(let _=0,y=i;_!==y;++_){const w=n[_],M=w[d],I=w[m];w[c]=M,w[d]=I,w.pop()}}else{const d=--s,f=e[d];d>0&&(t[f.uuid]=c),e[c]=f,e.pop();for(let m=0,g=i;m!==g;++m){const _=n[m];_[c]=_[d],_.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const o=this._bindings;if(i!==void 0)return o[i];const s=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,c=this.nCachedObjects_,d=new Array(u);i=o.length,n[e]=i,s.push(e),a.push(t),o.push(d);for(let f=c,m=l.length;f!==m;++f){const g=l[f];d[f]=new cn(g,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,o=this._parsedPaths,s=this._bindings,a=s.length-1,l=s[a];t[e[a]]=n,s[n]=l,s.pop(),o[n]=o[a],o.pop(),i[n]=i[a],i.pop()}}}Uy.prototype.isAnimationObjectGroup=!0;class kS{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const o=t.tracks,s=o.length,a=new Array(s),l={endingStart:bi,endingEnd:bi};for(let u=0;u!==s;++u){const c=o[u].createInterpolant(null);a[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Rc,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}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=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,o=e._clip.duration,s=o/i,a=i/o;e.warp(1,s,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,o=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=o,l[1]=o+n,u[0]=e/s,u[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled)return void this._updateWeight(e);const o=this._startTime;if(o!==null){const l=(e-o)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);const s=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case we:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulateAdditive(a);break;case Cs:default:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,o=this._loopCount;const s=n===fo;if(e===0)return o===-1?i:s&&(1&o)==1?t-i:i;if(n===zu){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,o+=Math.abs(a);const l=this.repetitions-o;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(s&&(1&o)==1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=jo,i.endingEnd=jo):(i.endingStart=e?this.zeroSlopeAtStart?jo:bi:fl,i.endingEnd=t?this.zeroSlopeAtEnd?jo:bi:fl)}_scheduleFading(e,t,n){const i=this._mixer,o=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=o,l[0]=t,a[1]=o+e,l[1]=n,this}}class ky extends go{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,o=i.length,s=e._propertyBindings,a=e._interpolants,l=n.uuid,u=this._bindingsByRootAndName;let c=u[l];c===void 0&&(c={},u[l]=c);for(let d=0;d!==o;++d){const f=i[d],m=f.name;let g=c[m];if(g!==void 0)s[d]=g;else{if(g=s[d],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,m));continue}const _=t&&t._propertyBindings[d].binding.parsedPath;g=new By(cn.create(n,m,_),f.ValueTypeName,f.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,m),s[d]=g}a[d].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,o=this._actionsByClip[i];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];o.useCount++==0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];--o.useCount==0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,o=this._actionsByClip;let s=o[t];if(s===void 0)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,o[t]=s;else{const a=s.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=i.length,i.push(e),s.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const o=e._clip.uuid,s=this._actionsByClip,a=s[o],l=a.knownActions,u=l[l.length-1],c=e._byClipCacheIndex;u._byClipCacheIndex=c,l[c]=u,l.pop(),e._byClipCacheIndex=null,delete a.actionByRoot[(e._localRoot||this._root).uuid],l.length===0&&delete s[o],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];--o.referenceCount==0&&this._removeInactiveBinding(o)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,o=this._bindings;let s=i[t];s===void 0&&(s={},i[t]=s),s[n]=e,e._cacheIndex=o.length,o.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,o=n.path,s=this._bindingsByRootAndName,a=s[i],l=t[t.length-1],u=e._cacheIndex;l._cacheIndex=u,t[u]=l,t.pop(),delete a[o],Object.keys(a).length===0&&delete s[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new _v(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,o=t[i];e.__cacheIndex=i,t[i]=e,o.__cacheIndex=n,t[n]=o}clipAction(e,t,n){const i=t||this._root,o=i.uuid;let s=typeof e=="string"?Md.findByName(i,e):e;const a=s!==null?s.uuid:e,l=this._actionsByClip[a];let u=null;if(n===void 0&&(n=s!==null?s.blendMode:Cs),l!==void 0){const d=l.actionByRoot[o];if(d!==void 0&&d.blendMode===n)return d;u=l.knownActions[0],s===null&&(s=u._clip)}if(s===null)return null;const c=new kS(this,s,t,n);return this._bindAction(c,u),this._addInactiveAction(c,a,o),c}existingAction(e,t){const n=t||this._root,i=n.uuid,o=typeof e=="string"?Md.findByName(n,e):e,s=o?o.uuid:e,a=this._actionsByClip[s];return a!==void 0&&a.actionByRoot[i]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,o=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==n;++u)t[u]._update(i,e,o,s);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(s);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,o=i[n];if(o!==void 0){const s=o.knownActions;for(let a=0,l=s.length;a!==l;++a){const u=s[a];this._deactivateAction(u);const c=u._cacheIndex,d=t[t.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,d._cacheIndex=c,t[c]=d,t.pop(),this._removeInactiveBindingsForAction(u)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const o in n){const s=n[o].actionByRoot[t];s!==void 0&&(this._deactivateAction(s),this._removeInactiveAction(s))}const i=this._bindingsByRootAndName[t];if(i!==void 0)for(const o in i){const s=i[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}ky.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class lm{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new lm(this.value.clone===void 0?this.value:this.value.clone())}}class Gy extends qs{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}Gy.prototype.isInstancedInterleavedBuffer=!0;class Hy{constructor(e,t,n,i,o){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=o,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}Hy.prototype.isGLBufferAttribute=!0;class GS{constructor(e,t,n=0,i=1/0){this.ray=new bo(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Uc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!1,n=[]){return Dv(e,this,n,t),n.sort(zy),n}intersectObjects(e,t=!1,n=[]){for(let i=0,o=e.length;i<o;i++)Dv(e[i],this,n,t);return n.sort(zy),n}}function zy(r,e){return r.distance-e.distance}function Dv(r,e,t,n){if(r.layers.test(e.layers)&&r.raycast(e,t),n===!0){const i=r.children;for(let o=0,s=i.length;o<s;o++)Dv(i[o],e,t,!0)}}class HS{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Ti(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class zS{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}const Vy=new Qe;class Wh{constructor(e=new Qe(1/0,1/0),t=new Qe(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Vy.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Vy.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}Wh.prototype.isBox2=!0;const jy=new T,um=new T;class Wy{constructor(e=new T,t=new T){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){jy.subVectors(e,this.start),um.subVectors(this.end,this.start);const n=um.dot(um);let i=um.dot(jy)/n;return t&&(i=Ti(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Xy extends Xt{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}Xy.prototype.isImmediateRenderObject=!0;const Yy=new T;class VS extends Xt{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Mt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,l=32;s<l;s++,a++){const u=s/l*Math.PI*2,c=a/l*Math.PI*2;i.push(Math.cos(u),Math.sin(u),1,Math.cos(c),Math.sin(c),1)}n.setAttribute("position",new st(i,3));const o=new yi({fog:!1,toneMapped:!1});this.cone=new E(n,o),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Yy.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Yy),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ya=new T,hm=new pt,Nv=new pt;class qy extends E{constructor(e){const t=function l(u){const c=[];u&&u.isBone&&c.push(u);for(let d=0;d<u.children.length;d++)c.push.apply(c,l(u.children[d]));return c}(e),n=new Mt,i=[],o=[],s=new gt(0,0,1),a=new gt(0,1,0);for(let l=0;l<t.length;l++){const u=t[l];u.parent&&u.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),o.push(s.r,s.g,s.b),o.push(a.r,a.g,a.b))}n.setAttribute("position",new st(i,3)),n.setAttribute("color",new st(o,3)),super(n,new yi({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");Nv.copy(this.root.matrixWorld).invert();for(let o=0,s=0;o<t.length;o++){const a=t[o];a.parent&&a.parent.isBone&&(hm.multiplyMatrices(Nv,a.matrixWorld),Ya.setFromMatrixPosition(hm),i.setXYZ(s,Ya.x,Ya.y,Ya.z),hm.multiplyMatrices(Nv,a.parent.matrixWorld),Ya.setFromMatrixPosition(hm),i.setXYZ(s+1,Ya.x,Ya.y,Ya.z),s+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}class jS extends ln{constructor(e,t,n){super(new Xl(t,4,2),new Kn({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const WS=new T,Zy=new gt,Jy=new gt;class XS extends Xt{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new jl(t);i.rotateY(.5*Math.PI),this.material=new Kn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const o=i.getAttribute("position"),s=new Float32Array(3*o.count);i.setAttribute("color",new Zt(s,3)),this.add(new ln(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Zy.copy(this.light.color),Jy.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const o=n<i/2?Zy:Jy;t.setXYZ(n,o.r,o.g,o.b)}t.needsUpdate=!0}e.lookAt(WS.setFromMatrixPosition(this.light.matrixWorld).negate())}}class $y extends E{constructor(e=10,t=10,n=4473924,i=8947848){n=new gt(n),i=new gt(i);const o=t/2,s=e/t,a=e/2,l=[],u=[];for(let d=0,f=0,m=-a;d<=t;d++,m+=s){l.push(-a,0,m,a,0,m),l.push(m,0,-a,m,0,a);const g=d===o?n:i;g.toArray(u,f),f+=3,g.toArray(u,f),f+=3,g.toArray(u,f),f+=3,g.toArray(u,f),f+=3}const c=new Mt;c.setAttribute("position",new st(l,3)),c.setAttribute("color",new st(u,3)),super(c,new yi({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class YS extends E{constructor(e=10,t=16,n=8,i=64,o=4473924,s=8947848){o=new gt(o),s=new gt(s);const a=[],l=[];for(let c=0;c<=t;c++){const d=c/t*(2*Math.PI),f=Math.sin(d)*e,m=Math.cos(d)*e;a.push(0,0,0),a.push(f,0,m);const g=1&c?o:s;l.push(g.r,g.g,g.b),l.push(g.r,g.g,g.b)}for(let c=0;c<=n;c++){const d=1&c?o:s,f=e-e/n*c;for(let m=0;m<i;m++){let g=m/i*(2*Math.PI),_=Math.sin(g)*f,y=Math.cos(g)*f;a.push(_,0,y),l.push(d.r,d.g,d.b),g=(m+1)/i*(2*Math.PI),_=Math.sin(g)*f,y=Math.cos(g)*f,a.push(_,0,y),l.push(d.r,d.g,d.b)}}const u=new Mt;u.setAttribute("position",new st(a,3)),u.setAttribute("color",new st(l,3)),super(u,new yi({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const Ky=new T,cm=new T,Qy=new T;class qS extends Xt{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,t===void 0&&(t=1);let i=new Mt;i.setAttribute("position",new st([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const o=new yi({fog:!1,toneMapped:!1});this.lightPlane=new h(i,o),this.add(this.lightPlane),i=new Mt,i.setAttribute("position",new st([0,0,0,0,0,1],3)),this.targetLine=new h(i,o),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Ky.setFromMatrixPosition(this.light.matrixWorld),cm.setFromMatrixPosition(this.light.target.matrixWorld),Qy.subVectors(cm,Ky),this.lightPlane.lookAt(cm),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(cm),this.targetLine.scale.z=Qy.length()}}const dm=new T,ii=new zs;class ZS extends E{constructor(e){const t=new Mt,n=new yi({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],o=[],s={},a=new gt(16755200),l=new gt(16711680),u=new gt(43775),c=new gt(16777215),d=new gt(3355443);function f(g,_,y){m(g,y),m(_,y)}function m(g,_){i.push(0,0,0),o.push(_.r,_.g,_.b),s[g]===void 0&&(s[g]=[]),s[g].push(i.length/3-1)}f("n1","n2",a),f("n2","n4",a),f("n4","n3",a),f("n3","n1",a),f("f1","f2",a),f("f2","f4",a),f("f4","f3",a),f("f3","f1",a),f("n1","f1",a),f("n2","f2",a),f("n3","f3",a),f("n4","f4",a),f("p","n1",l),f("p","n2",l),f("p","n3",l),f("p","n4",l),f("u1","u2",u),f("u2","u3",u),f("u3","u1",u),f("c","t",c),f("p","c",d),f("cn1","cn2",d),f("cn3","cn4",d),f("cf1","cf2",d),f("cf3","cf4",d),t.setAttribute("position",new st(i,3)),t.setAttribute("color",new st(o,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){const e=this.geometry,t=this.pointMap;ii.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),di("c",t,e,ii,0,0,-1),di("t",t,e,ii,0,0,1),di("n1",t,e,ii,-1,-1,-1),di("n2",t,e,ii,1,-1,-1),di("n3",t,e,ii,-1,1,-1),di("n4",t,e,ii,1,1,-1),di("f1",t,e,ii,-1,-1,1),di("f2",t,e,ii,1,-1,1),di("f3",t,e,ii,-1,1,1),di("f4",t,e,ii,1,1,1),di("u1",t,e,ii,.7,1.1,-1),di("u2",t,e,ii,-.7,1.1,-1),di("u3",t,e,ii,0,2,-1),di("cf1",t,e,ii,-1,0,1),di("cf2",t,e,ii,1,0,1),di("cf3",t,e,ii,0,-1,1),di("cf4",t,e,ii,0,1,1),di("cn1",t,e,ii,-1,0,-1),di("cn2",t,e,ii,1,0,-1),di("cn3",t,e,ii,0,-1,-1),di("cn4",t,e,ii,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function di(r,e,t,n,i,o,s){dm.set(i,o,s).unproject(n);const a=e[r];if(a!==void 0){const l=t.getAttribute("position");for(let u=0,c=a.length;u<c;u++)l.setXYZ(a[u],dm.x,dm.y,dm.z)}}const pm=new In;class ex extends E{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),o=new Mt;o.setIndex(new Zt(n,1)),o.setAttribute("position",new Zt(i,3)),super(o,new yi({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&pm.setFromObject(this.object),pm.isEmpty())return;const t=pm.min,n=pm.max,i=this.geometry.attributes.position,o=i.array;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=t.x,o[4]=n.y,o[5]=n.z,o[6]=t.x,o[7]=t.y,o[8]=n.z,o[9]=n.x,o[10]=t.y,o[11]=n.z,o[12]=n.x,o[13]=n.y,o[14]=t.z,o[15]=t.x,o[16]=n.y,o[17]=t.z,o[18]=t.x,o[19]=t.y,o[20]=t.z,o[21]=n.x,o[22]=t.y,o[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return E.prototype.copy.call(this,e),this.object=e.object,this}}class JS extends E{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Mt;i.setIndex(new Zt(n,1)),i.setAttribute("position",new st([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new yi({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class $S extends h{constructor(e,t=1,n=16776960){const i=n,o=new Mt;o.setAttribute("position",new st([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),o.computeBoundingSphere(),super(o,new yi({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new Mt;s.setAttribute("position",new st([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new ln(s,new Kn({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?W:z,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const tx=new T;let fm,Fv;class KS extends Xt{constructor(e=new T(0,0,1),t=new T(0,0,0),n=1,i=16776960,o=.2*n,s=.2*o){super(),this.type="ArrowHelper",fm===void 0&&(fm=new Mt,fm.setAttribute("position",new st([0,0,0,0,1,0],3)),Fv=new Et(0,.5,1,5,1),Fv.translate(0,-.5,0)),this.position.copy(t),this.line=new h(fm,new yi({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ln(Fv,new Kn({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,o,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{tx.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(tx,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class nx extends E{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new Mt;n.setAttribute("position",new st(t,3)),n.setAttribute("color",new st([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(n,new yi({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const i=new gt,o=this.geometry.attributes.color.array;return i.set(e),i.toArray(o,0),i.toArray(o,3),i.set(t),i.toArray(o,6),i.toArray(o,9),i.set(n),i.toArray(o,12),i.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const ix=new Float32Array(1),QS=new Int32Array(ix.buffer);class eE{static toHalfFloat(e){ix[0]=e;const t=QS[0];let n=t>>16&32768,i=t>>12&2047;const o=t>>23&255;return o<103?n:o>142?(n|=31744,n|=(o==255?0:1)&&8388607&t,n):o<113?(i|=2048,n|=(i>>114-o)+(i>>113-o&1),n):(n|=o-112<<10|i>>1,n+=1&i,n)}}const as=Math.pow(2,8),rx=[.125,.215,.35,.446,.526,.582],ox=5+rx.length,ls={[wt]:0,[$t]:1,[nr]:2,[ml]:3,[Ic]:4,[Xi]:5,[zn]:6},tu=new Kn({side:W,depthWrite:!1,depthTest:!1}),tE=new ln(new Qr,tu),Bv=new jh,{_lodPlanes:Rd,_sizeLods:sx,_sigmas:mm}=rE(),ax=new gt;let Uv=null;const nu=(1+Math.sqrt(5))/2,Xh=1/nu,lx=[new T(1,1,1),new T(-1,1,1),new T(1,1,-1),new T(-1,1,-1),new T(0,nu,Xh),new T(0,nu,-Xh),new T(Xh,0,nu),new T(-Xh,0,nu),new T(nu,Xh,0),new T(-nu,Xh,0)];function ux(r){const e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class nE{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const n=new Float32Array(t),i=new T(0,1,0);return new zh({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:ls[wt]},outputEncoding:{value:ls[wt]}},vertexShader:kv(),fragmentShader:`
|
|
2976
|
+
}`}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new Mt;g.setAttribute("position",new Zt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new ln(g,f),y=this;function w(U,N){const G=e.update(_);f.uniforms.shadow_pass.value=U.map.texture,f.uniforms.resolution.value=U.mapSize,f.uniforms.radius.value=U.radius,r.setRenderTarget(U.mapPass),r.clear(),r.renderBufferDirect(N,null,G,f,_,null),m.uniforms.shadow_pass.value=U.mapPass.texture,m.uniforms.resolution.value=U.mapSize,m.uniforms.radius.value=U.radius,r.setRenderTarget(U.map),r.clear(),r.renderBufferDirect(N,null,G,m,_,null)}function M(U){const N=U<<0;let G=a[N];return G===void 0&&(G=new on({depthPacking:Lc,morphTargets:U}),a[N]=G),G}function I(U){const N=U<<0;let G=l[N];return G===void 0&&(G=new bh({morphTargets:U}),l[N]=G),G}function F(U,N,G,he,ne,Z,Q){let $=null,se=M,me=U.customDepthMaterial;if(he.isPointLight===!0&&(se=I,me=U.customDistanceMaterial),me===void 0){let ge=!1;G.morphTargets===!0&&(ge=N.morphAttributes&&N.morphAttributes.position&&N.morphAttributes.position.length>0),$=se(ge)}else $=me;if(r.localClippingEnabled&&G.clipShadows===!0&&G.clippingPlanes.length!==0){const ge=$.uuid,de=G.uuid;let fe=u[ge];fe===void 0&&(fe={},u[ge]=fe);let Re=fe[de];Re===void 0&&(Re=$.clone(),fe[de]=Re),$=Re}return $.visible=G.visible,$.wireframe=G.wireframe,$.side=Q===D?G.shadowSide!==null?G.shadowSide:G.side:G.shadowSide!==null?G.shadowSide:d[G.side],$.clipShadows=G.clipShadows,$.clippingPlanes=G.clippingPlanes,$.clipIntersection=G.clipIntersection,$.wireframeLinewidth=G.wireframeLinewidth,$.linewidth=G.linewidth,he.isPointLight===!0&&$.isMeshDistanceMaterial===!0&&($.referencePosition.setFromMatrixPosition(he.matrixWorld),$.nearDistance=ne,$.farDistance=Z),$}function R(U,N,G,he,ne){if(U.visible===!1)return;if(U.layers.test(N.layers)&&(U.isMesh||U.isLine||U.isPoints)&&(U.castShadow||U.receiveShadow&&ne===D)&&(!U.frustumCulled||n.intersectsObject(U))){U.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,U.matrixWorld);const Q=e.update(U),$=U.material;if(Array.isArray($)){const se=Q.groups;for(let me=0,ge=se.length;me<ge;me++){const de=se[me],fe=$[de.materialIndex];if(fe&&fe.visible){const Re=F(U,Q,fe,he,G.near,G.far,ne);r.renderBufferDirect(G,null,Q,Re,U,de)}}}else if($.visible){const se=F(U,Q,$,he,G.near,G.far,ne);r.renderBufferDirect(G,null,Q,se,U,null)}}const Z=U.children;for(let Q=0,$=Z.length;Q<$;Q++)R(Z[Q],N,G,he,ne)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=O,this.render=function(U,N,G){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||U.length===0)return;const he=r.getRenderTarget(),ne=r.getActiveCubeFace(),Z=r.getActiveMipmapLevel(),Q=r.state;Q.setBlending($e),Q.buffers.color.setClear(1,1,1,1),Q.buffers.depth.setTest(!0),Q.setScissorTest(!1);for(let $=0,se=U.length;$<se;$++){const me=U[$],ge=me.shadow;if(ge===void 0){console.warn("THREE.WebGLShadowMap:",me,"has no shadow.");continue}if(ge.autoUpdate===!1&&ge.needsUpdate===!1)continue;i.copy(ge.mapSize);const de=ge.getFrameExtents();if(i.multiply(de),o.copy(ge.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/de.x),i.x=o.x*de.x,ge.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/de.y),i.y=o.y*de.y,ge.mapSize.y=o.y)),ge.map===null&&!ge.isPointLightShadow&&this.type===D){const Re={minFilter:Jn,magFilter:Jn,format:er};ge.map=new Ir(i.x,i.y,Re),ge.map.texture.name=me.name+".shadowMap",ge.mapPass=new Ir(i.x,i.y,Re),ge.camera.updateProjectionMatrix()}if(ge.map===null){const Re={minFilter:Zn,magFilter:Zn,format:er};ge.map=new Ir(i.x,i.y,Re),ge.map.texture.name=me.name+".shadowMap",ge.camera.updateProjectionMatrix()}r.setRenderTarget(ge.map),r.clear();const fe=ge.getViewportCount();for(let Re=0;Re<fe;Re++){const ke=ge.getViewport(Re);s.set(o.x*ke.x,o.y*ke.y,o.x*ke.z,o.y*ke.w),Q.viewport(s),ge.updateMatrices(me,Re),n=ge.getFrustum(),R(N,G,ge.camera,me,this.type)}ge.isPointLightShadow||this.type!==D||w(ge,G),ge.needsUpdate=!1}y.needsUpdate=!1,r.setRenderTarget(he,ne,Z)}}function wh(r,e,t){const n=t.isWebGL2,i=new function(){let Y=!1;const pe=new pn;let ye=null;const xe=new pn(0,0,0,0);return{setMask:function(De){ye===De||Y||(r.colorMask(De,De,De,De),ye=De)},setLocked:function(De){Y=De},setClear:function(De,ht,xt,_t,Gt){Gt===!0&&(De*=_t,ht*=_t,xt*=_t),pe.set(De,ht,xt,_t),xe.equals(pe)===!1&&(r.clearColor(De,ht,xt,_t),xe.copy(pe))},reset:function(){Y=!1,ye=null,xe.set(-1,0,0,0)}}},o=new function(){let Y=!1,pe=null,ye=null,xe=null;return{setTest:function(De){De?Be(2929):J(2929)},setMask:function(De){pe===De||Y||(r.depthMask(De),pe=De)},setFunc:function(De){if(ye!==De){if(De)switch(De){case qn:r.depthFunc(512);break;case yn:r.depthFunc(519);break;case ai:r.depthFunc(513);break;case Fi:r.depthFunc(515);break;case Pi:r.depthFunc(514);break;case Vi:r.depthFunc(518);break;case Rr:r.depthFunc(516);break;case Mp:r.depthFunc(517);break;default:r.depthFunc(515)}else r.depthFunc(515);ye=De}},setLocked:function(De){Y=De},setClear:function(De){xe!==De&&(r.clearDepth(De),xe=De)},reset:function(){Y=!1,pe=null,ye=null,xe=null}}},s=new function(){let Y=!1,pe=null,ye=null,xe=null,De=null,ht=null,xt=null,_t=null,Gt=null;return{setTest:function(Wt){Y||(Wt?Be(2960):J(2960))},setMask:function(Wt){pe===Wt||Y||(r.stencilMask(Wt),pe=Wt)},setFunc:function(Wt,si,Cn){ye===Wt&&xe===si&&De===Cn||(r.stencilFunc(Wt,si,Cn),ye=Wt,xe=si,De=Cn)},setOp:function(Wt,si,Cn){ht===Wt&&xt===si&&_t===Cn||(r.stencilOp(Wt,si,Cn),ht=Wt,xt=si,_t=Cn)},setLocked:function(Wt){Y=Wt},setClear:function(Wt){Gt!==Wt&&(r.clearStencil(Wt),Gt=Wt)},reset:function(){Y=!1,pe=null,ye=null,xe=null,De=null,ht=null,xt=null,_t=null,Gt=null}}};let a={},l=null,u={},c=null,d=!1,f=null,m=null,g=null,_=null,y=null,w=null,M=null,I=!1,F=null,R=null,U=null,N=null,G=null;const he=r.getParameter(35661);let ne=!1,Z=0;const Q=r.getParameter(7938);Q.indexOf("WebGL")!==-1?(Z=parseFloat(/^WebGL (\d)/.exec(Q)[1]),ne=Z>=1):Q.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),ne=Z>=2);let $=null,se={};const me=r.getParameter(3088),ge=r.getParameter(2978),de=new pn().fromArray(me),fe=new pn().fromArray(ge);function Re(Y,pe,ye){const xe=new Uint8Array(4),De=r.createTexture();r.bindTexture(Y,De),r.texParameteri(Y,10241,9728),r.texParameteri(Y,10240,9728);for(let ht=0;ht<ye;ht++)r.texImage2D(pe+ht,0,6408,1,1,0,6408,5121,xe);return De}const ke={};function Be(Y){a[Y]!==!0&&(r.enable(Y),a[Y]=!0)}function J(Y){a[Y]!==!1&&(r.disable(Y),a[Y]=!1)}ke[3553]=Re(3553,3553,1),ke[34067]=Re(34067,34069,6),i.setClear(0,0,0,1),o.setClear(1),s.setClear(0),Be(2929),o.setFunc(Fi),Te(!1),Ge(Xe),Be(2884),Ne($e);const te={[Me]:32774,[Oe]:32778,[Se]:32779};if(n)te[Ue]=32775,te[qe]=32776;else{const Y=e.get("EXT_blend_minmax");Y!==null&&(te[Ue]=Y.MIN_EXT,te[qe]=Y.MAX_EXT)}const Ae={[at]:0,[rt]:1,[Qt]:768,[en]:770,[gn]:776,[Dn]:774,[Vt]:772,[lt]:769,[Bt]:771,[wn]:775,[bt]:773};function Ne(Y,pe,ye,xe,De,ht,xt,_t){if(Y!==$e){if(d===!1&&(Be(3042),d=!0),Y===be)De=De||pe,ht=ht||ye,xt=xt||xe,pe===m&&De===y||(r.blendEquationSeparate(te[pe],te[De]),m=pe,y=De),ye===g&&xe===_&&ht===w&&xt===M||(r.blendFuncSeparate(Ae[ye],Ae[xe],Ae[ht],Ae[xt]),g=ye,_=xe,w=ht,M=xt),f=Y,I=null;else if(Y!==f||_t!==I){if(m===Me&&y===Me||(r.blendEquation(32774),m=Me,y=Me),_t)switch(Y){case ae:r.blendFuncSeparate(1,771,1,771);break;case Ce:r.blendFunc(1,1);break;case Ie:r.blendFuncSeparate(0,0,769,771);break;case H:r.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",Y)}else switch(Y){case ae:r.blendFuncSeparate(770,771,1,771);break;case Ce:r.blendFunc(770,1);break;case Ie:r.blendFunc(0,769);break;case H:r.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",Y)}g=null,_=null,w=null,M=null,f=Y,I=_t}}else d===!0&&(J(3042),d=!1)}function Te(Y){F!==Y&&(Y?r.frontFace(2304):r.frontFace(2305),F=Y)}function Ge(Y){Y!==Ee?(Be(2884),Y!==R&&(Y===Xe?r.cullFace(1029):Y===Fe?r.cullFace(1028):r.cullFace(1032))):J(2884),R=Y}function Ye(Y,pe,ye){Y?(Be(32823),N===pe&&G===ye||(r.polygonOffset(pe,ye),N=pe,G=ye)):J(32823)}function ve(Y){Y===void 0&&(Y=33984+he-1),$!==Y&&(r.activeTexture(Y),$=Y)}return{buffers:{color:i,depth:o,stencil:s},enable:Be,disable:J,bindFramebuffer:function(Y,pe){return pe===null&&l!==null&&(pe=l),u[Y]!==pe&&(r.bindFramebuffer(Y,pe),u[Y]=pe,n&&(Y===36009&&(u[36160]=pe),Y===36160&&(u[36009]=pe)),!0)},bindXRFramebuffer:function(Y){Y!==l&&(r.bindFramebuffer(36160,Y),l=Y)},useProgram:function(Y){return c!==Y&&(r.useProgram(Y),c=Y,!0)},setBlending:Ne,setMaterial:function(Y,pe){Y.side===ee?J(2884):Be(2884);let ye=Y.side===W;pe&&(ye=!ye),Te(ye),Y.blending===ae&&Y.transparent===!1?Ne($e):Ne(Y.blending,Y.blendEquation,Y.blendSrc,Y.blendDst,Y.blendEquationAlpha,Y.blendSrcAlpha,Y.blendDstAlpha,Y.premultipliedAlpha),o.setFunc(Y.depthFunc),o.setTest(Y.depthTest),o.setMask(Y.depthWrite),i.setMask(Y.colorWrite);const xe=Y.stencilWrite;s.setTest(xe),xe&&(s.setMask(Y.stencilWriteMask),s.setFunc(Y.stencilFunc,Y.stencilRef,Y.stencilFuncMask),s.setOp(Y.stencilFail,Y.stencilZFail,Y.stencilZPass)),Ye(Y.polygonOffset,Y.polygonOffsetFactor,Y.polygonOffsetUnits),Y.alphaToCoverage===!0?Be(32926):J(32926)},setFlipSided:Te,setCullFace:Ge,setLineWidth:function(Y){Y!==U&&(ne&&r.lineWidth(Y),U=Y)},setPolygonOffset:Ye,setScissorTest:function(Y){Y?Be(3089):J(3089)},activeTexture:ve,bindTexture:function(Y,pe){$===null&&ve();let ye=se[$];ye===void 0&&(ye={type:void 0,texture:void 0},se[$]=ye),ye.type===Y&&ye.texture===pe||(r.bindTexture(Y,pe||ke[Y]),ye.type=Y,ye.texture=pe)},unbindTexture:function(){const Y=se[$];Y!==void 0&&Y.type!==void 0&&(r.bindTexture(Y.type,null),Y.type=void 0,Y.texture=void 0)},compressedTexImage2D:function(){try{r.compressedTexImage2D.apply(r,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},texImage2D:function(){try{r.texImage2D.apply(r,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},texImage3D:function(){try{r.texImage3D.apply(r,arguments)}catch(Y){console.error("THREE.WebGLState:",Y)}},scissor:function(Y){de.equals(Y)===!1&&(r.scissor(Y.x,Y.y,Y.z,Y.w),de.copy(Y))},viewport:function(Y){fe.equals(Y)===!1&&(r.viewport(Y.x,Y.y,Y.z,Y.w),fe.copy(Y))},reset:function(){r.disable(3042),r.disable(2884),r.disable(2929),r.disable(32823),r.disable(3089),r.disable(2960),r.disable(32926),r.blendEquation(32774),r.blendFunc(1,0),r.blendFuncSeparate(1,0,1,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(513),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(519,0,4294967295),r.stencilOp(7680,7680,7680),r.clearStencil(0),r.cullFace(1029),r.frontFace(2305),r.polygonOffset(0,0),r.activeTexture(33984),r.bindFramebuffer(36160,null),n===!0&&(r.bindFramebuffer(36009,null),r.bindFramebuffer(36008,null)),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),a={},$=null,se={},l=null,u={},c=null,d=!1,f=null,m=null,g=null,_=null,y=null,w=null,M=null,I=!1,F=null,R=null,U=null,N=null,G=null,de.set(0,0,r.canvas.width,r.canvas.height),fe.set(0,0,r.canvas.width,r.canvas.height),i.reset(),o.reset(),s.reset()}}}function iv(r,e,t,n,i,o,s){const a=i.isWebGL2,l=i.maxTextures,u=i.maxCubemapSize,c=i.maxTextureSize,d=i.maxSamples,f=new WeakMap;let m,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(J,te){return g?new OffscreenCanvas(J,te):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(J,te,Ae,Ne){let Te=1;if((J.width>Ne||J.height>Ne)&&(Te=Ne/Math.max(J.width,J.height)),Te<1||te===!0){if(typeof HTMLImageElement!="undefined"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&J instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&J instanceof ImageBitmap){const Ge=te?Qu:Math.floor,Ye=Ge(Te*J.width),ve=Ge(Te*J.height);m===void 0&&(m=_(Ye,ve));const Y=Ae?_(Ye,ve):m;return Y.width=Ye,Y.height=ve,Y.getContext("2d").drawImage(J,0,0,Ye,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+Ye+"x"+ve+")."),Y}return"data"in J&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),J}return J}function w(J){return xl(J.width)&&xl(J.height)}function M(J,te){return J.generateMipmaps&&te&&J.minFilter!==Zn&&J.minFilter!==Jn}function I(J,te,Ae,Ne,Te=1){r.generateMipmap(J),n.get(te).__maxMipLevel=Math.log2(Math.max(Ae,Ne,Te))}function F(J,te,Ae){if(a===!1)return te;if(J!==null){if(r[J]!==void 0)return r[J];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+J+"'")}let Ne=te;return te===6403&&(Ae===5126&&(Ne=33326),Ae===5131&&(Ne=33325),Ae===5121&&(Ne=33321)),te===6407&&(Ae===5126&&(Ne=34837),Ae===5131&&(Ne=34843),Ae===5121&&(Ne=32849)),te===6408&&(Ae===5126&&(Ne=34836),Ae===5131&&(Ne=34842),Ae===5121&&(Ne=32856)),Ne!==33325&&Ne!==33326&&Ne!==34842&&Ne!==34836||e.get("EXT_color_buffer_float"),Ne}function R(J){return J===Zn||J===ul||J===hl?9728:9729}function U(J){const te=J.target;te.removeEventListener("dispose",U),function(Ae){const Ne=n.get(Ae);Ne.__webglInit!==void 0&&(r.deleteTexture(Ne.__webglTexture),n.remove(Ae))}(te),te.isVideoTexture&&f.delete(te),s.memory.textures--}function N(J){const te=J.target;te.removeEventListener("dispose",N),function(Ae){const Ne=Ae.texture,Te=n.get(Ae),Ge=n.get(Ne);if(!!Ae){if(Ge.__webglTexture!==void 0&&(r.deleteTexture(Ge.__webglTexture),s.memory.textures--),Ae.depthTexture&&Ae.depthTexture.dispose(),Ae.isWebGLCubeRenderTarget)for(let Ye=0;Ye<6;Ye++)r.deleteFramebuffer(Te.__webglFramebuffer[Ye]),Te.__webglDepthbuffer&&r.deleteRenderbuffer(Te.__webglDepthbuffer[Ye]);else r.deleteFramebuffer(Te.__webglFramebuffer),Te.__webglDepthbuffer&&r.deleteRenderbuffer(Te.__webglDepthbuffer),Te.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Te.__webglMultisampledFramebuffer),Te.__webglColorRenderbuffer&&r.deleteRenderbuffer(Te.__webglColorRenderbuffer),Te.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Te.__webglDepthRenderbuffer);if(Ae.isWebGLMultipleRenderTargets)for(let Ye=0,ve=Ne.length;Ye<ve;Ye++){const Y=n.get(Ne[Ye]);Y.__webglTexture&&(r.deleteTexture(Y.__webglTexture),s.memory.textures--),n.remove(Ne[Ye])}n.remove(Ne),n.remove(Ae)}}(te)}let G=0;function he(J,te){const Ae=n.get(J);if(J.isVideoTexture&&function(Ne){const Te=s.render.frame;f.get(Ne)!==Te&&(f.set(Ne,Te),Ne.update())}(J),J.version>0&&Ae.__version!==J.version){const Ne=J.image;if(Ne===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Ne.complete!==!1)return void me(Ae,J,te);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}t.activeTexture(33984+te),t.bindTexture(3553,Ae.__webglTexture)}function ne(J,te){const Ae=n.get(J);J.version>0&&Ae.__version!==J.version?function(Ne,Te,Ge){if(Te.image.length!==6)return;se(Ne,Te),t.activeTexture(33984+Ge),t.bindTexture(34067,Ne.__webglTexture),r.pixelStorei(37440,Te.flipY),r.pixelStorei(37441,Te.premultiplyAlpha),r.pixelStorei(3317,Te.unpackAlignment),r.pixelStorei(37443,0);const Ye=Te&&(Te.isCompressedTexture||Te.image[0].isCompressedTexture),ve=Te.image[0]&&Te.image[0].isDataTexture,Y=[];for(let _t=0;_t<6;_t++)Y[_t]=Ye||ve?ve?Te.image[_t].image:Te.image[_t]:y(Te.image[_t],!1,!0,u);const pe=Y[0],ye=w(pe)||a,xe=o.convert(Te.format),De=o.convert(Te.type),ht=F(Te.internalFormat,xe,De);let xt;if($(34067,Te,ye),Ye){for(let _t=0;_t<6;_t++){xt=Y[_t].mipmaps;for(let Gt=0;Gt<xt.length;Gt++){const Wt=xt[Gt];Te.format!==er&&Te.format!==co?xe!==null?t.compressedTexImage2D(34069+_t,Gt,ht,Wt.width,Wt.height,0,Wt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+_t,Gt,ht,Wt.width,Wt.height,0,xe,De,Wt.data)}}Ne.__maxMipLevel=xt.length-1}else{xt=Te.mipmaps;for(let _t=0;_t<6;_t++)if(ve){t.texImage2D(34069+_t,0,ht,Y[_t].width,Y[_t].height,0,xe,De,Y[_t].data);for(let Gt=0;Gt<xt.length;Gt++){const Wt=xt[Gt].image[_t].image;t.texImage2D(34069+_t,Gt+1,ht,Wt.width,Wt.height,0,xe,De,Wt.data)}}else{t.texImage2D(34069+_t,0,ht,xe,De,Y[_t]);for(let Gt=0;Gt<xt.length;Gt++){const Wt=xt[Gt];t.texImage2D(34069+_t,Gt+1,ht,xe,De,Wt.image[_t])}}Ne.__maxMipLevel=xt.length}M(Te,ye)&&I(34067,Te,pe.width,pe.height),Ne.__version=Te.version,Te.onUpdate&&Te.onUpdate(Te)}(Ae,J,te):(t.activeTexture(33984+te),t.bindTexture(34067,Ae.__webglTexture))}const Z={[Go]:10497,[mi]:33071,[ll]:33648},Q={[Zn]:9728,[ul]:9984,[hl]:9986,[Jn]:9729,[Ho]:9985,[Ts]:9987};function $(J,te,Ae){if(Ae?(r.texParameteri(J,10242,Z[te.wrapS]),r.texParameteri(J,10243,Z[te.wrapT]),J!==32879&&J!==35866||r.texParameteri(J,32882,Z[te.wrapR]),r.texParameteri(J,10240,Q[te.magFilter]),r.texParameteri(J,10241,Q[te.minFilter])):(r.texParameteri(J,10242,33071),r.texParameteri(J,10243,33071),J!==32879&&J!==35866||r.texParameteri(J,32882,33071),te.wrapS===mi&&te.wrapT===mi||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(J,10240,R(te.magFilter)),r.texParameteri(J,10241,R(te.minFilter)),te.minFilter!==Zn&&te.minFilter!==Jn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Ne=e.get("EXT_texture_filter_anisotropic");if(te.type===ho&&e.has("OES_texture_float_linear")===!1||a===!1&&te.type===Es&&e.has("OES_texture_half_float_linear")===!1)return;(te.anisotropy>1||n.get(te).__currentAnisotropy)&&(r.texParameterf(J,Ne.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(te.anisotropy,i.getMaxAnisotropy())),n.get(te).__currentAnisotropy=te.anisotropy)}}function se(J,te){J.__webglInit===void 0&&(J.__webglInit=!0,te.addEventListener("dispose",U),J.__webglTexture=r.createTexture(),s.memory.textures++)}function me(J,te,Ae){let Ne=3553;te.isDataTexture2DArray&&(Ne=35866),te.isDataTexture3D&&(Ne=32879),se(J,te),t.activeTexture(33984+Ae),t.bindTexture(Ne,J.__webglTexture),r.pixelStorei(37440,te.flipY),r.pixelStorei(37441,te.premultiplyAlpha),r.pixelStorei(3317,te.unpackAlignment),r.pixelStorei(37443,0);const Te=function(De){return!a&&(De.wrapS!==mi||De.wrapT!==mi||De.minFilter!==Zn&&De.minFilter!==Jn)}(te)&&w(te.image)===!1,Ge=y(te.image,Te,!1,c),Ye=w(Ge)||a,ve=o.convert(te.format);let Y,pe=o.convert(te.type),ye=F(te.internalFormat,ve,pe);$(Ne,te,Ye);const xe=te.mipmaps;if(te.isDepthTexture)ye=6402,a?ye=te.type===ho?36012:te.type===Ss?33190:te.type===dn?35056:33189:te.type===ho&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),te.format===Nn&&ye===6402&&te.type!==cl&&te.type!==Ss&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),te.type=cl,pe=o.convert(te.type)),te.format===Ms&&ye===6402&&(ye=34041,te.type!==dn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),te.type=dn,pe=o.convert(te.type))),t.texImage2D(3553,0,ye,Ge.width,Ge.height,0,ve,pe,null);else if(te.isDataTexture)if(xe.length>0&&Ye){for(let De=0,ht=xe.length;De<ht;De++)Y=xe[De],t.texImage2D(3553,De,ye,Y.width,Y.height,0,ve,pe,Y.data);te.generateMipmaps=!1,J.__maxMipLevel=xe.length-1}else t.texImage2D(3553,0,ye,Ge.width,Ge.height,0,ve,pe,Ge.data),J.__maxMipLevel=0;else if(te.isCompressedTexture){for(let De=0,ht=xe.length;De<ht;De++)Y=xe[De],te.format!==er&&te.format!==co?ve!==null?t.compressedTexImage2D(3553,De,ye,Y.width,Y.height,0,Y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,De,ye,Y.width,Y.height,0,ve,pe,Y.data);J.__maxMipLevel=xe.length-1}else if(te.isDataTexture2DArray)t.texImage3D(35866,0,ye,Ge.width,Ge.height,Ge.depth,0,ve,pe,Ge.data),J.__maxMipLevel=0;else if(te.isDataTexture3D)t.texImage3D(32879,0,ye,Ge.width,Ge.height,Ge.depth,0,ve,pe,Ge.data),J.__maxMipLevel=0;else if(xe.length>0&&Ye){for(let De=0,ht=xe.length;De<ht;De++)Y=xe[De],t.texImage2D(3553,De,ye,ve,pe,Y);te.generateMipmaps=!1,J.__maxMipLevel=xe.length-1}else t.texImage2D(3553,0,ye,ve,pe,Ge),J.__maxMipLevel=0;M(te,Ye)&&I(Ne,te,Ge.width,Ge.height),J.__version=te.version,te.onUpdate&&te.onUpdate(te)}function ge(J,te,Ae,Ne,Te){const Ge=o.convert(Ae.format),Ye=o.convert(Ae.type),ve=F(Ae.internalFormat,Ge,Ye);Te===32879||Te===35866?t.texImage3D(Te,0,ve,te.width,te.height,te.depth,0,Ge,Ye,null):t.texImage2D(Te,0,ve,te.width,te.height,0,Ge,Ye,null),t.bindFramebuffer(36160,J),r.framebufferTexture2D(36160,Ne,Te,n.get(Ae).__webglTexture,0),t.bindFramebuffer(36160,null)}function de(J,te,Ae){if(r.bindRenderbuffer(36161,J),te.depthBuffer&&!te.stencilBuffer){let Ne=33189;if(Ae){const Te=te.depthTexture;Te&&Te.isDepthTexture&&(Te.type===ho?Ne=36012:Te.type===Ss&&(Ne=33190));const Ge=Re(te);r.renderbufferStorageMultisample(36161,Ge,Ne,te.width,te.height)}else r.renderbufferStorage(36161,Ne,te.width,te.height);r.framebufferRenderbuffer(36160,36096,36161,J)}else if(te.depthBuffer&&te.stencilBuffer){if(Ae){const Ne=Re(te);r.renderbufferStorageMultisample(36161,Ne,35056,te.width,te.height)}else r.renderbufferStorage(36161,34041,te.width,te.height);r.framebufferRenderbuffer(36160,33306,36161,J)}else{const Ne=te.isWebGLMultipleRenderTargets===!0?te.texture[0]:te.texture,Te=o.convert(Ne.format),Ge=o.convert(Ne.type),Ye=F(Ne.internalFormat,Te,Ge);if(Ae){const ve=Re(te);r.renderbufferStorageMultisample(36161,ve,Ye,te.width,te.height)}else r.renderbufferStorage(36161,Ye,te.width,te.height)}r.bindRenderbuffer(36161,null)}function fe(J){const te=n.get(J),Ae=J.isWebGLCubeRenderTarget===!0;if(J.depthTexture){if(Ae)throw new Error("target.depthTexture not supported in Cube render targets");(function(Ne,Te){if(Te&&Te.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,Ne),!Te.depthTexture||!Te.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(Te.depthTexture).__webglTexture&&Te.depthTexture.image.width===Te.width&&Te.depthTexture.image.height===Te.height||(Te.depthTexture.image.width=Te.width,Te.depthTexture.image.height=Te.height,Te.depthTexture.needsUpdate=!0),he(Te.depthTexture,0);const Ge=n.get(Te.depthTexture).__webglTexture;if(Te.depthTexture.format===Nn)r.framebufferTexture2D(36160,36096,3553,Ge,0);else{if(Te.depthTexture.format!==Ms)throw new Error("Unknown depthTexture format");r.framebufferTexture2D(36160,33306,3553,Ge,0)}})(te.__webglFramebuffer,J)}else if(Ae){te.__webglDepthbuffer=[];for(let Ne=0;Ne<6;Ne++)t.bindFramebuffer(36160,te.__webglFramebuffer[Ne]),te.__webglDepthbuffer[Ne]=r.createRenderbuffer(),de(te.__webglDepthbuffer[Ne],J,!1)}else t.bindFramebuffer(36160,te.__webglFramebuffer),te.__webglDepthbuffer=r.createRenderbuffer(),de(te.__webglDepthbuffer,J,!1);t.bindFramebuffer(36160,null)}function Re(J){return a&&J.isWebGLMultisampleRenderTarget?Math.min(d,J.samples):0}let ke=!1,Be=!1;this.allocateTextureUnit=function(){const J=G;return J>=l&&console.warn("THREE.WebGLTextures: Trying to use "+J+" texture units while this GPU supports only "+l),G+=1,J},this.resetTextureUnits=function(){G=0},this.setTexture2D=he,this.setTexture2DArray=function(J,te){const Ae=n.get(J);J.version>0&&Ae.__version!==J.version?me(Ae,J,te):(t.activeTexture(33984+te),t.bindTexture(35866,Ae.__webglTexture))},this.setTexture3D=function(J,te){const Ae=n.get(J);J.version>0&&Ae.__version!==J.version?me(Ae,J,te):(t.activeTexture(33984+te),t.bindTexture(32879,Ae.__webglTexture))},this.setTextureCube=ne,this.setupRenderTarget=function(J){const te=J.texture,Ae=n.get(J),Ne=n.get(te);J.addEventListener("dispose",N),J.isWebGLMultipleRenderTargets!==!0&&(Ne.__webglTexture=r.createTexture(),Ne.__version=te.version,s.memory.textures++);const Te=J.isWebGLCubeRenderTarget===!0,Ge=J.isWebGLMultipleRenderTargets===!0,Ye=J.isWebGLMultisampleRenderTarget===!0,ve=te.isDataTexture3D||te.isDataTexture2DArray,Y=w(J)||a;if(!a||te.format!==co||te.type!==ho&&te.type!==Es||(te.format=er,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),Te){Ae.__webglFramebuffer=[];for(let pe=0;pe<6;pe++)Ae.__webglFramebuffer[pe]=r.createFramebuffer()}else if(Ae.__webglFramebuffer=r.createFramebuffer(),Ge)if(i.drawBuffers){const pe=J.texture;for(let ye=0,xe=pe.length;ye<xe;ye++){const De=n.get(pe[ye]);De.__webglTexture===void 0&&(De.__webglTexture=r.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(Ye)if(a){Ae.__webglMultisampledFramebuffer=r.createFramebuffer(),Ae.__webglColorRenderbuffer=r.createRenderbuffer(),r.bindRenderbuffer(36161,Ae.__webglColorRenderbuffer);const pe=o.convert(te.format),ye=o.convert(te.type),xe=F(te.internalFormat,pe,ye),De=Re(J);r.renderbufferStorageMultisample(36161,De,xe,J.width,J.height),t.bindFramebuffer(36160,Ae.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064,36161,Ae.__webglColorRenderbuffer),r.bindRenderbuffer(36161,null),J.depthBuffer&&(Ae.__webglDepthRenderbuffer=r.createRenderbuffer(),de(Ae.__webglDepthRenderbuffer,J,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(Te){t.bindTexture(34067,Ne.__webglTexture),$(34067,te,Y);for(let pe=0;pe<6;pe++)ge(Ae.__webglFramebuffer[pe],J,te,36064,34069+pe);M(te,Y)&&I(34067,te,J.width,J.height),t.bindTexture(34067,null)}else if(Ge){const pe=J.texture;for(let ye=0,xe=pe.length;ye<xe;ye++){const De=pe[ye],ht=n.get(De);t.bindTexture(3553,ht.__webglTexture),$(3553,De,Y),ge(Ae.__webglFramebuffer,J,De,36064+ye,3553),M(De,Y)&&I(3553,De,J.width,J.height)}t.bindTexture(3553,null)}else{let pe=3553;ve&&(a?pe=te.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(pe,Ne.__webglTexture),$(pe,te,Y),ge(Ae.__webglFramebuffer,J,te,36064,pe),M(te,Y)&&I(pe,te,J.width,J.height,J.depth),t.bindTexture(pe,null)}J.depthBuffer&&fe(J)},this.updateRenderTargetMipmap=function(J){const te=w(J)||a,Ae=J.isWebGLMultipleRenderTargets===!0?J.texture:[J.texture];for(let Ne=0,Te=Ae.length;Ne<Te;Ne++){const Ge=Ae[Ne];if(M(Ge,te)){const Ye=J.isWebGLCubeRenderTarget?34067:3553,ve=n.get(Ge).__webglTexture;t.bindTexture(Ye,ve),I(Ye,Ge,J.width,J.height),t.bindTexture(Ye,null)}}},this.updateMultisampleRenderTarget=function(J){if(J.isWebGLMultisampleRenderTarget)if(a){const te=J.width,Ae=J.height;let Ne=16384;J.depthBuffer&&(Ne|=256),J.stencilBuffer&&(Ne|=1024);const Te=n.get(J);t.bindFramebuffer(36008,Te.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,Te.__webglFramebuffer),r.blitFramebuffer(0,0,te,Ae,0,0,te,Ae,Ne,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,Te.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(J,te){J&&J.isWebGLRenderTarget&&(ke===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ke=!0),J=J.texture),he(J,te)},this.safeSetTextureCube=function(J,te){J&&J.isWebGLCubeRenderTarget&&(Be===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Be=!0),J=J.texture),ne(J,te)}}function kf(r,e,t){const n=t.isWebGL2;return{convert:function(i){let o;if(i===zo)return 5121;if(i===kp)return 32819;if(i===Gp)return 32820;if(i===Hp)return 33635;if(i===Fp)return 5120;if(i===Bp)return 5122;if(i===cl)return 5123;if(i===Up)return 5124;if(i===Ss)return 5125;if(i===ho)return 5126;if(i===Es)return n?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(i===_n)return 6406;if(i===co)return 6407;if(i===er)return 6408;if(i===zp)return 6409;if(i===gc)return 6410;if(i===Nn)return 6402;if(i===Ms)return 34041;if(i===ga)return 6403;if(i===vc)return 36244;if(i===Cu)return 33319;if(i===tr)return 33320;if(i===_c)return 36248;if(i===yc)return 36249;if(i===Ru||i===Iu||i===Lu||i===Ou){if(o=e.get("WEBGL_compressed_texture_s3tc"),o===null)return null;if(i===Ru)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Iu)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Lu)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Ou)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(i===Bi||i===xc||i===ji||i===bc){if(o=e.get("WEBGL_compressed_texture_pvrtc"),o===null)return null;if(i===Bi)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===xc)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===ji)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===bc)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===wc)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((i===Wr||i===va)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(i===Wr)return o.COMPRESSED_RGB8_ETC2;if(i===va)return o.COMPRESSED_RGBA8_ETC2_EAC}return i===Du||i===Tn||i===po||i===Nu||i===jp||i===Fu||i===Wp||i===Tc||i===dl||i===As||i===Xp||i===Sc||i===Ec||i===Bu||i===Mc||i===ku||i===Gu||i===Ac||i===Wi||i===Hu||i===_a||i===Pc||i===Cc||i===Yp||i===qp||i===Zp||i===Jp||i===Ps?(o=e.get("WEBGL_compressed_texture_astc"),o!==null?i:null):i===Uu?(o=e.get("EXT_texture_compression_bptc"),o!==null?i:null):i===dn?n?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class fd extends Qn{constructor(e=[]){super(),this.cameras=e}}fd.prototype.isArrayCamera=!0;class Ys extends Xt{constructor(){super(),this.type="Group"}}Ys.prototype.isGroup=!0;const md={type:"move"};class Nl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ys,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ys,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new T,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new T),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ys,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new T,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new T),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(i=t.getPose(e.targetRaySpace,n),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(md))),u&&e.hand){s=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,n);if(u.joints[_.jointName]===void 0){const M=new Ys;M.matrixAutoUpdate=!1,M.visible=!1,u.joints[_.jointName]=M,u.add(M)}const w=u.joints[_.jointName];y!==null&&(w.matrix.fromArray(y.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.jointRadius=y.radius),w.visible=y!==null}const c=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],f=c.position.distanceTo(d.position),m=.02,g=.005;u.inputState.pinching&&f>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=m-g&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,n),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}}class rv extends go{constructor(e,t){super();const n=this,i=e.state;let o=null,s=1,a=null,l="local-floor",u=null,c=null,d=null,f=null;const m=[],g=new Map,_=new Qn;_.layers.enable(1),_.viewport=new pn;const y=new Qn;y.layers.enable(2),y.viewport=new pn;const w=[_,y],M=new fd;M.layers.enable(1),M.layers.enable(2);let I=null,F=null;function R($){const se=g.get($.inputSource);se&&se.dispatchEvent({type:$.type,data:$.inputSource})}function U(){g.forEach(function($,se){$.disconnect(se)}),g.clear(),I=null,F=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),Q.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function N($){const se=o.inputSources;for(let me=0;me<m.length;me++)g.set(se[me],m[me]);for(let me=0;me<$.removed.length;me++){const ge=$.removed[me],de=g.get(ge);de&&(de.dispatchEvent({type:"disconnected",data:ge}),g.delete(ge))}for(let me=0;me<$.added.length;me++){const ge=$.added[me],de=g.get(ge);de&&de.dispatchEvent({type:"connected",data:ge})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function($){let se=m[$];return se===void 0&&(se=new Nl,m[$]=se),se.getTargetRaySpace()},this.getControllerGrip=function($){let se=m[$];return se===void 0&&(se=new Nl,m[$]=se),se.getGripSpace()},this.getHand=function($){let se=m[$];return se===void 0&&(se=new Nl,m[$]=se),se.getHandSpace()},this.setFramebufferScaleFactor=function($){s=$,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function($){l=$,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return o},this.setSession=async function($){if(o=$,o!==null){o.addEventListener("select",R),o.addEventListener("selectstart",R),o.addEventListener("selectend",R),o.addEventListener("squeeze",R),o.addEventListener("squeezestart",R),o.addEventListener("squeezeend",R),o.addEventListener("end",U),o.addEventListener("inputsourceschange",N);const se=t.getContextAttributes();if(se.xrCompatible!==!0&&await t.makeXRCompatible(),o.renderState.layers===void 0){const me={antialias:se.antialias,alpha:se.alpha,depth:se.depth,stencil:se.stencil,framebufferScaleFactor:s},ge=new XRWebGLLayer(o,t,me);o.updateRenderState({baseLayer:ge})}else{let me=0;se.depth&&(me=se.stencil?34041:6402);const ge={colorFormat:se.alpha?6408:6407,depthFormat:me,scaleFactor:s};c=new XRWebGLBinding(o,t),f=c.createProjectionLayer(ge),d=t.createFramebuffer(),o.updateRenderState({layers:[f]})}a=await o.requestReferenceSpace(l),Q.setContext(o),Q.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const G=new T,he=new T;function ne($,se){se===null?$.matrixWorld.copy($.matrix):$.matrixWorld.multiplyMatrices(se.matrixWorld,$.matrix),$.matrixWorldInverse.copy($.matrixWorld).invert()}this.updateCamera=function($){if(o===null)return;M.near=y.near=_.near=$.near,M.far=y.far=_.far=$.far,I===M.near&&F===M.far||(o.updateRenderState({depthNear:M.near,depthFar:M.far}),I=M.near,F=M.far);const se=$.parent,me=M.cameras;ne(M,se);for(let de=0;de<me.length;de++)ne(me[de],se);M.matrixWorld.decompose(M.position,M.quaternion,M.scale),$.position.copy(M.position),$.quaternion.copy(M.quaternion),$.scale.copy(M.scale),$.matrix.copy(M.matrix),$.matrixWorld.copy(M.matrixWorld);const ge=$.children;for(let de=0,fe=ge.length;de<fe;de++)ge[de].updateMatrixWorld(!0);me.length===2?function(de,fe,Re){G.setFromMatrixPosition(fe.matrixWorld),he.setFromMatrixPosition(Re.matrixWorld);const ke=G.distanceTo(he),Be=fe.projectionMatrix.elements,J=Re.projectionMatrix.elements,te=Be[14]/(Be[10]-1),Ae=Be[14]/(Be[10]+1),Ne=(Be[9]+1)/Be[5],Te=(Be[9]-1)/Be[5],Ge=(Be[8]-1)/Be[0],Ye=(J[8]+1)/J[0],ve=te*Ge,Y=te*Ye,pe=ke/(-Ge+Ye),ye=pe*-Ge;fe.matrixWorld.decompose(de.position,de.quaternion,de.scale),de.translateX(ye),de.translateZ(pe),de.matrixWorld.compose(de.position,de.quaternion,de.scale),de.matrixWorldInverse.copy(de.matrixWorld).invert();const xe=te+pe,De=Ae+pe,ht=ve-ye,xt=Y+(ke-ye),_t=Ne*Ae/De*xe,Gt=Te*Ae/De*xe;de.projectionMatrix.makePerspective(ht,xt,_t,Gt,xe,De)}(M,_,y):M.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return M};let Z=null;const Q=new Qc;Q.setAnimationLoop(function($,se){if(u=se.getViewerPose(a),u!==null){const ge=u.views,de=o.renderState.baseLayer;o.renderState.layers===void 0&&i.bindXRFramebuffer(de.framebuffer);let fe=!1;ge.length!==M.cameras.length&&(M.cameras.length=0,fe=!0);for(let Re=0;Re<ge.length;Re++){const ke=ge[Re];let Be=null;if(o.renderState.layers===void 0)Be=de.getViewport(ke);else{const te=c.getViewSubImage(f,ke);i.bindXRFramebuffer(d),t.framebufferTexture2D(36160,36064,3553,te.colorTexture,0),te.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,te.depthStencilTexture,0),Be=te.viewport}const J=w[Re];J.matrix.fromArray(ke.transform.matrix),J.projectionMatrix.fromArray(ke.projectionMatrix),J.viewport.set(Be.x,Be.y,Be.width,Be.height),Re===0&&M.matrix.copy(J.matrix),fe===!0&&M.cameras.push(J)}}const me=o.inputSources;for(let ge=0;ge<m.length;ge++){const de=m[ge],fe=me[ge];de.update(fe,se,a)}Z&&Z($,se)}),this.setAnimationLoop=function($){Z=$},this.dispose=function(){}}}function ov(r){function e(n,i){n.opacity.value=i.opacity,i.color&&n.diffuse.value.copy(i.color),i.emissive&&n.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(n.map.value=i.map),i.alphaMap&&(n.alphaMap.value=i.alphaMap),i.specularMap&&(n.specularMap.value=i.specularMap);const o=r.get(i).envMap;if(o){n.envMap.value=o,n.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,n.reflectivity.value=i.reflectivity,n.refractionRatio.value=i.refractionRatio;const l=r.get(o).__maxMipLevel;l!==void 0&&(n.maxMipLevel.value=l)}let s,a;i.lightMap&&(n.lightMap.value=i.lightMap,n.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(n.aoMap.value=i.aoMap,n.aoMapIntensity.value=i.aoMapIntensity),i.map?s=i.map:i.specularMap?s=i.specularMap:i.displacementMap?s=i.displacementMap:i.normalMap?s=i.normalMap:i.bumpMap?s=i.bumpMap:i.roughnessMap?s=i.roughnessMap:i.metalnessMap?s=i.metalnessMap:i.alphaMap?s=i.alphaMap:i.emissiveMap?s=i.emissiveMap:i.clearcoatMap?s=i.clearcoatMap:i.clearcoatNormalMap?s=i.clearcoatNormalMap:i.clearcoatRoughnessMap&&(s=i.clearcoatRoughnessMap),s!==void 0&&(s.isWebGLRenderTarget&&(s=s.texture),s.matrixAutoUpdate===!0&&s.updateMatrix(),n.uvTransform.value.copy(s.matrix)),i.aoMap?a=i.aoMap:i.lightMap&&(a=i.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function t(n,i){n.roughness.value=i.roughness,n.metalness.value=i.metalness,i.roughnessMap&&(n.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(n.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(n.emissiveMap.value=i.emissiveMap),i.bumpMap&&(n.bumpMap.value=i.bumpMap,n.bumpScale.value=i.bumpScale,i.side===W&&(n.bumpScale.value*=-1)),i.normalMap&&(n.normalMap.value=i.normalMap,n.normalScale.value.copy(i.normalScale),i.side===W&&n.normalScale.value.negate()),i.displacementMap&&(n.displacementMap.value=i.displacementMap,n.displacementScale.value=i.displacementScale,n.displacementBias.value=i.displacementBias),r.get(i).envMap&&(n.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms:function(n,i){n.fogColor.value.copy(i.color),i.isFog?(n.fogNear.value=i.near,n.fogFar.value=i.far):i.isFogExp2&&(n.fogDensity.value=i.density)},refreshMaterialUniforms:function(n,i,o,s,a){i.isMeshBasicMaterial?e(n,i):i.isMeshLambertMaterial?(e(n,i),function(l,u){u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap)}(n,i)):i.isMeshToonMaterial?(e(n,i),function(l,u){u.gradientMap&&(l.gradientMap.value=u.gradientMap),u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===W&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===W&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isMeshPhongMaterial?(e(n,i),function(l,u){l.specular.value.copy(u.specular),l.shininess.value=Math.max(u.shininess,1e-4),u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===W&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===W&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isMeshStandardMaterial?(e(n,i),i.isMeshPhysicalMaterial?function(l,u,c){t(l,u),l.reflectivity.value=u.reflectivity,l.clearcoat.value=u.clearcoat,l.clearcoatRoughness.value=u.clearcoatRoughness,u.sheen&&l.sheen.value.copy(u.sheen),u.clearcoatMap&&(l.clearcoatMap.value=u.clearcoatMap),u.clearcoatRoughnessMap&&(l.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap),u.clearcoatNormalMap&&(l.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),l.clearcoatNormalMap.value=u.clearcoatNormalMap,u.side===W&&l.clearcoatNormalScale.value.negate()),l.transmission.value=u.transmission,u.transmissionMap&&(l.transmissionMap.value=u.transmissionMap),u.transmission>0&&(l.transmissionSamplerMap.value=c.texture,l.transmissionSamplerSize.value.set(c.width,c.height)),l.thickness.value=u.thickness,u.thicknessMap&&(l.thicknessMap.value=u.thicknessMap),l.attenuationDistance.value=u.attenuationDistance,l.attenuationColor.value.copy(u.attenuationColor)}(n,i,a):t(n,i)):i.isMeshMatcapMaterial?(e(n,i),function(l,u){u.matcap&&(l.matcap.value=u.matcap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===W&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===W&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isMeshDepthMaterial?(e(n,i),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isMeshDistanceMaterial?(e(n,i),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias),l.referencePosition.value.copy(u.referencePosition),l.nearDistance.value=u.nearDistance,l.farDistance.value=u.farDistance}(n,i)):i.isMeshNormalMaterial?(e(n,i),function(l,u){u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===W&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===W&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,i)):i.isLineBasicMaterial?(function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity}(n,i),i.isLineDashedMaterial&&function(l,u){l.dashSize.value=u.dashSize,l.totalSize.value=u.dashSize+u.gapSize,l.scale.value=u.scale}(n,i)):i.isPointsMaterial?function(l,u,c,d){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.size.value=u.size*c,l.scale.value=.5*d,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let f;u.map?f=u.map:u.alphaMap&&(f=u.alphaMap),f!==void 0&&(f.matrixAutoUpdate===!0&&f.updateMatrix(),l.uvTransform.value.copy(f.matrix))}(n,i,o,s):i.isSpriteMaterial?function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.rotation.value=u.rotation,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let c;u.map?c=u.map:u.alphaMap&&(c=u.alphaMap),c!==void 0&&(c.matrixAutoUpdate===!0&&c.updateMatrix(),l.uvTransform.value.copy(c.matrix))}(n,i):i.isShadowMaterial?(n.color.value.copy(i.color),n.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function fn(r={}){const e=r.canvas!==void 0?r.canvas:function(){const ue=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return ue.style.display="block",ue}(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0&&r.alpha,i=r.depth===void 0||r.depth,o=r.stencil===void 0||r.stencil,s=r.antialias!==void 0&&r.antialias,a=r.premultipliedAlpha===void 0||r.premultipliedAlpha,l=r.preserveDrawingBuffer!==void 0&&r.preserveDrawingBuffer,u=r.powerPreference!==void 0?r.powerPreference:"default",c=r.failIfMajorPerformanceCaveat!==void 0&&r.failIfMajorPerformanceCaveat;let d=null,f=null;const m=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=wt,this.physicallyCorrectLights=!1,this.toneMapping=uo,this.toneMappingExposure=1;const _=this;let y=!1,w=0,M=0,I=null,F=-1,R=null;const U=new pn,N=new pn;let G=null,he=e.width,ne=e.height,Z=1,Q=null,$=null;const se=new pn(0,0,he,ne),me=new pn(0,0,he,ne);let ge=!1;const de=[],fe=new Da;let Re=!1,ke=!1,Be=null;const J=new pt,te=new T,Ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ne(){return I===null?Z:1}let Te,Ge,Ye,ve,Y,pe,ye,xe,De,ht,xt,_t,Gt,Wt,si,Cn,Bo,vp,_p,yp,dr,Cr,it=t;function _T(ue,Ve){for(let Le=0;Le<ue.length;Le++){const We=ue[Le],ot=e.getContext(We,Ve);if(ot!==null)return ot}return null}try{const ue={alpha:n,depth:i,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:c};if(e.addEventListener("webglcontextlost",xT,!1),e.addEventListener("webglcontextrestored",bT,!1),it===null){const Ve=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&Ve.shift(),it=_T(Ve,ue),it===null)throw _T(Ve)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}it.getShaderPrecisionFormat===void 0&&(it.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ue){throw console.error("THREE.WebGLRenderer: "+ue.message),ue}function yT(){Te=new Rg(it),Ge=new cf(it,Te,r),Te.init(Ge),dr=new kf(it,Te,Ge),Ye=new wh(it,Te,Ge),de[0]=1029,ve=new Ll(it),Y=new xh,pe=new iv(it,Te,Ye,Y,Ge,dr,ve),ye=new pf(_),xe=new Pg(it,Ge),Cr=new Il(it,Te,xe,Ge),De=new ed(it,xe,ve,Cr),ht=new ph(it,De,xe,ve),vp=new gf(it),si=new df(Y),xt=new Df(_,ye,Te,Ge,Cr,si),_t=new ov(Y),Gt=new nv(Y),Wt=new Uf(Te,Ge),Bo=new Cg(_,ye,Ye,ht,a),Cn=new pd(_,ht,Ge),_p=new hf(it,Te,ve,Ge),yp=new ff(it,Te,ve,Ge),ve.programs=xt.programs,_.capabilities=Ge,_.extensions=Te,_.properties=Y,_.renderLists=Gt,_.shadowMap=Cn,_.state=Ye,_.info=ve}yT();const zr=new rv(_,it);function xT(ue){ue.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function bT(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const ue=ve.autoReset,Ve=Cn.enabled,Le=Cn.autoUpdate,We=Cn.needsUpdate,ot=Cn.type;yT(),ve.autoReset=ue,Cn.enabled=Ve,Cn.autoUpdate=Le,Cn.needsUpdate=We,Cn.type=ot}function wT(ue){const Ve=ue.target;Ve.removeEventListener("dispose",wT),function(Le){(function(We){const ot=Y.get(We).programs;ot!==void 0&&ot.forEach(function(hn){xt.releaseProgram(hn)})})(Le),Y.remove(Le)}(Ve)}this.xr=zr,this.getContext=function(){return it},this.getContextAttributes=function(){return it.getContextAttributes()},this.forceContextLoss=function(){const ue=Te.get("WEBGL_lose_context");ue&&ue.loseContext()},this.forceContextRestore=function(){const ue=Te.get("WEBGL_lose_context");ue&&ue.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(ue){ue!==void 0&&(Z=ue,this.setSize(he,ne,!1))},this.getSize=function(ue){return ue.set(he,ne)},this.setSize=function(ue,Ve,Le){zr.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(he=ue,ne=Ve,e.width=Math.floor(ue*Z),e.height=Math.floor(Ve*Z),Le!==!1&&(e.style.width=ue+"px",e.style.height=Ve+"px"),this.setViewport(0,0,ue,Ve))},this.getDrawingBufferSize=function(ue){return ue.set(he*Z,ne*Z).floor()},this.setDrawingBufferSize=function(ue,Ve,Le){he=ue,ne=Ve,Z=Le,e.width=Math.floor(ue*Le),e.height=Math.floor(Ve*Le),this.setViewport(0,0,ue,Ve)},this.getCurrentViewport=function(ue){return ue.copy(U)},this.getViewport=function(ue){return ue.copy(se)},this.setViewport=function(ue,Ve,Le,We){ue.isVector4?se.set(ue.x,ue.y,ue.z,ue.w):se.set(ue,Ve,Le,We),Ye.viewport(U.copy(se).multiplyScalar(Z).floor())},this.getScissor=function(ue){return ue.copy(me)},this.setScissor=function(ue,Ve,Le,We){ue.isVector4?me.set(ue.x,ue.y,ue.z,ue.w):me.set(ue,Ve,Le,We),Ye.scissor(N.copy(me).multiplyScalar(Z).floor())},this.getScissorTest=function(){return ge},this.setScissorTest=function(ue){Ye.setScissorTest(ge=ue)},this.setOpaqueSort=function(ue){Q=ue},this.setTransparentSort=function(ue){$=ue},this.getClearColor=function(ue){return ue.copy(Bo.getClearColor())},this.setClearColor=function(){Bo.setClearColor.apply(Bo,arguments)},this.getClearAlpha=function(){return Bo.getClearAlpha()},this.setClearAlpha=function(){Bo.setClearAlpha.apply(Bo,arguments)},this.clear=function(ue,Ve,Le){let We=0;(ue===void 0||ue)&&(We|=16384),(Ve===void 0||Ve)&&(We|=256),(Le===void 0||Le)&&(We|=1024),it.clear(We)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",xT,!1),e.removeEventListener("webglcontextrestored",bT,!1),Gt.dispose(),Wt.dispose(),Y.dispose(),ye.dispose(),ht.dispose(),Cr.dispose(),zr.dispose(),zr.removeEventListener("sessionstart",TT),zr.removeEventListener("sessionend",ST),Be&&(Be.dispose(),Be=null),Su.stop()},this.renderBufferImmediate=function(ue,Ve){Cr.initAttributes();const Le=Y.get(ue);ue.hasPositions&&!Le.position&&(Le.position=it.createBuffer()),ue.hasNormals&&!Le.normal&&(Le.normal=it.createBuffer()),ue.hasUvs&&!Le.uv&&(Le.uv=it.createBuffer()),ue.hasColors&&!Le.color&&(Le.color=it.createBuffer());const We=Ve.getAttributes();ue.hasPositions&&(it.bindBuffer(34962,Le.position),it.bufferData(34962,ue.positionArray,35048),Cr.enableAttribute(We.position),it.vertexAttribPointer(We.position,3,5126,!1,0,0)),ue.hasNormals&&(it.bindBuffer(34962,Le.normal),it.bufferData(34962,ue.normalArray,35048),Cr.enableAttribute(We.normal),it.vertexAttribPointer(We.normal,3,5126,!1,0,0)),ue.hasUvs&&(it.bindBuffer(34962,Le.uv),it.bufferData(34962,ue.uvArray,35048),Cr.enableAttribute(We.uv),it.vertexAttribPointer(We.uv,2,5126,!1,0,0)),ue.hasColors&&(it.bindBuffer(34962,Le.color),it.bufferData(34962,ue.colorArray,35048),Cr.enableAttribute(We.color),it.vertexAttribPointer(We.color,3,5126,!1,0,0)),Cr.disableUnusedAttributes(),it.drawArrays(4,0,ue.count),ue.count=0},this.renderBufferDirect=function(ue,Ve,Le,We,ot,hn){Ve===null&&(Ve=Ae);const zt=ot.isMesh&&ot.matrixWorld.determinant()<0,ut=AT(ue,Ve,We,ot);Ye.setMaterial(We,zt);let Kt=Le.index;const Rt=Le.attributes.position;if(Kt===null){if(Rt===void 0||Rt.count===0)return}else if(Kt.count===0)return;let sn,kt=1;We.wireframe===!0&&(Kt=De.getWireframeAttribute(Le),kt=2),(We.morphTargets||We.morphNormals)&&vp.update(ot,Le,We,ut),Cr.setup(ot,We,ut,Le,Kt);let rn=_p;Kt!==null&&(sn=xe.get(Kt),rn=yp,rn.setIndex(sn));const xi=Kt!==null?Kt.count:Rt.count,On=Le.drawRange.start*kt,Uo=Le.drawRange.count*kt,Rn=hn!==null?hn.start*kt:0,bs=hn!==null?hn.count*kt:1/0,Ai=Math.max(On,Rn),Vr=Math.min(xi,On+Uo,Rn+bs)-1,Qi=Math.max(0,Vr-Ai+1);if(Qi!==0){if(ot.isMesh)We.wireframe===!0?(Ye.setLineWidth(We.wireframeLinewidth*Ne()),rn.setMode(1)):rn.setMode(4);else if(ot.isLine){let xp=We.linewidth;xp===void 0&&(xp=1),Ye.setLineWidth(xp*Ne()),ot.isLineSegments?rn.setMode(1):ot.isLineLoop?rn.setMode(2):rn.setMode(3)}else ot.isPoints?rn.setMode(0):ot.isSprite&&rn.setMode(4);if(ot.isInstancedMesh)rn.renderInstances(Ai,Qi,ot.count);else if(Le.isInstancedBufferGeometry){const xp=Math.min(Le.instanceCount,Le._maxInstanceCount);rn.renderInstances(Ai,Qi,xp)}else rn.render(Ai,Qi)}},this.compile=function(ue,Ve){f=Wt.get(ue),f.init(),ue.traverseVisible(function(Le){Le.isLight&&Le.layers.test(Ve.layers)&&(f.pushLight(Le),Le.castShadow&&f.pushShadow(Le))}),f.setupLights(),ue.traverse(function(Le){const We=Le.material;if(We)if(Array.isArray(We))for(let ot=0;ot<We.length;ot++)G_(We[ot],ue,Le);else G_(We,ue,Le)})};let k_=null;function TT(){Su.stop()}function ST(){Su.start()}const Su=new Qc;function pg(ue,Ve,Le){const We=Ve.isScene===!0?Ve.overrideMaterial:null;for(let ot=0,hn=ue.length;ot<hn;ot++){const zt=ue[ot],ut=zt.object,Kt=zt.geometry,Rt=We===null?zt.material:We,sn=zt.group;if(Le.isArrayCamera){const kt=Le.cameras;for(let rn=0,xi=kt.length;rn<xi;rn++){const On=kt[rn];ut.layers.test(On.layers)&&(Ye.viewport(U.copy(On.viewport)),f.setupLightsView(On),ET(ut,Ve,On,Kt,Rt,sn))}}else ET(ut,Ve,Le,Kt,Rt,sn)}}function ET(ue,Ve,Le,We,ot,hn){if(ue.onBeforeRender(_,Ve,Le,We,ot,hn),ue.modelViewMatrix.multiplyMatrices(Le.matrixWorldInverse,ue.matrixWorld),ue.normalMatrix.getNormalMatrix(ue.modelViewMatrix),ue.isImmediateRenderObject){const zt=AT(Le,Ve,ot,ue);Ye.setMaterial(ot),Cr.reset(),function(ut,Kt){ut.render(function(Rt){_.renderBufferImmediate(Rt,Kt)})}(ue,zt)}else ot.transparent===!0&&ot.side===ee?(ot.side=W,ot.needsUpdate=!0,_.renderBufferDirect(Le,Ve,We,ot,ue,hn),ot.side=z,ot.needsUpdate=!0,_.renderBufferDirect(Le,Ve,We,ot,ue,hn),ot.side=ee):_.renderBufferDirect(Le,Ve,We,ot,ue,hn);ue.onAfterRender(_,Ve,Le,We,ot,hn)}function G_(ue,Ve,Le){Ve.isScene!==!0&&(Ve=Ae);const We=Y.get(ue),ot=f.state.lights,hn=f.state.shadowsArray,zt=ot.state.version,ut=xt.getParameters(ue,ot.state,hn,Ve,Le),Kt=xt.getProgramCacheKey(ut);let Rt=We.programs;We.environment=ue.isMeshStandardMaterial?Ve.environment:null,We.fog=Ve.fog,We.envMap=ye.get(ue.envMap||We.environment),Rt===void 0&&(ue.addEventListener("dispose",wT),Rt=new Map,We.programs=Rt);let sn=Rt.get(Kt);if(sn!==void 0){if(We.currentProgram===sn&&We.lightsStateVersion===zt)return MT(ue,ut),sn}else ut.uniforms=xt.getUniforms(ue),ue.onBuild(ut,_),ue.onBeforeCompile(ut,_),sn=xt.acquireProgram(ut,Kt),Rt.set(Kt,sn),We.uniforms=ut.uniforms;const kt=We.uniforms;(ue.isShaderMaterial||ue.isRawShaderMaterial)&&ue.clipping!==!0||(kt.clippingPlanes=si.uniform),MT(ue,ut),We.needsLights=function(On){return On.isMeshLambertMaterial||On.isMeshToonMaterial||On.isMeshPhongMaterial||On.isMeshStandardMaterial||On.isShadowMaterial||On.isShaderMaterial&&On.lights===!0}(ue),We.lightsStateVersion=zt,We.needsLights&&(kt.ambientLightColor.value=ot.state.ambient,kt.lightProbe.value=ot.state.probe,kt.directionalLights.value=ot.state.directional,kt.directionalLightShadows.value=ot.state.directionalShadow,kt.spotLights.value=ot.state.spot,kt.spotLightShadows.value=ot.state.spotShadow,kt.rectAreaLights.value=ot.state.rectArea,kt.ltc_1.value=ot.state.rectAreaLTC1,kt.ltc_2.value=ot.state.rectAreaLTC2,kt.pointLights.value=ot.state.point,kt.pointLightShadows.value=ot.state.pointShadow,kt.hemisphereLights.value=ot.state.hemi,kt.directionalShadowMap.value=ot.state.directionalShadowMap,kt.directionalShadowMatrix.value=ot.state.directionalShadowMatrix,kt.spotShadowMap.value=ot.state.spotShadowMap,kt.spotShadowMatrix.value=ot.state.spotShadowMatrix,kt.pointShadowMap.value=ot.state.pointShadowMap,kt.pointShadowMatrix.value=ot.state.pointShadowMatrix);const rn=sn.getUniforms(),xi=es.seqWithValue(rn.seq,kt);return We.currentProgram=sn,We.uniformsList=xi,sn}function MT(ue,Ve){const Le=Y.get(ue);Le.outputEncoding=Ve.outputEncoding,Le.instancing=Ve.instancing,Le.skinning=Ve.skinning,Le.numClippingPlanes=Ve.numClippingPlanes,Le.numIntersection=Ve.numClipIntersection,Le.vertexAlphas=Ve.vertexAlphas}function AT(ue,Ve,Le,We){Ve.isScene!==!0&&(Ve=Ae),pe.resetTextureUnits();const ot=Ve.fog,hn=Le.isMeshStandardMaterial?Ve.environment:null,zt=I===null?_.outputEncoding:I.texture.encoding,ut=ye.get(Le.envMap||hn),Kt=Le.vertexColors===!0&&We.geometry&&We.geometry.attributes.color&&We.geometry.attributes.color.itemSize===4,Rt=Y.get(Le),sn=f.state.lights;if(Re===!0&&(ke===!0||ue!==R)){const Qi=ue===R&&Le.id===F;si.setState(Le,ue,Qi)}let kt=!1;Le.version===Rt.__version?Rt.needsLights&&Rt.lightsStateVersion!==sn.state.version||Rt.outputEncoding!==zt||We.isInstancedMesh&&Rt.instancing===!1?kt=!0:We.isInstancedMesh||Rt.instancing!==!0?We.isSkinnedMesh&&Rt.skinning===!1?kt=!0:We.isSkinnedMesh||Rt.skinning!==!0?Rt.envMap!==ut||Le.fog&&Rt.fog!==ot?kt=!0:Rt.numClippingPlanes===void 0||Rt.numClippingPlanes===si.numPlanes&&Rt.numIntersection===si.numIntersection?Rt.vertexAlphas!==Kt&&(kt=!0):kt=!0:kt=!0:kt=!0:(kt=!0,Rt.__version=Le.version);let rn=Rt.currentProgram;kt===!0&&(rn=G_(Le,Ve,We));let xi=!1,On=!1,Uo=!1;const Rn=rn.getUniforms(),bs=Rt.uniforms;if(Ye.useProgram(rn.program)&&(xi=!0,On=!0,Uo=!0),Le.id!==F&&(F=Le.id,On=!0),xi||R!==ue){if(Rn.setValue(it,"projectionMatrix",ue.projectionMatrix),Ge.logarithmicDepthBuffer&&Rn.setValue(it,"logDepthBufFC",2/(Math.log(ue.far+1)/Math.LN2)),R!==ue&&(R=ue,On=!0,Uo=!0),Le.isShaderMaterial||Le.isMeshPhongMaterial||Le.isMeshToonMaterial||Le.isMeshStandardMaterial||Le.envMap){const Qi=Rn.map.cameraPosition;Qi!==void 0&&Qi.setValue(it,te.setFromMatrixPosition(ue.matrixWorld))}(Le.isMeshPhongMaterial||Le.isMeshToonMaterial||Le.isMeshLambertMaterial||Le.isMeshBasicMaterial||Le.isMeshStandardMaterial||Le.isShaderMaterial)&&Rn.setValue(it,"isOrthographic",ue.isOrthographicCamera===!0),(Le.isMeshPhongMaterial||Le.isMeshToonMaterial||Le.isMeshLambertMaterial||Le.isMeshBasicMaterial||Le.isMeshStandardMaterial||Le.isShaderMaterial||Le.isShadowMaterial||We.isSkinnedMesh)&&Rn.setValue(it,"viewMatrix",ue.matrixWorldInverse)}if(We.isSkinnedMesh){Rn.setOptional(it,We,"bindMatrix"),Rn.setOptional(it,We,"bindMatrixInverse");const Qi=We.skeleton;Qi&&(Ge.floatVertexTextures?(Qi.boneTexture===null&&Qi.computeBoneTexture(),Rn.setValue(it,"boneTexture",Qi.boneTexture,pe),Rn.setValue(it,"boneTextureSize",Qi.boneTextureSize)):Rn.setOptional(it,Qi,"boneMatrices"))}var Ai,Vr;return(On||Rt.receiveShadow!==We.receiveShadow)&&(Rt.receiveShadow=We.receiveShadow,Rn.setValue(it,"receiveShadow",We.receiveShadow)),On&&(Rn.setValue(it,"toneMappingExposure",_.toneMappingExposure),Rt.needsLights&&(Vr=Uo,(Ai=bs).ambientLightColor.needsUpdate=Vr,Ai.lightProbe.needsUpdate=Vr,Ai.directionalLights.needsUpdate=Vr,Ai.directionalLightShadows.needsUpdate=Vr,Ai.pointLights.needsUpdate=Vr,Ai.pointLightShadows.needsUpdate=Vr,Ai.spotLights.needsUpdate=Vr,Ai.spotLightShadows.needsUpdate=Vr,Ai.rectAreaLights.needsUpdate=Vr,Ai.hemisphereLights.needsUpdate=Vr),ot&&Le.fog&&_t.refreshFogUniforms(bs,ot),_t.refreshMaterialUniforms(bs,Le,Z,ne,Be),es.upload(it,Rt.uniformsList,bs,pe)),Le.isShaderMaterial&&Le.uniformsNeedUpdate===!0&&(es.upload(it,Rt.uniformsList,bs,pe),Le.uniformsNeedUpdate=!1),Le.isSpriteMaterial&&Rn.setValue(it,"center",We.center),Rn.setValue(it,"modelViewMatrix",We.modelViewMatrix),Rn.setValue(it,"normalMatrix",We.normalMatrix),Rn.setValue(it,"modelMatrix",We.matrixWorld),rn}Su.setAnimationLoop(function(ue){k_&&k_(ue)}),typeof window!="undefined"&&Su.setContext(window),this.setAnimationLoop=function(ue){k_=ue,zr.setAnimationLoop(ue),ue===null?Su.stop():Su.start()},zr.addEventListener("sessionstart",TT),zr.addEventListener("sessionend",ST),this.render=function(ue,Ve){if(Ve!==void 0&&Ve.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(y===!0)return;ue.autoUpdate===!0&&ue.updateMatrixWorld(),Ve.parent===null&&Ve.updateMatrixWorld(),zr.enabled===!0&&zr.isPresenting===!0&&(zr.cameraAutoUpdate===!0&&zr.updateCamera(Ve),Ve=zr.getCamera()),ue.isScene===!0&&ue.onBeforeRender(_,ue,Ve,I),f=Wt.get(ue,g.length),f.init(),g.push(f),J.multiplyMatrices(Ve.projectionMatrix,Ve.matrixWorldInverse),fe.setFromProjectionMatrix(J),ke=this.localClippingEnabled,Re=si.init(this.clippingPlanes,ke,Ve),d=Gt.get(ue,m.length),d.init(),m.push(d),function zt(ut,Kt,Rt,sn){if(ut.visible===!1)return;if(ut.layers.test(Kt.layers)){if(ut.isGroup)Rt=ut.renderOrder;else if(ut.isLOD)ut.autoUpdate===!0&&ut.update(Kt);else if(ut.isLight)f.pushLight(ut),ut.castShadow&&f.pushShadow(ut);else if(ut.isSprite){if(!ut.frustumCulled||fe.intersectsSprite(ut)){sn&&te.setFromMatrixPosition(ut.matrixWorld).applyMatrix4(J);const rn=ht.update(ut),xi=ut.material;xi.visible&&d.push(ut,rn,xi,Rt,te.z,null)}}else if(ut.isImmediateRenderObject)sn&&te.setFromMatrixPosition(ut.matrixWorld).applyMatrix4(J),d.push(ut,null,ut.material,Rt,te.z,null);else if((ut.isMesh||ut.isLine||ut.isPoints)&&(ut.isSkinnedMesh&&ut.skeleton.frame!==ve.render.frame&&(ut.skeleton.update(),ut.skeleton.frame=ve.render.frame),!ut.frustumCulled||fe.intersectsObject(ut))){sn&&te.setFromMatrixPosition(ut.matrixWorld).applyMatrix4(J);const rn=ht.update(ut),xi=ut.material;if(Array.isArray(xi)){const On=rn.groups;for(let Uo=0,Rn=On.length;Uo<Rn;Uo++){const bs=On[Uo],Ai=xi[bs.materialIndex];Ai&&Ai.visible&&d.push(ut,rn,Ai,Rt,te.z,bs)}}else xi.visible&&d.push(ut,rn,xi,Rt,te.z,null)}}const kt=ut.children;for(let rn=0,xi=kt.length;rn<xi;rn++)zt(kt[rn],Kt,Rt,sn)}(ue,Ve,0,_.sortObjects),d.finish(),_.sortObjects===!0&&d.sort(Q,$),Re===!0&&si.beginShadows();const Le=f.state.shadowsArray;Cn.render(Le,ue,Ve),f.setupLights(),f.setupLightsView(Ve),Re===!0&&si.endShadows(),this.info.autoReset===!0&&this.info.reset(),Bo.render(d,ue);const We=d.opaque,ot=d.transmissive,hn=d.transparent;We.length>0&&pg(We,ue,Ve),ot.length>0&&function(zt,ut,Kt,Rt){if(Be===null){const rn=s===!0&&Ge.isWebGL2===!0;Be=new(rn?Os:Ir)(1024,1024,{generateMipmaps:!0,type:dr.convert(Es)!==null?Es:zo,minFilter:Ts,magFilter:Zn,wrapS:mi,wrapT:mi})}const sn=_.getRenderTarget();_.setRenderTarget(Be),_.clear();const kt=_.toneMapping;_.toneMapping=uo,pg(zt,Kt,Rt),_.toneMapping=kt,pe.updateMultisampleRenderTarget(Be),pe.updateRenderTargetMipmap(Be),_.setRenderTarget(sn),pg(ut,Kt,Rt)}(We,ot,ue,Ve),hn.length>0&&pg(hn,ue,Ve),I!==null&&(pe.updateMultisampleRenderTarget(I),pe.updateRenderTargetMipmap(I)),ue.isScene===!0&&ue.onAfterRender(_,ue,Ve),Ye.buffers.depth.setTest(!0),Ye.buffers.depth.setMask(!0),Ye.buffers.color.setMask(!0),Ye.setPolygonOffset(!1),Cr.resetDefaultState(),F=-1,R=null,g.pop(),f=g.length>0?g[g.length-1]:null,m.pop(),d=m.length>0?m[m.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return I},this.setRenderTarget=function(ue,Ve=0,Le=0){I=ue,w=Ve,M=Le,ue&&Y.get(ue).__webglFramebuffer===void 0&&pe.setupRenderTarget(ue);let We=null,ot=!1,hn=!1;if(ue){const zt=ue.texture;(zt.isDataTexture3D||zt.isDataTexture2DArray)&&(hn=!0);const ut=Y.get(ue).__webglFramebuffer;ue.isWebGLCubeRenderTarget?(We=ut[Ve],ot=!0):We=ue.isWebGLMultisampleRenderTarget?Y.get(ue).__webglMultisampledFramebuffer:ut,U.copy(ue.viewport),N.copy(ue.scissor),G=ue.scissorTest}else U.copy(se).multiplyScalar(Z).floor(),N.copy(me).multiplyScalar(Z).floor(),G=ge;if(Ye.bindFramebuffer(36160,We)&&Ge.drawBuffers){let zt=!1;if(ue)if(ue.isWebGLMultipleRenderTargets){const ut=ue.texture;if(de.length!==ut.length||de[0]!==36064){for(let Kt=0,Rt=ut.length;Kt<Rt;Kt++)de[Kt]=36064+Kt;de.length=ut.length,zt=!0}}else de.length===1&&de[0]===36064||(de[0]=36064,de.length=1,zt=!0);else de.length===1&&de[0]===1029||(de[0]=1029,de.length=1,zt=!0);zt&&(Ge.isWebGL2?it.drawBuffers(de):Te.get("WEBGL_draw_buffers").drawBuffersWEBGL(de))}if(Ye.viewport(U),Ye.scissor(N),Ye.setScissorTest(G),ot){const zt=Y.get(ue.texture);it.framebufferTexture2D(36160,36064,34069+Ve,zt.__webglTexture,Le)}else if(hn){const zt=Y.get(ue.texture),ut=Ve||0;it.framebufferTextureLayer(36160,36064,zt.__webglTexture,Le||0,ut)}},this.readRenderTargetPixels=function(ue,Ve,Le,We,ot,hn,zt){if(!ue||!ue.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ut=Y.get(ue).__webglFramebuffer;if(ue.isWebGLCubeRenderTarget&&zt!==void 0&&(ut=ut[zt]),ut){Ye.bindFramebuffer(36160,ut);try{const Kt=ue.texture,Rt=Kt.format,sn=Kt.type;if(Rt!==er&&dr.convert(Rt)!==it.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const kt=sn===Es&&(Te.has("EXT_color_buffer_half_float")||Ge.isWebGL2&&Te.has("EXT_color_buffer_float"));if(!(sn===zo||dr.convert(sn)===it.getParameter(35738)||sn===ho&&(Ge.isWebGL2||Te.has("OES_texture_float")||Te.has("WEBGL_color_buffer_float"))||kt))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");it.checkFramebufferStatus(36160)===36053?Ve>=0&&Ve<=ue.width-We&&Le>=0&&Le<=ue.height-ot&&it.readPixels(Ve,Le,We,ot,dr.convert(Rt),dr.convert(sn),hn):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Kt=I!==null?Y.get(I).__webglFramebuffer:null;Ye.bindFramebuffer(36160,Kt)}}},this.copyFramebufferToTexture=function(ue,Ve,Le=0){const We=Math.pow(2,-Le),ot=Math.floor(Ve.image.width*We),hn=Math.floor(Ve.image.height*We);let zt=dr.convert(Ve.format);Ge.isWebGL2&&(zt===6407&&(zt=32849),zt===6408&&(zt=32856)),pe.setTexture2D(Ve,0),it.copyTexImage2D(3553,Le,zt,ue.x,ue.y,ot,hn,0),Ye.unbindTexture()},this.copyTextureToTexture=function(ue,Ve,Le,We=0){const ot=Ve.image.width,hn=Ve.image.height,zt=dr.convert(Le.format),ut=dr.convert(Le.type);pe.setTexture2D(Le,0),it.pixelStorei(37440,Le.flipY),it.pixelStorei(37441,Le.premultiplyAlpha),it.pixelStorei(3317,Le.unpackAlignment),Ve.isDataTexture?it.texSubImage2D(3553,We,ue.x,ue.y,ot,hn,zt,ut,Ve.image.data):Ve.isCompressedTexture?it.compressedTexSubImage2D(3553,We,ue.x,ue.y,Ve.mipmaps[0].width,Ve.mipmaps[0].height,zt,Ve.mipmaps[0].data):it.texSubImage2D(3553,We,ue.x,ue.y,zt,ut,Ve.image),We===0&&Le.generateMipmaps&&it.generateMipmap(3553),Ye.unbindTexture()},this.copyTextureToTexture3D=function(ue,Ve,Le,We,ot=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const hn=ue.max.x-ue.min.x+1,zt=ue.max.y-ue.min.y+1,ut=ue.max.z-ue.min.z+1,Kt=dr.convert(We.format),Rt=dr.convert(We.type);let sn;if(We.isDataTexture3D)pe.setTexture3D(We,0),sn=32879;else{if(!We.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");pe.setTexture2DArray(We,0),sn=35866}it.pixelStorei(37440,We.flipY),it.pixelStorei(37441,We.premultiplyAlpha),it.pixelStorei(3317,We.unpackAlignment);const kt=it.getParameter(3314),rn=it.getParameter(32878),xi=it.getParameter(3316),On=it.getParameter(3315),Uo=it.getParameter(32877),Rn=Le.isCompressedTexture?Le.mipmaps[0]:Le.image;it.pixelStorei(3314,Rn.width),it.pixelStorei(32878,Rn.height),it.pixelStorei(3316,ue.min.x),it.pixelStorei(3315,ue.min.y),it.pixelStorei(32877,ue.min.z),Le.isDataTexture||Le.isDataTexture3D?it.texSubImage3D(sn,ot,Ve.x,Ve.y,Ve.z,hn,zt,ut,Kt,Rt,Rn.data):Le.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),it.compressedTexSubImage3D(sn,ot,Ve.x,Ve.y,Ve.z,hn,zt,ut,Kt,Rn.data)):it.texSubImage3D(sn,ot,Ve.x,Ve.y,Ve.z,hn,zt,ut,Kt,Rt,Rn),it.pixelStorei(3314,kt),it.pixelStorei(32878,rn),it.pixelStorei(3316,xi),it.pixelStorei(3315,On),it.pixelStorei(32877,Uo),ot===0&&We.generateMipmaps&&it.generateMipmap(sn),Ye.unbindTexture()},this.initTexture=function(ue){pe.setTexture2D(ue,0),Ye.unbindTexture()},this.resetState=function(){w=0,M=0,I=null,Ye.reset(),Cr.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class ci extends fn{}ci.prototype.isWebGL1Renderer=!0;class _i{constructor(e,t=25e-5){this.name="",this.color=new gt(e),this.density=t}clone(){return new _i(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}_i.prototype.isFogExp2=!0;class Fl{constructor(e,t=1,n=1e3){this.name="",this.color=new gt(e),this.near=t,this.far=n}clone(){return new Fl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Fl.prototype.isFog=!0;class Ba extends Xt{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}Ba.prototype.isScene=!0;class qs{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Rs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ir()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,o=this.stride;i<o;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ir()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ir()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}qs.prototype.isInterleavedBuffer=!0;const ei=new T;class Mo{constructor(e,t,n,i=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ei.x=this.getX(t),ei.y=this.getY(t),ei.z=this.getZ(t),ei.applyMatrix4(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ei.x=this.getX(t),ei.y=this.getY(t),ei.z=this.getZ(t),ei.applyNormalMatrix(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ei.x=this.getX(t),ei.y=this.getY(t),ei.z=this.getZ(t),ei.transformDirection(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,o){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=o,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[i+o])}return new Zt(new this.array.constructor(t),this.itemSize,this.normalized)}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Mo(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[i+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Mo.prototype.isInterleavedBufferAttribute=!0;class Bl extends vi{constructor(e){super(),this.type="SpriteMaterial",this.color=new gt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Zs;Bl.prototype.isSpriteMaterial=!0;const to=new T,Ua=new T,Js=new T,$s=new Qe,Ul=new Qe,Gf=new pt,Th=new T,kl=new T,Sh=new T,Hf=new Qe,Gl=new Qe,gd=new Qe;class Hl extends Xt{constructor(e){if(super(),this.type="Sprite",Zs===void 0){Zs=new Mt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new qs(t,5);Zs.setIndex([0,1,2,0,2,3]),Zs.setAttribute("position",new Mo(n,3,0,!1)),Zs.setAttribute("uv",new Mo(n,2,3,!1))}this.geometry=Zs,this.material=e!==void 0?e:new Bl,this.center=new Qe(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ua.setFromMatrixScale(this.matrixWorld),Gf.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Js.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ua.multiplyScalar(-Js.z);const n=this.material.rotation;let i,o;n!==0&&(o=Math.cos(n),i=Math.sin(n));const s=this.center;Eh(Th.set(-.5,-.5,0),Js,s,Ua,i,o),Eh(kl.set(.5,-.5,0),Js,s,Ua,i,o),Eh(Sh.set(.5,.5,0),Js,s,Ua,i,o),Hf.set(0,0),Gl.set(1,0),gd.set(1,1);let a=e.ray.intersectTriangle(Th,kl,Sh,!1,to);if(a===null&&(Eh(kl.set(-.5,.5,0),Js,s,Ua,i,o),Gl.set(0,1),a=e.ray.intersectTriangle(Th,Sh,kl,!1,to),a===null))return;const l=e.ray.origin.distanceTo(to);l<e.near||l>e.far||t.push({distance:l,point:to.clone(),uv:Mn.getUV(to,Th,kl,Sh,Hf,Gl,gd,new Qe),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Eh(r,e,t,n,i,o){$s.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Ul.x=o*$s.x-i*$s.y,Ul.y=i*$s.x+o*$s.y):Ul.copy($s),r.copy(e),r.x+=Ul.x,r.y+=Ul.y,r.applyMatrix4(Gf)}Hl.prototype.isSprite=!0;const ka=new T,zf=new T;class Vf extends Xt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const o=t[n];this.addLevel(o.object.clone(),o.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){ka.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(ka);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){ka.setFromMatrixPosition(e.matrixWorld),zf.setFromMatrixPosition(this.matrixWorld);const n=ka.distanceTo(zf)/e.zoom;let i,o;for(t[0].object.visible=!0,i=1,o=t.length;i<o&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;i<o;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,o=n.length;i<o;i++){const s=n[i];t.object.levels.push({object:s.object.uuid,distance:s.distance})}return t}}const Hi=new T,Mh=new pn,jf=new pn,sv=new T,Ah=new pt;class Ga extends ln{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new pt,this.bindMatrixInverse=new pt}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new pn,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);const o=1/e.manhattanLength();o!==1/0?e.multiplyScalar(o):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,i=this.geometry;Mh.fromBufferAttribute(i.attributes.skinIndex,e),jf.fromBufferAttribute(i.attributes.skinWeight,e),Hi.fromBufferAttribute(i.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let o=0;o<4;o++){const s=jf.getComponent(o);if(s!==0){const a=Mh.getComponent(o);Ah.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(sv.copy(Hi).applyMatrix4(Ah),s)}}return t.applyMatrix4(this.bindMatrixInverse)}}Ga.prototype.isSkinnedMesh=!0;class Ph extends Xt{constructor(){super(),this.type="Bone"}}Ph.prototype.isBone=!0;class ns extends $n{constructor(e=null,t=1,n=1,i,o,s,a,l,u=Zn,c=Zn,d,f){super(null,s,a,l,u,c,i,o,d,f),this.image={data:e,width:t,height:n},this.magFilter=u,this.minFilter=c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}ns.prototype.isDataTexture=!0;const Wf=new pt,Xf=new pt;class Ch{constructor(e=[],t=[]){this.uuid=ir(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new pt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new pt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let o=0,s=e.length;o<s;o++){const a=e[o]?e[o].matrixWorld:Xf;Wf.multiplyMatrices(a,t[o]),Wf.toArray(n,16*o)}i!==null&&(i.needsUpdate=!0)}clone(){return new Ch(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=ya(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new ns(t,e,e,er,ho);return this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const o=e.bones[n];let s=t[o];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",o),s=new Ph),this.bones.push(s),this.boneInverses.push(new pt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,o=t.length;i<o;i++){const s=t[i];e.bones.push(s.uuid);const a=n[i];e.boneInverses.push(a.toArray())}return e}}const Yf=new pt,Rh=new pt,Ha=[],zl=new ln;class vd extends ln{constructor(e,t,n){super(e,t),this.instanceMatrix=new Zt(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,i=this.count;if(zl.geometry=this.geometry,zl.material=this.material,zl.material!==void 0)for(let o=0;o<i;o++){this.getMatrixAt(o,Yf),Rh.multiplyMatrices(n,Yf),zl.matrixWorld=Rh,zl.raycast(e,Ha);for(let s=0,a=Ha.length;s<a;s++){const l=Ha[s];l.instanceId=o,l.object=this,t.push(l)}Ha.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Zt(new Float32Array(3*this.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}vd.prototype.isInstancedMesh=!0;class yi extends vi{constructor(e){super(),this.type="LineBasicMaterial",this.color=new gt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}yi.prototype.isLineBasicMaterial=!0;const qf=new T,Ih=new T,Zf=new pt,_d=new bo,Lh=new li;class h extends Xt{constructor(e=new Mt,t=new yi){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,o=t.count;i<o;i++)qf.fromBufferAttribute(t,i-1),Ih.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=qf.distanceTo(Ih);e.setAttribute("lineDistance",new st(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,o=e.params.Line.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Lh.copy(n.boundingSphere),Lh.applyMatrix4(i),Lh.radius+=o,e.ray.intersectsSphere(Lh)===!1)return;Zf.copy(i).invert(),_d.copy(e.ray).applyMatrix4(Zf);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,u=new T,c=new T,d=new T,f=new T,m=this.isLineSegments?2:1;if(n.isBufferGeometry){const g=n.index,_=n.attributes.position;if(g!==null)for(let y=Math.max(0,s.start),w=Math.min(g.count,s.start+s.count)-1;y<w;y+=m){const M=g.getX(y),I=g.getX(y+1);if(u.fromBufferAttribute(_,M),c.fromBufferAttribute(_,I),_d.distanceSqToSegment(u,c,f,d)>l)continue;f.applyMatrix4(this.matrixWorld);const F=e.ray.origin.distanceTo(f);F<e.near||F>e.far||t.push({distance:F,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(let y=Math.max(0,s.start),w=Math.min(_.count,s.start+s.count)-1;y<w;y+=m){if(u.fromBufferAttribute(_,y),c.fromBufferAttribute(_,y+1),_d.distanceSqToSegment(u,c,f,d)>l)continue;f.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(f);M<e.near||M>e.far||t.push({distance:M,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o<s;o++){const a=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}h.prototype.isLine=!0;const p=new T,x=new T;class E extends h{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,o=t.count;i<o;i+=2)p.fromBufferAttribute(t,i),x.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+p.distanceTo(x);e.setAttribute("lineDistance",new st(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}E.prototype.isLineSegments=!0;class P extends h{constructor(e,t){super(e,t),this.type="LineLoop"}}P.prototype.isLineLoop=!0;class j extends vi{constructor(e){super(),this.type="PointsMaterial",this.color=new gt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}j.prototype.isPointsMaterial=!0;const re=new pt,ce=new bo,_e=new li,He=new T;class ze extends Xt{constructor(e=new Mt,t=new j){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,o=e.params.Points.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_e.copy(n.boundingSphere),_e.applyMatrix4(i),_e.radius+=o,e.ray.intersectsSphere(_e)===!1)return;re.copy(i).invert(),ce.copy(e.ray).applyMatrix4(re);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const u=n.index,c=n.attributes.position;if(u!==null)for(let d=Math.max(0,s.start),f=Math.min(u.count,s.start+s.count);d<f;d++){const m=u.getX(d);He.fromBufferAttribute(c,m),tt(He,m,l,i,e,t,this)}else for(let d=Math.max(0,s.start),f=Math.min(c.count,s.start+s.count);d<f;d++)He.fromBufferAttribute(c,d),tt(He,d,l,i,e,t,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o<s;o++){const a=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=o}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function tt(r,e,t,n,i,o,s){const a=ce.distanceSqToPoint(r);if(a<t){const l=new T;ce.closestPointToPoint(r,l),l.applyMatrix4(n);const u=i.ray.origin.distanceTo(l);if(u<i.near||u>i.far)return;o.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:s})}}ze.prototype.isPoints=!0;class vt extends $n{constructor(e,t,n,i,o,s,a,l,u){super(e,t,n,i,o,s,a,l,u),this.format=a!==void 0?a:co,this.minFilter=s!==void 0?s:Jn,this.magFilter=o!==void 0?o:Jn,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(function d(){c.needsUpdate=!0,e.requestVideoFrameCallback(d)})}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!("requestVideoFrameCallback"in e)&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}vt.prototype.isVideoTexture=!0;class yt extends $n{constructor(e,t,n,i,o,s,a,l,u,c,d,f){super(null,s,a,l,u,c,i,o,d,f),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}yt.prototype.isCompressedTexture=!0;class Ct extends $n{constructor(e,t,n,i,o,s,a,l,u){super(e,t,n,i,o,s,a,l,u),this.needsUpdate=!0}}Ct.prototype.isCanvasTexture=!0;class Je extends $n{constructor(e,t,n,i,o,s,a,l,u,c){if((c=c!==void 0?c:Nn)!==Nn&&c!==Ms)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&c===Nn&&(n=cl),n===void 0&&c===Ms&&(n=dn),super(null,i,o,s,a,l,c,n,u),this.image={width:e,height:t},this.magFilter=a!==void 0?a:Zn,this.minFilter=l!==void 0?l:Zn,this.flipY=!1,this.generateMipmaps=!1}}Je.prototype.isDepthTexture=!0;class nt extends Mt{constructor(e=1,t=8,n=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const o=[],s=[],a=[],l=[],u=new T,c=new Qe;s.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,f=3;d<=t;d++,f+=3){const m=n+d/t*i;u.x=e*Math.cos(m),u.y=e*Math.sin(m),s.push(u.x,u.y,u.z),a.push(0,0,1),c.x=(s[f]/e+1)/2,c.y=(s[f+1]/e+1)/2,l.push(c.x,c.y)}for(let d=1;d<=t;d++)o.push(d,d+1,0);this.setIndex(o),this.setAttribute("position",new st(s,3)),this.setAttribute("normal",new st(a,3)),this.setAttribute("uv",new st(l,2))}static fromJSON(e){return new nt(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Et extends Mt{constructor(e=1,t=1,n=1,i=8,o=1,s=!1,a=0,l=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:o,openEnded:s,thetaStart:a,thetaLength:l};const u=this;i=Math.floor(i),o=Math.floor(o);const c=[],d=[],f=[],m=[];let g=0;const _=[],y=n/2;let w=0;function M(I){const F=g,R=new Qe,U=new T;let N=0;const G=I===!0?e:t,he=I===!0?1:-1;for(let Z=1;Z<=i;Z++)d.push(0,y*he,0),f.push(0,he,0),m.push(.5,.5),g++;const ne=g;for(let Z=0;Z<=i;Z++){const Q=Z/i*l+a,$=Math.cos(Q),se=Math.sin(Q);U.x=G*se,U.y=y*he,U.z=G*$,d.push(U.x,U.y,U.z),f.push(0,he,0),R.x=.5*$+.5,R.y=.5*se*he+.5,m.push(R.x,R.y),g++}for(let Z=0;Z<i;Z++){const Q=F+Z,$=ne+Z;I===!0?c.push($,$+1,Q):c.push($+1,$,Q),N+=3}u.addGroup(w,N,I===!0?1:2),w+=N}(function(){const I=new T,F=new T;let R=0;const U=(t-e)/n;for(let N=0;N<=o;N++){const G=[],he=N/o,ne=he*(t-e)+e;for(let Z=0;Z<=i;Z++){const Q=Z/i,$=Q*l+a,se=Math.sin($),me=Math.cos($);F.x=ne*se,F.y=-he*n+y,F.z=ne*me,d.push(F.x,F.y,F.z),I.set(se,U,me).normalize(),f.push(I.x,I.y,I.z),m.push(Q,1-he),G.push(g++)}_.push(G)}for(let N=0;N<i;N++)for(let G=0;G<o;G++){const he=_[G][N],ne=_[G+1][N],Z=_[G+1][N+1],Q=_[G][N+1];c.push(he,ne,Q),c.push(ne,Z,Q),R+=6}u.addGroup(w,R,0),w+=R})(),s===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(c),this.setAttribute("position",new st(d,3)),this.setAttribute("normal",new st(f,3)),this.setAttribute("uv",new st(m,2))}static fromJSON(e){return new Et(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class mt extends Et{constructor(e=1,t=1,n=8,i=1,o=!1,s=0,a=2*Math.PI){super(0,e,t,n,i,o,s,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:o,thetaStart:s,thetaLength:a}}static fromJSON(e){return new mt(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class St extends Mt{constructor(e,t,n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const o=[],s=[];function a(f,m,g,_){const y=_+1,w=[];for(let M=0;M<=y;M++){w[M]=[];const I=f.clone().lerp(g,M/y),F=m.clone().lerp(g,M/y),R=y-M;for(let U=0;U<=R;U++)w[M][U]=U===0&&M===y?I:I.clone().lerp(F,U/R)}for(let M=0;M<y;M++)for(let I=0;I<2*(y-M)-1;I++){const F=Math.floor(I/2);I%2==0?(l(w[M][F+1]),l(w[M+1][F]),l(w[M][F])):(l(w[M][F+1]),l(w[M+1][F+1]),l(w[M+1][F]))}}function l(f){o.push(f.x,f.y,f.z)}function u(f,m){const g=3*f;m.x=e[g+0],m.y=e[g+1],m.z=e[g+2]}function c(f,m,g,_){_<0&&f.x===1&&(s[m]=f.x-1),g.x===0&&g.z===0&&(s[m]=_/2/Math.PI+.5)}function d(f){return Math.atan2(f.z,-f.x)}(function(f){const m=new T,g=new T,_=new T;for(let y=0;y<t.length;y+=3)u(t[y+0],m),u(t[y+1],g),u(t[y+2],_),a(m,g,_,f)})(i),function(f){const m=new T;for(let g=0;g<o.length;g+=3)m.x=o[g+0],m.y=o[g+1],m.z=o[g+2],m.normalize().multiplyScalar(f),o[g+0]=m.x,o[g+1]=m.y,o[g+2]=m.z}(n),function(){const f=new T;for(let g=0;g<o.length;g+=3){f.x=o[g+0],f.y=o[g+1],f.z=o[g+2];const _=d(f)/2/Math.PI+.5,y=(m=f,Math.atan2(-m.y,Math.sqrt(m.x*m.x+m.z*m.z))/Math.PI+.5);s.push(_,1-y)}var m;(function(){const g=new T,_=new T,y=new T,w=new T,M=new Qe,I=new Qe,F=new Qe;for(let R=0,U=0;R<o.length;R+=9,U+=6){g.set(o[R+0],o[R+1],o[R+2]),_.set(o[R+3],o[R+4],o[R+5]),y.set(o[R+6],o[R+7],o[R+8]),M.set(s[U+0],s[U+1]),I.set(s[U+2],s[U+3]),F.set(s[U+4],s[U+5]),w.copy(g).add(_).add(y).divideScalar(3);const N=d(w);c(M,U+0,g,N),c(I,U+2,_,N),c(F,U+4,y,N)}})(),function(){for(let g=0;g<s.length;g+=6){const _=s[g+0],y=s[g+2],w=s[g+4],M=Math.max(_,y,w),I=Math.min(_,y,w);M>.9&&I<.1&&(_<.2&&(s[g+0]+=1),y<.2&&(s[g+2]+=1),w<.2&&(s[g+4]+=1))}}()}(),this.setAttribute("position",new st(o,3)),this.setAttribute("normal",new st(o.slice(),3)),this.setAttribute("uv",new st(s,2)),i===0?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new St(e.vertices,e.indices,e.radius,e.details)}}class It extends St{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new It(e.radius,e.detail)}}const jt=new T,Tt=new T,Ot=new T,Wn=new Mn;class Ei extends Mt{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const n=Math.pow(10,4),i=Math.cos(Sn*t),o=e.getIndex(),s=e.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],u=["a","b","c"],c=new Array(3),d={},f=[];for(let m=0;m<a;m+=3){o?(l[0]=o.getX(m),l[1]=o.getX(m+1),l[2]=o.getX(m+2)):(l[0]=m,l[1]=m+1,l[2]=m+2);const{a:g,b:_,c:y}=Wn;if(g.fromBufferAttribute(s,l[0]),_.fromBufferAttribute(s,l[1]),y.fromBufferAttribute(s,l[2]),Wn.getNormal(Ot),c[0]=`${Math.round(g.x*n)},${Math.round(g.y*n)},${Math.round(g.z*n)}`,c[1]=`${Math.round(_.x*n)},${Math.round(_.y*n)},${Math.round(_.z*n)}`,c[2]=`${Math.round(y.x*n)},${Math.round(y.y*n)},${Math.round(y.z*n)}`,c[0]!==c[1]&&c[1]!==c[2]&&c[2]!==c[0])for(let w=0;w<3;w++){const M=(w+1)%3,I=c[w],F=c[M],R=Wn[u[w]],U=Wn[u[M]],N=`${I}_${F}`,G=`${F}_${I}`;G in d&&d[G]?(Ot.dot(d[G].normal)<=i&&(f.push(R.x,R.y,R.z),f.push(U.x,U.y,U.z)),d[G]=null):N in d||(d[N]={index0:l[w],index1:l[M],normal:Ot.clone()})}}for(const m in d)if(d[m]){const{index0:g,index1:_}=d[m];jt.fromBufferAttribute(s,g),Tt.fromBufferAttribute(s,_),f.push(jt.x,jt.y,jt.z),f.push(Tt.x,Tt.y,Tt.z)}this.setAttribute("position",new st(f,3))}}class Xn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),o=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),o+=n.distanceTo(i),t.push(o),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const o=n.length;let s;s=t||e*n[o-1];let a,l=0,u=o-1;for(;l<=u;)if(i=Math.floor(l+(u-l)/2),a=n[i]-s,a<0)l=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(i=u,n[i]===s)return i/(o-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(o-1)}getTangent(e,t){let n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);const o=this.getPoint(n),s=this.getPoint(i),a=t||(o.isVector2?new Qe:new T);return a.copy(s).sub(o).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new T,i=[],o=[],s=[],a=new T,l=new pt;for(let m=0;m<=e;m++){const g=m/e;i[m]=this.getTangentAt(g,new T),i[m].normalize()}o[0]=new T,s[0]=new T;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),d=Math.abs(i[0].y),f=Math.abs(i[0].z);c<=u&&(u=c,n.set(1,0,0)),d<=u&&(u=d,n.set(0,1,0)),f<=u&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),o[0].crossVectors(i[0],a),s[0].crossVectors(i[0],o[0]);for(let m=1;m<=e;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(Ti(i[m-1].dot(i[m]),-1,1));o[m].applyMatrix4(l.makeRotationAxis(a,g))}s[m].crossVectors(i[m],o[m])}if(t===!0){let m=Math.acos(Ti(o[0].dot(o[e]),-1,1));m/=e,i[0].dot(a.crossVectors(o[0],o[e]))>0&&(m=-m);for(let g=1;g<=e;g++)o[g].applyMatrix4(l.makeRotationAxis(i[g],m*g)),s[g].crossVectors(i[g],o[g])}return{tangents:i,normals:o,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class kn extends Xn{constructor(e=0,t=0,n=1,i=1,o=0,s=2*Math.PI,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new Qe,i=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=i;for(;o>i;)o-=i;o<Number.EPSILON&&(o=s?0:i),this.aClockwise!==!0||s||(o===i?o=-i:o-=i);const a=this.aStartAngle+e*o;let l=this.aX+this.xRadius*Math.cos(a),u=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const c=Math.cos(this.aRotation),d=Math.sin(this.aRotation),f=l-this.aX,m=u-this.aY;l=f*c-m*d+this.aX,u=f*d+m*c+this.aY}return n.set(l,u)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}kn.prototype.isEllipseCurve=!0;class kr extends kn{constructor(e,t,n,i,o,s){super(e,t,n,n,i,o,s),this.type="ArcCurve"}}function no(){let r=0,e=0,t=0,n=0;function i(o,s,a,l){r=o,e=a,t=-3*o+3*s-2*a-l,n=2*o-2*s+a+l}return{initCatmullRom:function(o,s,a,l,u){i(s,a,u*(a-o),u*(l-s))},initNonuniformCatmullRom:function(o,s,a,l,u,c,d){let f=(s-o)/u-(a-o)/(u+c)+(a-s)/c,m=(a-s)/c-(l-s)/(c+d)+(l-a)/d;f*=c,m*=c,i(s,a,f,m)},calc:function(o){const s=o*o;return r+e*o+t*s+n*(s*o)}}}kr.prototype.isArcCurve=!0;const is=new T,za=new no,rs=new no,io=new no;class Oh extends Xn{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new T){const n=t,i=this.points,o=i.length,s=(o-(this.closed?0:1))*e;let a,l,u=Math.floor(s),c=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/o)+1)*o:c===0&&u===o-1&&(u=o-2,c=1),this.closed||u>0?a=i[(u-1)%o]:(is.subVectors(i[0],i[1]).add(i[0]),a=is);const d=i[u%o],f=i[(u+1)%o];if(this.closed||u+2<o?l=i[(u+2)%o]:(is.subVectors(i[o-1],i[o-2]).add(i[o-1]),l=is),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let g=Math.pow(a.distanceToSquared(d),m),_=Math.pow(d.distanceToSquared(f),m),y=Math.pow(f.distanceToSquared(l),m);_<1e-4&&(_=1),g<1e-4&&(g=_),y<1e-4&&(y=_),za.initNonuniformCatmullRom(a.x,d.x,f.x,l.x,g,_,y),rs.initNonuniformCatmullRom(a.y,d.y,f.y,l.y,g,_,y),io.initNonuniformCatmullRom(a.z,d.z,f.z,l.z,g,_,y)}else this.curveType==="catmullrom"&&(za.initCatmullRom(a.x,d.x,f.x,l.x,this.tension),rs.initCatmullRom(a.y,d.y,f.y,l.y,this.tension),io.initCatmullRom(a.z,d.z,f.z,l.z,this.tension));return n.set(za.calc(c),rs.calc(c),io.calc(c)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new T().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function yd(r,e,t,n,i){const o=.5*(n-e),s=.5*(i-t),a=r*r;return(2*t-2*n+o+s)*(r*a)+(-3*t+3*n-2*o-s)*a+o*r+t}function os(r,e,t,n){return function(i,o){const s=1-i;return s*s*o}(r,e)+function(i,o){return 2*(1-i)*i*o}(r,t)+function(i,o){return i*i*o}(r,n)}function Ks(r,e,t,n,i){return function(o,s){const a=1-o;return a*a*a*s}(r,e)+function(o,s){const a=1-o;return 3*a*a*o*s}(r,t)+function(o,s){return 3*(1-o)*o*o*s}(r,n)+function(o,s){return o*o*o*s}(r,i)}Oh.prototype.isCatmullRomCurve3=!0;class Qs extends Xn{constructor(e=new Qe,t=new Qe,n=new Qe,i=new Qe){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Qe){const n=t,i=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(Ks(e,i.x,o.x,s.x,a.x),Ks(e,i.y,o.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Qs.prototype.isCubicBezierCurve=!0;class Va extends Xn{constructor(e=new T,t=new T,n=new T,i=new T){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new T){const n=t,i=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(Ks(e,i.x,o.x,s.x,a.x),Ks(e,i.y,o.y,s.y,a.y),Ks(e,i.z,o.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Va.prototype.isCubicBezierCurve3=!0;class ja extends Xn{constructor(e=new Qe,t=new Qe){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Qe){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new Qe;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}ja.prototype.isLineCurve=!0;class Vl extends Xn{constructor(e=new T,t=new T){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new T){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ea extends Xn{constructor(e=new Qe,t=new Qe,n=new Qe){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Qe){const n=t,i=this.v0,o=this.v1,s=this.v2;return n.set(os(e,i.x,o.x,s.x),os(e,i.y,o.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}ea.prototype.isQuadraticBezierCurve=!0;class av extends Xn{constructor(e=new T,t=new T,n=new T){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new T){const n=t,i=this.v0,o=this.v1,s=this.v2;return n.set(os(e,i.x,o.x,s.x),os(e,i.y,o.y,s.y),os(e,i.z,o.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}av.prototype.isQuadraticBezierCurve3=!0;class Jf extends Xn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Qe){const n=t,i=this.points,o=(i.length-1)*e,s=Math.floor(o),a=o-s,l=i[s===0?s:s-1],u=i[s],c=i[s>i.length-2?i.length-1:s+1],d=i[s>i.length-3?i.length-1:s+2];return n.set(yd(a,l.x,u.x,c.x,d.x),yd(a,l.y,u.y,c.y,d.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Qe().fromArray(i))}return this}}Jf.prototype.isSplineCurve=!0;var lv=Object.freeze({__proto__:null,ArcCurve:kr,CatmullRomCurve3:Oh,CubicBezierCurve:Qs,CubicBezierCurve3:Va,EllipseCurve:kn,LineCurve:ja,LineCurve3:Vl,QuadraticBezierCurve:ea,QuadraticBezierCurve3:av,SplineCurve:Jf});const aS=function(r,e,t=2){const n=e&&e.length,i=n?e[0]*t:r.length;let o=ey(r,0,i,t,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u,c,d,f,m;if(n&&(o=function(g,_,y,w){const M=[];let I,F,R,U,N;for(I=0,F=_.length;I<F;I++)R=_[I]*w,U=I<F-1?_[I+1]*w:g.length,N=ey(g,R,U,w,!1),N===N.next&&(N.steiner=!0),M.push(mS(N));for(M.sort(dS),I=0;I<M.length;I++)pS(M[I],y),y=Wa(y,y.next);return y}(r,e,o,t)),r.length>80*t){a=u=r[0],l=c=r[1];for(let g=t;g<i;g+=t)d=r[g],f=r[g+1],d<a&&(a=d),f<l&&(l=f),d>u&&(u=d),f>c&&(c=f);m=Math.max(u-a,c-l),m=m!==0?1/m:0}return xd(o,s,t,a,l,m),s};function ey(r,e,t,n,i){let o,s;if(i===function(a,l,u,c){let d=0;for(let f=l,m=u-c;f<u;f+=c)d+=(a[m]-a[f])*(a[f+1]+a[m+1]),m=f;return d}(r,e,t,n)>0)for(o=e;o<t;o+=n)s=iy(o,r[o],r[o+1],s);else for(o=t-n;o>=e;o-=n)s=iy(o,r[o],r[o+1],s);return s&&$f(s,s.next)&&(wd(s),s=s.next),s}function Wa(r,e){if(!r)return r;e||(e=r);let t,n=r;do if(t=!1,n.steiner||!$f(n,n.next)&&ti(n.prev,n,n.next)!==0)n=n.next;else{if(wd(n),n=e=n.prev,n===n.next)break;t=!0}while(t||n!==e);return e}function xd(r,e,t,n,i,o,s){if(!r)return;!s&&o&&function(c,d,f,m){let g=c;do g.z===null&&(g.z=uv(g.x,g.y,d,f,m)),g.prevZ=g.prev,g.nextZ=g.next,g=g.next;while(g!==c);g.prevZ.nextZ=null,g.prevZ=null,function(_){let y,w,M,I,F,R,U,N,G=1;do{for(w=_,_=null,F=null,R=0;w;){for(R++,M=w,U=0,y=0;y<G&&(U++,M=M.nextZ,M);y++);for(N=G;U>0||N>0&&M;)U!==0&&(N===0||!M||w.z<=M.z)?(I=w,w=w.nextZ,U--):(I=M,M=M.nextZ,N--),F?F.nextZ=I:_=I,I.prevZ=F,F=I;w=M}F.nextZ=null,G*=2}while(R>1)}(g)}(r,n,i,o);let a,l,u=r;for(;r.prev!==r.next;)if(a=r.prev,l=r.next,o?uS(r,n,i,o):lS(r))e.push(a.i/t),e.push(r.i/t),e.push(l.i/t),wd(r),r=l.next,u=l.next;else if((r=l)===u){s?s===1?xd(r=hS(Wa(r),e,t),e,t,n,i,o,2):s===2&&cS(r,e,t,n,i,o):xd(Wa(r),e,t,n,i,o,1);break}}function lS(r){const e=r.prev,t=r,n=r.next;if(ti(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Dh(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&ti(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function uS(r,e,t,n){const i=r.prev,o=r,s=r.next;if(ti(i,o,s)>=0)return!1;const a=i.x<o.x?i.x<s.x?i.x:s.x:o.x<s.x?o.x:s.x,l=i.y<o.y?i.y<s.y?i.y:s.y:o.y<s.y?o.y:s.y,u=i.x>o.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,c=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,d=uv(a,l,e,t,n),f=uv(u,c,e,t,n);let m=r.prevZ,g=r.nextZ;for(;m&&m.z>=d&&g&&g.z<=f;){if(m!==r.prev&&m!==r.next&&Dh(i.x,i.y,o.x,o.y,s.x,s.y,m.x,m.y)&&ti(m.prev,m,m.next)>=0||(m=m.prevZ,g!==r.prev&&g!==r.next&&Dh(i.x,i.y,o.x,o.y,s.x,s.y,g.x,g.y)&&ti(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;m&&m.z>=d;){if(m!==r.prev&&m!==r.next&&Dh(i.x,i.y,o.x,o.y,s.x,s.y,m.x,m.y)&&ti(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;g&&g.z<=f;){if(g!==r.prev&&g!==r.next&&Dh(i.x,i.y,o.x,o.y,s.x,s.y,g.x,g.y)&&ti(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function hS(r,e,t){let n=r;do{const i=n.prev,o=n.next.next;!$f(i,o)&&ty(i,n,n.next,o)&&bd(i,o)&&bd(o,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(o.i/t),wd(n),wd(n.next),n=r=o),n=n.next}while(n!==r);return Wa(n)}function cS(r,e,t,n,i,o){let s=r;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&gS(s,a)){let l=ny(s,a);return s=Wa(s,s.next),l=Wa(l,l.next),xd(s,e,t,n,i,o),void xd(l,e,t,n,i,o)}a=a.next}s=s.next}while(s!==r)}function dS(r,e){return r.x-e.x}function pS(r,e){if(e=function(t,n){let i=n;const o=t.x,s=t.y;let a,l=-1/0;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){const g=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(g<=o&&g>l){if(l=g,g===o){if(s===i.y)return i;if(s===i.next.y)return i.next}a=i.x<i.next.x?i:i.next}}i=i.next}while(i!==n);if(!a)return null;if(o===l)return a;const u=a,c=a.x,d=a.y;let f,m=1/0;i=a;do o>=i.x&&i.x>=c&&o!==i.x&&Dh(s<d?o:l,s,c,d,s<d?l:o,s,i.x,i.y)&&(f=Math.abs(s-i.y)/(o-i.x),bd(i,t)&&(f<m||f===m&&(i.x>a.x||i.x===a.x&&fS(a,i)))&&(a=i,m=f)),i=i.next;while(i!==u);return a}(r,e)){const t=ny(e,r);Wa(e,e.next),Wa(t,t.next)}}function fS(r,e){return ti(r.prev,r,e.prev)<0&&ti(e.next,r,r.next)<0}function uv(r,e,t,n,i){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=32767*(r-t)*i)|r<<8))|r<<4))|r<<2))|r<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function mS(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function Dh(r,e,t,n,i,o,s,a){return(i-s)*(e-a)-(r-s)*(o-a)>=0&&(r-s)*(n-a)-(t-s)*(e-a)>=0&&(t-s)*(o-a)-(i-s)*(n-a)>=0}function gS(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!function(t,n){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==n.i&&i.next.i!==n.i&&ty(i,i.next,t,n))return!0;i=i.next}while(i!==t);return!1}(r,e)&&(bd(r,e)&&bd(e,r)&&function(t,n){let i=t,o=!1;const s=(t.x+n.x)/2,a=(t.y+n.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&s<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(o=!o),i=i.next;while(i!==t);return o}(r,e)&&(ti(r.prev,r,e.prev)||ti(r,e.prev,e))||$f(r,e)&&ti(r.prev,r,r.next)>0&&ti(e.prev,e,e.next)>0)}function ti(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function $f(r,e){return r.x===e.x&&r.y===e.y}function ty(r,e,t,n){const i=Qf(ti(r,e,t)),o=Qf(ti(r,e,n)),s=Qf(ti(t,n,r)),a=Qf(ti(t,n,e));return i!==o&&s!==a||!(i!==0||!Kf(r,t,e))||!(o!==0||!Kf(r,n,e))||!(s!==0||!Kf(t,r,n))||!(a!==0||!Kf(t,e,n))}function Kf(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function Qf(r){return r>0?1:r<0?-1:0}function bd(r,e){return ti(r.prev,r,r.next)<0?ti(r,e,r.next)>=0&&ti(r,r.prev,e)>=0:ti(r,e,r.prev)<0||ti(r,r.next,e)<0}function ny(r,e){const t=new hv(r.i,r.x,r.y),n=new hv(e.i,e.x,e.y),i=r.next,o=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}function iy(r,e,t,n){const i=new hv(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function wd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function hv(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ss{static area(e){const t=e.length;let n=0;for(let i=t-1,o=0;o<t;i=o++)n+=e[i].x*e[o].y-e[o].x*e[i].y;return .5*n}static isClockWise(e){return ss.area(e)<0}static triangulateShape(e,t){const n=[],i=[],o=[];ry(e),oy(n,e);let s=e.length;t.forEach(ry);for(let l=0;l<t.length;l++)i.push(s),s+=t[l].length,oy(n,t[l]);const a=aS(n,i);for(let l=0;l<a.length;l+=3)o.push(a.slice(l,l+3));return o}}function ry(r){const e=r.length;e>2&&r[e-1].equals(r[0])&&r.pop()}function oy(r,e){for(let t=0;t<e.length;t++)r.push(e[t].x),r.push(e[t].y)}class Ao extends Mt{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],o=[];for(let a=0,l=e.length;a<l;a++)s(e[a]);function s(a){const l=[],u=t.curveSegments!==void 0?t.curveSegments:12,c=t.steps!==void 0?t.steps:1;let d=t.depth!==void 0?t.depth:100,f=t.bevelEnabled===void 0||t.bevelEnabled,m=t.bevelThickness!==void 0?t.bevelThickness:6,g=t.bevelSize!==void 0?t.bevelSize:m-2,_=t.bevelOffset!==void 0?t.bevelOffset:0,y=t.bevelSegments!==void 0?t.bevelSegments:3;const w=t.extrudePath,M=t.UVGenerator!==void 0?t.UVGenerator:vS;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=t.amount);let I,F,R,U,N,G=!1;w&&(I=w.getSpacedPoints(c),G=!0,f=!1,F=w.computeFrenetFrames(c,!1),R=new T,U=new T,N=new T),f||(y=0,m=0,g=0,_=0);const he=a.extractPoints(u);let ne=he.shape;const Z=he.holes;if(!ss.isClockWise(ne)){ne=ne.reverse();for(let ve=0,Y=Z.length;ve<Y;ve++){const pe=Z[ve];ss.isClockWise(pe)&&(Z[ve]=pe.reverse())}}const Q=ss.triangulateShape(ne,Z),$=ne;for(let ve=0,Y=Z.length;ve<Y;ve++){const pe=Z[ve];ne=ne.concat(pe)}function se(ve,Y,pe){return Y||console.error("THREE.ExtrudeGeometry: vec does not exist"),Y.clone().multiplyScalar(pe).add(ve)}const me=ne.length,ge=Q.length;function de(ve,Y,pe){let ye,xe,De;const ht=ve.x-Y.x,xt=ve.y-Y.y,_t=pe.x-ve.x,Gt=pe.y-ve.y,Wt=ht*ht+xt*xt,si=ht*Gt-xt*_t;if(Math.abs(si)>Number.EPSILON){const Cn=Math.sqrt(Wt),Bo=Math.sqrt(_t*_t+Gt*Gt),vp=Y.x-xt/Cn,_p=Y.y+ht/Cn,yp=((pe.x-Gt/Bo-vp)*Gt-(pe.y+_t/Bo-_p)*_t)/(ht*Gt-xt*_t);ye=vp+ht*yp-ve.x,xe=_p+xt*yp-ve.y;const dr=ye*ye+xe*xe;if(dr<=2)return new Qe(ye,xe);De=Math.sqrt(dr/2)}else{let Cn=!1;ht>Number.EPSILON?_t>Number.EPSILON&&(Cn=!0):ht<-Number.EPSILON?_t<-Number.EPSILON&&(Cn=!0):Math.sign(xt)===Math.sign(Gt)&&(Cn=!0),Cn?(ye=-xt,xe=ht,De=Math.sqrt(Wt)):(ye=ht,xe=xt,De=Math.sqrt(Wt/2))}return new Qe(ye/De,xe/De)}const fe=[];for(let ve=0,Y=$.length,pe=Y-1,ye=ve+1;ve<Y;ve++,pe++,ye++)pe===Y&&(pe=0),ye===Y&&(ye=0),fe[ve]=de($[ve],$[pe],$[ye]);const Re=[];let ke,Be=fe.concat();for(let ve=0,Y=Z.length;ve<Y;ve++){const pe=Z[ve];ke=[];for(let ye=0,xe=pe.length,De=xe-1,ht=ye+1;ye<xe;ye++,De++,ht++)De===xe&&(De=0),ht===xe&&(ht=0),ke[ye]=de(pe[ye],pe[De],pe[ht]);Re.push(ke),Be=Be.concat(ke)}for(let ve=0;ve<y;ve++){const Y=ve/y,pe=m*Math.cos(Y*Math.PI/2),ye=g*Math.sin(Y*Math.PI/2)+_;for(let xe=0,De=$.length;xe<De;xe++){const ht=se($[xe],fe[xe],ye);Ae(ht.x,ht.y,-pe)}for(let xe=0,De=Z.length;xe<De;xe++){const ht=Z[xe];ke=Re[xe];for(let xt=0,_t=ht.length;xt<_t;xt++){const Gt=se(ht[xt],ke[xt],ye);Ae(Gt.x,Gt.y,-pe)}}}const J=g+_;for(let ve=0;ve<me;ve++){const Y=f?se(ne[ve],Be[ve],J):ne[ve];G?(U.copy(F.normals[0]).multiplyScalar(Y.x),R.copy(F.binormals[0]).multiplyScalar(Y.y),N.copy(I[0]).add(U).add(R),Ae(N.x,N.y,N.z)):Ae(Y.x,Y.y,0)}for(let ve=1;ve<=c;ve++)for(let Y=0;Y<me;Y++){const pe=f?se(ne[Y],Be[Y],J):ne[Y];G?(U.copy(F.normals[ve]).multiplyScalar(pe.x),R.copy(F.binormals[ve]).multiplyScalar(pe.y),N.copy(I[ve]).add(U).add(R),Ae(N.x,N.y,N.z)):Ae(pe.x,pe.y,d/c*ve)}for(let ve=y-1;ve>=0;ve--){const Y=ve/y,pe=m*Math.cos(Y*Math.PI/2),ye=g*Math.sin(Y*Math.PI/2)+_;for(let xe=0,De=$.length;xe<De;xe++){const ht=se($[xe],fe[xe],ye);Ae(ht.x,ht.y,d+pe)}for(let xe=0,De=Z.length;xe<De;xe++){const ht=Z[xe];ke=Re[xe];for(let xt=0,_t=ht.length;xt<_t;xt++){const Gt=se(ht[xt],ke[xt],ye);G?Ae(Gt.x,Gt.y+I[c-1].y,I[c-1].x+pe):Ae(Gt.x,Gt.y,d+pe)}}}function te(ve,Y){let pe=ve.length;for(;--pe>=0;){const ye=pe;let xe=pe-1;xe<0&&(xe=ve.length-1);for(let De=0,ht=c+2*y;De<ht;De++){const xt=me*De,_t=me*(De+1);Te(Y+ye+xt,Y+xe+xt,Y+xe+_t,Y+ye+_t)}}}function Ae(ve,Y,pe){l.push(ve),l.push(Y),l.push(pe)}function Ne(ve,Y,pe){Ge(ve),Ge(Y),Ge(pe);const ye=i.length/3,xe=M.generateTopUV(n,i,ye-3,ye-2,ye-1);Ye(xe[0]),Ye(xe[1]),Ye(xe[2])}function Te(ve,Y,pe,ye){Ge(ve),Ge(Y),Ge(ye),Ge(Y),Ge(pe),Ge(ye);const xe=i.length/3,De=M.generateSideWallUV(n,i,xe-6,xe-3,xe-2,xe-1);Ye(De[0]),Ye(De[1]),Ye(De[3]),Ye(De[1]),Ye(De[2]),Ye(De[3])}function Ge(ve){i.push(l[3*ve+0]),i.push(l[3*ve+1]),i.push(l[3*ve+2])}function Ye(ve){o.push(ve.x),o.push(ve.y)}(function(){const ve=i.length/3;if(f){let Y=0,pe=me*Y;for(let ye=0;ye<ge;ye++){const xe=Q[ye];Ne(xe[2]+pe,xe[1]+pe,xe[0]+pe)}Y=c+2*y,pe=me*Y;for(let ye=0;ye<ge;ye++){const xe=Q[ye];Ne(xe[0]+pe,xe[1]+pe,xe[2]+pe)}}else{for(let Y=0;Y<ge;Y++){const pe=Q[Y];Ne(pe[2],pe[1],pe[0])}for(let Y=0;Y<ge;Y++){const pe=Q[Y];Ne(pe[0]+me*c,pe[1]+me*c,pe[2]+me*c)}}n.addGroup(ve,i.length/3-ve,0)})(),function(){const ve=i.length/3;let Y=0;te($,Y),Y+=$.length;for(let pe=0,ye=Z.length;pe<ye;pe++){const xe=Z[pe];te(xe,Y),Y+=xe.length}n.addGroup(ve,i.length/3-ve,1)}()}this.setAttribute("position",new st(i,3)),this.setAttribute("uv",new st(o,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(t,n,i){if(i.shapes=[],Array.isArray(t))for(let o=0,s=t.length;o<s;o++){const a=t[o];i.shapes.push(a.uuid)}else i.shapes.push(t.uuid);return n.extrudePath!==void 0&&(i.options.extrudePath=n.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let o=0,s=e.shapes.length;o<s;o++){const a=t[e.shapes[o]];n.push(a)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new lv[i.type]().fromJSON(i)),new Ao(n,e.options)}}const vS={generateTopUV:function(r,e,t,n,i){const o=e[3*t],s=e[3*t+1],a=e[3*n],l=e[3*n+1],u=e[3*i],c=e[3*i+1];return[new Qe(o,s),new Qe(a,l),new Qe(u,c)]},generateSideWallUV:function(r,e,t,n,i,o){const s=e[3*t],a=e[3*t+1],l=e[3*t+2],u=e[3*n],c=e[3*n+1],d=e[3*n+2],f=e[3*i],m=e[3*i+1],g=e[3*i+2],_=e[3*o],y=e[3*o+1],w=e[3*o+2];return Math.abs(a-c)<Math.abs(s-u)?[new Qe(s,1-l),new Qe(u,1-d),new Qe(f,1-g),new Qe(_,1-w)]:[new Qe(a,1-l),new Qe(c,1-d),new Qe(m,1-g),new Qe(y,1-w)]}};class Nh extends St{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Nh(e.radius,e.detail)}}class Fh extends Mt{constructor(e,t=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=Ti(i,0,2*Math.PI);const o=[],s=[],a=[],l=1/t,u=new T,c=new Qe;for(let d=0;d<=t;d++){const f=n+d*l*i,m=Math.sin(f),g=Math.cos(f);for(let _=0;_<=e.length-1;_++)u.x=e[_].x*m,u.y=e[_].y,u.z=e[_].x*g,s.push(u.x,u.y,u.z),c.x=d/t,c.y=_/(e.length-1),a.push(c.x,c.y)}for(let d=0;d<t;d++)for(let f=0;f<e.length-1;f++){const m=f+d*e.length,g=m,_=m+e.length,y=m+e.length+1,w=m+1;o.push(g,_,w),o.push(_,y,w)}if(this.setIndex(o),this.setAttribute("position",new st(s,3)),this.setAttribute("uv",new st(a,2)),this.computeVertexNormals(),i===2*Math.PI){const d=this.attributes.normal.array,f=new T,m=new T,g=new T,_=t*e.length*3;for(let y=0,w=0;y<e.length;y++,w+=3)f.x=d[w+0],f.y=d[w+1],f.z=d[w+2],m.x=d[_+w+0],m.y=d[_+w+1],m.z=d[_+w+2],g.addVectors(f,m).normalize(),d[w+0]=d[_+w+0]=g.x,d[w+1]=d[_+w+1]=g.y,d[w+2]=d[_+w+2]=g.z}}static fromJSON(e){return new Fh(e.points,e.segments,e.phiStart,e.phiLength)}}class jl extends St{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new jl(e.radius,e.detail)}}class Td extends Mt{constructor(e,t,n){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};const i=[],o=[],s=[],a=[],l=1e-5,u=new T,c=new T,d=new T,f=new T,m=new T;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const g=t+1;for(let _=0;_<=n;_++){const y=_/n;for(let w=0;w<=t;w++){const M=w/t;e(M,y,c),o.push(c.x,c.y,c.z),M-l>=0?(e(M-l,y,d),f.subVectors(c,d)):(e(M+l,y,d),f.subVectors(d,c)),y-l>=0?(e(M,y-l,d),m.subVectors(c,d)):(e(M,y+l,d),m.subVectors(d,c)),u.crossVectors(f,m).normalize(),s.push(u.x,u.y,u.z),a.push(M,y)}}for(let _=0;_<n;_++)for(let y=0;y<t;y++){const w=_*g+y,M=_*g+y+1,I=(_+1)*g+y+1,F=(_+1)*g+y;i.push(w,M,F),i.push(M,I,F)}this.setIndex(i),this.setAttribute("position",new st(o,3)),this.setAttribute("normal",new st(s,3)),this.setAttribute("uv",new st(a,2))}}class Bh extends Mt{constructor(e=.5,t=1,n=8,i=1,o=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:o,thetaLength:s},n=Math.max(3,n);const a=[],l=[],u=[],c=[];let d=e;const f=(t-e)/(i=Math.max(1,i)),m=new T,g=new Qe;for(let _=0;_<=i;_++){for(let y=0;y<=n;y++){const w=o+y/n*s;m.x=d*Math.cos(w),m.y=d*Math.sin(w),l.push(m.x,m.y,m.z),u.push(0,0,1),g.x=(m.x/t+1)/2,g.y=(m.y/t+1)/2,c.push(g.x,g.y)}d+=f}for(let _=0;_<i;_++){const y=_*(n+1);for(let w=0;w<n;w++){const M=w+y,I=M,F=M+n+1,R=M+n+2,U=M+1;a.push(I,F,U),a.push(F,R,U)}}this.setIndex(a),this.setAttribute("position",new st(l,3)),this.setAttribute("normal",new st(u,3)),this.setAttribute("uv",new st(c,2))}static fromJSON(e){return new Bh(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Wl extends Mt{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],o=[],s=[];let a=0,l=0;if(Array.isArray(e)===!1)u(e);else for(let c=0;c<e.length;c++)u(e[c]),this.addGroup(a,l,c),a+=l,l=0;function u(c){const d=i.length/3,f=c.extractPoints(t);let m=f.shape;const g=f.holes;ss.isClockWise(m)===!1&&(m=m.reverse());for(let y=0,w=g.length;y<w;y++){const M=g[y];ss.isClockWise(M)===!0&&(g[y]=M.reverse())}const _=ss.triangulateShape(m,g);for(let y=0,w=g.length;y<w;y++){const M=g[y];m=m.concat(M)}for(let y=0,w=m.length;y<w;y++){const M=m[y];i.push(M.x,M.y,0),o.push(0,0,1),s.push(M.x,M.y)}for(let y=0,w=_.length;y<w;y++){const M=_[y],I=M[0]+d,F=M[1]+d,R=M[2]+d;n.push(I,F,R),l+=3}}this.setIndex(n),this.setAttribute("position",new st(i,3)),this.setAttribute("normal",new st(o,3)),this.setAttribute("uv",new st(s,2))}toJSON(){const e=super.toJSON();return function(t,n){if(n.shapes=[],Array.isArray(t))for(let i=0,o=t.length;i<o;i++){const s=t[i];n.shapes.push(s.uuid)}else n.shapes.push(t.uuid);return n}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let i=0,o=e.shapes.length;i<o;i++){const s=t[e.shapes[i]];n.push(s)}return new Wl(n,e.curveSegments)}}class Xl extends Mt{constructor(e=1,t=8,n=6,i=0,o=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:o,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(s+a,Math.PI);let u=0;const c=[],d=new T,f=new T,m=[],g=[],_=[],y=[];for(let w=0;w<=n;w++){const M=[],I=w/n;let F=0;w==0&&s==0?F=.5/t:w==n&&l==Math.PI&&(F=-.5/t);for(let R=0;R<=t;R++){const U=R/t;d.x=-e*Math.cos(i+U*o)*Math.sin(s+I*a),d.y=e*Math.cos(s+I*a),d.z=e*Math.sin(i+U*o)*Math.sin(s+I*a),g.push(d.x,d.y,d.z),f.copy(d).normalize(),_.push(f.x,f.y,f.z),y.push(U+F,1-I),M.push(u++)}c.push(M)}for(let w=0;w<n;w++)for(let M=0;M<t;M++){const I=c[w][M+1],F=c[w][M],R=c[w+1][M],U=c[w+1][M+1];(w!==0||s>0)&&m.push(I,F,U),(w!==n-1||l<Math.PI)&&m.push(F,R,U)}this.setIndex(m),this.setAttribute("position",new st(g,3)),this.setAttribute("normal",new st(_,3)),this.setAttribute("uv",new st(y,2))}static fromJSON(e){return new Xl(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Uh extends St{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Uh(e.radius,e.detail)}}class em extends Ao{constructor(e,t={}){const n=t.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Mt;const i=n.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(i,t),this.type="TextGeometry"}}class kh extends Mt{constructor(e=1,t=.4,n=8,i=6,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:o},n=Math.floor(n),i=Math.floor(i);const s=[],a=[],l=[],u=[],c=new T,d=new T,f=new T;for(let m=0;m<=n;m++)for(let g=0;g<=i;g++){const _=g/i*o,y=m/n*Math.PI*2;d.x=(e+t*Math.cos(y))*Math.cos(_),d.y=(e+t*Math.cos(y))*Math.sin(_),d.z=t*Math.sin(y),a.push(d.x,d.y,d.z),c.x=e*Math.cos(_),c.y=e*Math.sin(_),f.subVectors(d,c).normalize(),l.push(f.x,f.y,f.z),u.push(g/i),u.push(m/n)}for(let m=1;m<=n;m++)for(let g=1;g<=i;g++){const _=(i+1)*m+g-1,y=(i+1)*(m-1)+g-1,w=(i+1)*(m-1)+g,M=(i+1)*m+g;s.push(_,y,M),s.push(y,w,M)}this.setIndex(s),this.setAttribute("position",new st(a,3)),this.setAttribute("normal",new st(l,3)),this.setAttribute("uv",new st(u,2))}static fromJSON(e){return new kh(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Gh extends Mt{constructor(e=1,t=.4,n=64,i=8,o=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:o,q:s},n=Math.floor(n),i=Math.floor(i);const a=[],l=[],u=[],c=[],d=new T,f=new T,m=new T,g=new T,_=new T,y=new T,w=new T;for(let I=0;I<=n;++I){const F=I/n*o*Math.PI*2;M(F,o,s,e,m),M(F+.01,o,s,e,g),y.subVectors(g,m),w.addVectors(g,m),_.crossVectors(y,w),w.crossVectors(_,y),_.normalize(),w.normalize();for(let R=0;R<=i;++R){const U=R/i*Math.PI*2,N=-t*Math.cos(U),G=t*Math.sin(U);d.x=m.x+(N*w.x+G*_.x),d.y=m.y+(N*w.y+G*_.y),d.z=m.z+(N*w.z+G*_.z),l.push(d.x,d.y,d.z),f.subVectors(d,m).normalize(),u.push(f.x,f.y,f.z),c.push(I/n),c.push(R/i)}}for(let I=1;I<=n;I++)for(let F=1;F<=i;F++){const R=(i+1)*(I-1)+(F-1),U=(i+1)*I+(F-1),N=(i+1)*I+F,G=(i+1)*(I-1)+F;a.push(R,U,G),a.push(U,N,G)}function M(I,F,R,U,N){const G=Math.cos(I),he=Math.sin(I),ne=R/F*I,Z=Math.cos(ne);N.x=U*(2+Z)*.5*G,N.y=U*(2+Z)*he*.5,N.z=U*Math.sin(ne)*.5}this.setIndex(a),this.setAttribute("position",new st(l,3)),this.setAttribute("normal",new st(u,3)),this.setAttribute("uv",new st(c,2))}static fromJSON(e){return new Gh(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Hh extends Mt{constructor(e,t=64,n=1,i=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:o};const s=e.computeFrenetFrames(t,o);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new T,l=new T,u=new Qe;let c=new T;const d=[],f=[],m=[],g=[];function _(y){c=e.getPointAt(y/t,c);const w=s.normals[y],M=s.binormals[y];for(let I=0;I<=i;I++){const F=I/i*Math.PI*2,R=Math.sin(F),U=-Math.cos(F);l.x=U*w.x+R*M.x,l.y=U*w.y+R*M.y,l.z=U*w.z+R*M.z,l.normalize(),f.push(l.x,l.y,l.z),a.x=c.x+n*l.x,a.y=c.y+n*l.y,a.z=c.z+n*l.z,d.push(a.x,a.y,a.z)}}(function(){for(let y=0;y<t;y++)_(y);_(o===!1?t:0),function(){for(let y=0;y<=t;y++)for(let w=0;w<=i;w++)u.x=y/t,u.y=w/i,m.push(u.x,u.y)}(),function(){for(let y=1;y<=t;y++)for(let w=1;w<=i;w++){const M=(i+1)*(y-1)+(w-1),I=(i+1)*y+(w-1),F=(i+1)*y+w,R=(i+1)*(y-1)+w;g.push(M,I,R),g.push(I,F,R)}}()})(),this.setIndex(g),this.setAttribute("position",new st(d,3)),this.setAttribute("normal",new st(f,3)),this.setAttribute("uv",new st(m,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Hh(new lv[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class cv extends Mt{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const t=[],n=[0,0],i={},o=new T;if(e.index!==null){const s=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let u=0,c=l.length;u<c;++u){const d=l[u],f=d.start;for(let m=f,g=f+d.count;m<g;m+=3)for(let _=0;_<3;_++){const y=a.getX(m+_),w=a.getX(m+(_+1)%3);n[0]=Math.min(y,w),n[1]=Math.max(y,w);const M=n[0]+","+n[1];i[M]===void 0&&(i[M]={index1:n[0],index2:n[1]})}}for(const u in i){const c=i[u];o.fromBufferAttribute(s,c.index1),t.push(o.x,o.y,o.z),o.fromBufferAttribute(s,c.index2),t.push(o.x,o.y,o.z)}}else{const s=e.attributes.position;for(let a=0,l=s.count/3;a<l;a++)for(let u=0;u<3;u++){const c=3*a+u;o.fromBufferAttribute(s,c),t.push(o.x,o.y,o.z);const d=3*a+(u+1)%3;o.fromBufferAttribute(s,d),t.push(o.x,o.y,o.z)}}this.setAttribute("position",new st(t,3))}}var sy=Object.freeze({__proto__:null,BoxGeometry:Qr,BoxBufferGeometry:Qr,CircleGeometry:nt,CircleBufferGeometry:nt,ConeGeometry:mt,ConeBufferGeometry:mt,CylinderGeometry:Et,CylinderBufferGeometry:Et,DodecahedronGeometry:It,DodecahedronBufferGeometry:It,EdgesGeometry:Ei,ExtrudeGeometry:Ao,ExtrudeBufferGeometry:Ao,IcosahedronGeometry:Nh,IcosahedronBufferGeometry:Nh,LatheGeometry:Fh,LatheBufferGeometry:Fh,OctahedronGeometry:jl,OctahedronBufferGeometry:jl,ParametricGeometry:Td,ParametricBufferGeometry:Td,PlaneGeometry:Ii,PlaneBufferGeometry:Ii,PolyhedronGeometry:St,PolyhedronBufferGeometry:St,RingGeometry:Bh,RingBufferGeometry:Bh,ShapeGeometry:Wl,ShapeBufferGeometry:Wl,SphereGeometry:Xl,SphereBufferGeometry:Xl,TetrahedronGeometry:Uh,TetrahedronBufferGeometry:Uh,TextGeometry:em,TextBufferGeometry:em,TorusGeometry:kh,TorusBufferGeometry:kh,TorusKnotGeometry:Gh,TorusKnotBufferGeometry:Gh,TubeGeometry:Hh,TubeBufferGeometry:Hh,WireframeGeometry:cv});class dv extends vi{constructor(e){super(),this.type="ShadowMaterial",this.color=new gt(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}dv.prototype.isShadowMaterial=!0;class zh extends ki{constructor(e){super(e),this.type="RawShaderMaterial"}}zh.prototype.isRawShaderMaterial=!0;class tm extends vi{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new gt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}tm.prototype.isMeshStandardMaterial=!0;class pv extends tm{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Qe(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=Ti(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new gt(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new gt).copy(e.sheen):this.sheen=null,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this}}pv.prototype.isMeshPhysicalMaterial=!0;class nm extends vi{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new gt(16777215),this.specular=new gt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=rl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}nm.prototype.isMeshPhongMaterial=!0;class fv extends vi{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new gt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}fv.prototype.isMeshToonMaterial=!0;class mv extends vi{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}mv.prototype.isMeshNormalMaterial=!0;class im extends vi{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new gt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=rl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}im.prototype.isMeshLambertMaterial=!0;class gv extends vi{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new gt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pr,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}gv.prototype.isMeshMatcapMaterial=!0;class vv extends yi{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}vv.prototype.isLineDashedMaterial=!0;var _S=Object.freeze({__proto__:null,ShadowMaterial:dv,SpriteMaterial:Bl,RawShaderMaterial:zh,ShaderMaterial:ki,PointsMaterial:j,MeshPhysicalMaterial:pv,MeshStandardMaterial:tm,MeshPhongMaterial:nm,MeshToonMaterial:fv,MeshNormalMaterial:mv,MeshLambertMaterial:im,MeshDepthMaterial:on,MeshDistanceMaterial:bh,MeshBasicMaterial:Kn,MeshMatcapMaterial:gv,LineDashedMaterial:vv,LineBasicMaterial:yi,Material:vi});const Gn={arraySlice:function(r,e,t){return Gn.isTypedArray(r)?new r.constructor(r.subarray(e,t!==void 0?t:r.length)):r.slice(e,t)},convertArray:function(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)},isTypedArray:function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},getKeyframeOrder:function(r){const e=r.length,t=new Array(e);for(let n=0;n!==e;++n)t[n]=n;return t.sort(function(n,i){return r[n]-r[i]}),t},sortedArray:function(r,e,t){const n=r.length,i=new r.constructor(n);for(let o=0,s=0;s!==n;++o){const a=t[o]*e;for(let l=0;l!==e;++l)i[s++]=r[a+l]}return i},flattenJSON:function(r,e,t,n){let i=1,o=r[0];for(;o!==void 0&&o[n]===void 0;)o=r[i++];if(o===void 0)return;let s=o[n];if(s!==void 0)if(Array.isArray(s))do s=o[n],s!==void 0&&(e.push(o.time),t.push.apply(t,s)),o=r[i++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[n],s!==void 0&&(e.push(o.time),s.toArray(t,t.length)),o=r[i++];while(o!==void 0);else do s=o[n],s!==void 0&&(e.push(o.time),t.push(s)),o=r[i++];while(o!==void 0)},subclip:function(r,e,t,n,i=30){const o=r.clone();o.name=e;const s=[];for(let l=0;l<o.tracks.length;++l){const u=o.tracks[l],c=u.getValueSize(),d=[],f=[];for(let m=0;m<u.times.length;++m){const g=u.times[m]*i;if(!(g<t||g>=n)){d.push(u.times[m]);for(let _=0;_<c;++_)f.push(u.values[m*c+_])}}d.length!==0&&(u.times=Gn.convertArray(d,u.times.constructor),u.values=Gn.convertArray(f,u.values.constructor),s.push(u))}o.tracks=s;let a=1/0;for(let l=0;l<o.tracks.length;++l)a>o.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l<o.tracks.length;++l)o.tracks[l].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(r,e=0,t=r,n=30){n<=0&&(n=30);const i=t.tracks.length,o=e/n;for(let s=0;s<i;++s){const a=t.tracks[s],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const u=r.tracks.find(function(w){return w.name===a.name&&w.ValueTypeName===l});if(u===void 0)continue;let c=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=d/3);let f=0;const m=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=m/3);const g=a.times.length-1;let _;if(o<=a.times[0]){const w=c,M=d-c;_=Gn.arraySlice(a.values,w,M)}else if(o>=a.times[g]){const w=g*d+c,M=w+d-c;_=Gn.arraySlice(a.values,w,M)}else{const w=a.createInterpolant(),M=c,I=d-c;w.evaluate(o),_=Gn.arraySlice(w.resultBuffer,M,I)}l==="quaternion"&&new gi().fromArray(_).normalize().conjugate().toArray(_);const y=u.times.length;for(let w=0;w<y;++w){const M=w*m+f;if(l==="quaternion")gi.multiplyQuaternionsFlat(u.values,M,_,0,u.values,M);else{const I=m-2*f;for(let F=0;F<I;++F)u.values[M+F]-=_[F]}}}return r.blendMode=we,r}};class ta{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],o=t[n-1];e:{t:{let s;n:{i:if(!(e<i)){for(let a=n+2;;){if(i===void 0){if(e<o)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,o)}if(n===a)break;if(o=i,i=t[++n],e<i)break t}s=t.length;break n}if(e>=o)break e;{const a=t[1];e<a&&(n=2,o=a);for(let l=n-2;;){if(o===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===l)break;if(i=o,o=t[--n-1],e>=o)break t}s=n,n=0}}for(;n<s;){const a=n+s>>>1;e<t[a]?s=a:n=a+1}if(i=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(i===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,o,e)}this._cachedIndex=n,this.intervalChanged_(n,o,i)}return this.interpolate_(n,o,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i;for(let s=0;s!==i;++s)t[s]=n[o+s];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ta.prototype.beforeStart_=ta.prototype.copySampleValue_,ta.prototype.afterEnd_=ta.prototype.copySampleValue_;class ay extends ta{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:bi,endingEnd:bi}}intervalChanged_(e,t,n){const i=this.parameterPositions;let o=e-2,s=e+1,a=i[o],l=i[s];if(a===void 0)switch(this.getSettings_().endingStart){case jo:o=e,a=2*t-n;break;case fl:o=i.length-2,a=t+i[o]-i[o+1];break;default:o=e,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case jo:s=e,l=2*n-t;break;case fl:s=1,l=n+i[1]-i[0];break;default:s=e-1,l=t}const u=.5*(n-t),c=this.valueSize;this._weightPrev=u/(t-a),this._weightNext=u/(l-n),this._offsetPrev=o*c,this._offsetNext=s*c}interpolate_(e,t,n,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,c=this._offsetPrev,d=this._offsetNext,f=this._weightPrev,m=this._weightNext,g=(n-t)/(i-t),_=g*g,y=_*g,w=-f*y+2*f*_-f*g,M=(1+f)*y+(-1.5-2*f)*_+(-.5+f)*g+1,I=(-1-m)*y+(1.5+m)*_+.5*g,F=m*y-m*_;for(let R=0;R!==a;++R)o[R]=w*s[c+R]+M*s[u+R]+I*s[l+R]+F*s[d+R];return o}}class _v extends ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,c=(n-t)/(i-t),d=1-c;for(let f=0;f!==a;++f)o[f]=s[u+f]*d+s[l+f]*c;return o}}class ly extends ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Po{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Gn.convertArray(t,this.TimeBufferType),this.values=Gn.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Gn.convertArray(e.times,Array),values:Gn.convertArray(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new ly(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new _v(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new ay(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Vo:t=this.InterpolantFactoryMethodDiscrete;break;case pl:t=this.InterpolantFactoryMethodLinear;break;case mo:t=this.InterpolantFactoryMethodSmooth}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Vo;case this.InterpolantFactoryMethodLinear:return pl;case this.InterpolantFactoryMethodSmooth:return mo}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let o=0,s=i-1;for(;o!==i&&n[o]<e;)++o;for(;s!==-1&&n[s]>t;)--s;if(++s,o!==0||s!==i){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=Gn.arraySlice(n,o,s),this.values=Gn.arraySlice(this.values,o*a,s*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,o=n.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==o;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,s),e=!1;break}s=l}if(i!==void 0&&Gn.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){const u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=Gn.arraySlice(this.times),t=Gn.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===mo,o=e.length-1;let s=1;for(let a=1;a<o;++a){let l=!1;const u=e[a];if(u!==e[a+1]&&(a!==1||u!==e[0]))if(i)l=!0;else{const c=a*n,d=c-n,f=c+n;for(let m=0;m!==n;++m){const g=t[c+m];if(g!==t[d+m]||g!==t[f+m]){l=!0;break}}}if(l){if(a!==s){e[s]=e[a];const c=a*n,d=s*n;for(let f=0;f!==n;++f)t[d+f]=t[c+f]}++s}}if(o>0){e[s]=e[o];for(let a=o*n,l=s*n,u=0;u!==n;++u)t[l+u]=t[a+u];++s}return s!==e.length?(this.times=Gn.arraySlice(e,0,s),this.values=Gn.arraySlice(t,0,s*n)):(this.times=e,this.values=t),this}clone(){const e=Gn.arraySlice(this.times,0),t=Gn.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Po.prototype.TimeBufferType=Float32Array,Po.prototype.ValueBufferType=Float32Array,Po.prototype.DefaultInterpolation=pl;class Yl extends Po{}Yl.prototype.ValueTypeName="bool",Yl.prototype.ValueBufferType=Array,Yl.prototype.DefaultInterpolation=Vo,Yl.prototype.InterpolantFactoryMethodLinear=void 0,Yl.prototype.InterpolantFactoryMethodSmooth=void 0;class yv extends Po{}yv.prototype.ValueTypeName="color";class Sd extends Po{}Sd.prototype.ValueTypeName="number";class uy extends ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t);let u=e*a;for(let c=u+a;u!==c;u+=4)gi.slerpFlat(o,0,s,u-a,s,u,l);return o}}class Vh extends Po{InterpolantFactoryMethodLinear(e){return new uy(this.times,this.values,this.getValueSize(),e)}}Vh.prototype.ValueTypeName="quaternion",Vh.prototype.DefaultInterpolation=pl,Vh.prototype.InterpolantFactoryMethodSmooth=void 0;class ql extends Po{}ql.prototype.ValueTypeName="string",ql.prototype.ValueBufferType=Array,ql.prototype.DefaultInterpolation=Vo,ql.prototype.InterpolantFactoryMethodLinear=void 0,ql.prototype.InterpolantFactoryMethodSmooth=void 0;class Ed extends Po{}Ed.prototype.ValueTypeName="vector";class Md{constructor(e,t=-1,n,i=Cs){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=ir(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let s=0,a=n.length;s!==a;++s)t.push(yS(n[s]).scale(i));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,s=n.length;o!==s;++o)t.push(Po.toJSON(n[o]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const o=t.length,s=[];for(let a=0;a<o;a++){let l=[],u=[];l.push((a+o-1)%o,a,(a+1)%o),u.push(0,1,0);const c=Gn.getKeyframeOrder(l);l=Gn.sortedArray(l,1,c),u=Gn.sortedArray(u,1,c),i||l[0]!==0||(l.push(o),u.push(u[0])),s.push(new Sd(".morphTargetInfluences["+t[a].name+"]",l,u).scale(1/n))}return new this(e,-1,s)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},o=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const u=e[a],c=u.name.match(o);if(c&&c.length>1){const d=c[1];let f=i[d];f||(i[d]=f=[]),f.push(u)}}const s=[];for(const a in i)s.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(c,d,f,m,g){if(f.length!==0){const _=[],y=[];Gn.flattenJSON(f,_,y,m),_.length!==0&&g.push(new c(d,_,y))}},i=[],o=e.name||"default",s=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let c=0;c<u.length;c++){const d=u[c].keys;if(d&&d.length!==0)if(d[0].morphTargets){const f={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let g=0;g<d[m].morphTargets.length;g++)f[d[m].morphTargets[g]]=-1;for(const g in f){const _=[],y=[];for(let w=0;w!==d[m].morphTargets.length;++w){const M=d[m];_.push(M.time),y.push(M.morphTarget===g?1:0)}i.push(new Sd(".morphTargetInfluence["+g+"]",_,y))}l=f.length*(s||1)}else{const f=".bones["+t[c].name+"]";n(Ed,f+".position",d,"pos",i),n(Vh,f+".quaternion",d,"rot",i),n(Ed,f+".scale",d,"scl",i)}}return i.length===0?null:new this(o,l,i,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function yS(r){if(r.type===void 0)throw new Error("THREE.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 Sd;case"vector":case"vector2":case"vector3":case"vector4":return Ed;case"color":return yv;case"quaternion":return Vh;case"bool":case"boolean":return Yl;case"string":return ql}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(r.type);if(r.times===void 0){const t=[],n=[];Gn.flattenJSON(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const Zl={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class xv{constructor(e,t,n){const i=this;let o=!1,s=0,a=0,l;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(c){a++,o===!1&&i.onStart!==void 0&&i.onStart(c,s,a),o=!0},this.itemEnd=function(c){s++,i.onProgress!==void 0&&i.onProgress(c,s,a),s===a&&(o=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(c){i.onError!==void 0&&i.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,d){return u.push(c,d),this},this.removeHandler=function(c){const d=u.indexOf(c);return d!==-1&&u.splice(d,2),this},this.getHandler=function(c){for(let d=0,f=u.length;d<f;d+=2){const m=u[d],g=u[d+1];if(m.global&&(m.lastIndex=0),m.test(c))return g}return null}}}const hy=new xv;class Ji{constructor(e){this.manager=e!==void 0?e:hy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,o){n.load(e,i,t,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Co={};class Ro extends Ji{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=Zl.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;if(Co[e]!==void 0)return void Co[e].push({onLoad:t,onProgress:n,onError:i});const a=e.match(/^data:(.*?)(;base64)?,(.*)$/);let l;if(a){const u=a[1],c=!!a[2];let d=a[3];d=decodeURIComponent(d),c&&(d=atob(d));try{let f;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const g=new Uint8Array(d.length);for(let y=0;y<d.length;y++)g[y]=d.charCodeAt(y);f=m==="blob"?new Blob([g.buffer],{type:u}):g.buffer;break;case"document":f=new DOMParser().parseFromString(d,u);break;case"json":f=JSON.parse(d);break;default:f=d}setTimeout(function(){t&&t(f),o.manager.itemEnd(e)},0)}catch(f){setTimeout(function(){i&&i(f),o.manager.itemError(e),o.manager.itemEnd(e)},0)}}else{Co[e]=[],Co[e].push({onLoad:t,onProgress:n,onError:i}),l=new XMLHttpRequest,l.open("GET",e,!0),l.addEventListener("load",function(u){const c=this.response,d=Co[e];if(delete Co[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Zl.add(e,c);for(let f=0,m=d.length;f<m;f++){const g=d[f];g.onLoad&&g.onLoad(c)}o.manager.itemEnd(e)}else{for(let f=0,m=d.length;f<m;f++){const g=d[f];g.onError&&g.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)}},!1),l.addEventListener("progress",function(u){const c=Co[e];for(let d=0,f=c.length;d<f;d++){const m=c[d];m.onProgress&&m.onProgress(u)}},!1),l.addEventListener("error",function(u){const c=Co[e];delete Co[e];for(let d=0,f=c.length;d<f;d++){const m=c[d];m.onError&&m.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)},!1),l.addEventListener("abort",function(u){const c=Co[e];delete Co[e];for(let d=0,f=c.length;d<f;d++){const m=c[d];m.onError&&m.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)},!1),this.responseType!==void 0&&(l.responseType=this.responseType),this.withCredentials!==void 0&&(l.withCredentials=this.withCredentials),l.overrideMimeType&&l.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const u in this.requestHeader)l.setRequestHeader(u,this.requestHeader[u]);l.send(null)}return o.manager.itemStart(e),l}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class xS extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new Ro(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{t(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Md.parse(e[n]);t.push(i)}return t}}class bS extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=[],a=new yt,l=new Ro(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(o.withCredentials);let u=0;function c(d){l.load(e[d],function(f){const m=o.parse(f,!0);s[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},u+=1,u===6&&(m.mipmapCount===1&&(a.minFilter=Jn),a.image=s,a.format=m.format,a.needsUpdate=!0,t&&t(a))},n,i)}if(Array.isArray(e))for(let d=0,f=e.length;d<f;++d)c(d);else l.load(e,function(d){const f=o.parse(d,!0);if(f.isCubemap){const m=f.mipmaps.length/f.mipmapCount;for(let g=0;g<m;g++){s[g]={mipmaps:[]};for(let _=0;_<f.mipmapCount;_++)s[g].mipmaps.push(f.mipmaps[g*f.mipmapCount+_]),s[g].format=f.format,s[g].width=f.width,s[g].height=f.height}a.image=s}else a.image.width=f.width,a.image.height=f.height,a.mipmaps=f.mipmaps;f.mipmapCount===1&&(a.minFilter=Jn),a.format=f.format,a.needsUpdate=!0,t&&t(a)},n,i);return a}}class Ad extends Ji{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=Zl.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function l(){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),Zl.add(e,this),t&&t(this),o.manager.itemEnd(e)}function u(c){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),i&&i(c),o.manager.itemError(e),o.manager.itemEnd(e)}return a.addEventListener("load",l,!1),a.addEventListener("error",u,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(e),a.src=e,a}}class cy extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=new Br,s=new Ad(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function l(u){s.load(e[u],function(c){o.images[u]=c,a++,a===6&&(o.needsUpdate=!0,t&&t(o))},void 0,i)}for(let u=0;u<e.length;++u)l(u);return o}}class dy extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new ns,a=new Ro(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(o.withCredentials),a.load(e,function(l){const u=o.parse(l);u&&(u.image!==void 0?s.image=u.image:u.data!==void 0&&(s.image.width=u.width,s.image.height=u.height,s.image.data=u.data),s.wrapS=u.wrapS!==void 0?u.wrapS:mi,s.wrapT=u.wrapT!==void 0?u.wrapT:mi,s.magFilter=u.magFilter!==void 0?u.magFilter:Jn,s.minFilter=u.minFilter!==void 0?u.minFilter:Jn,s.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.encoding!==void 0&&(s.encoding=u.encoding),u.flipY!==void 0&&(s.flipY=u.flipY),u.format!==void 0&&(s.format=u.format),u.type!==void 0&&(s.type=u.type),u.mipmaps!==void 0&&(s.mipmaps=u.mipmaps,s.minFilter=Ts),u.mipmapCount===1&&(s.minFilter=Jn),u.generateMipmaps!==void 0&&(s.generateMipmaps=u.generateMipmaps),s.needsUpdate=!0,t&&t(s,u))},n,i),s}}class bv extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=new $n,s=new Ad(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(a){o.image=a;const l=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;o.format=l?co:er,o.needsUpdate=!0,t!==void 0&&t(o)},n,i),o}}class py extends Xn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ja(t,e))}getPoint(e){const t=e*this.getLength(),n=this.getCurveLengths();let i=0;for(;i<n.length;){if(n[i]>=t){const o=n[i]-t,s=this.curves[i],a=s.getLength(),l=a===0?0:1-o/a;return s.getPointAt(l)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,o=this.curves;i<o.length;i++){const s=o[i],a=s&&s.isEllipseCurve?2*e:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?e*s.points.length:e,l=s.getPoints(a);for(let u=0;u<l.length;u++){const c=l[u];n&&n.equals(c)||(t.push(c),n=c)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(new lv[i.type]().fromJSON(i))}return this}}class Jl extends py{constructor(e){super(),this.type="Path",this.currentPoint=new Qe,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new ja(this.currentPoint.clone(),new Qe(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const o=new ea(this.currentPoint.clone(),new Qe(e,t),new Qe(n,i));return this.curves.push(o),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,o,s){const a=new Qs(this.currentPoint.clone(),new Qe(e,t),new Qe(n,i),new Qe(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Jf(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,o,s){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,i,o,s),this}absarc(e,t,n,i,o,s){return this.absellipse(e,t,n,n,i,o,s),this}ellipse(e,t,n,i,o,s,a,l){const u=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+u,t+c,n,i,o,s,a,l),this}absellipse(e,t,n,i,o,s,a,l){const u=new kn(e,t,n,i,o,s,a,l);if(this.curves.length>0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Xa extends Jl{constructor(e){super(e),this.uuid=ir(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(new Jl().fromJSON(i))}return this}}class Io extends Xt{constructor(e,t=1){super(),this.type="Light",this.color=new gt(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}Io.prototype.isLight=!0;class wv extends Io{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(Xt.DefaultUp),this.updateMatrix(),this.groundColor=new gt(t)}copy(e){return Io.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}wv.prototype.isHemisphereLight=!0;const fy=new pt,my=new T,gy=new T;class Tv{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Qe(512,512),this.map=null,this.mapPass=null,this.matrix=new pt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Da,this._frameExtents=new Qe(1,1),this._viewportCount=1,this._viewports=[new pn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;my.setFromMatrixPosition(e.matrixWorld),t.position.copy(my),gy.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(gy),t.updateMatrixWorld(),fy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(fy),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),this.mapSize.x===512&&this.mapSize.y===512||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class vy extends Tv{constructor(){super(new Qn(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=2*ni*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;n===t.fov&&i===t.aspect&&o===t.far||(t.fov=n,t.aspect=i,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}vy.prototype.isSpotLightShadow=!0;class Sv extends Io{constructor(e,t,n=0,i=Math.PI/3,o=0,s=1){super(e,t),this.type="SpotLight",this.position.copy(Xt.DefaultUp),this.updateMatrix(),this.target=new Xt,this.distance=n,this.angle=i,this.penumbra=o,this.decay=s,this.shadow=new vy}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Sv.prototype.isSpotLight=!0;const _y=new pt,Pd=new T,Ev=new T;class yy extends Tv{constructor(){super(new Qn(90,1,.5,500)),this._frameExtents=new Qe(4,2),this._viewportCount=6,this._viewports=[new pn(2,1,1,1),new pn(0,1,1,1),new pn(3,1,1,1),new pn(1,1,1,1),new pn(3,0,1,1),new pn(1,0,1,1)],this._cubeDirections=[new T(1,0,0),new T(-1,0,0),new T(0,0,1),new T(0,0,-1),new T(0,1,0),new T(0,-1,0)],this._cubeUps=[new T(0,1,0),new T(0,1,0),new T(0,1,0),new T(0,1,0),new T(0,0,1),new T(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,o=e.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),Pd.setFromMatrixPosition(e.matrixWorld),n.position.copy(Pd),Ev.copy(n.position),Ev.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Ev),n.updateMatrixWorld(),i.makeTranslation(-Pd.x,-Pd.y,-Pd.z),_y.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_y)}}yy.prototype.isPointLightShadow=!0;class Mv extends Io{constructor(e,t,n=0,i=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new yy}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Mv.prototype.isPointLight=!0;class jh extends zs{constructor(e=-1,t=1,n=1,i=-1,o=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=n-e,s=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}jh.prototype.isOrthographicCamera=!0;class xy extends Tv{constructor(){super(new jh(-5,5,5,-5,.5,500))}}xy.prototype.isDirectionalLightShadow=!0;class rm extends Io{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Xt.DefaultUp),this.updateMatrix(),this.target=new Xt,this.shadow=new xy}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}rm.prototype.isDirectionalLight=!0;class om extends Io{constructor(e,t){super(e,t),this.type="AmbientLight"}}om.prototype.isAmbientLight=!0;class Av extends Io{constructor(e,t,n=10,i=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=i}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Av.prototype.isRectAreaLight=!0;class Pv{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new T)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,o=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*i),t.addScaledVector(s[2],.488603*o),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*i*1.092548),t.addScaledVector(s[5],i*o*1.092548),t.addScaledVector(s[6],.315392*(3*o*o-1)),t.addScaledVector(s[7],n*o*1.092548),t.addScaledVector(s[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,o=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*i),t.addScaledVector(s[2],1.023328*o),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*i),t.addScaledVector(s[5],.858086*i*o),t.addScaledVector(s[6],.743125*o*o-.247708),t.addScaledVector(s[7],.858086*n*o),t.addScaledVector(s[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}static getBasisAt(e,t){const n=e.x,i=e.y,o=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*o,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*o,t[6]=.315392*(3*o*o-1),t[7]=1.092548*n*o,t[8]=.546274*(n*n-i*i)}}Pv.prototype.isSphericalHarmonics3=!0;class Cd extends Io{constructor(e=new Pv,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Cd.prototype.isLightProbe=!0;class by extends Ji{constructor(e){super(e),this.textures={}}load(e,t,n,i){const o=this,s=new Ro(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(a){try{t(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},n,i)}parse(e){const t=this.textures;function n(o){return t[o]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",o),t[o]}const i=new _S[e.type];if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=new gt().setHex(e.sheen)),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==1&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(i.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(i.morphNormals=e.morphNormals),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(i.vertexTangents=e.vertexTangents),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const s=e.uniforms[o];switch(i.uniforms[o]={},s.type){case"t":i.uniforms[o].value=n(s.value);break;case"c":i.uniforms[o].value=new gt().setHex(s.value);break;case"v2":i.uniforms[o].value=new Qe().fromArray(s.value);break;case"v3":i.uniforms[o].value=new T().fromArray(s.value);break;case"v4":i.uniforms[o].value=new pn().fromArray(s.value);break;case"m3":i.uniforms[o].value=new En().fromArray(s.value);break;case"m4":i.uniforms[o].value=new pt().fromArray(s.value);break;default:i.uniforms[o].value=s.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const o in e.extensions)i.extensions[o]=e.extensions[o];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),i.normalScale=new Qe().fromArray(o)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Qe().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}}class sm{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class Cv extends Mt{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Cv.prototype.isInstancedBufferGeometry=!0;class Rv extends Zt{constructor(e,t,n,i=1){typeof n=="number"&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Rv.prototype.isInstancedBufferAttribute=!0;class wy extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new Ro(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(a){try{t(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(d,f){if(t[f]!==void 0)return t[f];const m=d.interleavedBuffers[f],g=function(w,M){if(n[M]!==void 0)return n[M];const I=w.arrayBuffers[M],F=new Uint32Array(I).buffer;return n[M]=F,F}(d,m.buffer),_=Us(m.type,g),y=new qs(_,m.stride);return y.uuid=m.uuid,t[f]=y,y}const o=e.isInstancedBufferGeometry?new Cv:new Mt,s=e.data.index;if(s!==void 0){const d=Us(s.type,s.array);o.setIndex(new Zt(d,1))}const a=e.data.attributes;for(const d in a){const f=a[d];let m;if(f.isInterleavedBufferAttribute){const g=i(e.data,f.data);m=new Mo(g,f.itemSize,f.offset,f.normalized)}else{const g=Us(f.type,f.array);m=new(f.isInstancedBufferAttribute?Rv:Zt)(g,f.itemSize,f.normalized)}f.name!==void 0&&(m.name=f.name),f.usage!==void 0&&m.setUsage(f.usage),f.updateRange!==void 0&&(m.updateRange.offset=f.updateRange.offset,m.updateRange.count=f.updateRange.count),o.setAttribute(d,m)}const l=e.data.morphAttributes;if(l)for(const d in l){const f=l[d],m=[];for(let g=0,_=f.length;g<_;g++){const y=f[g];let w;if(y.isInterleavedBufferAttribute){const M=i(e.data,y.data);w=new Mo(M,y.itemSize,y.offset,y.normalized)}else{const M=Us(y.type,y.array);w=new Zt(M,y.itemSize,y.normalized)}y.name!==void 0&&(w.name=y.name),m.push(w)}o.morphAttributes[d]=m}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const u=e.data.groups||e.data.drawcalls||e.data.offsets;if(u!==void 0)for(let d=0,f=u.length;d!==f;++d){const m=u[d];o.addGroup(m.start,m.count,m.materialIndex)}const c=e.data.boundingSphere;if(c!==void 0){const d=new T;c.center!==void 0&&d.fromArray(c.center),o.boundingSphere=new li(d,c.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class wS extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=this.path===""?sm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const a=new Ro(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let u=null;try{u=JSON.parse(l)}catch(d){return i!==void 0&&i(d),void console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message)}const c=u.metadata;c!==void 0&&c.type!==void 0&&c.type.toLowerCase()!=="geometry"?o.parse(u,t):console.error("THREE.ObjectLoader: Can't load "+e)},n,i)}async loadAsync(e,t){const n=this.path===""?sm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const i=new Ro(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);const o=await i.loadAsync(e,t),s=JSON.parse(o),a=s.metadata;if(a===void 0||a.type===void 0||a.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(s)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),o=this.parseGeometries(e.geometries,i),s=this.parseImages(e.images,function(){t!==void 0&&t(u)}),a=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,a),u=this.parseObject(e.object,o,l,a,n),c=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,c),t!==void 0){let d=!1;for(const f in s)if(s[f]instanceof HTMLImageElement){d=!0;break}d===!1&&t(u)}return u}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),o=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,o),a=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,i,a,s,t),u=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,u),l}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const o=new Xa().fromJSON(e[n]);t[o.uuid]=o}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(o){o.isBone&&(i[o.uuid]=o)}),e!==void 0)for(let o=0,s=e.length;o<s;o++){const a=new Ch().fromJSON(e[o],i);n[a.uuid]=a}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new wy;for(let o=0,s=e.length;o<s;o++){let a;const l=e[o];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(l);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:l.type in sy?a=sy[l.type].fromJSON(l,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),a.isBufferGeometry===!0&&l.userData!==void 0&&(a.userData=l.userData),n[l.uuid]=a}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const o=new by;o.setTextures(t);for(let s=0,a=e.length;s<a;s++){const l=e[s];if(l.type==="MultiMaterial"){const u=[];for(let c=0;c<l.materials.length;c++){const d=l.materials[c];n[d.uuid]===void 0&&(n[d.uuid]=o.parse(d)),u.push(n[d.uuid])}i[l.uuid]=u}else n[l.uuid]===void 0&&(n[l.uuid]=o.parse(l)),i[l.uuid]=n[l.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const i=e[n],o=Md.parse(i);t[o.uuid]=o}return t}parseImages(e,t){const n=this,i={};let o;function s(a){if(typeof a=="string"){const l=a;return function(u){return n.manager.itemStart(u),o.load(u,function(){n.manager.itemEnd(u)},void 0,function(){n.manager.itemError(u),n.manager.itemEnd(u)})}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:n.resourcePath+l)}return a.data?{data:Us(a.type,a.data),width:a.width,height:a.height}:null}if(e!==void 0&&e.length>0){const a=new xv(t);o=new Ad(a),o.setCrossOrigin(this.crossOrigin);for(let l=0,u=e.length;l<u;l++){const c=e[l],d=c.url;if(Array.isArray(d)){i[c.uuid]=[];for(let f=0,m=d.length;f<m;f++){const g=s(d[f]);g!==null&&(g instanceof HTMLImageElement?i[c.uuid].push(g):i[c.uuid].push(new ns(g.data,g.width,g.height)))}}else{const f=s(c.url);f!==null&&(i[c.uuid]=f)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function o(s){if(typeof s=="string"){const a=s,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await i.loadAsync(l)}return s.data?{data:Us(s.type,s.data),width:s.width,height:s.height}:null}if(e!==void 0&&e.length>0){i=new Ad(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,a=e.length;s<a;s++){const l=e[s],u=l.url;if(Array.isArray(u)){n[l.uuid]=[];for(let c=0,d=u.length;c<d;c++){const f=u[c],m=await o(f);m!==null&&(m instanceof HTMLImageElement?n[l.uuid].push(m):n[l.uuid].push(new ns(m.data,m.width,m.height)))}}else{const c=await o(l.url);c!==null&&(n[l.uuid]=c)}}}return n}parseTextures(e,t){function n(o,s){return typeof o=="number"?o:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",o),s[o])}const i={};if(e!==void 0)for(let o=0,s=e.length;o<s;o++){const a=e[o];let l;a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const u=t[a.image];Array.isArray(u)?(l=new Br(u),u.length===6&&(l.needsUpdate=!0)):(l=u&&u.data?new ns(u.data,u.width,u.height):new $n(u),u&&(l.needsUpdate=!0)),l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),a.mapping!==void 0&&(l.mapping=n(a.mapping,TS)),a.offset!==void 0&&l.offset.fromArray(a.offset),a.repeat!==void 0&&l.repeat.fromArray(a.repeat),a.center!==void 0&&l.center.fromArray(a.center),a.rotation!==void 0&&(l.rotation=a.rotation),a.wrap!==void 0&&(l.wrapS=n(a.wrap[0],Ty),l.wrapT=n(a.wrap[1],Ty)),a.format!==void 0&&(l.format=a.format),a.type!==void 0&&(l.type=a.type),a.encoding!==void 0&&(l.encoding=a.encoding),a.minFilter!==void 0&&(l.minFilter=n(a.minFilter,Sy)),a.magFilter!==void 0&&(l.magFilter=n(a.magFilter,Sy)),a.anisotropy!==void 0&&(l.anisotropy=a.anisotropy),a.flipY!==void 0&&(l.flipY=a.flipY),a.premultiplyAlpha!==void 0&&(l.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(l.unpackAlignment=a.unpackAlignment),i[a.uuid]=l}return i}parseObject(e,t,n,i,o){let s,a,l;function u(f){return t[f]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",f),t[f]}function c(f){if(f!==void 0){if(Array.isArray(f)){const m=[];for(let g=0,_=f.length;g<_;g++){const y=f[g];n[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),m.push(n[y])}return m}return n[f]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",f),n[f]}}function d(f){return i[f]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",f),i[f]}switch(e.type){case"Scene":s=new Ba,e.background!==void 0&&(Number.isInteger(e.background)?s.background=new gt(e.background):s.background=d(e.background)),e.environment!==void 0&&(s.environment=d(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?s.fog=new Fl(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(s.fog=new _i(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":s=new Qn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(s.focus=e.focus),e.zoom!==void 0&&(s.zoom=e.zoom),e.filmGauge!==void 0&&(s.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(s.filmOffset=e.filmOffset),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new jh(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(s.zoom=e.zoom),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new om(e.color,e.intensity);break;case"DirectionalLight":s=new rm(e.color,e.intensity);break;case"PointLight":s=new Mv(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new Av(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new Sv(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new wv(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=new Cd().fromJSON(e);break;case"SkinnedMesh":a=u(e.geometry),l=c(e.material),s=new Ga(a,l),e.bindMode!==void 0&&(s.bindMode=e.bindMode),e.bindMatrix!==void 0&&s.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(s.skeleton=e.skeleton);break;case"Mesh":a=u(e.geometry),l=c(e.material),s=new ln(a,l);break;case"InstancedMesh":a=u(e.geometry),l=c(e.material);const f=e.count,m=e.instanceMatrix,g=e.instanceColor;s=new vd(a,l,f),s.instanceMatrix=new Zt(new Float32Array(m.array),16),g!==void 0&&(s.instanceColor=new Zt(new Float32Array(g.array),g.itemSize));break;case"LOD":s=new Vf;break;case"Line":s=new h(u(e.geometry),c(e.material));break;case"LineLoop":s=new P(u(e.geometry),c(e.material));break;case"LineSegments":s=new E(u(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new ze(u(e.geometry),c(e.material));break;case"Sprite":s=new Hl(c(e.material));break;case"Group":s=new Ys;break;case"Bone":s=new Ph;break;default:s=new Xt}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const f=e.children;for(let m=0;m<f.length;m++)s.add(this.parseObject(f[m],t,n,i,o))}if(e.animations!==void 0){const f=e.animations;for(let m=0;m<f.length;m++){const g=f[m];s.animations.push(o[g])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(s.autoUpdate=e.autoUpdate);const f=e.levels;for(let m=0;m<f.length;m++){const g=f[m],_=s.getObjectByProperty("uuid",g.object);_!==void 0&&s.addLevel(_,g.distance)}}return s}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const i=t[n.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(i,n.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const TS={UVMapping:Pu,CubeReflectionMapping:ko,CubeRefractionMapping:ol,EquirectangularReflectionMapping:sl,EquirectangularRefractionMapping:al,CubeUVReflectionMapping:fa,CubeUVRefractionMapping:ma},Ty={RepeatWrapping:Go,ClampToEdgeWrapping:mi,MirroredRepeatWrapping:ll},Sy={NearestFilter:Zn,NearestMipmapNearestFilter:ul,NearestMipmapLinearFilter:hl,LinearFilter:Jn,LinearMipmapNearestFilter:Ho,LinearMipmapLinearFilter:Ts};class Ey extends Ji{constructor(e){super(e),typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=Zl.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(l){Zl.add(e,l),t&&t(l),o.manager.itemEnd(e)}).catch(function(l){i&&i(l),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}Ey.prototype.isImageBitmapLoader=!0;class My{constructor(){this.type="ShapePath",this.color=new gt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Jl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,o,s){return this.currentPath.bezierCurveTo(e,t,n,i,o,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(M){const I=[];for(let F=0,R=M.length;F<R;F++){const U=M[F],N=new Xa;N.curves=U.curves,I.push(N)}return I}function i(M,I){const F=I.length;let R=!1;for(let U=F-1,N=0;N<F;U=N++){let G=I[U],he=I[N],ne=he.x-G.x,Z=he.y-G.y;if(Math.abs(Z)>Number.EPSILON){if(Z<0&&(G=I[N],ne=-ne,he=I[U],Z=-Z),M.y<G.y||M.y>he.y)continue;if(M.y===G.y){if(M.x===G.x)return!0}else{const Q=Z*(M.x-G.x)-ne*(M.y-G.y);if(Q===0)return!0;if(Q<0)continue;R=!R}}else{if(M.y!==G.y)continue;if(he.x<=M.x&&M.x<=G.x||G.x<=M.x&&M.x<=he.x)return!0}}return R}const o=ss.isClockWise,s=this.subPaths;if(s.length===0)return[];if(t===!0)return n(s);let a,l,u;const c=[];if(s.length===1)return l=s[0],u=new Xa,u.curves=l.curves,c.push(u),c;let d=!o(s[0].getPoints());d=e?!d:d;const f=[],m=[];let g,_,y=[],w=0;m[w]=void 0,y[w]=[];for(let M=0,I=s.length;M<I;M++)l=s[M],g=l.getPoints(),a=o(g),a=e?!a:a,a?(!d&&m[w]&&w++,m[w]={s:new Xa,p:g},m[w].s.curves=l.curves,d&&w++,y[w]=[]):y[w].push({h:l,p:g[0]});if(!m[0])return n(s);if(m.length>1){let M=!1;const I=[];for(let F=0,R=m.length;F<R;F++)f[F]=[];for(let F=0,R=m.length;F<R;F++){const U=y[F];for(let N=0;N<U.length;N++){const G=U[N];let he=!0;for(let ne=0;ne<m.length;ne++)i(G.p,m[ne].p)&&(F!==ne&&I.push({froms:F,tos:ne,hole:N}),he?(he=!1,f[ne].push(G)):M=!0);he&&f[F].push(G)}}I.length>0&&(M||(y=f))}for(let M=0,I=m.length;M<I;M++){u=m[M].s,c.push(u),_=y[M];for(let F=0,R=_.length;F<R;F++)u.holes.push(_[F].h)}return c}}class Iv{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],i=function(o,s,a){const l=Array.from(o),u=s/a.resolution,c=(a.boundingBox.yMax-a.boundingBox.yMin+a.underlineThickness)*u,d=[];let f=0,m=0;for(let g=0;g<l.length;g++){const _=l[g];if(_===`
|
|
2977
|
+
`)f=0,m-=c;else{const y=SS(_,u,f,m,a);f+=y.offsetX,d.push(y.path)}}return d}(e,t,this.data);for(let o=0,s=i.length;o<s;o++)Array.prototype.push.apply(n,i[o].toShapes());return n}}function SS(r,e,t,n,i){const o=i.glyphs[r]||i.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+r+'" does not exists in font family '+i.familyName+".");const s=new My;let a,l,u,c,d,f,m,g;if(o.o){const _=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let y=0,w=_.length;y<w;)switch(_[y++]){case"m":a=_[y++]*e+t,l=_[y++]*e+n,s.moveTo(a,l);break;case"l":a=_[y++]*e+t,l=_[y++]*e+n,s.lineTo(a,l);break;case"q":u=_[y++]*e+t,c=_[y++]*e+n,d=_[y++]*e+t,f=_[y++]*e+n,s.quadraticCurveTo(d,f,u,c);break;case"b":u=_[y++]*e+t,c=_[y++]*e+n,d=_[y++]*e+t,f=_[y++]*e+n,m=_[y++]*e+t,g=_[y++]*e+n,s.bezierCurveTo(d,f,m,g,u,c)}}return{offsetX:o.ha*e,path:s}}Iv.prototype.isFont=!0;class ES extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new Ro(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(a){let l;try{l=JSON.parse(a)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),l=JSON.parse(a.substring(65,a.length-2))}const u=o.parse(l);t&&t(u)},n,i)}parse(e){return new Iv(e)}}let am;const Lv={getContext:function(){return am===void 0&&(am=new(window.AudioContext||window.webkitAudioContext)),am},setContext:function(r){am=r}};class Ay extends Ji{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new Ro(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{const l=a.slice(0);Lv.getContext().decodeAudioData(l,function(u){t(u)})}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},n,i)}}class Py extends Cd{constructor(e,t,n=1){super(void 0,n);const i=new gt().set(e),o=new gt().set(t),s=new T(i.r,i.g,i.b),a=new T(o.r,o.g,o.b),l=Math.sqrt(Math.PI),u=l*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(s).sub(a).multiplyScalar(u)}}Py.prototype.isHemisphereLightProbe=!0;class Cy extends Cd{constructor(e,t=1){super(void 0,t);const n=new gt().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Cy.prototype.isAmbientLightProbe=!0;const Ry=new pt,Iy=new pt;class MS{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;const n=e.projectionMatrix.clone(),i=t.eyeSep/2,o=i*t.near/t.focus,s=t.near*Math.tan(Sn*t.fov*.5)/t.zoom;let a,l;Iy.elements[12]=-i,Ry.elements[12]=i,a=-s*t.aspect+o,l=s*t.aspect+o,n.elements[0]=2*t.near/(l-a),n.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(n),a=-s*t.aspect-o,l=s*t.aspect-o,n.elements[0]=2*t.near/(l-a),n.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Iy),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Ry)}}class Ly{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Oy(),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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Oy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Oy(){return(typeof performance=="undefined"?Date:performance).now()}const $l=new T,Dy=new gi,AS=new T,Kl=new T;class PS extends Xt{constructor(){super(),this.type="AudioListener",this.context=Lv.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ly}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose($l,Dy,AS),Kl.set(0,0,-1).applyQuaternion(Dy),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime($l.x,i),t.positionY.linearRampToValueAtTime($l.y,i),t.positionZ.linearRampToValueAtTime($l.z,i),t.forwardX.linearRampToValueAtTime(Kl.x,i),t.forwardY.linearRampToValueAtTime(Kl.y,i),t.forwardZ.linearRampToValueAtTime(Kl.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition($l.x,$l.y,$l.z),t.setOrientation(Kl.x,Kl.y,Kl.z,n.x,n.y,n.z)}}class Ov extends Xt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl!==!1)return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(this.hasPlaybackControl!==!1)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl!==!1)return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl!==!1)return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Ql=new T,Ny=new gi,CS=new T,eu=new T;class RS extends Ov{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Ql,Ny,CS),eu.set(0,0,1).applyQuaternion(Ny);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Ql.x,n),t.positionY.linearRampToValueAtTime(Ql.y,n),t.positionZ.linearRampToValueAtTime(Ql.z,n),t.orientationX.linearRampToValueAtTime(eu.x,n),t.orientationY.linearRampToValueAtTime(eu.y,n),t.orientationZ.linearRampToValueAtTime(eu.z,n)}else t.setPosition(Ql.x,Ql.y,Ql.z),t.setOrientation(eu.x,eu.y,eu.z)}}class Fy{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class By{constructor(e,t,n){let i,o,s;switch(this.binding=e,this.valueSize=n,t){case"quaternion":i=this._slerp,o=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":i=this._select,o=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:i=this._lerp,o=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=o,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,o=e*i+i;let s=this.cumulativeWeight;if(s===0){for(let a=0;a!==i;++a)n[o+a]=n[a];s=t}else{s+=t;const a=t/s;this._mixBufferRegion(n,o,0,a,i)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,o=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,o<1){const l=t*this._origIndex;this._mixBufferRegion(n,i,l,1-o,t)}s>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let o=n,s=i;o!==s;++o)t[o]=t[i+o%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,o){if(i>=.5)for(let s=0;s!==o;++s)e[t+s]=e[n+s]}_slerp(e,t,n,i){gi.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,o){const s=this._workIndex*o;gi.multiplyQuaternionsFlat(e,s,e,t,e,n),gi.slerpFlat(e,t,e,t,e,s,i)}_lerp(e,t,n,i,o){const s=1-i;for(let a=0;a!==o;++a){const l=t+a;e[l]=e[l]*s+e[n+a]*i}}_lerpAdditive(e,t,n,i,o){for(let s=0;s!==o;++s){const a=t+s;e[a]=e[a]+e[n+s]*i}}}const IS=new RegExp("[\\[\\]\\.:\\/]","g"),LS="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",OS=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),DS=/(WCOD+)?/.source.replace("WCOD",LS),NS=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),FS=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),BS=new RegExp("^"+OS+DS+NS+FS+"$"),US=["material","materials","bones"];class cn{constructor(e,t,n){this.path=t,this.parsedPath=n||cn.parseTrackName(t),this.node=cn.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new cn.Composite(e,t,n):new cn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(IS,"")}static parseTrackName(e){const t=BS.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=n.nodeName.substring(i+1);US.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(o){for(let s=0;s<o.length;s++){const a=o[s];if(a.name===t||a.uuid===t)return a;const l=n(a.children);if(l)return l}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.node[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let o=t.propertyIndex;if(e||(e=cn.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let u=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let c=0;c<e.length;c++)if(e[c].name===u){u=c;break}break;default:if(e[n]===void 0)return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(u!==void 0){if(e[u]===void 0)return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[u]}}const s=e[i];if(s===void 0){const u=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e)}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(o!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);e.morphTargetDictionary[o]!==void 0&&(o=e.morphTargetDictionary[o])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=o}else s.fromArray!==void 0&&s.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}cn.Composite=class{constructor(r,e,t){const n=t||cn.parseTrackName(e);this._targetGroup=r,this._bindings=r.subscribe_(e,n)}getValue(r,e){this.bind();const t=this._targetGroup.nCachedObjects_,n=this._bindings[t];n!==void 0&&n.getValue(r,e)}setValue(r,e){const t=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=t.length;n!==i;++n)t[n].setValue(r,e)}bind(){const r=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=r.length;e!==t;++e)r[e].bind()}unbind(){const r=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=r.length;e!==t;++e)r[e].unbind()}},cn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},cn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},cn.prototype.GetterByBindingType=[cn.prototype._getValue_direct,cn.prototype._getValue_array,cn.prototype._getValue_arrayElement,cn.prototype._getValue_toArray],cn.prototype.SetterByBindingTypeAndVersioning=[[cn.prototype._setValue_direct,cn.prototype._setValue_direct_setNeedsUpdate,cn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[cn.prototype._setValue_array,cn.prototype._setValue_array_setNeedsUpdate,cn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[cn.prototype._setValue_arrayElement,cn.prototype._setValue_arrayElement_setNeedsUpdate,cn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[cn.prototype._setValue_fromArray,cn.prototype._setValue_fromArray_setNeedsUpdate,cn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Uy{constructor(){this.uuid=ir(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,o=this._bindings,s=o.length;let a,l=e.length,u=this.nCachedObjects_;for(let c=0,d=arguments.length;c!==d;++c){const f=arguments[c],m=f.uuid;let g=t[m];if(g===void 0){g=l++,t[m]=g,e.push(f);for(let _=0,y=s;_!==y;++_)o[_].push(new cn(f,n[_],i[_]))}else if(g<u){a=e[g];const _=--u,y=e[_];t[y.uuid]=g,e[g]=y,t[m]=_,e[_]=f;for(let w=0,M=s;w!==M;++w){const I=o[w],F=I[_];let R=I[g];I[g]=F,R===void 0&&(R=new cn(f,n[w],i[w])),I[_]=R}}else e[g]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let o=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){const l=arguments[s],u=l.uuid,c=t[u];if(c!==void 0&&c>=o){const d=o++,f=e[d];t[f.uuid]=c,e[c]=f,t[u]=d,e[d]=l;for(let m=0,g=i;m!==g;++m){const _=n[m],y=_[d],w=_[c];_[c]=y,_[d]=w}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let o=this.nCachedObjects_,s=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a].uuid,c=t[u];if(c!==void 0)if(delete t[u],c<o){const d=--o,f=e[d],m=--s,g=e[m];t[f.uuid]=c,e[c]=f,t[g.uuid]=d,e[d]=g,e.pop();for(let _=0,y=i;_!==y;++_){const w=n[_],M=w[d],I=w[m];w[c]=M,w[d]=I,w.pop()}}else{const d=--s,f=e[d];d>0&&(t[f.uuid]=c),e[c]=f,e.pop();for(let m=0,g=i;m!==g;++m){const _=n[m];_[c]=_[d],_.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const o=this._bindings;if(i!==void 0)return o[i];const s=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,c=this.nCachedObjects_,d=new Array(u);i=o.length,n[e]=i,s.push(e),a.push(t),o.push(d);for(let f=c,m=l.length;f!==m;++f){const g=l[f];d[f]=new cn(g,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,o=this._parsedPaths,s=this._bindings,a=s.length-1,l=s[a];t[e[a]]=n,s[n]=l,s.pop(),o[n]=o[a],o.pop(),i[n]=i[a],i.pop()}}}Uy.prototype.isAnimationObjectGroup=!0;class kS{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const o=t.tracks,s=o.length,a=new Array(s),l={endingStart:bi,endingEnd:bi};for(let u=0;u!==s;++u){const c=o[u].createInterpolant(null);a[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Rc,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}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=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,o=e._clip.duration,s=o/i,a=i/o;e.warp(1,s,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,o=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=o,l[1]=o+n,u[0]=e/s,u[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled)return void this._updateWeight(e);const o=this._startTime;if(o!==null){const l=(e-o)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);const s=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case we:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulateAdditive(a);break;case Cs:default:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,o=this._loopCount;const s=n===fo;if(e===0)return o===-1?i:s&&(1&o)==1?t-i:i;if(n===zu){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,o+=Math.abs(a);const l=this.repetitions-o;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(s&&(1&o)==1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=jo,i.endingEnd=jo):(i.endingStart=e?this.zeroSlopeAtStart?jo:bi:fl,i.endingEnd=t?this.zeroSlopeAtEnd?jo:bi:fl)}_scheduleFading(e,t,n){const i=this._mixer,o=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=o,l[0]=t,a[1]=o+e,l[1]=n,this}}class ky extends go{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,o=i.length,s=e._propertyBindings,a=e._interpolants,l=n.uuid,u=this._bindingsByRootAndName;let c=u[l];c===void 0&&(c={},u[l]=c);for(let d=0;d!==o;++d){const f=i[d],m=f.name;let g=c[m];if(g!==void 0)s[d]=g;else{if(g=s[d],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,m));continue}const _=t&&t._propertyBindings[d].binding.parsedPath;g=new By(cn.create(n,m,_),f.ValueTypeName,f.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,m),s[d]=g}a[d].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,o=this._actionsByClip[i];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];o.useCount++==0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];--o.useCount==0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,o=this._actionsByClip;let s=o[t];if(s===void 0)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,o[t]=s;else{const a=s.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=i.length,i.push(e),s.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const o=e._clip.uuid,s=this._actionsByClip,a=s[o],l=a.knownActions,u=l[l.length-1],c=e._byClipCacheIndex;u._byClipCacheIndex=c,l[c]=u,l.pop(),e._byClipCacheIndex=null,delete a.actionByRoot[(e._localRoot||this._root).uuid],l.length===0&&delete s[o],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];--o.referenceCount==0&&this._removeInactiveBinding(o)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,o=this._bindings;let s=i[t];s===void 0&&(s={},i[t]=s),s[n]=e,e._cacheIndex=o.length,o.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,o=n.path,s=this._bindingsByRootAndName,a=s[i],l=t[t.length-1],u=e._cacheIndex;l._cacheIndex=u,t[u]=l,t.pop(),delete a[o],Object.keys(a).length===0&&delete s[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new _v(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,o=t[i];e.__cacheIndex=i,t[i]=e,o.__cacheIndex=n,t[n]=o}clipAction(e,t,n){const i=t||this._root,o=i.uuid;let s=typeof e=="string"?Md.findByName(i,e):e;const a=s!==null?s.uuid:e,l=this._actionsByClip[a];let u=null;if(n===void 0&&(n=s!==null?s.blendMode:Cs),l!==void 0){const d=l.actionByRoot[o];if(d!==void 0&&d.blendMode===n)return d;u=l.knownActions[0],s===null&&(s=u._clip)}if(s===null)return null;const c=new kS(this,s,t,n);return this._bindAction(c,u),this._addInactiveAction(c,a,o),c}existingAction(e,t){const n=t||this._root,i=n.uuid,o=typeof e=="string"?Md.findByName(n,e):e,s=o?o.uuid:e,a=this._actionsByClip[s];return a!==void 0&&a.actionByRoot[i]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,o=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==n;++u)t[u]._update(i,e,o,s);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(s);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,o=i[n];if(o!==void 0){const s=o.knownActions;for(let a=0,l=s.length;a!==l;++a){const u=s[a];this._deactivateAction(u);const c=u._cacheIndex,d=t[t.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,d._cacheIndex=c,t[c]=d,t.pop(),this._removeInactiveBindingsForAction(u)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const o in n){const s=n[o].actionByRoot[t];s!==void 0&&(this._deactivateAction(s),this._removeInactiveAction(s))}const i=this._bindingsByRootAndName[t];if(i!==void 0)for(const o in i){const s=i[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}ky.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class lm{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new lm(this.value.clone===void 0?this.value:this.value.clone())}}class Gy extends qs{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}Gy.prototype.isInstancedInterleavedBuffer=!0;class Hy{constructor(e,t,n,i,o){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=o,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}Hy.prototype.isGLBufferAttribute=!0;class GS{constructor(e,t,n=0,i=1/0){this.ray=new bo(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Uc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!1,n=[]){return Dv(e,this,n,t),n.sort(zy),n}intersectObjects(e,t=!1,n=[]){for(let i=0,o=e.length;i<o;i++)Dv(e[i],this,n,t);return n.sort(zy),n}}function zy(r,e){return r.distance-e.distance}function Dv(r,e,t,n){if(r.layers.test(e.layers)&&r.raycast(e,t),n===!0){const i=r.children;for(let o=0,s=i.length;o<s;o++)Dv(i[o],e,t,!0)}}class HS{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Ti(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class zS{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}const Vy=new Qe;class Wh{constructor(e=new Qe(1/0,1/0),t=new Qe(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Vy.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Vy.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}Wh.prototype.isBox2=!0;const jy=new T,um=new T;class Wy{constructor(e=new T,t=new T){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){jy.subVectors(e,this.start),um.subVectors(this.end,this.start);const n=um.dot(um);let i=um.dot(jy)/n;return t&&(i=Ti(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Xy extends Xt{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}Xy.prototype.isImmediateRenderObject=!0;const Yy=new T;class VS extends Xt{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Mt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,l=32;s<l;s++,a++){const u=s/l*Math.PI*2,c=a/l*Math.PI*2;i.push(Math.cos(u),Math.sin(u),1,Math.cos(c),Math.sin(c),1)}n.setAttribute("position",new st(i,3));const o=new yi({fog:!1,toneMapped:!1});this.cone=new E(n,o),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Yy.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Yy),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ya=new T,hm=new pt,Nv=new pt;class qy extends E{constructor(e){const t=function l(u){const c=[];u&&u.isBone&&c.push(u);for(let d=0;d<u.children.length;d++)c.push.apply(c,l(u.children[d]));return c}(e),n=new Mt,i=[],o=[],s=new gt(0,0,1),a=new gt(0,1,0);for(let l=0;l<t.length;l++){const u=t[l];u.parent&&u.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),o.push(s.r,s.g,s.b),o.push(a.r,a.g,a.b))}n.setAttribute("position",new st(i,3)),n.setAttribute("color",new st(o,3)),super(n,new yi({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");Nv.copy(this.root.matrixWorld).invert();for(let o=0,s=0;o<t.length;o++){const a=t[o];a.parent&&a.parent.isBone&&(hm.multiplyMatrices(Nv,a.matrixWorld),Ya.setFromMatrixPosition(hm),i.setXYZ(s,Ya.x,Ya.y,Ya.z),hm.multiplyMatrices(Nv,a.parent.matrixWorld),Ya.setFromMatrixPosition(hm),i.setXYZ(s+1,Ya.x,Ya.y,Ya.z),s+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}class jS extends ln{constructor(e,t,n){super(new Xl(t,4,2),new Kn({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const WS=new T,Zy=new gt,Jy=new gt;class XS extends Xt{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new jl(t);i.rotateY(.5*Math.PI),this.material=new Kn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const o=i.getAttribute("position"),s=new Float32Array(3*o.count);i.setAttribute("color",new Zt(s,3)),this.add(new ln(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Zy.copy(this.light.color),Jy.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const o=n<i/2?Zy:Jy;t.setXYZ(n,o.r,o.g,o.b)}t.needsUpdate=!0}e.lookAt(WS.setFromMatrixPosition(this.light.matrixWorld).negate())}}class $y extends E{constructor(e=10,t=10,n=4473924,i=8947848){n=new gt(n),i=new gt(i);const o=t/2,s=e/t,a=e/2,l=[],u=[];for(let d=0,f=0,m=-a;d<=t;d++,m+=s){l.push(-a,0,m,a,0,m),l.push(m,0,-a,m,0,a);const g=d===o?n:i;g.toArray(u,f),f+=3,g.toArray(u,f),f+=3,g.toArray(u,f),f+=3,g.toArray(u,f),f+=3}const c=new Mt;c.setAttribute("position",new st(l,3)),c.setAttribute("color",new st(u,3)),super(c,new yi({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class YS extends E{constructor(e=10,t=16,n=8,i=64,o=4473924,s=8947848){o=new gt(o),s=new gt(s);const a=[],l=[];for(let c=0;c<=t;c++){const d=c/t*(2*Math.PI),f=Math.sin(d)*e,m=Math.cos(d)*e;a.push(0,0,0),a.push(f,0,m);const g=1&c?o:s;l.push(g.r,g.g,g.b),l.push(g.r,g.g,g.b)}for(let c=0;c<=n;c++){const d=1&c?o:s,f=e-e/n*c;for(let m=0;m<i;m++){let g=m/i*(2*Math.PI),_=Math.sin(g)*f,y=Math.cos(g)*f;a.push(_,0,y),l.push(d.r,d.g,d.b),g=(m+1)/i*(2*Math.PI),_=Math.sin(g)*f,y=Math.cos(g)*f,a.push(_,0,y),l.push(d.r,d.g,d.b)}}const u=new Mt;u.setAttribute("position",new st(a,3)),u.setAttribute("color",new st(l,3)),super(u,new yi({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const Ky=new T,cm=new T,Qy=new T;class qS extends Xt{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,t===void 0&&(t=1);let i=new Mt;i.setAttribute("position",new st([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const o=new yi({fog:!1,toneMapped:!1});this.lightPlane=new h(i,o),this.add(this.lightPlane),i=new Mt,i.setAttribute("position",new st([0,0,0,0,0,1],3)),this.targetLine=new h(i,o),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Ky.setFromMatrixPosition(this.light.matrixWorld),cm.setFromMatrixPosition(this.light.target.matrixWorld),Qy.subVectors(cm,Ky),this.lightPlane.lookAt(cm),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(cm),this.targetLine.scale.z=Qy.length()}}const dm=new T,ii=new zs;class ZS extends E{constructor(e){const t=new Mt,n=new yi({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],o=[],s={},a=new gt(16755200),l=new gt(16711680),u=new gt(43775),c=new gt(16777215),d=new gt(3355443);function f(g,_,y){m(g,y),m(_,y)}function m(g,_){i.push(0,0,0),o.push(_.r,_.g,_.b),s[g]===void 0&&(s[g]=[]),s[g].push(i.length/3-1)}f("n1","n2",a),f("n2","n4",a),f("n4","n3",a),f("n3","n1",a),f("f1","f2",a),f("f2","f4",a),f("f4","f3",a),f("f3","f1",a),f("n1","f1",a),f("n2","f2",a),f("n3","f3",a),f("n4","f4",a),f("p","n1",l),f("p","n2",l),f("p","n3",l),f("p","n4",l),f("u1","u2",u),f("u2","u3",u),f("u3","u1",u),f("c","t",c),f("p","c",d),f("cn1","cn2",d),f("cn3","cn4",d),f("cf1","cf2",d),f("cf3","cf4",d),t.setAttribute("position",new st(i,3)),t.setAttribute("color",new st(o,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){const e=this.geometry,t=this.pointMap;ii.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),di("c",t,e,ii,0,0,-1),di("t",t,e,ii,0,0,1),di("n1",t,e,ii,-1,-1,-1),di("n2",t,e,ii,1,-1,-1),di("n3",t,e,ii,-1,1,-1),di("n4",t,e,ii,1,1,-1),di("f1",t,e,ii,-1,-1,1),di("f2",t,e,ii,1,-1,1),di("f3",t,e,ii,-1,1,1),di("f4",t,e,ii,1,1,1),di("u1",t,e,ii,.7,1.1,-1),di("u2",t,e,ii,-.7,1.1,-1),di("u3",t,e,ii,0,2,-1),di("cf1",t,e,ii,-1,0,1),di("cf2",t,e,ii,1,0,1),di("cf3",t,e,ii,0,-1,1),di("cf4",t,e,ii,0,1,1),di("cn1",t,e,ii,-1,0,-1),di("cn2",t,e,ii,1,0,-1),di("cn3",t,e,ii,0,-1,-1),di("cn4",t,e,ii,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function di(r,e,t,n,i,o,s){dm.set(i,o,s).unproject(n);const a=e[r];if(a!==void 0){const l=t.getAttribute("position");for(let u=0,c=a.length;u<c;u++)l.setXYZ(a[u],dm.x,dm.y,dm.z)}}const pm=new In;class ex extends E{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),o=new Mt;o.setIndex(new Zt(n,1)),o.setAttribute("position",new Zt(i,3)),super(o,new yi({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&pm.setFromObject(this.object),pm.isEmpty())return;const t=pm.min,n=pm.max,i=this.geometry.attributes.position,o=i.array;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=t.x,o[4]=n.y,o[5]=n.z,o[6]=t.x,o[7]=t.y,o[8]=n.z,o[9]=n.x,o[10]=t.y,o[11]=n.z,o[12]=n.x,o[13]=n.y,o[14]=t.z,o[15]=t.x,o[16]=n.y,o[17]=t.z,o[18]=t.x,o[19]=t.y,o[20]=t.z,o[21]=n.x,o[22]=t.y,o[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return E.prototype.copy.call(this,e),this.object=e.object,this}}class JS extends E{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Mt;i.setIndex(new Zt(n,1)),i.setAttribute("position",new st([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new yi({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class $S extends h{constructor(e,t=1,n=16776960){const i=n,o=new Mt;o.setAttribute("position",new st([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),o.computeBoundingSphere(),super(o,new yi({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new Mt;s.setAttribute("position",new st([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new ln(s,new Kn({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?W:z,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const tx=new T;let fm,Fv;class KS extends Xt{constructor(e=new T(0,0,1),t=new T(0,0,0),n=1,i=16776960,o=.2*n,s=.2*o){super(),this.type="ArrowHelper",fm===void 0&&(fm=new Mt,fm.setAttribute("position",new st([0,0,0,0,1,0],3)),Fv=new Et(0,.5,1,5,1),Fv.translate(0,-.5,0)),this.position.copy(t),this.line=new h(fm,new yi({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ln(Fv,new Kn({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,o,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{tx.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(tx,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class nx extends E{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new Mt;n.setAttribute("position",new st(t,3)),n.setAttribute("color",new st([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(n,new yi({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const i=new gt,o=this.geometry.attributes.color.array;return i.set(e),i.toArray(o,0),i.toArray(o,3),i.set(t),i.toArray(o,6),i.toArray(o,9),i.set(n),i.toArray(o,12),i.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const ix=new Float32Array(1),QS=new Int32Array(ix.buffer);class eE{static toHalfFloat(e){ix[0]=e;const t=QS[0];let n=t>>16&32768,i=t>>12&2047;const o=t>>23&255;return o<103?n:o>142?(n|=31744,n|=(o==255?0:1)&&8388607&t,n):o<113?(i|=2048,n|=(i>>114-o)+(i>>113-o&1),n):(n|=o-112<<10|i>>1,n+=1&i,n)}}const as=Math.pow(2,8),rx=[.125,.215,.35,.446,.526,.582],ox=5+rx.length,ls={[wt]:0,[$t]:1,[nr]:2,[ml]:3,[Ic]:4,[Xi]:5,[zn]:6},tu=new Kn({side:W,depthWrite:!1,depthTest:!1}),tE=new ln(new Qr,tu),Bv=new jh,{_lodPlanes:Rd,_sizeLods:sx,_sigmas:mm}=rE(),ax=new gt;let Uv=null;const nu=(1+Math.sqrt(5))/2,Xh=1/nu,lx=[new T(1,1,1),new T(-1,1,1),new T(1,1,-1),new T(-1,1,-1),new T(0,nu,Xh),new T(0,nu,-Xh),new T(Xh,0,nu),new T(-Xh,0,nu),new T(nu,Xh,0),new T(-nu,Xh,0)];function ux(r){const e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class nE{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const n=new Float32Array(t),i=new T(0,1,0);return new zh({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:ls[wt]},outputEncoding:{value:ls[wt]}},vertexShader:kv(),fragmentShader:`
|
|
2978
2978
|
|
|
2979
2979
|
precision mediump float;
|
|
2980
2980
|
precision mediump int;
|
|
@@ -3038,7 +3038,7 @@ void main() {
|
|
|
3038
3038
|
gl_FragColor = linearToOutputTexel( gl_FragColor );
|
|
3039
3039
|
|
|
3040
3040
|
}
|
|
3041
|
-
`,blending:$e,depthTest:!1,depthWrite:!1})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Uv=this._renderer.getRenderTarget();const o=this._allocateTargets();return this._sceneToCubeUV(e,n,i,o),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=dx(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=cx(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<Rd.length;e++)Rd[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Uv),e.scissorTest=!1,gm(e,0,0,e.width,e.height)}_fromTexture(e){Uv=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:Zn,minFilter:Zn,generateMipmaps:!1,type:zo,format:Vp,encoding:iE(e)?e.encoding:nr,depthBuffer:!1},n=hx(t);return n.depthBuffer=!e,this._pingPongRenderTarget=hx(t),n}_compileMaterial(e){const t=new ln(Rd[0],e);this._renderer.compile(t,Bv)}_sceneToCubeUV(e,t,n,i){const o=new Qn(90,1,t,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.outputEncoding,d=l.toneMapping;l.getClearColor(ax),l.toneMapping=uo,l.outputEncoding=wt,l.autoClear=!1;let f=!1;const m=e.background;if(m){if(m.isColor){tu.color.copy(m).convertSRGBToLinear(),e.background=null;const g=ux(tu.color);tu.opacity=g,f=!0}}else{tu.color.copy(ax).convertSRGBToLinear();const g=ux(tu.color);tu.opacity=g,f=!0}for(let g=0;g<6;g++){const _=g%3;_==0?(o.up.set(0,s[g],0),o.lookAt(a[g],0,0)):_==1?(o.up.set(0,0,s[g]),o.lookAt(0,a[g],0)):(o.up.set(0,s[g],0),o.lookAt(0,0,a[g])),gm(i,_*as,g>2?as:0,as,as),l.setRenderTarget(i),f&&l.render(tE,o),l.render(e,o)}l.toneMapping=d,l.outputEncoding=c,l.autoClear=u}_textureToCubeUV(e,t){const n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=dx()):this._equirectShader==null&&(this._equirectShader=cx());const i=e.isCubeTexture?this._cubemapShader:this._equirectShader,o=new ln(Rd[0],i),s=i.uniforms;s.envMap.value=e,e.isCubeTexture||s.texelSize.value.set(1/e.image.width,1/e.image.height),s.inputEncoding.value=ls[e.encoding],s.outputEncoding.value=ls[t.texture.encoding],gm(t,0,0,3*as,2*as),n.setRenderTarget(t),n.render(o,Bv)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<ox;i++){const o=Math.sqrt(mm[i]*mm[i]-mm[i-1]*mm[i-1]),s=lx[(i-1)%lx.length];this._blur(e,i-1,i,o,s)}t.autoClear=n}_blur(e,t,n,i,o){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,i,"latitudinal",o),this._halfBlur(s,e,n,n,i,"longitudinal",o)}_halfBlur(e,t,n,i,o,s,a){const l=this._renderer,u=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new ln(Rd[i],u),d=u.uniforms,f=sx[n]-1,m=isFinite(o)?Math.PI/(2*f):2*Math.PI/39,g=o/m,_=isFinite(o)?1+Math.floor(3*g):20;_>20&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${_} samples when the maximum is set to 20`);const y=[];let w=0;for(let I=0;I<20;++I){const F=I/g,
|
|
3041
|
+
`,blending:$e,depthTest:!1,depthWrite:!1})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Uv=this._renderer.getRenderTarget();const o=this._allocateTargets();return this._sceneToCubeUV(e,n,i,o),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=dx(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=cx(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<Rd.length;e++)Rd[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Uv),e.scissorTest=!1,gm(e,0,0,e.width,e.height)}_fromTexture(e){Uv=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:Zn,minFilter:Zn,generateMipmaps:!1,type:zo,format:Vp,encoding:iE(e)?e.encoding:nr,depthBuffer:!1},n=hx(t);return n.depthBuffer=!e,this._pingPongRenderTarget=hx(t),n}_compileMaterial(e){const t=new ln(Rd[0],e);this._renderer.compile(t,Bv)}_sceneToCubeUV(e,t,n,i){const o=new Qn(90,1,t,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.outputEncoding,d=l.toneMapping;l.getClearColor(ax),l.toneMapping=uo,l.outputEncoding=wt,l.autoClear=!1;let f=!1;const m=e.background;if(m){if(m.isColor){tu.color.copy(m).convertSRGBToLinear(),e.background=null;const g=ux(tu.color);tu.opacity=g,f=!0}}else{tu.color.copy(ax).convertSRGBToLinear();const g=ux(tu.color);tu.opacity=g,f=!0}for(let g=0;g<6;g++){const _=g%3;_==0?(o.up.set(0,s[g],0),o.lookAt(a[g],0,0)):_==1?(o.up.set(0,0,s[g]),o.lookAt(0,a[g],0)):(o.up.set(0,s[g],0),o.lookAt(0,0,a[g])),gm(i,_*as,g>2?as:0,as,as),l.setRenderTarget(i),f&&l.render(tE,o),l.render(e,o)}l.toneMapping=d,l.outputEncoding=c,l.autoClear=u}_textureToCubeUV(e,t){const n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=dx()):this._equirectShader==null&&(this._equirectShader=cx());const i=e.isCubeTexture?this._cubemapShader:this._equirectShader,o=new ln(Rd[0],i),s=i.uniforms;s.envMap.value=e,e.isCubeTexture||s.texelSize.value.set(1/e.image.width,1/e.image.height),s.inputEncoding.value=ls[e.encoding],s.outputEncoding.value=ls[t.texture.encoding],gm(t,0,0,3*as,2*as),n.setRenderTarget(t),n.render(o,Bv)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<ox;i++){const o=Math.sqrt(mm[i]*mm[i]-mm[i-1]*mm[i-1]),s=lx[(i-1)%lx.length];this._blur(e,i-1,i,o,s)}t.autoClear=n}_blur(e,t,n,i,o){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,i,"latitudinal",o),this._halfBlur(s,e,n,n,i,"longitudinal",o)}_halfBlur(e,t,n,i,o,s,a){const l=this._renderer,u=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new ln(Rd[i],u),d=u.uniforms,f=sx[n]-1,m=isFinite(o)?Math.PI/(2*f):2*Math.PI/39,g=o/m,_=isFinite(o)?1+Math.floor(3*g):20;_>20&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${_} samples when the maximum is set to 20`);const y=[];let w=0;for(let I=0;I<20;++I){const F=I/g,R=Math.exp(-F*F/2);y.push(R),I==0?w+=R:I<_&&(w+=2*R)}for(let I=0;I<y.length;I++)y[I]=y[I]/w;d.envMap.value=e.texture,d.samples.value=_,d.weights.value=y,d.latitudinal.value=s==="latitudinal",a&&(d.poleAxis.value=a),d.dTheta.value=m,d.mipInt.value=8-n,d.inputEncoding.value=ls[e.texture.encoding],d.outputEncoding.value=ls[e.texture.encoding];const M=sx[i];gm(t,3*Math.max(0,as-2*M),(i===0?0:2*as)+2*M*(i>4?i-8+4:0),3*M,2*M),l.setRenderTarget(t),l.render(c,Bv)}}function iE(r){return r!==void 0&&r.type===zo&&(r.encoding===wt||r.encoding===$t||r.encoding===zn)}function rE(){const r=[],e=[],t=[];let n=8;for(let i=0;i<ox;i++){const o=Math.pow(2,n);e.push(o);let s=1/o;i>4?s=rx[i-8+4-1]:i==0&&(s=0),t.push(s);const a=1/(o-1),l=-a/2,u=1+a/2,c=[l,l,u,l,u,u,l,l,u,u,l,u],d=6,f=6,m=3,g=2,_=1,y=new Float32Array(m*f*d),w=new Float32Array(g*f*d),M=new Float32Array(_*f*d);for(let F=0;F<d;F++){const R=F%3*2/3-1,U=F>2?0:-1,N=[R,U,0,R+2/3,U,0,R+2/3,U+1,0,R,U,0,R+2/3,U+1,0,R,U+1,0];y.set(N,m*f*F),w.set(c,g*f*F);const G=[F,F,F,F,F,F];M.set(G,_*f*F)}const I=new Mt;I.setAttribute("position",new Zt(y,m)),I.setAttribute("uv",new Zt(w,g)),I.setAttribute("faceIndex",new Zt(M,_)),r.push(I),n>4&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function hx(r){const e=new Ir(3*as,3*as,r);return e.texture.mapping=fa,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function gm(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function cx(){const r=new Qe(1,1);return new zh({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:ls[wt]},outputEncoding:{value:ls[wt]}},vertexShader:kv(),fragmentShader:`
|
|
3042
3042
|
|
|
3043
3043
|
precision mediump float;
|
|
3044
3044
|
precision mediump int;
|
|
@@ -3231,7 +3231,7 @@ void main() {
|
|
|
3231
3231
|
return inputTexelToLinear( color );
|
|
3232
3232
|
|
|
3233
3233
|
}
|
|
3234
|
-
`}const oE=0,sE=1,aE=0,lE=1,uE=2;function hE(r){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),r}function cE(r=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),r.isMultiMaterial=!0,r.materials=r,r.clone=function(){return r.slice()},r}function dE(r,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ze(r,e)}function pE(r){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Hl(r)}function fE(r,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ze(r,e)}function mE(r){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new V(r)}function gE(r){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new V(r)}function vE(r){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new V(r)}function _E(r,e,t){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new T(r,e,t)}function yE(r,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Zt(r,e).setUsage(Xr)}function xE(r,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Ml(r,e)}function bE(r,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Wc(r,e)}function wE(r,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new uh(r,e)}function TE(r,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Xc(r,e)}function SE(r,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Aa(r,e)}function EE(r,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new hh(r,e)}function ME(r,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Fr(r,e)}function AE(r,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new st(r,e)}function PE(r,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Yc(r,e)}function CE(r){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new nx(r)}function RE(r,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new ex(r,e)}function IE(r,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new E(new Ei(r.geometry),new yi({color:e!==void 0?e:16777215}))}function LE(r,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new E(new cv(r.geometry),new yi({color:e!==void 0?e:16777215}))}function OE(r){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Ro(r)}function DE(r){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new dy(r)}function NE(r,e,t){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Pt(r,t)}function FE(){console.error("THREE.CanvasRenderer has been removed")}function BE(){console.error("THREE.JSONLoader has been removed.")}Xn.create=function(r,e){return console.log("THREE.Curve.create() has been deprecated"),r.prototype=Object.create(Xn.prototype),r.prototype.constructor=r,r.prototype.getPoint=e,r},Jl.prototype.fromPoints=function(r){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(r)},$y.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},qy.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Ji.prototype.extractUrlBase=function(r){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),sm.extractUrlBase(r)},Ji.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Wh.prototype.center=function(r){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(r)},Wh.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Wh.prototype.isIntersectionBox=function(r){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},Wh.prototype.size=function(r){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(r)},In.prototype.center=function(r){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(r)},In.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},In.prototype.isIntersectionBox=function(r){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},In.prototype.isIntersectionSphere=function(r){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(r)},In.prototype.size=function(r){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(r)},li.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Da.prototype.setFromMatrix=function(r){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(r)},Wy.prototype.center=function(r){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(r)},En.prototype.flattenToArrayOffset=function(r,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(r,e)},En.prototype.multiplyVector3=function(r){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),r.applyMatrix3(this)},En.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},En.prototype.applyToBufferAttribute=function(r){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),r.applyMatrix3(this)},En.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},En.prototype.getInverse=function(r){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(r).invert()},pt.prototype.extractPosition=function(r){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(r)},pt.prototype.flattenToArrayOffset=function(r,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(r,e)},pt.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new T().setFromMatrixColumn(this,3)},pt.prototype.setRotationFromQuaternion=function(r){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(r)},pt.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},pt.prototype.multiplyVector3=function(r){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},pt.prototype.multiplyVector4=function(r){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},pt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},pt.prototype.rotateAxis=function(r){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),r.transformDirection(this)},pt.prototype.crossVector=function(r){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},pt.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},pt.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},pt.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},pt.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},pt.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},pt.prototype.applyToBufferAttribute=function(r){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},pt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},pt.prototype.makeFrustum=function(r,e,t,n,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(r,e,n,t,i,o)},pt.prototype.getInverse=function(r){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(r).invert()},yr.prototype.isIntersectionLine=function(r){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(r)},gi.prototype.multiplyVector3=function(r){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),r.applyQuaternion(this)},gi.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},bo.prototype.isIntersectionBox=function(r){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},bo.prototype.isIntersectionPlane=function(r){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(r)},bo.prototype.isIntersectionSphere=function(r){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(r)},Mn.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Mn.prototype.barycoordFromPoint=function(r,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(r,e)},Mn.prototype.midpoint=function(r){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(r)},Mn.prototypenormal=function(r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(r)},Mn.prototype.plane=function(r){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(r)},Mn.barycoordFromPoint=function(r,e,t,n,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Mn.getBarycoord(r,e,t,n,i)},Mn.normal=function(r,e,t,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Mn.getNormal(r,e,t,n)},Xa.prototype.extractAllPoints=function(r){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(r)},Xa.prototype.extrude=function(r){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ao(this,r)},Xa.prototype.makeGeometry=function(r){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Wl(this,r)},Qe.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)},Qe.prototype.distanceToManhattan=function(r){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(r)},Qe.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},T.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},T.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},T.prototype.getPositionFromMatrix=function(r){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(r)},T.prototype.getScaleFromMatrix=function(r){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(r)},T.prototype.getColumnFromMatrix=function(r,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,r)},T.prototype.applyProjection=function(r){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(r)},T.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)},T.prototype.distanceToManhattan=function(r){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(r)},T.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},pn.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)},pn.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Xt.prototype.getChildByName=function(r){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(r)},Xt.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Xt.prototype.translate=function(r,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,r)},Xt.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},Xt.prototype.applyMatrix=function(r){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(r)},Object.defineProperties(Xt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(r){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=r}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),ln.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(ln.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),je},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Ga.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Qn.prototype.setLens=function(r,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(r)},Object.defineProperties(Io.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(r){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=r}},shadowCameraLeft:{set:function(r){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=r}},shadowCameraRight:{set:function(r){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=r}},shadowCameraTop:{set:function(r){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=r}},shadowCameraBottom:{set:function(r){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=r}},shadowCameraNear:{set:function(r){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=r}},shadowCameraFar:{set:function(r){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=r}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(r){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=r}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(r){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=r}},shadowMapHeight:{set:function(r){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=r}}}),Object.defineProperties(Zt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Xr},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Xr)}}}),Zt.prototype.setDynamic=function(r){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(r===!0?Xr:Rs),this},Zt.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Zt.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Mt.prototype.addIndex=function(r){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(r)},Mt.prototype.addAttribute=function(r,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?r==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(r,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(r,new Zt(arguments[1],arguments[2])))},Mt.prototype.addDrawCall=function(r,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(r,e)},Mt.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Mt.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Mt.prototype.removeAttribute=function(r){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(r)},Mt.prototype.applyMatrix=function(r){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(r)},Object.defineProperties(Mt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),qs.prototype.setDynamic=function(r){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(r===!0?Xr:Rs),this},qs.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Ao.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Ao.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Ao.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Ba.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},lm.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(vi.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new gt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(r){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=r===et}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(r){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=r}}}),Object.defineProperties(ki.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(r){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=r}}}),fn.prototype.clearTarget=function(r,e,t,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(r),this.clear(e,t,n)},fn.prototype.animate=function(r){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(r)},fn.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},fn.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},fn.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},fn.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},fn.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},fn.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},fn.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},fn.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},fn.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},fn.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},fn.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},fn.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},fn.prototype.enableScissorTest=function(r){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(r)},fn.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},fn.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},fn.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},fn.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},fn.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},fn.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},fn.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},fn.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},fn.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},fn.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(fn.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=r}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=r}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(r){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=r===!0?$t:wt}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(pd.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Ir.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(r){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=r}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(r){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=r}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(r){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=r}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(r){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=r}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(r){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=r}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(r){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=r}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(r){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=r}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(r){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=r}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(r){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=r}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(r){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=r}}}),Ov.prototype.load=function(r){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new Ay().load(r,function(t){e.setBuffer(t)}),this},Fy.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Vs.prototype.updateCubeMap=function(r,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(r,e)},Vs.prototype.clear=function(r,e,t,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(r,e,t,n)},fr.crossOrigin=void 0,fr.loadTexture=function(r,e,t,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new bv;i.setCrossOrigin(this.crossOrigin);const o=i.load(r,t,void 0,n);return e&&(o.mapping=e),o},fr.loadTextureCube=function(r,e,t,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new cy;i.setCrossOrigin(this.crossOrigin);const o=i.load(r,t,void 0,n);return e&&(o.mapping=e),o},fr.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},fr.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const UE={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function kE(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:X}})),typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=X);const wr=`
|
|
3234
|
+
`}const oE=0,sE=1,aE=0,lE=1,uE=2;function hE(r){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),r}function cE(r=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),r.isMultiMaterial=!0,r.materials=r,r.clone=function(){return r.slice()},r}function dE(r,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ze(r,e)}function pE(r){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Hl(r)}function fE(r,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ze(r,e)}function mE(r){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new j(r)}function gE(r){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new j(r)}function vE(r){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new j(r)}function _E(r,e,t){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new T(r,e,t)}function yE(r,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Zt(r,e).setUsage(Xr)}function xE(r,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Ml(r,e)}function bE(r,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Wc(r,e)}function wE(r,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new uh(r,e)}function TE(r,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Xc(r,e)}function SE(r,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Aa(r,e)}function EE(r,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new hh(r,e)}function ME(r,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Fr(r,e)}function AE(r,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new st(r,e)}function PE(r,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Yc(r,e)}function CE(r){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new nx(r)}function RE(r,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new ex(r,e)}function IE(r,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new E(new Ei(r.geometry),new yi({color:e!==void 0?e:16777215}))}function LE(r,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new E(new cv(r.geometry),new yi({color:e!==void 0?e:16777215}))}function OE(r){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Ro(r)}function DE(r){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new dy(r)}function NE(r,e,t){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Pt(r,t)}function FE(){console.error("THREE.CanvasRenderer has been removed")}function BE(){console.error("THREE.JSONLoader has been removed.")}Xn.create=function(r,e){return console.log("THREE.Curve.create() has been deprecated"),r.prototype=Object.create(Xn.prototype),r.prototype.constructor=r,r.prototype.getPoint=e,r},Jl.prototype.fromPoints=function(r){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(r)},$y.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},qy.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Ji.prototype.extractUrlBase=function(r){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),sm.extractUrlBase(r)},Ji.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Wh.prototype.center=function(r){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(r)},Wh.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Wh.prototype.isIntersectionBox=function(r){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},Wh.prototype.size=function(r){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(r)},In.prototype.center=function(r){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(r)},In.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},In.prototype.isIntersectionBox=function(r){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},In.prototype.isIntersectionSphere=function(r){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(r)},In.prototype.size=function(r){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(r)},li.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Da.prototype.setFromMatrix=function(r){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(r)},Wy.prototype.center=function(r){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(r)},En.prototype.flattenToArrayOffset=function(r,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(r,e)},En.prototype.multiplyVector3=function(r){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),r.applyMatrix3(this)},En.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},En.prototype.applyToBufferAttribute=function(r){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),r.applyMatrix3(this)},En.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},En.prototype.getInverse=function(r){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(r).invert()},pt.prototype.extractPosition=function(r){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(r)},pt.prototype.flattenToArrayOffset=function(r,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(r,e)},pt.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new T().setFromMatrixColumn(this,3)},pt.prototype.setRotationFromQuaternion=function(r){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(r)},pt.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},pt.prototype.multiplyVector3=function(r){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},pt.prototype.multiplyVector4=function(r){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},pt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},pt.prototype.rotateAxis=function(r){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),r.transformDirection(this)},pt.prototype.crossVector=function(r){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},pt.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},pt.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},pt.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},pt.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},pt.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},pt.prototype.applyToBufferAttribute=function(r){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},pt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},pt.prototype.makeFrustum=function(r,e,t,n,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(r,e,n,t,i,o)},pt.prototype.getInverse=function(r){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(r).invert()},yr.prototype.isIntersectionLine=function(r){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(r)},gi.prototype.multiplyVector3=function(r){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),r.applyQuaternion(this)},gi.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},bo.prototype.isIntersectionBox=function(r){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},bo.prototype.isIntersectionPlane=function(r){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(r)},bo.prototype.isIntersectionSphere=function(r){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(r)},Mn.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Mn.prototype.barycoordFromPoint=function(r,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(r,e)},Mn.prototype.midpoint=function(r){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(r)},Mn.prototypenormal=function(r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(r)},Mn.prototype.plane=function(r){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(r)},Mn.barycoordFromPoint=function(r,e,t,n,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Mn.getBarycoord(r,e,t,n,i)},Mn.normal=function(r,e,t,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Mn.getNormal(r,e,t,n)},Xa.prototype.extractAllPoints=function(r){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(r)},Xa.prototype.extrude=function(r){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ao(this,r)},Xa.prototype.makeGeometry=function(r){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Wl(this,r)},Qe.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)},Qe.prototype.distanceToManhattan=function(r){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(r)},Qe.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},T.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},T.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},T.prototype.getPositionFromMatrix=function(r){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(r)},T.prototype.getScaleFromMatrix=function(r){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(r)},T.prototype.getColumnFromMatrix=function(r,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,r)},T.prototype.applyProjection=function(r){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(r)},T.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)},T.prototype.distanceToManhattan=function(r){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(r)},T.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},pn.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)},pn.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Xt.prototype.getChildByName=function(r){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(r)},Xt.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Xt.prototype.translate=function(r,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,r)},Xt.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},Xt.prototype.applyMatrix=function(r){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(r)},Object.defineProperties(Xt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(r){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=r}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),ln.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(ln.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),je},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Ga.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Qn.prototype.setLens=function(r,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(r)},Object.defineProperties(Io.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(r){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=r}},shadowCameraLeft:{set:function(r){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=r}},shadowCameraRight:{set:function(r){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=r}},shadowCameraTop:{set:function(r){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=r}},shadowCameraBottom:{set:function(r){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=r}},shadowCameraNear:{set:function(r){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=r}},shadowCameraFar:{set:function(r){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=r}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(r){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=r}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(r){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=r}},shadowMapHeight:{set:function(r){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=r}}}),Object.defineProperties(Zt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Xr},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Xr)}}}),Zt.prototype.setDynamic=function(r){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(r===!0?Xr:Rs),this},Zt.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Zt.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Mt.prototype.addIndex=function(r){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(r)},Mt.prototype.addAttribute=function(r,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?r==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(r,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(r,new Zt(arguments[1],arguments[2])))},Mt.prototype.addDrawCall=function(r,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(r,e)},Mt.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Mt.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Mt.prototype.removeAttribute=function(r){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(r)},Mt.prototype.applyMatrix=function(r){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(r)},Object.defineProperties(Mt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),qs.prototype.setDynamic=function(r){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(r===!0?Xr:Rs),this},qs.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Ao.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Ao.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Ao.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Ba.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},lm.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(vi.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new gt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(r){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=r===et}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(r){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=r}}}),Object.defineProperties(ki.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(r){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=r}}}),fn.prototype.clearTarget=function(r,e,t,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(r),this.clear(e,t,n)},fn.prototype.animate=function(r){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(r)},fn.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},fn.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},fn.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},fn.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},fn.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},fn.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},fn.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},fn.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},fn.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},fn.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},fn.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},fn.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},fn.prototype.enableScissorTest=function(r){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(r)},fn.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},fn.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},fn.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},fn.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},fn.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},fn.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},fn.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},fn.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},fn.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},fn.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(fn.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=r}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=r}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(r){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=r===!0?$t:wt}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(pd.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Ir.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(r){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=r}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(r){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=r}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(r){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=r}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(r){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=r}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(r){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=r}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(r){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=r}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(r){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=r}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(r){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=r}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(r){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=r}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(r){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=r}}}),Ov.prototype.load=function(r){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new Ay().load(r,function(t){e.setBuffer(t)}),this},Fy.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Vs.prototype.updateCubeMap=function(r,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(r,e)},Vs.prototype.clear=function(r,e,t,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(r,e,t,n)},fr.crossOrigin=void 0,fr.loadTexture=function(r,e,t,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new bv;i.setCrossOrigin(this.crossOrigin);const o=i.load(r,t,void 0,n);return e&&(o.mapping=e),o},fr.loadTextureCube=function(r,e,t,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new cy;i.setCrossOrigin(this.crossOrigin);const o=i.load(r,t,void 0,n);return e&&(o.mapping=e),o},fr.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},fr.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const UE={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function kE(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:X}})),typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=X);const wr=`
|
|
3235
3235
|
vec4 blendSrcOver(vec4 src, vec4 dist) {
|
|
3236
3236
|
vec4 result = vec4(0.0, 0.0, 0.0, 0.0);
|
|
3237
3237
|
|
|
@@ -4729,7 +4729,7 @@ Deprecated since v`+r),console.warn(n))),Wx[e]=!0}}var l0={},Er=Object.create(nu
|
|
|
4729
4729
|
*
|
|
4730
4730
|
* @pixi/display is licensed under the MIT License.
|
|
4731
4731
|
* http://www.opensource.org/licenses/mit-license
|
|
4732
|
-
*/At.SORTABLE_CHILDREN=!1;var kd=function(){function r(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return r.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?nn.EMPTY:((e=e||new nn(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},r.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},r.prototype.addPointMatrix=function(e,t){var n=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,u=n*t.x+o*t.y+a,c=i*t.x+s*t.y+l;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)},r.prototype.addQuad=function(e){var t=this.minX,n=this.minY,i=this.maxX,o=this.maxY,s=e[0],a=e[1];t=s<t?s:t,n=a<n?a:n,i=s>i?s:i,o=a>o?a:o,t=(s=e[2])<t?s:t,n=(a=e[3])<n?a:n,i=s>i?s:i,o=a>o?a:o,t=(s=e[4])<t?s:t,n=(a=e[5])<n?a:n,i=s>i?s:i,o=a>o?a:o,t=(s=e[6])<t?s:t,n=(a=e[7])<n?a:n,i=s>i?s:i,o=a>o?a:o,this.minX=t,this.minY=n,this.maxX=i,this.maxY=o},r.prototype.addFrame=function(e,t,n,i,o){this.addFrameMatrix(e.worldTransform,t,n,i,o)},r.prototype.addFrameMatrix=function(e,t,n,i,o){var s=e.a,a=e.b,l=e.c,u=e.d,c=e.tx,d=e.ty,f=this.minX,m=this.minY,g=this.maxX,_=this.maxY,y=s*t+l*n+c,w=a*t+u*n+d;f=y<f?y:f,m=w<m?w:m,g=y>g?y:g,_=w>_?w:_,f=(y=s*i+l*n+c)<f?y:f,m=(w=a*i+u*n+d)<m?w:m,g=y>g?y:g,_=w>_?w:_,f=(y=s*t+l*o+c)<f?y:f,m=(w=a*t+u*o+d)<m?w:m,g=y>g?y:g,_=w>_?w:_,f=(y=s*i+l*o+c)<f?y:f,m=(w=a*i+u*o+d)<m?w:m,g=y>g?y:g,_=w>_?w:_,this.minX=f,this.minY=m,this.maxX=g,this.maxY=_},r.prototype.addVertexData=function(e,t,n){for(var i=this.minX,o=this.minY,s=this.maxX,a=this.maxY,l=t;l<n;l+=2){var u=e[l],c=e[l+1];i=u<i?u:i,o=c<o?c:o,s=u>s?u:s,a=c>a?c:a}this.minX=i,this.minY=o,this.maxX=s,this.maxY=a},r.prototype.addVertices=function(e,t,n,i){this.addVerticesMatrix(e.worldTransform,t,n,i)},r.prototype.addVerticesMatrix=function(e,t,n,i,o,s){o===void 0&&(o=0),s===void 0&&(s=o);for(var a=e.a,l=e.b,u=e.c,c=e.d,d=e.tx,f=e.ty,m=this.minX,g=this.minY,_=this.maxX,y=this.maxY,w=n;w<i;w+=2){var M=t[w],I=t[w+1],F=a*M+u*I+d,
|
|
4732
|
+
*/At.SORTABLE_CHILDREN=!1;var kd=function(){function r(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return r.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?nn.EMPTY:((e=e||new nn(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},r.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},r.prototype.addPointMatrix=function(e,t){var n=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,u=n*t.x+o*t.y+a,c=i*t.x+s*t.y+l;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)},r.prototype.addQuad=function(e){var t=this.minX,n=this.minY,i=this.maxX,o=this.maxY,s=e[0],a=e[1];t=s<t?s:t,n=a<n?a:n,i=s>i?s:i,o=a>o?a:o,t=(s=e[2])<t?s:t,n=(a=e[3])<n?a:n,i=s>i?s:i,o=a>o?a:o,t=(s=e[4])<t?s:t,n=(a=e[5])<n?a:n,i=s>i?s:i,o=a>o?a:o,t=(s=e[6])<t?s:t,n=(a=e[7])<n?a:n,i=s>i?s:i,o=a>o?a:o,this.minX=t,this.minY=n,this.maxX=i,this.maxY=o},r.prototype.addFrame=function(e,t,n,i,o){this.addFrameMatrix(e.worldTransform,t,n,i,o)},r.prototype.addFrameMatrix=function(e,t,n,i,o){var s=e.a,a=e.b,l=e.c,u=e.d,c=e.tx,d=e.ty,f=this.minX,m=this.minY,g=this.maxX,_=this.maxY,y=s*t+l*n+c,w=a*t+u*n+d;f=y<f?y:f,m=w<m?w:m,g=y>g?y:g,_=w>_?w:_,f=(y=s*i+l*n+c)<f?y:f,m=(w=a*i+u*n+d)<m?w:m,g=y>g?y:g,_=w>_?w:_,f=(y=s*t+l*o+c)<f?y:f,m=(w=a*t+u*o+d)<m?w:m,g=y>g?y:g,_=w>_?w:_,f=(y=s*i+l*o+c)<f?y:f,m=(w=a*i+u*o+d)<m?w:m,g=y>g?y:g,_=w>_?w:_,this.minX=f,this.minY=m,this.maxX=g,this.maxY=_},r.prototype.addVertexData=function(e,t,n){for(var i=this.minX,o=this.minY,s=this.maxX,a=this.maxY,l=t;l<n;l+=2){var u=e[l],c=e[l+1];i=u<i?u:i,o=c<o?c:o,s=u>s?u:s,a=c>a?c:a}this.minX=i,this.minY=o,this.maxX=s,this.maxY=a},r.prototype.addVertices=function(e,t,n,i){this.addVerticesMatrix(e.worldTransform,t,n,i)},r.prototype.addVerticesMatrix=function(e,t,n,i,o,s){o===void 0&&(o=0),s===void 0&&(s=o);for(var a=e.a,l=e.b,u=e.c,c=e.d,d=e.tx,f=e.ty,m=this.minX,g=this.minY,_=this.maxX,y=this.maxY,w=n;w<i;w+=2){var M=t[w],I=t[w+1],F=a*M+u*I+d,R=c*I+l*M+f;m=Math.min(m,F-o),_=Math.max(_,F+o),g=Math.min(g,R-s),y=Math.max(y,R+s)}this.minX=m,this.minY=g,this.maxX=_,this.maxY=y},r.prototype.addBounds=function(e){var t=this.minX,n=this.minY,i=this.maxX,o=this.maxY;this.minX=e.minX<t?e.minX:t,this.minY=e.minY<n?e.minY:n,this.maxX=e.maxX>i?e.maxX:i,this.maxY=e.maxY>o?e.maxY:o},r.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,o=e.maxX<t.maxX?e.maxX:t.maxX,s=e.maxY<t.maxY?e.maxY:t.maxY;if(n<=o&&i<=s){var a=this.minX,l=this.minY,u=this.maxX,c=this.maxY;this.minX=n<a?n:a,this.minY=i<l?i:l,this.maxX=o>u?o:u,this.maxY=s>c?s:c}},r.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},r.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,o=e.maxX<t.x+t.width?e.maxX:t.x+t.width,s=e.maxY<t.y+t.height?e.maxY:t.y+t.height;if(n<=o&&i<=s){var a=this.minX,l=this.minY,u=this.maxX,c=this.maxY;this.minX=n<a?n:a,this.minY=i<l?i:l,this.maxX=o>u?o:u,this.maxY=s>c?s:c}},r.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},r.prototype.addFramePad=function(e,t,n,i,o,s){e-=o,t-=s,n+=o,i+=s,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<t?this.minY:t,this.maxY=this.maxY>i?this.maxY:i},r}(),e1=function(r,e){return(e1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)};/*! *****************************************************************************
|
|
4733
4733
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4734
4734
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4735
4735
|
this file except in compliance with the License. You may obtain a copy of the
|
|
@@ -5079,7 +5079,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
5079
5079
|
|
|
5080
5080
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
5081
5081
|
and limitations under the License.
|
|
5082
|
-
***************************************************************************** */function ib(r,e){function t(){this.constructor=r}nb(r,e),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function UM(r,e){var t,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,n=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(r,s)}catch(d){c=[6,d],n=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}}var Vm,ms,rb=function(r){function e(t,n){n===void 0&&(n={width:1,height:1,autoLoad:!0});var i,o,s=this;return typeof t=="string"?(i=t,o=new Uint8Array):(i=null,o=t),(s=r.call(this,o,n)||this).origin=i,s.buffer=o?new Hm(o):null,s.origin&&n.autoLoad!==!1&&s.load(),o&&o.length&&(s.loaded=!0,s.onBlobLoaded(s.buffer.rawBinaryData)),s}return ib(e,r),e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return t=this,n=void 0,o=function(){var s;return UM(this,function(a){switch(a.label){case 0:return[4,fetch(this.origin)];case 1:return[4,a.sent().blob()];case 2:return[4,a.sent().arrayBuffer()];case 3:return s=a.sent(),this.data=new Uint32Array(s),this.buffer=new Hm(s),this.loaded=!0,this.onBlobLoaded(s),this.update(),[2,this]}})},new((i=Promise)||(i=Promise))(function(s,a){function l(d){try{c(o.next(d))}catch(f){a(f)}}function u(d){try{c(o.throw(d))}catch(f){a(f)}}function c(d){d.done?s(d.value):new i(function(f){f(d.value)}).then(l,u)}c((o=o.apply(t,n||[])).next())});var t,n,i,o},e}(Jh),jm=function(r){function e(t,n){var i=r.call(this,t,n)||this;return i.format=n.format,i.levels=n.levels||1,i._width=n.width,i._height=n.height,i._extension=e._formatToExtension(i.format),(n.levelBuffers||i.buffer)&&(i._levelBuffers=n.levelBuffers||e._createLevelBuffers(t instanceof Uint8Array?t:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}return ib(e,r),e.prototype.upload=function(t,n,i){var o=t.gl;if(!t.context.extensions[this._extension])throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var s=0,a=this.levels;s<a;s++){var l=this._levelBuffers[s],u=l.levelID,c=l.levelWidth,d=l.levelHeight,f=l.levelBuffer;o.compressedTexImage2D(o.TEXTURE_2D,u,this.format,c,d,0,f)}return!0},e.prototype.onBlobLoaded=function(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},e._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,n,i,o,s,a,l){for(var u=new Array(i),c=t.byteOffset,d=a,f=l,m=d+o-1&~(o-1),g=f+s-1&~(s-1),_=m*g*Yd[n],y=0;y<i;y++)u[y]={levelID:y,levelWidth:i>1?d:m,levelHeight:i>1?f:g,levelBuffer:new Uint8Array(t.buffer,c,_)},c+=_,_=(m=(d=d>>1||1)+o-1&~(o-1))*(g=(f=f>>1||1)+s-1&~(s-1))*Yd[n];return u},e}(rb),ob=function(){function r(){}return r.use=function(e,t){var n=e.data;if(e.type===ao.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var i=n.textures,o=void 0,s=void 0,a=0,l=i.length;a<l;a++){var u=i[a],c=u.src,d=u.format;if(d||(s=c),r.textureFormats[d]){o=c;break}}if(!(o=o||s))return void t(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));if(o===e.url)return void t(new Error("URL of compressed texture cannot be the same as the manifest's URL"));var f={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},m=ru.resolve(e.url.replace(this.baseUrl,""),o),g=n.cacheID;this.add(g,m,f,function(_){if(_.error)t(_.error);else{var y=_.texture,w=y===void 0?null:y,M=_.textures,I=M===void 0?{}:M;Object.assign(e,{texture:w,textures:I}),t()}})}else t()},r.add=function(){var e=document.createElement("canvas").getContext("webgl");if(e){var t={s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};for(var n in r.textureExtensions=t,r.textureFormats={},t){var i=t[n];i&&Object.assign(r.textureFormats,Object.getPrototypeOf(i))}}else console.error("WebGL not available for compressed textures. Silently failing.")},r}();function sb(r,e,t){var n={textures:{},texture:null};return e&&e.map(function(i){return new Nt(new vn(i,Object.assign({mipmap:ia.OFF,alphaMode:ds.NO_PREMULTIPLIED_ALPHA},t)))}).forEach(function(i,o){var s=i.baseTexture,a=r+"-"+(o+1);vn.addToCache(s,a),Nt.addToCache(i,a),o===0&&(vn.addToCache(s,r),Nt.addToCache(i,r),n.texture=i),n.textures[a]=i}),n}ao.setExtensionXhrType("dds",ao.XHR_RESPONSE_TYPE.BUFFER);var Do,q0,kM=3,GM=4,HM=7,zM=19,VM=2,jM=0,WM=1,XM=2,YM=3;(function(r){r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(Do||(Do={})),function(r){r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"}(q0||(q0={}));var qd,$h,Wm,qM=((Vm={})[827611204]=Jt.COMPRESSED_RGBA_S3TC_DXT1_EXT,Vm[861165636]=Jt.COMPRESSED_RGBA_S3TC_DXT3_EXT,Vm[894720068]=Jt.COMPRESSED_RGBA_S3TC_DXT5_EXT,Vm),ZM=((ms={})[Do.DXGI_FORMAT_BC1_TYPELESS]=Jt.COMPRESSED_RGBA_S3TC_DXT1_EXT,ms[Do.DXGI_FORMAT_BC1_UNORM]=Jt.COMPRESSED_RGBA_S3TC_DXT1_EXT,ms[Do.DXGI_FORMAT_BC2_TYPELESS]=Jt.COMPRESSED_RGBA_S3TC_DXT3_EXT,ms[Do.DXGI_FORMAT_BC2_UNORM]=Jt.COMPRESSED_RGBA_S3TC_DXT3_EXT,ms[Do.DXGI_FORMAT_BC3_TYPELESS]=Jt.COMPRESSED_RGBA_S3TC_DXT5_EXT,ms[Do.DXGI_FORMAT_BC3_UNORM]=Jt.COMPRESSED_RGBA_S3TC_DXT5_EXT,ms[Do.DXGI_FORMAT_BC1_UNORM_SRGB]=Jt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,ms[Do.DXGI_FORMAT_BC2_UNORM_SRGB]=Jt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,ms[Do.DXGI_FORMAT_BC3_UNORM_SRGB]=Jt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,ms),ab=function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,sb(e.name||e.url,r.parse(e.data),e.metadata))}catch(n){return void t(n)}t()},r.parse=function(e){var t=new Uint32Array(e);if(t[0]!==542327876)throw new Error("Invalid DDS file magic word");var n=new Uint32Array(e,0,124/Uint32Array.BYTES_PER_ELEMENT),i=n[kM],o=n[GM],s=n[HM],a=new Uint32Array(e,zM*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),l=a[1];if(4&l){var u=a[VM];if(u!==808540228){var c=qM[u],d=new Uint8Array(e,128);return[new jm(d,{format:c,width:o,height:i,levels:s})]}var f=new Uint32Array(t.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),m=f[jM],g=f[WM],_=f[XM],y=f[YM],w=ZM[m];if(w===void 0)throw new Error("DDSLoader cannot parse texture data with DXGI format "+m);if(_===4)throw new Error("DDSLoader does not support cubemap textures");if(g===q0.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSLoader does not supported 3D texture data");var M=new Array;if(y===1)M.push(new Uint8Array(e,148));else{for(var I=Yd[w],F=0,C=o,U=i,N=0;N<s;N++)F+=Math.max(1,C+3&-4)*Math.max(1,U+3&-4)*I,C>>>=1,U>>>=1;var G=148;for(N=0;N<y;N++)M.push(new Uint8Array(e,G,F)),G+=F}return M.map(function(he){return new jm(he,{format:w,width:o,height:i,levels:s})})}throw 64&l?new Error("DDSLoader does not support uncompressed texture data."):512&l?new Error("DDSLoader does not supported YUV uncompressed texture data."):131072&l?new Error("DDSLoader does not support single-channel (lumninance) texture data!"):2&l?new Error("DDSLoader does not support single-channel (alpha) texture data!"):new Error("DDSLoader failed to load a texture file due to an unknown reason!")},r}();ao.setExtensionXhrType("ktx",ao.XHR_RESPONSE_TYPE.BUFFER);var lb=[171,75,84,88,32,49,49,187,13,10,26,10],JM=12,$M=16,KM=24,QM=28,eA=36,tA=40,nA=44,iA=48,rA=52,oA=56,sA=60,Z0=((qd={})[bn.UNSIGNED_BYTE]=1,qd[bn.UNSIGNED_SHORT]=2,qd[bn.FLOAT]=4,qd[bn.HALF_FLOAT]=8,qd),ub=(($h={})[Lo.RGBA]=4,$h[Lo.RGB]=3,$h[Lo.LUMINANCE]=1,$h[Lo.LUMINANCE_ALPHA]=2,$h[Lo.ALPHA]=1,$h),hb=((Wm={})[bn.UNSIGNED_SHORT_4_4_4_4]=2,Wm[bn.UNSIGNED_SHORT_5_5_5_1]=2,Wm[bn.UNSIGNED_SHORT_5_6_5]=2,Wm),cb=function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var n=e.name||e.url;Object.assign(e,sb(n,r.parse(n,e.data),e.metadata))}catch(i){return void t(i)}t()},r.parse=function(e,t){var n=new DataView(t);if(!r.validate(e,n))return null;var i=n.getUint32(JM,!0)===67305985,o=n.getUint32($M,i),s=n.getUint32(KM,i),a=n.getUint32(QM,i),l=n.getUint32(eA,i),u=n.getUint32(tA,i)||1,c=n.getUint32(nA,i)||1,d=n.getUint32(iA,i)||1,f=n.getUint32(rA,i),m=n.getUint32(oA,i),g=n.getUint32(sA,i);if(u===0||c!==1)throw new Error("Only 2D textures are supported");if(f!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(d!==1)throw new Error("WebGL does not support array textures");var _,y=l+3&-4,w=u+3&-4,M=new Array(d),I=l*u;if(o===0&&(I=y*w),(_=o!==0?Z0[o]?Z0[o]*ub[s]:hb[o]:Yd[a])===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var F=I*_,C=l,U=u,N=y,G=w,he=64+g,ne=0;ne<m;ne++){for(var Z=n.getUint32(he,i),Q=he+4,$=0;$<d;$++){var se=M[$];se||(se=M[$]=new Array(m)),se[ne]={levelID:ne,levelWidth:m>1?C:N,levelHeight:m>1?U:G,levelBuffer:new Uint8Array(t,Q,F)},Q+=F}he=(he+=Z+4)%4!=0?he+4-he%4:he,F=(N=(C=C>>1||1)+4-1&-4)*(G=(U=U>>1||1)+4-1&-4)*_}if(o!==0)throw new Error("TODO: Uncompressed");return M.map(function(me){return new jm(null,{format:a,width:l,height:u,levels:m,levelBuffers:me})})},r.validate=function(e,t){for(var n=0;n<lb.length;n++)if(t.getUint8(n)!==lb[n])return console.error(e+" is not a valid *.ktx file!"),!1;return!0},r}(),db=function(r,e){return(db=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)};function pb(r,e){function t(){this.constructor=r}db(r,e),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ua,ha,aA=function(r){function e(t,n,i,o){t===void 0&&(t=1500),i===void 0&&(i=16384),o===void 0&&(o=!1);var s=r.call(this)||this;return i>16384&&(i=16384),s._properties=[!1,!0,!1,!1,!1],s._maxSize=t,s._batchSize=i,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=Ft.NORMAL,s.autoResize=o,s.roundPixels=!0,s.baseTexture=null,s.setProperties(n),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return pb(e,r),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,ou(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var n=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return n.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var n=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<n;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[n]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e}(Mi),fb=function(){function r(e,t,n){this.geometry=new gu,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<e.length;++i){var o=e[i];o={attributeName:o.attributeName,size:o.size,uploadFunction:o.uploadFunction,type:o.type||bn.FLOAT,offset:o.offset},t[i]?this.dynamicProperties.push(o):this.staticProperties.push(o)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return r.prototype.initBuffers=function(){var e=this.geometry,t=0;this.indexBuffer=new Di(Vx(this.size),!0,!0),e.addIndex(this.indexBuffer),this.dynamicStride=0;for(var n=0;n<this.dynamicProperties.length;++n)(a=this.dynamicProperties[n]).offset=t,t+=a.size,this.dynamicStride+=a.size;var i=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(i),this.dynamicDataUint32=new Uint32Array(i),this.dynamicBuffer=new Di(this.dynamicData,!1,!1);var o=0;for(this.staticStride=0,n=0;n<this.staticProperties.length;++n)(a=this.staticProperties[n]).offset=o,o+=a.size,this.staticStride+=a.size;var s=new ArrayBuffer(this.size*this.staticStride*4*4);for(this.staticData=new Float32Array(s),this.staticDataUint32=new Uint32Array(s),this.staticBuffer=new Di(this.staticData,!0,!1),n=0;n<this.dynamicProperties.length;++n){var a=this.dynamicProperties[n];e.addAttribute(a.attributeName,this.dynamicBuffer,0,a.type===bn.UNSIGNED_BYTE,a.type,4*this.dynamicStride,4*a.offset)}for(n=0;n<this.staticProperties.length;++n)a=this.staticProperties[n],e.addAttribute(a.attributeName,this.staticBuffer,0,a.type===bn.UNSIGNED_BYTE,a.type,4*this.staticStride,4*a.offset)},r.prototype.uploadDynamic=function(e,t,n){for(var i=0;i<this.dynamicProperties.length;i++){var o=this.dynamicProperties[i];o.uploadFunction(e,t,n,o.type===bn.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},r.prototype.uploadStatic=function(e,t,n){for(var i=0;i<this.staticProperties.length;i++){var o=this.staticProperties[i];o.uploadFunction(e,t,n,o.type===bn.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},r.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},r}(),mb=function(r){function e(t){var n=r.call(this,t)||this;return n.shader=null,n.properties=null,n.tempMatrix=new pi,n.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:n.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:n.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:n.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:n.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:bn.UNSIGNED_BYTE,uploadFunction:n.uploadTint,offset:0}],n.shader=oa.from(`attribute vec2 aVertexPosition;
|
|
5082
|
+
***************************************************************************** */function ib(r,e){function t(){this.constructor=r}nb(r,e),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function UM(r,e){var t,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,n=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(r,s)}catch(d){c=[6,d],n=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}}var Vm,ms,rb=function(r){function e(t,n){n===void 0&&(n={width:1,height:1,autoLoad:!0});var i,o,s=this;return typeof t=="string"?(i=t,o=new Uint8Array):(i=null,o=t),(s=r.call(this,o,n)||this).origin=i,s.buffer=o?new Hm(o):null,s.origin&&n.autoLoad!==!1&&s.load(),o&&o.length&&(s.loaded=!0,s.onBlobLoaded(s.buffer.rawBinaryData)),s}return ib(e,r),e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return t=this,n=void 0,o=function(){var s;return UM(this,function(a){switch(a.label){case 0:return[4,fetch(this.origin)];case 1:return[4,a.sent().blob()];case 2:return[4,a.sent().arrayBuffer()];case 3:return s=a.sent(),this.data=new Uint32Array(s),this.buffer=new Hm(s),this.loaded=!0,this.onBlobLoaded(s),this.update(),[2,this]}})},new((i=Promise)||(i=Promise))(function(s,a){function l(d){try{c(o.next(d))}catch(f){a(f)}}function u(d){try{c(o.throw(d))}catch(f){a(f)}}function c(d){d.done?s(d.value):new i(function(f){f(d.value)}).then(l,u)}c((o=o.apply(t,n||[])).next())});var t,n,i,o},e}(Jh),jm=function(r){function e(t,n){var i=r.call(this,t,n)||this;return i.format=n.format,i.levels=n.levels||1,i._width=n.width,i._height=n.height,i._extension=e._formatToExtension(i.format),(n.levelBuffers||i.buffer)&&(i._levelBuffers=n.levelBuffers||e._createLevelBuffers(t instanceof Uint8Array?t:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}return ib(e,r),e.prototype.upload=function(t,n,i){var o=t.gl;if(!t.context.extensions[this._extension])throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var s=0,a=this.levels;s<a;s++){var l=this._levelBuffers[s],u=l.levelID,c=l.levelWidth,d=l.levelHeight,f=l.levelBuffer;o.compressedTexImage2D(o.TEXTURE_2D,u,this.format,c,d,0,f)}return!0},e.prototype.onBlobLoaded=function(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},e._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,n,i,o,s,a,l){for(var u=new Array(i),c=t.byteOffset,d=a,f=l,m=d+o-1&~(o-1),g=f+s-1&~(s-1),_=m*g*Yd[n],y=0;y<i;y++)u[y]={levelID:y,levelWidth:i>1?d:m,levelHeight:i>1?f:g,levelBuffer:new Uint8Array(t.buffer,c,_)},c+=_,_=(m=(d=d>>1||1)+o-1&~(o-1))*(g=(f=f>>1||1)+s-1&~(s-1))*Yd[n];return u},e}(rb),ob=function(){function r(){}return r.use=function(e,t){var n=e.data;if(e.type===ao.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var i=n.textures,o=void 0,s=void 0,a=0,l=i.length;a<l;a++){var u=i[a],c=u.src,d=u.format;if(d||(s=c),r.textureFormats[d]){o=c;break}}if(!(o=o||s))return void t(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));if(o===e.url)return void t(new Error("URL of compressed texture cannot be the same as the manifest's URL"));var f={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},m=ru.resolve(e.url.replace(this.baseUrl,""),o),g=n.cacheID;this.add(g,m,f,function(_){if(_.error)t(_.error);else{var y=_.texture,w=y===void 0?null:y,M=_.textures,I=M===void 0?{}:M;Object.assign(e,{texture:w,textures:I}),t()}})}else t()},r.add=function(){var e=document.createElement("canvas").getContext("webgl");if(e){var t={s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};for(var n in r.textureExtensions=t,r.textureFormats={},t){var i=t[n];i&&Object.assign(r.textureFormats,Object.getPrototypeOf(i))}}else console.error("WebGL not available for compressed textures. Silently failing.")},r}();function sb(r,e,t){var n={textures:{},texture:null};return e&&e.map(function(i){return new Nt(new vn(i,Object.assign({mipmap:ia.OFF,alphaMode:ds.NO_PREMULTIPLIED_ALPHA},t)))}).forEach(function(i,o){var s=i.baseTexture,a=r+"-"+(o+1);vn.addToCache(s,a),Nt.addToCache(i,a),o===0&&(vn.addToCache(s,r),Nt.addToCache(i,r),n.texture=i),n.textures[a]=i}),n}ao.setExtensionXhrType("dds",ao.XHR_RESPONSE_TYPE.BUFFER);var Do,q0,kM=3,GM=4,HM=7,zM=19,VM=2,jM=0,WM=1,XM=2,YM=3;(function(r){r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(Do||(Do={})),function(r){r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"}(q0||(q0={}));var qd,$h,Wm,qM=((Vm={})[827611204]=Jt.COMPRESSED_RGBA_S3TC_DXT1_EXT,Vm[861165636]=Jt.COMPRESSED_RGBA_S3TC_DXT3_EXT,Vm[894720068]=Jt.COMPRESSED_RGBA_S3TC_DXT5_EXT,Vm),ZM=((ms={})[Do.DXGI_FORMAT_BC1_TYPELESS]=Jt.COMPRESSED_RGBA_S3TC_DXT1_EXT,ms[Do.DXGI_FORMAT_BC1_UNORM]=Jt.COMPRESSED_RGBA_S3TC_DXT1_EXT,ms[Do.DXGI_FORMAT_BC2_TYPELESS]=Jt.COMPRESSED_RGBA_S3TC_DXT3_EXT,ms[Do.DXGI_FORMAT_BC2_UNORM]=Jt.COMPRESSED_RGBA_S3TC_DXT3_EXT,ms[Do.DXGI_FORMAT_BC3_TYPELESS]=Jt.COMPRESSED_RGBA_S3TC_DXT5_EXT,ms[Do.DXGI_FORMAT_BC3_UNORM]=Jt.COMPRESSED_RGBA_S3TC_DXT5_EXT,ms[Do.DXGI_FORMAT_BC1_UNORM_SRGB]=Jt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,ms[Do.DXGI_FORMAT_BC2_UNORM_SRGB]=Jt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,ms[Do.DXGI_FORMAT_BC3_UNORM_SRGB]=Jt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,ms),ab=function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,sb(e.name||e.url,r.parse(e.data),e.metadata))}catch(n){return void t(n)}t()},r.parse=function(e){var t=new Uint32Array(e);if(t[0]!==542327876)throw new Error("Invalid DDS file magic word");var n=new Uint32Array(e,0,124/Uint32Array.BYTES_PER_ELEMENT),i=n[kM],o=n[GM],s=n[HM],a=new Uint32Array(e,zM*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),l=a[1];if(4&l){var u=a[VM];if(u!==808540228){var c=qM[u],d=new Uint8Array(e,128);return[new jm(d,{format:c,width:o,height:i,levels:s})]}var f=new Uint32Array(t.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),m=f[jM],g=f[WM],_=f[XM],y=f[YM],w=ZM[m];if(w===void 0)throw new Error("DDSLoader cannot parse texture data with DXGI format "+m);if(_===4)throw new Error("DDSLoader does not support cubemap textures");if(g===q0.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSLoader does not supported 3D texture data");var M=new Array;if(y===1)M.push(new Uint8Array(e,148));else{for(var I=Yd[w],F=0,R=o,U=i,N=0;N<s;N++)F+=Math.max(1,R+3&-4)*Math.max(1,U+3&-4)*I,R>>>=1,U>>>=1;var G=148;for(N=0;N<y;N++)M.push(new Uint8Array(e,G,F)),G+=F}return M.map(function(he){return new jm(he,{format:w,width:o,height:i,levels:s})})}throw 64&l?new Error("DDSLoader does not support uncompressed texture data."):512&l?new Error("DDSLoader does not supported YUV uncompressed texture data."):131072&l?new Error("DDSLoader does not support single-channel (lumninance) texture data!"):2&l?new Error("DDSLoader does not support single-channel (alpha) texture data!"):new Error("DDSLoader failed to load a texture file due to an unknown reason!")},r}();ao.setExtensionXhrType("ktx",ao.XHR_RESPONSE_TYPE.BUFFER);var lb=[171,75,84,88,32,49,49,187,13,10,26,10],JM=12,$M=16,KM=24,QM=28,eA=36,tA=40,nA=44,iA=48,rA=52,oA=56,sA=60,Z0=((qd={})[bn.UNSIGNED_BYTE]=1,qd[bn.UNSIGNED_SHORT]=2,qd[bn.FLOAT]=4,qd[bn.HALF_FLOAT]=8,qd),ub=(($h={})[Lo.RGBA]=4,$h[Lo.RGB]=3,$h[Lo.LUMINANCE]=1,$h[Lo.LUMINANCE_ALPHA]=2,$h[Lo.ALPHA]=1,$h),hb=((Wm={})[bn.UNSIGNED_SHORT_4_4_4_4]=2,Wm[bn.UNSIGNED_SHORT_5_5_5_1]=2,Wm[bn.UNSIGNED_SHORT_5_6_5]=2,Wm),cb=function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var n=e.name||e.url;Object.assign(e,sb(n,r.parse(n,e.data),e.metadata))}catch(i){return void t(i)}t()},r.parse=function(e,t){var n=new DataView(t);if(!r.validate(e,n))return null;var i=n.getUint32(JM,!0)===67305985,o=n.getUint32($M,i),s=n.getUint32(KM,i),a=n.getUint32(QM,i),l=n.getUint32(eA,i),u=n.getUint32(tA,i)||1,c=n.getUint32(nA,i)||1,d=n.getUint32(iA,i)||1,f=n.getUint32(rA,i),m=n.getUint32(oA,i),g=n.getUint32(sA,i);if(u===0||c!==1)throw new Error("Only 2D textures are supported");if(f!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(d!==1)throw new Error("WebGL does not support array textures");var _,y=l+3&-4,w=u+3&-4,M=new Array(d),I=l*u;if(o===0&&(I=y*w),(_=o!==0?Z0[o]?Z0[o]*ub[s]:hb[o]:Yd[a])===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var F=I*_,R=l,U=u,N=y,G=w,he=64+g,ne=0;ne<m;ne++){for(var Z=n.getUint32(he,i),Q=he+4,$=0;$<d;$++){var se=M[$];se||(se=M[$]=new Array(m)),se[ne]={levelID:ne,levelWidth:m>1?R:N,levelHeight:m>1?U:G,levelBuffer:new Uint8Array(t,Q,F)},Q+=F}he=(he+=Z+4)%4!=0?he+4-he%4:he,F=(N=(R=R>>1||1)+4-1&-4)*(G=(U=U>>1||1)+4-1&-4)*_}if(o!==0)throw new Error("TODO: Uncompressed");return M.map(function(me){return new jm(null,{format:a,width:l,height:u,levels:m,levelBuffers:me})})},r.validate=function(e,t){for(var n=0;n<lb.length;n++)if(t.getUint8(n)!==lb[n])return console.error(e+" is not a valid *.ktx file!"),!1;return!0},r}(),db=function(r,e){return(db=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)};function pb(r,e){function t(){this.constructor=r}db(r,e),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ua,ha,aA=function(r){function e(t,n,i,o){t===void 0&&(t=1500),i===void 0&&(i=16384),o===void 0&&(o=!1);var s=r.call(this)||this;return i>16384&&(i=16384),s._properties=[!1,!0,!1,!1,!1],s._maxSize=t,s._batchSize=i,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=Ft.NORMAL,s.autoResize=o,s.roundPixels=!0,s.baseTexture=null,s.setProperties(n),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return pb(e,r),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,ou(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var n=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return n.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var n=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<n;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[n]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e}(Mi),fb=function(){function r(e,t,n){this.geometry=new gu,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<e.length;++i){var o=e[i];o={attributeName:o.attributeName,size:o.size,uploadFunction:o.uploadFunction,type:o.type||bn.FLOAT,offset:o.offset},t[i]?this.dynamicProperties.push(o):this.staticProperties.push(o)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return r.prototype.initBuffers=function(){var e=this.geometry,t=0;this.indexBuffer=new Di(Vx(this.size),!0,!0),e.addIndex(this.indexBuffer),this.dynamicStride=0;for(var n=0;n<this.dynamicProperties.length;++n)(a=this.dynamicProperties[n]).offset=t,t+=a.size,this.dynamicStride+=a.size;var i=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(i),this.dynamicDataUint32=new Uint32Array(i),this.dynamicBuffer=new Di(this.dynamicData,!1,!1);var o=0;for(this.staticStride=0,n=0;n<this.staticProperties.length;++n)(a=this.staticProperties[n]).offset=o,o+=a.size,this.staticStride+=a.size;var s=new ArrayBuffer(this.size*this.staticStride*4*4);for(this.staticData=new Float32Array(s),this.staticDataUint32=new Uint32Array(s),this.staticBuffer=new Di(this.staticData,!0,!1),n=0;n<this.dynamicProperties.length;++n){var a=this.dynamicProperties[n];e.addAttribute(a.attributeName,this.dynamicBuffer,0,a.type===bn.UNSIGNED_BYTE,a.type,4*this.dynamicStride,4*a.offset)}for(n=0;n<this.staticProperties.length;++n)a=this.staticProperties[n],e.addAttribute(a.attributeName,this.staticBuffer,0,a.type===bn.UNSIGNED_BYTE,a.type,4*this.staticStride,4*a.offset)},r.prototype.uploadDynamic=function(e,t,n){for(var i=0;i<this.dynamicProperties.length;i++){var o=this.dynamicProperties[i];o.uploadFunction(e,t,n,o.type===bn.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},r.prototype.uploadStatic=function(e,t,n){for(var i=0;i<this.staticProperties.length;i++){var o=this.staticProperties[i];o.uploadFunction(e,t,n,o.type===bn.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},r.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},r}(),mb=function(r){function e(t){var n=r.call(this,t)||this;return n.shader=null,n.properties=null,n.tempMatrix=new pi,n.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:n.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:n.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:n.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:n.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:bn.UNSIGNED_BYTE,uploadFunction:n.uploadTint,offset:0}],n.shader=oa.from(`attribute vec2 aVertexPosition;
|
|
5083
5083
|
attribute vec2 aTextureCoord;
|
|
5084
5084
|
attribute vec4 aColor;
|
|
5085
5085
|
|
|
@@ -5112,8 +5112,8 @@ uniform sampler2D uSampler;
|
|
|
5112
5112
|
void main(void){
|
|
5113
5113
|
vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
|
|
5114
5114
|
gl_FragColor = color;
|
|
5115
|
-
}`,{}),n.state=Ja.for2d(),n}return pb(e,r),e.prototype.render=function(t){var n=t.children,i=t._maxSize,o=t._batchSize,s=this.renderer,a=n.length;if(a!==0){a>i&&!t.autoResize&&(a=i);var l=t._buffers;l||(l=t._buffers=this.generateBuffers(t));var u=n[0]._texture.baseTexture;this.state.blendMode=r0(t.blendMode,u.alphaMode),s.state.set(this.state);var c=s.gl,d=t.worldTransform.copyTo(this.tempMatrix);d.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=d.toArray(!0),this.shader.uniforms.uColor=zx(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,u.alphaMode),this.shader.uniforms.uSampler=u,this.renderer.shader.bind(this.shader);for(var f=!1,m=0,g=0;m<a;m+=o,g+=1){var _=a-m;_>o&&(_=o),g>=l.length&&l.push(this._generateOneMoreBuffer(t));var y=l[g];y.uploadDynamic(n,m,_);var w=t._bufferUpdateIDs[g]||0;(f=f||y._updateID<w)&&(y._updateID=t._updateID,y.uploadStatic(n,m,_)),s.geometry.bind(y.geometry),c.drawElements(c.TRIANGLES,6*_,c.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var n=[],i=t._maxSize,o=t._batchSize,s=t._properties,a=0;a<i;a+=o)n.push(new fb(this.properties,s,o));return n},e.prototype._generateOneMoreBuffer=function(t){var n=t._batchSize,i=t._properties;return new fb(this.properties,i,n)},e.prototype.uploadVertices=function(t,n,i,o,s,a){for(var l=0,u=0,c=0,d=0,f=0;f<i;++f){var m=t[n+f],g=m._texture,_=m.scale.x,y=m.scale.y,w=g.trim,M=g.orig;w?(l=(u=w.x-m.anchor.x*M.width)+w.width,c=(d=w.y-m.anchor.y*M.height)+w.height):(l=M.width*(1-m.anchor.x),u=M.width*-m.anchor.x,c=M.height*(1-m.anchor.y),d=M.height*-m.anchor.y),o[a]=u*_,o[a+1]=d*y,o[a+s]=l*_,o[a+s+1]=d*y,o[a+2*s]=l*_,o[a+2*s+1]=c*y,o[a+3*s]=u*_,o[a+3*s+1]=c*y,a+=4*s}},e.prototype.uploadPosition=function(t,n,i,o,s,a){for(var l=0;l<i;l++){var u=t[n+l].position;o[a]=u.x,o[a+1]=u.y,o[a+s]=u.x,o[a+s+1]=u.y,o[a+2*s]=u.x,o[a+2*s+1]=u.y,o[a+3*s]=u.x,o[a+3*s+1]=u.y,a+=4*s}},e.prototype.uploadRotation=function(t,n,i,o,s,a){for(var l=0;l<i;l++){var u=t[n+l].rotation;o[a]=u,o[a+s]=u,o[a+2*s]=u,o[a+3*s]=u,a+=4*s}},e.prototype.uploadUvs=function(t,n,i,o,s,a){for(var l=0;l<i;++l){var u=t[n+l]._texture._uvs;u?(o[a]=u.x0,o[a+1]=u.y0,o[a+s]=u.x1,o[a+s+1]=u.y1,o[a+2*s]=u.x2,o[a+2*s+1]=u.y2,o[a+3*s]=u.x3,o[a+3*s+1]=u.y3,a+=4*s):(o[a]=0,o[a+1]=0,o[a+s]=0,o[a+s+1]=0,o[a+2*s]=0,o[a+2*s+1]=0,o[a+3*s]=0,o[a+3*s+1]=0,a+=4*s)}},e.prototype.uploadTint=function(t,n,i,o,s,a){for(var l=0;l<i;++l){var u=t[n+l],c=u._texture.baseTexture.alphaMode>0,d=u.alpha,f=d<1&&c?xm(u._tintRGB,d):u._tintRGB+(255*d<<24);o[a]=f,o[a+s]=f,o[a+2*s]=f,o[a+3*s]=f,a+=4*s}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(Hd);(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(ua||(ua={})),function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"}(ha||(ha={}));var Kh={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(r,e){if(e===void 0&&(e=20),!this.adaptive||!r||isNaN(r))return e;var t=Math.ceil(r/this.maxLength);return t<this.minSegments?t=this.minSegments:t>this.maxSegments&&(t=this.maxSegments),t}},J0=function(){function r(){this.color=16777215,this.alpha=1,this.texture=Nt.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=Nt.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}(),gb=function(r,e){return(gb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)};function $0(r,e){function t(){this.constructor=r}gb(r,e),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var K0={build:function(r){r.points=r.shape.points.slice()},triangulate:function(r,e){var t=r.points,n=r.holes,i=e.points,o=e.indices;if(t.length>=6){for(var s=[],a=0;a<n.length;a++){var l=n[a];s.push(t.length/2),t=t.concat(l.points)}var u=$v()(t,s,2);if(!u)return;var c=i.length/2;for(a=0;a<u.length;a+=3)o.push(u[a]+c),o.push(u[a+1]+c),o.push(u[a+2]+c);for(a=0;a<t.length;a++)i.push(t[a])}}},Q0={build:function(r){var e,t,n=r.shape,i=r.points,o=n.x,s=n.y;if(i.length=0,r.type===ri.CIRC)e=n.radius,t=n.radius;else{var a=r.shape;e=a.width,t=a.height}if(e!==0&&t!==0){var l=Math.floor(30*Math.sqrt(n.radius))||Math.floor(15*Math.sqrt(e+t));l/=2.3;for(var u=2*Math.PI/l,c=0;c<l-.5;c++)i.push(o+Math.sin(-u*c)*e,s+Math.cos(-u*c)*t);i.push(i[0],i[1])}},triangulate:function(r,e){var t=r.points,n=e.points,i=e.indices,o=n.length/2,s=o,a=r.shape,l=r.matrix,u=a.x,c=a.y;n.push(r.matrix?l.a*u+l.c*c+l.tx:u,r.matrix?l.b*u+l.d*c+l.ty:c);for(var d=0;d<t.length;d+=2)n.push(t[d],t[d+1]),i.push(o++,s,o)}},vb={build:function(r){var e=r.shape,t=e.x,n=e.y,i=e.width,o=e.height,s=r.points;s.length=0,s.push(t,n,t+i,n,t+i,n+o,t,n+o)},triangulate:function(r,e){var t=r.points,n=e.points,i=n.length/2;n.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(i,i+1,i+2,i+1,i+2,i+3)}};function Qh(r,e,t){return r+(e-r)*t}function Xm(r,e,t,n,i,o,s){s===void 0&&(s=[]);for(var a=s,l=0,u=0,c=0,d=0,f=0,m=0,g=0,_=0;g<=20;++g)l=Qh(r,t,_=g/20),u=Qh(e,n,_),c=Qh(t,i,_),d=Qh(n,o,_),f=Qh(l,c,_),m=Qh(u,d,_),a.push(f,m);return a}var _b={build:function(r){var e=r.shape,t=r.points,n=e.x,i=e.y,o=e.width,s=e.height,a=Math.max(0,Math.min(e.radius,Math.min(o,s)/2));t.length=0,a?(Xm(n,i+a,n,i,n+a,i,t),Xm(n+o-a,i,n+o,i,n+o,i+a,t),Xm(n+o,i+s-a,n+o,i+s,n+o-a,i+s,t),Xm(n+a,i+s,n,i+s,n,i+s-a,t)):t.push(n,i,n+o,i,n+o,i+s,n,i+s)},triangulate:function(r,e){for(var t=r.points,n=e.points,i=e.indices,o=n.length/2,s=$v()(t,null,2),a=0,l=s.length;a<l;a+=3)i.push(s[a]+o),i.push(s[a+1]+o),i.push(s[a+2]+o);for(a=0,l=t.length;a<l;a++)n.push(t[a],t[++a])}};function yb(r,e,t,n,i,o,s,a){var l,u;s?(l=n,u=-t):(l=-n,u=t);var c=r-t*i+l,d=e-n*i+u,f=r+t*o+l,m=e+n*o+u;return a.push(c,d),a.push(f,m),2}function ec(r,e,t,n,i,o,s,a){var l=t-r,u=n-e,c=Math.atan2(l,u),d=Math.atan2(i-r,o-e);a&&c<d?c+=2*Math.PI:!a&&c>d&&(d+=2*Math.PI);var f=c,m=d-c,g=Math.abs(m),_=Math.sqrt(l*l+u*u),y=1+(15*g*Math.sqrt(_)/Math.PI>>0),w=m/y;if(f+=w,a){s.push(r,e),s.push(t,n);for(var M=1,I=f;M<y;M++,I+=w)s.push(r,e),s.push(r+Math.sin(I)*_,e+Math.cos(I)*_);s.push(r,e),s.push(i,o)}else{for(s.push(t,n),s.push(r,e),M=1,I=f;M<y;M++,I+=w)s.push(r+Math.sin(I)*_,e+Math.cos(I)*_),s.push(r,e);s.push(i,o),s.push(r,e)}return 2*y}function e_(r,e){r.lineStyle.native?function(t,n){var i=0,o=t.shape,s=t.points||o.points,a=o.type!==ri.POLY||o.closeStroke;if(s.length!==0){var l=n.points,u=n.indices,c=s.length/2,d=l.length/2,f=d;for(l.push(s[0],s[1]),i=1;i<c;i++)l.push(s[2*i],s[2*i+1]),u.push(f,f+1),f++;a&&u.push(f,d)}}(r,e):function(t,n){var i=t.shape,o=t.points||i.points.slice(),s=n.closePointEps;if(o.length!==0){var a=t.lineStyle,l=new oi(o[0],o[1]),u=new oi(o[o.length-2],o[o.length-1]),c=i.type!==ri.POLY||i.closeStroke,d=Math.abs(l.x-u.x)<s&&Math.abs(l.y-u.y)<s;if(c){o=o.slice(),d&&(o.pop(),o.pop(),u.set(o[o.length-2],o[o.length-1]));var f=.5*(l.x+u.x),m=.5*(u.y+l.y);o.unshift(f,m),o.push(f,m)}var g=n.points,_=o.length/2,y=o.length,w=g.length/2,M=a.width/2,I=M*M,F=a.miterLimit*a.miterLimit,C=o[0],U=o[1],N=o[2],G=o[3],he=0,ne=0,Z=-(U-G),Q=C-N,$=0,se=0,me=Math.sqrt(Z*Z+Q*Q);Z/=me,Q/=me,Z*=M,Q*=M;var ge=a.alignment,de=2*(1-ge),fe=2*ge;c||(a.cap===ha.ROUND?y+=ec(C-Z*(de-fe)*.5,U-Q*(de-fe)*.5,C-Z*de,U-Q*de,C+Z*fe,U+Q*fe,g,!0)+2:a.cap===ha.SQUARE&&(y+=yb(C,U,Z,Q,de,fe,!0,g))),g.push(C-Z*de,U-Q*de),g.push(C+Z*fe,U+Q*fe);for(var Re=1;Re<_-1;++Re){C=o[2*(Re-1)],U=o[2*(Re-1)+1],N=o[2*Re],G=o[2*Re+1],he=o[2*(Re+1)],ne=o[2*(Re+1)+1],Z=-(U-G),Q=C-N,Z/=me=Math.sqrt(Z*Z+Q*Q),Q/=me,Z*=M,Q*=M,$=-(G-ne),se=N-he,$/=me=Math.sqrt($*$+se*se),se/=me,$*=M,se*=M;var ke=N-C,Be=U-G,J=N-he,te=ne-G,Ae=Be*J-te*ke,Ne=Ae<0;if(Math.abs(Ae)<.1)g.push(N-Z*de,G-Q*de),g.push(N+Z*fe,G+Q*fe);else{var Te=(-Z+C)*(-Q+G)-(-Z+N)*(-Q+U),Ge=(-$+he)*(-se+G)-(-$+N)*(-se+ne),Ye=(ke*Ge-J*Te)/Ae,ve=(te*Te-Be*Ge)/Ae,Y=(Ye-N)*(Ye-N)+(ve-G)*(ve-G),pe=N+(Ye-N)*de,ye=G+(ve-G)*de,xe=N-(Ye-N)*fe,De=G-(ve-G)*fe,ht=Ne?de:fe;Y<=Math.min(ke*ke+Be*Be,J*J+te*te)+ht*ht*I?a.join===ua.BEVEL||Y/I>F?(Ne?(g.push(pe,ye),g.push(N+Z*fe,G+Q*fe),g.push(pe,ye),g.push(N+$*fe,G+se*fe)):(g.push(N-Z*de,G-Q*de),g.push(xe,De),g.push(N-$*de,G-se*de),g.push(xe,De)),y+=2):a.join===ua.ROUND?Ne?(g.push(pe,ye),g.push(N+Z*fe,G+Q*fe),y+=ec(N,G,N+Z*fe,G+Q*fe,N+$*fe,G+se*fe,g,!0)+4,g.push(pe,ye),g.push(N+$*fe,G+se*fe)):(g.push(N-Z*de,G-Q*de),g.push(xe,De),y+=ec(N,G,N-Z*de,G-Q*de,N-$*de,G-se*de,g,!1)+4,g.push(N-$*de,G-se*de),g.push(xe,De)):(g.push(pe,ye),g.push(xe,De)):(g.push(N-Z*de,G-Q*de),g.push(N+Z*fe,G+Q*fe),a.join===ua.BEVEL||Y/I>F||(a.join===ua.ROUND?y+=Ne?ec(N,G,N+Z*fe,G+Q*fe,N+$*fe,G+se*fe,g,!0)+2:ec(N,G,N-Z*de,G-Q*de,N-$*de,G-se*de,g,!1)+2:(Ne?(g.push(xe,De),g.push(xe,De)):(g.push(pe,ye),g.push(pe,ye)),y+=2)),g.push(N-$*de,G-se*de),g.push(N+$*fe,G+se*fe),y+=2)}}C=o[2*(_-2)],U=o[2*(_-2)+1],N=o[2*(_-1)],Z=-(U-(G=o[2*(_-1)+1])),Q=C-N,Z/=me=Math.sqrt(Z*Z+Q*Q),Q/=me,Z*=M,Q*=M,g.push(N-Z*de,G-Q*de),g.push(N+Z*fe,G+Q*fe),c||(a.cap===ha.ROUND?y+=ec(N-Z*(de-fe)*.5,G-Q*(de-fe)*.5,N-Z*de,G-Q*de,N+Z*fe,G+Q*fe,g,!1)+2:a.cap===ha.SQUARE&&(y+=yb(N,G,Z,Q,de,fe,!1,g)));var xt=n.indices,_t=Kh.epsilon*Kh.epsilon;for(Re=w;Re<y+w-2;++Re)C=g[2*Re],U=g[2*Re+1],N=g[2*(Re+1)],G=g[2*(Re+1)+1],he=g[2*(Re+2)],ne=g[2*(Re+2)+1],Math.abs(C*(G-ne)+N*(ne-U)+he*(U-G))<_t||xt.push(Re,Re+1,Re+2)}}(r,e)}var tc,t_=function(){function r(){}return r.curveTo=function(e,t,n,i,o,s){var a=s[s.length-2],l=s[s.length-1]-t,u=a-e,c=i-t,d=n-e,f=Math.abs(l*d-u*c);if(f<1e-8||o===0)return s[s.length-2]===e&&s[s.length-1]===t||s.push(e,t),null;var m=l*l+u*u,g=c*c+d*d,_=l*c+u*d,y=o*Math.sqrt(m)/f,w=o*Math.sqrt(g)/f,M=y*_/m,I=w*_/g,F=y*d+w*u,C=y*c+w*l,U=u*(w+M),N=l*(w+M),G=d*(y+I),he=c*(y+I);return{cx:F+e,cy:C+t,radius:o,startAngle:Math.atan2(N-C,U-F),endAngle:Math.atan2(he-C,G-F),anticlockwise:u*c>d*l}},r.arc=function(e,t,n,i,o,s,a,l,u){for(var c=a-s,d=Kh._segmentsCount(Math.abs(c)*o,40*Math.ceil(Math.abs(c)/Bd)),f=c/(2*d),m=2*f,g=Math.cos(f),_=Math.sin(f),y=d-1,w=y%1/y,M=0;M<=y;++M){var I=f+s+m*(M+w*M),F=Math.cos(I),C=-Math.sin(I);u.push((g*F+_*C)*o+n,(g*-C+_*F)*o+i)}},r}(),xb=function(){function r(){}return r.curveLength=function(e,t,n,i,o,s,a,l){for(var u=0,c=0,d=0,f=0,m=0,g=0,_=0,y=0,w=0,M=0,I=0,F=e,C=t,U=1;U<=10;++U)M=F-(y=(_=(g=(m=1-(c=U/10))*m)*m)*e+3*g*c*n+3*m*(d=c*c)*o+(f=d*c)*a),I=C-(w=_*t+3*g*c*i+3*m*d*s+f*l),F=y,C=w,u+=Math.sqrt(M*M+I*I);return u},r.curveTo=function(e,t,n,i,o,s,a){var l=a[a.length-2],u=a[a.length-1];a.length-=2;var c=Kh._segmentsCount(r.curveLength(l,u,e,t,n,i,o,s)),d=0,f=0,m=0,g=0,_=0;a.push(l,u);for(var y=1,w=0;y<=c;++y)m=(f=(d=1-(w=y/c))*d)*d,_=(g=w*w)*w,a.push(m*l+3*f*w*e+3*d*g*n+_*o,m*u+3*f*w*t+3*d*g*i+_*s)},r}(),bb=function(){function r(){}return r.curveLength=function(e,t,n,i,o,s){var a=e-2*n+o,l=t-2*i+s,u=2*n-2*e,c=2*i-2*t,d=4*(a*a+l*l),f=4*(a*u+l*c),m=u*u+c*c,g=2*Math.sqrt(d+f+m),_=Math.sqrt(d),y=2*d*_,w=2*Math.sqrt(m),M=f/_;return(y*g+_*f*(g-w)+(4*m*d-f*f)*Math.log((2*_+M+g)/(M+w)))/(4*y)},r.curveTo=function(e,t,n,i,o){for(var s=o[o.length-2],a=o[o.length-1],l=Kh._segmentsCount(r.curveLength(s,a,e,t,n,i)),u=0,c=0,d=1;d<=l;++d){var f=d/l;u=s+(e-s)*f,c=a+(t-a)*f,o.push(u+(e+(n-e)*f-u)*f,c+(t+(i-t)*f-c)*f)}},r}(),wb=function(){function r(){this.reset()}return r.prototype.begin=function(e,t,n){this.reset(),this.style=e,this.start=t,this.attribStart=n},r.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},r.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},r}(),Ym=((tc={})[ri.POLY]=K0,tc[ri.CIRC]=Q0,tc[ri.ELIP]=Q0,tc[ri.RECT]=vb,tc[ri.RREC]=_b,tc),n_=[],Zd=[],i_=function(){function r(e,t,n,i){t===void 0&&(t=null),n===void 0&&(n=null),i===void 0&&(i=null),this.shape=e,this.lineStyle=n,this.fillStyle=t,this.matrix=i,this.type=e.type,this.points=[],this.holes=[]}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r}(),nc=new oi,lA=new kd,Tb=function(r){function e(){var t=r.call(this)||this;return t.uvsFloat32=null,t.indicesUint16=null,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.dirty=0,t.batchDirty=-1,t.cacheDirty=-1,t.clearDirty=0,t.drawCalls=[],t.batches=[],t.shapeIndex=0,t._bounds=new kd,t.boundsDirty=-1,t.boundsPadding=0,t.batchable=!1,t.indicesUint16=null,t.uvsFloat32=null,t.closePointEps=1e-4,t}return $0(e,r),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Zd.push(this.drawCalls[t]);for(this.drawCalls.length=0,t=0;t<this.batches.length;t++){var n=this.batches[t];n.reset(),n_.push(n)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,n,i,o){n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=null);var s=new i_(t,n,i,o);return this.graphicsData.push(s),this.dirty++,this},e.prototype.drawHole=function(t,n){if(n===void 0&&(n=null),!this.graphicsData.length)return null;var i=new i_(t,null,null,n),o=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=o.lineStyle,o.holes.push(i),this.dirty++,this},e.prototype.destroy=function(){r.prototype.destroy.call(this);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var n=this.graphicsData,i=0;i<n.length;++i){var o=n[i];if(o.fillStyle.visible&&o.shape&&(o.matrix?o.matrix.applyInverse(t,nc):nc.copyFrom(t),o.shape.contains(nc.x,nc.y))){var s=!1;if(o.holes){for(var a=0;a<o.holes.length;a++)if(o.holes[a].shape.contains(nc.x,nc.y)){s=!0;break}}if(!s)return!0}}return!1},e.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var n=this.uvs,i=this.graphicsData,o=null,s=null;this.batches.length>0&&(s=(o=this.batches[this.batches.length-1]).style);for(var a=this.shapeIndex;a<i.length;a++){this.shapeIndex++;var l=i[a],u=l.fillStyle,c=l.lineStyle;Ym[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix);for(var d=0;d<2;d++){var f=d===0?u:c;if(f.visible){var m=f.texture.baseTexture,g=this.indices.length,_=this.points.length/2;m.wrapMode=cs.REPEAT,d===0?this.processFill(l):this.processLine(l);var y=this.points.length/2-_;y!==0&&(o&&!this._compareStyles(s,f)&&(o.end(g,_),o=null),o||((o=n_.pop()||new wb).begin(f,g,_),this.batches.push(o),s=f),this.addUvs(this.points,n,f.texture,_,y,f.matrix))}}}var w=this.indices.length,M=this.points.length/2;if(o&&o.end(w,M),this.batches.length!==0){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var I=M>65535&&t;this.indicesUint16=I?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,n){return!(!t||!n)&&t.texture.baseTexture===n.texture.baseTexture&&t.color+t.alpha===n.color+n.alpha&&!!t.native==!!n.native},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,n=this.graphicsData.length;t<n;t++){var i=this.graphicsData[t],o=i.fillStyle,s=i.lineStyle;if(o&&!o.texture.baseTexture.valid||s&&!s.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,n=0,i=t.length;n<i;n++)for(var o=t[n],s=0;s<o.size;s++){var a=o.start+s;this.indicesUint16[a]=this.indicesUint16[a]-o.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,n=0;n<t.length;n++)if(t[n].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++vn._globalBatch,n=0;n<this.drawCalls.length;n++)this.drawCalls[n].texArray.clear(),Zd.push(this.drawCalls[n]);this.drawCalls.length=0;var i=this.colors,o=this.textureIds,s=Zd.pop();s||((s=new km).texArray=new Gm),s.texArray.count=0,s.start=0,s.size=0,s.type=oo.TRIANGLES;var a=0,l=null,u=0,c=!1,d=oo.TRIANGLES,f=0;for(this.drawCalls.push(s),n=0;n<this.batches.length;n++){var m=this.batches[n],g=m.style,_=g.texture.baseTexture;c!==!!g.native&&(d=(c=!!g.native)?oo.LINES:oo.TRIANGLES,l=null,a=8,t++),l!==_&&(l=_,_._batchEnabled!==t&&(a===8&&(t++,a=0,s.size>0&&((s=Zd.pop())||((s=new km).texArray=new Gm),this.drawCalls.push(s)),s.start=f,s.size=0,s.texArray.count=0,s.type=d),_.touched=1,_._batchEnabled=t,_._batchLocation=a,_.wrapMode=cs.REPEAT,s.texArray.elements[s.texArray.count++]=_,a++)),s.size+=m.size,f+=m.size,u=_._batchLocation,this.addColors(i,g.color,g.alpha,m.attribSize),this.addTextureIds(o,u,m.attribSize)}vn._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,n=this.uvs,i=this.colors,o=this.textureIds,s=new ArrayBuffer(3*t.length*4),a=new Float32Array(s),l=new Uint32Array(s),u=0,c=0;c<t.length/2;c++)a[u++]=t[2*c],a[u++]=t[2*c+1],a[u++]=n[2*c],a[u++]=n[2*c+1],l[u++]=i[c],a[u++]=o[c];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?(this.processHoles(t.holes),K0.triangulate(t,this)):Ym[t.type].triangulate(t,this)},e.prototype.processLine=function(t){e_(t,this);for(var n=0;n<t.holes.length;n++)e_(t.holes[n],this)},e.prototype.processHoles=function(t){for(var n=0;n<t.length;n++){var i=t[n];Ym[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds,n=lA,i=pi.IDENTITY;this._bounds.clear(),n.clear();for(var o=0;o<this.graphicsData.length;o++){var s=this.graphicsData[o],a=s.shape,l=s.type,u=s.lineStyle,c=s.matrix||pi.IDENTITY,d=0;if(u&&u.visible){var f=u.alignment;d=u.width,l===ri.POLY?d*=.5+Math.abs(.5-f):d*=Math.max(0,f)}if(i!==c&&(n.isEmpty()||(t.addBoundsMatrix(n,i),n.clear()),i=c),l===ri.RECT||l===ri.RREC){var m=a;n.addFramePad(m.x,m.y,m.x+m.width,m.y+m.height,d,d)}else if(l===ri.CIRC){var g=a;n.addFramePad(g.x,g.y,g.x,g.y,g.radius+d,g.radius+d)}else if(l===ri.ELIP){var _=a;n.addFramePad(_.x,_.y,_.x,_.y,_.width+d,_.height+d)}else{var y=a;t.addVerticesMatrix(i,y.points,0,y.points.length,d,d)}}n.isEmpty()||t.addBoundsMatrix(n,i),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,n){for(var i=0;i<t.length/2;i++){var o=t[2*i],s=t[2*i+1];t[2*i]=n.a*o+n.c*s+n.tx,t[2*i+1]=n.b*o+n.d*s+n.ty}},e.prototype.addColors=function(t,n,i,o){for(var s=xm((n>>16)+(65280&n)+((255&n)<<16),i);o-- >0;)t.push(s)},e.prototype.addTextureIds=function(t,n,i){for(;i-- >0;)t.push(n)},e.prototype.addUvs=function(t,n,i,o,s,a){a===void 0&&(a=null);for(var l=0,u=n.length,c=i.frame;l<s;){var d=t[2*(o+l)],f=t[2*(o+l)+1];if(a){var m=a.a*d+a.c*f+a.tx;f=a.b*d+a.d*f+a.ty,d=m}l++,n.push(d/c.width,f/c.height)}var g=i.baseTexture;(c.width<g.width||c.height<g.height)&&this.adjustUvs(n,i,u,s)},e.prototype.adjustUvs=function(t,n,i,o){for(var s=n.baseTexture,a=1e-6,l=i+2*o,u=n.frame,c=u.width/s.width,d=u.height/s.height,f=u.x/u.width,m=u.y/u.height,g=Math.floor(t[i]+a),_=Math.floor(t[i+1]+a),y=i+2;y<l;y+=2)g=Math.min(g,Math.floor(t[y]+a)),_=Math.min(_,Math.floor(t[y+1]+a));for(f-=g,m-=_,y=i;y<l;y+=2)t[y]=(t[y]+f)*c,t[y+1]=(t[y+1]+m)*d},e.BATCHABLE_SIZE=100,e}(j0),Sb=function(r){function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.width=0,t.alignment=.5,t.native=!1,t.cap=ha.BUTT,t.join=ua.MITER,t.miterLimit=10,t}return $0(e,r),e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){r.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(J0),uA=new Float32Array(3),r_={},ca=function(r){function e(t){t===void 0&&(t=null);var n=r.call(this)||this;return n._geometry=t||new Tb,n._geometry.refCount++,n.shader=null,n.state=Ja.for2d(),n._fillStyle=new J0,n._lineStyle=new Sb,n._matrix=null,n._holeMode=!1,n.currentPath=null,n.batches=[],n.batchTint=-1,n.batchDirty=-1,n.vertexData=null,n.pluginName="batch",n._transformID=-1,n.tint=16777215,n.blendMode=Ft.NORMAL,n}return $0(e,r),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,n,i,o,s){return t===void 0&&(t=null),n===void 0&&(n=0),i===void 0&&(i=1),o===void 0&&(o=.5),s===void 0&&(s=!1),typeof t=="number"&&(t={width:t,color:n,alpha:i,alignment:o,native:s}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:Nt.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:ha.BUTT,join:ua.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var n=t.width>0&&t.alpha>0;return n?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:n},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,n=this.currentPath.points.length;n>2&&(this.drawShape(this.currentPath),this.currentPath=new Ud,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[n-2],t[n-1]))}else this.currentPath=new Ud,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,n){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=n,this},e.prototype.lineTo=function(t,n){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,o=i[i.length-2],s=i[i.length-1];return o===t&&s===n||i.push(t,n),this},e.prototype._initCurve=function(t,n){t===void 0&&(t=0),n===void 0&&(n=0),this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,n]):this.moveTo(t,n)},e.prototype.quadraticCurveTo=function(t,n,i,o){this._initCurve();var s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),bb.curveTo(t,n,i,o,s),this},e.prototype.bezierCurveTo=function(t,n,i,o,s,a){return this._initCurve(),xb.curveTo(t,n,i,o,s,a,this.currentPath.points),this},e.prototype.arcTo=function(t,n,i,o,s){this._initCurve(t,n);var a=this.currentPath.points,l=t_.curveTo(t,n,i,o,s,a);if(l){var u=l.cx,c=l.cy,d=l.radius,f=l.startAngle,m=l.endAngle,g=l.anticlockwise;this.arc(u,c,d,f,m,g)}return this},e.prototype.arc=function(t,n,i,o,s,a){if(a===void 0&&(a=!1),o===s)return this;if(!a&&s<=o?s+=Bd:a&&o<=s&&(o+=Bd),s-o==0)return this;var l=t+Math.cos(o)*i,u=n+Math.sin(o)*i,c=this._geometry.closePointEps,d=this.currentPath?this.currentPath.points:null;if(d){var f=Math.abs(d[d.length-2]-l),m=Math.abs(d[d.length-1]-u);f<c&&m<c||d.push(l,u)}else this.moveTo(l,u),d=this.currentPath.points;return t_.arc(l,u,t,n,i,o,s,a,d),this},e.prototype.beginFill=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=1),this.beginTextureFill({texture:Nt.WHITE,color:t,alpha:n})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:Nt.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var n=t.alpha>0;return n?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:n},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,n,i,o){return this.drawShape(new nn(t,n,i,o))},e.prototype.drawRoundedRect=function(t,n,i,o,s){return this.drawShape(new h0(t,n,i,o,s))},e.prototype.drawCircle=function(t,n,i){return this.drawShape(new $x(t,n,i))},e.prototype.drawEllipse=function(t,n,i,o){return this.drawShape(new Kx(t,n,i,o))},e.prototype.drawPolygon=function(){for(var t,n=arguments,i=[],o=0;o<arguments.length;o++)i[o]=n[o];var s=!0,a=i[0];a.points?(s=a.closeStroke,t=a.points):t=Array.isArray(i[0])?i[0]:i;var l=new Ud(t);return l.closeStroke=s,this.drawShape(l),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return!(t.length!==1||t[0].shape.type!==ri.RECT||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var n=this._geometry,i=t.context.supports.uint32Indices;n.updateBatches(i),n.batchable?(this.batchDirty!==n.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,n=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(var o=0;o<i;o++){var s=t.batches[o],a=s.style.color,l=new Float32Array(this.vertexData.buffer,4*s.attribStart*2,2*s.attribSize),u=new Float32Array(t.uvsFloat32.buffer,4*s.attribStart*2,2*s.attribSize),c={vertexData:l,blendMode:n,indices:new Uint16Array(t.indicesUint16.buffer,2*s.start,s.size),uvs:u,_batchRGB:ou(a),_tintRGB:a,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[o]=c}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var n=0,i=this.batches.length;n<i;n++){var o=this.batches[n];o.worldAlpha=this.worldAlpha*o.alpha,t.plugins[this.pluginName].render(o)}}},e.prototype._renderDirect=function(t){var n=this._resolveDirectShader(t),i=this._geometry,o=this.tint,s=this.worldAlpha,a=n.uniforms,l=i.drawCalls;a.translationMatrix=this.transform.worldTransform,a.tint[0]=(o>>16&255)/255*s,a.tint[1]=(o>>8&255)/255*s,a.tint[2]=(255&o)/255*s,a.tint[3]=s,t.shader.bind(n),t.geometry.bind(i,n),t.state.set(this.state);for(var u=0,c=l.length;u<c;u++)this._renderDrawCallDirect(t,i.drawCalls[u])},e.prototype._renderDrawCallDirect=function(t,n){for(var i=n.texArray,o=n.type,s=n.size,a=n.start,l=i.count,u=0;u<l;u++)t.texture.bind(i.elements[u],u);t.geometry.draw(o,s,a)},e.prototype._resolveDirectShader=function(t){var n=this.shader,i=this.pluginName;if(!n){if(!r_[i]){for(var o=t.plugins.batch.MAX_TEXTURES,s=new Int32Array(o),a=0;a<o;a++)s[a]=a;var l={tint:new Float32Array([1,1,1,1]),translationMatrix:new pi,default:Za.from({uSamplers:s},!0)},u=t.plugins[i]._shader.program;r_[i]=new oa(u,l)}n=r_[i]}return n},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var n=t.bounds,i=n.minX,o=n.minY,s=n.maxX,a=n.maxY;this._bounds.addFrame(this.transform,i,o,s,a)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=ou(this.tint,uA),n=0;n<this.batches.length;n++){var i=this.batches[n],o=i._batchRGB,s=(t[0]*o[0]*255<<16)+(t[1]*o[1]*255<<8)+(0|t[2]*o[2]*255);i._tintRGB=(s>>16)+(65280&s)+((255&s)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var n=this.transform.worldTransform,i=n.a,o=n.b,s=n.c,a=n.d,l=n.tx,u=n.ty,c=this._geometry.points,d=this.vertexData,f=0,m=0;m<c.length;m+=2){var g=c[m],_=c[m+1];d[f++]=i*g+s*_+l,d[f++]=a*_+o*g+u}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,r.prototype.destroy.call(this,t)},e._TEMP_POINT=new oi,e}(Mi),hA={buildPoly:K0,buildCircle:Q0,buildRectangle:vb,buildRoundedRectangle:_b,buildLine:e_,ArcUtils:t_,BezierUtils:xb,QuadraticUtils:bb,BatchPart:wb,FILL_COMMANDS:Ym,BATCH_POOL:n_,DRAW_CALL_POOL:Zd},Eb=function(r,e){return(Eb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)},ic,Jd=new oi,cA=new Uint16Array([0,1,2,0,2,3]),Hn=function(r){function e(t){var n=r.call(this)||this;return n._anchor=new hu(n._onAnchorUpdate,n,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),n._texture=null,n._width=0,n._height=0,n._tint=null,n._tintRGB=null,n.tint=16777215,n.blendMode=Ft.NORMAL,n._cachedTint=16777215,n.uvs=null,n.texture=t||Nt.EMPTY,n.vertexData=new Float32Array(8),n.vertexTrimmedData=null,n._transformID=-1,n._textureID=-1,n._transformTrimmedID=-1,n._textureTrimmedID=-1,n.indices=cA,n.pluginName="batch",n.isSprite=!0,n._roundPixels=At.ROUND_PIXELS,n}return function(t,n){function i(){this.constructor=t}Eb(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}(e,r),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=au(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=au(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var n=this.transform.worldTransform,i=n.a,o=n.b,s=n.c,a=n.d,l=n.tx,u=n.ty,c=this.vertexData,d=t.trim,f=t.orig,m=this._anchor,g=0,_=0,y=0,w=0;if(d?(g=(_=d.x-m._x*f.width)+d.width,y=(w=d.y-m._y*f.height)+d.height):(g=(_=-m._x*f.width)+f.width,y=(w=-m._y*f.height)+f.height),c[0]=i*_+s*w+l,c[1]=a*w+o*_+u,c[2]=i*g+s*w+l,c[3]=a*w+o*g+u,c[4]=i*g+s*y+l,c[5]=a*y+o*g+u,c[6]=i*_+s*y+l,c[7]=a*y+o*_+u,this._roundPixels)for(var M=At.RESOLUTION,I=0;I<c.length;++I)c[I]=Math.round((c[I]*M|0)/M)}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,n=this.vertexTrimmedData,i=t.orig,o=this._anchor,s=this.transform.worldTransform,a=s.a,l=s.b,u=s.c,c=s.d,d=s.tx,f=s.ty,m=-o._x*i.width,g=m+i.width,_=-o._y*i.height,y=_+i.height;n[0]=a*m+u*_+d,n[1]=c*_+l*m+f,n[2]=a*g+u*_+d,n[3]=c*_+l*g+f,n[4]=a*g+u*y+d,n[5]=c*y+l*g+f,n[6]=a*m+u*y+d,n[7]=c*y+l*m+f},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,n=this._texture.orig;!t||t.width===n.width&&t.height===n.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(t){return this.children.length===0?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new nn),t=this._localBoundsRect),this._bounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Jd);var n=this._texture.orig.width,i=this._texture.orig.height,o=-n*this.anchor.x,s=0;return Jd.x>=o&&Jd.x<o+n&&(s=-i*this.anchor.y,Jd.y>=s&&Jd.y<s+i)},e.prototype.destroy=function(t){if(r.prototype.destroy.call(this,t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof t=="boolean"?t:t&&t.texture){var n=typeof t=="boolean"?t:t&&t.baseTexture;this._texture.destroy(!!n)}this._texture=null},e.from=function(t,n){return new e(t instanceof Nt?t:Nt.from(t,n))},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var n=au(this.scale.x)||1;this.scale.x=n*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var n=au(this.scale.y)||1;this.scale.y=n*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||Nt.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(Mi),Mb=function(r,e){return(Mb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)};(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(ic||(ic={}));var o_={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:ic.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},dA=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],yu=function(){function r(e){this.styleID=0,this.reset(),a_(this,e,e)}return r.prototype.clone=function(){var e={};return a_(e,this,o_),new r(e)},r.prototype.reset=function(){a_(this,o_,o_)},Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=s_(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=s_(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){(function(t,n){if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!==n[i])return!1;return!0})(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leading",{get:function(){return this._leading},set:function(e){this._leading!==e&&(this._leading=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this._padding},set:function(e){this._padding!==e&&(this._padding=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stroke",{get:function(){return this._stroke},set:function(e){var t=s_(e);this._stroke!==t&&(this._stroke=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"trim",{get:function(){return this._trim},set:function(e){this._trim!==e&&(this._trim=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)},enumerable:!1,configurable:!0}),r.prototype.toFontString=function(){var e=typeof this.fontSize=="number"?this.fontSize+"px":this.fontSize,t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(var n=t.length-1;n>=0;n--){var i=t[n].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&dA.indexOf(i)<0&&(i='"'+i+'"'),t[n]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r}();function Ab(r){return typeof r=="number"?t0(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function s_(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=Ab(r[e]);return r}return Ab(r)}function a_(r,e,t){for(var n in t)Array.isArray(e[n])?r[n]=e[n].slice():r[n]=e[n]}var Hr=function(){function r(e,t,n,i,o,s,a,l,u){this.text=e,this.style=t,this.width=n,this.height=i,this.lines=o,this.lineWidths=s,this.lineHeight=a,this.maxLineWidth=l,this.fontProperties=u}return r.measureText=function(e,t,n,i){i===void 0&&(i=r._canvas),n=n==null?t.wordWrap:n;var o=t.toFontString(),s=r.measureFont(o);s.fontSize===0&&(s.fontSize=t.fontSize,s.ascent=t.fontSize);var a=i.getContext("2d");a.font=o;for(var l=(n?r.wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),u=new Array(l.length),c=0,d=0;d<l.length;d++){var f=a.measureText(l[d]).width+(l[d].length-1)*t.letterSpacing;u[d]=f,c=Math.max(c,f)}var m=c+t.strokeThickness;t.dropShadow&&(m+=t.dropShadowDistance);var g=t.lineHeight||s.fontSize+t.strokeThickness,_=Math.max(g,s.fontSize+t.strokeThickness)+(l.length-1)*(g+t.leading);return t.dropShadow&&(_+=t.dropShadowDistance),new r(e,t,m,_,l,u,g+t.leading,c,s)},r.wordWrap=function(e,t,n){n===void 0&&(n=r._canvas);for(var i=n.getContext("2d"),o=0,s="",a="",l=Object.create(null),u=t.letterSpacing,c=t.whiteSpace,d=r.collapseSpaces(c),f=r.collapseNewlines(c),m=!d,g=t.wordWrapWidth+u,_=r.tokenize(e),y=0;y<_.length;y++){var w=_[y];if(r.isNewline(w)){if(!f){a+=r.addLine(s),m=!d,s="",o=0;continue}w=" "}if(d){var M=r.isBreakingSpace(w),I=r.isBreakingSpace(s[s.length-1]);if(M&&I)continue}var F=r.getFromCache(w,u,l,i);if(F>g)if(s!==""&&(a+=r.addLine(s),s="",o=0),r.canBreakWords(w,t.breakWords))for(var C=r.wordWrapSplit(w),U=0;U<C.length;U++){for(var N=C[U],G=1;C[U+G];){var he=C[U+G],ne=N[N.length-1];if(r.canBreakChars(ne,he,w,U,t.breakWords))break;N+=he,G++}U+=N.length-1;var Z=r.getFromCache(N,u,l,i);Z+o>g&&(a+=r.addLine(s),m=!1,s="",o=0),s+=N,o+=Z}else{s.length>0&&(a+=r.addLine(s),s="",o=0);var Q=y===_.length-1;a+=r.addLine(w,!Q),m=!1,s="",o=0}else F+o>g&&(m=!1,a+=r.addLine(s),s="",o=0),(s.length>0||!r.isBreakingSpace(w)||m)&&(s+=w,o+=F)}return a+=r.addLine(s,!1)},r.addLine=function(e,t){return t===void 0&&(t=!0),e=r.trimRight(e),e=t?e+`
|
|
5116
|
-
`:e},r.getFromCache=function(e,t,n,i){var o=n[e];if(typeof o!="number"){var s=e.length*t;o=i.measureText(e).width+s,n[e]=o}return o},r.collapseSpaces=function(e){return e==="normal"||e==="pre-line"},r.collapseNewlines=function(e){return e==="normal"},r.trimRight=function(e){if(typeof e!="string")return"";for(var t=e.length-1;t>=0;t--){var n=e[t];if(!r.isBreakingSpace(n))break;e=e.slice(0,-1)}return e},r.isNewline=function(e){return typeof e=="string"&&r._newlines.indexOf(e.charCodeAt(0))>=0},r.isBreakingSpace=function(e,t){return typeof e=="string"&&r._breakingSpaces.indexOf(e.charCodeAt(0))>=0},r.tokenize=function(e){var t=[],n="";if(typeof e!="string")return t;for(var i=0;i<e.length;i++){var o=e[i],s=e[i+1];r.isBreakingSpace(o,s)||r.isNewline(o)?(n!==""&&(t.push(n),n=""),t.push(o)):n+=o}return n!==""&&t.push(n),t},r.canBreakWords=function(e,t){return t},r.canBreakChars=function(e,t,n,i,o){return!0},r.wordWrapSplit=function(e){return e.split("")},r.measureFont=function(e){if(r._fonts[e])return r._fonts[e];var t={ascent:0,descent:0,fontSize:0},n=r._canvas,i=r._context;i.font=e;var o=r.METRICS_STRING+r.BASELINE_SYMBOL,s=Math.ceil(i.measureText(o).width),a=Math.ceil(i.measureText(r.BASELINE_SYMBOL).width),l=Math.ceil(r.HEIGHT_MULTIPLIER*a);a=a*r.BASELINE_MULTIPLIER|0,n.width=s,n.height=l,i.fillStyle="#f00",i.fillRect(0,0,s,l),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,a);var u=i.getImageData(0,0,s,l).data,c=u.length,d=4*s,f=0,m=0,g=!1;for(f=0;f<a;++f){for(var _=0;_<d;_+=4)if(u[m+_]!==255){g=!0;break}if(g)break;m+=d}for(t.ascent=a-f,m=c-d,g=!1,f=l;f>a;--f){for(_=0;_<d;_+=4)if(u[m+_]!==255){g=!0;break}if(g)break;m-=d}return t.descent=f-a,t.fontSize=t.ascent+t.descent,r._fonts[e]=t,t},r.clearMetrics=function(e){e===void 0&&(e=""),e?delete r._fonts[e]:r._fonts={}},r}(),qm=function(){try{var r=new OffscreenCanvas(0,0),e=r.getContext("2d");return e&&e.measureText?r:document.createElement("canvas")}catch{return document.createElement("canvas")}}();qm.width=qm.height=10,Hr._canvas=qm,Hr._context=qm.getContext("2d"),Hr._fonts={},Hr.METRICS_STRING="|\xC9q\xC5",Hr.BASELINE_SYMBOL="M",Hr.BASELINE_MULTIPLIER=1.4,Hr.HEIGHT_MULTIPLIER=2,Hr._newlines=[10,13],Hr._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var pA={texture:!0,children:!1,baseTexture:!0},Zm=function(r){function e(t,n,i){var o=this,s=!1;i||(i=document.createElement("canvas"),s=!0),i.width=3,i.height=3;var a=Nt.from(i);return a.orig=new nn,a.trim=new nn,(o=r.call(this,a)||this)._ownCanvas=s,o.canvas=i,o.context=o.canvas.getContext("2d"),o._resolution=At.RESOLUTION,o._autoResolution=!0,o._text=null,o._style=null,o._styleListener=null,o._font="",o.text=t,o.style=n,o.localStyleID=-1,o}return function(t,n){function i(){this.constructor=t}Mb(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}(e,r),e.prototype.updateText=function(t){var n=this._style;if(this.localStyleID!==n.styleID&&(this.dirty=!0,this.localStyleID=n.styleID),this.dirty||!t){this._font=this._style.toFontString();var i,o,s=this.context,a=Hr.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),l=a.width,u=a.height,c=a.lines,d=a.lineHeight,f=a.lineWidths,m=a.maxLineWidth,g=a.fontProperties;this.canvas.width=Math.ceil((Math.max(1,l)+2*n.padding)*this._resolution),this.canvas.height=Math.ceil((Math.max(1,u)+2*n.padding)*this._resolution),s.scale(this._resolution,this._resolution),s.clearRect(0,0,this.canvas.width,this.canvas.height),s.font=this._font,s.lineWidth=n.strokeThickness,s.textBaseline=n.textBaseline,s.lineJoin=n.lineJoin,s.miterLimit=n.miterLimit;for(var _=n.dropShadow?2:1,y=0;y<_;++y){var w=n.dropShadow&&y===0,M=w?Math.ceil(Math.max(1,u)+2*n.padding):0,I=M*this._resolution;if(w){s.fillStyle="black",s.strokeStyle="black";var F=n.dropShadowColor,
|
|
5115
|
+
}`,{}),n.state=Ja.for2d(),n}return pb(e,r),e.prototype.render=function(t){var n=t.children,i=t._maxSize,o=t._batchSize,s=this.renderer,a=n.length;if(a!==0){a>i&&!t.autoResize&&(a=i);var l=t._buffers;l||(l=t._buffers=this.generateBuffers(t));var u=n[0]._texture.baseTexture;this.state.blendMode=r0(t.blendMode,u.alphaMode),s.state.set(this.state);var c=s.gl,d=t.worldTransform.copyTo(this.tempMatrix);d.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=d.toArray(!0),this.shader.uniforms.uColor=zx(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,u.alphaMode),this.shader.uniforms.uSampler=u,this.renderer.shader.bind(this.shader);for(var f=!1,m=0,g=0;m<a;m+=o,g+=1){var _=a-m;_>o&&(_=o),g>=l.length&&l.push(this._generateOneMoreBuffer(t));var y=l[g];y.uploadDynamic(n,m,_);var w=t._bufferUpdateIDs[g]||0;(f=f||y._updateID<w)&&(y._updateID=t._updateID,y.uploadStatic(n,m,_)),s.geometry.bind(y.geometry),c.drawElements(c.TRIANGLES,6*_,c.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var n=[],i=t._maxSize,o=t._batchSize,s=t._properties,a=0;a<i;a+=o)n.push(new fb(this.properties,s,o));return n},e.prototype._generateOneMoreBuffer=function(t){var n=t._batchSize,i=t._properties;return new fb(this.properties,i,n)},e.prototype.uploadVertices=function(t,n,i,o,s,a){for(var l=0,u=0,c=0,d=0,f=0;f<i;++f){var m=t[n+f],g=m._texture,_=m.scale.x,y=m.scale.y,w=g.trim,M=g.orig;w?(l=(u=w.x-m.anchor.x*M.width)+w.width,c=(d=w.y-m.anchor.y*M.height)+w.height):(l=M.width*(1-m.anchor.x),u=M.width*-m.anchor.x,c=M.height*(1-m.anchor.y),d=M.height*-m.anchor.y),o[a]=u*_,o[a+1]=d*y,o[a+s]=l*_,o[a+s+1]=d*y,o[a+2*s]=l*_,o[a+2*s+1]=c*y,o[a+3*s]=u*_,o[a+3*s+1]=c*y,a+=4*s}},e.prototype.uploadPosition=function(t,n,i,o,s,a){for(var l=0;l<i;l++){var u=t[n+l].position;o[a]=u.x,o[a+1]=u.y,o[a+s]=u.x,o[a+s+1]=u.y,o[a+2*s]=u.x,o[a+2*s+1]=u.y,o[a+3*s]=u.x,o[a+3*s+1]=u.y,a+=4*s}},e.prototype.uploadRotation=function(t,n,i,o,s,a){for(var l=0;l<i;l++){var u=t[n+l].rotation;o[a]=u,o[a+s]=u,o[a+2*s]=u,o[a+3*s]=u,a+=4*s}},e.prototype.uploadUvs=function(t,n,i,o,s,a){for(var l=0;l<i;++l){var u=t[n+l]._texture._uvs;u?(o[a]=u.x0,o[a+1]=u.y0,o[a+s]=u.x1,o[a+s+1]=u.y1,o[a+2*s]=u.x2,o[a+2*s+1]=u.y2,o[a+3*s]=u.x3,o[a+3*s+1]=u.y3,a+=4*s):(o[a]=0,o[a+1]=0,o[a+s]=0,o[a+s+1]=0,o[a+2*s]=0,o[a+2*s+1]=0,o[a+3*s]=0,o[a+3*s+1]=0,a+=4*s)}},e.prototype.uploadTint=function(t,n,i,o,s,a){for(var l=0;l<i;++l){var u=t[n+l],c=u._texture.baseTexture.alphaMode>0,d=u.alpha,f=d<1&&c?xm(u._tintRGB,d):u._tintRGB+(255*d<<24);o[a]=f,o[a+s]=f,o[a+2*s]=f,o[a+3*s]=f,a+=4*s}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(Hd);(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(ua||(ua={})),function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"}(ha||(ha={}));var Kh={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(r,e){if(e===void 0&&(e=20),!this.adaptive||!r||isNaN(r))return e;var t=Math.ceil(r/this.maxLength);return t<this.minSegments?t=this.minSegments:t>this.maxSegments&&(t=this.maxSegments),t}},J0=function(){function r(){this.color=16777215,this.alpha=1,this.texture=Nt.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=Nt.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}(),gb=function(r,e){return(gb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)};function $0(r,e){function t(){this.constructor=r}gb(r,e),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var K0={build:function(r){r.points=r.shape.points.slice()},triangulate:function(r,e){var t=r.points,n=r.holes,i=e.points,o=e.indices;if(t.length>=6){for(var s=[],a=0;a<n.length;a++){var l=n[a];s.push(t.length/2),t=t.concat(l.points)}var u=$v()(t,s,2);if(!u)return;var c=i.length/2;for(a=0;a<u.length;a+=3)o.push(u[a]+c),o.push(u[a+1]+c),o.push(u[a+2]+c);for(a=0;a<t.length;a++)i.push(t[a])}}},Q0={build:function(r){var e,t,n=r.shape,i=r.points,o=n.x,s=n.y;if(i.length=0,r.type===ri.CIRC)e=n.radius,t=n.radius;else{var a=r.shape;e=a.width,t=a.height}if(e!==0&&t!==0){var l=Math.floor(30*Math.sqrt(n.radius))||Math.floor(15*Math.sqrt(e+t));l/=2.3;for(var u=2*Math.PI/l,c=0;c<l-.5;c++)i.push(o+Math.sin(-u*c)*e,s+Math.cos(-u*c)*t);i.push(i[0],i[1])}},triangulate:function(r,e){var t=r.points,n=e.points,i=e.indices,o=n.length/2,s=o,a=r.shape,l=r.matrix,u=a.x,c=a.y;n.push(r.matrix?l.a*u+l.c*c+l.tx:u,r.matrix?l.b*u+l.d*c+l.ty:c);for(var d=0;d<t.length;d+=2)n.push(t[d],t[d+1]),i.push(o++,s,o)}},vb={build:function(r){var e=r.shape,t=e.x,n=e.y,i=e.width,o=e.height,s=r.points;s.length=0,s.push(t,n,t+i,n,t+i,n+o,t,n+o)},triangulate:function(r,e){var t=r.points,n=e.points,i=n.length/2;n.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(i,i+1,i+2,i+1,i+2,i+3)}};function Qh(r,e,t){return r+(e-r)*t}function Xm(r,e,t,n,i,o,s){s===void 0&&(s=[]);for(var a=s,l=0,u=0,c=0,d=0,f=0,m=0,g=0,_=0;g<=20;++g)l=Qh(r,t,_=g/20),u=Qh(e,n,_),c=Qh(t,i,_),d=Qh(n,o,_),f=Qh(l,c,_),m=Qh(u,d,_),a.push(f,m);return a}var _b={build:function(r){var e=r.shape,t=r.points,n=e.x,i=e.y,o=e.width,s=e.height,a=Math.max(0,Math.min(e.radius,Math.min(o,s)/2));t.length=0,a?(Xm(n,i+a,n,i,n+a,i,t),Xm(n+o-a,i,n+o,i,n+o,i+a,t),Xm(n+o,i+s-a,n+o,i+s,n+o-a,i+s,t),Xm(n+a,i+s,n,i+s,n,i+s-a,t)):t.push(n,i,n+o,i,n+o,i+s,n,i+s)},triangulate:function(r,e){for(var t=r.points,n=e.points,i=e.indices,o=n.length/2,s=$v()(t,null,2),a=0,l=s.length;a<l;a+=3)i.push(s[a]+o),i.push(s[a+1]+o),i.push(s[a+2]+o);for(a=0,l=t.length;a<l;a++)n.push(t[a],t[++a])}};function yb(r,e,t,n,i,o,s,a){var l,u;s?(l=n,u=-t):(l=-n,u=t);var c=r-t*i+l,d=e-n*i+u,f=r+t*o+l,m=e+n*o+u;return a.push(c,d),a.push(f,m),2}function ec(r,e,t,n,i,o,s,a){var l=t-r,u=n-e,c=Math.atan2(l,u),d=Math.atan2(i-r,o-e);a&&c<d?c+=2*Math.PI:!a&&c>d&&(d+=2*Math.PI);var f=c,m=d-c,g=Math.abs(m),_=Math.sqrt(l*l+u*u),y=1+(15*g*Math.sqrt(_)/Math.PI>>0),w=m/y;if(f+=w,a){s.push(r,e),s.push(t,n);for(var M=1,I=f;M<y;M++,I+=w)s.push(r,e),s.push(r+Math.sin(I)*_,e+Math.cos(I)*_);s.push(r,e),s.push(i,o)}else{for(s.push(t,n),s.push(r,e),M=1,I=f;M<y;M++,I+=w)s.push(r+Math.sin(I)*_,e+Math.cos(I)*_),s.push(r,e);s.push(i,o),s.push(r,e)}return 2*y}function e_(r,e){r.lineStyle.native?function(t,n){var i=0,o=t.shape,s=t.points||o.points,a=o.type!==ri.POLY||o.closeStroke;if(s.length!==0){var l=n.points,u=n.indices,c=s.length/2,d=l.length/2,f=d;for(l.push(s[0],s[1]),i=1;i<c;i++)l.push(s[2*i],s[2*i+1]),u.push(f,f+1),f++;a&&u.push(f,d)}}(r,e):function(t,n){var i=t.shape,o=t.points||i.points.slice(),s=n.closePointEps;if(o.length!==0){var a=t.lineStyle,l=new oi(o[0],o[1]),u=new oi(o[o.length-2],o[o.length-1]),c=i.type!==ri.POLY||i.closeStroke,d=Math.abs(l.x-u.x)<s&&Math.abs(l.y-u.y)<s;if(c){o=o.slice(),d&&(o.pop(),o.pop(),u.set(o[o.length-2],o[o.length-1]));var f=.5*(l.x+u.x),m=.5*(u.y+l.y);o.unshift(f,m),o.push(f,m)}var g=n.points,_=o.length/2,y=o.length,w=g.length/2,M=a.width/2,I=M*M,F=a.miterLimit*a.miterLimit,R=o[0],U=o[1],N=o[2],G=o[3],he=0,ne=0,Z=-(U-G),Q=R-N,$=0,se=0,me=Math.sqrt(Z*Z+Q*Q);Z/=me,Q/=me,Z*=M,Q*=M;var ge=a.alignment,de=2*(1-ge),fe=2*ge;c||(a.cap===ha.ROUND?y+=ec(R-Z*(de-fe)*.5,U-Q*(de-fe)*.5,R-Z*de,U-Q*de,R+Z*fe,U+Q*fe,g,!0)+2:a.cap===ha.SQUARE&&(y+=yb(R,U,Z,Q,de,fe,!0,g))),g.push(R-Z*de,U-Q*de),g.push(R+Z*fe,U+Q*fe);for(var Re=1;Re<_-1;++Re){R=o[2*(Re-1)],U=o[2*(Re-1)+1],N=o[2*Re],G=o[2*Re+1],he=o[2*(Re+1)],ne=o[2*(Re+1)+1],Z=-(U-G),Q=R-N,Z/=me=Math.sqrt(Z*Z+Q*Q),Q/=me,Z*=M,Q*=M,$=-(G-ne),se=N-he,$/=me=Math.sqrt($*$+se*se),se/=me,$*=M,se*=M;var ke=N-R,Be=U-G,J=N-he,te=ne-G,Ae=Be*J-te*ke,Ne=Ae<0;if(Math.abs(Ae)<.1)g.push(N-Z*de,G-Q*de),g.push(N+Z*fe,G+Q*fe);else{var Te=(-Z+R)*(-Q+G)-(-Z+N)*(-Q+U),Ge=(-$+he)*(-se+G)-(-$+N)*(-se+ne),Ye=(ke*Ge-J*Te)/Ae,ve=(te*Te-Be*Ge)/Ae,Y=(Ye-N)*(Ye-N)+(ve-G)*(ve-G),pe=N+(Ye-N)*de,ye=G+(ve-G)*de,xe=N-(Ye-N)*fe,De=G-(ve-G)*fe,ht=Ne?de:fe;Y<=Math.min(ke*ke+Be*Be,J*J+te*te)+ht*ht*I?a.join===ua.BEVEL||Y/I>F?(Ne?(g.push(pe,ye),g.push(N+Z*fe,G+Q*fe),g.push(pe,ye),g.push(N+$*fe,G+se*fe)):(g.push(N-Z*de,G-Q*de),g.push(xe,De),g.push(N-$*de,G-se*de),g.push(xe,De)),y+=2):a.join===ua.ROUND?Ne?(g.push(pe,ye),g.push(N+Z*fe,G+Q*fe),y+=ec(N,G,N+Z*fe,G+Q*fe,N+$*fe,G+se*fe,g,!0)+4,g.push(pe,ye),g.push(N+$*fe,G+se*fe)):(g.push(N-Z*de,G-Q*de),g.push(xe,De),y+=ec(N,G,N-Z*de,G-Q*de,N-$*de,G-se*de,g,!1)+4,g.push(N-$*de,G-se*de),g.push(xe,De)):(g.push(pe,ye),g.push(xe,De)):(g.push(N-Z*de,G-Q*de),g.push(N+Z*fe,G+Q*fe),a.join===ua.BEVEL||Y/I>F||(a.join===ua.ROUND?y+=Ne?ec(N,G,N+Z*fe,G+Q*fe,N+$*fe,G+se*fe,g,!0)+2:ec(N,G,N-Z*de,G-Q*de,N-$*de,G-se*de,g,!1)+2:(Ne?(g.push(xe,De),g.push(xe,De)):(g.push(pe,ye),g.push(pe,ye)),y+=2)),g.push(N-$*de,G-se*de),g.push(N+$*fe,G+se*fe),y+=2)}}R=o[2*(_-2)],U=o[2*(_-2)+1],N=o[2*(_-1)],Z=-(U-(G=o[2*(_-1)+1])),Q=R-N,Z/=me=Math.sqrt(Z*Z+Q*Q),Q/=me,Z*=M,Q*=M,g.push(N-Z*de,G-Q*de),g.push(N+Z*fe,G+Q*fe),c||(a.cap===ha.ROUND?y+=ec(N-Z*(de-fe)*.5,G-Q*(de-fe)*.5,N-Z*de,G-Q*de,N+Z*fe,G+Q*fe,g,!1)+2:a.cap===ha.SQUARE&&(y+=yb(N,G,Z,Q,de,fe,!1,g)));var xt=n.indices,_t=Kh.epsilon*Kh.epsilon;for(Re=w;Re<y+w-2;++Re)R=g[2*Re],U=g[2*Re+1],N=g[2*(Re+1)],G=g[2*(Re+1)+1],he=g[2*(Re+2)],ne=g[2*(Re+2)+1],Math.abs(R*(G-ne)+N*(ne-U)+he*(U-G))<_t||xt.push(Re,Re+1,Re+2)}}(r,e)}var tc,t_=function(){function r(){}return r.curveTo=function(e,t,n,i,o,s){var a=s[s.length-2],l=s[s.length-1]-t,u=a-e,c=i-t,d=n-e,f=Math.abs(l*d-u*c);if(f<1e-8||o===0)return s[s.length-2]===e&&s[s.length-1]===t||s.push(e,t),null;var m=l*l+u*u,g=c*c+d*d,_=l*c+u*d,y=o*Math.sqrt(m)/f,w=o*Math.sqrt(g)/f,M=y*_/m,I=w*_/g,F=y*d+w*u,R=y*c+w*l,U=u*(w+M),N=l*(w+M),G=d*(y+I),he=c*(y+I);return{cx:F+e,cy:R+t,radius:o,startAngle:Math.atan2(N-R,U-F),endAngle:Math.atan2(he-R,G-F),anticlockwise:u*c>d*l}},r.arc=function(e,t,n,i,o,s,a,l,u){for(var c=a-s,d=Kh._segmentsCount(Math.abs(c)*o,40*Math.ceil(Math.abs(c)/Bd)),f=c/(2*d),m=2*f,g=Math.cos(f),_=Math.sin(f),y=d-1,w=y%1/y,M=0;M<=y;++M){var I=f+s+m*(M+w*M),F=Math.cos(I),R=-Math.sin(I);u.push((g*F+_*R)*o+n,(g*-R+_*F)*o+i)}},r}(),xb=function(){function r(){}return r.curveLength=function(e,t,n,i,o,s,a,l){for(var u=0,c=0,d=0,f=0,m=0,g=0,_=0,y=0,w=0,M=0,I=0,F=e,R=t,U=1;U<=10;++U)M=F-(y=(_=(g=(m=1-(c=U/10))*m)*m)*e+3*g*c*n+3*m*(d=c*c)*o+(f=d*c)*a),I=R-(w=_*t+3*g*c*i+3*m*d*s+f*l),F=y,R=w,u+=Math.sqrt(M*M+I*I);return u},r.curveTo=function(e,t,n,i,o,s,a){var l=a[a.length-2],u=a[a.length-1];a.length-=2;var c=Kh._segmentsCount(r.curveLength(l,u,e,t,n,i,o,s)),d=0,f=0,m=0,g=0,_=0;a.push(l,u);for(var y=1,w=0;y<=c;++y)m=(f=(d=1-(w=y/c))*d)*d,_=(g=w*w)*w,a.push(m*l+3*f*w*e+3*d*g*n+_*o,m*u+3*f*w*t+3*d*g*i+_*s)},r}(),bb=function(){function r(){}return r.curveLength=function(e,t,n,i,o,s){var a=e-2*n+o,l=t-2*i+s,u=2*n-2*e,c=2*i-2*t,d=4*(a*a+l*l),f=4*(a*u+l*c),m=u*u+c*c,g=2*Math.sqrt(d+f+m),_=Math.sqrt(d),y=2*d*_,w=2*Math.sqrt(m),M=f/_;return(y*g+_*f*(g-w)+(4*m*d-f*f)*Math.log((2*_+M+g)/(M+w)))/(4*y)},r.curveTo=function(e,t,n,i,o){for(var s=o[o.length-2],a=o[o.length-1],l=Kh._segmentsCount(r.curveLength(s,a,e,t,n,i)),u=0,c=0,d=1;d<=l;++d){var f=d/l;u=s+(e-s)*f,c=a+(t-a)*f,o.push(u+(e+(n-e)*f-u)*f,c+(t+(i-t)*f-c)*f)}},r}(),wb=function(){function r(){this.reset()}return r.prototype.begin=function(e,t,n){this.reset(),this.style=e,this.start=t,this.attribStart=n},r.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},r.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},r}(),Ym=((tc={})[ri.POLY]=K0,tc[ri.CIRC]=Q0,tc[ri.ELIP]=Q0,tc[ri.RECT]=vb,tc[ri.RREC]=_b,tc),n_=[],Zd=[],i_=function(){function r(e,t,n,i){t===void 0&&(t=null),n===void 0&&(n=null),i===void 0&&(i=null),this.shape=e,this.lineStyle=n,this.fillStyle=t,this.matrix=i,this.type=e.type,this.points=[],this.holes=[]}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r}(),nc=new oi,lA=new kd,Tb=function(r){function e(){var t=r.call(this)||this;return t.uvsFloat32=null,t.indicesUint16=null,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.dirty=0,t.batchDirty=-1,t.cacheDirty=-1,t.clearDirty=0,t.drawCalls=[],t.batches=[],t.shapeIndex=0,t._bounds=new kd,t.boundsDirty=-1,t.boundsPadding=0,t.batchable=!1,t.indicesUint16=null,t.uvsFloat32=null,t.closePointEps=1e-4,t}return $0(e,r),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Zd.push(this.drawCalls[t]);for(this.drawCalls.length=0,t=0;t<this.batches.length;t++){var n=this.batches[t];n.reset(),n_.push(n)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,n,i,o){n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=null);var s=new i_(t,n,i,o);return this.graphicsData.push(s),this.dirty++,this},e.prototype.drawHole=function(t,n){if(n===void 0&&(n=null),!this.graphicsData.length)return null;var i=new i_(t,null,null,n),o=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=o.lineStyle,o.holes.push(i),this.dirty++,this},e.prototype.destroy=function(){r.prototype.destroy.call(this);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var n=this.graphicsData,i=0;i<n.length;++i){var o=n[i];if(o.fillStyle.visible&&o.shape&&(o.matrix?o.matrix.applyInverse(t,nc):nc.copyFrom(t),o.shape.contains(nc.x,nc.y))){var s=!1;if(o.holes){for(var a=0;a<o.holes.length;a++)if(o.holes[a].shape.contains(nc.x,nc.y)){s=!0;break}}if(!s)return!0}}return!1},e.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var n=this.uvs,i=this.graphicsData,o=null,s=null;this.batches.length>0&&(s=(o=this.batches[this.batches.length-1]).style);for(var a=this.shapeIndex;a<i.length;a++){this.shapeIndex++;var l=i[a],u=l.fillStyle,c=l.lineStyle;Ym[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix);for(var d=0;d<2;d++){var f=d===0?u:c;if(f.visible){var m=f.texture.baseTexture,g=this.indices.length,_=this.points.length/2;m.wrapMode=cs.REPEAT,d===0?this.processFill(l):this.processLine(l);var y=this.points.length/2-_;y!==0&&(o&&!this._compareStyles(s,f)&&(o.end(g,_),o=null),o||((o=n_.pop()||new wb).begin(f,g,_),this.batches.push(o),s=f),this.addUvs(this.points,n,f.texture,_,y,f.matrix))}}}var w=this.indices.length,M=this.points.length/2;if(o&&o.end(w,M),this.batches.length!==0){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var I=M>65535&&t;this.indicesUint16=I?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,n){return!(!t||!n)&&t.texture.baseTexture===n.texture.baseTexture&&t.color+t.alpha===n.color+n.alpha&&!!t.native==!!n.native},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,n=this.graphicsData.length;t<n;t++){var i=this.graphicsData[t],o=i.fillStyle,s=i.lineStyle;if(o&&!o.texture.baseTexture.valid||s&&!s.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,n=0,i=t.length;n<i;n++)for(var o=t[n],s=0;s<o.size;s++){var a=o.start+s;this.indicesUint16[a]=this.indicesUint16[a]-o.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,n=0;n<t.length;n++)if(t[n].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++vn._globalBatch,n=0;n<this.drawCalls.length;n++)this.drawCalls[n].texArray.clear(),Zd.push(this.drawCalls[n]);this.drawCalls.length=0;var i=this.colors,o=this.textureIds,s=Zd.pop();s||((s=new km).texArray=new Gm),s.texArray.count=0,s.start=0,s.size=0,s.type=oo.TRIANGLES;var a=0,l=null,u=0,c=!1,d=oo.TRIANGLES,f=0;for(this.drawCalls.push(s),n=0;n<this.batches.length;n++){var m=this.batches[n],g=m.style,_=g.texture.baseTexture;c!==!!g.native&&(d=(c=!!g.native)?oo.LINES:oo.TRIANGLES,l=null,a=8,t++),l!==_&&(l=_,_._batchEnabled!==t&&(a===8&&(t++,a=0,s.size>0&&((s=Zd.pop())||((s=new km).texArray=new Gm),this.drawCalls.push(s)),s.start=f,s.size=0,s.texArray.count=0,s.type=d),_.touched=1,_._batchEnabled=t,_._batchLocation=a,_.wrapMode=cs.REPEAT,s.texArray.elements[s.texArray.count++]=_,a++)),s.size+=m.size,f+=m.size,u=_._batchLocation,this.addColors(i,g.color,g.alpha,m.attribSize),this.addTextureIds(o,u,m.attribSize)}vn._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,n=this.uvs,i=this.colors,o=this.textureIds,s=new ArrayBuffer(3*t.length*4),a=new Float32Array(s),l=new Uint32Array(s),u=0,c=0;c<t.length/2;c++)a[u++]=t[2*c],a[u++]=t[2*c+1],a[u++]=n[2*c],a[u++]=n[2*c+1],l[u++]=i[c],a[u++]=o[c];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?(this.processHoles(t.holes),K0.triangulate(t,this)):Ym[t.type].triangulate(t,this)},e.prototype.processLine=function(t){e_(t,this);for(var n=0;n<t.holes.length;n++)e_(t.holes[n],this)},e.prototype.processHoles=function(t){for(var n=0;n<t.length;n++){var i=t[n];Ym[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds,n=lA,i=pi.IDENTITY;this._bounds.clear(),n.clear();for(var o=0;o<this.graphicsData.length;o++){var s=this.graphicsData[o],a=s.shape,l=s.type,u=s.lineStyle,c=s.matrix||pi.IDENTITY,d=0;if(u&&u.visible){var f=u.alignment;d=u.width,l===ri.POLY?d*=.5+Math.abs(.5-f):d*=Math.max(0,f)}if(i!==c&&(n.isEmpty()||(t.addBoundsMatrix(n,i),n.clear()),i=c),l===ri.RECT||l===ri.RREC){var m=a;n.addFramePad(m.x,m.y,m.x+m.width,m.y+m.height,d,d)}else if(l===ri.CIRC){var g=a;n.addFramePad(g.x,g.y,g.x,g.y,g.radius+d,g.radius+d)}else if(l===ri.ELIP){var _=a;n.addFramePad(_.x,_.y,_.x,_.y,_.width+d,_.height+d)}else{var y=a;t.addVerticesMatrix(i,y.points,0,y.points.length,d,d)}}n.isEmpty()||t.addBoundsMatrix(n,i),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,n){for(var i=0;i<t.length/2;i++){var o=t[2*i],s=t[2*i+1];t[2*i]=n.a*o+n.c*s+n.tx,t[2*i+1]=n.b*o+n.d*s+n.ty}},e.prototype.addColors=function(t,n,i,o){for(var s=xm((n>>16)+(65280&n)+((255&n)<<16),i);o-- >0;)t.push(s)},e.prototype.addTextureIds=function(t,n,i){for(;i-- >0;)t.push(n)},e.prototype.addUvs=function(t,n,i,o,s,a){a===void 0&&(a=null);for(var l=0,u=n.length,c=i.frame;l<s;){var d=t[2*(o+l)],f=t[2*(o+l)+1];if(a){var m=a.a*d+a.c*f+a.tx;f=a.b*d+a.d*f+a.ty,d=m}l++,n.push(d/c.width,f/c.height)}var g=i.baseTexture;(c.width<g.width||c.height<g.height)&&this.adjustUvs(n,i,u,s)},e.prototype.adjustUvs=function(t,n,i,o){for(var s=n.baseTexture,a=1e-6,l=i+2*o,u=n.frame,c=u.width/s.width,d=u.height/s.height,f=u.x/u.width,m=u.y/u.height,g=Math.floor(t[i]+a),_=Math.floor(t[i+1]+a),y=i+2;y<l;y+=2)g=Math.min(g,Math.floor(t[y]+a)),_=Math.min(_,Math.floor(t[y+1]+a));for(f-=g,m-=_,y=i;y<l;y+=2)t[y]=(t[y]+f)*c,t[y+1]=(t[y+1]+m)*d},e.BATCHABLE_SIZE=100,e}(j0),Sb=function(r){function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.width=0,t.alignment=.5,t.native=!1,t.cap=ha.BUTT,t.join=ua.MITER,t.miterLimit=10,t}return $0(e,r),e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){r.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(J0),uA=new Float32Array(3),r_={},ca=function(r){function e(t){t===void 0&&(t=null);var n=r.call(this)||this;return n._geometry=t||new Tb,n._geometry.refCount++,n.shader=null,n.state=Ja.for2d(),n._fillStyle=new J0,n._lineStyle=new Sb,n._matrix=null,n._holeMode=!1,n.currentPath=null,n.batches=[],n.batchTint=-1,n.batchDirty=-1,n.vertexData=null,n.pluginName="batch",n._transformID=-1,n.tint=16777215,n.blendMode=Ft.NORMAL,n}return $0(e,r),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,n,i,o,s){return t===void 0&&(t=null),n===void 0&&(n=0),i===void 0&&(i=1),o===void 0&&(o=.5),s===void 0&&(s=!1),typeof t=="number"&&(t={width:t,color:n,alpha:i,alignment:o,native:s}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:Nt.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:ha.BUTT,join:ua.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var n=t.width>0&&t.alpha>0;return n?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:n},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,n=this.currentPath.points.length;n>2&&(this.drawShape(this.currentPath),this.currentPath=new Ud,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[n-2],t[n-1]))}else this.currentPath=new Ud,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,n){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=n,this},e.prototype.lineTo=function(t,n){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,o=i[i.length-2],s=i[i.length-1];return o===t&&s===n||i.push(t,n),this},e.prototype._initCurve=function(t,n){t===void 0&&(t=0),n===void 0&&(n=0),this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,n]):this.moveTo(t,n)},e.prototype.quadraticCurveTo=function(t,n,i,o){this._initCurve();var s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),bb.curveTo(t,n,i,o,s),this},e.prototype.bezierCurveTo=function(t,n,i,o,s,a){return this._initCurve(),xb.curveTo(t,n,i,o,s,a,this.currentPath.points),this},e.prototype.arcTo=function(t,n,i,o,s){this._initCurve(t,n);var a=this.currentPath.points,l=t_.curveTo(t,n,i,o,s,a);if(l){var u=l.cx,c=l.cy,d=l.radius,f=l.startAngle,m=l.endAngle,g=l.anticlockwise;this.arc(u,c,d,f,m,g)}return this},e.prototype.arc=function(t,n,i,o,s,a){if(a===void 0&&(a=!1),o===s)return this;if(!a&&s<=o?s+=Bd:a&&o<=s&&(o+=Bd),s-o==0)return this;var l=t+Math.cos(o)*i,u=n+Math.sin(o)*i,c=this._geometry.closePointEps,d=this.currentPath?this.currentPath.points:null;if(d){var f=Math.abs(d[d.length-2]-l),m=Math.abs(d[d.length-1]-u);f<c&&m<c||d.push(l,u)}else this.moveTo(l,u),d=this.currentPath.points;return t_.arc(l,u,t,n,i,o,s,a,d),this},e.prototype.beginFill=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=1),this.beginTextureFill({texture:Nt.WHITE,color:t,alpha:n})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:Nt.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var n=t.alpha>0;return n?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:n},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,n,i,o){return this.drawShape(new nn(t,n,i,o))},e.prototype.drawRoundedRect=function(t,n,i,o,s){return this.drawShape(new h0(t,n,i,o,s))},e.prototype.drawCircle=function(t,n,i){return this.drawShape(new $x(t,n,i))},e.prototype.drawEllipse=function(t,n,i,o){return this.drawShape(new Kx(t,n,i,o))},e.prototype.drawPolygon=function(){for(var t,n=arguments,i=[],o=0;o<arguments.length;o++)i[o]=n[o];var s=!0,a=i[0];a.points?(s=a.closeStroke,t=a.points):t=Array.isArray(i[0])?i[0]:i;var l=new Ud(t);return l.closeStroke=s,this.drawShape(l),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return!(t.length!==1||t[0].shape.type!==ri.RECT||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var n=this._geometry,i=t.context.supports.uint32Indices;n.updateBatches(i),n.batchable?(this.batchDirty!==n.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,n=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(var o=0;o<i;o++){var s=t.batches[o],a=s.style.color,l=new Float32Array(this.vertexData.buffer,4*s.attribStart*2,2*s.attribSize),u=new Float32Array(t.uvsFloat32.buffer,4*s.attribStart*2,2*s.attribSize),c={vertexData:l,blendMode:n,indices:new Uint16Array(t.indicesUint16.buffer,2*s.start,s.size),uvs:u,_batchRGB:ou(a),_tintRGB:a,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[o]=c}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var n=0,i=this.batches.length;n<i;n++){var o=this.batches[n];o.worldAlpha=this.worldAlpha*o.alpha,t.plugins[this.pluginName].render(o)}}},e.prototype._renderDirect=function(t){var n=this._resolveDirectShader(t),i=this._geometry,o=this.tint,s=this.worldAlpha,a=n.uniforms,l=i.drawCalls;a.translationMatrix=this.transform.worldTransform,a.tint[0]=(o>>16&255)/255*s,a.tint[1]=(o>>8&255)/255*s,a.tint[2]=(255&o)/255*s,a.tint[3]=s,t.shader.bind(n),t.geometry.bind(i,n),t.state.set(this.state);for(var u=0,c=l.length;u<c;u++)this._renderDrawCallDirect(t,i.drawCalls[u])},e.prototype._renderDrawCallDirect=function(t,n){for(var i=n.texArray,o=n.type,s=n.size,a=n.start,l=i.count,u=0;u<l;u++)t.texture.bind(i.elements[u],u);t.geometry.draw(o,s,a)},e.prototype._resolveDirectShader=function(t){var n=this.shader,i=this.pluginName;if(!n){if(!r_[i]){for(var o=t.plugins.batch.MAX_TEXTURES,s=new Int32Array(o),a=0;a<o;a++)s[a]=a;var l={tint:new Float32Array([1,1,1,1]),translationMatrix:new pi,default:Za.from({uSamplers:s},!0)},u=t.plugins[i]._shader.program;r_[i]=new oa(u,l)}n=r_[i]}return n},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var n=t.bounds,i=n.minX,o=n.minY,s=n.maxX,a=n.maxY;this._bounds.addFrame(this.transform,i,o,s,a)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=ou(this.tint,uA),n=0;n<this.batches.length;n++){var i=this.batches[n],o=i._batchRGB,s=(t[0]*o[0]*255<<16)+(t[1]*o[1]*255<<8)+(0|t[2]*o[2]*255);i._tintRGB=(s>>16)+(65280&s)+((255&s)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var n=this.transform.worldTransform,i=n.a,o=n.b,s=n.c,a=n.d,l=n.tx,u=n.ty,c=this._geometry.points,d=this.vertexData,f=0,m=0;m<c.length;m+=2){var g=c[m],_=c[m+1];d[f++]=i*g+s*_+l,d[f++]=a*_+o*g+u}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,r.prototype.destroy.call(this,t)},e._TEMP_POINT=new oi,e}(Mi),hA={buildPoly:K0,buildCircle:Q0,buildRectangle:vb,buildRoundedRectangle:_b,buildLine:e_,ArcUtils:t_,BezierUtils:xb,QuadraticUtils:bb,BatchPart:wb,FILL_COMMANDS:Ym,BATCH_POOL:n_,DRAW_CALL_POOL:Zd},Eb=function(r,e){return(Eb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)},ic,Jd=new oi,cA=new Uint16Array([0,1,2,0,2,3]),Hn=function(r){function e(t){var n=r.call(this)||this;return n._anchor=new hu(n._onAnchorUpdate,n,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),n._texture=null,n._width=0,n._height=0,n._tint=null,n._tintRGB=null,n.tint=16777215,n.blendMode=Ft.NORMAL,n._cachedTint=16777215,n.uvs=null,n.texture=t||Nt.EMPTY,n.vertexData=new Float32Array(8),n.vertexTrimmedData=null,n._transformID=-1,n._textureID=-1,n._transformTrimmedID=-1,n._textureTrimmedID=-1,n.indices=cA,n.pluginName="batch",n.isSprite=!0,n._roundPixels=At.ROUND_PIXELS,n}return function(t,n){function i(){this.constructor=t}Eb(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}(e,r),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=au(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=au(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var n=this.transform.worldTransform,i=n.a,o=n.b,s=n.c,a=n.d,l=n.tx,u=n.ty,c=this.vertexData,d=t.trim,f=t.orig,m=this._anchor,g=0,_=0,y=0,w=0;if(d?(g=(_=d.x-m._x*f.width)+d.width,y=(w=d.y-m._y*f.height)+d.height):(g=(_=-m._x*f.width)+f.width,y=(w=-m._y*f.height)+f.height),c[0]=i*_+s*w+l,c[1]=a*w+o*_+u,c[2]=i*g+s*w+l,c[3]=a*w+o*g+u,c[4]=i*g+s*y+l,c[5]=a*y+o*g+u,c[6]=i*_+s*y+l,c[7]=a*y+o*_+u,this._roundPixels)for(var M=At.RESOLUTION,I=0;I<c.length;++I)c[I]=Math.round((c[I]*M|0)/M)}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,n=this.vertexTrimmedData,i=t.orig,o=this._anchor,s=this.transform.worldTransform,a=s.a,l=s.b,u=s.c,c=s.d,d=s.tx,f=s.ty,m=-o._x*i.width,g=m+i.width,_=-o._y*i.height,y=_+i.height;n[0]=a*m+u*_+d,n[1]=c*_+l*m+f,n[2]=a*g+u*_+d,n[3]=c*_+l*g+f,n[4]=a*g+u*y+d,n[5]=c*y+l*g+f,n[6]=a*m+u*y+d,n[7]=c*y+l*m+f},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,n=this._texture.orig;!t||t.width===n.width&&t.height===n.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(t){return this.children.length===0?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new nn),t=this._localBoundsRect),this._bounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Jd);var n=this._texture.orig.width,i=this._texture.orig.height,o=-n*this.anchor.x,s=0;return Jd.x>=o&&Jd.x<o+n&&(s=-i*this.anchor.y,Jd.y>=s&&Jd.y<s+i)},e.prototype.destroy=function(t){if(r.prototype.destroy.call(this,t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof t=="boolean"?t:t&&t.texture){var n=typeof t=="boolean"?t:t&&t.baseTexture;this._texture.destroy(!!n)}this._texture=null},e.from=function(t,n){return new e(t instanceof Nt?t:Nt.from(t,n))},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var n=au(this.scale.x)||1;this.scale.x=n*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var n=au(this.scale.y)||1;this.scale.y=n*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||Nt.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(Mi),Mb=function(r,e){return(Mb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)};(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(ic||(ic={}));var o_={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:ic.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},dA=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],yu=function(){function r(e){this.styleID=0,this.reset(),a_(this,e,e)}return r.prototype.clone=function(){var e={};return a_(e,this,o_),new r(e)},r.prototype.reset=function(){a_(this,o_,o_)},Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=s_(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=s_(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){(function(t,n){if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!==n[i])return!1;return!0})(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leading",{get:function(){return this._leading},set:function(e){this._leading!==e&&(this._leading=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this._padding},set:function(e){this._padding!==e&&(this._padding=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stroke",{get:function(){return this._stroke},set:function(e){var t=s_(e);this._stroke!==t&&(this._stroke=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"trim",{get:function(){return this._trim},set:function(e){this._trim!==e&&(this._trim=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)},enumerable:!1,configurable:!0}),r.prototype.toFontString=function(){var e=typeof this.fontSize=="number"?this.fontSize+"px":this.fontSize,t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(var n=t.length-1;n>=0;n--){var i=t[n].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&dA.indexOf(i)<0&&(i='"'+i+'"'),t[n]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r}();function Ab(r){return typeof r=="number"?t0(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function s_(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=Ab(r[e]);return r}return Ab(r)}function a_(r,e,t){for(var n in t)Array.isArray(e[n])?r[n]=e[n].slice():r[n]=e[n]}var Hr=function(){function r(e,t,n,i,o,s,a,l,u){this.text=e,this.style=t,this.width=n,this.height=i,this.lines=o,this.lineWidths=s,this.lineHeight=a,this.maxLineWidth=l,this.fontProperties=u}return r.measureText=function(e,t,n,i){i===void 0&&(i=r._canvas),n=n==null?t.wordWrap:n;var o=t.toFontString(),s=r.measureFont(o);s.fontSize===0&&(s.fontSize=t.fontSize,s.ascent=t.fontSize);var a=i.getContext("2d");a.font=o;for(var l=(n?r.wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),u=new Array(l.length),c=0,d=0;d<l.length;d++){var f=a.measureText(l[d]).width+(l[d].length-1)*t.letterSpacing;u[d]=f,c=Math.max(c,f)}var m=c+t.strokeThickness;t.dropShadow&&(m+=t.dropShadowDistance);var g=t.lineHeight||s.fontSize+t.strokeThickness,_=Math.max(g,s.fontSize+t.strokeThickness)+(l.length-1)*(g+t.leading);return t.dropShadow&&(_+=t.dropShadowDistance),new r(e,t,m,_,l,u,g+t.leading,c,s)},r.wordWrap=function(e,t,n){n===void 0&&(n=r._canvas);for(var i=n.getContext("2d"),o=0,s="",a="",l=Object.create(null),u=t.letterSpacing,c=t.whiteSpace,d=r.collapseSpaces(c),f=r.collapseNewlines(c),m=!d,g=t.wordWrapWidth+u,_=r.tokenize(e),y=0;y<_.length;y++){var w=_[y];if(r.isNewline(w)){if(!f){a+=r.addLine(s),m=!d,s="",o=0;continue}w=" "}if(d){var M=r.isBreakingSpace(w),I=r.isBreakingSpace(s[s.length-1]);if(M&&I)continue}var F=r.getFromCache(w,u,l,i);if(F>g)if(s!==""&&(a+=r.addLine(s),s="",o=0),r.canBreakWords(w,t.breakWords))for(var R=r.wordWrapSplit(w),U=0;U<R.length;U++){for(var N=R[U],G=1;R[U+G];){var he=R[U+G],ne=N[N.length-1];if(r.canBreakChars(ne,he,w,U,t.breakWords))break;N+=he,G++}U+=N.length-1;var Z=r.getFromCache(N,u,l,i);Z+o>g&&(a+=r.addLine(s),m=!1,s="",o=0),s+=N,o+=Z}else{s.length>0&&(a+=r.addLine(s),s="",o=0);var Q=y===_.length-1;a+=r.addLine(w,!Q),m=!1,s="",o=0}else F+o>g&&(m=!1,a+=r.addLine(s),s="",o=0),(s.length>0||!r.isBreakingSpace(w)||m)&&(s+=w,o+=F)}return a+=r.addLine(s,!1)},r.addLine=function(e,t){return t===void 0&&(t=!0),e=r.trimRight(e),e=t?e+`
|
|
5116
|
+
`:e},r.getFromCache=function(e,t,n,i){var o=n[e];if(typeof o!="number"){var s=e.length*t;o=i.measureText(e).width+s,n[e]=o}return o},r.collapseSpaces=function(e){return e==="normal"||e==="pre-line"},r.collapseNewlines=function(e){return e==="normal"},r.trimRight=function(e){if(typeof e!="string")return"";for(var t=e.length-1;t>=0;t--){var n=e[t];if(!r.isBreakingSpace(n))break;e=e.slice(0,-1)}return e},r.isNewline=function(e){return typeof e=="string"&&r._newlines.indexOf(e.charCodeAt(0))>=0},r.isBreakingSpace=function(e,t){return typeof e=="string"&&r._breakingSpaces.indexOf(e.charCodeAt(0))>=0},r.tokenize=function(e){var t=[],n="";if(typeof e!="string")return t;for(var i=0;i<e.length;i++){var o=e[i],s=e[i+1];r.isBreakingSpace(o,s)||r.isNewline(o)?(n!==""&&(t.push(n),n=""),t.push(o)):n+=o}return n!==""&&t.push(n),t},r.canBreakWords=function(e,t){return t},r.canBreakChars=function(e,t,n,i,o){return!0},r.wordWrapSplit=function(e){return e.split("")},r.measureFont=function(e){if(r._fonts[e])return r._fonts[e];var t={ascent:0,descent:0,fontSize:0},n=r._canvas,i=r._context;i.font=e;var o=r.METRICS_STRING+r.BASELINE_SYMBOL,s=Math.ceil(i.measureText(o).width),a=Math.ceil(i.measureText(r.BASELINE_SYMBOL).width),l=Math.ceil(r.HEIGHT_MULTIPLIER*a);a=a*r.BASELINE_MULTIPLIER|0,n.width=s,n.height=l,i.fillStyle="#f00",i.fillRect(0,0,s,l),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,a);var u=i.getImageData(0,0,s,l).data,c=u.length,d=4*s,f=0,m=0,g=!1;for(f=0;f<a;++f){for(var _=0;_<d;_+=4)if(u[m+_]!==255){g=!0;break}if(g)break;m+=d}for(t.ascent=a-f,m=c-d,g=!1,f=l;f>a;--f){for(_=0;_<d;_+=4)if(u[m+_]!==255){g=!0;break}if(g)break;m-=d}return t.descent=f-a,t.fontSize=t.ascent+t.descent,r._fonts[e]=t,t},r.clearMetrics=function(e){e===void 0&&(e=""),e?delete r._fonts[e]:r._fonts={}},r}(),qm=function(){try{var r=new OffscreenCanvas(0,0),e=r.getContext("2d");return e&&e.measureText?r:document.createElement("canvas")}catch{return document.createElement("canvas")}}();qm.width=qm.height=10,Hr._canvas=qm,Hr._context=qm.getContext("2d"),Hr._fonts={},Hr.METRICS_STRING="|\xC9q\xC5",Hr.BASELINE_SYMBOL="M",Hr.BASELINE_MULTIPLIER=1.4,Hr.HEIGHT_MULTIPLIER=2,Hr._newlines=[10,13],Hr._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var pA={texture:!0,children:!1,baseTexture:!0},Zm=function(r){function e(t,n,i){var o=this,s=!1;i||(i=document.createElement("canvas"),s=!0),i.width=3,i.height=3;var a=Nt.from(i);return a.orig=new nn,a.trim=new nn,(o=r.call(this,a)||this)._ownCanvas=s,o.canvas=i,o.context=o.canvas.getContext("2d"),o._resolution=At.RESOLUTION,o._autoResolution=!0,o._text=null,o._style=null,o._styleListener=null,o._font="",o.text=t,o.style=n,o.localStyleID=-1,o}return function(t,n){function i(){this.constructor=t}Mb(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}(e,r),e.prototype.updateText=function(t){var n=this._style;if(this.localStyleID!==n.styleID&&(this.dirty=!0,this.localStyleID=n.styleID),this.dirty||!t){this._font=this._style.toFontString();var i,o,s=this.context,a=Hr.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),l=a.width,u=a.height,c=a.lines,d=a.lineHeight,f=a.lineWidths,m=a.maxLineWidth,g=a.fontProperties;this.canvas.width=Math.ceil((Math.max(1,l)+2*n.padding)*this._resolution),this.canvas.height=Math.ceil((Math.max(1,u)+2*n.padding)*this._resolution),s.scale(this._resolution,this._resolution),s.clearRect(0,0,this.canvas.width,this.canvas.height),s.font=this._font,s.lineWidth=n.strokeThickness,s.textBaseline=n.textBaseline,s.lineJoin=n.lineJoin,s.miterLimit=n.miterLimit;for(var _=n.dropShadow?2:1,y=0;y<_;++y){var w=n.dropShadow&&y===0,M=w?Math.ceil(Math.max(1,u)+2*n.padding):0,I=M*this._resolution;if(w){s.fillStyle="black",s.strokeStyle="black";var F=n.dropShadowColor,R=ou(typeof F=="number"?F:n0(F));s.shadowColor="rgba("+255*R[0]+","+255*R[1]+","+255*R[2]+","+n.dropShadowAlpha+")",s.shadowBlur=n.dropShadowBlur,s.shadowOffsetX=Math.cos(n.dropShadowAngle)*n.dropShadowDistance,s.shadowOffsetY=Math.sin(n.dropShadowAngle)*n.dropShadowDistance+I}else s.fillStyle=this._generateFillStyle(n,c,a),s.strokeStyle=n.stroke,s.shadowColor="black",s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0;var U=(d-g.fontSize)/2;(!e.nextLineHeightBehavior||d-g.fontSize<0)&&(U=0);for(var N=0;N<c.length;N++)i=n.strokeThickness/2,o=n.strokeThickness/2+N*d+g.ascent+U,n.align==="right"?i+=m-f[N]:n.align==="center"&&(i+=(m-f[N])/2),n.stroke&&n.strokeThickness&&this.drawLetterSpacing(c[N],i+n.padding,o+n.padding-M,!0),n.fill&&this.drawLetterSpacing(c[N],i+n.padding,o+n.padding-M)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,n,i,o){o===void 0&&(o=!1);var s=this._style.letterSpacing;if(s!==0)for(var a=n,l=Array.from?Array.from(t):t.split(""),u=this.context.measureText(t).width,c=0,d=0;d<l.length;++d){var f=l[d];o?this.context.strokeText(f,a,i):this.context.fillText(f,a,i),a+=u-(c=this.context.measureText(t.substring(d+1)).width)+s,u=c}else o?this.context.strokeText(t,n,i):this.context.fillText(t,n,i)},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var n=Xx(t);n.data&&(t.width=n.width,t.height=n.height,this.context.putImageData(n.data,0,0))}var i=this._texture,o=this._style,s=o.trim?0:o.padding,a=i.baseTexture;i.trim.width=i._frame.width=Math.ceil(t.width/this._resolution),i.trim.height=i._frame.height=Math.ceil(t.height/this._resolution),i.trim.x=-s,i.trim.y=-s,i.orig.width=i._frame.width-2*s,i.orig.height=i._frame.height-2*s,this._onTextureUpdate(),a.setRealSize(t.width,t.height,this._resolution),this._recursivePostUpdateTransform(),this.dirty=!1},e.prototype._render=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),r.prototype._render.call(this,t)},e.prototype.getLocalBounds=function(t){return this.updateText(!0),r.prototype.getLocalBounds.call(this,t)},e.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,n,i){var o,s=t.fill;if(!Array.isArray(s))return s;if(s.length===1)return s[0];var a=t.dropShadow?t.dropShadowDistance:0,l=t.padding||0,u=Math.ceil(this.canvas.width/this._resolution)-a-2*l,c=Math.ceil(this.canvas.height/this._resolution)-a-2*l,d=s.slice(),f=t.fillGradientStops.slice();if(!f.length)for(var m=d.length+1,g=1;g<m;++g)f.push(g/m);if(d.unshift(s[0]),f.unshift(0),d.push(s[s.length-1]),f.push(1),t.fillGradientType===ic.LINEAR_VERTICAL){o=this.context.createLinearGradient(u/2,l,u/2,c+l);var _=(i.fontProperties.fontSize+t.strokeThickness)/c;for(g=0;g<n.length;g++)for(var y=i.lineHeight*g,w=0;w<d.length;w++){var M=0;M=typeof f[w]=="number"?f[w]:w/d.length;var I=Math.min(1,Math.max(0,y/c+M*_));I=Number(I.toFixed(5)),o.addColorStop(I,d[w])}}else{o=this.context.createLinearGradient(l,c/2,u+l,c/2);var F=d.length+1,R=1;for(g=0;g<d.length;g++){var U=void 0;U=typeof f[g]=="number"?f[g]:R/F,o.addColorStop(U,d[g]),R++}}return o},e.prototype.destroy=function(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},pA,t),r.prototype.destroy.call(this,t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var n=au(this.scale.x)||1;this.scale.x=n*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var n=au(this.scale.y)||1;this.scale.y=n*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},this._style=t instanceof yu?t:new yu(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(t==null?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.nextLineHeightBehavior=!1,e}(Hn);/*!
|
|
5117
5117
|
* @pixi/prepare - v6.0.4
|
|
5118
5118
|
* Compiled Tue, 11 May 2021 18:00:23 UTC
|
|
5119
5119
|
*
|
|
@@ -5198,10 +5198,10 @@ void main(void)
|
|
|
5198
5198
|
{
|
|
5199
5199
|
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
|
|
5200
5200
|
}
|
|
5201
|
-
`),o)||this)._colorDirty=!1,i.uvMatrix=new Bm(t),i.batchable=n.program===void 0,i.pluginName=n.pluginName,i.tint=n.tint,i.alpha=n.alpha,i}return l_(e,r),Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;o0(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(oa),Qd=function(r){function e(t,n,i){var o=r.call(this)||this,s=new Di(t),a=new Di(n,!0),l=new Di(i,!0,!0);return o.addAttribute("aVertexPosition",s,2,!1,bn.FLOAT).addAttribute("aTextureCoord",a,2,!1,bn.FLOAT).addIndex(l),o._updateId=-1,o}return l_(e,r),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(gu),zb=function(r,e){return(zb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)},ep=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]},EA=function(){function r(){}return r.test=function(e){return typeof e=="string"&&e.indexOf("info face=")===0},r.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in t){var o=t[i].match(/^[a-z]+/gm)[0],s=t[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var l in s){var u=s[l].split("="),c=u[0],d=u[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f;a[c]=m}n[o].push(a)}var g=new ep;return n.info.forEach(function(_){return g.info.push({face:_.face,size:parseInt(_.size,10)})}),n.common.forEach(function(_){return g.common.push({lineHeight:parseInt(_.lineHeight,10)})}),n.page.forEach(function(_){return g.page.push({id:parseInt(_.id,10),file:_.file})}),n.char.forEach(function(_){return g.char.push({id:parseInt(_.id,10),page:parseInt(_.page,10),x:parseInt(_.x,10),y:parseInt(_.y,10),width:parseInt(_.width,10),height:parseInt(_.height,10),xoffset:parseInt(_.xoffset,10),yoffset:parseInt(_.yoffset,10),xadvance:parseInt(_.xadvance,10)})}),n.kerning.forEach(function(_){return g.kerning.push({first:parseInt(_.first,10),second:parseInt(_.second,10),amount:parseInt(_.amount,10)})}),g},r}(),h_=function(){function r(){}return r.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},r.parse=function(e){for(var t=new ep,n=e.getElementsByTagName("info"),i=e.getElementsByTagName("common"),o=e.getElementsByTagName("page"),s=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),l=0;l<n.length;l++)t.info.push({face:n[l].getAttribute("face"),size:parseInt(n[l].getAttribute("size"),10)});for(l=0;l<i.length;l++)t.common.push({lineHeight:parseInt(i[l].getAttribute("lineHeight"),10)});for(l=0;l<o.length;l++)t.page.push({id:parseInt(o[l].getAttribute("id"),10)||0,file:o[l].getAttribute("file")});for(l=0;l<s.length;l++){var u=s[l];t.char.push({id:parseInt(u.getAttribute("id"),10),page:parseInt(u.getAttribute("page"),10)||0,x:parseInt(u.getAttribute("x"),10),y:parseInt(u.getAttribute("y"),10),width:parseInt(u.getAttribute("width"),10),height:parseInt(u.getAttribute("height"),10),xoffset:parseInt(u.getAttribute("xoffset"),10),yoffset:parseInt(u.getAttribute("yoffset"),10),xadvance:parseInt(u.getAttribute("xadvance"),10)})}for(l=0;l<a.length;l++)t.kerning.push({first:parseInt(a[l].getAttribute("first"),10),second:parseInt(a[l].getAttribute("second"),10),amount:parseInt(a[l].getAttribute("amount"),10)});return t},r}(),MA=function(){function r(){}return r.test=function(e){if(typeof e=="string"&&e.indexOf("<font>")>-1){var t=new self.DOMParser().parseFromString(e,"text/xml");return h_.test(t)}return!1},r.parse=function(e){var t=new self.DOMParser().parseFromString(e,"text/xml");return h_.parse(t)},r}(),c_=[EA,h_,MA];function Vb(r){for(var e=0;e<c_.length;e++)if(c_[e].test(r))return c_[e];return null}function jb(r,e,t,n,i,o){var s,a=t.fill;if(!Array.isArray(a))return a;if(a.length===1)return a[0];var l=t.dropShadow?t.dropShadowDistance:0,u=t.padding||0,c=Math.ceil(r.width/n)-l-2*u,d=Math.ceil(r.height/n)-l-2*u,f=a.slice(),m=t.fillGradientStops.slice();if(!m.length)for(var g=f.length+1,_=1;_<g;++_)m.push(_/g);if(f.unshift(a[0]),m.unshift(0),f.push(a[a.length-1]),m.push(1),t.fillGradientType===ic.LINEAR_VERTICAL){s=e.createLinearGradient(c/2,u,c/2,d+u);var y=0,w=(o.fontProperties.fontSize+t.strokeThickness)/d;for(_=0;_<i.length;_++)for(var M=o.lineHeight*_,I=0;I<f.length;I++){var F=M/d+(typeof m[I]=="number"?m[I]:I/f.length)*w,C=Math.max(y,F);C=Math.min(C,1),s.addColorStop(C,f[I]),y=C}}else{s=e.createLinearGradient(u,d/2,c+u,d/2);var U=f.length+1,N=1;for(_=0;_<f.length;_++){var G=void 0;G=typeof m[_]=="number"?m[_]:N/U,s.addColorStop(G,f[_]),N++}}return s}function AA(r,e,t,n,i,o,s){var a=t.text,l=t.fontProperties;e.translate(n,i),e.scale(o,o);var u=s.strokeThickness/2,c=-s.strokeThickness/2;e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=jb(r,e,s,o,[a],t),e.strokeStyle=s.stroke,e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=jb(r,e,s,o,[a],t),e.strokeStyle=s.stroke;var d=s.dropShadowColor,f=ou(typeof d=="number"?d:n0(d));s.dropShadow?(e.shadowColor="rgba("+255*f[0]+","+255*f[1]+","+255*f[2]+","+s.dropShadowAlpha+")",e.shadowBlur=s.dropShadowBlur,e.shadowOffsetX=Math.cos(s.dropShadowAngle)*s.dropShadowDistance,e.shadowOffsetY=Math.sin(s.dropShadowAngle)*s.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),s.stroke&&s.strokeThickness&&e.strokeText(a,u,c+t.lineHeight-l.descent),s.fill&&e.fillText(a,u,c+t.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}var rc=function(){function r(e,t,n){var i=e.info[0],o=e.common[0],s=Fd(e.page[0].file),a={};this._ownsTextures=n,this.font=i.face,this.size=i.size,this.lineHeight=o.lineHeight/s,this.chars={},this.pageTextures=a;for(var l=0;l<e.page.length;l++){var u=e.page[l],c=u.id,d=u.file;a[c]=t instanceof Array?t[l]:t[d]}for(l=0;l<e.char.length;l++){var f=e.char[l],m=(c=f.id,f.page),g=e.char[l],_=g.x,y=g.y,w=g.width,M=g.height,I=g.xoffset,F=g.yoffset,C=g.xadvance;y/=s,w/=s,M/=s,I/=s,F/=s,C/=s;var U=new nn((_/=s)+a[m].frame.x/s,y+a[m].frame.y/s,w,M);this.chars[c]={xOffset:I,yOffset:F,xAdvance:C,kerning:{},texture:new Nt(a[m].baseTexture,U),page:m}}for(l=0;l<e.kerning.length;l++){var N=e.kerning[l],G=N.first,he=N.second,ne=N.amount;G/=s,he/=s,ne/=s,this.chars[he]&&(this.chars[he].kerning[G]=ne)}}return r.prototype.destroy=function(){for(var e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(var e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null},r.install=function(e,t,n){var i;if(e instanceof ep)i=e;else{var o=Vb(e);if(!o)throw new Error("Unrecognized data format for font.");i=o.parse(e)}t instanceof Nt&&(t=[t]);var s=new r(i,t,n);return r.available[s.font]=s,s},r.uninstall=function(e){var t=r.available[e];if(!t)throw new Error("No font found named '"+e+"'");t.destroy(),delete r.available[e]},r.from=function(e,t,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var i=Object.assign({},r.defaultOptions,n),o=i.chars,s=i.padding,a=i.resolution,l=i.textureWidth,u=i.textureHeight,c=function(Re){typeof Re=="string"&&(Re=[Re]);for(var ke=[],Be=0,J=Re.length;Be<J;Be++){var te=Re[Be];if(Array.isArray(te)){if(te.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+te.length+".");var Ae=te[0].charCodeAt(0),Ne=te[1].charCodeAt(0);if(Ne<Ae)throw new Error("[BitmapFont]: Invalid character range.");for(var Te=Ae,Ge=Ne;Te<=Ge;Te++)ke.push(String.fromCharCode(Te))}else ke.push.apply(ke,te.split(""))}if(ke.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return ke}(o),d=t instanceof yu?t:new yu(t),f=l,m=new ep;m.info[0]={face:d.fontFamily,size:d.fontSize},m.common[0]={lineHeight:d.fontSize};for(var g,_,y,w=0,M=0,I=0,F=[],C=0;C<c.length;C++){g||((g=document.createElement("canvas")).width=l,g.height=u,_=g.getContext("2d"),y=new vn(g,{resolution:a}),F.push(new Nt(y)),m.page.push({id:F.length-1,file:""}));var U=Hr.measureText(c[C],d,!1,g),N=U.width,G=Math.ceil(U.height),he=Math.ceil((d.fontStyle==="italic"?2:1)*N);if(M>=u-G*a){if(M===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+d.fontSize+"px fonts");--C,g=null,_=null,y=null,M=0,w=0,I=0}else if(I=Math.max(G+U.fontProperties.descent,I),he*a+w>=f)--C,M+=I*a,M=Math.ceil(M),w=0,I=0;else{AA(g,_,U,w,M,a,d);var ne=U.text.charCodeAt(0);m.char.push({id:ne,page:F.length-1,x:w/a,y:M/a,width:he,height:G,xoffset:0,yoffset:0,xadvance:Math.ceil(N-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0))}),w+=(he+2*s)*a,w=Math.ceil(w)}}C=0;for(var Z=c.length;C<Z;C++)for(var Q=c[C],$=0;$<Z;$++){var se=c[$],me=_.measureText(Q).width,ge=_.measureText(se).width,de=_.measureText(Q+se).width-(me+ge);de&&m.kerning.push({first:Q.charCodeAt(0),second:se.charCodeAt(0),amount:de})}var fe=new r(m,F,!0);return r.available[e]!==void 0&&r.uninstall(e),r.available[e]=fe,fe},r.ALPHA=[["a","z"],["A","Z"]," "],r.NUMERIC=[["0","9"]],r.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],r.ASCII=[[" ","~"]],r.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:r.ALPHANUMERIC},r.available={},r}(),Wb=[],Xb=[],PA=function(r){function e(t,n){n===void 0&&(n={});var i=r.call(this)||this;i._tint=16777215;var o=Object.assign({},e.styleDefaults,n),s=o.align,a=o.tint,l=o.maxWidth,u=o.letterSpacing,c=o.fontName,d=o.fontSize;if(!rc.available[c])throw new Error('Missing BitmapFont "'+c+'"');return i._activePagesMeshData=[],i._textWidth=0,i._textHeight=0,i._align=s,i._tint=a,i._fontName=c,i._fontSize=d||rc.available[c].size,i._text=t,i._maxWidth=l,i._maxLineHeight=0,i._letterSpacing=u,i._anchor=new hu(function(){i.dirty=!0},i,0,0),i._roundPixels=At.ROUND_PIXELS,i.dirty=!0,i._textureCache={},i}return function(t,n){function i(){this.constructor=t}zb(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}(e,r),e.prototype.updateText=function(){for(var t,n=rc.available[this._fontName],i=this._fontSize/n.size,o=new oi,s=[],a=[],l=[],u=this._text.replace(/(?:\r\n|\r)/g,`
|
|
5202
|
-
`)||" ",c=u.length,d=this._maxWidth*n.size/this._fontSize,f=null,m=0,g=0,_=0,y=-1,w=0,M=0,I=0,F=0,
|
|
5203
|
-
`){var G=n.chars[U];if(G){f&&G.kerning[f]&&(o.x+=G.kerning[f]);var he=Xb.pop()||{texture:Nt.EMPTY,line:0,charCode:0,prevSpaces:0,position:new oi};he.texture=G.texture,he.line=_,he.charCode=U,he.position.x=o.x+G.xOffset+this._letterSpacing/2,he.position.y=o.y+G.yOffset,he.prevSpaces=F,s.push(he),o.x+=G.xAdvance+this._letterSpacing,m=o.x,I=Math.max(I,G.yOffset+G.texture.height),f=U,y!==-1&&d>0&&o.x>d&&(su(s,1+y-++M,1+
|
|
5204
|
-
`&&(/(?:\s)/.test(ne)&&(m=w),a.push(m),g=Math.max(g,m),l.push(-1));var Z=[];for(
|
|
5201
|
+
`),o)||this)._colorDirty=!1,i.uvMatrix=new Bm(t),i.batchable=n.program===void 0,i.pluginName=n.pluginName,i.tint=n.tint,i.alpha=n.alpha,i}return l_(e,r),Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;o0(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(oa),Qd=function(r){function e(t,n,i){var o=r.call(this)||this,s=new Di(t),a=new Di(n,!0),l=new Di(i,!0,!0);return o.addAttribute("aVertexPosition",s,2,!1,bn.FLOAT).addAttribute("aTextureCoord",a,2,!1,bn.FLOAT).addIndex(l),o._updateId=-1,o}return l_(e,r),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(gu),zb=function(r,e){return(zb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)},ep=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]},EA=function(){function r(){}return r.test=function(e){return typeof e=="string"&&e.indexOf("info face=")===0},r.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in t){var o=t[i].match(/^[a-z]+/gm)[0],s=t[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var l in s){var u=s[l].split("="),c=u[0],d=u[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f;a[c]=m}n[o].push(a)}var g=new ep;return n.info.forEach(function(_){return g.info.push({face:_.face,size:parseInt(_.size,10)})}),n.common.forEach(function(_){return g.common.push({lineHeight:parseInt(_.lineHeight,10)})}),n.page.forEach(function(_){return g.page.push({id:parseInt(_.id,10),file:_.file})}),n.char.forEach(function(_){return g.char.push({id:parseInt(_.id,10),page:parseInt(_.page,10),x:parseInt(_.x,10),y:parseInt(_.y,10),width:parseInt(_.width,10),height:parseInt(_.height,10),xoffset:parseInt(_.xoffset,10),yoffset:parseInt(_.yoffset,10),xadvance:parseInt(_.xadvance,10)})}),n.kerning.forEach(function(_){return g.kerning.push({first:parseInt(_.first,10),second:parseInt(_.second,10),amount:parseInt(_.amount,10)})}),g},r}(),h_=function(){function r(){}return r.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},r.parse=function(e){for(var t=new ep,n=e.getElementsByTagName("info"),i=e.getElementsByTagName("common"),o=e.getElementsByTagName("page"),s=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),l=0;l<n.length;l++)t.info.push({face:n[l].getAttribute("face"),size:parseInt(n[l].getAttribute("size"),10)});for(l=0;l<i.length;l++)t.common.push({lineHeight:parseInt(i[l].getAttribute("lineHeight"),10)});for(l=0;l<o.length;l++)t.page.push({id:parseInt(o[l].getAttribute("id"),10)||0,file:o[l].getAttribute("file")});for(l=0;l<s.length;l++){var u=s[l];t.char.push({id:parseInt(u.getAttribute("id"),10),page:parseInt(u.getAttribute("page"),10)||0,x:parseInt(u.getAttribute("x"),10),y:parseInt(u.getAttribute("y"),10),width:parseInt(u.getAttribute("width"),10),height:parseInt(u.getAttribute("height"),10),xoffset:parseInt(u.getAttribute("xoffset"),10),yoffset:parseInt(u.getAttribute("yoffset"),10),xadvance:parseInt(u.getAttribute("xadvance"),10)})}for(l=0;l<a.length;l++)t.kerning.push({first:parseInt(a[l].getAttribute("first"),10),second:parseInt(a[l].getAttribute("second"),10),amount:parseInt(a[l].getAttribute("amount"),10)});return t},r}(),MA=function(){function r(){}return r.test=function(e){if(typeof e=="string"&&e.indexOf("<font>")>-1){var t=new self.DOMParser().parseFromString(e,"text/xml");return h_.test(t)}return!1},r.parse=function(e){var t=new self.DOMParser().parseFromString(e,"text/xml");return h_.parse(t)},r}(),c_=[EA,h_,MA];function Vb(r){for(var e=0;e<c_.length;e++)if(c_[e].test(r))return c_[e];return null}function jb(r,e,t,n,i,o){var s,a=t.fill;if(!Array.isArray(a))return a;if(a.length===1)return a[0];var l=t.dropShadow?t.dropShadowDistance:0,u=t.padding||0,c=Math.ceil(r.width/n)-l-2*u,d=Math.ceil(r.height/n)-l-2*u,f=a.slice(),m=t.fillGradientStops.slice();if(!m.length)for(var g=f.length+1,_=1;_<g;++_)m.push(_/g);if(f.unshift(a[0]),m.unshift(0),f.push(a[a.length-1]),m.push(1),t.fillGradientType===ic.LINEAR_VERTICAL){s=e.createLinearGradient(c/2,u,c/2,d+u);var y=0,w=(o.fontProperties.fontSize+t.strokeThickness)/d;for(_=0;_<i.length;_++)for(var M=o.lineHeight*_,I=0;I<f.length;I++){var F=M/d+(typeof m[I]=="number"?m[I]:I/f.length)*w,R=Math.max(y,F);R=Math.min(R,1),s.addColorStop(R,f[I]),y=R}}else{s=e.createLinearGradient(u,d/2,c+u,d/2);var U=f.length+1,N=1;for(_=0;_<f.length;_++){var G=void 0;G=typeof m[_]=="number"?m[_]:N/U,s.addColorStop(G,f[_]),N++}}return s}function AA(r,e,t,n,i,o,s){var a=t.text,l=t.fontProperties;e.translate(n,i),e.scale(o,o);var u=s.strokeThickness/2,c=-s.strokeThickness/2;e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=jb(r,e,s,o,[a],t),e.strokeStyle=s.stroke,e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=jb(r,e,s,o,[a],t),e.strokeStyle=s.stroke;var d=s.dropShadowColor,f=ou(typeof d=="number"?d:n0(d));s.dropShadow?(e.shadowColor="rgba("+255*f[0]+","+255*f[1]+","+255*f[2]+","+s.dropShadowAlpha+")",e.shadowBlur=s.dropShadowBlur,e.shadowOffsetX=Math.cos(s.dropShadowAngle)*s.dropShadowDistance,e.shadowOffsetY=Math.sin(s.dropShadowAngle)*s.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),s.stroke&&s.strokeThickness&&e.strokeText(a,u,c+t.lineHeight-l.descent),s.fill&&e.fillText(a,u,c+t.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}var rc=function(){function r(e,t,n){var i=e.info[0],o=e.common[0],s=Fd(e.page[0].file),a={};this._ownsTextures=n,this.font=i.face,this.size=i.size,this.lineHeight=o.lineHeight/s,this.chars={},this.pageTextures=a;for(var l=0;l<e.page.length;l++){var u=e.page[l],c=u.id,d=u.file;a[c]=t instanceof Array?t[l]:t[d]}for(l=0;l<e.char.length;l++){var f=e.char[l],m=(c=f.id,f.page),g=e.char[l],_=g.x,y=g.y,w=g.width,M=g.height,I=g.xoffset,F=g.yoffset,R=g.xadvance;y/=s,w/=s,M/=s,I/=s,F/=s,R/=s;var U=new nn((_/=s)+a[m].frame.x/s,y+a[m].frame.y/s,w,M);this.chars[c]={xOffset:I,yOffset:F,xAdvance:R,kerning:{},texture:new Nt(a[m].baseTexture,U),page:m}}for(l=0;l<e.kerning.length;l++){var N=e.kerning[l],G=N.first,he=N.second,ne=N.amount;G/=s,he/=s,ne/=s,this.chars[he]&&(this.chars[he].kerning[G]=ne)}}return r.prototype.destroy=function(){for(var e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(var e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null},r.install=function(e,t,n){var i;if(e instanceof ep)i=e;else{var o=Vb(e);if(!o)throw new Error("Unrecognized data format for font.");i=o.parse(e)}t instanceof Nt&&(t=[t]);var s=new r(i,t,n);return r.available[s.font]=s,s},r.uninstall=function(e){var t=r.available[e];if(!t)throw new Error("No font found named '"+e+"'");t.destroy(),delete r.available[e]},r.from=function(e,t,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var i=Object.assign({},r.defaultOptions,n),o=i.chars,s=i.padding,a=i.resolution,l=i.textureWidth,u=i.textureHeight,c=function(Re){typeof Re=="string"&&(Re=[Re]);for(var ke=[],Be=0,J=Re.length;Be<J;Be++){var te=Re[Be];if(Array.isArray(te)){if(te.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+te.length+".");var Ae=te[0].charCodeAt(0),Ne=te[1].charCodeAt(0);if(Ne<Ae)throw new Error("[BitmapFont]: Invalid character range.");for(var Te=Ae,Ge=Ne;Te<=Ge;Te++)ke.push(String.fromCharCode(Te))}else ke.push.apply(ke,te.split(""))}if(ke.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return ke}(o),d=t instanceof yu?t:new yu(t),f=l,m=new ep;m.info[0]={face:d.fontFamily,size:d.fontSize},m.common[0]={lineHeight:d.fontSize};for(var g,_,y,w=0,M=0,I=0,F=[],R=0;R<c.length;R++){g||((g=document.createElement("canvas")).width=l,g.height=u,_=g.getContext("2d"),y=new vn(g,{resolution:a}),F.push(new Nt(y)),m.page.push({id:F.length-1,file:""}));var U=Hr.measureText(c[R],d,!1,g),N=U.width,G=Math.ceil(U.height),he=Math.ceil((d.fontStyle==="italic"?2:1)*N);if(M>=u-G*a){if(M===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+d.fontSize+"px fonts");--R,g=null,_=null,y=null,M=0,w=0,I=0}else if(I=Math.max(G+U.fontProperties.descent,I),he*a+w>=f)--R,M+=I*a,M=Math.ceil(M),w=0,I=0;else{AA(g,_,U,w,M,a,d);var ne=U.text.charCodeAt(0);m.char.push({id:ne,page:F.length-1,x:w/a,y:M/a,width:he,height:G,xoffset:0,yoffset:0,xadvance:Math.ceil(N-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0))}),w+=(he+2*s)*a,w=Math.ceil(w)}}R=0;for(var Z=c.length;R<Z;R++)for(var Q=c[R],$=0;$<Z;$++){var se=c[$],me=_.measureText(Q).width,ge=_.measureText(se).width,de=_.measureText(Q+se).width-(me+ge);de&&m.kerning.push({first:Q.charCodeAt(0),second:se.charCodeAt(0),amount:de})}var fe=new r(m,F,!0);return r.available[e]!==void 0&&r.uninstall(e),r.available[e]=fe,fe},r.ALPHA=[["a","z"],["A","Z"]," "],r.NUMERIC=[["0","9"]],r.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],r.ASCII=[[" ","~"]],r.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:r.ALPHANUMERIC},r.available={},r}(),Wb=[],Xb=[],PA=function(r){function e(t,n){n===void 0&&(n={});var i=r.call(this)||this;i._tint=16777215;var o=Object.assign({},e.styleDefaults,n),s=o.align,a=o.tint,l=o.maxWidth,u=o.letterSpacing,c=o.fontName,d=o.fontSize;if(!rc.available[c])throw new Error('Missing BitmapFont "'+c+'"');return i._activePagesMeshData=[],i._textWidth=0,i._textHeight=0,i._align=s,i._tint=a,i._fontName=c,i._fontSize=d||rc.available[c].size,i._text=t,i._maxWidth=l,i._maxLineHeight=0,i._letterSpacing=u,i._anchor=new hu(function(){i.dirty=!0},i,0,0),i._roundPixels=At.ROUND_PIXELS,i.dirty=!0,i._textureCache={},i}return function(t,n){function i(){this.constructor=t}zb(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}(e,r),e.prototype.updateText=function(){for(var t,n=rc.available[this._fontName],i=this._fontSize/n.size,o=new oi,s=[],a=[],l=[],u=this._text.replace(/(?:\r\n|\r)/g,`
|
|
5202
|
+
`)||" ",c=u.length,d=this._maxWidth*n.size/this._fontSize,f=null,m=0,g=0,_=0,y=-1,w=0,M=0,I=0,F=0,R=0;R<c;R++){var U=u.charCodeAt(R),N=u.charAt(R);if(/(?:\s)/.test(N)&&(y=R,w=m,F++),N!=="\r"&&N!==`
|
|
5203
|
+
`){var G=n.chars[U];if(G){f&&G.kerning[f]&&(o.x+=G.kerning[f]);var he=Xb.pop()||{texture:Nt.EMPTY,line:0,charCode:0,prevSpaces:0,position:new oi};he.texture=G.texture,he.line=_,he.charCode=U,he.position.x=o.x+G.xOffset+this._letterSpacing/2,he.position.y=o.y+G.yOffset,he.prevSpaces=F,s.push(he),o.x+=G.xAdvance+this._letterSpacing,m=o.x,I=Math.max(I,G.yOffset+G.texture.height),f=U,y!==-1&&d>0&&o.x>d&&(su(s,1+y-++M,1+R-y),R=y,y=-1,a.push(w),l.push(s.length>0?s[s.length-1].prevSpaces:0),g=Math.max(g,w),_++,o.x=0,o.y+=n.lineHeight,f=null,F=0)}}else a.push(m),l.push(-1),g=Math.max(g,m),++_,++M,o.x=0,o.y+=n.lineHeight,f=null,F=0}var ne=u.charAt(u.length-1);ne!=="\r"&&ne!==`
|
|
5204
|
+
`&&(/(?:\s)/.test(ne)&&(m=w),a.push(m),g=Math.max(g,m),l.push(-1));var Z=[];for(R=0;R<=_;R++){var Q=0;this._align==="right"?Q=g-a[R]:this._align==="center"?Q=(g-a[R])/2:this._align==="justify"&&(Q=l[R]<0?0:(g-a[R])/l[R]),Z.push(Q)}var $=s.length,se={},me=[],ge=this._activePagesMeshData;for(R=0;R<ge.length;R++)Wb.push(ge[R]);for(R=0;R<$;R++){var de=(Te=s[R].texture).baseTexture.uid;if(!se[de]){if(!(xe=Wb.pop())){var fe=new Qd,Re=new Kd(Nt.EMPTY);xe={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new xu(fe,Re),vertices:null,uvs:null,indices:null}}xe.index=0,xe.indexCount=0,xe.vertexCount=0,xe.uvsCount=0,xe.total=0;var ke=this._textureCache;ke[de]=ke[de]||new Nt(Te.baseTexture),xe.mesh.texture=ke[de],xe.mesh.tint=this._tint,me.push(xe),se[de]=xe}se[de].total++}for(R=0;R<ge.length;R++)me.indexOf(ge[R])===-1&&this.removeChild(ge[R].mesh);for(R=0;R<me.length;R++)me[R].mesh.parent!==this&&this.addChild(me[R].mesh);for(var R in this._activePagesMeshData=me,se){var Be=(xe=se[R]).total;if(!(((t=xe.indices)===null||t===void 0?void 0:t.length)>6*Be)||xe.vertices.length<2*xu.BATCHABLE_SIZE)xe.vertices=new Float32Array(8*Be),xe.uvs=new Float32Array(8*Be),xe.indices=new Uint16Array(6*Be);else for(var J=xe.total,te=xe.vertices,Ae=4*J*2;Ae<te.length;Ae++)te[Ae]=0;xe.mesh.size=6*Be}for(R=0;R<$;R++){var Ne=(N=s[R]).position.x+Z[N.line]*(this._align==="justify"?N.prevSpaces:1);this._roundPixels&&(Ne=Math.round(Ne));var Te,Ge=Ne*i,Ye=N.position.y*i,ve=se[(Te=N.texture).baseTexture.uid],Y=Te.frame,pe=Te._uvs,ye=ve.index++;ve.indices[6*ye+0]=0+4*ye,ve.indices[6*ye+1]=1+4*ye,ve.indices[6*ye+2]=2+4*ye,ve.indices[6*ye+3]=0+4*ye,ve.indices[6*ye+4]=2+4*ye,ve.indices[6*ye+5]=3+4*ye,ve.vertices[8*ye+0]=Ge,ve.vertices[8*ye+1]=Ye,ve.vertices[8*ye+2]=Ge+Y.width*i,ve.vertices[8*ye+3]=Ye,ve.vertices[8*ye+4]=Ge+Y.width*i,ve.vertices[8*ye+5]=Ye+Y.height*i,ve.vertices[8*ye+6]=Ge,ve.vertices[8*ye+7]=Ye+Y.height*i,ve.uvs[8*ye+0]=pe.x0,ve.uvs[8*ye+1]=pe.y0,ve.uvs[8*ye+2]=pe.x1,ve.uvs[8*ye+3]=pe.y1,ve.uvs[8*ye+4]=pe.x2,ve.uvs[8*ye+5]=pe.y2,ve.uvs[8*ye+6]=pe.x3,ve.uvs[8*ye+7]=pe.y3}for(var R in this._textWidth=g*i,this._textHeight=(o.y+n.lineHeight)*i,se){var xe=se[R];if(this.anchor.x!==0||this.anchor.y!==0)for(var De=0,ht=this._textWidth*this.anchor.x,xt=this._textHeight*this.anchor.y,_t=0;_t<xe.total;_t++)xe.vertices[De++]-=ht,xe.vertices[De++]-=xt,xe.vertices[De++]-=ht,xe.vertices[De++]-=xt,xe.vertices[De++]-=ht,xe.vertices[De++]-=xt,xe.vertices[De++]-=ht,xe.vertices[De++]-=xt;this._maxLineHeight=I*i;var Gt=xe.mesh.geometry.getBuffer("aVertexPosition"),Wt=xe.mesh.geometry.getBuffer("aTextureCoord"),si=xe.mesh.geometry.getIndex();Gt.data=xe.vertices,Wt.data=xe.uvs,si.data=xe.indices,Gt.update(),Wt.update(),si.update()}for(R=0;R<s.length;R++)Xb.push(s[R])},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype.getLocalBounds=function(){return this.validate(),r.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var n=0;n<this._activePagesMeshData.length;n++)this._activePagesMeshData[n].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!rc.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(t==null?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t){var n=this._textureCache;for(var i in n)n[i].destroy(),delete n[i];this._textureCache=null,r.prototype.destroy.call(this,t)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(Mi),Yb=function(){function r(){}return r.add=function(){ao.setExtensionXhrType("fnt",ao.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){var n=Vb(e.data);if(n)for(var i=r.getBaseUrl(this,e),o=n.parse(e.data),s={},a=function(_){s[_.metadata.pageFile]=_.texture,Object.keys(s).length===o.page.length&&(e.bitmapFont=rc.install(o,s,!0),t())},l=0;l<o.page.length;++l){var u=o.page[l].file,c=i+u,d=!1;for(var f in this.resources){var m=this.resources[f];if(m.url===c){m.metadata.pageFile=u,m.texture?a(m):m.onAfterMiddleware.add(a),d=!0;break}}if(!d){var g={crossOrigin:e.crossOrigin,loadType:ao.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(c,g,a)}}else t()},r.getBaseUrl=function(e,t){var n=t.isDataUrl?"":r.dirname(t.url);return t.isDataUrl&&(n==="."&&(n=""),e.baseUrl&&n&&e.baseUrl.charAt(e.baseUrl.length-1)==="/"&&(n+="/")),(n=n.replace(e.baseUrl,""))&&n.charAt(n.length-1)!=="/"&&(n+="/"),n},r.dirname=function(e){var t=e.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return t===e?".":t===""?"/":t},r}(),qb=function(r,e){return(qb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(r,e)},CA=function(r){function e(t){t===void 0&&(t=1);var n=r.call(this,F1,`varying vec2 vTextureCoord;
|
|
5205
5205
|
|
|
5206
5206
|
uniform sampler2D uSampler;
|
|
5207
5207
|
uniform float uAlpha;
|
|
@@ -5725,7 +5725,7 @@ void main(void){
|
|
|
5725
5725
|
}
|
|
5726
5726
|
gl_FragColor = color1;
|
|
5727
5727
|
}
|
|
5728
|
-
`,{percent:0})}set percent(e){this.uniforms.percent=e}}class w2 extends Ka{constructor(e){var t;super(e),this.filterType="",this.isConflict=!0,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:o,delta:s})=>{const a=s/o;this.filter&&(this.filter.percent=a),a>=1&&this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let n=0;e.json.transition==="out"?n=-1:e.json.transition==="in"&&(n=1);const i=(t=e.json.filter)===null||t===void 0?void 0:t.match(/^([a-zA-Z]+)(\((.+)\))?/);if(i){const o=i[1],s=i[3];if(o==="wipe"){const a=new x2(n);s==="up"?a.direction=1:s==="down"?a.direction=2:s==="left"?a.direction=3:s==="right"&&(a.direction=4),this.filter=a,this.filterType=`${o}-${s}`}else if(o==="fade"){const a=new b2;this.filter=a,this.filterType=""+o}}}get modifyAttrKey(){return this.filterType}}class T2 extends Ka{constructor(e){super(e),this.isConflict=!0,this.activeWhenConflict="next",this.onTimeUpdate=({duration:t,delta:n})=>{var i;const o=n/t,s=(i=this.path)===null||i===void 0?void 0:i.getPoint(o);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{var t;const n=(t=this.path)===null||t===void 0?void 0:t.getPoint(0);this.timingTarget&&n&&(this.timingTarget.ppt_x=n.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=n.y+this.timingTarget.design_ppt_y)},this.onSeekToEnd=()=>{var t;const n=(t=this.path)===null||t===void 0?void 0:t.getPoint(1);this.timingTarget&&n&&(this.timingTarget.ppt_x=n.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=n.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var e;const t=new Jl,n=(e=this.json.path)===null||e===void 0?void 0:e.match(/[MLCmlc][^MLCmlc]+/g);if(n)for(const i of n){const[o,...s]=i.trim().replace(/\s+/g," ").split(" ");if(o==="M"){const[a,l]=s.map(u=>Number(u));t.moveTo(a,l)}else if(o==="L"){const[a,l]=s.map(u=>Number(u));t.lineTo(a,l)}else if(o==="C"){const[a,l,u,c,d,f]=s.map(m=>Number(m));t.bezierCurveTo(a,l,u,c,d,f)}else if(o==="Z")t.closePath();else if(o==="E")console.warn("not implements");else if(o==="c"){const[a,l,u,c,d,f]=s.map(g=>Number(g)),m=t.currentPoint;t.bezierCurveTo(a+m.x,l+m.y,u+m.x,c+m.y,d+m.x,f+m.y)}else if(o==="l"){const a=t.currentPoint,[l,u]=s.map(c=>Number(c));t.lineTo(l+a.x,u+a.y)}else if(o==="m"){const a=t.currentPoint,[l,u]=s.map(c=>Number(c));t.moveTo(l+a.x,u+a.y)}}this.path=t}}class S2 extends Ka{constructor(e){super(e),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=t=>{t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:n})=>{const i=n/t,o={x:1,y:1};if(this.from&&this.to)o.x=this.from.x+(this.to.x-this.from.x)*i,o.y=this.from.y+(this.to.y-this.from.y)*i;else if(this.by){const s={x:this.by.x,y:this.by.y};o.x=1+(s.x-1)*i,o.y=1+(s.y-1)*i}this.timingTarget&&(this.timingTarget.scale=o)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=e.json.from,this.to=e.json.to,this.by=e.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class E2 extends Ka{constructor(e){super(e),this.isConflict=!1,this.activeWhenConflict="next",this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=t=>{this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to),t.isReverse||this.updateCurrentValue();const[n]=this.json.cBhvr.attrList[0].split(".");gs(this.timingTarget,n+".on","true")},this.onTimeNodeEnd=()=>{if(this.json.cBhvr.ctn.fill==="remove"){const[t]=this.json.cBhvr.attrList[0].split(".");gs(this.timingTarget,t+".on","false")}},this.onSeekToStart=()=>{if(this.timingTarget){const[t]=this.json.cBhvr.attrList[0].split(".");gs(this.timingTarget,t+".on","false")}},this.onTimeNodeStart=()=>{if(this.timingTarget){const t=tg(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.startColorString=t)}},this.onTimeUpdate=({delta:t,duration:n})=>{const i=t/n;this.to.interpolationFrom(this.from,i,this.target),this.timingTarget&&gs(this.timingTarget,this.json.cBhvr.attrList[0],this.target.toHexString())},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1})},this.json.clrSpc==="rgb"?(this.from=new Km(this.json.from),this.to=new Km(this.json.to),this.by=new Km(this.json.by),this.target=new Km):(this.from=new $m(this.json.from),this.to=new $m(this.json.to),this.by=new $m(this.json.by),this.target=new $m),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const e=tg(this.timingTarget,this.json.cBhvr.attrList[0]);e&&(this.currentColorString=e)}}}class M2 extends Ka{constructor(e){super(e),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=t=>{this.lastVal=null,t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:n})=>{const i=n/t;let o=0,s=0;if(this.from!==void 0&&this.to!==void 0){o=this.from,s=this.to;const a=o+(s-o)*i;this.timingTarget&&(this.timingTarget.r=a)}else if(this.by!==void 0){this.lastVal||(this.lastVal=0);const a=this.by*i-this.lastVal;this.lastVal=this.by*i,this.timingTarget&&(this.timingTarget.r+=a)}},this.onTimeNodeStart=()=>{var t;Object(oe.isNumber)((t=this.timingTarget)===null||t===void 0?void 0:t.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&this.startVal!==null&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var e;this.currentVal=(e=this.timingTarget)===null||e===void 0?void 0:e.r}}class A2 extends Ka{constructor(e){super(e),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var t,n;const{cmd:i,cmdType:o}=this.json;!this.isApplied&&i&&o&&(this.isApplied=!0,(n=(t=this.timingTarget)===null||t===void 0?void 0:t.cmd)===null||n===void 0||n.applyCommand(i,o))},this.onSeekToStart=()=>{var t,n;(n=(t=this.timingTarget)===null||t===void 0?void 0:t.cmd)===null||n===void 0||n.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{var t,n;(n=(t=this.timingTarget)===null||t===void 0?void 0:t.cmd)===null||n===void 0||n.applyCommand("custom-pause","call")},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){var e,t,n,i;return((t=(e=this.json)===null||e===void 0?void 0:e.cmd)!==null&&t!==void 0?t:"")+((i=(n=this.json)===null||n===void 0?void 0:n.cmdType)!==null&&i!==void 0?i:"")}}var P2=v(17);class ng{constructor(e){ng.useRtc||(this.howl=new P2.Howl({src:[e]}))}play(){var e;(e=this.howl)===null||e===void 0||e.play()}pause(){var e;(e=this.howl)===null||e===void 0||e.pause()}stop(){var e;(e=this.howl)===null||e===void 0||e.stop()}}ng.useRtc=!1;class C2{constructor(e){this.runtimeNodeEventHub=new k.a,this.stopAudio=()=>{this.audio.stop()};const{json:t,isIterate:n,isSub:i,eventHub:o,ctx:s,parent:a,iterateType:l,iterateIndex:u,iterateId:c}=e;this.json=t,this.id=t.cMediaNode.ctn.id,this.commonTimeNode=new sc({json:t.cMediaNode.ctn,isSub:i,eventHubs:{global:o,runtime:this.runtimeNodeEventHub},ctx:s,parent:a,isIterate:n,iterateType:l,iterateIndex:u,iterateId:c}),this.audio=new ng(t.cMediaNode.tgtEl),this.commonTimeNode.on("timelineStart",()=>{this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.stopAudio)}}var R2=v(7),Lw=v.n(R2);function Ow(){return Date.now().toString(32)+Math.random().toString(32).substring(2)}function x_(r){const e=[],t=r.filter(l=>{const u=l.width<2048&&l.height<2048;return u||e.push(l),u}).map(l=>(l.width+=2,l.height+=2,l)).sort((l,u)=>l.width*l.height-u.width*u.height);let n=t.length+1,i=2050,o=2050;const s=[];let a=null;for(;(i>2048||o>2048)&&t.length>0;)n-=1,a=Lw()(t.slice(0,n)),i=a.width,o=a.height;return a&&s.push(a),e.forEach(l=>{const u=Lw()([l]);s.push(u)}),n<t.length?s.concat(x_(t.slice(n))):s}var I2=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})};class sc extends k.a{constructor(e){super(),this.uuid=Date.now().toString(32)+Math.random().toString(32).substring(2),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId=null,this.iterateShadows=[],this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.timeDelta=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.dispose())},this.handleActive=(m=!0)=>{if(this.isActive=!0,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if(this.json.restart==="never")return;this.json.restart!=="whenNotActive"&&this.json.restart!=="always"||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(m))}else this.startTimeLine(m)},this.updateTimeLine=m=>{const g=m/(At.TARGET_FPMS||.06);this.timeDelta+=g,this.duration-this.timeDelta<=g&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(m=!1)=>{(this.isTimeNodeEnd()||m)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:t,isIterate:n,ctx:i,eventHubs:o,parent:s,json:a,iterateType:l,iterateId:u,iterateIndex:c}=e;this.isSub=t,this.isIterate=n,this.parentTimeNode=s,this.json=a,this.ctx=i,this.iterateIndex=c,this.eventHubs=o,this.iterateType=l,this.iterateId=u;const d=Number(this.json.dur),f=this.json.spd||1;this.isNegativeSpeed=f<0,Number.isNaN(d)||(this.duration=d/Math.abs(f)),this.setPreStyle(),a.childTnLst&&this.createChildren(a.childTnLst),this.startConds=new sp(this.json.id||"",a.stCondLst,o,this.ctx),this.endConds=new sp(this.json.id||"",a.endCondLst,o,this.ctx),a.endSync&&(this.endSync=new sp(this.json.id||"",[a.endSync],o,this.ctx),this.endSync.on("active",()=>{var m;this.json.nodeType==="interactiveSeq"&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),(m=this.endSync)===null||m===void 0||m.reset())})),this.startConds.on("active",m=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(m))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(m=>m.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&this.json.masterRel==="nextClick"&&this.startConds.addCond({event:"shape slide onNext"}),this.json.iterate&&this.isIterate===!1&&this.createIterateShadow()}createIterateShadow(){const e=Ow();let t=!0,n=0;const i=o=>{o===e&&(t=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",i))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",i);t;){const o=JSON.parse(JSON.stringify(this.json)),s=new sc({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:n,iterateId:e});this.iterateShadows[n]=s,n+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(e){this.isReverse=e}createTimeNode(e,t){let n=null;const i={json:e,isSub:t,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId};return e.type==="seq"?n=new f2(i):e.type==="par"?n=new Dw(i):e.type==="set"?n=new g2(i):e.type==="anim"?n=new y2(i):e.type==="animEffect"?n=new w2(i):e.type==="animMotion"?n=new T2(i):e.type==="animScale"?n=new S2(i):e.type==="animClr"?n=new E2(i):e.type==="animRot"?n=new M2(i):e.type==="cmd"?n=new A2(i):e.type==="audio"&&(n=new C2(i)),n}createSubList(e){this.subList=[],e.forEach(t=>{const n=this.createTimeNode(t,!0);n&&this.subList.push(n)})}createChildren(e){e.forEach(t=>{const n=this.createTimeNode(t,!1);n&&(n.commonTimeNode.on("timeNodeStart",i=>{this.emit("childTimeNodeStart",i)}),n.commonTimeNode.on("timeNodeEnd",i=>{this.emit("childTimeNodeEnd",i),this.children.every(o=>o.commonTimeNode.isTimeNodeEnd())&&(this.json.iterate||this.allChildrenEndHandle())}),this.children.push(n))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(e=>e.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.timeDelta=0,this.children.forEach(e=>e.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(e=>e.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.timeDelta=0;const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(mn.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(mn.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(e=!0){if(e&&(this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.onTimeLineEnd()):this.duration>t&&(this.ctx.eventHub.emit(mn.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}setTimeout(e,t){let n=0;const i=o=>{n+=o/(At.TARGET_FPMS||.06),n>=t&&(e(),this.ctx.ticker.remove(i))};return this.ctx.ticker.add(i),()=>{this.ctx.ticker.remove(i)}}tickerDelay(e){return new Promise(t=>{this.setTimeout(()=>{t()},e)})}startIterate(){return I2(this,void 0,void 0,function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const e of this.iterateShadows){if(this.isIterateEnd)return;e.children.forEach(t=>{t.commonTimeNode.startTimeNode()}),e.applyCount+=1,yield this.tickerDelay(this.json.iterate.interval)}this.onTimeLineEnd()}})}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}setPreStyle(){if(!this.json.presetClass)return;const e=[],t=n=>{n.forEach(i=>{var o,s,a;i.cBhvr&&i.cBhvr.target&&e.findIndex(l=>l.id===i.cBhvr.target.id)<0&&e.push(i.cBhvr.target),((s=(o=i==null?void 0:i.cBhvr)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.childTnLst)&&i.cBhvr.ctn.childTnLst.length>0&&t(i.cBhvr.ctn.childTnLst),((a=i==null?void 0:i.ctn)===null||a===void 0?void 0:a.childTnLst)&&i.ctn.childTnLst.length>0&&t(i.ctn.childTnLst)})};t(this.json.childTnLst||[]),e.forEach(n=>{if(this.json.iterate){let i=0,o=!0;for(;o;){const s=this.ctx.timingTargets.getTarget(n,!0,{type:this.json.iterate.type,index:i,id:""});s&&(this.setPreStyleForTarget(s),i+=1),o=!!s}}else{const i=this.ctx.timingTargets.getTarget(n,!1);i&&this.setPreStyleForTarget(i)}})}setPreStyleForTarget(e){e&&this.json.presetSubtype&&(e.presetSubType=this.json.presetSubtype),e&&!e.hasPreset&&(this.json.presetClass==="entr"?(e.hasPreset=!0,e.style.visibility="hidden"):this.json.presetClass==="exit"&&(e.hasPreset=!0,e.style.visibility="visible"))}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(e=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(e);const t=this.json.stCondLst.filter(i=>/^self/.test(i.event||""))[0];t&&this.startConds.condHandle(t);const n=this.json.endCondLst.filter(i=>/^self/.test(i.event||""))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(this.children.length===0||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(e=>e.commonTimeNode.destroy())}seekToStart(e=!0){if(this.isActive=!1,this.dispose(),this.isNegativeSpeed,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(t=>t.seekToStart(e));if(e)for(let t=this.subList.length-1;t>=0;t--){const n=this.subList[t];n==null||n.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const n=this.children[t];n==null||n.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const n=this.children[t];n==null||n.commonTimeNode.seekToStart()}}dispose(e=!1){this.isConflictDispose=e,window.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(mn.animateEnd),this.ctx.ticker.remove(this.updateTimeLine),this.startConds.reset(),this.endConds.reset()}seekToEnd(e,t=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const n=this.json.autoRev||e;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(i=>i.seekToEnd(n,t));this.children.length===0&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(i=>i.commonTimeNode.seekToEnd(n,t)),t&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(i=>i.commonTimeNode.seekToEnd(!1)))}isTimeNodeEnd(){let e=!0;return this.children.length>0&&(e=e&&this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}emitEndEvents(){this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(e=>e.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(e=>e.commonTimeNode.destroy())}}class Dw extends k.a{constructor(e){super(),this.isRunning=!1,this.runtimeNodeEventHub=new k.a;const{json:t,iterateType:n,isIterate:i,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:u,iterateId:c}=e;this.id=t.ctn.id,this.json=t,this.ctx=a,this.isIterate=i,this.globalEventHub=l,this.commonTimeNode=new sc({json:t.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:u,iterateId:c}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(d=>{d.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),d.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(d=>{d.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}class L2{constructor(e,t,n){this.json=e,this.ctx=n;const i=e.timeNodeList.find(o=>o.type==="par"&&o.ctn.nodeType==="tmRoot");i&&(this.tmRoot=new Dw({json:i,isSub:!1,isIterate:!1,eventHub:t,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(o=>{var s,a,l;return((s=o.json)===null||s===void 0?void 0:s.type)==="seq"&&((l=(a=o.json)===null||a===void 0?void 0:a.ctn)===null||l===void 0?void 0:l.nodeType)==="mainSeq"}))}findSeq(e){var t;return(t=this.tmRoot)===null||t===void 0?void 0:t.commonTimeNode.children.find(n=>{var i,o,s;return((i=n.json)===null||i===void 0?void 0:i.type)==="seq"&&((s=(o=n.json)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.id)===e})}start(){var e;this.json.autoPlayMainSeq?setTimeout(()=>{var t;(t=this.mainSeq)===null||t===void 0||t.startAutoPlay()}):(e=this.mainSeq)===null||e===void 0||e.commonTimeNode.startTimeNode()}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var e;(e=this.mainSeq)===null||e===void 0||e.commonTimeNode.collectStartValue()}setMainSeqStep(e,t){var n;e===-1&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),(n=this.mainSeq)===null||n===void 0||n.setCurrentStep(e,t)}destroy(){var e;(e=this.tmRoot)===null||e===void 0||e.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(e){const t=this.findSeq(e);t&&t.commonTimeNode.seekToEnd(!1,!0)}}var O2=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})};class D2 extends __{constructor(e,t,n){super({id:"stage",width:e.width,height:e.height,type:"Container",children:e.children},t,n),this.globalEventHub=new k.a,this.json=e,this.container.visible=!1,this.ctx=t,this.globalEventHub.on("c:prev slide",()=>{this.ctx.eventHub.emit(_s.prev)}),this.globalEventHub.on("c:next slide",()=>{this.ctx.eventHub.emit(_s.next)});const i=new ca;i.drawRect(0,0,e.width,e.height),this.container.addChild(i)}get interactiveContainer(){return this.container}render(){const e=Object.create(null,{render:{get:()=>super.render}});return O2(this,void 0,void 0,function*(){yield e.render.call(this),this.ctx.eventHub.emit("StageRenderEnd")})}createTiming(){this.json.timing&&(this.timing=new L2(this.json.timing,this.globalEventHub,this.ctx))}startTiming(){var e;(e=this.timing)===null||e===void 0||e.start()}setMainSeqApplied(){var e;(e=this.timing)===null||e===void 0||e.setMainSeqApplied()}setMainSeqStep(e,t){var n;(n=this.timing)===null||n===void 0||n.setMainSeqStep(e,t)}collectMainSeqStartValue(){var e;(e=this.timing)===null||e===void 0||e.collectMainSeqStartValue()}hasTiming(){return!!this.timing}destroy(){var e;super.destroy(),this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),this.ctx.fillTexture.destroy(),this.globalEventHub.removeAllListeners(),(e=this.timing)===null||e===void 0||e.destroy()}mainSeqStep(){var e,t;return(t=(e=this.timing)===null||e===void 0?void 0:e.currentMainSeqStep())!==null&&t!==void 0?t:0}mainSeqLength(){var e,t;return(t=(e=this.timing)===null||e===void 0?void 0:e.currentMainSeqLength())!==null&&t!==void 0?t:0}mainSeqHasNextStep(){var e,t;return(t=(e=this.timing)===null||e===void 0?void 0:e.mainSeqHasNextStep())!==null&&t!==void 0&&t}mainSeqHasPrevStep(){var e,t;return(t=(e=this.timing)===null||e===void 0?void 0:e.mainSeqHasPrevStep())!==null&&t!==void 0&&t}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?this.globalEventHub.emit("shape slide onNext"):this.ctx.eventHub.emit(_s.next)}prevStep(){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?this.globalEventHub.emit("shape slide onPrev"):this.ctx.eventHub.emit(_s.prev)}applyInteractiveAction(e){this.globalEventHub.emit(e)}seekInteractiveSeqToEnd(e){var t;(t=this.timing)===null||t===void 0||t.seekInteractiveSeqToEnd(e)}}const Ki=134217729;function b_(r,e,t,n,i){let o,s,a,l,u=e[0],c=n[0],d=0,f=0;c>u==c>-u?(o=u,u=e[++d]):(o=c,c=n[++f]);let m=0;if(d<r&&f<t)for(c>u==c>-u?(s=u+o,a=o-(s-u),u=e[++d]):(s=c+o,a=o-(s-c),c=n[++f]),o=s,a!==0&&(i[m++]=a);d<r&&f<t;)c>u==c>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++d]):(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=n[++f]),o=s,a!==0&&(i[m++]=a);for(;d<r;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++d],o=s,a!==0&&(i[m++]=a);for(;f<t;)s=o+c,l=s-o,a=o-(s-l)+(c-l),c=n[++f],o=s,a!==0&&(i[m++]=a);return o===0&&m!==0||(i[m++]=o),m}function N2(r,e){let t=e[0];for(let n=1;n<r;n++)t+=e[n];return t}function lp(r){return new Float64Array(r)}const ac=lp(4),Nw=lp(8),Fw=lp(12),Bw=lp(16),hr=lp(4);function ig(r,e,t,n,i,o){const s=(e-o)*(t-i),a=(r-i)*(n-o),l=s-a;if(s===0||a===0||s>0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=33306690738754716e-32*u?l:-function(c,d,f,m,g,_,y){let w,M,I,F,C,U,N,G,he,ne,Z,Q,$,se,me,ge,de,fe;const Re=c-g,ke=f-g,Be=d-_,J=m-_;se=Re*J,U=Ki*Re,N=U-(U-Re),G=Re-N,U=Ki*J,he=U-(U-J),ne=J-he,me=G*ne-(se-N*he-G*he-N*ne),ge=Be*ke,U=Ki*Be,N=U-(U-Be),G=Be-N,U=Ki*ke,he=U-(U-ke),ne=ke-he,de=G*ne-(ge-N*he-G*he-N*ne),Z=me-de,C=me-Z,ac[0]=me-(Z+C)+(C-de),Q=se+Z,C=Q-se,$=se-(Q-C)+(Z-C),Z=$-ge,C=$-Z,ac[1]=$-(Z+C)+(C-ge),fe=Q+Z,C=fe-Q,ac[2]=Q-(fe-C)+(Z-C),ac[3]=fe;let te=N2(4,ac),Ae=22204460492503146e-32*y;if(te>=Ae||-te>=Ae||(C=c-Re,w=c-(Re+C)+(C-g),C=f-ke,I=f-(ke+C)+(C-g),C=d-Be,M=d-(Be+C)+(C-_),C=m-J,F=m-(J+C)+(C-_),w===0&&M===0&&I===0&&F===0)||(Ae=11093356479670487e-47*y+33306690738754706e-32*Math.abs(te),te+=Re*F+J*w-(Be*I+ke*M),te>=Ae||-te>=Ae))return te;se=w*J,U=Ki*w,N=U-(U-w),G=w-N,U=Ki*J,he=U-(U-J),ne=J-he,me=G*ne-(se-N*he-G*he-N*ne),ge=M*ke,U=Ki*M,N=U-(U-M),G=M-N,U=Ki*ke,he=U-(U-ke),ne=ke-he,de=G*ne-(ge-N*he-G*he-N*ne),Z=me-de,C=me-Z,hr[0]=me-(Z+C)+(C-de),Q=se+Z,C=Q-se,$=se-(Q-C)+(Z-C),Z=$-ge,C=$-Z,hr[1]=$-(Z+C)+(C-ge),fe=Q+Z,C=fe-Q,hr[2]=Q-(fe-C)+(Z-C),hr[3]=fe;const Ne=b_(4,ac,4,hr,Nw);se=Re*F,U=Ki*Re,N=U-(U-Re),G=Re-N,U=Ki*F,he=U-(U-F),ne=F-he,me=G*ne-(se-N*he-G*he-N*ne),ge=Be*I,U=Ki*Be,N=U-(U-Be),G=Be-N,U=Ki*I,he=U-(U-I),ne=I-he,de=G*ne-(ge-N*he-G*he-N*ne),Z=me-de,C=me-Z,hr[0]=me-(Z+C)+(C-de),Q=se+Z,C=Q-se,$=se-(Q-C)+(Z-C),Z=$-ge,C=$-Z,hr[1]=$-(Z+C)+(C-ge),fe=Q+Z,C=fe-Q,hr[2]=Q-(fe-C)+(Z-C),hr[3]=fe;const Te=b_(Ne,Nw,4,hr,Fw);se=w*F,U=Ki*w,N=U-(U-w),G=w-N,U=Ki*F,he=U-(U-F),ne=F-he,me=G*ne-(se-N*he-G*he-N*ne),ge=M*I,U=Ki*M,N=U-(U-M),G=M-N,U=Ki*I,he=U-(U-I),ne=I-he,de=G*ne-(ge-N*he-G*he-N*ne),Z=me-de,C=me-Z,hr[0]=me-(Z+C)+(C-de),Q=se+Z,C=Q-se,$=se-(Q-C)+(Z-C),Z=$-ge,C=$-Z,hr[1]=$-(Z+C)+(C-ge),fe=Q+Z,C=fe-Q,hr[2]=Q-(fe-C)+(Z-C),hr[3]=fe;const Ge=b_(Te,Fw,4,hr,Bw);return Bw[Ge-1]}(r,e,t,n,i,o,u)}const Uw=Math.pow(2,-52),rg=new Uint32Array(512);class w_{static from(e,t=U2,n=k2){const i=e.length,o=new Float64Array(2*i);for(let s=0;s<i;s++){const a=e[s];o[2*s]=t(a),o[2*s+1]=n(a)}return new w_(o)}constructor(e){const t=e.length>>1;if(t>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:i,_hullHash:o}=this,s=e.length>>1;let a=1/0,l=1/0,u=-1/0,c=-1/0;for(let ne=0;ne<s;ne++){const Z=e[2*ne],Q=e[2*ne+1];Z<a&&(a=Z),Q<l&&(l=Q),Z>u&&(u=Z),Q>c&&(c=Q),this._ids[ne]=ne}const d=(a+u)/2,f=(l+c)/2;let m,g,_,y=1/0;for(let ne=0;ne<s;ne++){const Z=T_(d,f,e[2*ne],e[2*ne+1]);Z<y&&(m=ne,y=Z)}const w=e[2*m],M=e[2*m+1];y=1/0;for(let ne=0;ne<s;ne++){if(ne===m)continue;const Z=T_(w,M,e[2*ne],e[2*ne+1]);Z<y&&Z>0&&(g=ne,y=Z)}let I=e[2*g],F=e[2*g+1],C=1/0;for(let ne=0;ne<s;ne++){if(ne===m||ne===g)continue;const Z=B2(w,M,I,F,e[2*ne],e[2*ne+1]);Z<C&&(_=ne,C=Z)}let U=e[2*_],N=e[2*_+1];if(C===1/0){for(let Q=0;Q<s;Q++)this._dists[Q]=e[2*Q]-e[0]||e[2*Q+1]-e[1];lc(this._ids,this._dists,0,s-1);const ne=new Uint32Array(s);let Z=0;for(let Q=0,$=-1/0;Q<s;Q++){const se=this._ids[Q];this._dists[se]>$&&(ne[Z++]=se,$=this._dists[se])}return this.hull=ne.subarray(0,Z),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(ig(w,M,I,F,U,N)<0){const ne=g,Z=I,Q=F;g=_,I=U,F=N,_=ne,U=Z,N=Q}const G=function(ne,Z,Q,$,se,me){const ge=Q-ne,de=$-Z,fe=se-ne,Re=me-Z,ke=ge*ge+de*de,Be=fe*fe+Re*Re,J=.5/(ge*Re-de*fe);return{x:ne+(Re*ke-de*Be)*J,y:Z+(ge*Be-fe*ke)*J}}(w,M,I,F,U,N);this._cx=G.x,this._cy=G.y;for(let ne=0;ne<s;ne++)this._dists[ne]=T_(e[2*ne],e[2*ne+1],G.x,G.y);lc(this._ids,this._dists,0,s-1),this._hullStart=m;let he=3;n[m]=t[_]=g,n[g]=t[m]=_,n[_]=t[g]=m,i[m]=0,i[g]=1,i[_]=2,o.fill(-1),o[this._hashKey(w,M)]=m,o[this._hashKey(I,F)]=g,o[this._hashKey(U,N)]=_,this.trianglesLen=0,this._addTriangle(m,g,_,-1,-1,-1);for(let ne,Z,Q=0;Q<this._ids.length;Q++){const $=this._ids[Q],se=e[2*$],me=e[2*$+1];if(Q>0&&Math.abs(se-ne)<=Uw&&Math.abs(me-Z)<=Uw||(ne=se,Z=me,$===m||$===g||$===_))continue;let ge=0;for(let Be=0,J=this._hashKey(se,me);Be<this._hashSize&&(ge=o[(J+Be)%this._hashSize],ge===-1||ge===n[ge]);Be++);ge=t[ge];let de,fe=ge;for(;de=n[fe],ig(se,me,e[2*fe],e[2*fe+1],e[2*de],e[2*de+1])>=0;)if(fe=de,fe===ge){fe=-1;break}if(fe===-1)continue;let Re=this._addTriangle(fe,$,n[fe],-1,-1,i[fe]);i[$]=this._legalize(Re+2),i[fe]=Re,he++;let ke=n[fe];for(;de=n[ke],ig(se,me,e[2*ke],e[2*ke+1],e[2*de],e[2*de+1])<0;)Re=this._addTriangle(ke,$,de,i[$],-1,i[ke]),i[$]=this._legalize(Re+2),n[ke]=ke,he--,ke=de;if(fe===ge)for(;de=t[fe],ig(se,me,e[2*de],e[2*de+1],e[2*fe],e[2*fe+1])<0;)Re=this._addTriangle(de,$,fe,-1,i[fe],i[de]),this._legalize(Re+2),i[de]=Re,n[fe]=fe,he--,fe=de;this._hullStart=t[$]=fe,n[fe]=t[ke]=$,n[$]=ke,o[this._hashKey(se,me)]=$,o[this._hashKey(e[2*fe],e[2*fe+1])]=fe}this.hull=new Uint32Array(he);for(let ne=0,Z=this._hullStart;ne<he;ne++)this.hull[ne]=Z,Z=n[Z];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(n,i){const o=n/(Math.abs(n)+Math.abs(i));return(i>0?3-o:1+o)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:i}=this;let o=0,s=0;for(;;){const a=n[e],l=e-e%3;if(s=l+(e+2)%3,a===-1){if(o===0)break;e=rg[--o];continue}const u=a-a%3,c=l+(e+1)%3,d=u+(a+2)%3,f=t[s],m=t[e],g=t[c],_=t[d];if(F2(i[2*f],i[2*f+1],i[2*m],i[2*m+1],i[2*g],i[2*g+1],i[2*_],i[2*_+1])){t[e]=_,t[a]=f;const y=n[d];if(y===-1){let M=this._hullStart;do{if(this._hullTri[M]===d){this._hullTri[M]=e;break}M=this._hullPrev[M]}while(M!==this._hullStart)}this._link(e,y),this._link(a,n[s]),this._link(s,d);const w=u+(a+1)%3;o<rg.length&&(rg[o++]=w)}else{if(o===0)break;e=rg[--o]}}return s}_link(e,t){this._halfedges[e]=t,t!==-1&&(this._halfedges[t]=e)}_addTriangle(e,t,n,i,o,s){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function T_(r,e,t,n){const i=r-t,o=e-n;return i*i+o*o}function F2(r,e,t,n,i,o,s,a){const l=r-s,u=e-a,c=t-s,d=n-a,f=i-s,m=o-a,g=c*c+d*d,_=f*f+m*m;return l*(d*_-g*m)-u*(c*_-g*f)+(l*l+u*u)*(c*m-d*f)<0}function B2(r,e,t,n,i,o){const s=t-r,a=n-e,l=i-r,u=o-e,c=s*s+a*a,d=l*l+u*u,f=.5/(s*u-a*l),m=(u*c-a*d)*f,g=(s*d-l*c)*f;return m*m+g*g}function lc(r,e,t,n){if(n-t<=20)for(let i=t+1;i<=n;i++){const o=r[i],s=e[o];let a=i-1;for(;a>=t&&e[r[a]]>s;)r[a+1]=r[a--];r[a+1]=o}else{let i=t+1,o=n;up(r,t+n>>1,i),e[r[t]]>e[r[n]]&&up(r,t,n),e[r[i]]>e[r[n]]&&up(r,i,n),e[r[t]]>e[r[i]]&&up(r,t,i);const s=r[i],a=e[s];for(;;){do i++;while(e[r[i]]<a);do o--;while(e[r[o]]>a);if(o<i)break;up(r,i,o)}r[t+1]=r[o],r[o]=s,n-i+1>=o-t?(lc(r,e,i,n),lc(r,e,t,o-1)):(lc(r,e,t,o-1),lc(r,e,i,n))}}function up(r,e,t){const n=r[e];r[e]=r[t],r[t]=n}function U2(r){return r[0]}function k2(r){return r[1]}function vs(r,e,t=5){return Math.abs(r-e)<=Math.pow(10,-t)}class Qa{constructor(){this.point={x:0,y:0},this.slope=Math.PI/4}static fromPointSlope(e,t){const n=new Qa;return n.point=e,n.slope=t,n}resolveY(e){return Math.tan(this.slope)*(e-this.point.x)+this.point.y}distanceToLinearEquation(e){return vs(this.slope,e.slope)?this.distanceToPoint(e.point):-1}distanceToPoint(e){let t=0;if(Math.tan(this.slope)*(e.x-this.point.x)+this.point.y===e.y)return 0;t=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;const n=Qa.fromPointSlope(e,t),i=this.crossPoint(n);return i?Math.ceil(Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))):0}crossPoint(e){if(vs(e.slope,this.slope))return null;let t=0,n=0;const i=Math.tan(e.slope),o=Math.tan(this.slope),{x:s,y:a}=this.point,{x:l,y:u}=e.point;return vs(this.slope,Math.PI/2)?(t=this.point.x,n=i*(t-l)+u):vs(e.slope,Math.PI/2)?(t=e.point.x,n=o*(t-s)+a):vs(this.slope,Math.PI)||vs(this.slope,0)?(n=this.point.y,t=(n-u)/i+l):vs(e.slope,Math.PI)||vs(e.slope,0)?(n=e.point.y,t=(n-a)/o+s):(t=(i*l-u+a-o*s)/(i-o),n=o*(t-s)+a),{x:t,y:n}}}function G2(r,e,t){return r.fillType==="solidFill"?function(n,i,o){const s=new ca,[a,l]=function(u){const c=u.substring(1);return[parseInt(c.substring(0,6),16),parseInt(c.substring(6,8),16)/255]}(n.color);return s.beginFill(a,l),s.drawRect(0,0,i,o),s.endFill(),s}(r,e,t):r.fillType==="gradientFill"?function(n,i,o){let s=null;const a=new Mi;if(n.stopList.sort((u,c)=>u.pos-c.pos),!n.stopList.find(u=>u.pos===0)){const u=n.stopList[0];n.stopList.unshift({pos:0,color:u.color})}if(!n.stopList.find(u=>u.pos===1)){const u=n.stopList[n.stopList.length-1];n.stopList.push({pos:1,color:u.color})}const l=u=>{const c=[];for(let d=0,f=u.length;d<f-1;d++){const m=u[d],g=u[d+1],_=m.pos+.5*(g.pos-m.pos),y=Qm(m.color,g.color,.5),w=2*d;c[w]=m,c[w+1]={color:y,pos:_},c[w+2]=g}return c};if(n.stopList=l(n.stopList),n.stopList=l(n.stopList),n.line?s=function(u,c,d){const f=c/2,m=d/2,g={x:-f,y:m},_={x:-f,y:-m},y={x:f,y:m},w={x:f,y:-m},M=Qa.fromPointSlope({x:-f,y:0},Math.PI/2),I=Qa.fromPointSlope({x:0,y:m},0),F=Qa.fromPointSlope({x:f,y:0},Math.PI/2),C=Qa.fromPointSlope({x:0,y:-m},0),U=[g,_,y,w],N=[M,I,F,C],G=[],he=u.stopList.slice(1,u.stopList.length-1).map(me=>{var ge,de;const fe=2*Math.PI;let Re=(de=(ge=u.line)===null||ge===void 0?void 0:ge.ang)!==null&&de!==void 0?de:0;for(;Re>fe;)Re-=fe;for(;Re<0;)Re+=fe;const ke={x:0,y:0};vs(Re,Math.PI/2)?(ke.x=0,ke.y=d/2-me.pos*d):vs(Re,0)?(ke.x=me.pos*c-c/2,ke.y=0):(ke.x=me.pos*c-c/2,ke.y=d/2-me.pos*d),Re>Math.PI/2&&Re<=Math.PI&&(ke.x*=-1),Re>Math.PI&&Re<=2*Math.PI&&(ke.y*=-1);const Be=Qa.fromPointSlope(ke,Math.PI/2-u.line.ang),J=N.map(Ae=>Be.crossPoint(Ae)).filter(Ae=>Ae&&Ae.x<=f&&Ae.x>=-f&&Ae.y<=m&&Ae.y>=-m).map(Ae=>({point:Ae,color:me.color})).sort((Ae,Ne)=>Ne.point.y-Ae.point.y);G.push(...J);let te=Math.abs(J[1].point.x-J[0].point.x)/10;for(let Ae=20;Ae--;){const Ne=Ae%2==0?1:-1,Te=ke.x+Ne*te,Ge=Be.resolveY(Te);Te<=f&&Te>=-f&&Ge<=m&&Ge>=-m&&G.push({point:{x:Te,y:Ge},color:me.color}),te+=te}return Be});let ne=[],Z=[];e:for(let me=0;me<U.length;me++){const ge=U[me];for(let Be=0;Be<he.length-1;Be++){const J=he[Be],te=he[Be+1],Ae=J.distanceToLinearEquation(te),Ne=J.distanceToPoint(ge),Te=te.distanceToPoint(ge);if(Ne<Ae&&Te<Ae){const Ge=u.stopList.slice(1,u.stopList.length-1)[Be],Ye=u.stopList.slice(1,u.stopList.length-1)[Be+1],ve=Qm(Ge.color,Ye.color,Ne/Ae);G.splice(Be+1,0,{point:ge,color:ve});continue e}}const de=he[0],fe=he[he.length-1],Re=de.distanceToPoint(ge),ke=fe.distanceToPoint(ge);Re<=ke?ne.push({point:ge,dis:Re}):Z.push({point:ge,dis:ke})}ne=ne.sort((me,ge)=>ge.dis-me.dis);const Q=ne.map((me,ge)=>{if(ge===0)return{point:me.point,color:u.stopList[0].color};{const de=u.stopList[0].color,fe=u.stopList[1].color;return{point:me.point,color:Qm(de,fe,1-(ne[0].dis===0?1:me.dis/ne[0].dis))}}}).sort((me,ge)=>ge.point.y-me.point.y);Z=Z.sort((me,ge)=>ge.dis-me.dis);const $=Z.map((me,ge)=>{if(ge===0)return{point:me.point,color:u.stopList[u.stopList.length-1].color};{const de=u.stopList[u.stopList.length-2].color,fe=u.stopList[u.stopList.length-1].color;return{point:me.point,color:Qm(de,fe,Z[0].dis===0?0:me.dis/Z[0].dis)}}}).sort((me,ge)=>ge.point.y-me.point.y),se=Q.concat(...G).concat($);for(let me=0;me<se.length;me++)se[me].point.x+=f,se[me].point.y=-se[me].point.y+m;return{points:se,position:{x:0,y:0}}}(n,i,o):n.path&&(s=function(u,c,d){var f;const m=[],g={x:0,y:0};if(((f=u.path)===null||f===void 0?void 0:f.path)==="circle"){const _=c/2,y=d/2,w=Math.sqrt(_*_+y*y);u.stopList.forEach(M=>{if(M.pos===0)m.push({point:{x:0,y:0},color:M.color});else{const I=w*M.pos,F=new Jl;F.absellipse(0,0,I,I,0,2*Math.PI,!1,0),F.getPoints(50).forEach(C=>{m.push({point:{x:C.x,y:C.y},color:M.color})})}g.x=_,g.y=y})}return{points:m,position:g}}(n,i,o)),s){const u=[],c=[],{position:d,points:f}=s,m=w_.from(f,M=>M.point.x,M=>M.point.y);for(let M=0;M<m.triangles.length;M+=3)u.push(f[m.triangles[M]].point.x,f[m.triangles[M]].point.y),u.push(f[m.triangles[M+1]].point.x,f[m.triangles[M+1]].point.y),u.push(f[m.triangles[M+2]].point.x,f[m.triangles[M+2]].point.y),c.push(...$a(f[m.triangles[M]].color)),c.push(...$a(f[m.triangles[M+1]].color)),c.push(...$a(f[m.triangles[M+2]].color));const g=new gu;g.addAttribute("aVertexPosition",u,2),g.addAttribute("aColor",c,4);const _=oa.from(`
|
|
5728
|
+
`,{percent:0})}set percent(e){this.uniforms.percent=e}}class w2 extends Ka{constructor(e){var t;super(e),this.filterType="",this.isConflict=!0,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:o,delta:s})=>{const a=s/o;this.filter&&(this.filter.percent=a),a>=1&&this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let n=0;e.json.transition==="out"?n=-1:e.json.transition==="in"&&(n=1);const i=(t=e.json.filter)===null||t===void 0?void 0:t.match(/^([a-zA-Z]+)(\((.+)\))?/);if(i){const o=i[1],s=i[3];if(o==="wipe"){const a=new x2(n);s==="up"?a.direction=1:s==="down"?a.direction=2:s==="left"?a.direction=3:s==="right"&&(a.direction=4),this.filter=a,this.filterType=`${o}-${s}`}else if(o==="fade"){const a=new b2;this.filter=a,this.filterType=""+o}}}get modifyAttrKey(){return this.filterType}}class T2 extends Ka{constructor(e){super(e),this.isConflict=!0,this.activeWhenConflict="next",this.onTimeUpdate=({duration:t,delta:n})=>{var i;const o=n/t,s=(i=this.path)===null||i===void 0?void 0:i.getPoint(o);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{var t;const n=(t=this.path)===null||t===void 0?void 0:t.getPoint(0);this.timingTarget&&n&&(this.timingTarget.ppt_x=n.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=n.y+this.timingTarget.design_ppt_y)},this.onSeekToEnd=()=>{var t;const n=(t=this.path)===null||t===void 0?void 0:t.getPoint(1);this.timingTarget&&n&&(this.timingTarget.ppt_x=n.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=n.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var e;const t=new Jl,n=(e=this.json.path)===null||e===void 0?void 0:e.match(/[MLCmlc][^MLCmlc]+/g);if(n)for(const i of n){const[o,...s]=i.trim().replace(/\s+/g," ").split(" ");if(o==="M"){const[a,l]=s.map(u=>Number(u));t.moveTo(a,l)}else if(o==="L"){const[a,l]=s.map(u=>Number(u));t.lineTo(a,l)}else if(o==="C"){const[a,l,u,c,d,f]=s.map(m=>Number(m));t.bezierCurveTo(a,l,u,c,d,f)}else if(o==="Z")t.closePath();else if(o==="E")console.warn("not implements");else if(o==="c"){const[a,l,u,c,d,f]=s.map(g=>Number(g)),m=t.currentPoint;t.bezierCurveTo(a+m.x,l+m.y,u+m.x,c+m.y,d+m.x,f+m.y)}else if(o==="l"){const a=t.currentPoint,[l,u]=s.map(c=>Number(c));t.lineTo(l+a.x,u+a.y)}else if(o==="m"){const a=t.currentPoint,[l,u]=s.map(c=>Number(c));t.moveTo(l+a.x,u+a.y)}}this.path=t}}class S2 extends Ka{constructor(e){super(e),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=t=>{t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:n})=>{const i=n/t,o={x:1,y:1};if(this.from&&this.to)o.x=this.from.x+(this.to.x-this.from.x)*i,o.y=this.from.y+(this.to.y-this.from.y)*i;else if(this.by){const s={x:this.by.x,y:this.by.y};o.x=1+(s.x-1)*i,o.y=1+(s.y-1)*i}this.timingTarget&&(this.timingTarget.scale=o)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=e.json.from,this.to=e.json.to,this.by=e.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class E2 extends Ka{constructor(e){super(e),this.isConflict=!1,this.activeWhenConflict="next",this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=t=>{this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to),t.isReverse||this.updateCurrentValue();const[n]=this.json.cBhvr.attrList[0].split(".");gs(this.timingTarget,n+".on","true")},this.onTimeNodeEnd=()=>{if(this.json.cBhvr.ctn.fill==="remove"){const[t]=this.json.cBhvr.attrList[0].split(".");gs(this.timingTarget,t+".on","false")}},this.onSeekToStart=()=>{if(this.timingTarget){const[t]=this.json.cBhvr.attrList[0].split(".");gs(this.timingTarget,t+".on","false")}},this.onTimeNodeStart=()=>{if(this.timingTarget){const t=tg(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.startColorString=t)}},this.onTimeUpdate=({delta:t,duration:n})=>{const i=t/n;this.to.interpolationFrom(this.from,i,this.target),this.timingTarget&&gs(this.timingTarget,this.json.cBhvr.attrList[0],this.target.toHexString())},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1})},this.json.clrSpc==="rgb"?(this.from=new Km(this.json.from),this.to=new Km(this.json.to),this.by=new Km(this.json.by),this.target=new Km):(this.from=new $m(this.json.from),this.to=new $m(this.json.to),this.by=new $m(this.json.by),this.target=new $m),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const e=tg(this.timingTarget,this.json.cBhvr.attrList[0]);e&&(this.currentColorString=e)}}}class M2 extends Ka{constructor(e){super(e),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=t=>{this.lastVal=null,t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:n})=>{const i=n/t;let o=0,s=0;if(this.from!==void 0&&this.to!==void 0){o=this.from,s=this.to;const a=o+(s-o)*i;this.timingTarget&&(this.timingTarget.r=a)}else if(this.by!==void 0){this.lastVal||(this.lastVal=0);const a=this.by*i-this.lastVal;this.lastVal=this.by*i,this.timingTarget&&(this.timingTarget.r+=a)}},this.onTimeNodeStart=()=>{var t;Object(oe.isNumber)((t=this.timingTarget)===null||t===void 0?void 0:t.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&this.startVal!==null&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var e;this.currentVal=(e=this.timingTarget)===null||e===void 0?void 0:e.r}}class A2 extends Ka{constructor(e){super(e),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var t,n;const{cmd:i,cmdType:o}=this.json;!this.isApplied&&i&&o&&(this.isApplied=!0,(n=(t=this.timingTarget)===null||t===void 0?void 0:t.cmd)===null||n===void 0||n.applyCommand(i,o))},this.onSeekToStart=()=>{var t,n;(n=(t=this.timingTarget)===null||t===void 0?void 0:t.cmd)===null||n===void 0||n.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{var t,n;(n=(t=this.timingTarget)===null||t===void 0?void 0:t.cmd)===null||n===void 0||n.applyCommand("custom-pause","call")},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){var e,t,n,i;return((t=(e=this.json)===null||e===void 0?void 0:e.cmd)!==null&&t!==void 0?t:"")+((i=(n=this.json)===null||n===void 0?void 0:n.cmdType)!==null&&i!==void 0?i:"")}}var P2=v(17);class ng{constructor(e){ng.useRtc||(this.howl=new P2.Howl({src:[e]}))}play(){var e;(e=this.howl)===null||e===void 0||e.play()}pause(){var e;(e=this.howl)===null||e===void 0||e.pause()}stop(){var e;(e=this.howl)===null||e===void 0||e.stop()}}ng.useRtc=!1;class C2{constructor(e){this.runtimeNodeEventHub=new k.a,this.stopAudio=()=>{this.audio.stop()};const{json:t,isIterate:n,isSub:i,eventHub:o,ctx:s,parent:a,iterateType:l,iterateIndex:u,iterateId:c}=e;this.json=t,this.id=t.cMediaNode.ctn.id,this.commonTimeNode=new sc({json:t.cMediaNode.ctn,isSub:i,eventHubs:{global:o,runtime:this.runtimeNodeEventHub},ctx:s,parent:a,isIterate:n,iterateType:l,iterateIndex:u,iterateId:c}),this.audio=new ng(t.cMediaNode.tgtEl),this.commonTimeNode.on("timelineStart",()=>{this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.stopAudio)}}var R2=v(7),Lw=v.n(R2);function Ow(){return Date.now().toString(32)+Math.random().toString(32).substring(2)}function x_(r){const e=[],t=r.filter(l=>{const u=l.width<2048&&l.height<2048;return u||e.push(l),u}).map(l=>(l.width+=2,l.height+=2,l)).sort((l,u)=>l.width*l.height-u.width*u.height);let n=t.length+1,i=2050,o=2050;const s=[];let a=null;for(;(i>2048||o>2048)&&t.length>0;)n-=1,a=Lw()(t.slice(0,n)),i=a.width,o=a.height;return a&&s.push(a),e.forEach(l=>{const u=Lw()([l]);s.push(u)}),n<t.length?s.concat(x_(t.slice(n))):s}var I2=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})};class sc extends k.a{constructor(e){super(),this.uuid=Date.now().toString(32)+Math.random().toString(32).substring(2),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId=null,this.iterateShadows=[],this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.timeDelta=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.dispose())},this.handleActive=(m=!0)=>{if(this.isActive=!0,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if(this.json.restart==="never")return;this.json.restart!=="whenNotActive"&&this.json.restart!=="always"||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(m))}else this.startTimeLine(m)},this.updateTimeLine=m=>{const g=m/(At.TARGET_FPMS||.06);this.timeDelta+=g,this.duration-this.timeDelta<=g&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(m=!1)=>{(this.isTimeNodeEnd()||m)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:t,isIterate:n,ctx:i,eventHubs:o,parent:s,json:a,iterateType:l,iterateId:u,iterateIndex:c}=e;this.isSub=t,this.isIterate=n,this.parentTimeNode=s,this.json=a,this.ctx=i,this.iterateIndex=c,this.eventHubs=o,this.iterateType=l,this.iterateId=u;const d=Number(this.json.dur),f=this.json.spd||1;this.isNegativeSpeed=f<0,Number.isNaN(d)||(this.duration=d/Math.abs(f)),this.setPreStyle(),a.childTnLst&&this.createChildren(a.childTnLst),this.startConds=new sp(this.json.id||"",a.stCondLst,o,this.ctx),this.endConds=new sp(this.json.id||"",a.endCondLst,o,this.ctx),a.endSync&&(this.endSync=new sp(this.json.id||"",[a.endSync],o,this.ctx),this.endSync.on("active",()=>{var m;this.json.nodeType==="interactiveSeq"&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),(m=this.endSync)===null||m===void 0||m.reset())})),this.startConds.on("active",m=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(m))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(m=>m.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&this.json.masterRel==="nextClick"&&this.startConds.addCond({event:"shape slide onNext"}),this.json.iterate&&this.isIterate===!1&&this.createIterateShadow()}createIterateShadow(){const e=Ow();let t=!0,n=0;const i=o=>{o===e&&(t=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",i))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",i);t;){const o=JSON.parse(JSON.stringify(this.json)),s=new sc({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:n,iterateId:e});this.iterateShadows[n]=s,n+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(e){this.isReverse=e}createTimeNode(e,t){let n=null;const i={json:e,isSub:t,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId};return e.type==="seq"?n=new f2(i):e.type==="par"?n=new Dw(i):e.type==="set"?n=new g2(i):e.type==="anim"?n=new y2(i):e.type==="animEffect"?n=new w2(i):e.type==="animMotion"?n=new T2(i):e.type==="animScale"?n=new S2(i):e.type==="animClr"?n=new E2(i):e.type==="animRot"?n=new M2(i):e.type==="cmd"?n=new A2(i):e.type==="audio"&&(n=new C2(i)),n}createSubList(e){this.subList=[],e.forEach(t=>{const n=this.createTimeNode(t,!0);n&&this.subList.push(n)})}createChildren(e){e.forEach(t=>{const n=this.createTimeNode(t,!1);n&&(n.commonTimeNode.on("timeNodeStart",i=>{this.emit("childTimeNodeStart",i)}),n.commonTimeNode.on("timeNodeEnd",i=>{this.emit("childTimeNodeEnd",i),this.children.every(o=>o.commonTimeNode.isTimeNodeEnd())&&(this.json.iterate||this.allChildrenEndHandle())}),this.children.push(n))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(e=>e.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.timeDelta=0,this.children.forEach(e=>e.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(e=>e.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.timeDelta=0;const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(mn.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(mn.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(e=!0){if(e&&(this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.onTimeLineEnd()):this.duration>t&&(this.ctx.eventHub.emit(mn.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}setTimeout(e,t){let n=0;const i=o=>{n+=o/(At.TARGET_FPMS||.06),n>=t&&(e(),this.ctx.ticker.remove(i))};return this.ctx.ticker.add(i),()=>{this.ctx.ticker.remove(i)}}tickerDelay(e){return new Promise(t=>{this.setTimeout(()=>{t()},e)})}startIterate(){return I2(this,void 0,void 0,function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const e of this.iterateShadows){if(this.isIterateEnd)return;e.children.forEach(t=>{t.commonTimeNode.startTimeNode()}),e.applyCount+=1,yield this.tickerDelay(this.json.iterate.interval)}this.onTimeLineEnd()}})}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}setPreStyle(){if(!this.json.presetClass)return;const e=[],t=n=>{n.forEach(i=>{var o,s,a;i.cBhvr&&i.cBhvr.target&&e.findIndex(l=>l.id===i.cBhvr.target.id)<0&&e.push(i.cBhvr.target),((s=(o=i==null?void 0:i.cBhvr)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.childTnLst)&&i.cBhvr.ctn.childTnLst.length>0&&t(i.cBhvr.ctn.childTnLst),((a=i==null?void 0:i.ctn)===null||a===void 0?void 0:a.childTnLst)&&i.ctn.childTnLst.length>0&&t(i.ctn.childTnLst)})};t(this.json.childTnLst||[]),e.forEach(n=>{if(this.json.iterate){let i=0,o=!0;for(;o;){const s=this.ctx.timingTargets.getTarget(n,!0,{type:this.json.iterate.type,index:i,id:""});s&&(this.setPreStyleForTarget(s),i+=1),o=!!s}}else{const i=this.ctx.timingTargets.getTarget(n,!1);i&&this.setPreStyleForTarget(i)}})}setPreStyleForTarget(e){e&&this.json.presetSubtype&&(e.presetSubType=this.json.presetSubtype),e&&!e.hasPreset&&(this.json.presetClass==="entr"?(e.hasPreset=!0,e.style.visibility="hidden"):this.json.presetClass==="exit"&&(e.hasPreset=!0,e.style.visibility="visible"))}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(e=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(e);const t=this.json.stCondLst.filter(i=>/^self/.test(i.event||""))[0];t&&this.startConds.condHandle(t);const n=this.json.endCondLst.filter(i=>/^self/.test(i.event||""))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(this.children.length===0||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(e=>e.commonTimeNode.destroy())}seekToStart(e=!0){if(this.isActive=!1,this.dispose(),this.isNegativeSpeed,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(t=>t.seekToStart(e));if(e)for(let t=this.subList.length-1;t>=0;t--){const n=this.subList[t];n==null||n.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const n=this.children[t];n==null||n.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const n=this.children[t];n==null||n.commonTimeNode.seekToStart()}}dispose(e=!1){this.isConflictDispose=e,window.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(mn.animateEnd),this.ctx.ticker.remove(this.updateTimeLine),this.startConds.reset(),this.endConds.reset()}seekToEnd(e,t=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const n=this.json.autoRev||e;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(i=>i.seekToEnd(n,t));this.children.length===0&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(i=>i.commonTimeNode.seekToEnd(n,t)),t&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(i=>i.commonTimeNode.seekToEnd(!1)))}isTimeNodeEnd(){let e=!0;return this.children.length>0&&(e=e&&this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}emitEndEvents(){this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(e=>e.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(e=>e.commonTimeNode.destroy())}}class Dw extends k.a{constructor(e){super(),this.isRunning=!1,this.runtimeNodeEventHub=new k.a;const{json:t,iterateType:n,isIterate:i,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:u,iterateId:c}=e;this.id=t.ctn.id,this.json=t,this.ctx=a,this.isIterate=i,this.globalEventHub=l,this.commonTimeNode=new sc({json:t.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:u,iterateId:c}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(d=>{d.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),d.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(d=>{d.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}class L2{constructor(e,t,n){this.json=e,this.ctx=n;const i=e.timeNodeList.find(o=>o.type==="par"&&o.ctn.nodeType==="tmRoot");i&&(this.tmRoot=new Dw({json:i,isSub:!1,isIterate:!1,eventHub:t,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(o=>{var s,a,l;return((s=o.json)===null||s===void 0?void 0:s.type)==="seq"&&((l=(a=o.json)===null||a===void 0?void 0:a.ctn)===null||l===void 0?void 0:l.nodeType)==="mainSeq"}))}findSeq(e){var t;return(t=this.tmRoot)===null||t===void 0?void 0:t.commonTimeNode.children.find(n=>{var i,o,s;return((i=n.json)===null||i===void 0?void 0:i.type)==="seq"&&((s=(o=n.json)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.id)===e})}start(){var e;this.json.autoPlayMainSeq?setTimeout(()=>{var t;(t=this.mainSeq)===null||t===void 0||t.startAutoPlay()}):(e=this.mainSeq)===null||e===void 0||e.commonTimeNode.startTimeNode()}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var e;(e=this.mainSeq)===null||e===void 0||e.commonTimeNode.collectStartValue()}setMainSeqStep(e,t){var n;e===-1&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),(n=this.mainSeq)===null||n===void 0||n.setCurrentStep(e,t)}destroy(){var e;(e=this.tmRoot)===null||e===void 0||e.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(e){const t=this.findSeq(e);t&&t.commonTimeNode.seekToEnd(!1,!0)}}var O2=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})};class D2 extends __{constructor(e,t,n){super({id:"stage",width:e.width,height:e.height,type:"Container",children:e.children},t,n),this.globalEventHub=new k.a,this.json=e,this.container.visible=!1,this.ctx=t,this.globalEventHub.on("c:prev slide",()=>{this.ctx.eventHub.emit(_s.prev)}),this.globalEventHub.on("c:next slide",()=>{this.ctx.eventHub.emit(_s.next)});const i=new ca;i.drawRect(0,0,e.width,e.height),this.container.addChild(i)}get interactiveContainer(){return this.container}render(){const e=Object.create(null,{render:{get:()=>super.render}});return O2(this,void 0,void 0,function*(){yield e.render.call(this),this.ctx.eventHub.emit("StageRenderEnd")})}createTiming(){this.json.timing&&(this.timing=new L2(this.json.timing,this.globalEventHub,this.ctx))}startTiming(){var e;(e=this.timing)===null||e===void 0||e.start()}setMainSeqApplied(){var e;(e=this.timing)===null||e===void 0||e.setMainSeqApplied()}setMainSeqStep(e,t){var n;(n=this.timing)===null||n===void 0||n.setMainSeqStep(e,t)}collectMainSeqStartValue(){var e;(e=this.timing)===null||e===void 0||e.collectMainSeqStartValue()}hasTiming(){return!!this.timing}destroy(){var e;super.destroy(),this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),this.ctx.fillTexture.destroy(),this.globalEventHub.removeAllListeners(),(e=this.timing)===null||e===void 0||e.destroy()}mainSeqStep(){var e,t;return(t=(e=this.timing)===null||e===void 0?void 0:e.currentMainSeqStep())!==null&&t!==void 0?t:0}mainSeqLength(){var e,t;return(t=(e=this.timing)===null||e===void 0?void 0:e.currentMainSeqLength())!==null&&t!==void 0?t:0}mainSeqHasNextStep(){var e,t;return(t=(e=this.timing)===null||e===void 0?void 0:e.mainSeqHasNextStep())!==null&&t!==void 0&&t}mainSeqHasPrevStep(){var e,t;return(t=(e=this.timing)===null||e===void 0?void 0:e.mainSeqHasPrevStep())!==null&&t!==void 0&&t}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?this.globalEventHub.emit("shape slide onNext"):this.ctx.eventHub.emit(_s.next)}prevStep(){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?this.globalEventHub.emit("shape slide onPrev"):this.ctx.eventHub.emit(_s.prev)}applyInteractiveAction(e){this.globalEventHub.emit(e)}seekInteractiveSeqToEnd(e){var t;(t=this.timing)===null||t===void 0||t.seekInteractiveSeqToEnd(e)}}const Ki=134217729;function b_(r,e,t,n,i){let o,s,a,l,u=e[0],c=n[0],d=0,f=0;c>u==c>-u?(o=u,u=e[++d]):(o=c,c=n[++f]);let m=0;if(d<r&&f<t)for(c>u==c>-u?(s=u+o,a=o-(s-u),u=e[++d]):(s=c+o,a=o-(s-c),c=n[++f]),o=s,a!==0&&(i[m++]=a);d<r&&f<t;)c>u==c>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++d]):(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=n[++f]),o=s,a!==0&&(i[m++]=a);for(;d<r;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++d],o=s,a!==0&&(i[m++]=a);for(;f<t;)s=o+c,l=s-o,a=o-(s-l)+(c-l),c=n[++f],o=s,a!==0&&(i[m++]=a);return o===0&&m!==0||(i[m++]=o),m}function N2(r,e){let t=e[0];for(let n=1;n<r;n++)t+=e[n];return t}function lp(r){return new Float64Array(r)}const ac=lp(4),Nw=lp(8),Fw=lp(12),Bw=lp(16),hr=lp(4);function ig(r,e,t,n,i,o){const s=(e-o)*(t-i),a=(r-i)*(n-o),l=s-a;if(s===0||a===0||s>0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=33306690738754716e-32*u?l:-function(c,d,f,m,g,_,y){let w,M,I,F,R,U,N,G,he,ne,Z,Q,$,se,me,ge,de,fe;const Re=c-g,ke=f-g,Be=d-_,J=m-_;se=Re*J,U=Ki*Re,N=U-(U-Re),G=Re-N,U=Ki*J,he=U-(U-J),ne=J-he,me=G*ne-(se-N*he-G*he-N*ne),ge=Be*ke,U=Ki*Be,N=U-(U-Be),G=Be-N,U=Ki*ke,he=U-(U-ke),ne=ke-he,de=G*ne-(ge-N*he-G*he-N*ne),Z=me-de,R=me-Z,ac[0]=me-(Z+R)+(R-de),Q=se+Z,R=Q-se,$=se-(Q-R)+(Z-R),Z=$-ge,R=$-Z,ac[1]=$-(Z+R)+(R-ge),fe=Q+Z,R=fe-Q,ac[2]=Q-(fe-R)+(Z-R),ac[3]=fe;let te=N2(4,ac),Ae=22204460492503146e-32*y;if(te>=Ae||-te>=Ae||(R=c-Re,w=c-(Re+R)+(R-g),R=f-ke,I=f-(ke+R)+(R-g),R=d-Be,M=d-(Be+R)+(R-_),R=m-J,F=m-(J+R)+(R-_),w===0&&M===0&&I===0&&F===0)||(Ae=11093356479670487e-47*y+33306690738754706e-32*Math.abs(te),te+=Re*F+J*w-(Be*I+ke*M),te>=Ae||-te>=Ae))return te;se=w*J,U=Ki*w,N=U-(U-w),G=w-N,U=Ki*J,he=U-(U-J),ne=J-he,me=G*ne-(se-N*he-G*he-N*ne),ge=M*ke,U=Ki*M,N=U-(U-M),G=M-N,U=Ki*ke,he=U-(U-ke),ne=ke-he,de=G*ne-(ge-N*he-G*he-N*ne),Z=me-de,R=me-Z,hr[0]=me-(Z+R)+(R-de),Q=se+Z,R=Q-se,$=se-(Q-R)+(Z-R),Z=$-ge,R=$-Z,hr[1]=$-(Z+R)+(R-ge),fe=Q+Z,R=fe-Q,hr[2]=Q-(fe-R)+(Z-R),hr[3]=fe;const Ne=b_(4,ac,4,hr,Nw);se=Re*F,U=Ki*Re,N=U-(U-Re),G=Re-N,U=Ki*F,he=U-(U-F),ne=F-he,me=G*ne-(se-N*he-G*he-N*ne),ge=Be*I,U=Ki*Be,N=U-(U-Be),G=Be-N,U=Ki*I,he=U-(U-I),ne=I-he,de=G*ne-(ge-N*he-G*he-N*ne),Z=me-de,R=me-Z,hr[0]=me-(Z+R)+(R-de),Q=se+Z,R=Q-se,$=se-(Q-R)+(Z-R),Z=$-ge,R=$-Z,hr[1]=$-(Z+R)+(R-ge),fe=Q+Z,R=fe-Q,hr[2]=Q-(fe-R)+(Z-R),hr[3]=fe;const Te=b_(Ne,Nw,4,hr,Fw);se=w*F,U=Ki*w,N=U-(U-w),G=w-N,U=Ki*F,he=U-(U-F),ne=F-he,me=G*ne-(se-N*he-G*he-N*ne),ge=M*I,U=Ki*M,N=U-(U-M),G=M-N,U=Ki*I,he=U-(U-I),ne=I-he,de=G*ne-(ge-N*he-G*he-N*ne),Z=me-de,R=me-Z,hr[0]=me-(Z+R)+(R-de),Q=se+Z,R=Q-se,$=se-(Q-R)+(Z-R),Z=$-ge,R=$-Z,hr[1]=$-(Z+R)+(R-ge),fe=Q+Z,R=fe-Q,hr[2]=Q-(fe-R)+(Z-R),hr[3]=fe;const Ge=b_(Te,Fw,4,hr,Bw);return Bw[Ge-1]}(r,e,t,n,i,o,u)}const Uw=Math.pow(2,-52),rg=new Uint32Array(512);class w_{static from(e,t=U2,n=k2){const i=e.length,o=new Float64Array(2*i);for(let s=0;s<i;s++){const a=e[s];o[2*s]=t(a),o[2*s+1]=n(a)}return new w_(o)}constructor(e){const t=e.length>>1;if(t>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:i,_hullHash:o}=this,s=e.length>>1;let a=1/0,l=1/0,u=-1/0,c=-1/0;for(let ne=0;ne<s;ne++){const Z=e[2*ne],Q=e[2*ne+1];Z<a&&(a=Z),Q<l&&(l=Q),Z>u&&(u=Z),Q>c&&(c=Q),this._ids[ne]=ne}const d=(a+u)/2,f=(l+c)/2;let m,g,_,y=1/0;for(let ne=0;ne<s;ne++){const Z=T_(d,f,e[2*ne],e[2*ne+1]);Z<y&&(m=ne,y=Z)}const w=e[2*m],M=e[2*m+1];y=1/0;for(let ne=0;ne<s;ne++){if(ne===m)continue;const Z=T_(w,M,e[2*ne],e[2*ne+1]);Z<y&&Z>0&&(g=ne,y=Z)}let I=e[2*g],F=e[2*g+1],R=1/0;for(let ne=0;ne<s;ne++){if(ne===m||ne===g)continue;const Z=B2(w,M,I,F,e[2*ne],e[2*ne+1]);Z<R&&(_=ne,R=Z)}let U=e[2*_],N=e[2*_+1];if(R===1/0){for(let Q=0;Q<s;Q++)this._dists[Q]=e[2*Q]-e[0]||e[2*Q+1]-e[1];lc(this._ids,this._dists,0,s-1);const ne=new Uint32Array(s);let Z=0;for(let Q=0,$=-1/0;Q<s;Q++){const se=this._ids[Q];this._dists[se]>$&&(ne[Z++]=se,$=this._dists[se])}return this.hull=ne.subarray(0,Z),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(ig(w,M,I,F,U,N)<0){const ne=g,Z=I,Q=F;g=_,I=U,F=N,_=ne,U=Z,N=Q}const G=function(ne,Z,Q,$,se,me){const ge=Q-ne,de=$-Z,fe=se-ne,Re=me-Z,ke=ge*ge+de*de,Be=fe*fe+Re*Re,J=.5/(ge*Re-de*fe);return{x:ne+(Re*ke-de*Be)*J,y:Z+(ge*Be-fe*ke)*J}}(w,M,I,F,U,N);this._cx=G.x,this._cy=G.y;for(let ne=0;ne<s;ne++)this._dists[ne]=T_(e[2*ne],e[2*ne+1],G.x,G.y);lc(this._ids,this._dists,0,s-1),this._hullStart=m;let he=3;n[m]=t[_]=g,n[g]=t[m]=_,n[_]=t[g]=m,i[m]=0,i[g]=1,i[_]=2,o.fill(-1),o[this._hashKey(w,M)]=m,o[this._hashKey(I,F)]=g,o[this._hashKey(U,N)]=_,this.trianglesLen=0,this._addTriangle(m,g,_,-1,-1,-1);for(let ne,Z,Q=0;Q<this._ids.length;Q++){const $=this._ids[Q],se=e[2*$],me=e[2*$+1];if(Q>0&&Math.abs(se-ne)<=Uw&&Math.abs(me-Z)<=Uw||(ne=se,Z=me,$===m||$===g||$===_))continue;let ge=0;for(let Be=0,J=this._hashKey(se,me);Be<this._hashSize&&(ge=o[(J+Be)%this._hashSize],ge===-1||ge===n[ge]);Be++);ge=t[ge];let de,fe=ge;for(;de=n[fe],ig(se,me,e[2*fe],e[2*fe+1],e[2*de],e[2*de+1])>=0;)if(fe=de,fe===ge){fe=-1;break}if(fe===-1)continue;let Re=this._addTriangle(fe,$,n[fe],-1,-1,i[fe]);i[$]=this._legalize(Re+2),i[fe]=Re,he++;let ke=n[fe];for(;de=n[ke],ig(se,me,e[2*ke],e[2*ke+1],e[2*de],e[2*de+1])<0;)Re=this._addTriangle(ke,$,de,i[$],-1,i[ke]),i[$]=this._legalize(Re+2),n[ke]=ke,he--,ke=de;if(fe===ge)for(;de=t[fe],ig(se,me,e[2*de],e[2*de+1],e[2*fe],e[2*fe+1])<0;)Re=this._addTriangle(de,$,fe,-1,i[fe],i[de]),this._legalize(Re+2),i[de]=Re,n[fe]=fe,he--,fe=de;this._hullStart=t[$]=fe,n[fe]=t[ke]=$,n[$]=ke,o[this._hashKey(se,me)]=$,o[this._hashKey(e[2*fe],e[2*fe+1])]=fe}this.hull=new Uint32Array(he);for(let ne=0,Z=this._hullStart;ne<he;ne++)this.hull[ne]=Z,Z=n[Z];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(n,i){const o=n/(Math.abs(n)+Math.abs(i));return(i>0?3-o:1+o)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:i}=this;let o=0,s=0;for(;;){const a=n[e],l=e-e%3;if(s=l+(e+2)%3,a===-1){if(o===0)break;e=rg[--o];continue}const u=a-a%3,c=l+(e+1)%3,d=u+(a+2)%3,f=t[s],m=t[e],g=t[c],_=t[d];if(F2(i[2*f],i[2*f+1],i[2*m],i[2*m+1],i[2*g],i[2*g+1],i[2*_],i[2*_+1])){t[e]=_,t[a]=f;const y=n[d];if(y===-1){let M=this._hullStart;do{if(this._hullTri[M]===d){this._hullTri[M]=e;break}M=this._hullPrev[M]}while(M!==this._hullStart)}this._link(e,y),this._link(a,n[s]),this._link(s,d);const w=u+(a+1)%3;o<rg.length&&(rg[o++]=w)}else{if(o===0)break;e=rg[--o]}}return s}_link(e,t){this._halfedges[e]=t,t!==-1&&(this._halfedges[t]=e)}_addTriangle(e,t,n,i,o,s){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function T_(r,e,t,n){const i=r-t,o=e-n;return i*i+o*o}function F2(r,e,t,n,i,o,s,a){const l=r-s,u=e-a,c=t-s,d=n-a,f=i-s,m=o-a,g=c*c+d*d,_=f*f+m*m;return l*(d*_-g*m)-u*(c*_-g*f)+(l*l+u*u)*(c*m-d*f)<0}function B2(r,e,t,n,i,o){const s=t-r,a=n-e,l=i-r,u=o-e,c=s*s+a*a,d=l*l+u*u,f=.5/(s*u-a*l),m=(u*c-a*d)*f,g=(s*d-l*c)*f;return m*m+g*g}function lc(r,e,t,n){if(n-t<=20)for(let i=t+1;i<=n;i++){const o=r[i],s=e[o];let a=i-1;for(;a>=t&&e[r[a]]>s;)r[a+1]=r[a--];r[a+1]=o}else{let i=t+1,o=n;up(r,t+n>>1,i),e[r[t]]>e[r[n]]&&up(r,t,n),e[r[i]]>e[r[n]]&&up(r,i,n),e[r[t]]>e[r[i]]&&up(r,t,i);const s=r[i],a=e[s];for(;;){do i++;while(e[r[i]]<a);do o--;while(e[r[o]]>a);if(o<i)break;up(r,i,o)}r[t+1]=r[o],r[o]=s,n-i+1>=o-t?(lc(r,e,i,n),lc(r,e,t,o-1)):(lc(r,e,t,o-1),lc(r,e,i,n))}}function up(r,e,t){const n=r[e];r[e]=r[t],r[t]=n}function U2(r){return r[0]}function k2(r){return r[1]}function vs(r,e,t=5){return Math.abs(r-e)<=Math.pow(10,-t)}class Qa{constructor(){this.point={x:0,y:0},this.slope=Math.PI/4}static fromPointSlope(e,t){const n=new Qa;return n.point=e,n.slope=t,n}resolveY(e){return Math.tan(this.slope)*(e-this.point.x)+this.point.y}distanceToLinearEquation(e){return vs(this.slope,e.slope)?this.distanceToPoint(e.point):-1}distanceToPoint(e){let t=0;if(Math.tan(this.slope)*(e.x-this.point.x)+this.point.y===e.y)return 0;t=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;const n=Qa.fromPointSlope(e,t),i=this.crossPoint(n);return i?Math.ceil(Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))):0}crossPoint(e){if(vs(e.slope,this.slope))return null;let t=0,n=0;const i=Math.tan(e.slope),o=Math.tan(this.slope),{x:s,y:a}=this.point,{x:l,y:u}=e.point;return vs(this.slope,Math.PI/2)?(t=this.point.x,n=i*(t-l)+u):vs(e.slope,Math.PI/2)?(t=e.point.x,n=o*(t-s)+a):vs(this.slope,Math.PI)||vs(this.slope,0)?(n=this.point.y,t=(n-u)/i+l):vs(e.slope,Math.PI)||vs(e.slope,0)?(n=e.point.y,t=(n-a)/o+s):(t=(i*l-u+a-o*s)/(i-o),n=o*(t-s)+a),{x:t,y:n}}}function G2(r,e,t){return r.fillType==="solidFill"?function(n,i,o){const s=new ca,[a,l]=function(u){const c=u.substring(1);return[parseInt(c.substring(0,6),16),parseInt(c.substring(6,8),16)/255]}(n.color);return s.beginFill(a,l),s.drawRect(0,0,i,o),s.endFill(),s}(r,e,t):r.fillType==="gradientFill"?function(n,i,o){let s=null;const a=new Mi;if(n.stopList.sort((u,c)=>u.pos-c.pos),!n.stopList.find(u=>u.pos===0)){const u=n.stopList[0];n.stopList.unshift({pos:0,color:u.color})}if(!n.stopList.find(u=>u.pos===1)){const u=n.stopList[n.stopList.length-1];n.stopList.push({pos:1,color:u.color})}const l=u=>{const c=[];for(let d=0,f=u.length;d<f-1;d++){const m=u[d],g=u[d+1],_=m.pos+.5*(g.pos-m.pos),y=Qm(m.color,g.color,.5),w=2*d;c[w]=m,c[w+1]={color:y,pos:_},c[w+2]=g}return c};if(n.stopList=l(n.stopList),n.stopList=l(n.stopList),n.line?s=function(u,c,d){const f=c/2,m=d/2,g={x:-f,y:m},_={x:-f,y:-m},y={x:f,y:m},w={x:f,y:-m},M=Qa.fromPointSlope({x:-f,y:0},Math.PI/2),I=Qa.fromPointSlope({x:0,y:m},0),F=Qa.fromPointSlope({x:f,y:0},Math.PI/2),R=Qa.fromPointSlope({x:0,y:-m},0),U=[g,_,y,w],N=[M,I,F,R],G=[],he=u.stopList.slice(1,u.stopList.length-1).map(me=>{var ge,de;const fe=2*Math.PI;let Re=(de=(ge=u.line)===null||ge===void 0?void 0:ge.ang)!==null&&de!==void 0?de:0;for(;Re>fe;)Re-=fe;for(;Re<0;)Re+=fe;const ke={x:0,y:0};vs(Re,Math.PI/2)?(ke.x=0,ke.y=d/2-me.pos*d):vs(Re,0)?(ke.x=me.pos*c-c/2,ke.y=0):(ke.x=me.pos*c-c/2,ke.y=d/2-me.pos*d),Re>Math.PI/2&&Re<=Math.PI&&(ke.x*=-1),Re>Math.PI&&Re<=2*Math.PI&&(ke.y*=-1);const Be=Qa.fromPointSlope(ke,Math.PI/2-u.line.ang),J=N.map(Ae=>Be.crossPoint(Ae)).filter(Ae=>Ae&&Ae.x<=f&&Ae.x>=-f&&Ae.y<=m&&Ae.y>=-m).map(Ae=>({point:Ae,color:me.color})).sort((Ae,Ne)=>Ne.point.y-Ae.point.y);G.push(...J);let te=Math.abs(J[1].point.x-J[0].point.x)/10;for(let Ae=20;Ae--;){const Ne=Ae%2==0?1:-1,Te=ke.x+Ne*te,Ge=Be.resolveY(Te);Te<=f&&Te>=-f&&Ge<=m&&Ge>=-m&&G.push({point:{x:Te,y:Ge},color:me.color}),te+=te}return Be});let ne=[],Z=[];e:for(let me=0;me<U.length;me++){const ge=U[me];for(let Be=0;Be<he.length-1;Be++){const J=he[Be],te=he[Be+1],Ae=J.distanceToLinearEquation(te),Ne=J.distanceToPoint(ge),Te=te.distanceToPoint(ge);if(Ne<Ae&&Te<Ae){const Ge=u.stopList.slice(1,u.stopList.length-1)[Be],Ye=u.stopList.slice(1,u.stopList.length-1)[Be+1],ve=Qm(Ge.color,Ye.color,Ne/Ae);G.splice(Be+1,0,{point:ge,color:ve});continue e}}const de=he[0],fe=he[he.length-1],Re=de.distanceToPoint(ge),ke=fe.distanceToPoint(ge);Re<=ke?ne.push({point:ge,dis:Re}):Z.push({point:ge,dis:ke})}ne=ne.sort((me,ge)=>ge.dis-me.dis);const Q=ne.map((me,ge)=>{if(ge===0)return{point:me.point,color:u.stopList[0].color};{const de=u.stopList[0].color,fe=u.stopList[1].color;return{point:me.point,color:Qm(de,fe,1-(ne[0].dis===0?1:me.dis/ne[0].dis))}}}).sort((me,ge)=>ge.point.y-me.point.y);Z=Z.sort((me,ge)=>ge.dis-me.dis);const $=Z.map((me,ge)=>{if(ge===0)return{point:me.point,color:u.stopList[u.stopList.length-1].color};{const de=u.stopList[u.stopList.length-2].color,fe=u.stopList[u.stopList.length-1].color;return{point:me.point,color:Qm(de,fe,Z[0].dis===0?0:me.dis/Z[0].dis)}}}).sort((me,ge)=>ge.point.y-me.point.y),se=Q.concat(...G).concat($);for(let me=0;me<se.length;me++)se[me].point.x+=f,se[me].point.y=-se[me].point.y+m;return{points:se,position:{x:0,y:0}}}(n,i,o):n.path&&(s=function(u,c,d){var f;const m=[],g={x:0,y:0};if(((f=u.path)===null||f===void 0?void 0:f.path)==="circle"){const _=c/2,y=d/2,w=Math.sqrt(_*_+y*y);u.stopList.forEach(M=>{if(M.pos===0)m.push({point:{x:0,y:0},color:M.color});else{const I=w*M.pos,F=new Jl;F.absellipse(0,0,I,I,0,2*Math.PI,!1,0),F.getPoints(50).forEach(R=>{m.push({point:{x:R.x,y:R.y},color:M.color})})}g.x=_,g.y=y})}return{points:m,position:g}}(n,i,o)),s){const u=[],c=[],{position:d,points:f}=s,m=w_.from(f,M=>M.point.x,M=>M.point.y);for(let M=0;M<m.triangles.length;M+=3)u.push(f[m.triangles[M]].point.x,f[m.triangles[M]].point.y),u.push(f[m.triangles[M+1]].point.x,f[m.triangles[M+1]].point.y),u.push(f[m.triangles[M+2]].point.x,f[m.triangles[M+2]].point.y),c.push(...$a(f[m.triangles[M]].color)),c.push(...$a(f[m.triangles[M+1]].color)),c.push(...$a(f[m.triangles[M+2]].color));const g=new gu;g.addAttribute("aVertexPosition",u,2),g.addAttribute("aColor",c,4);const _=oa.from(`
|
|
5729
5729
|
precision mediump float;
|
|
5730
5730
|
attribute vec2 aVertexPosition;
|
|
5731
5731
|
attribute vec4 aColor;
|
|
@@ -5799,7 +5799,7 @@ void main(void){
|
|
|
5799
5799
|
vec4 texColor = texture2D(uSampler, vTextureCoord);
|
|
5800
5800
|
gl_FragColor = transform(texColor, arg);
|
|
5801
5801
|
}
|
|
5802
|
-
`),{arg:t})}}class j2{constructor(e,t){this.renderTextures=[],this.textures=Object.create(null),this.fillStyles=[],this.renderer=e,this.spriteTextures=t}addTexture(e,t){this.textures[e]=t}render(e){const{items:t,width:n,height:i}=e,o=new Mi;t.forEach(l=>{if(l.item.blipFillObject)l.item.blipFillObject.position.x+=l.x+1,l.item.blipFillObject.position.y+=l.y+1,o.addChild(l.item.blipFillObject);else{const u=G2(l.item.fill,l.width-2,l.height-2);if(u)u.position.x+=l.x+1,u.position.y+=l.y+1,o.addChild(u);else{const c=new ca;c.drawRect(0,0,l.width-2,l.height-2),o.addChild(c)}}if(l.item.name){const u=new Zm(l.item.name,{fontFamily:"Arial",fontSize:12,fill:16715792,align:"center"});u.position.x=l.x+1,u.position.y=l.y+1,o.addChild(u)}});const s=new ca;s.drawRect(0,0,Math.ceil(n),Math.ceil(i)),o.addChild(s);const a=Gr.create({width:n,height:i});this.renderTextures.push(a),this.renderer.render(o,{renderTexture:a}),o.destroy(!0),t.forEach(l=>{this.textures[l.item.id]=new Nt(a.baseTexture,new nn(l.x+1,l.y+1,l.width-2,l.height-2))})}getTexture(e){return this.textures[e]||this.spriteTextures.getTexture(e)||null}getGifFrames(e){return this.spriteTextures.getGifFrames(e)}addFill(e,t,n,i){const o=JSON.stringify(e)+t+n,s=eg()(o);if(this.textures[s]||this.fillStyles.findIndex(a=>a.id===s)>=0)return s;if(e.fillType!=="blipFill")this.fillStyles.push({fill:e,width:t,height:n,id:s,name:i});else{const a=this.spriteTextures.getTexture(e.src);if(a){const l=new Hn;l.texture=a,e.filters.length>0&&(l.filters=function(u){const c=[];return u.forEach(d=>{["biLevel"].indexOf(d.type)>=0&&c.push(new V2(d.type,d.args[0]))}),c}(e.filters)),this.fillStyles.push({fill:e,width:a.width,height:a.height,id:s,blipFillObject:l})}}return s}pack(){const e=x_(this.fillStyles.filter(t=>!(!t.fill.fillType||t.fill.fillType==="noFill"||t.width===0||t.height===0)||(this.textures[t.id]=null,!1)));for(let t=0,n=e.length;t<n;t++){const i=e[t];this.render(i)}}destroy(){this.textures=Object.create(null),this.fillStyles=[],this.renderTextures.forEach(e=>e.destroy(!0)),this.spriteTextures.destroy()}}function kw(r,e,t){let n,i,o=e,s=t;o===0&&(o=s/1e4),s===0&&(s=o/1e4);const a=r%360;if(a%180==0)n=Math.cos(a*(Math.PI/180))*o,i=0;else if(a%90==0)n=0,i=-Math.sin(a*(Math.PI/180))*s;else{const l=Math.tan(a*Math.PI/180);n=o*s/Math.sqrt(Math.pow(s,2)+Math.pow(o*l,2)),(a>90&&a<270||a<-90&&a>-270)&&(n=-n),i=-l*n}return{x:n,y:i}}function W2(r,e,t,n,i,o,s){const a={x:0,y:0},l=-o,u=kw((i=-i)/Math.PI*180,t,n),c=r.x-u.x,d=r.y-u.y;for(let f=0;f<51;f++){const m=kw((i+f/50*l)/Math.PI*180,t,n);m.x+=c,m.y+=d,f/50==1&&(a.x=m.x,a.y=m.y),m.x=m.x/9525*e.x,m.y=m.y/9525*e.y,s.lineTo(m.x,m.y)}return a}class X2{constructor(e){this.renderTextures=[],this.idTidMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.renderer=e}render(e){const{items:t,width:n,height:i}=e,o=Gr.create({width:n,height:i});this.renderTextures.push(o);const s=new Mi;t.forEach(a=>{const l=new Hn;l.texture=a.item.texture,l.x=a.x,l.y=a.y,s.addChild(l)}),this.renderer.render(s,{renderTexture:o}),s.destroy({texture:!0,baseTexture:!0,children:!0}),t.forEach(a=>{this.textures[a.item.id]={texture:new Nt(o.baseTexture,new nn(a.x,a.y,a.width,a.height)),pivot:a.item.pivot}})}getGraphicsData(e){const t=this.idTidMap[e]||"";return this.textures[t]||null}addGraphics(e,t,n,i,o,s,a,l){const u=l||Ow(),c=eg()(t+((s==null?void 0:s.width)||0).toString()+a);if(this.idTidMap[u]=c,this.graphics.findIndex(d=>d.id===c)<0){const{texture:d,pivot:f}=function(m,g,_,y,w,M=!0){var I,F,C,U,N,G;const he={x:Math.abs(w.x),y:Math.abs(w.y)},ne=window.devicePixelRatio,Z=document.createElement("canvas"),Q=Z.getContext("2d");if(!Q)throw new Error("ctx");Q.lineCap=(y==null?void 0:y.cap)||"butt",Q.lineJoin=(y==null?void 0:y.join)||"miter";let $=0,se=0,me=0,ge=0,de=0,fe="none",Re="none";return M?($=g,se=_,de=0,Re="#ffffff"):(fe="#ffffff",de=(y==null?void 0:y.width)||0,me=.5*((I=y==null?void 0:y.width)!==null&&I!==void 0?I:0),ge=.5*((F=y==null?void 0:y.width)!==null&&F!==void 0?F:0),$=g+((C=y==null?void 0:y.width)!==null&&C!==void 0?C:0),se=_+((U=y==null?void 0:y.width)!==null&&U!==void 0?U:0),he.x+=.5*((N=y==null?void 0:y.width)!==null&&N!==void 0?N:0),he.y+=.5*((G=y==null?void 0:y.width)!==null&&G!==void 0?G:0)),$+=Math.abs(w.x),se+=Math.abs(w.y),me+=Math.abs(w.x),ge+=Math.abs(w.y),me*=ne,ge*=ne,$=Math.ceil($*ne),se=Math.ceil(se*ne),Z.width=$,Z.height=se,Q.transform(ne,0,0,ne,me,ge),m.forEach(ke=>{Q.lineWidth=de,Q.strokeStyle=fe,ke.fill!=="none"&&(Q.fillStyle=Re),Q.beginPath();const{scale:Be}=ke,J=ke.path.trim().split(" ");let te={x:0,y:0};for(let Ae=0;Ae<J.length;Ae+=2){const Ne=J[Ae],Te=J[Ae+1];if(Ne==="M"){let[Ge,Ye]=Te.split(",").map(ve=>Number(ve));te={x:Ge,y:Ye},Ge=Ge/9525*Be.x,Ye=Ye/9525*Be.y,Q.moveTo(Ge,Ye)}else if(Ne==="A"){const[Ge,Ye,ve,Y]=Te.split(",").map(pe=>Number(pe));te=W2(te,Be,Ge,Ye,ve,Y,Q)}else if(Ne==="L"){let[Ge,Ye]=Te.split(",").map(ve=>Number(ve));te={x:Ge,y:Ye},Ge=Ge/9525*Be.x,Ye=Ye/9525*Be.y,Q.lineTo(Ge,Ye)}else if(Ne==="QB"){let[Ge,Ye,ve,Y]=Te.split(",").map(pe=>Number(pe));te={x:ve,y:Y},Ge=Ge/9525*Be.x,Ye=Ye/9525*Be.y,ve=ve/9525*Be.x,Y=Y/9525*Be.y,Q.quadraticCurveTo(Ge,Ye,ve,Y)}else if(Ne==="CB"){let[Ge,Ye,ve,Y,pe,ye]=Te.split(",").map(xe=>Number(xe));te={x:pe,y:ye},Ge=Ge/9525*Be.x,Ye=Ye/9525*Be.y,ve=ve/9525*Be.x,Y=Y/9525*Be.y,pe=pe/9525*Be.x,ye=ye/9525*Be.y,Q.bezierCurveTo(Ge,Ye,ve,Y,pe,ye)}else Ne==="C"&&Q.closePath()}ke.hasStroke&&de>0&&Q.stroke(),ke.fill!=="none"&&M&&Q.fill("nonzero")}),{texture:new Nt(new vn(Z,{width:g,height:_,resolution:ne})),pivot:he}}(e,i,o,s,n,a);this.graphics.push({id:c,texture:d,pivot:f,width:d.width,height:d.height})}return u}pack(){x_(this.graphics).forEach(e=>{this.render(e)}),this.graphics.forEach(e=>{e.texture.destroy(!0)}),this.graphics=[]}destroy(){Object.keys(this.textures).forEach(e=>{var t;(t=this.textures[e])===null||t===void 0||t.texture.destroy()}),this.textures=Object.create(null),this.graphics=[],this.renderTextures.forEach(e=>e.destroy(!0))}}class Y2{constructor(e){this.gifs=Object.create(null),this.textures=Object.create(null),this.spriteSheets=[],this.loader=e}getTexture(e){return this.textures[e]||null}getGifFrames(e){return this.gifs[e]?this.gifs[e].filter(t=>!!t):[]}loadSpriteSheets(e,t,n){return new Promise(i=>{this.loader.reset();for(const o of e)this.loader.add(o,`${t}/${n}/jsonOutput/${o}.json`);this.loader.load(o=>{for(const s of e){const a=o.resources[s].spritesheet;this.spriteSheets.push(a),Object.keys(a.textures).forEach(l=>{const u=l.match(/^(.+)_gif_(\d+)$/);if(u&&u[1]&&u[2]){const c=u[1];this.gifs[c]||(this.gifs[c]=[]);const d=parseInt(u[2],10);this.gifs[c][d]=a.textures[l]}else this.textures[l]=a.textures[l]})}i()})})}destroy(){this.spriteSheets.forEach(e=>e.destroy(!0)),this.loader.destroy()}}class q2{constructor(){this.prevTime=-1,this.times=10,this.dur=0,this.valeList=[],this.value=0,this.calcFps()}calcFps(){requestAnimationFrame(e=>{const t=e-this.prevTime;this.dur+=t,this.times-=1,this.times===0&&(this.valeList.push(1e4/this.dur),this.times=10,this.dur=0,this.valeList.length>10&&(this.value=Math.round(this.valeList.reduce((n,i)=>n+i)/this.valeList.length),this.valeList=[])),this.prevTime=e,this.calcFps()})}}var hp=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})};window.PIXI=B,q.skipHello();const Gw={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip"};class Z2{constructor(e){this.eventHub=e,this.targets=Object.create(null)}addTarget(e,t){this.targets[e]=t}getTargetById(e){return this.targets[e]}getTarget(e,t,n={type:"el",index:0,id:""}){var i,o;let s=this.targets[e.id];return e.type!=="shape"?s:(e.type==="shape"&&e.txEl&&(s=(i=s==null?void 0:s.getTextElement(e.txEl.type,e.txEl.range))!==null&&i!==void 0?i:null),e.type==="shape"&&e.bg&&n.index===0&&(t=!1,s=(o=s==null?void 0:s.getBgElement())!==null&&o!==void 0?o:null,this.eventHub.emit("IterateTimeNodeEnd",n.id)),t&&s?s.getIterateEntry(n.type,n.index,n.id):s)}clearTargets(){this.targets=Object.create(null)}}const _s={prev:"gotoPrev",next:"gotoNext",goto:"gotoSlide"},mn={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",interactiveAnimTrigger:"interactiveAnimTrigger",animateStart:"animateStart",animateEnd:"animateEnd"};class J2 extends k.a{constructor(e={}){super(),this.transactionPlayer=new WE,this.transactionSprite=new Hn,this.isForward=!0,this.dynamicResolution=1,this.drawCall=0,this.fps=new q2,this.width=0,this.height=0,this.currentIndex=0,this.slideCount=0,this.frameList=[],this.runtime={drawCall:0,fps:0},this.handlePrevSlide=()=>hp(this,void 0,void 0,function*(){const i=this.currentIndex-1;i>=1&&(this.isForward=!1,yield this.renderSlide(i))}),this.handleNextSlide=()=>hp(this,void 0,void 0,function*(){const i=this.currentIndex+1;i<=this.slideCount&&(this.isForward=!0,yield this.renderSlide(i))}),this.handleGotoSlide=i=>{i<=this.slideCount&&i>=1&&this.renderSlide(i)},this.config={minFPS:Object(oe.isUndefined)(e.minFPS)?40:e.minFPS,maxFPS:Object(oe.isUndefined)(e.maxFPS)?50:e.maxFPS,resolution:Object(oe.isUndefined)(e.resolution)?window.devicePixelRatio:e.resolution,autoResolution:!Object(oe.isUndefined)(e.autoResolution)&&e.autoResolution,minResolution:Object(oe.isUndefined)(e.minResolution)?1:e.minResolution,autoFPS:!Object(oe.isUndefined)(e.autoFPS)&&e.autoFPS},this.app=new Xd({antialias:!0,autoDensity:!0,backgroundColor:16777215}),this.updateConfig(this.config),this.app.view.style.zIndex="1",this.app.stage.sortableChildren=!0;const t=this.app.renderer,{drawElements:n}=t.gl;t.gl.drawElements=(...i)=>{n.call(t.gl,...i),this.drawCall+=1},this.app.ticker.add(i=>{this.runtime.drawCall=this.drawCall,this.drawCall=0;const o=1e3/(i/(At.TARGET_FPMS||.06));if(this.frameList.push(o),this.frameList.length>50){const s=this.frameList.reduce((a,l)=>a+l)/this.frameList.length;if(this.runtime.fps=Math.floor(s),this.fps.value<this.config.minFPS)this.dynamicResolution=this.app.renderer.resolution-.1,this.dynamicResolution=Math.max(this.config.minResolution,this.dynamicResolution),this.dynamicResolution<=this.config.minResolution&&this.config.autoFPS&&(this.app.ticker.minFPS-=2,this.app.ticker.maxFPS-=2);else if(this.fps.value>1.08*this.config.minFPS&&this.fps.value<=this.config.maxFPS){const a=Math.min(this.app.ticker.minFPS+2,this.config.minFPS),l=Math.min(this.app.ticker.maxFPS+2,this.config.maxFPS);a<=this.config.minFPS&&(this.app.ticker.minFPS=a),l<=this.config.maxFPS&&(this.app.ticker.maxFPS=l),a>=this.config.minFPS&&l>=this.config.maxFPS&&(this.dynamicResolution+=.1,this.dynamicResolution=Math.max(this.config.minResolution,this.dynamicResolution))}this.config.autoResolution&&this.dynamicResolution!==this.app.renderer.resolution&&this.app.ticker.addOnce(()=>{const a=Math.min(this.dynamicResolution,this.config.resolution);this.app.renderer.resolution=a,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.width,this.height)},Mr.HIGH),this.frameList=[]}},null,Mr.LOW)}get view(){return this.app.view}updateConfig(e){Object(oe.isUndefined)(e.minFPS)||(this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),Object(oe.isUndefined)(e.maxFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS),Object(oe.isUndefined)(e.resolution)||(this.config.resolution=e.resolution,this.app.ticker.addOnce(()=>{this.app.renderer.resolution=e.resolution||window.devicePixelRatio,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.width,this.height)},Mr.HIGH)),Object(oe.isUndefined)(e.autoResolution)||(this.config.autoResolution=e.autoResolution),Object(oe.isUndefined)(e.autoFPS)||(this.config.autoFPS=e.autoFPS),Object(oe.isUndefined)(e.minResolution)||(this.config.minResolution=e.minResolution)}setResourceData(e,t){this.taskId=e,this.url=t}setInteractive(e){this.app.stage.interactive=e,this.app.stage.interactiveChildren=e}loadSlide(e){return hp(this,void 0,void 0,function*(){const t=new Y2(this.app.loader),n=new k.a,i={renderer:this.app.renderer,graphicsTexture:new X2(this.app.renderer),fillTexture:new j2(this.app.renderer,t),stageWidth:0,stageHeight:0,ticker:this.app.ticker,timingTargets:new Z2(n),eventHub:n},o=yield(yield fetch(`${this.url}/${this.taskId}/jsonOutput/slide-${e}.json`)).json(),{width:s,height:a,sheets:l}=o;yield t.loadSpriteSheets(l,this.url,this.taskId),i.stageWidth=s,i.stageHeight=a;const u=new D2(o,i,{x:0,y:0});return i.eventHub.on(_s.prev,this.handlePrevSlide),i.eventHub.on(_s.next,this.handleNextSlide),i.eventHub.on(_s.goto,this.handleGotoSlide),this.translateEvent(i.eventHub,[mn.mainSeqStepChange,mn.mainSeqStateChange,mn.hyperlinkTrigger,mn.interactiveAnimTrigger,mn.mainSeqStepStart,mn.mainSeqStepEnd,mn.animateStart,mn.animateEnd]),u.preRender(),i.fillTexture.pack(),i.graphicsTexture.pack(),{stage:u,json:o}})}translateEvent(e,t){t.forEach(n=>{e.on(n,(...i)=>{this.emit(n,...i)})})}renderSlide(e){return hp(this,void 0,void 0,function*(){this.emit(mn.renderStart,e),this.currentIndex=Number(e);const t=yield this.loadSlide(e),{width:n,height:i,slideCount:o}=t.json;let s;this.slideCount=o,this.app.view.style.width=n+"px",this.app.view.style.height=i+"px",this.app.renderer.resize(n,i),this.width=n,this.height=i,this.currentStage&&(t.json.transition&&t.json.transition.type&&(s=this.getBase64(this.currentStage)),this.prevStage=this.currentStage),this.currentStage=t,yield t.stage.render(),t.stage.createTiming(),t.stage.container.visible=!0,t.stage.collectMainSeqStartValue(),this.isForward?t.stage.setMainSeqStep(0,"start"):t.stage.setMainSeqStep(-1,"end");const a=this.getBase64(this.currentStage);t.stage.container.visible=!1,this.app.stage.addChild(t.stage.container),s&&a&&t.json.transition&&t.json.transition.type&&(yield this.playTransaction(s,a,t.json.transition)),this.prevStage&&(this.app.stage.removeChild(this.prevStage.stage.container),this.prevStage.stage.destroy(),this.prevStage=void 0),this.isForward?t.stage.startTiming():t.stage.setMainSeqApplied(),t.stage.container.visible=!0,this.emit(mn.renderEnd,e),this.emit(mn.slideChange,e)})}getBase64(e){const{width:t,height:n}=e.json,i=Gr.create({width:t,height:n});return this.app.renderer.render(e.stage.container,{renderTexture:i}),this.app.renderer.plugins.extract.base64(i,"image/jpeg")}playTransaction(e,t,n){return hp(this,void 0,void 0,function*(){const i=this.app.view.parentElement;if(e&&t&&i&&Gw[n.type]){this.transactionSprite.zIndex=999,this.app.stage.addChild(this.transactionSprite);const o=this.transactionPlayer.renderer.domElement,s=Nt.from(o),a=()=>s.update();this.app.ticker.add(a),this.transactionSprite.texture=s;const{width:l,height:u}=this.currentStage.json;return new Promise(c=>{var d,f;this.transactionPlayer.play({reverse:!this.isForward,prevTextureUrl:e,nextTextureUrl:t,textureWidth:l,textureHeight:u,presetType:Gw[n.type],stageWidth:l,stageHeight:u,duration:(f=(d=this.currentStage)===null||d===void 0?void 0:d.json.transition)===null||f===void 0?void 0:f.dur,delay:0,onTransactionEnd:()=>{c(),this.app.stage.removeChild(this.transactionSprite),this.app.ticker.remove(a)}})})}return Promise.resolve()})}nextStep(){var e;(e=this.currentStage)===null||e===void 0||e.stage.nextStep()}prevStep(){var e;(e=this.currentStage)===null||e===void 0||e.stage.prevStep()}mainSeqLength(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqLength())!==null&&t!==void 0?t:0}mainSeqStep(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqStep())!==null&&t!==void 0?t:0}setMainSeqStep(e,t){var n;(n=this.currentStage)===null||n===void 0||n.stage.setMainSeqStep(e,t)}mainSeqState(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqState())!==null&&t!==void 0?t:null}mainSeqHasNextStep(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqHasNextStep())!==null&&t!==void 0&&t}mainSeqHasPrevStep(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqHasPrevStep())!==null&&t!==void 0&&t}nextTick(e){this.app.ticker.addOnce(()=>{e()},Mr.LOW)}applyInteractiveAction(e){var t;(t=this.currentStage)===null||t===void 0||t.stage.applyInteractiveAction(e)}seekInteractiveSeqToEnd(e){var t;(t=this.currentStage)===null||t===void 0||t.stage.seekInteractiveSeqToEnd(e)}pause(){this.app.ticker.stop()}resume(){this.app.ticker.start()}destroy(){this.prevStage&&this.prevStage.stage.destroy(),this.currentStage&&this.currentStage.stage.destroy()}}var cp,bu=[],Hw="ResizeObserver loop completed with undelivered notifications.";(function(r){r.BORDER_BOX="border-box",r.CONTENT_BOX="content-box",r.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(cp||(cp={}));var S_,wu=function(r){return Object.freeze(r)},$2=function(r,e){this.inlineSize=r,this.blockSize=e,wu(this)},zw=function(){function r(e,t,n,i){return this.x=e,this.y=t,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,wu(this)}return r.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},r.fromRect=function(e){return new r(e.x,e.y,e.width,e.height)},r}(),E_=function(r){return r instanceof SVGElement&&"getBBox"in r},Vw=function(r){if(E_(r)){var e=r.getBBox(),t=e.width,n=e.height;return!t&&!n}var i=r,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||r.getClientRects().length)},jw=function(r){var e,t;if(r instanceof Element)return!0;var n=(t=(e=r)===null||e===void 0?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&r instanceof n.Element)},dp=typeof window!="undefined"?window:{},og=new WeakMap,Ww=/auto|scroll/,K2=/^tb|vertical/,Q2=/msie|trident/i.test(dp.navigator&&dp.navigator.userAgent),ys=function(r){return parseFloat(r||"0")},uc=function(r,e,t){return r===void 0&&(r=0),e===void 0&&(e=0),t===void 0&&(t=!1),new $2((t?e:r)||0,(t?r:e)||0)},Xw=wu({devicePixelContentBoxSize:uc(),borderBoxSize:uc(),contentBoxSize:uc(),contentRect:new zw(0,0,0,0)}),Yw=function(r,e){if(e===void 0&&(e=!1),og.has(r)&&!e)return og.get(r);if(Vw(r))return og.set(r,Xw),Xw;var t=getComputedStyle(r),n=E_(r)&&r.ownerSVGElement&&r.getBBox(),i=!Q2&&t.boxSizing==="border-box",o=K2.test(t.writingMode||""),s=!n&&Ww.test(t.overflowY||""),a=!n&&Ww.test(t.overflowX||""),l=n?0:ys(t.paddingTop),u=n?0:ys(t.paddingRight),c=n?0:ys(t.paddingBottom),d=n?0:ys(t.paddingLeft),f=n?0:ys(t.borderTopWidth),m=n?0:ys(t.borderRightWidth),g=n?0:ys(t.borderBottomWidth),_=d+u,y=l+c,w=(n?0:ys(t.borderLeftWidth))+m,M=f+g,I=a?r.offsetHeight-M-r.clientHeight:0,F=s?r.offsetWidth-w-r.clientWidth:0,C=i?_+w:0,U=i?y+M:0,N=n?n.width:ys(t.width)-C-F,G=n?n.height:ys(t.height)-U-I,he=N+_+F+w,ne=G+y+I+M,Z=wu({devicePixelContentBoxSize:uc(Math.round(N*devicePixelRatio),Math.round(G*devicePixelRatio),o),borderBoxSize:uc(he,ne,o),contentBoxSize:uc(N,G,o),contentRect:new zw(d,l,N,G)});return og.set(r,Z),Z},qw=function(r,e,t){var n=Yw(r,t),i=n.borderBoxSize,o=n.contentBoxSize,s=n.devicePixelContentBoxSize;switch(e){case cp.DEVICE_PIXEL_CONTENT_BOX:return s;case cp.BORDER_BOX:return i;default:return o}},eP=function(r){var e=Yw(r);this.target=r,this.contentRect=e.contentRect,this.borderBoxSize=wu([e.borderBoxSize]),this.contentBoxSize=wu([e.contentBoxSize]),this.devicePixelContentBoxSize=wu([e.devicePixelContentBoxSize])},Zw=function(r){if(Vw(r))return 1/0;for(var e=0,t=r.parentNode;t;)e+=1,t=t.parentNode;return e},tP=function(){var r=1/0,e=[];bu.forEach(function(i){if(i.activeTargets.length!==0){var o=[];i.activeTargets.forEach(function(s){var a=new eP(s.target),l=Zw(s.target);o.push(a),s.lastReportedSize=qw(s.target,s.observedBox),l<r&&(r=l)}),e.push(function(){i.callback.call(i.observer,o,i.observer)}),i.activeTargets.splice(0,i.activeTargets.length)}});for(var t=0,n=e;t<n.length;t++)(0,n[t])();return r},Jw=function(r){bu.forEach(function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach(function(t){t.isActive()&&(Zw(t.target)>r?e.activeTargets.push(t):e.skippedTargets.push(t))})})},nP=function(){var r,e=0;for(Jw(e);bu.some(function(t){return t.activeTargets.length>0});)e=tP(),Jw(e);return bu.some(function(t){return t.skippedTargets.length>0})&&(typeof ErrorEvent=="function"?r=new ErrorEvent("error",{message:Hw}):((r=document.createEvent("Event")).initEvent("error",!1,!1),r.message=Hw),window.dispatchEvent(r)),e>0},$w=[],iP=function(r){if(!S_){var e=0,t=document.createTextNode("");new MutationObserver(function(){return $w.splice(0).forEach(function(n){return n()})}).observe(t,{characterData:!0}),S_=function(){t.textContent=""+(e?e--:e++)}}$w.push(r),S_()},M_=0,rP={attributes:!0,characterData:!0,childList:!0,subtree:!0},Kw=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Qw=function(r){return r===void 0&&(r=0),Date.now()+r},A_=!1,P_=new(function(){function r(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return r.prototype.run=function(e){var t=this;if(e===void 0&&(e=250),!A_){A_=!0;var n,i=Qw(e);n=function(){var o=!1;try{o=nP()}finally{if(A_=!1,e=i-Qw(),!M_)return;o?t.run(1e3):e>0?t.run(e):t.start()}},iP(function(){requestAnimationFrame(n)})}},r.prototype.schedule=function(){this.stop(),this.run()},r.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,rP)};document.body?t():dp.addEventListener("DOMContentLoaded",t)},r.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Kw.forEach(function(t){return dp.addEventListener(t,e.listener,!0)}))},r.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Kw.forEach(function(t){return dp.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},r}()),eT=function(r){!M_&&r>0&&P_.start(),!(M_+=r)&&P_.stop()},oP=function(){function r(e,t){this.target=e,this.observedBox=t||cp.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return r.prototype.isActive=function(){var e,t=qw(this.target,this.observedBox,!0);return e=this.target,E_(e)||function(n){switch(n.tagName){case"INPUT":if(n.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||getComputedStyle(e).display!=="inline"||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},r}(),sP=function(r,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=r,this.callback=e},sg=new WeakMap,tT=function(r,e){for(var t=0;t<r.length;t+=1)if(r[t].target===e)return t;return-1},ag=function(){function r(){}return r.connect=function(e,t){var n=new sP(e,t);sg.set(e,n)},r.observe=function(e,t,n){var i=sg.get(e),o=i.observationTargets.length===0;tT(i.observationTargets,t)<0&&(o&&bu.push(i),i.observationTargets.push(new oP(t,n&&n.box)),eT(1),P_.schedule())},r.unobserve=function(e,t){var n=sg.get(e),i=tT(n.observationTargets,t),o=n.observationTargets.length===1;i>=0&&(o&&bu.splice(bu.indexOf(n),1),n.observationTargets.splice(i,1),eT(-1))},r.disconnect=function(e){var t=this,n=sg.get(e);n.observationTargets.slice().forEach(function(i){return t.unobserve(e,i.target)}),n.activeTargets.splice(0,n.activeTargets.length)},r}(),aP=function(){function r(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ag.connect(this,e)}return r.prototype.observe=function(e,t){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!jw(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ag.observe(this,e,t)},r.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!jw(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ag.unobserve(this,e)},r.prototype.disconnect=function(){ag.disconnect(this)},r.toString=function(){return"function ResizeObserver () { [polyfill code] }"},r}(),lP=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})},uP=function(r,e){var t,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,n=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(r,s)}catch(d){c=[6,d],n=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}},hP=function(){function r(e,t,n,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=n,this.index=e,this.slideIndex=t,this.eventHub=i}return r.prototype.apply=function(){return lP(this,void 0,void 0,function(){var e;return uP(this,function(t){switch(t.label){case 0:this.eventHub.emit("task-start",this),t.label=1;case 1:return t.trys.push([1,3,,4]),this.state="start",[4,this.fn()];case 2:return t.sent(),this.state="end",this.eventHub.emit("task-end",this),[3,4];case 3:return e=t.sent(),this.eventHub.emit("task-error",{task:this,error:e}),[3,4];case 4:return[2]}})})},r}(),cP=function(){function r(){var e=this;this.eventHub=new k.a,this.tasks=[],this.index=0,this.eventHub.on("task-end",function(t){var n,i=e.tasks.findIndex(function(s){return s.index===t.index}),o=i+1;o>=0&&((n=e.tasks[o])===null||n===void 0||n.apply()),i>=0&&(e.tasks.splice(i,1),e.replaceIdleTask())}),this.eventHub.on("task-error",function(t){var n=t.task,i=e.tasks.findIndex(function(o){return o.index===n.index});i>=0&&(e.tasks.splice(i,1),e.replaceIdleTask())})}return r.prototype.replaceIdleTask=function(){for(var e,t=this,n=new Set,i=0,o=this.tasks.length;i<o;i++)this.tasks[i].state==="idle"&&((e=this.tasks[i+1])===null||e===void 0?void 0:e.state)==="idle"&&n.add(i);Array.from(n).forEach(function(s){t.tasks.splice(s,1)})},r.prototype.addTask=function(e,t){var n=new hP(this.index++,t,e,this.eventHub);this.tasks.push(n),this.tasks.sort(function(i,o){return i.index-o.index}),this.replaceIdleTask(),this.tasks.length===1&&n.apply()},r.prototype.hasStartTask=function(){return this.tasks.some(function(e){return e.state==="start"})},r}(),dP=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})},pP=function(r,e){var t,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,n=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(r,s)}catch(d){c=[6,d],n=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}};function fP(r,e){return dP(this,void 0,void 0,function(){var t;return pP(this,function(n){switch(n.label){case 0:t=Date.now(),n.label=1;case 1:return!r()&&Date.now()-t<e?[4,(i=50,new Promise(function(o){return setTimeout(o,i)}))]:[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}var i})})}function hc(r,e){var t=r.__state.conversionName.toString(),n=Math.round(r.r),i=Math.round(r.g),o=Math.round(r.b),s=r.a,a=Math.round(r.h),l=r.s.toFixed(1),u=r.v.toFixed(1);if(e||t==="THREE_CHAR_HEX"||t==="SIX_CHAR_HEX"){for(var c=r.hex.toString(16);c.length<6;)c="0"+c;return"#"+c}return t==="CSS_RGB"?"rgb("+n+","+i+","+o+")":t==="CSS_RGBA"?"rgba("+n+","+i+","+o+","+s+")":t==="HEX"?"0x"+r.hex.toString(16):t==="RGB_ARRAY"?"["+n+","+i+","+o+"]":t==="RGBA_ARRAY"?"["+n+","+i+","+o+","+s+"]":t==="RGB_OBJ"?"{r:"+n+",g:"+i+",b:"+o+"}":t==="RGBA_OBJ"?"{r:"+n+",g:"+i+",b:"+o+",a:"+s+"}":t==="HSV_OBJ"?"{h:"+a+",s:"+l+",v:"+u+"}":t==="HSVA_OBJ"?"{h:"+a+",s:"+l+",v:"+u+",a:"+s+"}":"unknown format"}var nT=Array.prototype.forEach,pp=Array.prototype.slice,Ke={BREAK:{},extend:function(r){return this.each(pp.call(arguments,1),function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(t){this.isUndefined(e[t])||(r[t]=e[t])}.bind(this))},this),r},defaults:function(r){return this.each(pp.call(arguments,1),function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(t){this.isUndefined(r[t])&&(r[t]=e[t])}.bind(this))},this),r},compose:function(){var r=pp.call(arguments);return function(){for(var e=pp.call(arguments),t=r.length-1;t>=0;t--)e=[r[t].apply(this,e)];return e[0]}},each:function(r,e,t){if(r){if(nT&&r.forEach&&r.forEach===nT)r.forEach(e,t);else if(r.length===r.length+0){var n,i=void 0;for(i=0,n=r.length;i<n;i++)if(i in r&&e.call(t,r[i],i)===this.BREAK)return}else for(var o in r)if(e.call(t,r[o],o)===this.BREAK)return}},defer:function(r){setTimeout(r,0)},debounce:function(r,e,t){var n=void 0;return function(){var i=this,o=arguments;function s(){n=null,t||r.apply(i,o)}var a=t||!n;clearTimeout(n),n=setTimeout(s,e),a&&r.apply(i,o)}},toArray:function(r){return r.toArray?r.toArray():pp.call(r)},isUndefined:function(r){return r===void 0},isNull:function(r){return r===null},isNaN:function(r){function e(t){return r.apply(this,arguments)}return e.toString=function(){return r.toString()},e}(function(r){return isNaN(r)}),isArray:Array.isArray||function(r){return r.constructor===Array},isObject:function(r){return r===Object(r)},isNumber:function(r){return r===r+0},isString:function(r){return r===r+""},isBoolean:function(r){return r===!1||r===!0},isFunction:function(r){return r instanceof Function}},mP=[{litmus:Ke.isString,conversions:{THREE_CHAR_HEX:{read:function(r){var e=r.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return e!==null&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:hc},SIX_CHAR_HEX:{read:function(r){var e=r.match(/^#([A-F0-9]{6})$/i);return e!==null&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:hc},CSS_RGB:{read:function(r){var e=r.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return e!==null&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:hc},CSS_RGBA:{read:function(r){var e=r.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return e!==null&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:hc}}},{litmus:Ke.isNumber,conversions:{HEX:{read:function(r){return{space:"HEX",hex:r,conversionName:"HEX"}},write:function(r){return r.hex}}}},{litmus:Ke.isArray,conversions:{RGB_ARRAY:{read:function(r){return r.length===3&&{space:"RGB",r:r[0],g:r[1],b:r[2]}},write:function(r){return[r.r,r.g,r.b]}},RGBA_ARRAY:{read:function(r){return r.length===4&&{space:"RGB",r:r[0],g:r[1],b:r[2],a:r[3]}},write:function(r){return[r.r,r.g,r.b,r.a]}}}},{litmus:Ke.isObject,conversions:{RGBA_OBJ:{read:function(r){return!!(Ke.isNumber(r.r)&&Ke.isNumber(r.g)&&Ke.isNumber(r.b)&&Ke.isNumber(r.a))&&{space:"RGB",r:r.r,g:r.g,b:r.b,a:r.a}},write:function(r){return{r:r.r,g:r.g,b:r.b,a:r.a}}},RGB_OBJ:{read:function(r){return!!(Ke.isNumber(r.r)&&Ke.isNumber(r.g)&&Ke.isNumber(r.b))&&{space:"RGB",r:r.r,g:r.g,b:r.b}},write:function(r){return{r:r.r,g:r.g,b:r.b}}},HSVA_OBJ:{read:function(r){return!!(Ke.isNumber(r.h)&&Ke.isNumber(r.s)&&Ke.isNumber(r.v)&&Ke.isNumber(r.a))&&{space:"HSV",h:r.h,s:r.s,v:r.v,a:r.a}},write:function(r){return{h:r.h,s:r.s,v:r.v,a:r.a}}},HSV_OBJ:{read:function(r){return!!(Ke.isNumber(r.h)&&Ke.isNumber(r.s)&&Ke.isNumber(r.v))&&{space:"HSV",h:r.h,s:r.s,v:r.v}},write:function(r){return{h:r.h,s:r.s,v:r.v}}}}}],fp=void 0,lg=void 0,C_=function(){lg=!1;var r=arguments.length>1?Ke.toArray(arguments):arguments[0];return Ke.each(mP,function(e){if(e.litmus(r))return Ke.each(e.conversions,function(t,n){if(fp=t.read(r),lg===!1&&fp!==!1)return lg=fp,fp.conversionName=n,fp.conversion=t,Ke.BREAK}),Ke.BREAK}),lg},iT=void 0,ug={hsv_to_rgb:function(r,e,t){var n=Math.floor(r/60)%6,i=r/60-Math.floor(r/60),o=t*(1-e),s=t*(1-i*e),a=t*(1-(1-i)*e),l=[[t,a,o],[s,t,o],[o,t,a],[o,s,t],[a,o,t],[t,o,s]][n];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(r,e,t){var n=Math.min(r,e,t),i=Math.max(r,e,t),o=i-n,s=void 0;return i===0?{h:NaN,s:0,v:0}:(s=r===i?(e-t)/o:e===i?2+(t-r)/o:4+(r-e)/o,(s/=6)<0&&(s+=1),{h:360*s,s:o/i,v:i/255})},rgb_to_hex:function(r,e,t){var n=this.hex_with_component(0,2,r);return n=this.hex_with_component(n,1,e),n=this.hex_with_component(n,0,t)},component_from_hex:function(r,e){return r>>8*e&255},hex_with_component:function(r,e,t){return t<<(iT=8*e)|r&~(255<<iT)}},gP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},No=function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")},Fo=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),el=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:r(o,t,n)}if("value"in i)return i.value;var s=i.get;return s!==void 0?s.call(n):void 0},tl=function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)},nl=function(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||typeof e!="object"&&typeof e!="function"?r:e},Ni=function(){function r(){if(No(this,r),this.__state=C_.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return Fo(r,[{key:"toString",value:function(){return hc(this)}},{key:"toHexString",value:function(){return hc(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),r}();function R_(r,e,t){Object.defineProperty(r,e,{get:function(){return this.__state.space==="RGB"||Ni.recalculateRGB(this,e,t),this.__state[e]},set:function(n){this.__state.space!=="RGB"&&(Ni.recalculateRGB(this,e,t),this.__state.space="RGB"),this.__state[e]=n}})}function I_(r,e){Object.defineProperty(r,e,{get:function(){return this.__state.space==="HSV"||Ni.recalculateHSV(this),this.__state[e]},set:function(t){this.__state.space!=="HSV"&&(Ni.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}Ni.recalculateRGB=function(r,e,t){if(r.__state.space==="HEX")r.__state[e]=ug.component_from_hex(r.__state.hex,t);else{if(r.__state.space!=="HSV")throw new Error("Corrupted color state");Ke.extend(r.__state,ug.hsv_to_rgb(r.__state.h,r.__state.s,r.__state.v))}},Ni.recalculateHSV=function(r){var e=ug.rgb_to_hsv(r.r,r.g,r.b);Ke.extend(r.__state,{s:e.s,v:e.v}),Ke.isNaN(e.h)?Ke.isUndefined(r.__state.h)&&(r.__state.h=0):r.__state.h=e.h},Ni.COMPONENTS=["r","g","b","h","s","v","hex","a"],R_(Ni.prototype,"r",2),R_(Ni.prototype,"g",1),R_(Ni.prototype,"b",0),I_(Ni.prototype,"h"),I_(Ni.prototype,"s"),I_(Ni.prototype,"v"),Object.defineProperty(Ni.prototype,"a",{get:function(){return this.__state.a},set:function(r){this.__state.a=r}}),Object.defineProperty(Ni.prototype,"hex",{get:function(){return this.__state.space!=="HEX"&&(this.__state.hex=ug.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(r){this.__state.space="HEX",this.__state.hex=r}});var Tu=function(){function r(e,t){No(this,r),this.initialValue=e[t],this.domElement=document.createElement("div"),this.object=e,this.property=t,this.__onChange=void 0,this.__onFinishChange=void 0}return Fo(r,[{key:"onChange",value:function(e){return this.__onChange=e,this}},{key:"onFinishChange",value:function(e){return this.__onFinishChange=e,this}},{key:"setValue",value:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),r}(),rT={};Ke.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},function(r,e){Ke.each(r,function(t){rT[t]=e})});var vP=/(\d+(\.\d+)?)px/;function xs(r){if(r==="0"||Ke.isUndefined(r))return 0;var e=r.match(vP);return Ke.isNull(e)?0:parseFloat(e[1])}var Pe={makeSelectable:function(r,e){r!==void 0&&r.style!==void 0&&(r.onselectstart=e?function(){return!1}:function(){},r.style.MozUserSelect=e?"auto":"none",r.style.KhtmlUserSelect=e?"auto":"none",r.unselectable=e?"on":"off")},makeFullscreen:function(r,e,t){var n=t,i=e;Ke.isUndefined(i)&&(i=!0),Ke.isUndefined(n)&&(n=!0),r.style.position="absolute",i&&(r.style.left=0,r.style.right=0),n&&(r.style.top=0,r.style.bottom=0)},fakeEvent:function(r,e,t,n){var i=t||{},o=rT[e];if(!o)throw new Error("Event type "+e+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=i.x||i.clientX||0,l=i.y||i.clientY||0;s.initMouseEvent(e,i.bubbles||!1,i.cancelable||!0,window,i.clickCount||1,0,0,a,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var u=s.initKeyboardEvent||s.initKeyEvent;Ke.defaults(i,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),u(e,i.bubbles||!1,i.cancelable,window,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.keyCode,i.charCode);break;default:s.initEvent(e,i.bubbles||!1,i.cancelable||!0)}Ke.defaults(s,n),r.dispatchEvent(s)},bind:function(r,e,t,n){var i=n||!1;return r.addEventListener?r.addEventListener(e,t,i):r.attachEvent&&r.attachEvent("on"+e,t),Pe},unbind:function(r,e,t,n){var i=n||!1;return r.removeEventListener?r.removeEventListener(e,t,i):r.detachEvent&&r.detachEvent("on"+e,t),Pe},addClass:function(r,e){if(r.className===void 0)r.className=e;else if(r.className!==e){var t=r.className.split(/ +/);t.indexOf(e)===-1&&(t.push(e),r.className=t.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return Pe},removeClass:function(r,e){if(e)if(r.className===e)r.removeAttribute("class");else{var t=r.className.split(/ +/),n=t.indexOf(e);n!==-1&&(t.splice(n,1),r.className=t.join(" "))}else r.className=void 0;return Pe},hasClass:function(r,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(r.className)||!1},getWidth:function(r){var e=getComputedStyle(r);return xs(e["border-left-width"])+xs(e["border-right-width"])+xs(e["padding-left"])+xs(e["padding-right"])+xs(e.width)},getHeight:function(r){var e=getComputedStyle(r);return xs(e["border-top-width"])+xs(e["border-bottom-width"])+xs(e["padding-top"])+xs(e["padding-bottom"])+xs(e.height)},getOffset:function(r){var e=r,t={left:0,top:0};if(e.offsetParent)do t.left+=e.offsetLeft,t.top+=e.offsetTop,e=e.offsetParent;while(e);return t},isActive:function(r){return r===document.activeElement&&(r.type||r.href)}},oT=function(r){function e(t,n){No(this,e);var i=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i;return i.__prev=i.getValue(),i.__checkbox=document.createElement("input"),i.__checkbox.setAttribute("type","checkbox"),Pe.bind(i.__checkbox,"change",function(){o.setValue(!o.__prev)},!1),i.domElement.appendChild(i.__checkbox),i.updateDisplay(),i}return tl(e,r),Fo(e,[{key:"setValue",value:function(t){var n=el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(Tu),_P=function(r){function e(t,n,i){No(this,e);var o=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),s=i,a=o;if(o.__select=document.createElement("select"),Ke.isArray(s)){var l={};Ke.each(s,function(u){l[u]=u}),s=l}return Ke.each(s,function(u,c){var d=document.createElement("option");d.innerHTML=c,d.setAttribute("value",u),a.__select.appendChild(d)}),o.updateDisplay(),Pe.bind(o.__select,"change",function(){var u=this.options[this.selectedIndex].value;a.setValue(u)}),o.domElement.appendChild(o.__select),o}return tl(e,r),Fo(e,[{key:"setValue",value:function(t){var n=el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return Pe.isActive(this.__select)?this:(this.__select.value=this.getValue(),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e}(Tu),yP=function(r){function e(t,n){No(this,e);var i=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i;function s(){o.setValue(o.__input.value)}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),Pe.bind(i.__input,"keyup",s),Pe.bind(i.__input,"change",s),Pe.bind(i.__input,"blur",function(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}),Pe.bind(i.__input,"keydown",function(a){a.keyCode===13&&this.blur()}),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return tl(e,r),Fo(e,[{key:"updateDisplay",value:function(){return Pe.isActive(this.__input)||(this.__input.value=this.getValue()),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(Tu);function sT(r){var e=r.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var aT=function(r){function e(t,n,i){No(this,e);var o=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),s=i||{};return o.__min=s.min,o.__max=s.max,o.__step=s.step,Ke.isUndefined(o.__step)?o.initialValue===0?o.__impliedStep=1:o.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(o.initialValue))/Math.LN10))/10:o.__impliedStep=o.__step,o.__precision=sT(o.__impliedStep),o}return tl(e,r),Fo(e,[{key:"setValue",value:function(t){var n=t;return this.__min!==void 0&&n<this.__min?n=this.__min:this.__max!==void 0&&n>this.__max&&(n=this.__max),this.__step!==void 0&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(t){return this.__min=t,this}},{key:"max",value:function(t){return this.__max=t,this}},{key:"step",value:function(t){return this.__step=t,this.__impliedStep=t,this.__precision=sT(t),this}}]),e}(Tu),hg=function(r){function e(t,n,i){No(this,e);var o=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));o.__truncationSuspended=!1;var s=o,a=void 0;function l(){s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function u(d){var f=a-d.clientY;s.setValue(s.getValue()+f*s.__impliedStep),a=d.clientY}function c(){Pe.unbind(window,"mousemove",u),Pe.unbind(window,"mouseup",c),l()}return o.__input=document.createElement("input"),o.__input.setAttribute("type","text"),Pe.bind(o.__input,"change",function(){var d=parseFloat(s.__input.value);Ke.isNaN(d)||s.setValue(d)}),Pe.bind(o.__input,"blur",function(){l()}),Pe.bind(o.__input,"mousedown",function(d){Pe.bind(window,"mousemove",u),Pe.bind(window,"mouseup",c),a=d.clientY}),Pe.bind(o.__input,"keydown",function(d){d.keyCode===13&&(s.__truncationSuspended=!0,this.blur(),s.__truncationSuspended=!1,l())}),o.updateDisplay(),o.domElement.appendChild(o.__input),o}return tl(e,r),Fo(e,[{key:"updateDisplay",value:function(){var t,n,i;return this.__input.value=this.__truncationSuspended?this.getValue():(t=this.getValue(),n=this.__precision,i=Math.pow(10,n),Math.round(t*i)/i),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(aT);function lT(r,e,t,n,i){return n+(r-e)/(t-e)*(i-n)}var L_=function(r){function e(t,n,i,o,s){No(this,e);var a=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,{min:i,max:o,step:s})),l=a;function u(m){m.preventDefault();var g=l.__background.getBoundingClientRect();return l.setValue(lT(m.clientX,g.left,g.right,l.__min,l.__max)),!1}function c(){Pe.unbind(window,"mousemove",u),Pe.unbind(window,"mouseup",c),l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}function d(m){var g=m.touches[0].clientX,_=l.__background.getBoundingClientRect();l.setValue(lT(g,_.left,_.right,l.__min,l.__max))}function f(){Pe.unbind(window,"touchmove",d),Pe.unbind(window,"touchend",f),l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),Pe.bind(a.__background,"mousedown",function(m){document.activeElement.blur(),Pe.bind(window,"mousemove",u),Pe.bind(window,"mouseup",c),u(m)}),Pe.bind(a.__background,"touchstart",function(m){m.touches.length===1&&(Pe.bind(window,"touchmove",d),Pe.bind(window,"touchend",f),d(m))}),Pe.addClass(a.__background,"slider"),Pe.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return tl(e,r),Fo(e,[{key:"updateDisplay",value:function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(aT),uT=function(r){function e(t,n,i){No(this,e);var o=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),s=o;return o.__button=document.createElement("div"),o.__button.innerHTML=i===void 0?"Fire":i,Pe.bind(o.__button,"click",function(a){return a.preventDefault(),s.fire(),!1}),Pe.addClass(o.__button,"button"),o.domElement.appendChild(o.__button),o}return tl(e,r),Fo(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e}(Tu),O_=function(r){function e(t,n){No(this,e);var i=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));i.__color=new Ni(i.getValue()),i.__temp=new Ni(0);var o=i;i.domElement=document.createElement("div"),Pe.makeSelectable(i.domElement,!1),i.__selector=document.createElement("div"),i.__selector.className="selector",i.__saturation_field=document.createElement("div"),i.__saturation_field.className="saturation-field",i.__field_knob=document.createElement("div"),i.__field_knob.className="field-knob",i.__field_knob_border="2px solid ",i.__hue_knob=document.createElement("div"),i.__hue_knob.className="hue-knob",i.__hue_field=document.createElement("div"),i.__hue_field.className="hue-field",i.__input=document.createElement("input"),i.__input.type="text",i.__input_textShadow="0 1px 1px ",Pe.bind(i.__input,"keydown",function(y){y.keyCode===13&&f.call(this)}),Pe.bind(i.__input,"blur",f),Pe.bind(i.__selector,"mousedown",function(){Pe.addClass(this,"drag").bind(window,"mouseup",function(){Pe.removeClass(o.__selector,"drag")})}),Pe.bind(i.__selector,"touchstart",function(){Pe.addClass(this,"drag").bind(window,"touchend",function(){Pe.removeClass(o.__selector,"drag")})});var s,a=document.createElement("div");function l(y){g(y),Pe.bind(window,"mousemove",g),Pe.bind(window,"touchmove",g),Pe.bind(window,"mouseup",c),Pe.bind(window,"touchend",c)}function u(y){_(y),Pe.bind(window,"mousemove",_),Pe.bind(window,"touchmove",_),Pe.bind(window,"mouseup",d),Pe.bind(window,"touchend",d)}function c(){Pe.unbind(window,"mousemove",g),Pe.unbind(window,"touchmove",g),Pe.unbind(window,"mouseup",c),Pe.unbind(window,"touchend",c),m()}function d(){Pe.unbind(window,"mousemove",_),Pe.unbind(window,"touchmove",_),Pe.unbind(window,"mouseup",d),Pe.unbind(window,"touchend",d),m()}function f(){var y=C_(this.value);y!==!1?(o.__color.__state=y,o.setValue(o.__color.toOriginal())):this.value=o.__color.toString()}function m(){o.__onFinishChange&&o.__onFinishChange.call(o,o.__color.toOriginal())}function g(y){y.type.indexOf("touch")===-1&&y.preventDefault();var w=o.__saturation_field.getBoundingClientRect(),M=y.touches&&y.touches[0]||y,I=M.clientX,F=M.clientY,C=(I-w.left)/(w.right-w.left),U=1-(F-w.top)/(w.bottom-w.top);return U>1?U=1:U<0&&(U=0),C>1?C=1:C<0&&(C=0),o.__color.v=U,o.__color.s=C,o.setValue(o.__color.toOriginal()),!1}function _(y){y.type.indexOf("touch")===-1&&y.preventDefault();var w=o.__hue_field.getBoundingClientRect(),M=1-((y.touches&&y.touches[0]||y).clientY-w.top)/(w.bottom-w.top);return M>1?M=1:M<0&&(M=0),o.__color.h=360*M,o.setValue(o.__color.toOriginal()),!1}return Ke.extend(i.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),Ke.extend(i.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:i.__field_knob_border+(i.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),Ke.extend(i.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),Ke.extend(i.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),Ke.extend(a.style,{width:"100%",height:"100%",background:"none"}),hT(a,"top","rgba(0,0,0,0)","#000"),Ke.extend(i.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(s=i.__hue_field).style.background="",s.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",s.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",Ke.extend(i.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:i.__input_textShadow+"rgba(0,0,0,0.7)"}),Pe.bind(i.__saturation_field,"mousedown",l),Pe.bind(i.__saturation_field,"touchstart",l),Pe.bind(i.__field_knob,"mousedown",l),Pe.bind(i.__field_knob,"touchstart",l),Pe.bind(i.__hue_field,"mousedown",u),Pe.bind(i.__hue_field,"touchstart",u),i.__saturation_field.appendChild(a),i.__selector.appendChild(i.__field_knob),i.__selector.appendChild(i.__saturation_field),i.__selector.appendChild(i.__hue_field),i.__hue_field.appendChild(i.__hue_knob),i.domElement.appendChild(i.__input),i.domElement.appendChild(i.__selector),i.updateDisplay(),i}return tl(e,r),Fo(e,[{key:"updateDisplay",value:function(){var t=C_(this.getValue());if(t!==!1){var n=!1;Ke.each(Ni.COMPONENTS,function(s){if(!Ke.isUndefined(t[s])&&!Ke.isUndefined(this.__color.__state[s])&&t[s]!==this.__color.__state[s])return n=!0,{}},this),n&&Ke.extend(this.__color.__state,t)}Ke.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var i=this.__color.v<.5||this.__color.s>.5?255:0,o=255-i;Ke.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+i+","+i+","+i+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,hT(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),Ke.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+i+","+i+","+i+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})}}]),e}(Tu),xP=["-moz-","-o-","-webkit-","-ms-",""];function hT(r,e,t,n){r.style.background="",Ke.each(xP,function(i){r.style.cssText+="background: "+i+"linear-gradient("+e+", "+t+" 0%, "+n+" 100%); "})}var bP=function(r,e){var t=e||document,n=document.createElement("style");n.type="text/css",n.innerHTML=r;var i=t.getElementsByTagName("head")[0];try{i.appendChild(n)}catch{}},wP=`<div id="dg-save" class="dg dialogue">
|
|
5802
|
+
`),{arg:t})}}class j2{constructor(e,t){this.renderTextures=[],this.textures=Object.create(null),this.fillStyles=[],this.renderer=e,this.spriteTextures=t}addTexture(e,t){this.textures[e]=t}render(e){const{items:t,width:n,height:i}=e,o=new Mi;t.forEach(l=>{if(l.item.blipFillObject)l.item.blipFillObject.position.x+=l.x+1,l.item.blipFillObject.position.y+=l.y+1,o.addChild(l.item.blipFillObject);else{const u=G2(l.item.fill,l.width-2,l.height-2);if(u)u.position.x+=l.x+1,u.position.y+=l.y+1,o.addChild(u);else{const c=new ca;c.drawRect(0,0,l.width-2,l.height-2),o.addChild(c)}}if(l.item.name){const u=new Zm(l.item.name,{fontFamily:"Arial",fontSize:12,fill:16715792,align:"center"});u.position.x=l.x+1,u.position.y=l.y+1,o.addChild(u)}});const s=new ca;s.drawRect(0,0,Math.ceil(n),Math.ceil(i)),o.addChild(s);const a=Gr.create({width:n,height:i});this.renderTextures.push(a),this.renderer.render(o,{renderTexture:a}),o.destroy(!0),t.forEach(l=>{this.textures[l.item.id]=new Nt(a.baseTexture,new nn(l.x+1,l.y+1,l.width-2,l.height-2))})}getTexture(e){return this.textures[e]||this.spriteTextures.getTexture(e)||null}getGifFrames(e){return this.spriteTextures.getGifFrames(e)}addFill(e,t,n,i){const o=JSON.stringify(e)+t+n,s=eg()(o);if(this.textures[s]||this.fillStyles.findIndex(a=>a.id===s)>=0)return s;if(e.fillType!=="blipFill")this.fillStyles.push({fill:e,width:t,height:n,id:s,name:i});else{const a=this.spriteTextures.getTexture(e.src);if(a){const l=new Hn;l.texture=a,e.filters.length>0&&(l.filters=function(u){const c=[];return u.forEach(d=>{["biLevel"].indexOf(d.type)>=0&&c.push(new V2(d.type,d.args[0]))}),c}(e.filters)),this.fillStyles.push({fill:e,width:a.width,height:a.height,id:s,blipFillObject:l})}}return s}pack(){const e=x_(this.fillStyles.filter(t=>!(!t.fill.fillType||t.fill.fillType==="noFill"||t.width===0||t.height===0)||(this.textures[t.id]=null,!1)));for(let t=0,n=e.length;t<n;t++){const i=e[t];this.render(i)}}destroy(){this.textures=Object.create(null),this.fillStyles=[],this.renderTextures.forEach(e=>e.destroy(!0)),this.spriteTextures.destroy()}}function kw(r,e,t){let n,i,o=e,s=t;o===0&&(o=s/1e4),s===0&&(s=o/1e4);const a=r%360;if(a%180==0)n=Math.cos(a*(Math.PI/180))*o,i=0;else if(a%90==0)n=0,i=-Math.sin(a*(Math.PI/180))*s;else{const l=Math.tan(a*Math.PI/180);n=o*s/Math.sqrt(Math.pow(s,2)+Math.pow(o*l,2)),(a>90&&a<270||a<-90&&a>-270)&&(n=-n),i=-l*n}return{x:n,y:i}}function W2(r,e,t,n,i,o,s){const a={x:0,y:0},l=-o,u=kw((i=-i)/Math.PI*180,t,n),c=r.x-u.x,d=r.y-u.y;for(let f=0;f<51;f++){const m=kw((i+f/50*l)/Math.PI*180,t,n);m.x+=c,m.y+=d,f/50==1&&(a.x=m.x,a.y=m.y),m.x=m.x/9525*e.x,m.y=m.y/9525*e.y,s.lineTo(m.x,m.y)}return a}class X2{constructor(e){this.renderTextures=[],this.idTidMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.renderer=e}render(e){const{items:t,width:n,height:i}=e,o=Gr.create({width:n,height:i});this.renderTextures.push(o);const s=new Mi;t.forEach(a=>{const l=new Hn;l.texture=a.item.texture,l.x=a.x,l.y=a.y,s.addChild(l)}),this.renderer.render(s,{renderTexture:o}),s.destroy({texture:!0,baseTexture:!0,children:!0}),t.forEach(a=>{this.textures[a.item.id]={texture:new Nt(o.baseTexture,new nn(a.x,a.y,a.width,a.height)),pivot:a.item.pivot}})}getGraphicsData(e){const t=this.idTidMap[e]||"";return this.textures[t]||null}addGraphics(e,t,n,i,o,s,a,l){const u=l||Ow(),c=eg()(t+((s==null?void 0:s.width)||0).toString()+a);if(this.idTidMap[u]=c,this.graphics.findIndex(d=>d.id===c)<0){const{texture:d,pivot:f}=function(m,g,_,y,w,M=!0){var I,F,R,U,N,G;const he={x:Math.abs(w.x),y:Math.abs(w.y)},ne=window.devicePixelRatio,Z=document.createElement("canvas"),Q=Z.getContext("2d");if(!Q)throw new Error("ctx");Q.lineCap=(y==null?void 0:y.cap)||"butt",Q.lineJoin=(y==null?void 0:y.join)||"miter";let $=0,se=0,me=0,ge=0,de=0,fe="none",Re="none";return M?($=g,se=_,de=0,Re="#ffffff"):(fe="#ffffff",de=(y==null?void 0:y.width)||0,me=.5*((I=y==null?void 0:y.width)!==null&&I!==void 0?I:0),ge=.5*((F=y==null?void 0:y.width)!==null&&F!==void 0?F:0),$=g+((R=y==null?void 0:y.width)!==null&&R!==void 0?R:0),se=_+((U=y==null?void 0:y.width)!==null&&U!==void 0?U:0),he.x+=.5*((N=y==null?void 0:y.width)!==null&&N!==void 0?N:0),he.y+=.5*((G=y==null?void 0:y.width)!==null&&G!==void 0?G:0)),$+=Math.abs(w.x),se+=Math.abs(w.y),me+=Math.abs(w.x),ge+=Math.abs(w.y),me*=ne,ge*=ne,$=Math.ceil($*ne),se=Math.ceil(se*ne),Z.width=$,Z.height=se,Q.transform(ne,0,0,ne,me,ge),m.forEach(ke=>{Q.lineWidth=de,Q.strokeStyle=fe,ke.fill!=="none"&&(Q.fillStyle=Re),Q.beginPath();const{scale:Be}=ke,J=ke.path.trim().split(" ");let te={x:0,y:0};for(let Ae=0;Ae<J.length;Ae+=2){const Ne=J[Ae],Te=J[Ae+1];if(Ne==="M"){let[Ge,Ye]=Te.split(",").map(ve=>Number(ve));te={x:Ge,y:Ye},Ge=Ge/9525*Be.x,Ye=Ye/9525*Be.y,Q.moveTo(Ge,Ye)}else if(Ne==="A"){const[Ge,Ye,ve,Y]=Te.split(",").map(pe=>Number(pe));te=W2(te,Be,Ge,Ye,ve,Y,Q)}else if(Ne==="L"){let[Ge,Ye]=Te.split(",").map(ve=>Number(ve));te={x:Ge,y:Ye},Ge=Ge/9525*Be.x,Ye=Ye/9525*Be.y,Q.lineTo(Ge,Ye)}else if(Ne==="QB"){let[Ge,Ye,ve,Y]=Te.split(",").map(pe=>Number(pe));te={x:ve,y:Y},Ge=Ge/9525*Be.x,Ye=Ye/9525*Be.y,ve=ve/9525*Be.x,Y=Y/9525*Be.y,Q.quadraticCurveTo(Ge,Ye,ve,Y)}else if(Ne==="CB"){let[Ge,Ye,ve,Y,pe,ye]=Te.split(",").map(xe=>Number(xe));te={x:pe,y:ye},Ge=Ge/9525*Be.x,Ye=Ye/9525*Be.y,ve=ve/9525*Be.x,Y=Y/9525*Be.y,pe=pe/9525*Be.x,ye=ye/9525*Be.y,Q.bezierCurveTo(Ge,Ye,ve,Y,pe,ye)}else Ne==="C"&&Q.closePath()}ke.hasStroke&&de>0&&Q.stroke(),ke.fill!=="none"&&M&&Q.fill("nonzero")}),{texture:new Nt(new vn(Z,{width:g,height:_,resolution:ne})),pivot:he}}(e,i,o,s,n,a);this.graphics.push({id:c,texture:d,pivot:f,width:d.width,height:d.height})}return u}pack(){x_(this.graphics).forEach(e=>{this.render(e)}),this.graphics.forEach(e=>{e.texture.destroy(!0)}),this.graphics=[]}destroy(){Object.keys(this.textures).forEach(e=>{var t;(t=this.textures[e])===null||t===void 0||t.texture.destroy()}),this.textures=Object.create(null),this.graphics=[],this.renderTextures.forEach(e=>e.destroy(!0))}}class Y2{constructor(e){this.gifs=Object.create(null),this.textures=Object.create(null),this.spriteSheets=[],this.loader=e}getTexture(e){return this.textures[e]||null}getGifFrames(e){return this.gifs[e]?this.gifs[e].filter(t=>!!t):[]}loadSpriteSheets(e,t,n){return new Promise(i=>{this.loader.reset();for(const o of e)this.loader.add(o,`${t}/${n}/jsonOutput/${o}.json`);this.loader.load(o=>{for(const s of e){const a=o.resources[s].spritesheet;this.spriteSheets.push(a),Object.keys(a.textures).forEach(l=>{const u=l.match(/^(.+)_gif_(\d+)$/);if(u&&u[1]&&u[2]){const c=u[1];this.gifs[c]||(this.gifs[c]=[]);const d=parseInt(u[2],10);this.gifs[c][d]=a.textures[l]}else this.textures[l]=a.textures[l]})}i()})})}destroy(){this.spriteSheets.forEach(e=>e.destroy(!0)),this.loader.destroy()}}class q2{constructor(){this.prevTime=-1,this.times=10,this.dur=0,this.valeList=[],this.value=0,this.calcFps()}calcFps(){requestAnimationFrame(e=>{const t=e-this.prevTime;this.dur+=t,this.times-=1,this.times===0&&(this.valeList.push(1e4/this.dur),this.times=10,this.dur=0,this.valeList.length>10&&(this.value=Math.round(this.valeList.reduce((n,i)=>n+i)/this.valeList.length),this.valeList=[])),this.prevTime=e,this.calcFps()})}}var hp=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})};window.PIXI=B,q.skipHello();const Gw={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip"};class Z2{constructor(e){this.eventHub=e,this.targets=Object.create(null)}addTarget(e,t){this.targets[e]=t}getTargetById(e){return this.targets[e]}getTarget(e,t,n={type:"el",index:0,id:""}){var i,o;let s=this.targets[e.id];return e.type!=="shape"?s:(e.type==="shape"&&e.txEl&&(s=(i=s==null?void 0:s.getTextElement(e.txEl.type,e.txEl.range))!==null&&i!==void 0?i:null),e.type==="shape"&&e.bg&&n.index===0&&(t=!1,s=(o=s==null?void 0:s.getBgElement())!==null&&o!==void 0?o:null,this.eventHub.emit("IterateTimeNodeEnd",n.id)),t&&s?s.getIterateEntry(n.type,n.index,n.id):s)}clearTargets(){this.targets=Object.create(null)}}const _s={prev:"gotoPrev",next:"gotoNext",goto:"gotoSlide"},mn={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",interactiveAnimTrigger:"interactiveAnimTrigger",animateStart:"animateStart",animateEnd:"animateEnd"};class J2 extends k.a{constructor(e={}){super(),this.transactionPlayer=new WE,this.transactionSprite=new Hn,this.isForward=!0,this.dynamicResolution=1,this.drawCall=0,this.fps=new q2,this.width=0,this.height=0,this.currentIndex=0,this.slideCount=0,this.frameList=[],this.runtime={drawCall:0,fps:0},this.handlePrevSlide=()=>hp(this,void 0,void 0,function*(){const i=this.currentIndex-1;i>=1&&(this.isForward=!1,yield this.renderSlide(i))}),this.handleNextSlide=()=>hp(this,void 0,void 0,function*(){const i=this.currentIndex+1;i<=this.slideCount&&(this.isForward=!0,yield this.renderSlide(i))}),this.handleGotoSlide=i=>{i<=this.slideCount&&i>=1&&this.renderSlide(i)},this.config={minFPS:Object(oe.isUndefined)(e.minFPS)?40:e.minFPS,maxFPS:Object(oe.isUndefined)(e.maxFPS)?50:e.maxFPS,resolution:Object(oe.isUndefined)(e.resolution)?window.devicePixelRatio:e.resolution,autoResolution:!Object(oe.isUndefined)(e.autoResolution)&&e.autoResolution,minResolution:Object(oe.isUndefined)(e.minResolution)?1:e.minResolution,autoFPS:!Object(oe.isUndefined)(e.autoFPS)&&e.autoFPS},this.app=new Xd({antialias:!0,autoDensity:!0,backgroundColor:16777215}),this.updateConfig(this.config),this.app.view.style.zIndex="1",this.app.stage.sortableChildren=!0;const t=this.app.renderer,{drawElements:n}=t.gl;t.gl.drawElements=(...i)=>{n.call(t.gl,...i),this.drawCall+=1},this.app.ticker.add(i=>{this.runtime.drawCall=this.drawCall,this.drawCall=0;const o=1e3/(i/(At.TARGET_FPMS||.06));if(this.frameList.push(o),this.frameList.length>50){const s=this.frameList.reduce((a,l)=>a+l)/this.frameList.length;if(this.runtime.fps=Math.floor(s),this.fps.value<this.config.minFPS)this.dynamicResolution=this.app.renderer.resolution-.1,this.dynamicResolution=Math.max(this.config.minResolution,this.dynamicResolution),this.dynamicResolution<=this.config.minResolution&&this.config.autoFPS&&(this.app.ticker.minFPS-=2,this.app.ticker.maxFPS-=2);else if(this.fps.value>1.08*this.config.minFPS&&this.fps.value<=this.config.maxFPS){const a=Math.min(this.app.ticker.minFPS+2,this.config.minFPS),l=Math.min(this.app.ticker.maxFPS+2,this.config.maxFPS);a<=this.config.minFPS&&(this.app.ticker.minFPS=a),l<=this.config.maxFPS&&(this.app.ticker.maxFPS=l),a>=this.config.minFPS&&l>=this.config.maxFPS&&(this.dynamicResolution+=.1,this.dynamicResolution=Math.max(this.config.minResolution,this.dynamicResolution))}this.config.autoResolution&&this.dynamicResolution!==this.app.renderer.resolution&&this.app.ticker.addOnce(()=>{const a=Math.min(this.dynamicResolution,this.config.resolution);this.app.renderer.resolution=a,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.width,this.height)},Mr.HIGH),this.frameList=[]}},null,Mr.LOW)}get view(){return this.app.view}updateConfig(e){Object(oe.isUndefined)(e.minFPS)||(this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),Object(oe.isUndefined)(e.maxFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS),Object(oe.isUndefined)(e.resolution)||(this.config.resolution=e.resolution,this.app.ticker.addOnce(()=>{this.app.renderer.resolution=e.resolution||window.devicePixelRatio,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.width,this.height)},Mr.HIGH)),Object(oe.isUndefined)(e.autoResolution)||(this.config.autoResolution=e.autoResolution),Object(oe.isUndefined)(e.autoFPS)||(this.config.autoFPS=e.autoFPS),Object(oe.isUndefined)(e.minResolution)||(this.config.minResolution=e.minResolution)}setResourceData(e,t){this.taskId=e,this.url=t}setInteractive(e){this.app.stage.interactive=e,this.app.stage.interactiveChildren=e}loadSlide(e){return hp(this,void 0,void 0,function*(){const t=new Y2(this.app.loader),n=new k.a,i={renderer:this.app.renderer,graphicsTexture:new X2(this.app.renderer),fillTexture:new j2(this.app.renderer,t),stageWidth:0,stageHeight:0,ticker:this.app.ticker,timingTargets:new Z2(n),eventHub:n},o=yield(yield fetch(`${this.url}/${this.taskId}/jsonOutput/slide-${e}.json`)).json(),{width:s,height:a,sheets:l}=o;yield t.loadSpriteSheets(l,this.url,this.taskId),i.stageWidth=s,i.stageHeight=a;const u=new D2(o,i,{x:0,y:0});return i.eventHub.on(_s.prev,this.handlePrevSlide),i.eventHub.on(_s.next,this.handleNextSlide),i.eventHub.on(_s.goto,this.handleGotoSlide),this.translateEvent(i.eventHub,[mn.mainSeqStepChange,mn.mainSeqStateChange,mn.hyperlinkTrigger,mn.interactiveAnimTrigger,mn.mainSeqStepStart,mn.mainSeqStepEnd,mn.animateStart,mn.animateEnd]),u.preRender(),i.fillTexture.pack(),i.graphicsTexture.pack(),{stage:u,json:o}})}translateEvent(e,t){t.forEach(n=>{e.on(n,(...i)=>{this.emit(n,...i)})})}renderSlide(e){return hp(this,void 0,void 0,function*(){this.emit(mn.renderStart,e),this.currentIndex=Number(e);const t=yield this.loadSlide(e),{width:n,height:i,slideCount:o}=t.json;let s;this.slideCount=o,this.app.view.style.width=n+"px",this.app.view.style.height=i+"px",this.app.renderer.resize(n,i),this.width=n,this.height=i,this.currentStage&&(t.json.transition&&t.json.transition.type&&(s=this.getBase64(this.currentStage)),this.prevStage=this.currentStage),this.currentStage=t,yield t.stage.render(),t.stage.createTiming(),t.stage.container.visible=!0,t.stage.collectMainSeqStartValue(),this.isForward?t.stage.setMainSeqStep(0,"start"):t.stage.setMainSeqStep(-1,"end");const a=this.getBase64(this.currentStage);t.stage.container.visible=!1,this.app.stage.addChild(t.stage.container),s&&a&&t.json.transition&&t.json.transition.type&&(yield this.playTransaction(s,a,t.json.transition)),this.prevStage&&(this.app.stage.removeChild(this.prevStage.stage.container),this.prevStage.stage.destroy(),this.prevStage=void 0),this.isForward?t.stage.startTiming():t.stage.setMainSeqApplied(),t.stage.container.visible=!0,this.emit(mn.renderEnd,e),this.emit(mn.slideChange,e)})}getBase64(e){const{width:t,height:n}=e.json,i=Gr.create({width:t,height:n});return this.app.renderer.render(e.stage.container,{renderTexture:i}),this.app.renderer.plugins.extract.base64(i,"image/jpeg")}playTransaction(e,t,n){return hp(this,void 0,void 0,function*(){const i=this.app.view.parentElement;if(e&&t&&i&&Gw[n.type]){this.transactionSprite.zIndex=999,this.app.stage.addChild(this.transactionSprite);const o=this.transactionPlayer.renderer.domElement,s=Nt.from(o),a=()=>s.update();this.app.ticker.add(a),this.transactionSprite.texture=s;const{width:l,height:u}=this.currentStage.json;return new Promise(c=>{var d,f;this.transactionPlayer.play({reverse:!this.isForward,prevTextureUrl:e,nextTextureUrl:t,textureWidth:l,textureHeight:u,presetType:Gw[n.type],stageWidth:l,stageHeight:u,duration:(f=(d=this.currentStage)===null||d===void 0?void 0:d.json.transition)===null||f===void 0?void 0:f.dur,delay:0,onTransactionEnd:()=>{c(),this.app.stage.removeChild(this.transactionSprite),this.app.ticker.remove(a)}})})}return Promise.resolve()})}nextStep(){var e;(e=this.currentStage)===null||e===void 0||e.stage.nextStep()}prevStep(){var e;(e=this.currentStage)===null||e===void 0||e.stage.prevStep()}mainSeqLength(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqLength())!==null&&t!==void 0?t:0}mainSeqStep(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqStep())!==null&&t!==void 0?t:0}setMainSeqStep(e,t){var n;(n=this.currentStage)===null||n===void 0||n.stage.setMainSeqStep(e,t)}mainSeqState(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqState())!==null&&t!==void 0?t:null}mainSeqHasNextStep(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqHasNextStep())!==null&&t!==void 0&&t}mainSeqHasPrevStep(){var e,t;return(t=(e=this.currentStage)===null||e===void 0?void 0:e.stage.mainSeqHasPrevStep())!==null&&t!==void 0&&t}nextTick(e){this.app.ticker.addOnce(()=>{e()},Mr.LOW)}applyInteractiveAction(e){var t;(t=this.currentStage)===null||t===void 0||t.stage.applyInteractiveAction(e)}seekInteractiveSeqToEnd(e){var t;(t=this.currentStage)===null||t===void 0||t.stage.seekInteractiveSeqToEnd(e)}pause(){this.app.ticker.stop()}resume(){this.app.ticker.start()}destroy(){this.prevStage&&this.prevStage.stage.destroy(),this.currentStage&&this.currentStage.stage.destroy()}}var cp,bu=[],Hw="ResizeObserver loop completed with undelivered notifications.";(function(r){r.BORDER_BOX="border-box",r.CONTENT_BOX="content-box",r.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(cp||(cp={}));var S_,wu=function(r){return Object.freeze(r)},$2=function(r,e){this.inlineSize=r,this.blockSize=e,wu(this)},zw=function(){function r(e,t,n,i){return this.x=e,this.y=t,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,wu(this)}return r.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},r.fromRect=function(e){return new r(e.x,e.y,e.width,e.height)},r}(),E_=function(r){return r instanceof SVGElement&&"getBBox"in r},Vw=function(r){if(E_(r)){var e=r.getBBox(),t=e.width,n=e.height;return!t&&!n}var i=r,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||r.getClientRects().length)},jw=function(r){var e,t;if(r instanceof Element)return!0;var n=(t=(e=r)===null||e===void 0?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&r instanceof n.Element)},dp=typeof window!="undefined"?window:{},og=new WeakMap,Ww=/auto|scroll/,K2=/^tb|vertical/,Q2=/msie|trident/i.test(dp.navigator&&dp.navigator.userAgent),ys=function(r){return parseFloat(r||"0")},uc=function(r,e,t){return r===void 0&&(r=0),e===void 0&&(e=0),t===void 0&&(t=!1),new $2((t?e:r)||0,(t?r:e)||0)},Xw=wu({devicePixelContentBoxSize:uc(),borderBoxSize:uc(),contentBoxSize:uc(),contentRect:new zw(0,0,0,0)}),Yw=function(r,e){if(e===void 0&&(e=!1),og.has(r)&&!e)return og.get(r);if(Vw(r))return og.set(r,Xw),Xw;var t=getComputedStyle(r),n=E_(r)&&r.ownerSVGElement&&r.getBBox(),i=!Q2&&t.boxSizing==="border-box",o=K2.test(t.writingMode||""),s=!n&&Ww.test(t.overflowY||""),a=!n&&Ww.test(t.overflowX||""),l=n?0:ys(t.paddingTop),u=n?0:ys(t.paddingRight),c=n?0:ys(t.paddingBottom),d=n?0:ys(t.paddingLeft),f=n?0:ys(t.borderTopWidth),m=n?0:ys(t.borderRightWidth),g=n?0:ys(t.borderBottomWidth),_=d+u,y=l+c,w=(n?0:ys(t.borderLeftWidth))+m,M=f+g,I=a?r.offsetHeight-M-r.clientHeight:0,F=s?r.offsetWidth-w-r.clientWidth:0,R=i?_+w:0,U=i?y+M:0,N=n?n.width:ys(t.width)-R-F,G=n?n.height:ys(t.height)-U-I,he=N+_+F+w,ne=G+y+I+M,Z=wu({devicePixelContentBoxSize:uc(Math.round(N*devicePixelRatio),Math.round(G*devicePixelRatio),o),borderBoxSize:uc(he,ne,o),contentBoxSize:uc(N,G,o),contentRect:new zw(d,l,N,G)});return og.set(r,Z),Z},qw=function(r,e,t){var n=Yw(r,t),i=n.borderBoxSize,o=n.contentBoxSize,s=n.devicePixelContentBoxSize;switch(e){case cp.DEVICE_PIXEL_CONTENT_BOX:return s;case cp.BORDER_BOX:return i;default:return o}},eP=function(r){var e=Yw(r);this.target=r,this.contentRect=e.contentRect,this.borderBoxSize=wu([e.borderBoxSize]),this.contentBoxSize=wu([e.contentBoxSize]),this.devicePixelContentBoxSize=wu([e.devicePixelContentBoxSize])},Zw=function(r){if(Vw(r))return 1/0;for(var e=0,t=r.parentNode;t;)e+=1,t=t.parentNode;return e},tP=function(){var r=1/0,e=[];bu.forEach(function(i){if(i.activeTargets.length!==0){var o=[];i.activeTargets.forEach(function(s){var a=new eP(s.target),l=Zw(s.target);o.push(a),s.lastReportedSize=qw(s.target,s.observedBox),l<r&&(r=l)}),e.push(function(){i.callback.call(i.observer,o,i.observer)}),i.activeTargets.splice(0,i.activeTargets.length)}});for(var t=0,n=e;t<n.length;t++)(0,n[t])();return r},Jw=function(r){bu.forEach(function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach(function(t){t.isActive()&&(Zw(t.target)>r?e.activeTargets.push(t):e.skippedTargets.push(t))})})},nP=function(){var r,e=0;for(Jw(e);bu.some(function(t){return t.activeTargets.length>0});)e=tP(),Jw(e);return bu.some(function(t){return t.skippedTargets.length>0})&&(typeof ErrorEvent=="function"?r=new ErrorEvent("error",{message:Hw}):((r=document.createEvent("Event")).initEvent("error",!1,!1),r.message=Hw),window.dispatchEvent(r)),e>0},$w=[],iP=function(r){if(!S_){var e=0,t=document.createTextNode("");new MutationObserver(function(){return $w.splice(0).forEach(function(n){return n()})}).observe(t,{characterData:!0}),S_=function(){t.textContent=""+(e?e--:e++)}}$w.push(r),S_()},M_=0,rP={attributes:!0,characterData:!0,childList:!0,subtree:!0},Kw=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Qw=function(r){return r===void 0&&(r=0),Date.now()+r},A_=!1,P_=new(function(){function r(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return r.prototype.run=function(e){var t=this;if(e===void 0&&(e=250),!A_){A_=!0;var n,i=Qw(e);n=function(){var o=!1;try{o=nP()}finally{if(A_=!1,e=i-Qw(),!M_)return;o?t.run(1e3):e>0?t.run(e):t.start()}},iP(function(){requestAnimationFrame(n)})}},r.prototype.schedule=function(){this.stop(),this.run()},r.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,rP)};document.body?t():dp.addEventListener("DOMContentLoaded",t)},r.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Kw.forEach(function(t){return dp.addEventListener(t,e.listener,!0)}))},r.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Kw.forEach(function(t){return dp.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},r}()),eT=function(r){!M_&&r>0&&P_.start(),!(M_+=r)&&P_.stop()},oP=function(){function r(e,t){this.target=e,this.observedBox=t||cp.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return r.prototype.isActive=function(){var e,t=qw(this.target,this.observedBox,!0);return e=this.target,E_(e)||function(n){switch(n.tagName){case"INPUT":if(n.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||getComputedStyle(e).display!=="inline"||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},r}(),sP=function(r,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=r,this.callback=e},sg=new WeakMap,tT=function(r,e){for(var t=0;t<r.length;t+=1)if(r[t].target===e)return t;return-1},ag=function(){function r(){}return r.connect=function(e,t){var n=new sP(e,t);sg.set(e,n)},r.observe=function(e,t,n){var i=sg.get(e),o=i.observationTargets.length===0;tT(i.observationTargets,t)<0&&(o&&bu.push(i),i.observationTargets.push(new oP(t,n&&n.box)),eT(1),P_.schedule())},r.unobserve=function(e,t){var n=sg.get(e),i=tT(n.observationTargets,t),o=n.observationTargets.length===1;i>=0&&(o&&bu.splice(bu.indexOf(n),1),n.observationTargets.splice(i,1),eT(-1))},r.disconnect=function(e){var t=this,n=sg.get(e);n.observationTargets.slice().forEach(function(i){return t.unobserve(e,i.target)}),n.activeTargets.splice(0,n.activeTargets.length)},r}(),aP=function(){function r(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ag.connect(this,e)}return r.prototype.observe=function(e,t){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!jw(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ag.observe(this,e,t)},r.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!jw(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ag.unobserve(this,e)},r.prototype.disconnect=function(){ag.disconnect(this)},r.toString=function(){return"function ResizeObserver () { [polyfill code] }"},r}(),lP=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})},uP=function(r,e){var t,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,n=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(r,s)}catch(d){c=[6,d],n=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}},hP=function(){function r(e,t,n,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=n,this.index=e,this.slideIndex=t,this.eventHub=i}return r.prototype.apply=function(){return lP(this,void 0,void 0,function(){var e;return uP(this,function(t){switch(t.label){case 0:this.eventHub.emit("task-start",this),t.label=1;case 1:return t.trys.push([1,3,,4]),this.state="start",[4,this.fn()];case 2:return t.sent(),this.state="end",this.eventHub.emit("task-end",this),[3,4];case 3:return e=t.sent(),this.eventHub.emit("task-error",{task:this,error:e}),[3,4];case 4:return[2]}})})},r}(),cP=function(){function r(){var e=this;this.eventHub=new k.a,this.tasks=[],this.index=0,this.eventHub.on("task-end",function(t){var n,i=e.tasks.findIndex(function(s){return s.index===t.index}),o=i+1;o>=0&&((n=e.tasks[o])===null||n===void 0||n.apply()),i>=0&&(e.tasks.splice(i,1),e.replaceIdleTask())}),this.eventHub.on("task-error",function(t){var n=t.task,i=e.tasks.findIndex(function(o){return o.index===n.index});i>=0&&(e.tasks.splice(i,1),e.replaceIdleTask())})}return r.prototype.replaceIdleTask=function(){for(var e,t=this,n=new Set,i=0,o=this.tasks.length;i<o;i++)this.tasks[i].state==="idle"&&((e=this.tasks[i+1])===null||e===void 0?void 0:e.state)==="idle"&&n.add(i);Array.from(n).forEach(function(s){t.tasks.splice(s,1)})},r.prototype.addTask=function(e,t){var n=new hP(this.index++,t,e,this.eventHub);this.tasks.push(n),this.tasks.sort(function(i,o){return i.index-o.index}),this.replaceIdleTask(),this.tasks.length===1&&n.apply()},r.prototype.hasStartTask=function(){return this.tasks.some(function(e){return e.state==="start"})},r}(),dP=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})},pP=function(r,e){var t,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,n=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(r,s)}catch(d){c=[6,d],n=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}};function fP(r,e){return dP(this,void 0,void 0,function(){var t;return pP(this,function(n){switch(n.label){case 0:t=Date.now(),n.label=1;case 1:return!r()&&Date.now()-t<e?[4,(i=50,new Promise(function(o){return setTimeout(o,i)}))]:[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}var i})})}function hc(r,e){var t=r.__state.conversionName.toString(),n=Math.round(r.r),i=Math.round(r.g),o=Math.round(r.b),s=r.a,a=Math.round(r.h),l=r.s.toFixed(1),u=r.v.toFixed(1);if(e||t==="THREE_CHAR_HEX"||t==="SIX_CHAR_HEX"){for(var c=r.hex.toString(16);c.length<6;)c="0"+c;return"#"+c}return t==="CSS_RGB"?"rgb("+n+","+i+","+o+")":t==="CSS_RGBA"?"rgba("+n+","+i+","+o+","+s+")":t==="HEX"?"0x"+r.hex.toString(16):t==="RGB_ARRAY"?"["+n+","+i+","+o+"]":t==="RGBA_ARRAY"?"["+n+","+i+","+o+","+s+"]":t==="RGB_OBJ"?"{r:"+n+",g:"+i+",b:"+o+"}":t==="RGBA_OBJ"?"{r:"+n+",g:"+i+",b:"+o+",a:"+s+"}":t==="HSV_OBJ"?"{h:"+a+",s:"+l+",v:"+u+"}":t==="HSVA_OBJ"?"{h:"+a+",s:"+l+",v:"+u+",a:"+s+"}":"unknown format"}var nT=Array.prototype.forEach,pp=Array.prototype.slice,Ke={BREAK:{},extend:function(r){return this.each(pp.call(arguments,1),function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(t){this.isUndefined(e[t])||(r[t]=e[t])}.bind(this))},this),r},defaults:function(r){return this.each(pp.call(arguments,1),function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(t){this.isUndefined(r[t])&&(r[t]=e[t])}.bind(this))},this),r},compose:function(){var r=pp.call(arguments);return function(){for(var e=pp.call(arguments),t=r.length-1;t>=0;t--)e=[r[t].apply(this,e)];return e[0]}},each:function(r,e,t){if(r){if(nT&&r.forEach&&r.forEach===nT)r.forEach(e,t);else if(r.length===r.length+0){var n,i=void 0;for(i=0,n=r.length;i<n;i++)if(i in r&&e.call(t,r[i],i)===this.BREAK)return}else for(var o in r)if(e.call(t,r[o],o)===this.BREAK)return}},defer:function(r){setTimeout(r,0)},debounce:function(r,e,t){var n=void 0;return function(){var i=this,o=arguments;function s(){n=null,t||r.apply(i,o)}var a=t||!n;clearTimeout(n),n=setTimeout(s,e),a&&r.apply(i,o)}},toArray:function(r){return r.toArray?r.toArray():pp.call(r)},isUndefined:function(r){return r===void 0},isNull:function(r){return r===null},isNaN:function(r){function e(t){return r.apply(this,arguments)}return e.toString=function(){return r.toString()},e}(function(r){return isNaN(r)}),isArray:Array.isArray||function(r){return r.constructor===Array},isObject:function(r){return r===Object(r)},isNumber:function(r){return r===r+0},isString:function(r){return r===r+""},isBoolean:function(r){return r===!1||r===!0},isFunction:function(r){return r instanceof Function}},mP=[{litmus:Ke.isString,conversions:{THREE_CHAR_HEX:{read:function(r){var e=r.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return e!==null&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:hc},SIX_CHAR_HEX:{read:function(r){var e=r.match(/^#([A-F0-9]{6})$/i);return e!==null&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:hc},CSS_RGB:{read:function(r){var e=r.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return e!==null&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:hc},CSS_RGBA:{read:function(r){var e=r.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return e!==null&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:hc}}},{litmus:Ke.isNumber,conversions:{HEX:{read:function(r){return{space:"HEX",hex:r,conversionName:"HEX"}},write:function(r){return r.hex}}}},{litmus:Ke.isArray,conversions:{RGB_ARRAY:{read:function(r){return r.length===3&&{space:"RGB",r:r[0],g:r[1],b:r[2]}},write:function(r){return[r.r,r.g,r.b]}},RGBA_ARRAY:{read:function(r){return r.length===4&&{space:"RGB",r:r[0],g:r[1],b:r[2],a:r[3]}},write:function(r){return[r.r,r.g,r.b,r.a]}}}},{litmus:Ke.isObject,conversions:{RGBA_OBJ:{read:function(r){return!!(Ke.isNumber(r.r)&&Ke.isNumber(r.g)&&Ke.isNumber(r.b)&&Ke.isNumber(r.a))&&{space:"RGB",r:r.r,g:r.g,b:r.b,a:r.a}},write:function(r){return{r:r.r,g:r.g,b:r.b,a:r.a}}},RGB_OBJ:{read:function(r){return!!(Ke.isNumber(r.r)&&Ke.isNumber(r.g)&&Ke.isNumber(r.b))&&{space:"RGB",r:r.r,g:r.g,b:r.b}},write:function(r){return{r:r.r,g:r.g,b:r.b}}},HSVA_OBJ:{read:function(r){return!!(Ke.isNumber(r.h)&&Ke.isNumber(r.s)&&Ke.isNumber(r.v)&&Ke.isNumber(r.a))&&{space:"HSV",h:r.h,s:r.s,v:r.v,a:r.a}},write:function(r){return{h:r.h,s:r.s,v:r.v,a:r.a}}},HSV_OBJ:{read:function(r){return!!(Ke.isNumber(r.h)&&Ke.isNumber(r.s)&&Ke.isNumber(r.v))&&{space:"HSV",h:r.h,s:r.s,v:r.v}},write:function(r){return{h:r.h,s:r.s,v:r.v}}}}}],fp=void 0,lg=void 0,C_=function(){lg=!1;var r=arguments.length>1?Ke.toArray(arguments):arguments[0];return Ke.each(mP,function(e){if(e.litmus(r))return Ke.each(e.conversions,function(t,n){if(fp=t.read(r),lg===!1&&fp!==!1)return lg=fp,fp.conversionName=n,fp.conversion=t,Ke.BREAK}),Ke.BREAK}),lg},iT=void 0,ug={hsv_to_rgb:function(r,e,t){var n=Math.floor(r/60)%6,i=r/60-Math.floor(r/60),o=t*(1-e),s=t*(1-i*e),a=t*(1-(1-i)*e),l=[[t,a,o],[s,t,o],[o,t,a],[o,s,t],[a,o,t],[t,o,s]][n];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(r,e,t){var n=Math.min(r,e,t),i=Math.max(r,e,t),o=i-n,s=void 0;return i===0?{h:NaN,s:0,v:0}:(s=r===i?(e-t)/o:e===i?2+(t-r)/o:4+(r-e)/o,(s/=6)<0&&(s+=1),{h:360*s,s:o/i,v:i/255})},rgb_to_hex:function(r,e,t){var n=this.hex_with_component(0,2,r);return n=this.hex_with_component(n,1,e),n=this.hex_with_component(n,0,t)},component_from_hex:function(r,e){return r>>8*e&255},hex_with_component:function(r,e,t){return t<<(iT=8*e)|r&~(255<<iT)}},gP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},No=function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")},Fo=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),el=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:r(o,t,n)}if("value"in i)return i.value;var s=i.get;return s!==void 0?s.call(n):void 0},tl=function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)},nl=function(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||typeof e!="object"&&typeof e!="function"?r:e},Ni=function(){function r(){if(No(this,r),this.__state=C_.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return Fo(r,[{key:"toString",value:function(){return hc(this)}},{key:"toHexString",value:function(){return hc(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),r}();function R_(r,e,t){Object.defineProperty(r,e,{get:function(){return this.__state.space==="RGB"||Ni.recalculateRGB(this,e,t),this.__state[e]},set:function(n){this.__state.space!=="RGB"&&(Ni.recalculateRGB(this,e,t),this.__state.space="RGB"),this.__state[e]=n}})}function I_(r,e){Object.defineProperty(r,e,{get:function(){return this.__state.space==="HSV"||Ni.recalculateHSV(this),this.__state[e]},set:function(t){this.__state.space!=="HSV"&&(Ni.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}Ni.recalculateRGB=function(r,e,t){if(r.__state.space==="HEX")r.__state[e]=ug.component_from_hex(r.__state.hex,t);else{if(r.__state.space!=="HSV")throw new Error("Corrupted color state");Ke.extend(r.__state,ug.hsv_to_rgb(r.__state.h,r.__state.s,r.__state.v))}},Ni.recalculateHSV=function(r){var e=ug.rgb_to_hsv(r.r,r.g,r.b);Ke.extend(r.__state,{s:e.s,v:e.v}),Ke.isNaN(e.h)?Ke.isUndefined(r.__state.h)&&(r.__state.h=0):r.__state.h=e.h},Ni.COMPONENTS=["r","g","b","h","s","v","hex","a"],R_(Ni.prototype,"r",2),R_(Ni.prototype,"g",1),R_(Ni.prototype,"b",0),I_(Ni.prototype,"h"),I_(Ni.prototype,"s"),I_(Ni.prototype,"v"),Object.defineProperty(Ni.prototype,"a",{get:function(){return this.__state.a},set:function(r){this.__state.a=r}}),Object.defineProperty(Ni.prototype,"hex",{get:function(){return this.__state.space!=="HEX"&&(this.__state.hex=ug.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(r){this.__state.space="HEX",this.__state.hex=r}});var Tu=function(){function r(e,t){No(this,r),this.initialValue=e[t],this.domElement=document.createElement("div"),this.object=e,this.property=t,this.__onChange=void 0,this.__onFinishChange=void 0}return Fo(r,[{key:"onChange",value:function(e){return this.__onChange=e,this}},{key:"onFinishChange",value:function(e){return this.__onFinishChange=e,this}},{key:"setValue",value:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),r}(),rT={};Ke.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},function(r,e){Ke.each(r,function(t){rT[t]=e})});var vP=/(\d+(\.\d+)?)px/;function xs(r){if(r==="0"||Ke.isUndefined(r))return 0;var e=r.match(vP);return Ke.isNull(e)?0:parseFloat(e[1])}var Pe={makeSelectable:function(r,e){r!==void 0&&r.style!==void 0&&(r.onselectstart=e?function(){return!1}:function(){},r.style.MozUserSelect=e?"auto":"none",r.style.KhtmlUserSelect=e?"auto":"none",r.unselectable=e?"on":"off")},makeFullscreen:function(r,e,t){var n=t,i=e;Ke.isUndefined(i)&&(i=!0),Ke.isUndefined(n)&&(n=!0),r.style.position="absolute",i&&(r.style.left=0,r.style.right=0),n&&(r.style.top=0,r.style.bottom=0)},fakeEvent:function(r,e,t,n){var i=t||{},o=rT[e];if(!o)throw new Error("Event type "+e+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=i.x||i.clientX||0,l=i.y||i.clientY||0;s.initMouseEvent(e,i.bubbles||!1,i.cancelable||!0,window,i.clickCount||1,0,0,a,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var u=s.initKeyboardEvent||s.initKeyEvent;Ke.defaults(i,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),u(e,i.bubbles||!1,i.cancelable,window,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.keyCode,i.charCode);break;default:s.initEvent(e,i.bubbles||!1,i.cancelable||!0)}Ke.defaults(s,n),r.dispatchEvent(s)},bind:function(r,e,t,n){var i=n||!1;return r.addEventListener?r.addEventListener(e,t,i):r.attachEvent&&r.attachEvent("on"+e,t),Pe},unbind:function(r,e,t,n){var i=n||!1;return r.removeEventListener?r.removeEventListener(e,t,i):r.detachEvent&&r.detachEvent("on"+e,t),Pe},addClass:function(r,e){if(r.className===void 0)r.className=e;else if(r.className!==e){var t=r.className.split(/ +/);t.indexOf(e)===-1&&(t.push(e),r.className=t.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return Pe},removeClass:function(r,e){if(e)if(r.className===e)r.removeAttribute("class");else{var t=r.className.split(/ +/),n=t.indexOf(e);n!==-1&&(t.splice(n,1),r.className=t.join(" "))}else r.className=void 0;return Pe},hasClass:function(r,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(r.className)||!1},getWidth:function(r){var e=getComputedStyle(r);return xs(e["border-left-width"])+xs(e["border-right-width"])+xs(e["padding-left"])+xs(e["padding-right"])+xs(e.width)},getHeight:function(r){var e=getComputedStyle(r);return xs(e["border-top-width"])+xs(e["border-bottom-width"])+xs(e["padding-top"])+xs(e["padding-bottom"])+xs(e.height)},getOffset:function(r){var e=r,t={left:0,top:0};if(e.offsetParent)do t.left+=e.offsetLeft,t.top+=e.offsetTop,e=e.offsetParent;while(e);return t},isActive:function(r){return r===document.activeElement&&(r.type||r.href)}},oT=function(r){function e(t,n){No(this,e);var i=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i;return i.__prev=i.getValue(),i.__checkbox=document.createElement("input"),i.__checkbox.setAttribute("type","checkbox"),Pe.bind(i.__checkbox,"change",function(){o.setValue(!o.__prev)},!1),i.domElement.appendChild(i.__checkbox),i.updateDisplay(),i}return tl(e,r),Fo(e,[{key:"setValue",value:function(t){var n=el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(Tu),_P=function(r){function e(t,n,i){No(this,e);var o=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),s=i,a=o;if(o.__select=document.createElement("select"),Ke.isArray(s)){var l={};Ke.each(s,function(u){l[u]=u}),s=l}return Ke.each(s,function(u,c){var d=document.createElement("option");d.innerHTML=c,d.setAttribute("value",u),a.__select.appendChild(d)}),o.updateDisplay(),Pe.bind(o.__select,"change",function(){var u=this.options[this.selectedIndex].value;a.setValue(u)}),o.domElement.appendChild(o.__select),o}return tl(e,r),Fo(e,[{key:"setValue",value:function(t){var n=el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return Pe.isActive(this.__select)?this:(this.__select.value=this.getValue(),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e}(Tu),yP=function(r){function e(t,n){No(this,e);var i=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i;function s(){o.setValue(o.__input.value)}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),Pe.bind(i.__input,"keyup",s),Pe.bind(i.__input,"change",s),Pe.bind(i.__input,"blur",function(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}),Pe.bind(i.__input,"keydown",function(a){a.keyCode===13&&this.blur()}),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return tl(e,r),Fo(e,[{key:"updateDisplay",value:function(){return Pe.isActive(this.__input)||(this.__input.value=this.getValue()),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(Tu);function sT(r){var e=r.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var aT=function(r){function e(t,n,i){No(this,e);var o=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),s=i||{};return o.__min=s.min,o.__max=s.max,o.__step=s.step,Ke.isUndefined(o.__step)?o.initialValue===0?o.__impliedStep=1:o.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(o.initialValue))/Math.LN10))/10:o.__impliedStep=o.__step,o.__precision=sT(o.__impliedStep),o}return tl(e,r),Fo(e,[{key:"setValue",value:function(t){var n=t;return this.__min!==void 0&&n<this.__min?n=this.__min:this.__max!==void 0&&n>this.__max&&(n=this.__max),this.__step!==void 0&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(t){return this.__min=t,this}},{key:"max",value:function(t){return this.__max=t,this}},{key:"step",value:function(t){return this.__step=t,this.__impliedStep=t,this.__precision=sT(t),this}}]),e}(Tu),hg=function(r){function e(t,n,i){No(this,e);var o=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));o.__truncationSuspended=!1;var s=o,a=void 0;function l(){s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function u(d){var f=a-d.clientY;s.setValue(s.getValue()+f*s.__impliedStep),a=d.clientY}function c(){Pe.unbind(window,"mousemove",u),Pe.unbind(window,"mouseup",c),l()}return o.__input=document.createElement("input"),o.__input.setAttribute("type","text"),Pe.bind(o.__input,"change",function(){var d=parseFloat(s.__input.value);Ke.isNaN(d)||s.setValue(d)}),Pe.bind(o.__input,"blur",function(){l()}),Pe.bind(o.__input,"mousedown",function(d){Pe.bind(window,"mousemove",u),Pe.bind(window,"mouseup",c),a=d.clientY}),Pe.bind(o.__input,"keydown",function(d){d.keyCode===13&&(s.__truncationSuspended=!0,this.blur(),s.__truncationSuspended=!1,l())}),o.updateDisplay(),o.domElement.appendChild(o.__input),o}return tl(e,r),Fo(e,[{key:"updateDisplay",value:function(){var t,n,i;return this.__input.value=this.__truncationSuspended?this.getValue():(t=this.getValue(),n=this.__precision,i=Math.pow(10,n),Math.round(t*i)/i),el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(aT);function lT(r,e,t,n,i){return n+(r-e)/(t-e)*(i-n)}var L_=function(r){function e(t,n,i,o,s){No(this,e);var a=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,{min:i,max:o,step:s})),l=a;function u(m){m.preventDefault();var g=l.__background.getBoundingClientRect();return l.setValue(lT(m.clientX,g.left,g.right,l.__min,l.__max)),!1}function c(){Pe.unbind(window,"mousemove",u),Pe.unbind(window,"mouseup",c),l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}function d(m){var g=m.touches[0].clientX,_=l.__background.getBoundingClientRect();l.setValue(lT(g,_.left,_.right,l.__min,l.__max))}function f(){Pe.unbind(window,"touchmove",d),Pe.unbind(window,"touchend",f),l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),Pe.bind(a.__background,"mousedown",function(m){document.activeElement.blur(),Pe.bind(window,"mousemove",u),Pe.bind(window,"mouseup",c),u(m)}),Pe.bind(a.__background,"touchstart",function(m){m.touches.length===1&&(Pe.bind(window,"touchmove",d),Pe.bind(window,"touchend",f),d(m))}),Pe.addClass(a.__background,"slider"),Pe.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return tl(e,r),Fo(e,[{key:"updateDisplay",value:function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",el(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(aT),uT=function(r){function e(t,n,i){No(this,e);var o=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),s=o;return o.__button=document.createElement("div"),o.__button.innerHTML=i===void 0?"Fire":i,Pe.bind(o.__button,"click",function(a){return a.preventDefault(),s.fire(),!1}),Pe.addClass(o.__button,"button"),o.domElement.appendChild(o.__button),o}return tl(e,r),Fo(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e}(Tu),O_=function(r){function e(t,n){No(this,e);var i=nl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));i.__color=new Ni(i.getValue()),i.__temp=new Ni(0);var o=i;i.domElement=document.createElement("div"),Pe.makeSelectable(i.domElement,!1),i.__selector=document.createElement("div"),i.__selector.className="selector",i.__saturation_field=document.createElement("div"),i.__saturation_field.className="saturation-field",i.__field_knob=document.createElement("div"),i.__field_knob.className="field-knob",i.__field_knob_border="2px solid ",i.__hue_knob=document.createElement("div"),i.__hue_knob.className="hue-knob",i.__hue_field=document.createElement("div"),i.__hue_field.className="hue-field",i.__input=document.createElement("input"),i.__input.type="text",i.__input_textShadow="0 1px 1px ",Pe.bind(i.__input,"keydown",function(y){y.keyCode===13&&f.call(this)}),Pe.bind(i.__input,"blur",f),Pe.bind(i.__selector,"mousedown",function(){Pe.addClass(this,"drag").bind(window,"mouseup",function(){Pe.removeClass(o.__selector,"drag")})}),Pe.bind(i.__selector,"touchstart",function(){Pe.addClass(this,"drag").bind(window,"touchend",function(){Pe.removeClass(o.__selector,"drag")})});var s,a=document.createElement("div");function l(y){g(y),Pe.bind(window,"mousemove",g),Pe.bind(window,"touchmove",g),Pe.bind(window,"mouseup",c),Pe.bind(window,"touchend",c)}function u(y){_(y),Pe.bind(window,"mousemove",_),Pe.bind(window,"touchmove",_),Pe.bind(window,"mouseup",d),Pe.bind(window,"touchend",d)}function c(){Pe.unbind(window,"mousemove",g),Pe.unbind(window,"touchmove",g),Pe.unbind(window,"mouseup",c),Pe.unbind(window,"touchend",c),m()}function d(){Pe.unbind(window,"mousemove",_),Pe.unbind(window,"touchmove",_),Pe.unbind(window,"mouseup",d),Pe.unbind(window,"touchend",d),m()}function f(){var y=C_(this.value);y!==!1?(o.__color.__state=y,o.setValue(o.__color.toOriginal())):this.value=o.__color.toString()}function m(){o.__onFinishChange&&o.__onFinishChange.call(o,o.__color.toOriginal())}function g(y){y.type.indexOf("touch")===-1&&y.preventDefault();var w=o.__saturation_field.getBoundingClientRect(),M=y.touches&&y.touches[0]||y,I=M.clientX,F=M.clientY,R=(I-w.left)/(w.right-w.left),U=1-(F-w.top)/(w.bottom-w.top);return U>1?U=1:U<0&&(U=0),R>1?R=1:R<0&&(R=0),o.__color.v=U,o.__color.s=R,o.setValue(o.__color.toOriginal()),!1}function _(y){y.type.indexOf("touch")===-1&&y.preventDefault();var w=o.__hue_field.getBoundingClientRect(),M=1-((y.touches&&y.touches[0]||y).clientY-w.top)/(w.bottom-w.top);return M>1?M=1:M<0&&(M=0),o.__color.h=360*M,o.setValue(o.__color.toOriginal()),!1}return Ke.extend(i.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),Ke.extend(i.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:i.__field_knob_border+(i.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),Ke.extend(i.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),Ke.extend(i.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),Ke.extend(a.style,{width:"100%",height:"100%",background:"none"}),hT(a,"top","rgba(0,0,0,0)","#000"),Ke.extend(i.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(s=i.__hue_field).style.background="",s.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",s.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",Ke.extend(i.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:i.__input_textShadow+"rgba(0,0,0,0.7)"}),Pe.bind(i.__saturation_field,"mousedown",l),Pe.bind(i.__saturation_field,"touchstart",l),Pe.bind(i.__field_knob,"mousedown",l),Pe.bind(i.__field_knob,"touchstart",l),Pe.bind(i.__hue_field,"mousedown",u),Pe.bind(i.__hue_field,"touchstart",u),i.__saturation_field.appendChild(a),i.__selector.appendChild(i.__field_knob),i.__selector.appendChild(i.__saturation_field),i.__selector.appendChild(i.__hue_field),i.__hue_field.appendChild(i.__hue_knob),i.domElement.appendChild(i.__input),i.domElement.appendChild(i.__selector),i.updateDisplay(),i}return tl(e,r),Fo(e,[{key:"updateDisplay",value:function(){var t=C_(this.getValue());if(t!==!1){var n=!1;Ke.each(Ni.COMPONENTS,function(s){if(!Ke.isUndefined(t[s])&&!Ke.isUndefined(this.__color.__state[s])&&t[s]!==this.__color.__state[s])return n=!0,{}},this),n&&Ke.extend(this.__color.__state,t)}Ke.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var i=this.__color.v<.5||this.__color.s>.5?255:0,o=255-i;Ke.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+i+","+i+","+i+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,hT(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),Ke.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+i+","+i+","+i+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})}}]),e}(Tu),xP=["-moz-","-o-","-webkit-","-ms-",""];function hT(r,e,t,n){r.style.background="",Ke.each(xP,function(i){r.style.cssText+="background: "+i+"linear-gradient("+e+", "+t+" 0%, "+n+" 100%); "})}var bP=function(r,e){var t=e||document,n=document.createElement("style");n.type="text/css",n.innerHTML=r;var i=t.getElementsByTagName("head")[0];try{i.appendChild(n)}catch{}},wP=`<div id="dg-save" class="dg dialogue">
|
|
5803
5803
|
|
|
5804
5804
|
Here's the new load parameter for your <code>GUI</code>'s constructor:
|
|
5805
5805
|
|
|
@@ -5820,6 +5820,6 @@ void main(void){
|
|
|
5820
5820
|
</div>
|
|
5821
5821
|
|
|
5822
5822
|
</div>`,TP=function(r,e){var t=r[e];return Ke.isArray(arguments[2])||Ke.isObject(arguments[2])?new _P(r,e,arguments[2]):Ke.isNumber(t)?Ke.isNumber(arguments[2])&&Ke.isNumber(arguments[3])?Ke.isNumber(arguments[4])?new L_(r,e,arguments[2],arguments[3],arguments[4]):new L_(r,e,arguments[2],arguments[3]):Ke.isNumber(arguments[4])?new hg(r,e,{min:arguments[2],max:arguments[3],step:arguments[4]}):new hg(r,e,{min:arguments[2],max:arguments[3]}):Ke.isString(t)?new yP(r,e):Ke.isFunction(t)?new uT(r,e,""):Ke.isBoolean(t)?new oT(r,e):null},SP=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(r){setTimeout(r,1e3/60)},EP=function(){function r(){No(this,r),this.backgroundElement=document.createElement("div"),Ke.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),Pe.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),Ke.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;Pe.bind(this.backgroundElement,"click",function(){e.hide()})}return Fo(r,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),Ke.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})}},{key:"hide",value:function(){var e=this,t=function n(){e.domElement.style.display="none",e.backgroundElement.style.display="none",Pe.unbind(e.domElement,"webkitTransitionEnd",n),Pe.unbind(e.domElement,"transitionend",n),Pe.unbind(e.domElement,"oTransitionEnd",n)};Pe.bind(this.domElement,"webkitTransitionEnd",t),Pe.bind(this.domElement,"transitionend",t),Pe.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-Pe.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-Pe.getHeight(this.domElement)/2+"px"}}]),r}();bP(function(r){if(r&&typeof window!="undefined"){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=r,document.head.appendChild(e),r}}(`.dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}
|
|
5823
|
-
`));var mp=function(){try{return!!window.localStorage}catch{return!1}}(),cg=void 0,cT=!0,cc=void 0,D_=!1,dT=[],Ln=function r(e){var t=this,n=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),Pe.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=Ke.defaults(n,{closeOnTop:!1,autoPlace:!0,width:r.DEFAULT_WIDTH}),n=Ke.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),Ke.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),Ke.isUndefined(n.parent)&&n.hideable&&dT.push(this),n.resizable=Ke.isUndefined(n.parent)&&n.resizable,n.autoPlace&&Ke.isUndefined(n.scrollable)&&(n.scrollable=!0);var i,o=mp&&localStorage.getItem(dc(this,"isLocal"))==="true",s=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return t.parent?t.getRoot().preset:n.load.preset},set:function(c){t.parent?t.getRoot().preset=c:n.load.preset=c,function(d){for(var f=0;f<d.__preset_select.length;f++)d.__preset_select[f].value===d.preset&&(d.__preset_select.selectedIndex=f)}(this),t.revert()}},width:{get:function(){return n.width},set:function(c){n.width=c,U_(t,c)}},name:{get:function(){return n.name},set:function(c){n.name=c,a&&(a.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(c){n.closed=c,n.closed?Pe.addClass(t.__ul,r.CLASS_CLOSED):Pe.removeClass(t.__ul,r.CLASS_CLOSED),this.onResize(),t.__closeButton&&(t.__closeButton.innerHTML=c?r.TEXT_OPEN:r.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return o},set:function(c){mp&&(o=c,c?Pe.bind(window,"unload",s):Pe.unbind(window,"unload",s),localStorage.setItem(dc(t,"isLocal"),c))}}}),Ke.isUndefined(n.parent)){if(this.closed=n.closed||!1,Pe.addClass(this.domElement,r.CLASS_MAIN),Pe.makeSelectable(this.domElement,!1),mp&&o){t.useLocalStorage=!0;var l=localStorage.getItem(dc(this,"gui"));l&&(n.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=r.TEXT_CLOSED,Pe.addClass(this.__closeButton,r.CLASS_CLOSE_BUTTON),n.closeOnTop?(Pe.addClass(this.__closeButton,r.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(Pe.addClass(this.__closeButton,r.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),Pe.bind(this.__closeButton,"click",function(){t.closed=!t.closed})}else{n.closed===void 0&&(n.closed=!0);var u=document.createTextNode(n.name);Pe.addClass(u,"controller-name"),a=N_(t,u),Pe.addClass(this.__ul,r.CLASS_CLOSED),Pe.addClass(a,"title"),Pe.bind(a,"click",function(c){return c.preventDefault(),t.closed=!t.closed,!1}),n.closed||(this.closed=!1)}n.autoPlace&&(Ke.isUndefined(n.parent)&&(cT&&(cc=document.createElement("div"),Pe.addClass(cc,"dg"),Pe.addClass(cc,r.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(cc),cT=!1),cc.appendChild(this.domElement),Pe.addClass(this.domElement,r.CLASS_AUTO_PLACE)),this.parent||U_(t,n.width)),this.__resizeHandler=function(){t.onResizeDebounced()},Pe.bind(window,"resize",this.__resizeHandler),Pe.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),Pe.bind(this.__ul,"transitionend",this.__resizeHandler),Pe.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&AP(this),s=function(){mp&&localStorage.getItem(dc(t,"isLocal"))==="true"&&localStorage.setItem(dc(t,"gui"),JSON.stringify(t.getSaveObject()))},this.saveToLocalStorageIfPossible=s,n.parent||((i=t.getRoot()).width+=1,Ke.defer(function(){i.width-=1}))};function N_(r,e,t){var n=document.createElement("li");return e&&n.appendChild(e),t?r.__ul.insertBefore(n,t):r.__ul.appendChild(n),r.onResize(),n}function pT(r){Pe.unbind(window,"resize",r.__resizeHandler),r.saveToLocalStorageIfPossible&&Pe.unbind(window,"unload",r.saveToLocalStorageIfPossible)}function F_(r,e){var t=r.__preset_select[r.__preset_select.selectedIndex];t.innerHTML=e?t.value+"*":t.value}function fT(r,e){var t=r.getRoot(),n=t.__rememberedObjects.indexOf(e.object);if(n!==-1){var i=t.__rememberedObjectIndecesToControllers[n];if(i===void 0&&(i={},t.__rememberedObjectIndecesToControllers[n]=i),i[e.property]=e,t.load&&t.load.remembered){var o=t.load.remembered,s=void 0;if(o[r.preset])s=o[r.preset];else{if(!o.Default)return;s=o.Default}if(s[n]&&s[n][e.property]!==void 0){var a=s[n][e.property];e.initialValue=a,e.setValue(a)}}}}function gp(r,e,t,n){if(e[t]===void 0)throw new Error('Object "'+e+'" has no property "'+t+'"');var i=void 0;if(n.color)i=new O_(e,t);else{var o=[e,t].concat(n.factoryArgs);i=TP.apply(r,o)}n.before instanceof Tu&&(n.before=n.before.__li),fT(r,i),Pe.addClass(i.domElement,"c");var s=document.createElement("span");Pe.addClass(s,"property-name"),s.innerHTML=i.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(i.domElement);var l=N_(r,a,n.before);return Pe.addClass(l,Ln.CLASS_CONTROLLER_ROW),i instanceof O_?Pe.addClass(l,"color"):Pe.addClass(l,gP(i.getValue())),function(u,c,d){if(d.__li=c,d.__gui=u,Ke.extend(d,{options:function(g){if(arguments.length>1){var _=d.__li.nextElementSibling;return d.remove(),gp(u,d.object,d.property,{before:_,factoryArgs:[Ke.toArray(arguments)]})}if(Ke.isArray(g)||Ke.isObject(g)){var y=d.__li.nextElementSibling;return d.remove(),gp(u,d.object,d.property,{before:y,factoryArgs:[g]})}},name:function(g){return d.__li.firstElementChild.firstElementChild.innerHTML=g,d},listen:function(){return d.__gui.listen(d),d},remove:function(){return d.__gui.remove(d),d}}),d instanceof L_){var f=new hg(d.object,d.property,{min:d.__min,max:d.__max,step:d.__step});Ke.each(["updateDisplay","onChange","onFinishChange","step","min","max"],function(g){var _=d[g],y=f[g];d[g]=f[g]=function(){var w=Array.prototype.slice.call(arguments);return y.apply(f,w),_.apply(d,w)}}),Pe.addClass(c,"has-slider"),d.domElement.insertBefore(f.domElement,d.domElement.firstElementChild)}else if(d instanceof hg){var m=function(g){if(Ke.isNumber(d.__min)&&Ke.isNumber(d.__max)){var _=d.__li.firstElementChild.firstElementChild.innerHTML,y=d.__gui.__listening.indexOf(d)>-1;d.remove();var w=gp(u,d.object,d.property,{before:d.__li.nextElementSibling,factoryArgs:[d.__min,d.__max,d.__step]});return w.name(_),y&&w.listen(),w}return g};d.min=Ke.compose(m,d.min),d.max=Ke.compose(m,d.max)}else d instanceof oT?(Pe.bind(c,"click",function(){Pe.fakeEvent(d.__checkbox,"click")}),Pe.bind(d.__checkbox,"click",function(g){g.stopPropagation()})):d instanceof uT?(Pe.bind(c,"click",function(){Pe.fakeEvent(d.__button,"click")}),Pe.bind(c,"mouseover",function(){Pe.addClass(d.__button,"hover")}),Pe.bind(c,"mouseout",function(){Pe.removeClass(d.__button,"hover")})):d instanceof O_&&(Pe.addClass(c,"color"),d.updateDisplay=Ke.compose(function(g){return c.style.borderLeftColor=d.__color.toString(),g},d.updateDisplay),d.updateDisplay());d.setValue=Ke.compose(function(g){return u.getRoot().__preset_select&&d.isModified()&&F_(u.getRoot(),!0),g},d.setValue)}(r,l,i),r.__controllers.push(i),i}function dc(r,e){return document.location.href+"."+e}function B_(r,e,t){var n=document.createElement("option");n.innerHTML=e,n.value=e,r.__preset_select.appendChild(n),t&&(r.__preset_select.selectedIndex=r.__preset_select.length-1)}function mT(r,e){e.style.display=r.useLocalStorage?"block":"none"}function MP(r){var e=r.__save_row=document.createElement("li");Pe.addClass(r.domElement,"has-save"),r.__ul.insertBefore(e,r.__ul.firstChild),Pe.addClass(e,"save-row");var t=document.createElement("span");t.innerHTML=" ",Pe.addClass(t,"button gears");var n=document.createElement("span");n.innerHTML="Save",Pe.addClass(n,"button"),Pe.addClass(n,"save");var i=document.createElement("span");i.innerHTML="New",Pe.addClass(i,"button"),Pe.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",Pe.addClass(o,"button"),Pe.addClass(o,"revert");var s=r.__preset_select=document.createElement("select");if(r.load&&r.load.remembered?Ke.each(r.load.remembered,function(c,d){B_(r,d,d===r.preset)}):B_(r,"Default",!1),Pe.bind(s,"change",function(){for(var c=0;c<r.__preset_select.length;c++)r.__preset_select[c].innerHTML=r.__preset_select[c].value;r.preset=this.value}),e.appendChild(s),e.appendChild(t),e.appendChild(n),e.appendChild(i),e.appendChild(o),mp){var a=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block",localStorage.getItem(dc(0,"isLocal"))==="true"&&l.setAttribute("checked","checked"),mT(r,a),Pe.bind(l,"change",function(){r.useLocalStorage=!r.useLocalStorage,mT(r,a)})}var u=document.getElementById("dg-new-constructor");Pe.bind(u,"keydown",function(c){!c.metaKey||c.which!==67&&c.keyCode!==67||cg.hide()}),Pe.bind(t,"click",function(){u.innerHTML=JSON.stringify(r.getSaveObject(),void 0,2),cg.show(),u.focus(),u.select()}),Pe.bind(n,"click",function(){r.save()}),Pe.bind(i,"click",function(){var c=prompt("Enter a new preset name.");c&&r.saveAs(c)}),Pe.bind(o,"click",function(){r.revert()})}function AP(r){var e=void 0;function t(o){return o.preventDefault(),r.width+=e-o.clientX,r.onResize(),e=o.clientX,!1}function n(){Pe.removeClass(r.__closeButton,Ln.CLASS_DRAG),Pe.unbind(window,"mousemove",t),Pe.unbind(window,"mouseup",n)}function i(o){return o.preventDefault(),e=o.clientX,Pe.addClass(r.__closeButton,Ln.CLASS_DRAG),Pe.bind(window,"mousemove",t),Pe.bind(window,"mouseup",n),!1}r.__resize_handle=document.createElement("div"),Ke.extend(r.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),Pe.bind(r.__resize_handle,"mousedown",i),Pe.bind(r.__closeButton,"mousedown",i),r.domElement.insertBefore(r.__resize_handle,r.domElement.firstElementChild)}function U_(r,e){r.domElement.style.width=e+"px",r.__save_row&&r.autoPlace&&(r.__save_row.style.width=e+"px"),r.__closeButton&&(r.__closeButton.style.width=e+"px")}function dg(r,e){var t={};return Ke.each(r.__rememberedObjects,function(n,i){var o={},s=r.__rememberedObjectIndecesToControllers[i];Ke.each(s,function(a,l){o[l]=e?a.initialValue:a.getValue()}),t[i]=o}),t}Ln.toggleHide=function(){D_=!D_,Ke.each(dT,function(r){r.domElement.style.display=D_?"none":""})},Ln.CLASS_AUTO_PLACE="a",Ln.CLASS_AUTO_PLACE_CONTAINER="ac",Ln.CLASS_MAIN="main",Ln.CLASS_CONTROLLER_ROW="cr",Ln.CLASS_TOO_TALL="taller-than-window",Ln.CLASS_CLOSED="closed",Ln.CLASS_CLOSE_BUTTON="close-button",Ln.CLASS_CLOSE_TOP="close-top",Ln.CLASS_CLOSE_BOTTOM="close-bottom",Ln.CLASS_DRAG="drag",Ln.DEFAULT_WIDTH=245,Ln.TEXT_CLOSED="Close Controls",Ln.TEXT_OPEN="Open Controls",Ln._keydownHandler=function(r){document.activeElement.type==="text"||r.which!==72&&r.keyCode!==72||Ln.toggleHide()},Pe.bind(window,"keydown",Ln._keydownHandler,!1),Ke.extend(Ln.prototype,{add:function(r,e){return gp(this,r,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(r,e){return gp(this,r,e,{color:!0})},remove:function(r){this.__ul.removeChild(r.__li),this.__controllers.splice(this.__controllers.indexOf(r),1);var e=this;Ke.defer(function(){e.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&cc.removeChild(this.domElement);var r=this;Ke.each(this.__folders,function(e){r.removeFolder(e)}),Pe.unbind(window,"keydown",Ln._keydownHandler,!1),pT(this)},addFolder:function(r){if(this.__folders[r]!==void 0)throw new Error('You already have a folder in this GUI by the name "'+r+'"');var e={name:r,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[r]&&(e.closed=this.load.folders[r].closed,e.load=this.load.folders[r]);var t=new Ln(e);this.__folders[r]=t;var n=N_(this,t.domElement);return Pe.addClass(n,"folder"),t},removeFolder:function(r){this.__ul.removeChild(r.domElement.parentElement),delete this.__folders[r.name],this.load&&this.load.folders&&this.load.folders[r.name]&&delete this.load.folders[r.name],pT(r);var e=this;Ke.each(r.__folders,function(t){r.removeFolder(t)}),Ke.defer(function(){e.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var r=this.getRoot();if(r.scrollable){var e=Pe.getOffset(r.__ul).top,t=0;Ke.each(r.__ul.childNodes,function(n){r.autoPlace&&n===r.__save_row||(t+=Pe.getHeight(n))}),window.innerHeight-e-20<t?(Pe.addClass(r.domElement,Ln.CLASS_TOO_TALL),r.__ul.style.height=window.innerHeight-e-20+"px"):(Pe.removeClass(r.domElement,Ln.CLASS_TOO_TALL),r.__ul.style.height="auto")}r.__resize_handle&&Ke.defer(function(){r.__resize_handle.style.height=r.__ul.offsetHeight+"px"}),r.__closeButton&&(r.__closeButton.style.width=r.width+"px")},onResizeDebounced:Ke.debounce(function(){this.onResize()},50),remember:function(){if(Ke.isUndefined(cg)&&((cg=new EP).domElement.innerHTML=wP),this.parent)throw new Error("You can only call remember on a top level GUI.");var r=this;Ke.each(Array.prototype.slice.call(arguments),function(e){r.__rememberedObjects.length===0&&MP(r),r.__rememberedObjects.indexOf(e)===-1&&r.__rememberedObjects.push(e)}),this.autoPlace&&U_(this,this.width)},getRoot:function(){for(var r=this;r.parent;)r=r.parent;return r},getSaveObject:function(){var r=this.load;return r.closed=this.closed,this.__rememberedObjects.length>0&&(r.preset=this.preset,r.remembered||(r.remembered={}),r.remembered[this.preset]=dg(this)),r.folders={},Ke.each(this.__folders,function(e,t){r.folders[t]=e.getSaveObject()}),r},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=dg(this),F_(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(r){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=dg(this,!0)),this.load.remembered[r]=dg(this),this.preset=r,B_(this,r,!0),this.saveToLocalStorageIfPossible()},revert:function(r){Ke.each(this.__controllers,function(e){this.getRoot().load.remembered?fT(r||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())},this),Ke.each(this.__folders,function(e){e.revert(e)}),r||F_(this.getRoot(),!1)},listen:function(r){var e=this.__listening.length===0;this.__listening.push(r),e&&function t(n){n.length!==0&&SP.call(window,function(){t(n)}),Ke.each(n,function(i){i.updateDisplay()})}(this.__listening)},updateDisplay:function(){Ke.each(this.__controllers,function(r){r.updateDisplay()}),Ke.each(this.__folders,function(r){r.updateDisplay()})}});var PP=Ln,CP=function(){function r(e){this.runTime={fps:0,resolution:""},this.target=e.target,this.data=e.params,this.player=e.player,this.gui=this.createControllerGUI(),this.createStats(),this.addEventListener()}return r.prototype.createStats=function(){var e=this;setInterval(function(){e.controller.runTimeFps.setValue(e.player.runtime.fps),e.controller.runTimeResolution.setValue(e.player.view.width+"*"+e.player.view.height)},500)},r.prototype.createControllerGUI=function(){var e,t,n,i,o,s,a=new PP({autoPlace:!0,closed:!0});return a.domElement.style.opacity=".6",a.domElement.style.transformOrigin="100% 0",a.domElement.style.transform="scale(1.4)",this.target.appendChild(a.domElement),a.domElement.style.position="absolute",a.domElement.style.right="0",a.domElement.style.top="0",a.domElement.style.zIndex="2",this.controller={runTimeFps:a.add({FPS:0},"FPS",0),runTimeResolution:a.add({\u5206\u8FA8\u7387:""},"\u5206\u8FA8\u7387",""),autoFps:a.add({\u81EA\u52A8fps:(e=this.data.autoFPS)===null||e===void 0||e},"\u81EA\u52A8fps",!0),autoResolution:a.add({\u81EA\u52A8\u5206\u8FA8\u7387:(t=this.data.autoResolution)!==null&&t!==void 0&&t},"\u81EA\u52A8\u5206\u8FA8\u7387",!0),moreCalculation:a.add({\u989D\u5916\u8BA1\u7B97:0},"\u989D\u5916\u8BA1\u7B97",0,100),minFPS:a.add({\u6700\u4F4Efps:(n=this.data.minFPS)!==null&&n!==void 0?n:40},"\u6700\u4F4Efps",0,60),maxFPS:a.add({\u6700\u9AD8fps:(i=this.data.maxFPS)!==null&&i!==void 0?i:50},"\u6700\u9AD8fps",0,60),resolution:a.add({\u76EE\u6807\u5206\u8FA8\u500D\u7387:(o=this.data.resolution)!==null&&o!==void 0?o:window.devicePixelRatio},"\u76EE\u6807\u5206\u8FA8\u500D\u7387",.5,4),minResolution:a.add({\u6700\u5C0F\u5206\u8FA8\u500D\u7387:(s=this.data.minResolution)!==null&&s!==void 0?s:1},"\u6700\u5C0F\u5206\u8FA8\u500D\u7387",.5,4)},this.controller.runTimeFps.disabled=!0,this.controller.runTimeResolution.disabled=!0,a},r.prototype.addEventListener=function(){var e,t=this;this.controller.autoFps.onChange(function(n){t.data.autoFPS=n,t.player.updateConfig(t.data)}),this.controller.maxFPS.onChange(function(n){t.data.maxFPS=n,t.player.updateConfig(t.data)}),this.controller.minFPS.onChange(function(n){t.data.minFPS=n,t.player.updateConfig(t.data)}),this.controller.autoResolution.onChange(function(n){t.data.autoResolution=n,t.player.updateConfig(t.data)}),this.controller.minResolution.onChange(function(n){t.data.minResolution=n,t.player.updateConfig(t.data)}),this.controller.resolution.onChange(function(n){t.data.resolution=n,t.player.updateConfig(t.data)}),this.controller.moreCalculation.onChange(function(n){e&&t.player.app.ticker.remove(e),n>0&&(e=function(){for(var i="";i.length<n;)i+=Math.random().toString(32).substr(2);eg()(i)},t.player.app.ticker.add(e))})},r}(),RP=function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])})(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),gT=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})},vT=function(r,e){var t,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,n=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(r,s)}catch(d){c=[6,d],n=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}},IP=window.ResizeObserver||aP,cr={syncDispatch:"syncDispatch",syncReceive:"syncReceive",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd"},LP=function(r){function e(t){var n=r.call(this)||this;return n.__slideState={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,appliedInteractiveSeqIds:[]},n.resize=!1,n.isAnimating=!1,n.renderingTaskManager=new cP,n.isLoading=!1,n.interactive=!0,n.player=new J2,n.frameWidth=1,n.frameHeight=1,n.frame=document.createElement("div"),n.frameResizeObserver=new IP(function(i){return n.frameResizeHandler(i)}),n.anchor=t.anchor,n.resize=t.resize||!1,n.interactive=t.interactive,n.player.setInteractive(n.interactive),n.player.updateConfig(t.renderOptions||{}),n.frame.style.cssText="width:100%;height:100%;display:flex;justify-content:center;align-items:center",n.frame.appendChild(n.player.view),n.anchor.appendChild(n.frame),(t==null?void 0:t.controller)&&new CP({player:n.player,params:t.renderOptions||{},target:n.frame}),n.frameResizeObserver.observe(n.frame),n.player.on(mn.renderStart,function(i){n.isLoading=!0,n.emit(cr.renderStart,i)}),n.player.on(mn.renderEnd,function(i){n.isLoading=!1,n.emit(cr.renderEnd,i)}),n.player.on(mn.slideChange,function(i){n.__slideState.currentSlideIndex=i,n.emit(cr.slideChange,i)}),n.player.on(mn.mainSeqStateChange,function(i){n.__slideState.mainSeqState=i}),n.player.on(mn.mainSeqStepChange,function(i){n.__slideState.mainSeqStep=i}),n.player.on(mn.animateStart,function(){n.isAnimating!==!0&&(n.isAnimating=!0,n.emit(cr.animateStart))}),n.player.on(mn.animateEnd,function(){n.isAnimating!==!1&&(n.isAnimating=!1,n.emit(cr.animateEnd))}),n.player.on(mn.interactiveAnimTrigger,function(i){var o=i.action,s=i.seqId;n.__slideState.appliedInteractiveSeqIds.push(s),n.emit(cr.syncDispatch,{type:"interactiveAnim",action:o})}),n.player.on(mn.mainSeqStepStart,Object(oe.throttle)(function(i){n.emit(cr.mainSeqStepStart)},100)),n.player.on(mn.mainSeqStepEnd,Object(oe.throttle)(function(i){n.emit(cr.mainSeqStepEnd)},100)),n.on(cr.syncReceive,n.receiveSyncHandler),n.renderingTaskManager.eventHub.on("task-error",function(i){var o=i.error,s=i.task;n.emit(cr.renderError,{error:o,index:s.slideIndex})}),n}return RP(e,r),e.prototype.frameResizeHandler=function(t){var n=t[0].contentRect,i=n.width,o=n.height;this.frameWidth=i,this.frameHeight=o,this.resizeView()},e.prototype.resizeView=function(){var t=this.width,n=this.height;if(t>0&&n>0){var i=this.frameWidth/t,o=i*n;if(o>this.frameHeight&&(i*=this.frameHeight/o),this.resize){var s=this.player.app,a=i*(this.player.config.resolution||window.devicePixelRatio);s.renderer.resolution=a,s.renderer.plugins.interaction.resolution=s.renderer.resolution,s.renderer.resize(this.width,this.height)}this.view.style.transform="scale("+i+")"}},e.prototype.receiveSyncHandler=function(t){var n=this;t.type==="nextStep"?this.mainSeqStep===t.next-1||this.mainSeqStep+1===this.mainSeqLength?this.nextStep(!0):(this.setMainSeqStep(t.next,"start"),this.player.nextTick(function(){n.nextStep(!0)})):t.type==="prevStep"?this.mainSeqStep===0&&this.mainSeqState==="idle"||this.mainSeqStep===t.next+1||this.mainSeqStep+1===this.mainSeqLength?this.prevStep(!0):(this.setMainSeqStep(t.next+1,"start"),this.player.nextTick(function(){n.prevStep(!0)})):t.type==="interactiveAnim"?this.player.applyInteractiveAction(t.action):t.type==="renderSlide"&&this.renderSlide(t.index,!0)},e.prototype.setSlideState=function(t){return gT(this,void 0,void 0,function(){var n,i=this;return vT(this,function(o){switch(o.label){case 0:return t.taskId&&t.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=t.taskId,this.player.setResourceData(t.taskId,this.__slideState.url)),t.url&&t.url!==this.__slideState.url&&(this.__slideState.url=t.url,this.player.setResourceData(this.__slideState.taskId,t.url)),Number.isInteger(t.currentSlideIndex)&&t.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=t.currentSlideIndex,[4,this.renderSlide(t.currentSlideIndex)]):[3,2];case 1:o.sent(),o.label=2;case 2:return[4,fP(function(){return i.player.currentIndex===t.currentSlideIndex&&i.player.currentStage},3e3)];case 3:return o.sent(),n=!1,Number.isInteger(t.mainSeqStep)&&t.mainSeqStep!==this.__slideState.mainSeqStep&&(n=!0,this.__slideState.mainSeqStep=t.mainSeqStep),t.mainSeqState&&t.mainSeqState!==this.__slideState.mainSeqState&&(n=!0,this.__slideState.mainSeqState=t.mainSeqState),n&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),t.appliedInteractiveSeqIds&&t.appliedInteractiveSeqIds.length>0&&(this.__slideState.appliedInteractiveSeqIds=t.appliedInteractiveSeqIds,t.appliedInteractiveSeqIds.forEach(function(s){i.player.seekInteractiveSeqToEnd(s)})),[2]}})})},Object.defineProperty(e.prototype,"slideCount",{get:function(){return this.player.slideCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqLength",{get:function(){return this.player.mainSeqLength()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqStep",{get:function(){return this.player.mainSeqStep()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqState",{get:function(){return this.player.mainSeqState()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderOptions",{get:function(){return this.player.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderFps",{get:function(){return this.player.runtime.fps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runtimeFps",{get:function(){return this.player.fps.value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this.player.view},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.player.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.player.height},enumerable:!1,configurable:!0}),e.prototype.updateRenderOption=function(t){this.player.updateConfig(t)},e.prototype.setResource=function(t,n){this.player.setResourceData(t,n),this.__slideState.taskId=t,this.__slideState.url=n,this.emit(cr.syncDispatch,{type:"setResource",taskId:t,url:n})},e.prototype._renderSlide=function(t,n){return n===void 0&&(n=!1),gT(this,void 0,void 0,function(){return vT(this,function(i){switch(i.label){case 0:return this.isLoading=!0,[4,this.player.renderSlide(t)];case 1:return i.sent(),this.__slideState.currentSlideIndex=t,this.isLoading=!1,this.resizeView(),n||this.emit(cr.syncDispatch,{type:"renderSlide",index:t}),[2]}})})},e.prototype.renderSlide=function(t,n){var i=this;n===void 0&&(n=!1);var o=Number(t);(o!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(o>this.slideCount&&this.slideCount>0||this.renderingTaskManager.addTask(function(){return i._renderSlide(o,n)},o))},e.prototype.nextStep=function(t){if(t===void 0&&(t=!1),!this.isLoading){this.player.nextStep();var n=this.player.mainSeqStep();this.__slideState.mainSeqStep=n,t||this.emit(cr.syncDispatch,{type:"nextStep",next:n})}},e.prototype.prevStep=function(t){if(t===void 0&&(t=!1),!this.isLoading){this.player.prevStep();var n=this.player.mainSeqStep();this.__slideState.mainSeqStep=n,t||this.emit(cr.syncDispatch,{type:"prevStep",next:n})}},e.prototype.setMainSeqStep=function(t,n){this.player.setMainSeqStep(t,n)},e.prototype.setInteractive=function(t){this.interactive=t,this.player.setInteractive(t)},e.prototype.pause=function(){this.player.pause()},e.prototype.resume=function(){this.player.resume()},e.prototype.destroy=function(){this.frameResizeObserver.disconnect(),this.player.removeAllListeners(),this.player.destroy(),this.player.removeAllListeners();try{this.anchor.removeChild(this.player.view)}catch{}},e}(k.a)}]);class H_{constructor(){this.disposers=new Map,this.disposerIDGenCount=-1}add(L,v=this.genDisposerID()){return this.flush(v),this.disposers.set(v,L()),v}addEventListener(L,v,b,q,B=this.genDisposerID()){return this.add(()=>(L.addEventListener(v,b,q),()=>L.removeEventListener(v,b,q)),B),B}setTimeout(L,v,b=this.genDisposerID()){return this.add(()=>{const q=window.setTimeout(()=>{this.remove(b),L()},v);return()=>window.clearTimeout(q)},b)}setInterval(L,v,b=this.genDisposerID()){return this.add(()=>{const q=window.setInterval(L,v);return()=>window.clearInterval(q)},b)}remove(L){const v=this.disposers.get(L);return this.disposers.delete(L),v}flush(L){const v=this.remove(L);if(v)try{v()}catch(b){console.error(b)}}flushAll(){this.disposers.forEach(L=>{try{L()}catch(v){console.error(v)}}),this.disposers.clear()}genDisposerID(){const{MAX_SAFE_INTEGER:L=9007199254740991}=Number;return this.disposerIDGenCount=(this.disposerIDGenCount+1)%L,`disposer-${this.disposerIDGenCount}`}}function FP(R){return R!=null&&typeof R=="object"&&!Array.isArray(R)}function BP(R,L){let v=R.getAttributes();if(v||(R.setAttributes(L),v=R.getAttributes()),!v)throw new Error("[NetlessAppMonaco] No attributes");return FP(L)&&Object.keys(L).forEach(b=>{Object.prototype.hasOwnProperty.call(v,b)||R.updateAttributes([b],L[b])}),v}function UP(R,L,v){return Math.min(Math.max(R,L),v)}function kP(R){return typeof R=="object"&&R!==null}function GP(R,L,v){const b=L.slideState.currentSlideIndex;if(b==null)return;const q=[v,b].join("/");if(R.scenePathType(q)==="none"){R.removeScenes(v);const B=L.slideCount,ie=[];for(let k=1;k<=B;++k)ie.push({name:`${k}`});R.putScenes(v,ie)}R.setScenePath(q)}function HP(R){const{width:L,height:v,slideCount:b,slideState:q}=R,{taskId:B,url:ie}=q,k=[];for(let oe=1;oe<=b;++oe)k.push({width:L,height:v,thumbnail:`${ie}/${B}/preview/${oe}.png`,src:"ppt"});return k}class zP{constructor(L,v,b,q,B,ie,k){this.slide=L,this.onPageChanged=v,this.onTransitionStart=b,this.onTransitionEnd=q,this.onDispatchSyncEvent=B,this.initialState=ie,this.initialPage=k,this.pollCount=0,this.pollReadyState=()=>{this.isReady()?this.resolveReady(this):this.pollCount<20?(this.pollCount++,setTimeout(this.pollReadyState,500)):this.reject()},this.targetingPage=-1,L.on(jr.SLIDE_EVENTS.slideChange,v),L.on(jr.SLIDE_EVENTS.renderStart,b),L.on(jr.SLIDE_EVENTS.renderEnd,q),L.on(jr.SLIDE_EVENTS.mainSeqStepStart,b),L.on(jr.SLIDE_EVENTS.mainSeqStepEnd,q),L.on(jr.SLIDE_EVENTS.syncDispatch,B),L.on(jr.SLIDE_EVENTS.renderError,({error:oe})=>{console.warn("[Slide] render error",oe),q()}),ie?L.setSlideState(ie):L.renderSlide(k),this.ready=new Promise((oe,X)=>{this.resolveReady=oe,this.reject=X}),this.pollReadyState()}receiveSyncEvent(L){this.slide.emit(jr.SLIDE_EVENTS.syncReceive,L)}isReady(){return this.slide.slideCount>0}jumpToPage(L){!this.isReady()||(L=UP(L,1,this.slide.slideCount),L!==this.targetingPage&&(this.targetingPage=L,this.slide.renderSlide(L)))}destroy(){this.slide.destroy()}}async function VP(R,L,v,b,q,B,ie,k,oe,X){const K=new jr.Slide({anchor:R,interactive:!0,resize:!0,controller:b});return K.setResource(L,v),new zP(K,ie,k,oe,X,q,B).ready}function jP(R){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${R}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),v.appendChild(b),v}function WP(R){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${R}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),v.appendChild(b),v}function XP(R){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${R}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),v.appendChild(b),v}function YP(R){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${R}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),v.appendChild(b),v}function qP(R){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${R}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),v.appendChild(b),v}const Eu=typeof window!="undefined",IT=Eu&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),LT=Eu&&"IntersectionObserver"in window,OT=Eu&&"classList"in document.createElement("p"),DT=Eu&&window.devicePixelRatio>1,ZP={elements_selector:".lazy",container:IT||Eu?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},NT=R=>Object.assign({},ZP,R),FT=function(R,L){let v;const b="LazyLoad::Initialized",q=new R(L);try{v=new CustomEvent(b,{detail:{instance:q}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(b,!1,!1,{instance:q})}window.dispatchEvent(v)},JP=(R,L)=>{if(!!L)if(!L.length)FT(R,L);else for(let v=0,b;b=L[v];v+=1)FT(R,b)},pa="src",z_="srcset",V_="sizes",BT="poster",bp="llOriginalAttrs",j_="loading",UT="loaded",kT="applied",$P="entered",W_="error",GT="native",HT="data-",zT="ll-status",lo=(R,L)=>R.getAttribute(HT+L),KP=(R,L,v)=>{var b=HT+L;if(v===null){R.removeAttribute(b);return}R.setAttribute(b,v)},wp=R=>lo(R,zT),Mu=(R,L)=>KP(R,zT,L),fg=R=>Mu(R,null),X_=R=>wp(R)===null,QP=R=>wp(R)===j_,eC=R=>wp(R)===W_,Y_=R=>wp(R)===GT,tC=[j_,UT,kT,W_],nC=R=>tC.indexOf(wp(R))>=0,il=(R,L,v,b)=>{if(!!R){if(b!==void 0){R(L,v,b);return}if(v!==void 0){R(L,v);return}R(L)}},pc=(R,L)=>{if(OT){R.classList.add(L);return}R.className+=(R.className?" ":"")+L},ws=(R,L)=>{if(OT){R.classList.remove(L);return}R.className=R.className.replace(new RegExp("(^|\\s+)"+L+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},iC=R=>{R.llTempImage=document.createElement("IMG")},rC=R=>{delete R.llTempImage},VT=R=>R.llTempImage,mg=(R,L)=>{if(!L)return;const v=L._observer;!v||v.unobserve(R)},oC=R=>{R.disconnect()},sC=(R,L,v)=>{L.unobserve_entered&&mg(R,v)},q_=(R,L)=>{!R||(R.loadingCount+=L)},aC=R=>{!R||(R.toLoadCount-=1)},jT=(R,L)=>{!R||(R.toLoadCount=L)},lC=R=>R.loadingCount>0,uC=R=>R.toLoadCount>0,WT=R=>{let L=[];for(let v=0,b;b=R.children[v];v+=1)b.tagName==="SOURCE"&&L.push(b);return L},Z_=(R,L)=>{const v=R.parentNode;if(!v||v.tagName!=="PICTURE")return;WT(v).forEach(L)},XT=(R,L)=>{WT(R).forEach(L)},gg=[pa],YT=[pa,BT],vg=[pa,z_,V_],_g=R=>!!R[bp],qT=R=>R[bp],ZT=R=>delete R[bp],Tp=(R,L)=>{if(_g(R))return;const v={};L.forEach(b=>{v[b]=R.getAttribute(b)}),R[bp]=v},hC=R=>{_g(R)||(R[bp]={backgroundImage:R.style.backgroundImage})},cC=(R,L,v)=>{if(!v){R.removeAttribute(L);return}R.setAttribute(L,v)},Sp=(R,L)=>{if(!_g(R))return;const v=qT(R);L.forEach(b=>{cC(R,b,v[b])})},dC=R=>{if(!_g(R))return;const L=qT(R);R.style.backgroundImage=L.backgroundImage},pC=(R,L,v)=>{pc(R,L.class_applied),Mu(R,kT),!!v&&(L.unobserve_completed&&mg(R,L),il(L.callback_applied,R,v))},JT=(R,L,v)=>{pc(R,L.class_loading),Mu(R,j_),!!v&&(q_(v,1),il(L.callback_loading,R,v))},Au=(R,L,v)=>{!v||R.setAttribute(L,v)},$T=(R,L)=>{Au(R,V_,lo(R,L.data_sizes)),Au(R,z_,lo(R,L.data_srcset)),Au(R,pa,lo(R,L.data_src))},fC=(R,L)=>{Z_(R,v=>{Tp(v,vg),$T(v,L)}),Tp(R,vg),$T(R,L)},mC=(R,L)=>{Tp(R,gg),Au(R,pa,lo(R,L.data_src))},gC=(R,L)=>{XT(R,v=>{Tp(v,gg),Au(v,pa,lo(v,L.data_src))}),Tp(R,YT),Au(R,BT,lo(R,L.data_poster)),Au(R,pa,lo(R,L.data_src)),R.load()},vC=(R,L,v)=>{const b=lo(R,L.data_bg),q=lo(R,L.data_bg_hidpi),B=DT&&q?q:b;!B||(R.style.backgroundImage=`url("${B}")`,VT(R).setAttribute(pa,B),JT(R,L,v))},_C=(R,L,v)=>{const b=lo(R,L.data_bg_multi),q=lo(R,L.data_bg_multi_hidpi),B=DT&&q?q:b;!B||(R.style.backgroundImage=B,pC(R,L,v))},KT={IMG:fC,IFRAME:mC,VIDEO:gC},yC=(R,L)=>{const v=KT[R.tagName];!v||v(R,L)},xC=(R,L,v)=>{const b=KT[R.tagName];!b||(b(R,L),JT(R,L,v))},bC=["IMG","IFRAME","VIDEO"],wC=R=>bC.indexOf(R.tagName)>-1,QT=(R,L)=>{L&&!lC(L)&&!uC(L)&&il(R.callback_finish,L)},eS=(R,L,v)=>{R.addEventListener(L,v),R.llEvLisnrs[L]=v},TC=(R,L,v)=>{R.removeEventListener(L,v)},J_=R=>!!R.llEvLisnrs,SC=(R,L,v)=>{J_(R)||(R.llEvLisnrs={});const b=R.tagName==="VIDEO"?"loadeddata":"load";eS(R,b,L),eS(R,"error",v)},$_=R=>{if(!J_(R))return;const L=R.llEvLisnrs;for(let v in L){const b=L[v];TC(R,v,b)}delete R.llEvLisnrs},tS=(R,L,v)=>{rC(R),q_(v,-1),aC(v),ws(R,L.class_loading),L.unobserve_completed&&mg(R,v)},EC=(R,L,v,b)=>{const q=Y_(L);tS(L,v,b),pc(L,v.class_loaded),Mu(L,UT),il(v.callback_loaded,L,b),q||QT(v,b)},MC=(R,L,v,b)=>{const q=Y_(L);tS(L,v,b),pc(L,v.class_error),Mu(L,W_),il(v.callback_error,L,b),q||QT(v,b)},K_=(R,L,v)=>{const b=VT(R)||R;if(J_(b))return;SC(b,ie=>{EC(ie,R,L,v),$_(b)},ie=>{MC(ie,R,L,v),$_(b)})},AC=(R,L,v)=>{iC(R),K_(R,L,v),hC(R),vC(R,L,v),_C(R,L,v)},PC=(R,L,v)=>{K_(R,L,v),xC(R,L,v)},Q_=(R,L,v)=>{wC(R)?PC(R,L,v):AC(R,L,v)},CC=(R,L,v)=>{R.setAttribute("loading","lazy"),K_(R,L,v),yC(R,L),Mu(R,GT)},nS=R=>{R.removeAttribute(pa),R.removeAttribute(z_),R.removeAttribute(V_)},RC=R=>{Z_(R,L=>{nS(L)}),nS(R)},iS=R=>{Z_(R,L=>{Sp(L,vg)}),Sp(R,vg)},IC=R=>{XT(R,L=>{Sp(L,gg)}),Sp(R,YT),R.load()},LC=R=>{Sp(R,gg)},OC={IMG:iS,IFRAME:LC,VIDEO:IC},DC=R=>{const L=OC[R.tagName];if(!L){dC(R);return}L(R)},NC=(R,L)=>{X_(R)||Y_(R)||(ws(R,L.class_entered),ws(R,L.class_exited),ws(R,L.class_applied),ws(R,L.class_loading),ws(R,L.class_loaded),ws(R,L.class_error))},FC=(R,L)=>{DC(R),NC(R,L),fg(R),ZT(R)},BC=(R,L,v,b)=>{!v.cancel_on_exit||!QP(R)||R.tagName==="IMG"&&($_(R),RC(R),iS(R),ws(R,v.class_loading),q_(b,-1),fg(R),il(v.callback_cancel,R,L,b))},UC=(R,L,v,b)=>{const q=nC(R);Mu(R,$P),pc(R,v.class_entered),ws(R,v.class_exited),sC(R,v,b),il(v.callback_enter,R,L,b),!q&&Q_(R,v,b)},kC=(R,L,v,b)=>{X_(R)||(pc(R,v.class_exited),BC(R,L,v,b),il(v.callback_exit,R,L,b))},GC=["IMG","IFRAME","VIDEO"],rS=R=>R.use_native&&"loading"in HTMLImageElement.prototype,HC=(R,L,v)=>{R.forEach(b=>{GC.indexOf(b.tagName)!==-1&&CC(b,L,v)}),jT(v,0)},zC=R=>R.isIntersecting||R.intersectionRatio>0,VC=R=>({root:R.container===document?null:R.container,rootMargin:R.thresholds||R.threshold+"px"}),jC=(R,L,v)=>{R.forEach(b=>zC(b)?UC(b.target,b,L,v):kC(b.target,b,L,v))},WC=(R,L)=>{L.forEach(v=>{R.observe(v)})},XC=(R,L)=>{oC(R),WC(R,L)},YC=(R,L)=>{!LT||rS(R)||(L._observer=new IntersectionObserver(v=>{jC(v,R,L)},VC(R)))},oS=R=>Array.prototype.slice.call(R),yg=R=>R.container.querySelectorAll(R.elements_selector),qC=R=>oS(R).filter(X_),ZC=R=>eC(R),JC=R=>oS(R).filter(ZC),sS=(R,L)=>qC(R||yg(L)),$C=(R,L)=>{JC(yg(R)).forEach(b=>{ws(b,R.class_error),fg(b)}),L.update()},KC=(R,L)=>{!Eu||window.addEventListener("online",()=>{$C(R,L)})},Ep=function(R,L){const v=NT(R);this._settings=v,this.loadingCount=0,YC(v,this),KC(v,this),this.update(L)};Ep.prototype={update:function(R){const L=this._settings,v=sS(R,L);if(jT(this,v.length),IT||!LT){this.loadAll(v);return}if(rS(L)){HC(v,L,this);return}XC(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),yg(this._settings).forEach(R=>{ZT(R)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(R){const L=this._settings;sS(R,L).forEach(b=>{mg(b,this),Q_(b,L,this)})},restoreAll:function(){const R=this._settings;yg(R).forEach(L=>{FC(L,R)})}};Ep.load=(R,L)=>{const v=NT(L);Q_(R,v)};Ep.resetStatus=R=>{fg(R)};Eu&&JP(Ep,window.lazyLoadOptions);class QC{constructor({readonly:L,box:v,onNewPageIndex:b,onPlay:q}){this._pages=[],this.pageIndex=0,this.setPaused=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new H_,this.readonly=L,this.box=v,this.onNewPageIndex=b,this.onPlay=q,this.render()}set pages(L){this._pages=L,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}mount(){this.box.mountContent(this.$content),this.box.mountFooter(this.$footer)}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(L){this.readonly!==L&&(this.readonly=L,this.$content.classList.toggle(this.wrapClassName("readonly"),L),this.$footer.classList.toggle(this.wrapClassName("readonly"),L),this.$pageNumberInput.disabled=L)}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(L){Number.isNaN(L)||(this.pageIndex=L,this.$pageNumberInput.value=String(L+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(L){this.isSmallBox!==L&&(this.isSmallBox=L,this.$footer.classList.toggle(this.wrapClassName("float-footer"),L))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const L=document.createElement("div");L.className=this.wrapClassName("content"),this.$content=L,this.readonly&&L.classList.add(this.wrapClassName("readonly")),L.appendChild(this.renderPreviewMask()),L.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const L=document.createElement("div");L.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=L,this.refreshPreview(),this.sideEffect.addEventListener(L,"click",v=>{var q;if(this.readonly)return;const b=(q=v.target.dataset)==null?void 0:q.pageIndex;b&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(b)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){const{$preview:L}=this,v=this.wrapClassName("preview-page"),b=this.wrapClassName("preview-page-name");for(;L.firstChild;)L.firstChild.remove();this.pages.forEach((q,B)=>{var le;const ie=(le=q.thumbnail)!=null?le:q.src.startsWith("ppt")?void 0:q.src;if(!ie)return;const k=String(B),oe=document.createElement("a");oe.className=v+" "+this.wrapClassName(`preview-page-${B}`),oe.setAttribute("href","#"),oe.dataset.pageIndex=k;const X=document.createElement("span");X.className=b,X.textContent=String(B+1),X.dataset.pageIndex=k;const K=document.createElement("img");K.width=q.width,K.height=q.height,K.dataset.src=ie,K.dataset.pageIndex=k,oe.appendChild(K),oe.appendChild(X),L.appendChild(oe)}),this.sideEffect.add(()=>{const q=new Ep({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`});return()=>q.destroy()},"preview-lazyload")}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",L=>{this.readonly||L.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const L=document.createElement("div");L.className=this.wrapClassName("footer"),this.$footer=L,this.readonly&&L.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&L.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",jP(this.namespace));this.sideEffect.addEventListener(v,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=v,this.$btnSidebar.style.display="none",this.$footer.appendChild(v);const b=document.createElement("div");b.className=this.wrapClassName("page-jumps");const q=this.renderFooterBtn("btn-page-back",WP(this.namespace));if(this.sideEffect.addEventListener(q,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),b.appendChild(q),this.onPlay){const X=this.renderFooterBtn("btn-page-play",YP(this.namespace),qP(this.namespace));this.$btnPlay=X,this.sideEffect.addEventListener(X,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),b.appendChild(X)}const B=this.renderFooterBtn("btn-page-next",XP(this.namespace));this.sideEffect.addEventListener(B,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),b.appendChild(B);const ie=document.createElement("div");ie.className=this.wrapClassName("page-number");const k=document.createElement("input");k.className=this.wrapClassName("page-number-input"),k.value=String(this.pageIndex+1),this.readonly&&(k.disabled=!0),this.$pageNumberInput=k,this.sideEffect.addEventListener(k,"change",()=>{this.readonly||k.value&&this.onNewPageIndex(Number(k.value)-1)});const oe=document.createElement("span");this.$totalPage=oe,ie.appendChild(k),ie.appendChild(oe),this.$footer.appendChild(b),this.$footer.appendChild(ie)}return this.$footer}renderFooterBtn(L,v,b){const q=document.createElement("button");return q.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(L),q.appendChild(v),b&&q.appendChild(b),q}togglePreview(L){if(this.isShowPreview=L!=null?L:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const v=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));v&&this.$preview.scrollTo({top:v.offsetTop-16})}}wrapClassName(L){return`${this.namespace}-${L}`}}const eR=new Set(["clicker","selector"]);class tR{constructor({box:L,view:v,mountSlideController:b,mountWhiteboard:q}){this.scaleDocsToFit=()=>{if(this.slideController){const{width:B,height:ie}=this.slideController.slide;this.whiteboardView.moveCameraToContain({originX:-B/2,originY:-ie/2,width:B,height:ie,animationMode:"immediately"})}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=B=>{this.slideController&&this.slideController.jumpToPage(B+1)},this.sideEffect=new H_,this.namespace="netless-app-slide",this.box=L,this.whiteboardView=v,this.mountSlideController=b,this.mountWhiteboard=q,this.viewer=new QC({box:L,readonly:L.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",L=>{if(this.box.focus&&this.slideController)switch(L.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderSlideContainer(){if(!this.$slide){const L=document.createElement("div");L.className=this.wrapClassName("slide"),L.dataset.appKind="Slide",this.$slide=L}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView)),this.$whiteboardView}async mount(){return this.viewer.mount(),this.slideController=await this.mountSlideController(this.$slide),this.viewer.pages=HP(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController)),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(L){return(L.slide.slideState.currentSlideIndex||1)-1}unmount(){return this.slideController&&this.slideController.destroy(),this.viewer.unmount(),this}setReadonly(L){this.viewer.setReadonly(L)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(L){this.$whiteboardView.style.pointerEvents=!L||eR.has(L)?"none":"auto"}wrapClassName(L){return`${this.namespace}-${L}`}}var nR=`.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:1.5em;text-align:right;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly .netless-app-slide-footer-btn{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-footer-btn:hover{background:transparent}.netless-app-slide-readonly .netless-app-slide-page-number-input{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-page-number-input:hover,.netless-app-slide-readonly .netless-app-slide-page-number-input:focus,.netless-app-slide-readonly .netless-app-slide-page-number-input:active{background:transparent;box-shadow:none}.netless-app-slide-readonly .netless-app-slide-page-number-input:disabled{color:inherit}.netless-app-slide-readonly.netless-app-slide-float-footer{display:none}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}
|
|
5824
|
-
`;const iR={kind:"Slide",async setup(
|
|
5823
|
+
`));var mp=function(){try{return!!window.localStorage}catch{return!1}}(),cg=void 0,cT=!0,cc=void 0,D_=!1,dT=[],Ln=function r(e){var t=this,n=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),Pe.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=Ke.defaults(n,{closeOnTop:!1,autoPlace:!0,width:r.DEFAULT_WIDTH}),n=Ke.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),Ke.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),Ke.isUndefined(n.parent)&&n.hideable&&dT.push(this),n.resizable=Ke.isUndefined(n.parent)&&n.resizable,n.autoPlace&&Ke.isUndefined(n.scrollable)&&(n.scrollable=!0);var i,o=mp&&localStorage.getItem(dc(this,"isLocal"))==="true",s=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return t.parent?t.getRoot().preset:n.load.preset},set:function(c){t.parent?t.getRoot().preset=c:n.load.preset=c,function(d){for(var f=0;f<d.__preset_select.length;f++)d.__preset_select[f].value===d.preset&&(d.__preset_select.selectedIndex=f)}(this),t.revert()}},width:{get:function(){return n.width},set:function(c){n.width=c,U_(t,c)}},name:{get:function(){return n.name},set:function(c){n.name=c,a&&(a.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(c){n.closed=c,n.closed?Pe.addClass(t.__ul,r.CLASS_CLOSED):Pe.removeClass(t.__ul,r.CLASS_CLOSED),this.onResize(),t.__closeButton&&(t.__closeButton.innerHTML=c?r.TEXT_OPEN:r.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return o},set:function(c){mp&&(o=c,c?Pe.bind(window,"unload",s):Pe.unbind(window,"unload",s),localStorage.setItem(dc(t,"isLocal"),c))}}}),Ke.isUndefined(n.parent)){if(this.closed=n.closed||!1,Pe.addClass(this.domElement,r.CLASS_MAIN),Pe.makeSelectable(this.domElement,!1),mp&&o){t.useLocalStorage=!0;var l=localStorage.getItem(dc(this,"gui"));l&&(n.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=r.TEXT_CLOSED,Pe.addClass(this.__closeButton,r.CLASS_CLOSE_BUTTON),n.closeOnTop?(Pe.addClass(this.__closeButton,r.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(Pe.addClass(this.__closeButton,r.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),Pe.bind(this.__closeButton,"click",function(){t.closed=!t.closed})}else{n.closed===void 0&&(n.closed=!0);var u=document.createTextNode(n.name);Pe.addClass(u,"controller-name"),a=N_(t,u),Pe.addClass(this.__ul,r.CLASS_CLOSED),Pe.addClass(a,"title"),Pe.bind(a,"click",function(c){return c.preventDefault(),t.closed=!t.closed,!1}),n.closed||(this.closed=!1)}n.autoPlace&&(Ke.isUndefined(n.parent)&&(cT&&(cc=document.createElement("div"),Pe.addClass(cc,"dg"),Pe.addClass(cc,r.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(cc),cT=!1),cc.appendChild(this.domElement),Pe.addClass(this.domElement,r.CLASS_AUTO_PLACE)),this.parent||U_(t,n.width)),this.__resizeHandler=function(){t.onResizeDebounced()},Pe.bind(window,"resize",this.__resizeHandler),Pe.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),Pe.bind(this.__ul,"transitionend",this.__resizeHandler),Pe.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&AP(this),s=function(){mp&&localStorage.getItem(dc(t,"isLocal"))==="true"&&localStorage.setItem(dc(t,"gui"),JSON.stringify(t.getSaveObject()))},this.saveToLocalStorageIfPossible=s,n.parent||((i=t.getRoot()).width+=1,Ke.defer(function(){i.width-=1}))};function N_(r,e,t){var n=document.createElement("li");return e&&n.appendChild(e),t?r.__ul.insertBefore(n,t):r.__ul.appendChild(n),r.onResize(),n}function pT(r){Pe.unbind(window,"resize",r.__resizeHandler),r.saveToLocalStorageIfPossible&&Pe.unbind(window,"unload",r.saveToLocalStorageIfPossible)}function F_(r,e){var t=r.__preset_select[r.__preset_select.selectedIndex];t.innerHTML=e?t.value+"*":t.value}function fT(r,e){var t=r.getRoot(),n=t.__rememberedObjects.indexOf(e.object);if(n!==-1){var i=t.__rememberedObjectIndecesToControllers[n];if(i===void 0&&(i={},t.__rememberedObjectIndecesToControllers[n]=i),i[e.property]=e,t.load&&t.load.remembered){var o=t.load.remembered,s=void 0;if(o[r.preset])s=o[r.preset];else{if(!o.Default)return;s=o.Default}if(s[n]&&s[n][e.property]!==void 0){var a=s[n][e.property];e.initialValue=a,e.setValue(a)}}}}function gp(r,e,t,n){if(e[t]===void 0)throw new Error('Object "'+e+'" has no property "'+t+'"');var i=void 0;if(n.color)i=new O_(e,t);else{var o=[e,t].concat(n.factoryArgs);i=TP.apply(r,o)}n.before instanceof Tu&&(n.before=n.before.__li),fT(r,i),Pe.addClass(i.domElement,"c");var s=document.createElement("span");Pe.addClass(s,"property-name"),s.innerHTML=i.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(i.domElement);var l=N_(r,a,n.before);return Pe.addClass(l,Ln.CLASS_CONTROLLER_ROW),i instanceof O_?Pe.addClass(l,"color"):Pe.addClass(l,gP(i.getValue())),function(u,c,d){if(d.__li=c,d.__gui=u,Ke.extend(d,{options:function(g){if(arguments.length>1){var _=d.__li.nextElementSibling;return d.remove(),gp(u,d.object,d.property,{before:_,factoryArgs:[Ke.toArray(arguments)]})}if(Ke.isArray(g)||Ke.isObject(g)){var y=d.__li.nextElementSibling;return d.remove(),gp(u,d.object,d.property,{before:y,factoryArgs:[g]})}},name:function(g){return d.__li.firstElementChild.firstElementChild.innerHTML=g,d},listen:function(){return d.__gui.listen(d),d},remove:function(){return d.__gui.remove(d),d}}),d instanceof L_){var f=new hg(d.object,d.property,{min:d.__min,max:d.__max,step:d.__step});Ke.each(["updateDisplay","onChange","onFinishChange","step","min","max"],function(g){var _=d[g],y=f[g];d[g]=f[g]=function(){var w=Array.prototype.slice.call(arguments);return y.apply(f,w),_.apply(d,w)}}),Pe.addClass(c,"has-slider"),d.domElement.insertBefore(f.domElement,d.domElement.firstElementChild)}else if(d instanceof hg){var m=function(g){if(Ke.isNumber(d.__min)&&Ke.isNumber(d.__max)){var _=d.__li.firstElementChild.firstElementChild.innerHTML,y=d.__gui.__listening.indexOf(d)>-1;d.remove();var w=gp(u,d.object,d.property,{before:d.__li.nextElementSibling,factoryArgs:[d.__min,d.__max,d.__step]});return w.name(_),y&&w.listen(),w}return g};d.min=Ke.compose(m,d.min),d.max=Ke.compose(m,d.max)}else d instanceof oT?(Pe.bind(c,"click",function(){Pe.fakeEvent(d.__checkbox,"click")}),Pe.bind(d.__checkbox,"click",function(g){g.stopPropagation()})):d instanceof uT?(Pe.bind(c,"click",function(){Pe.fakeEvent(d.__button,"click")}),Pe.bind(c,"mouseover",function(){Pe.addClass(d.__button,"hover")}),Pe.bind(c,"mouseout",function(){Pe.removeClass(d.__button,"hover")})):d instanceof O_&&(Pe.addClass(c,"color"),d.updateDisplay=Ke.compose(function(g){return c.style.borderLeftColor=d.__color.toString(),g},d.updateDisplay),d.updateDisplay());d.setValue=Ke.compose(function(g){return u.getRoot().__preset_select&&d.isModified()&&F_(u.getRoot(),!0),g},d.setValue)}(r,l,i),r.__controllers.push(i),i}function dc(r,e){return document.location.href+"."+e}function B_(r,e,t){var n=document.createElement("option");n.innerHTML=e,n.value=e,r.__preset_select.appendChild(n),t&&(r.__preset_select.selectedIndex=r.__preset_select.length-1)}function mT(r,e){e.style.display=r.useLocalStorage?"block":"none"}function MP(r){var e=r.__save_row=document.createElement("li");Pe.addClass(r.domElement,"has-save"),r.__ul.insertBefore(e,r.__ul.firstChild),Pe.addClass(e,"save-row");var t=document.createElement("span");t.innerHTML=" ",Pe.addClass(t,"button gears");var n=document.createElement("span");n.innerHTML="Save",Pe.addClass(n,"button"),Pe.addClass(n,"save");var i=document.createElement("span");i.innerHTML="New",Pe.addClass(i,"button"),Pe.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",Pe.addClass(o,"button"),Pe.addClass(o,"revert");var s=r.__preset_select=document.createElement("select");if(r.load&&r.load.remembered?Ke.each(r.load.remembered,function(c,d){B_(r,d,d===r.preset)}):B_(r,"Default",!1),Pe.bind(s,"change",function(){for(var c=0;c<r.__preset_select.length;c++)r.__preset_select[c].innerHTML=r.__preset_select[c].value;r.preset=this.value}),e.appendChild(s),e.appendChild(t),e.appendChild(n),e.appendChild(i),e.appendChild(o),mp){var a=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block",localStorage.getItem(dc(0,"isLocal"))==="true"&&l.setAttribute("checked","checked"),mT(r,a),Pe.bind(l,"change",function(){r.useLocalStorage=!r.useLocalStorage,mT(r,a)})}var u=document.getElementById("dg-new-constructor");Pe.bind(u,"keydown",function(c){!c.metaKey||c.which!==67&&c.keyCode!==67||cg.hide()}),Pe.bind(t,"click",function(){u.innerHTML=JSON.stringify(r.getSaveObject(),void 0,2),cg.show(),u.focus(),u.select()}),Pe.bind(n,"click",function(){r.save()}),Pe.bind(i,"click",function(){var c=prompt("Enter a new preset name.");c&&r.saveAs(c)}),Pe.bind(o,"click",function(){r.revert()})}function AP(r){var e=void 0;function t(o){return o.preventDefault(),r.width+=e-o.clientX,r.onResize(),e=o.clientX,!1}function n(){Pe.removeClass(r.__closeButton,Ln.CLASS_DRAG),Pe.unbind(window,"mousemove",t),Pe.unbind(window,"mouseup",n)}function i(o){return o.preventDefault(),e=o.clientX,Pe.addClass(r.__closeButton,Ln.CLASS_DRAG),Pe.bind(window,"mousemove",t),Pe.bind(window,"mouseup",n),!1}r.__resize_handle=document.createElement("div"),Ke.extend(r.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),Pe.bind(r.__resize_handle,"mousedown",i),Pe.bind(r.__closeButton,"mousedown",i),r.domElement.insertBefore(r.__resize_handle,r.domElement.firstElementChild)}function U_(r,e){r.domElement.style.width=e+"px",r.__save_row&&r.autoPlace&&(r.__save_row.style.width=e+"px"),r.__closeButton&&(r.__closeButton.style.width=e+"px")}function dg(r,e){var t={};return Ke.each(r.__rememberedObjects,function(n,i){var o={},s=r.__rememberedObjectIndecesToControllers[i];Ke.each(s,function(a,l){o[l]=e?a.initialValue:a.getValue()}),t[i]=o}),t}Ln.toggleHide=function(){D_=!D_,Ke.each(dT,function(r){r.domElement.style.display=D_?"none":""})},Ln.CLASS_AUTO_PLACE="a",Ln.CLASS_AUTO_PLACE_CONTAINER="ac",Ln.CLASS_MAIN="main",Ln.CLASS_CONTROLLER_ROW="cr",Ln.CLASS_TOO_TALL="taller-than-window",Ln.CLASS_CLOSED="closed",Ln.CLASS_CLOSE_BUTTON="close-button",Ln.CLASS_CLOSE_TOP="close-top",Ln.CLASS_CLOSE_BOTTOM="close-bottom",Ln.CLASS_DRAG="drag",Ln.DEFAULT_WIDTH=245,Ln.TEXT_CLOSED="Close Controls",Ln.TEXT_OPEN="Open Controls",Ln._keydownHandler=function(r){document.activeElement.type==="text"||r.which!==72&&r.keyCode!==72||Ln.toggleHide()},Pe.bind(window,"keydown",Ln._keydownHandler,!1),Ke.extend(Ln.prototype,{add:function(r,e){return gp(this,r,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(r,e){return gp(this,r,e,{color:!0})},remove:function(r){this.__ul.removeChild(r.__li),this.__controllers.splice(this.__controllers.indexOf(r),1);var e=this;Ke.defer(function(){e.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&cc.removeChild(this.domElement);var r=this;Ke.each(this.__folders,function(e){r.removeFolder(e)}),Pe.unbind(window,"keydown",Ln._keydownHandler,!1),pT(this)},addFolder:function(r){if(this.__folders[r]!==void 0)throw new Error('You already have a folder in this GUI by the name "'+r+'"');var e={name:r,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[r]&&(e.closed=this.load.folders[r].closed,e.load=this.load.folders[r]);var t=new Ln(e);this.__folders[r]=t;var n=N_(this,t.domElement);return Pe.addClass(n,"folder"),t},removeFolder:function(r){this.__ul.removeChild(r.domElement.parentElement),delete this.__folders[r.name],this.load&&this.load.folders&&this.load.folders[r.name]&&delete this.load.folders[r.name],pT(r);var e=this;Ke.each(r.__folders,function(t){r.removeFolder(t)}),Ke.defer(function(){e.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var r=this.getRoot();if(r.scrollable){var e=Pe.getOffset(r.__ul).top,t=0;Ke.each(r.__ul.childNodes,function(n){r.autoPlace&&n===r.__save_row||(t+=Pe.getHeight(n))}),window.innerHeight-e-20<t?(Pe.addClass(r.domElement,Ln.CLASS_TOO_TALL),r.__ul.style.height=window.innerHeight-e-20+"px"):(Pe.removeClass(r.domElement,Ln.CLASS_TOO_TALL),r.__ul.style.height="auto")}r.__resize_handle&&Ke.defer(function(){r.__resize_handle.style.height=r.__ul.offsetHeight+"px"}),r.__closeButton&&(r.__closeButton.style.width=r.width+"px")},onResizeDebounced:Ke.debounce(function(){this.onResize()},50),remember:function(){if(Ke.isUndefined(cg)&&((cg=new EP).domElement.innerHTML=wP),this.parent)throw new Error("You can only call remember on a top level GUI.");var r=this;Ke.each(Array.prototype.slice.call(arguments),function(e){r.__rememberedObjects.length===0&&MP(r),r.__rememberedObjects.indexOf(e)===-1&&r.__rememberedObjects.push(e)}),this.autoPlace&&U_(this,this.width)},getRoot:function(){for(var r=this;r.parent;)r=r.parent;return r},getSaveObject:function(){var r=this.load;return r.closed=this.closed,this.__rememberedObjects.length>0&&(r.preset=this.preset,r.remembered||(r.remembered={}),r.remembered[this.preset]=dg(this)),r.folders={},Ke.each(this.__folders,function(e,t){r.folders[t]=e.getSaveObject()}),r},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=dg(this),F_(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(r){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=dg(this,!0)),this.load.remembered[r]=dg(this),this.preset=r,B_(this,r,!0),this.saveToLocalStorageIfPossible()},revert:function(r){Ke.each(this.__controllers,function(e){this.getRoot().load.remembered?fT(r||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())},this),Ke.each(this.__folders,function(e){e.revert(e)}),r||F_(this.getRoot(),!1)},listen:function(r){var e=this.__listening.length===0;this.__listening.push(r),e&&function t(n){n.length!==0&&SP.call(window,function(){t(n)}),Ke.each(n,function(i){i.updateDisplay()})}(this.__listening)},updateDisplay:function(){Ke.each(this.__controllers,function(r){r.updateDisplay()}),Ke.each(this.__folders,function(r){r.updateDisplay()})}});var PP=Ln,CP=function(){function r(e){this.runTime={fps:0,resolution:""},this.target=e.target,this.data=e.params,this.player=e.player,this.gui=this.createControllerGUI(),this.createStats(),this.addEventListener()}return r.prototype.createStats=function(){var e=this;setInterval(function(){e.controller.runTimeFps.setValue(e.player.runtime.fps),e.controller.runTimeResolution.setValue(e.player.view.width+"*"+e.player.view.height)},500)},r.prototype.createControllerGUI=function(){var e,t,n,i,o,s,a=new PP({autoPlace:!0,closed:!0});return a.domElement.style.opacity=".6",a.domElement.style.transformOrigin="100% 0",a.domElement.style.transform="scale(1.4)",this.target.appendChild(a.domElement),a.domElement.style.position="absolute",a.domElement.style.right="0",a.domElement.style.top="0",a.domElement.style.zIndex="2",this.controller={runTimeFps:a.add({FPS:0},"FPS",0),runTimeResolution:a.add({\u5206\u8FA8\u7387:""},"\u5206\u8FA8\u7387",""),autoFps:a.add({\u81EA\u52A8fps:(e=this.data.autoFPS)===null||e===void 0||e},"\u81EA\u52A8fps",!0),autoResolution:a.add({\u81EA\u52A8\u5206\u8FA8\u7387:(t=this.data.autoResolution)!==null&&t!==void 0&&t},"\u81EA\u52A8\u5206\u8FA8\u7387",!0),moreCalculation:a.add({\u989D\u5916\u8BA1\u7B97:0},"\u989D\u5916\u8BA1\u7B97",0,100),minFPS:a.add({\u6700\u4F4Efps:(n=this.data.minFPS)!==null&&n!==void 0?n:40},"\u6700\u4F4Efps",0,60),maxFPS:a.add({\u6700\u9AD8fps:(i=this.data.maxFPS)!==null&&i!==void 0?i:50},"\u6700\u9AD8fps",0,60),resolution:a.add({\u76EE\u6807\u5206\u8FA8\u500D\u7387:(o=this.data.resolution)!==null&&o!==void 0?o:window.devicePixelRatio},"\u76EE\u6807\u5206\u8FA8\u500D\u7387",.5,4),minResolution:a.add({\u6700\u5C0F\u5206\u8FA8\u500D\u7387:(s=this.data.minResolution)!==null&&s!==void 0?s:1},"\u6700\u5C0F\u5206\u8FA8\u500D\u7387",.5,4)},this.controller.runTimeFps.disabled=!0,this.controller.runTimeResolution.disabled=!0,a},r.prototype.addEventListener=function(){var e,t=this;this.controller.autoFps.onChange(function(n){t.data.autoFPS=n,t.player.updateConfig(t.data)}),this.controller.maxFPS.onChange(function(n){t.data.maxFPS=n,t.player.updateConfig(t.data)}),this.controller.minFPS.onChange(function(n){t.data.minFPS=n,t.player.updateConfig(t.data)}),this.controller.autoResolution.onChange(function(n){t.data.autoResolution=n,t.player.updateConfig(t.data)}),this.controller.minResolution.onChange(function(n){t.data.minResolution=n,t.player.updateConfig(t.data)}),this.controller.resolution.onChange(function(n){t.data.resolution=n,t.player.updateConfig(t.data)}),this.controller.moreCalculation.onChange(function(n){e&&t.player.app.ticker.remove(e),n>0&&(e=function(){for(var i="";i.length<n;)i+=Math.random().toString(32).substr(2);eg()(i)},t.player.app.ticker.add(e))})},r}(),RP=function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])})(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),gT=function(r,e,t,n){return new(t||(t=Promise))(function(i,o){function s(u){try{l(n.next(u))}catch(c){o(c)}}function a(u){try{l(n.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((n=n.apply(r,e||[])).next())})},vT=function(r,e){var t,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,n=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(r,s)}catch(d){c=[6,d],n=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([l,u])}}},IP=window.ResizeObserver||aP,cr={syncDispatch:"syncDispatch",syncReceive:"syncReceive",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd"},LP=function(r){function e(t){var n=r.call(this)||this;return n.__slideState={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,appliedInteractiveSeqIds:[]},n.resize=!1,n.isAnimating=!1,n.renderingTaskManager=new cP,n.isLoading=!1,n.interactive=!0,n.player=new J2,n.frameWidth=1,n.frameHeight=1,n.frame=document.createElement("div"),n.frameResizeObserver=new IP(function(i){return n.frameResizeHandler(i)}),n.anchor=t.anchor,n.resize=t.resize||!1,n.interactive=t.interactive,n.player.setInteractive(n.interactive),n.player.updateConfig(t.renderOptions||{}),n.frame.style.cssText="width:100%;height:100%;display:flex;justify-content:center;align-items:center",n.frame.appendChild(n.player.view),n.anchor.appendChild(n.frame),(t==null?void 0:t.controller)&&new CP({player:n.player,params:t.renderOptions||{},target:n.frame}),n.frameResizeObserver.observe(n.frame),n.player.on(mn.renderStart,function(i){n.isLoading=!0,n.emit(cr.renderStart,i)}),n.player.on(mn.renderEnd,function(i){n.isLoading=!1,n.emit(cr.renderEnd,i)}),n.player.on(mn.slideChange,function(i){n.__slideState.currentSlideIndex=i,n.emit(cr.slideChange,i)}),n.player.on(mn.mainSeqStateChange,function(i){n.__slideState.mainSeqState=i}),n.player.on(mn.mainSeqStepChange,function(i){n.__slideState.mainSeqStep=i}),n.player.on(mn.animateStart,function(){n.isAnimating!==!0&&(n.isAnimating=!0,n.emit(cr.animateStart))}),n.player.on(mn.animateEnd,function(){n.isAnimating!==!1&&(n.isAnimating=!1,n.emit(cr.animateEnd))}),n.player.on(mn.interactiveAnimTrigger,function(i){var o=i.action,s=i.seqId;n.__slideState.appliedInteractiveSeqIds.push(s),n.emit(cr.syncDispatch,{type:"interactiveAnim",action:o})}),n.player.on(mn.mainSeqStepStart,Object(oe.throttle)(function(i){n.emit(cr.mainSeqStepStart)},100)),n.player.on(mn.mainSeqStepEnd,Object(oe.throttle)(function(i){n.emit(cr.mainSeqStepEnd)},100)),n.on(cr.syncReceive,n.receiveSyncHandler),n.renderingTaskManager.eventHub.on("task-error",function(i){var o=i.error,s=i.task;n.emit(cr.renderError,{error:o,index:s.slideIndex})}),n}return RP(e,r),e.prototype.frameResizeHandler=function(t){var n=t[0].contentRect,i=n.width,o=n.height;this.frameWidth=i,this.frameHeight=o,this.resizeView()},e.prototype.resizeView=function(){var t=this.width,n=this.height;if(t>0&&n>0){var i=this.frameWidth/t,o=i*n;if(o>this.frameHeight&&(i*=this.frameHeight/o),this.resize){var s=this.player.app,a=i*(this.player.config.resolution||window.devicePixelRatio);s.renderer.resolution=a,s.renderer.plugins.interaction.resolution=s.renderer.resolution,s.renderer.resize(this.width,this.height)}this.view.style.transform="scale("+i+")"}},e.prototype.receiveSyncHandler=function(t){var n=this;t.type==="nextStep"?this.mainSeqStep===t.next-1||this.mainSeqStep+1===this.mainSeqLength?this.nextStep(!0):(this.setMainSeqStep(t.next,"start"),this.player.nextTick(function(){n.nextStep(!0)})):t.type==="prevStep"?this.mainSeqStep===0&&this.mainSeqState==="idle"||this.mainSeqStep===t.next+1||this.mainSeqStep+1===this.mainSeqLength?this.prevStep(!0):(this.setMainSeqStep(t.next+1,"start"),this.player.nextTick(function(){n.prevStep(!0)})):t.type==="interactiveAnim"?this.player.applyInteractiveAction(t.action):t.type==="renderSlide"&&this.renderSlide(t.index,!0)},e.prototype.setSlideState=function(t){return gT(this,void 0,void 0,function(){var n,i=this;return vT(this,function(o){switch(o.label){case 0:return t.taskId&&t.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=t.taskId,this.player.setResourceData(t.taskId,this.__slideState.url)),t.url&&t.url!==this.__slideState.url&&(this.__slideState.url=t.url,this.player.setResourceData(this.__slideState.taskId,t.url)),Number.isInteger(t.currentSlideIndex)&&t.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=t.currentSlideIndex,[4,this.renderSlide(t.currentSlideIndex)]):[3,2];case 1:o.sent(),o.label=2;case 2:return[4,fP(function(){return i.player.currentIndex===t.currentSlideIndex&&i.player.currentStage},3e3)];case 3:return o.sent(),n=!1,Number.isInteger(t.mainSeqStep)&&t.mainSeqStep!==this.__slideState.mainSeqStep&&(n=!0,this.__slideState.mainSeqStep=t.mainSeqStep),t.mainSeqState&&t.mainSeqState!==this.__slideState.mainSeqState&&(n=!0,this.__slideState.mainSeqState=t.mainSeqState),n&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),t.appliedInteractiveSeqIds&&t.appliedInteractiveSeqIds.length>0&&(this.__slideState.appliedInteractiveSeqIds=t.appliedInteractiveSeqIds,t.appliedInteractiveSeqIds.forEach(function(s){i.player.seekInteractiveSeqToEnd(s)})),[2]}})})},Object.defineProperty(e.prototype,"slideCount",{get:function(){return this.player.slideCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqLength",{get:function(){return this.player.mainSeqLength()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqStep",{get:function(){return this.player.mainSeqStep()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqState",{get:function(){return this.player.mainSeqState()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderOptions",{get:function(){return this.player.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderFps",{get:function(){return this.player.runtime.fps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runtimeFps",{get:function(){return this.player.fps.value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this.player.view},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.player.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.player.height},enumerable:!1,configurable:!0}),e.prototype.updateRenderOption=function(t){this.player.updateConfig(t)},e.prototype.setResource=function(t,n){this.player.setResourceData(t,n),this.__slideState.taskId=t,this.__slideState.url=n,this.emit(cr.syncDispatch,{type:"setResource",taskId:t,url:n})},e.prototype._renderSlide=function(t,n){return n===void 0&&(n=!1),gT(this,void 0,void 0,function(){return vT(this,function(i){switch(i.label){case 0:return this.isLoading=!0,[4,this.player.renderSlide(t)];case 1:return i.sent(),this.__slideState.currentSlideIndex=t,this.isLoading=!1,this.resizeView(),n||this.emit(cr.syncDispatch,{type:"renderSlide",index:t}),[2]}})})},e.prototype.renderSlide=function(t,n){var i=this;n===void 0&&(n=!1);var o=Number(t);(o!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(o>this.slideCount&&this.slideCount>0||this.renderingTaskManager.addTask(function(){return i._renderSlide(o,n)},o))},e.prototype.nextStep=function(t){if(t===void 0&&(t=!1),!this.isLoading){this.player.nextStep();var n=this.player.mainSeqStep();this.__slideState.mainSeqStep=n,t||this.emit(cr.syncDispatch,{type:"nextStep",next:n})}},e.prototype.prevStep=function(t){if(t===void 0&&(t=!1),!this.isLoading){this.player.prevStep();var n=this.player.mainSeqStep();this.__slideState.mainSeqStep=n,t||this.emit(cr.syncDispatch,{type:"prevStep",next:n})}},e.prototype.setMainSeqStep=function(t,n){this.player.setMainSeqStep(t,n)},e.prototype.setInteractive=function(t){this.interactive=t,this.player.setInteractive(t)},e.prototype.pause=function(){this.player.pause()},e.prototype.resume=function(){this.player.resume()},e.prototype.destroy=function(){this.frameResizeObserver.disconnect(),this.player.removeAllListeners(),this.player.destroy(),this.player.removeAllListeners();try{this.anchor.removeChild(this.player.view)}catch{}},e}(k.a)}]);class H_{constructor(){this.disposers=new Map,this.disposerIDGenCount=-1}add(L,v=this.genDisposerID()){return this.flush(v),this.disposers.set(v,L()),v}addEventListener(L,v,b,q,B=this.genDisposerID()){return this.add(()=>(L.addEventListener(v,b,q),()=>L.removeEventListener(v,b,q)),B),B}setTimeout(L,v,b=this.genDisposerID()){return this.add(()=>{const q=window.setTimeout(()=>{this.remove(b),L()},v);return()=>window.clearTimeout(q)},b)}setInterval(L,v,b=this.genDisposerID()){return this.add(()=>{const q=window.setInterval(L,v);return()=>window.clearInterval(q)},b)}remove(L){const v=this.disposers.get(L);return this.disposers.delete(L),v}flush(L){const v=this.remove(L);if(v)try{v()}catch(b){console.error(b)}}flushAll(){this.disposers.forEach(L=>{try{L()}catch(v){console.error(v)}}),this.disposers.clear()}genDisposerID(){const{MAX_SAFE_INTEGER:L=9007199254740991}=Number;return this.disposerIDGenCount=(this.disposerIDGenCount+1)%L,`disposer-${this.disposerIDGenCount}`}}function FP(C){return C!=null&&typeof C=="object"&&!Array.isArray(C)}function BP(C,L){let v=C.getAttributes();if(v||(C.setAttributes(L),v=C.getAttributes()),!v)throw new Error("[NetlessAppMonaco] No attributes");return FP(L)&&Object.keys(L).forEach(b=>{Object.prototype.hasOwnProperty.call(v,b)||C.updateAttributes([b],L[b])}),v}function UP(C,L,v){return Math.min(Math.max(C,L),v)}function kP(C){return typeof C=="object"&&C!==null}function GP(C,L,v){const b=L.slideState.currentSlideIndex;if(b==null)return;const q=[v,b].join("/");if(C.scenePathType(q)==="none"){C.removeScenes(v);const B=L.slideCount,ie=[];for(let k=1;k<=B;++k)ie.push({name:`${k}`});C.putScenes(v,ie)}C.setScenePath(q)}function HP(C){const{width:L,height:v,slideCount:b,slideState:q}=C,{taskId:B,url:ie}=q,k=[];for(let oe=1;oe<=b;++oe)k.push({width:L,height:v,thumbnail:`${ie}/${B}/preview/${oe}.png`,src:"ppt"});return k}class zP{constructor(L,v,b,q,B,ie,k){this.slide=L,this.onPageChanged=v,this.onTransitionStart=b,this.onTransitionEnd=q,this.onDispatchSyncEvent=B,this.initialState=ie,this.initialPage=k,this.pollCount=0,this.pollReadyState=()=>{this.isReady()?this.resolveReady(this):this.pollCount<20?(this.pollCount++,setTimeout(this.pollReadyState,500)):this.reject()},this.targetingPage=-1,L.on(jr.SLIDE_EVENTS.slideChange,v),L.on(jr.SLIDE_EVENTS.renderStart,b),L.on(jr.SLIDE_EVENTS.renderEnd,q),L.on(jr.SLIDE_EVENTS.mainSeqStepStart,b),L.on(jr.SLIDE_EVENTS.mainSeqStepEnd,q),L.on(jr.SLIDE_EVENTS.syncDispatch,B),L.on(jr.SLIDE_EVENTS.renderError,({error:oe})=>{console.warn("[Slide] render error",oe),q()}),ie?L.setSlideState(ie):L.renderSlide(k),this.ready=new Promise((oe,X)=>{this.resolveReady=oe,this.reject=X}),this.pollReadyState()}receiveSyncEvent(L){this.slide.emit(jr.SLIDE_EVENTS.syncReceive,L)}isReady(){return this.slide.slideCount>0}jumpToPage(L){!this.isReady()||(L=UP(L,1,this.slide.slideCount),L!==this.targetingPage&&(this.targetingPage=L,this.slide.renderSlide(L)))}destroy(){this.slide.destroy()}}async function VP(C,L,v,b,q,B,ie,k,oe,X){const K=new jr.Slide({anchor:C,interactive:!0,resize:!0,controller:b});return K.setResource(L,v),new zP(K,ie,k,oe,X,q,B).ready}function jP(C){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${C}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),v.appendChild(b),v}function WP(C){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${C}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),v.appendChild(b),v}function XP(C){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${C}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),v.appendChild(b),v}function YP(C){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${C}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),v.appendChild(b),v}function qP(C){const L="http://www.w3.org/2000/svg",v=document.createElementNS(L,"svg");v.setAttribute("class",`${C}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(L,"path");return b.setAttribute("fill","currentColor"),b.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),v.appendChild(b),v}const Eu=typeof window!="undefined",IT=Eu&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),LT=Eu&&"IntersectionObserver"in window,OT=Eu&&"classList"in document.createElement("p"),DT=Eu&&window.devicePixelRatio>1,ZP={elements_selector:".lazy",container:IT||Eu?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},NT=C=>Object.assign({},ZP,C),FT=function(C,L){let v;const b="LazyLoad::Initialized",q=new C(L);try{v=new CustomEvent(b,{detail:{instance:q}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(b,!1,!1,{instance:q})}window.dispatchEvent(v)},JP=(C,L)=>{if(!!L)if(!L.length)FT(C,L);else for(let v=0,b;b=L[v];v+=1)FT(C,b)},pa="src",z_="srcset",V_="sizes",BT="poster",bp="llOriginalAttrs",j_="loading",UT="loaded",kT="applied",$P="entered",W_="error",GT="native",HT="data-",zT="ll-status",lo=(C,L)=>C.getAttribute(HT+L),KP=(C,L,v)=>{var b=HT+L;if(v===null){C.removeAttribute(b);return}C.setAttribute(b,v)},wp=C=>lo(C,zT),Mu=(C,L)=>KP(C,zT,L),fg=C=>Mu(C,null),X_=C=>wp(C)===null,QP=C=>wp(C)===j_,eC=C=>wp(C)===W_,Y_=C=>wp(C)===GT,tC=[j_,UT,kT,W_],nC=C=>tC.indexOf(wp(C))>=0,il=(C,L,v,b)=>{if(!!C){if(b!==void 0){C(L,v,b);return}if(v!==void 0){C(L,v);return}C(L)}},pc=(C,L)=>{if(OT){C.classList.add(L);return}C.className+=(C.className?" ":"")+L},ws=(C,L)=>{if(OT){C.classList.remove(L);return}C.className=C.className.replace(new RegExp("(^|\\s+)"+L+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},iC=C=>{C.llTempImage=document.createElement("IMG")},rC=C=>{delete C.llTempImage},VT=C=>C.llTempImage,mg=(C,L)=>{if(!L)return;const v=L._observer;!v||v.unobserve(C)},oC=C=>{C.disconnect()},sC=(C,L,v)=>{L.unobserve_entered&&mg(C,v)},q_=(C,L)=>{!C||(C.loadingCount+=L)},aC=C=>{!C||(C.toLoadCount-=1)},jT=(C,L)=>{!C||(C.toLoadCount=L)},lC=C=>C.loadingCount>0,uC=C=>C.toLoadCount>0,WT=C=>{let L=[];for(let v=0,b;b=C.children[v];v+=1)b.tagName==="SOURCE"&&L.push(b);return L},Z_=(C,L)=>{const v=C.parentNode;if(!v||v.tagName!=="PICTURE")return;WT(v).forEach(L)},XT=(C,L)=>{WT(C).forEach(L)},gg=[pa],YT=[pa,BT],vg=[pa,z_,V_],_g=C=>!!C[bp],qT=C=>C[bp],ZT=C=>delete C[bp],Tp=(C,L)=>{if(_g(C))return;const v={};L.forEach(b=>{v[b]=C.getAttribute(b)}),C[bp]=v},hC=C=>{_g(C)||(C[bp]={backgroundImage:C.style.backgroundImage})},cC=(C,L,v)=>{if(!v){C.removeAttribute(L);return}C.setAttribute(L,v)},Sp=(C,L)=>{if(!_g(C))return;const v=qT(C);L.forEach(b=>{cC(C,b,v[b])})},dC=C=>{if(!_g(C))return;const L=qT(C);C.style.backgroundImage=L.backgroundImage},pC=(C,L,v)=>{pc(C,L.class_applied),Mu(C,kT),!!v&&(L.unobserve_completed&&mg(C,L),il(L.callback_applied,C,v))},JT=(C,L,v)=>{pc(C,L.class_loading),Mu(C,j_),!!v&&(q_(v,1),il(L.callback_loading,C,v))},Au=(C,L,v)=>{!v||C.setAttribute(L,v)},$T=(C,L)=>{Au(C,V_,lo(C,L.data_sizes)),Au(C,z_,lo(C,L.data_srcset)),Au(C,pa,lo(C,L.data_src))},fC=(C,L)=>{Z_(C,v=>{Tp(v,vg),$T(v,L)}),Tp(C,vg),$T(C,L)},mC=(C,L)=>{Tp(C,gg),Au(C,pa,lo(C,L.data_src))},gC=(C,L)=>{XT(C,v=>{Tp(v,gg),Au(v,pa,lo(v,L.data_src))}),Tp(C,YT),Au(C,BT,lo(C,L.data_poster)),Au(C,pa,lo(C,L.data_src)),C.load()},vC=(C,L,v)=>{const b=lo(C,L.data_bg),q=lo(C,L.data_bg_hidpi),B=DT&&q?q:b;!B||(C.style.backgroundImage=`url("${B}")`,VT(C).setAttribute(pa,B),JT(C,L,v))},_C=(C,L,v)=>{const b=lo(C,L.data_bg_multi),q=lo(C,L.data_bg_multi_hidpi),B=DT&&q?q:b;!B||(C.style.backgroundImage=B,pC(C,L,v))},KT={IMG:fC,IFRAME:mC,VIDEO:gC},yC=(C,L)=>{const v=KT[C.tagName];!v||v(C,L)},xC=(C,L,v)=>{const b=KT[C.tagName];!b||(b(C,L),JT(C,L,v))},bC=["IMG","IFRAME","VIDEO"],wC=C=>bC.indexOf(C.tagName)>-1,QT=(C,L)=>{L&&!lC(L)&&!uC(L)&&il(C.callback_finish,L)},eS=(C,L,v)=>{C.addEventListener(L,v),C.llEvLisnrs[L]=v},TC=(C,L,v)=>{C.removeEventListener(L,v)},J_=C=>!!C.llEvLisnrs,SC=(C,L,v)=>{J_(C)||(C.llEvLisnrs={});const b=C.tagName==="VIDEO"?"loadeddata":"load";eS(C,b,L),eS(C,"error",v)},$_=C=>{if(!J_(C))return;const L=C.llEvLisnrs;for(let v in L){const b=L[v];TC(C,v,b)}delete C.llEvLisnrs},tS=(C,L,v)=>{rC(C),q_(v,-1),aC(v),ws(C,L.class_loading),L.unobserve_completed&&mg(C,v)},EC=(C,L,v,b)=>{const q=Y_(L);tS(L,v,b),pc(L,v.class_loaded),Mu(L,UT),il(v.callback_loaded,L,b),q||QT(v,b)},MC=(C,L,v,b)=>{const q=Y_(L);tS(L,v,b),pc(L,v.class_error),Mu(L,W_),il(v.callback_error,L,b),q||QT(v,b)},K_=(C,L,v)=>{const b=VT(C)||C;if(J_(b))return;SC(b,ie=>{EC(ie,C,L,v),$_(b)},ie=>{MC(ie,C,L,v),$_(b)})},AC=(C,L,v)=>{iC(C),K_(C,L,v),hC(C),vC(C,L,v),_C(C,L,v)},PC=(C,L,v)=>{K_(C,L,v),xC(C,L,v)},Q_=(C,L,v)=>{wC(C)?PC(C,L,v):AC(C,L,v)},CC=(C,L,v)=>{C.setAttribute("loading","lazy"),K_(C,L,v),yC(C,L),Mu(C,GT)},nS=C=>{C.removeAttribute(pa),C.removeAttribute(z_),C.removeAttribute(V_)},RC=C=>{Z_(C,L=>{nS(L)}),nS(C)},iS=C=>{Z_(C,L=>{Sp(L,vg)}),Sp(C,vg)},IC=C=>{XT(C,L=>{Sp(L,gg)}),Sp(C,YT),C.load()},LC=C=>{Sp(C,gg)},OC={IMG:iS,IFRAME:LC,VIDEO:IC},DC=C=>{const L=OC[C.tagName];if(!L){dC(C);return}L(C)},NC=(C,L)=>{X_(C)||Y_(C)||(ws(C,L.class_entered),ws(C,L.class_exited),ws(C,L.class_applied),ws(C,L.class_loading),ws(C,L.class_loaded),ws(C,L.class_error))},FC=(C,L)=>{DC(C),NC(C,L),fg(C),ZT(C)},BC=(C,L,v,b)=>{!v.cancel_on_exit||!QP(C)||C.tagName==="IMG"&&($_(C),RC(C),iS(C),ws(C,v.class_loading),q_(b,-1),fg(C),il(v.callback_cancel,C,L,b))},UC=(C,L,v,b)=>{const q=nC(C);Mu(C,$P),pc(C,v.class_entered),ws(C,v.class_exited),sC(C,v,b),il(v.callback_enter,C,L,b),!q&&Q_(C,v,b)},kC=(C,L,v,b)=>{X_(C)||(pc(C,v.class_exited),BC(C,L,v,b),il(v.callback_exit,C,L,b))},GC=["IMG","IFRAME","VIDEO"],rS=C=>C.use_native&&"loading"in HTMLImageElement.prototype,HC=(C,L,v)=>{C.forEach(b=>{GC.indexOf(b.tagName)!==-1&&CC(b,L,v)}),jT(v,0)},zC=C=>C.isIntersecting||C.intersectionRatio>0,VC=C=>({root:C.container===document?null:C.container,rootMargin:C.thresholds||C.threshold+"px"}),jC=(C,L,v)=>{C.forEach(b=>zC(b)?UC(b.target,b,L,v):kC(b.target,b,L,v))},WC=(C,L)=>{L.forEach(v=>{C.observe(v)})},XC=(C,L)=>{oC(C),WC(C,L)},YC=(C,L)=>{!LT||rS(C)||(L._observer=new IntersectionObserver(v=>{jC(v,C,L)},VC(C)))},oS=C=>Array.prototype.slice.call(C),yg=C=>C.container.querySelectorAll(C.elements_selector),qC=C=>oS(C).filter(X_),ZC=C=>eC(C),JC=C=>oS(C).filter(ZC),sS=(C,L)=>qC(C||yg(L)),$C=(C,L)=>{JC(yg(C)).forEach(b=>{ws(b,C.class_error),fg(b)}),L.update()},KC=(C,L)=>{!Eu||window.addEventListener("online",()=>{$C(C,L)})},Ep=function(C,L){const v=NT(C);this._settings=v,this.loadingCount=0,YC(v,this),KC(v,this),this.update(L)};Ep.prototype={update:function(C){const L=this._settings,v=sS(C,L);if(jT(this,v.length),IT||!LT){this.loadAll(v);return}if(rS(L)){HC(v,L,this);return}XC(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),yg(this._settings).forEach(C=>{ZT(C)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(C){const L=this._settings;sS(C,L).forEach(b=>{mg(b,this),Q_(b,L,this)})},restoreAll:function(){const C=this._settings;yg(C).forEach(L=>{FC(L,C)})}};Ep.load=(C,L)=>{const v=NT(L);Q_(C,v)};Ep.resetStatus=C=>{fg(C)};Eu&&JP(Ep,window.lazyLoadOptions);class QC{constructor({readonly:L,box:v,onNewPageIndex:b,onPlay:q}){this._pages=[],this.pageIndex=0,this.setPaused=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new H_,this.readonly=L,this.box=v,this.onNewPageIndex=b,this.onPlay=q,this.render()}set pages(L){this._pages=L,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}mount(){this.box.mountContent(this.$content),this.box.mountFooter(this.$footer)}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(L){this.readonly!==L&&(this.readonly=L,this.$content.classList.toggle(this.wrapClassName("readonly"),L),this.$footer.classList.toggle(this.wrapClassName("readonly"),L),this.$pageNumberInput.disabled=L)}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(L){Number.isNaN(L)||(this.pageIndex=L,this.$pageNumberInput.value=String(L+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(L){this.isSmallBox!==L&&(this.isSmallBox=L,this.$footer.classList.toggle(this.wrapClassName("float-footer"),L))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const L=document.createElement("div");L.className=this.wrapClassName("content"),this.$content=L,this.readonly&&L.classList.add(this.wrapClassName("readonly")),L.appendChild(this.renderPreviewMask()),L.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const L=document.createElement("div");L.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=L,this.refreshPreview(),this.sideEffect.addEventListener(L,"click",v=>{var q;if(this.readonly)return;const b=(q=v.target.dataset)==null?void 0:q.pageIndex;b&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(b)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){const{$preview:L}=this,v=this.wrapClassName("preview-page"),b=this.wrapClassName("preview-page-name");for(;L.firstChild;)L.firstChild.remove();this.pages.forEach((q,B)=>{var le;const ie=(le=q.thumbnail)!=null?le:q.src.startsWith("ppt")?void 0:q.src;if(!ie)return;const k=String(B),oe=document.createElement("a");oe.className=v+" "+this.wrapClassName(`preview-page-${B}`),oe.setAttribute("href","#"),oe.dataset.pageIndex=k;const X=document.createElement("span");X.className=b,X.textContent=String(B+1),X.dataset.pageIndex=k;const K=document.createElement("img");K.width=q.width,K.height=q.height,K.dataset.src=ie,K.dataset.pageIndex=k,oe.appendChild(K),oe.appendChild(X),L.appendChild(oe)}),this.sideEffect.add(()=>{const q=new Ep({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`});return()=>q.destroy()},"preview-lazyload")}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",L=>{this.readonly||L.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const L=document.createElement("div");L.className=this.wrapClassName("footer"),this.$footer=L,this.readonly&&L.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&L.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",jP(this.namespace));this.sideEffect.addEventListener(v,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=v,this.$btnSidebar.style.display="none",this.$footer.appendChild(v);const b=document.createElement("div");b.className=this.wrapClassName("page-jumps");const q=this.renderFooterBtn("btn-page-back",WP(this.namespace));if(this.sideEffect.addEventListener(q,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),b.appendChild(q),this.onPlay){const X=this.renderFooterBtn("btn-page-play",YP(this.namespace),qP(this.namespace));this.$btnPlay=X,this.sideEffect.addEventListener(X,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),b.appendChild(X)}const B=this.renderFooterBtn("btn-page-next",XP(this.namespace));this.sideEffect.addEventListener(B,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),b.appendChild(B);const ie=document.createElement("div");ie.className=this.wrapClassName("page-number");const k=document.createElement("input");k.className=this.wrapClassName("page-number-input"),k.value=String(this.pageIndex+1),this.readonly&&(k.disabled=!0),this.$pageNumberInput=k,this.sideEffect.addEventListener(k,"change",()=>{this.readonly||k.value&&this.onNewPageIndex(Number(k.value)-1)});const oe=document.createElement("span");this.$totalPage=oe,ie.appendChild(k),ie.appendChild(oe),this.$footer.appendChild(b),this.$footer.appendChild(ie)}return this.$footer}renderFooterBtn(L,v,b){const q=document.createElement("button");return q.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(L),q.appendChild(v),b&&q.appendChild(b),q}togglePreview(L){if(this.isShowPreview=L!=null?L:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const v=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));v&&this.$preview.scrollTo({top:v.offsetTop-16})}}wrapClassName(L){return`${this.namespace}-${L}`}}const eR=new Set(["clicker","selector"]);class tR{constructor({box:L,view:v,mountSlideController:b,mountWhiteboard:q}){this.scaleDocsToFit=()=>{if(this.slideController){const{width:B,height:ie}=this.slideController.slide;this.whiteboardView.moveCameraToContain({originX:-B/2,originY:-ie/2,width:B,height:ie,animationMode:"immediately"})}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=B=>{this.slideController&&this.slideController.jumpToPage(B+1)},this.sideEffect=new H_,this.namespace="netless-app-slide",this.box=L,this.whiteboardView=v,this.mountSlideController=b,this.mountWhiteboard=q,this.viewer=new QC({box:L,readonly:L.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",L=>{if(this.box.focus&&this.slideController)switch(L.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderSlideContainer(){if(!this.$slide){const L=document.createElement("div");L.className=this.wrapClassName("slide"),L.dataset.appKind="Slide",this.$slide=L}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView)),this.$whiteboardView}async mount(){return this.viewer.mount(),this.slideController=await this.mountSlideController(this.$slide),this.viewer.pages=HP(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController)),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(L){return(L.slide.slideState.currentSlideIndex||1)-1}unmount(){return this.slideController&&this.slideController.destroy(),this.viewer.unmount(),this}setReadonly(L){this.viewer.setReadonly(L)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(L){this.$whiteboardView.style.pointerEvents=!L||eR.has(L)?"none":"auto"}wrapClassName(L){return`${this.namespace}-${L}`}}var nR=`.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:1.5em;text-align:right;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly .netless-app-slide-footer-btn{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-footer-btn:hover{background:transparent}.netless-app-slide-readonly .netless-app-slide-page-number-input{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-page-number-input:hover,.netless-app-slide-readonly .netless-app-slide-page-number-input:focus,.netless-app-slide-readonly .netless-app-slide-page-number-input:active{background:transparent;box-shadow:none}.netless-app-slide-readonly .netless-app-slide-page-number-input:disabled{color:inherit}.netless-app-slide-readonly.netless-app-slide-float-footer{display:none}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}
|
|
5824
|
+
`;const iR={kind:"Slide",async setup(C){var O;const L=C.getBox(),v=C.getView(),b=C.getRoom(),q=C.getDisplayer(),B=BP(C,{taskId:"",url:"",state:null});if(!B.taskId||!B.url)throw new Error("[Slide] no taskId or url");if(!v)throw new Error("[Slide] no view, please set scenePath on addApp()");L.mountStyles(nR);const ie=new H_,k=C.getInitScenePath(),oe=(O=C.getAppOptions())==null?void 0:O.debug,X=`channel-${C.appId}`;let K;const le=V=>{console.log("[Slide] page to",V),C.getIsWritable()&&b&&K&&(GP(b,K.slide,k),A.viewer.setPageIndex(V-1))},Ee=()=>{A.viewer.setPlaying()},Xe=()=>{A.viewer.setPaused()},Fe=V=>{C.getIsWritable()&&K&&(C.updateAttributes(["state"],K.slide.slideState),b&&b.dispatchMagixEvent(X,{type:jr.SLIDE_EVENTS.syncDispatch,event:V}))};function S(V){const{slide:D}=V;D.on(jr.SLIDE_EVENTS.syncDispatch,z=>{C.updateAttributes(["state"],D.slideState),b&&b.dispatchMagixEvent(X,{type:jr.SLIDE_EVENTS.syncDispatch,payload:z})}),ie.add(()=>{const z=W=>{if(V&&W.event===X&&W.authorId!==q.observerId&&kP(W.payload)){const{type:ee,payload:et}=W.payload;ee===jr.SLIDE_EVENTS.syncDispatch&&V.receiveSyncEvent(et)}};return q.addMagixEventListener(X,z),()=>q.removeMagixEventListener(X,z)})}const A=new tR({box:L,view:v,mountSlideController:async V=>(K=await VP(V,B.taskId,B.url,oe,JSON.parse(JSON.stringify(B.state)),q.state.sceneState.index+1,le,Ee,Xe,Fe),S(K),K),mountWhiteboard:V=>C.mountView(V)});try{await A.mount()}catch{console.log("[Slide]: destroy by error"),ie.flushAll(),A.destroy();return}b&&(A.toggleClickThrough(b.state.memberState.currentApplianceName),ie.add(()=>{const V=D=>{D.memberState&&A.toggleClickThrough(D.memberState.currentApplianceName)};return b.callbacks.on("onRoomStateChanged",V),()=>b.callbacks.off("onRoomStateChanged",V)})),L.events.on("readonly",V=>{A.setReadonly(V)}),C.emitter.on("destroy",()=>{console.log("[Slide]: destroy"),ie.flushAll(),A.destroy()})}};exports.default=iR;
|
|
5825
5825
|
//# sourceMappingURL=main.cjs.js.map
|