@netless/app-slide 0.1.1 → 0.1.2

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 CHANGED
@@ -5,9 +5,9 @@
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 $="Expected a function",L="__lodash_placeholder__",Y=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],j="[object Arguments]",F="[object Array]",K="[object Boolean]",xe="[object Date]",Re="[object Error]",Ie="[object Function]",M="[object GeneratorFunction]",N="[object Map]",D="[object Number]",ee="[object Object]",C="[object RegExp]",z="[object Set]",V="[object String]",ne="[object Symbol]",qe="[object WeakMap]",ft="[object ArrayBuffer]",Pe="[object DataView]",ae="[object Float32Array]",Me="[object Float64Array]",De="[object Int8Array]",W="[object Int16Array]",ye="[object Int32Array]",Ce="[object Uint8Array]",Le="[object Uint16Array]",Ne="[object Uint32Array]",$e=/\b__p \+= '';/g,Qe=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vt=/&(?:amp|lt|gt|quot|#39);/g,ln=/[&<>"']/g,wt=RegExp(vt.source),Wt=RegExp(ln.source),qt=/<%-([\s\S]+?)%>/g,rn=/<%([\s\S]+?)%>/g,Bt=/<%=([\s\S]+?)%>/g,Dn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fn=/^\w*$/,Mn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jn=/[\\^$.*+?()[\]{}|]/g,An=RegExp(jn.source),In=/^\s+/,di=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Di=/\{\n\/\* \[wrapped with (.+)\] \*/,pi=/,? & /,uo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Co=/[()=,{}\[\]\/\s]/,Oa=/\\(\\)?/g,ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sr=/\w*$/,E=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,O=/^\[object .+?Constructor\]$/,Q=/^0o[0-7]+$/i,J=/^(?:0|[1-9]\d*)$/,Z=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ge=/['\n\r\u2028\u2029\\]/g,be="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\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",Fe="[\\ud800-\\udfff]",Ye="["+we+"]",ht="["+be+"]",xt="\\d+",Ot="[\\u2700-\\u27bf]",Gt="[a-z\\xdf-\\xf6\\xf8-\\xff]",fi="[^\\ud800-\\udfff"+we+xt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",nr="\\ud83c[\\udffb-\\udfff]",Po="[^\\ud800-\\udfff]",Hs="(?:\\ud83c[\\udde6-\\uddff]){2}",Gn="[\\ud800-\\udbff][\\udc00-\\udfff]",os="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Fp="(?:"+Gt+"|"+fi+")",zs="(?:"+os+"|"+fi+")",Bp="(?:"+ht+"|"+nr+")?",ss="[\\ufe0e\\ufe0f]?"+Bp+("(?:\\u200d(?:"+[Po,Hs,Gn].join("|")+")[\\ufe0e\\ufe0f]?"+Bp+")*"),Up="(?:"+[Ot,Hs,Gn].join("|")+")"+ss,kp="(?:"+[Po+ht+"?",ht,Hs,Gn,Fe].join("|")+")",Al=RegExp("['\u2019]","g"),Gp=RegExp(ht,"g"),js=RegExp(nr+"(?="+nr+")|"+kp+ss,"g"),Io=RegExp([os+"?"+Gt+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[Ye,os,"$"].join("|")+")",zs+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[Ye,os+Fp,"$"].join("|")+")",os+"?"+Fp+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",os+"+(?:['\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_])",xt,Up].join("|"),"g"),Vs=RegExp("[\\u200d\\ud800-\\udfff"+be+"\\ufe0e\\ufe0f]"),Hp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zp=["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"],jp=-1,Nn={};Nn[ae]=Nn[Me]=Nn[De]=Nn[W]=Nn[ye]=Nn[Ce]=Nn["[object Uint8ClampedArray]"]=Nn[Le]=Nn[Ne]=!0,Nn[j]=Nn[F]=Nn[ft]=Nn[K]=Nn[Pe]=Nn[xe]=Nn[Re]=Nn[Ie]=Nn[N]=Nn[D]=Nn[ee]=Nn[C]=Nn[z]=Nn[V]=Nn[qe]=!1;var Hn={};Hn[j]=Hn[F]=Hn[ft]=Hn[Pe]=Hn[K]=Hn[xe]=Hn[ae]=Hn[Me]=Hn[De]=Hn[W]=Hn[ye]=Hn[N]=Hn[D]=Hn[ee]=Hn[C]=Hn[z]=Hn[V]=Hn[ne]=Hn[Ce]=Hn["[object Uint8ClampedArray]"]=Hn[Le]=Hn[Ne]=!0,Hn[Re]=Hn[Ie]=Hn[qe]=!1;var Oo={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tr=parseFloat,Vp=parseInt,Pc=typeof b=="object"&&b&&b.Object===Object&&b,Wp=typeof self=="object"&&self&&self.Object===Object&&self,ti=Pc||Wp||Function("return this")(),Ws=R&&!R.nodeType&&R,La=Ws&&typeof te=="object"&&te&&!te.nodeType&&te,Ic=La&&La.exports===Ws,Gu=Ic&&Pc.process,Er=function(){try{var Ue=La&&La.require&&La.require("util").types;return Ue||Gu&&Gu.binding&&Gu.binding("util")}catch{}}(),Oc=Er&&Er.isArrayBuffer,Lc=Er&&Er.isDate,Hu=Er&&Er.isMap,zu=Er&&Er.isRegExp,ju=Er&&Er.isSet,Vu=Er&&Er.isTypedArray;function ir(Ue,rt,at){switch(at.length){case 0:return Ue.call(rt);case 1:return Ue.call(rt,at[0]);case 2:return Ue.call(rt,at[0],at[1]);case 3:return Ue.call(rt,at[0],at[1],at[2])}return Ue.apply(rt,at)}function Nc(Ue,rt,at,Mt){for(var Ht=-1,vn=Ue==null?0:Ue.length;++Ht<vn;){var ai=Ue[Ht];rt(Mt,ai,at(ai),Ue)}return Mt}function hr(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length;++at<Mt&&rt(Ue[at],at,Ue)!==!1;);return Ue}function Dc(Ue,rt){for(var at=Ue==null?0:Ue.length;at--&&rt(Ue[at],at,Ue)!==!1;);return Ue}function Fc(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length;++at<Mt;)if(!rt(Ue[at],at,Ue))return!1;return!0}function co(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length,Ht=0,vn=[];++at<Mt;){var ai=Ue[at];rt(ai,at,Ue)&&(vn[Ht++]=ai)}return vn}function Na(Ue,rt){return!!(Ue!=null&&Ue.length)&&Xs(Ue,rt,0)>-1}function Wu(Ue,rt,at){for(var Mt=-1,Ht=Ue==null?0:Ue.length;++Mt<Ht;)if(at(rt,Ue[Mt]))return!0;return!1}function Vn(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length,Ht=Array(Mt);++at<Mt;)Ht[at]=rt(Ue[at],at,Ue);return Ht}function Lo(Ue,rt){for(var at=-1,Mt=rt.length,Ht=Ue.length;++at<Mt;)Ue[Ht+at]=rt[at];return Ue}function Xu(Ue,rt,at,Mt){var Ht=-1,vn=Ue==null?0:Ue.length;for(Mt&&vn&&(at=Ue[++Ht]);++Ht<vn;)at=rt(at,Ue[Ht],Ht,Ue);return at}function Xp(Ue,rt,at,Mt){var Ht=Ue==null?0:Ue.length;for(Mt&&Ht&&(at=Ue[--Ht]);Ht--;)at=rt(at,Ue[Ht],Ht,Ue);return at}function qu(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length;++at<Mt;)if(rt(Ue[at],at,Ue))return!0;return!1}var qp=Yu("length");function Bc(Ue,rt,at){var Mt;return at(Ue,function(Ht,vn,ai){if(rt(Ht,vn,ai))return Mt=vn,!1}),Mt}function Rl(Ue,rt,at,Mt){for(var Ht=Ue.length,vn=at+(Mt?1:-1);Mt?vn--:++vn<Ht;)if(rt(Ue[vn],vn,Ue))return vn;return-1}function Xs(Ue,rt,at){return rt==rt?function(Mt,Ht,vn){for(var ai=vn-1,Mr=Mt.length;++ai<Mr;)if(Mt[ai]===Ht)return ai;return-1}(Ue,rt,at):Rl(Ue,Uc,at)}function Yp(Ue,rt,at,Mt){for(var Ht=at-1,vn=Ue.length;++Ht<vn;)if(Mt(Ue[Ht],rt))return Ht;return-1}function Uc(Ue){return Ue!=Ue}function kc(Ue,rt){var at=Ue==null?0:Ue.length;return at?Ju(Ue,rt)/at:NaN}function Yu(Ue){return function(rt){return rt==null?void 0:rt[Ue]}}function $u(Ue){return function(rt){return Ue==null?void 0:Ue[rt]}}function Gc(Ue,rt,at,Mt,Ht){return Ht(Ue,function(vn,ai,Mr){at=Mt?(Mt=!1,vn):rt(at,vn,ai,Mr)}),at}function Ju(Ue,rt){for(var at,Mt=-1,Ht=Ue.length;++Mt<Ht;){var vn=rt(Ue[Mt]);vn!==void 0&&(at=at===void 0?vn:at+vn)}return at}function Zu(Ue,rt){for(var at=-1,Mt=Array(Ue);++at<Ue;)Mt[at]=rt(at);return Mt}function Hc(Ue){return Ue&&Ue.slice(0,ls(Ue)+1).replace(In,"")}function cr(Ue){return function(rt){return Ue(rt)}}function Ku(Ue,rt){return Vn(rt,function(at){return Ue[at]})}function Da(Ue,rt){return Ue.has(rt)}function zc(Ue,rt){for(var at=-1,Mt=Ue.length;++at<Mt&&Xs(rt,Ue[at],0)>-1;);return at}function jc(Ue,rt){for(var at=Ue.length;at--&&Xs(rt,Ue[at],0)>-1;);return at}function $p(Ue,rt){for(var at=Ue.length,Mt=0;at--;)Ue[at]===rt&&++Mt;return Mt}var Jp=$u({\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=$u({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Kp(Ue){return"\\"+Oo[Ue]}function qs(Ue){return Vs.test(Ue)}function Qu(Ue){var rt=-1,at=Array(Ue.size);return Ue.forEach(function(Mt,Ht){at[++rt]=[Ht,Mt]}),at}function Vc(Ue,rt){return function(at){return Ue(rt(at))}}function No(Ue,rt){for(var at=-1,Mt=Ue.length,Ht=0,vn=[];++at<Mt;){var ai=Ue[at];ai!==rt&&ai!==L||(Ue[at]=L,vn[Ht++]=at)}return vn}function as(Ue){var rt=-1,at=Array(Ue.size);return Ue.forEach(function(Mt){at[++rt]=Mt}),at}function Cl(Ue){var rt=-1,at=Array(Ue.size);return Ue.forEach(function(Mt){at[++rt]=[Mt,Mt]}),at}function Do(Ue){return qs(Ue)?function(rt){for(var at=js.lastIndex=0;js.test(rt);)++at;return at}(Ue):qp(Ue)}function zi(Ue){return qs(Ue)?function(rt){return rt.match(js)||[]}(Ue):function(rt){return rt.split("")}(Ue)}function ls(Ue){for(var rt=Ue.length;rt--&&di.test(Ue.charAt(rt)););return rt}var Pl=$u({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Ys=function Ue(rt){var at,Mt=(rt=rt==null?ti:Ys.defaults(ti.Object(),rt,Ys.pick(ti,zp))).Array,Ht=rt.Date,vn=rt.Error,ai=rt.Function,Mr=rt.Math,zn=rt.Object,Il=rt.RegExp,Wc=rt.String,dr=rt.TypeError,Ol=Mt.prototype,Xc=ai.prototype,Br=zn.prototype,Ll=rt["__core-js_shared__"],eh=Xc.toString,Rn=Br.hasOwnProperty,Ag=0,Qp=(at=/[^.]+$/.exec(Ll&&Ll.keys&&Ll.keys.IE_PROTO||""))?"Symbol(src)_1."+at:"",th=Br.toString,Rg=eh.call(zn),Cg=ti._,Pg=Il("^"+eh.call(Rn).replace(jn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nh=Ic?rt.Buffer:void 0,us=rt.Symbol,ih=rt.Uint8Array,ef=nh?nh.allocUnsafe:void 0,rh=Vc(zn.getPrototypeOf,zn),tf=zn.create,nf=Br.propertyIsEnumerable,Nl=Ol.splice,$s=us?us.isConcatSpreadable:void 0,po=us?us.iterator:void 0,Js=us?us.toStringTag:void 0,oh=function(){try{var c=ua(zn,"defineProperty");return c({},"",{}),c}catch{}}(),Ig=rt.clearTimeout!==ti.clearTimeout&&rt.clearTimeout,Og=Ht&&Ht.now!==ti.Date.now&&Ht.now,Lg=rt.setTimeout!==ti.setTimeout&&rt.setTimeout,sh=Mr.ceil,ah=Mr.floor,qc=zn.getOwnPropertySymbols,Yc=nh?nh.isBuffer:void 0,Fo=rt.isFinite,ji=Ol.join,lh=Vc(zn.keys,zn),Wn=Mr.max,wi=Mr.min,Ar=Ht.now,Vi=rt.parseInt,uh=Mr.random,Dl=Ol.reverse,Fl=ua(rt,"DataView"),Fa=ua(rt,"Map"),hh=ua(rt,"Promise"),Zs=ua(rt,"Set"),mt=ua(rt,"WeakMap"),Xn=ua(zn,"create"),Bo=mt&&new mt,Ur={},Ng=vs(Fl),mi=vs(Fa),$c=vs(hh),Bn=vs(Zs),$r=vs(mt),Bl=us?us.prototype:void 0,Ks=Bl?Bl.valueOf:void 0,Fi=Bl?Bl.toString:void 0;function S(c){if(ri(c)&&!on(c)&&!(c instanceof un)){if(c instanceof Zn)return c;if(Rn.call(c,"__wrapped__"))return yf(c)}return new Zn(c)}var hs=function(){function c(){}return function(f){if(!ii(f))return{};if(tf)return tf(f);c.prototype=f;var x=new c;return c.prototype=void 0,x}}();function Ul(){}function Zn(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=void 0}function un(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Jr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var A=c[f];this.set(A[0],A[1])}}function Zr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var A=c[f];this.set(A[0],A[1])}}function pr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var A=c[f];this.set(A[0],A[1])}}function kr(c){var f=-1,x=c==null?0:c.length;for(this.__data__=new pr;++f<x;)this.add(c[f])}function Ji(c){var f=this.__data__=new Zr(c);this.size=f.size}function Uo(c,f){var x=on(c),A=!x&&ys(c),k=!x&&!A&&Vo(c),ie=!x&&!A&&!k&&ca(c),pe=x||A||k||ie,Se=pe?Zu(c.length,Wc):[],Be=Se.length;for(var tt in c)!f&&!Rn.call(c,tt)||pe&&(tt=="length"||k&&(tt=="offset"||tt=="parent")||ie&&(tt=="buffer"||tt=="byteLength"||tt=="byteOffset")||Ki(tt,Be))||Se.push(tt);return Se}function ko(c){var f=c.length;return f?c[fs(0,f-1)]:void 0}function Qs(c,f){return Th(Ai(c),Go(f,0,c.length))}function kl(c){return Th(Ai(c))}function Ba(c,f,x){(x!==void 0&&!Wr(c[f],x)||x===void 0&&!(f in c))&&mo(c,f,x)}function cs(c,f,x){var A=c[f];Rn.call(c,f)&&Wr(A,x)&&(x!==void 0||f in c)||mo(c,f,x)}function fo(c,f){for(var x=c.length;x--;)if(Wr(c[x][0],f))return x;return-1}function Jc(c,f,x,A){return rr(c,function(k,ie,pe){f(A,k,x(k),pe)}),A}function rf(c,f){return c&&ui(f,Ci(f),c)}function mo(c,f,x){f=="__proto__"&&oh?oh(c,f,{configurable:!0,enumerable:!0,value:x,writable:!0}):c[f]=x}function Gl(c,f){for(var x=-1,A=f.length,k=Mt(A),ie=c==null;++x<A;)k[x]=ie?void 0:Cd(c,f[x]);return k}function Go(c,f,x){return c==c&&(x!==void 0&&(c=c<=x?c:x),f!==void 0&&(c=c>=f?c:f)),c}function Mi(c,f,x,A,k,ie){var pe,Se=1&f,Be=2&f,tt=4&f;if(x&&(pe=k?x(c,A,k,ie):x(c)),pe!==void 0)return pe;if(!ii(c))return c;var nt=on(c);if(nt){if(pe=function(lt){var _t=lt.length,Vt=new lt.constructor(_t);return _t&&typeof lt[0]=="string"&&Rn.call(lt,"index")&&(Vt.index=lt.index,Vt.input=lt.input),Vt}(c),!Se)return Ai(c,pe)}else{var gt=Ri(c),Ft=gt==Ie||gt==M;if(Vo(c))return ld(c,Se);if(gt==ee||gt==j||Ft&&!k){if(pe=Be||Ft?{}:pd(c),!Se)return Be?function(lt,_t){return ui(lt,ha(lt),_t)}(c,function(lt,_t){return lt&&ui(_t,Ui(_t),lt)}(pe,c)):function(lt,_t){return ui(lt,jr(lt),_t)}(c,rf(pe,c))}else{if(!Hn[gt])return k?c:{};pe=function(lt,_t,Vt){var Lt=lt.constructor;switch(_t){case ft:return ud(lt);case K:case xe:return new Lt(+lt);case Pe:return function(Kt,dn){var zt=dn?ud(Kt.buffer):Kt.buffer;return new Kt.constructor(zt,Kt.byteOffset,Kt.byteLength)}(lt,Vt);case ae:case Me:case De:case W:case ye:case Ce:case"[object Uint8ClampedArray]":case Le:case Ne:return ia(lt,Vt);case N:return new Lt;case D:case V:return new Lt(lt);case C:return function(Kt){var dn=new Kt.constructor(Kt.source,Sr.exec(Kt));return dn.lastIndex=Kt.lastIndex,dn}(lt);case z:return new Lt;case ne:return jt=lt,Ks?zn(Ks.call(jt)):{}}var jt}(c,gt,Se)}}ie||(ie=new Ji);var kt=ie.get(c);if(kt)return kt;ie.set(c,pe),Ff(c)?c.forEach(function(lt){pe.add(Mi(lt,f,x,lt,c,ie))}):Df(c)&&c.forEach(function(lt,_t){pe.set(_t,Mi(lt,f,x,_t,c,ie))});var $t=nt?void 0:(tt?Be?aa:or:Be?Ui:Ci)(c);return hr($t||c,function(lt,_t){$t&&(lt=c[_t=lt]),cs(pe,_t,Mi(lt,f,x,_t,c,ie))}),pe}function go(c,f,x){var A=x.length;if(c==null)return!A;for(c=zn(c);A--;){var k=x[A],ie=f[k],pe=c[k];if(pe===void 0&&!(k in c)||!ie(pe))return!1}return!0}function ch(c,f,x){if(typeof c!="function")throw new dr($);return Yl(function(){c.apply(void 0,x)},f)}function ds(c,f,x,A){var k=-1,ie=Na,pe=!0,Se=c.length,Be=[],tt=f.length;if(!Se)return Be;x&&(f=Vn(f,cr(x))),A?(ie=Wu,pe=!1):f.length>=200&&(ie=Da,pe=!1,f=new kr(f));e:for(;++k<Se;){var nt=c[k],gt=x==null?nt:x(nt);if(nt=A||nt!==0?nt:0,pe&&gt==gt){for(var Ft=tt;Ft--;)if(f[Ft]===gt)continue e;Be.push(nt)}else ie(f,gt,A)||Be.push(nt)}return Be}S.templateSettings={escape:qt,evaluate:rn,interpolate:Bt,variable:"",imports:{_:S}},S.prototype=Ul.prototype,S.prototype.constructor=S,Zn.prototype=hs(Ul.prototype),Zn.prototype.constructor=Zn,un.prototype=hs(Ul.prototype),un.prototype.constructor=un,Jr.prototype.clear=function(){this.__data__=Xn?Xn(null):{},this.size=0},Jr.prototype.delete=function(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f},Jr.prototype.get=function(c){var f=this.__data__;if(Xn){var x=f[c];return x==="__lodash_hash_undefined__"?void 0:x}return Rn.call(f,c)?f[c]:void 0},Jr.prototype.has=function(c){var f=this.__data__;return Xn?f[c]!==void 0:Rn.call(f,c)},Jr.prototype.set=function(c,f){var x=this.__data__;return this.size+=this.has(c)?0:1,x[c]=Xn&&f===void 0?"__lodash_hash_undefined__":f,this},Zr.prototype.clear=function(){this.__data__=[],this.size=0},Zr.prototype.delete=function(c){var f=this.__data__,x=fo(f,c);return!(x<0)&&(x==f.length-1?f.pop():Nl.call(f,x,1),--this.size,!0)},Zr.prototype.get=function(c){var f=this.__data__,x=fo(f,c);return x<0?void 0:f[x][1]},Zr.prototype.has=function(c){return fo(this.__data__,c)>-1},Zr.prototype.set=function(c,f){var x=this.__data__,A=fo(x,c);return A<0?(++this.size,x.push([c,f])):x[A][1]=f,this},pr.prototype.clear=function(){this.size=0,this.__data__={hash:new Jr,map:new(Fa||Zr),string:new Jr}},pr.prototype.delete=function(c){var f=Ja(this,c).delete(c);return this.size-=f?1:0,f},pr.prototype.get=function(c){return Ja(this,c).get(c)},pr.prototype.has=function(c){return Ja(this,c).has(c)},pr.prototype.set=function(c,f){var x=Ja(this,c),A=x.size;return x.set(c,f),this.size+=x.size==A?0:1,this},kr.prototype.add=kr.prototype.push=function(c){return this.__data__.set(c,"__lodash_hash_undefined__"),this},kr.prototype.has=function(c){return this.__data__.has(c)},Ji.prototype.clear=function(){this.__data__=new Zr,this.size=0},Ji.prototype.delete=function(c){var f=this.__data__,x=f.delete(c);return this.size=f.size,x},Ji.prototype.get=function(c){return this.__data__.get(c)},Ji.prototype.has=function(c){return this.__data__.has(c)},Ji.prototype.set=function(c,f){var x=this.__data__;if(x instanceof Zr){var A=x.__data__;if(!Fa||A.length<199)return A.push([c,f]),this.size=++x.size,this;x=this.__data__=new pr(A)}return x.set(c,f),this.size=x.size,this};var rr=Xt(vo),dh=Xt(Zc,!0);function ph(c,f){var x=!0;return rr(c,function(A,k,ie){return x=!!f(A,k,ie)}),x}function Ua(c,f,x){for(var A=-1,k=c.length;++A<k;){var ie=c[A],pe=f(ie);if(pe!=null&&(Se===void 0?pe==pe&&!Or(pe):x(pe,Se)))var Se=pe,Be=ie}return Be}function Ho(c,f){var x=[];return rr(c,function(A,k,ie){f(A,k,ie)&&x.push(A)}),x}function Rt(c,f,x,A,k){var ie=-1,pe=c.length;for(x||(x=Dg),k||(k=[]);++ie<pe;){var Se=c[ie];f>0&&x(Se)?f>1?Rt(Se,f-1,x,A,k):Lo(k,Se):A||(k[k.length]=Se)}return k}var ps=hd(),Gr=hd(!0);function vo(c,f){return c&&ps(c,f,Ci)}function Zc(c,f){return c&&Gr(c,f,Ci)}function Kr(c,f){return co(f,function(x){return no(c[x])})}function _o(c,f){for(var x=0,A=(f=eo(f,c)).length;c!=null&&x<A;)c=c[Vr(f[x++])];return x&&x==A?c:void 0}function fr(c,f,x){var A=f(c);return on(c)?A:Lo(A,x(c))}function Zi(c){return c==null?c===void 0?"[object Undefined]":"[object Null]":Js&&Js in zn(c)?function(f){var x=Rn.call(f,Js),A=f[Js];try{f[Js]=void 0;var k=!0}catch{}var ie=th.call(f);return k&&(x?f[Js]=A:delete f[Js]),ie}(c):function(f){return th.call(f)}(c)}function fh(c,f){return c>f}function ea(c,f){return c!=null&&Rn.call(c,f)}function Kc(c,f){return c!=null&&f in zn(c)}function Qc(c,f,x){for(var A=x?Wu:Na,k=c[0].length,ie=c.length,pe=ie,Se=Mt(ie),Be=1/0,tt=[];pe--;){var nt=c[pe];pe&&f&&(nt=Vn(nt,cr(f))),Be=wi(nt.length,Be),Se[pe]=!x&&(f||k>=120&&nt.length>=120)?new kr(pe&&nt):void 0}nt=c[0];var gt=-1,Ft=Se[0];e:for(;++gt<k&&tt.length<Be;){var kt=nt[gt],$t=f?f(kt):kt;if(kt=x||kt!==0?kt:0,!(Ft?Da(Ft,$t):A(tt,$t,x))){for(pe=ie;--pe;){var lt=Se[pe];if(!(lt?Da(lt,$t):A(c[pe],$t,x)))continue e}Ft&&Ft.push($t),tt.push(kt)}}return tt}function ka(c,f,x){var A=(c=mf(c,f=eo(f,c)))==null?c:c[Vr(Ir(f))];return A==null?void 0:ir(A,c,x)}function ta(c){return ri(c)&&Zi(c)==j}function Rr(c,f,x,A,k){return c===f||(c==null||f==null||!ri(c)&&!ri(f)?c!=c&&f!=f:function(ie,pe,Se,Be,tt,nt){var gt=on(ie),Ft=on(pe),kt=gt?F:Ri(ie),$t=Ft?F:Ri(pe),lt=(kt=kt==j?ee:kt)==ee,_t=($t=$t==j?ee:$t)==ee,Vt=kt==$t;if(Vt&&Vo(ie)){if(!Vo(pe))return!1;gt=!0,lt=!1}if(Vt&&!lt)return nt||(nt=new Ji),gt||ca(ie)?Wi(ie,pe,Se,Be,tt,nt):function(zt,en,hi,Xi,ci,oi,io){switch(hi){case Pe:if(zt.byteLength!=en.byteLength||zt.byteOffset!=en.byteOffset)return!1;zt=zt.buffer,en=en.buffer;case ft:return!(zt.byteLength!=en.byteLength||!oi(new ih(zt),new ih(en)));case K:case xe:case D:return Wr(+zt,+en);case Re:return zt.name==en.name&&zt.message==en.message;case C:case V:return zt==en+"";case N:var So=Qu;case z:var bs=1&Xi;if(So||(So=as),zt.size!=en.size&&!bs)return!1;var ol=io.get(zt);if(ol)return ol==en;Xi|=2,io.set(zt,en);var ws=Wi(So(zt),So(en),Xi,ci,oi,io);return io.delete(zt),ws;case ne:if(Ks)return Ks.call(zt)==Ks.call(en)}return!1}(ie,pe,kt,Se,Be,tt,nt);if(!(1&Se)){var Lt=lt&&Rn.call(ie,"__wrapped__"),jt=_t&&Rn.call(pe,"__wrapped__");if(Lt||jt){var Kt=Lt?ie.value():ie,dn=jt?pe.value():pe;return nt||(nt=new Ji),tt(Kt,dn,Se,Be,nt)}}return Vt?(nt||(nt=new Ji),function(zt,en,hi,Xi,ci,oi){var io=1&hi,So=or(zt),bs=So.length,ol=or(en).length;if(bs!=ol&&!io)return!1;for(var ws=bs;ws--;){var To=So[ws];if(!(io?To in en:Rn.call(en,To)))return!1}var Vh=oi.get(zt),Ld=oi.get(en);if(Vh&&Ld)return Vh==en&&Ld==zt;var Ss=!0;oi.set(zt,en),oi.set(en,zt);for(var va=io;++ws<bs;){To=So[ws];var _a=zt[To],sl=en[To];if(Xi)var al=io?Xi(sl,_a,To,en,zt,oi):Xi(_a,sl,To,zt,en,oi);if(!(al===void 0?_a===sl||ci(_a,sl,hi,Xi,oi):al)){Ss=!1;break}va||(va=To=="constructor")}if(Ss&&!va){var ou=zt.constructor,ya=en.constructor;ou==ya||!("constructor"in zt)||!("constructor"in en)||typeof ou=="function"&&ou instanceof ou&&typeof ya=="function"&&ya instanceof ya||(Ss=!1)}return oi.delete(zt),oi.delete(en),Ss}(ie,pe,Se,Be,tt,nt)):!1}(c,f,x,A,Rr,k))}function Ga(c,f,x,A){var k=x.length,ie=k,pe=!A;if(c==null)return!ie;for(c=zn(c);k--;){var Se=x[k];if(pe&&Se[2]?Se[1]!==c[Se[0]]:!(Se[0]in c))return!1}for(;++k<ie;){var Be=(Se=x[k])[0],tt=c[Be],nt=Se[1];if(pe&&Se[2]){if(tt===void 0&&!(Be in c))return!1}else{var gt=new Ji;if(A)var Ft=A(tt,nt,Be,c,f,gt);if(!(Ft===void 0?Rr(nt,tt,3,A,gt):Ft))return!1}}return!0}function Ha(c){return!(!ii(c)||(f=c,Qp&&Qp in f))&&(no(c)?Pg:O).test(vs(c));var f}function of(c){return typeof c=="function"?c:c==null?ar:typeof c=="object"?on(c)?nd(c[0],c[1]):af(c):Yf(c)}function ed(c){if(!ql(c))return lh(c);var f=[];for(var x in zn(c))Rn.call(c,x)&&x!="constructor"&&f.push(x);return f}function sf(c){if(!ii(c))return function(k){var ie=[];if(k!=null)for(var pe in zn(k))ie.push(pe);return ie}(c);var f=ql(c),x=[];for(var A in c)(A!="constructor"||!f&&Rn.call(c,A))&&x.push(A);return x}function mh(c,f){return c<f}function td(c,f){var x=-1,A=mr(c)?Mt(c.length):[];return rr(c,function(k,ie,pe){A[++x]=f(k,ie,pe)}),A}function af(c){var f=dd(c);return f.length==1&&f[0][2]?pf(f[0][0],f[0][1]):function(x){return x===c||Ga(x,c,f)}}function nd(c,f){return At(c)&&df(f)?pf(Vr(c),f):function(x){var A=Cd(x,c);return A===void 0&&A===f?Zl(x,c):Rr(f,A,3)}}function pn(c,f,x,A,k){c!==f&&ps(f,function(ie,pe){if(k||(k=new Ji),ii(ie))(function(Be,tt,nt,gt,Ft,kt,$t){var lt=fd(Be,nt),_t=fd(tt,nt),Vt=$t.get(_t);if(Vt)return void Ba(Be,nt,Vt);var Lt=kt?kt(lt,_t,nt+"",Be,tt,$t):void 0,jt=Lt===void 0;if(jt){var Kt=on(_t),dn=!Kt&&Vo(_t),zt=!Kt&&!dn&&ca(_t);Lt=_t,Kt||dn||zt?on(lt)?Lt=lt:Yn(lt)?Lt=Ai(lt):dn?(jt=!1,Lt=ld(_t,!0)):zt?(jt=!1,Lt=ia(_t,!0)):Lt=[]:Qa(_t)||ys(_t)?(Lt=lt,ys(lt)?Lt=Gf(lt):ii(lt)&&!no(lt)||(Lt=pd(_t))):jt=!1}jt&&($t.set(_t,Lt),Ft(Lt,_t,gt,kt,$t),$t.delete(_t)),Ba(Be,nt,Lt)})(c,f,pe,x,pn,A,k);else{var Se=A?A(fd(c,pe),ie,pe+"",c,f,k):void 0;Se===void 0&&(Se=ie),Ba(c,pe,Se)}},Ui)}function Hr(c,f){var x=c.length;if(x)return Ki(f+=f<0?x:0,x)?c[f]:void 0}function yo(c,f,x){f=f.length?Vn(f,function(k){return on(k)?function(ie){return _o(ie,k.length===1?k[0]:k)}:k}):[ar];var A=-1;return f=Vn(f,cr(Yt())),function(k,ie){var pe=k.length;for(k.sort(ie);pe--;)k[pe]=k[pe].value;return k}(td(c,function(k,ie,pe){return{criteria:Vn(f,function(Se){return Se(k)}),index:++A,value:k}}),function(k,ie){return function(pe,Se,Be){for(var tt=-1,nt=pe.criteria,gt=Se.criteria,Ft=nt.length,kt=Be.length;++tt<Ft;){var $t=cf(nt[tt],gt[tt]);if($t){if(tt>=kt)return $t;var lt=Be[tt];return $t*(lt=="desc"?-1:1)}}return pe.index-Se.index}(k,ie,x)})}function gh(c,f,x){for(var A=-1,k=f.length,ie={};++A<k;){var pe=f[A],Se=_o(c,pe);x(Se,pe)&&qn(ie,eo(pe,c),Se)}return ie}function Qr(c,f,x,A){var k=A?Yp:Xs,ie=-1,pe=f.length,Se=c;for(c===f&&(f=Ai(f)),x&&(Se=Vn(c,cr(x)));++ie<pe;)for(var Be=0,tt=f[ie],nt=x?x(tt):tt;(Be=k(Se,nt,Be,A))>-1;)Se!==c&&Nl.call(Se,Be,1),Nl.call(c,Be,1);return c}function na(c,f){for(var x=c?f.length:0,A=x-1;x--;){var k=f[x];if(x==A||k!==ie){var ie=k;Ki(k)?Nl.call(c,k,1):ja(c,k)}}return c}function fs(c,f){return c+ah(uh()*(f-c+1))}function vh(c,f){var x="";if(!c||f<1||f>9007199254740991)return x;do f%2&&(x+=c),(f=ah(f/2))&&(c+=c);while(f);return x}function fn(c,f){return md(ff(c,f,ar),c+"")}function id(c){return ko(wo(c))}function rd(c,f){var x=wo(c);return Th(x,Go(f,0,x.length))}function qn(c,f,x,A){if(!ii(c))return c;for(var k=-1,ie=(f=eo(f,c)).length,pe=ie-1,Se=c;Se!=null&&++k<ie;){var Be=Vr(f[k]),tt=x;if(Be==="__proto__"||Be==="constructor"||Be==="prototype")return c;if(k!=pe){var nt=Se[Be];(tt=A?A(nt,Be,Se):void 0)===void 0&&(tt=ii(nt)?nt:Ki(f[k+1])?[]:{})}cs(Se,Be,tt),Se=Se[Be]}return c}var lf=Bo?function(c,f){return Bo.set(c,f),c}:ar,Bi=oh?function(c,f){return oh(c,"toString",{configurable:!0,enumerable:!1,value:nl(f),writable:!0})}:ar;function uf(c){return Th(wo(c))}function li(c,f,x){var A=-1,k=c.length;f<0&&(f=-f>k?0:k+f),(x=x>k?k:x)<0&&(x+=k),k=f>x?0:x-f>>>0,f>>>=0;for(var ie=Mt(k);++A<k;)ie[A]=c[A+f];return ie}function _h(c,f){var x;return rr(c,function(A,k,ie){return!(x=f(A,k,ie))}),!!x}function za(c,f,x){var A=0,k=c==null?A:c.length;if(typeof f=="number"&&f==f&&k<=2147483647){for(;A<k;){var ie=A+k>>>1,pe=c[ie];pe!==null&&!Or(pe)&&(x?pe<=f:pe<f)?A=ie+1:k=ie}return k}return Hl(c,f,ar,x)}function Hl(c,f,x,A){var k=0,ie=c==null?0:c.length;if(ie===0)return 0;for(var pe=(f=x(f))!=f,Se=f===null,Be=Or(f),tt=f===void 0;k<ie;){var nt=ah((k+ie)/2),gt=x(c[nt]),Ft=gt!==void 0,kt=gt===null,$t=gt==gt,lt=Or(gt);if(pe)var _t=A||$t;else _t=tt?$t&&(A||Ft):Se?$t&&Ft&&(A||!kt):Be?$t&&Ft&&!kt&&(A||!lt):!kt&&!lt&&(A?gt<=f:gt<f);_t?k=nt+1:ie=nt}return wi(ie,4294967294)}function yh(c,f){for(var x=-1,A=c.length,k=0,ie=[];++x<A;){var pe=c[x],Se=f?f(pe):pe;if(!x||!Wr(Se,Be)){var Be=Se;ie[k++]=pe===0?0:pe}}return ie}function Dt(c){return typeof c=="number"?c:Or(c)?NaN:+c}function gi(c){if(typeof c=="string")return c;if(on(c))return Vn(c,gi)+"";if(Or(c))return Fi?Fi.call(c):"";var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}function Tn(c,f,x){var A=-1,k=Na,ie=c.length,pe=!0,Se=[],Be=Se;if(x)pe=!1,k=Wu;else if(ie>=200){var tt=f?null:cd(c);if(tt)return as(tt);pe=!1,k=Da,Be=new kr}else Be=f?[]:Se;e:for(;++A<ie;){var nt=c[A],gt=f?f(nt):nt;if(nt=x||nt!==0?nt:0,pe&&gt==gt){for(var Ft=Be.length;Ft--;)if(Be[Ft]===gt)continue e;f&&Be.push(gt),Se.push(nt)}else k(Be,gt,x)||(Be!==Se&&Be.push(gt),Se.push(nt))}return Se}function ja(c,f){return(c=mf(c,f=eo(f,c)))==null||delete c[Vr(Ir(f))]}function gn(c,f,x,A){return qn(c,f,x(_o(c,f)),A)}function zl(c,f,x,A){for(var k=c.length,ie=A?k:-1;(A?ie--:++ie<k)&&f(c[ie],ie,c););return x?li(c,A?0:ie,A?ie+1:k):li(c,A?ie+1:0,A?k:ie)}function od(c,f){var x=c;return x instanceof un&&(x=x.value()),Xu(f,function(A,k){return k.func.apply(k.thisArg,Lo([A],k.args))},x)}function xh(c,f,x){var A=c.length;if(A<2)return A?Tn(c[0]):[];for(var k=-1,ie=Mt(A);++k<A;)for(var pe=c[k],Se=-1;++Se<A;)Se!=k&&(ie[k]=ds(ie[k]||pe,c[Se],f,x));return Tn(Rt(ie,1),f,x)}function sd(c,f,x){for(var A=-1,k=c.length,ie=f.length,pe={};++A<k;){var Se=A<ie?f[A]:void 0;x(pe,c[A],Se)}return pe}function Va(c){return Yn(c)?c:[]}function bh(c){return typeof c=="function"?c:ar}function eo(c,f){return on(c)?c:At(c,f)?[c]:Eh(bn(c))}var hf=fn;function Tt(c,f,x){var A=c.length;return x=x===void 0?A:x,!f&&x>=A?c:li(c,f,x)}var ad=Ig||function(c){return ti.clearTimeout(c)};function ld(c,f){if(f)return c.slice();var x=c.length,A=ef?ef(x):new c.constructor(x);return c.copy(A),A}function ud(c){var f=new c.constructor(c.byteLength);return new ih(f).set(new ih(c)),f}function ia(c,f){var x=f?ud(c.buffer):c.buffer;return new c.constructor(x,c.byteOffset,c.length)}function cf(c,f){if(c!==f){var x=c!==void 0,A=c===null,k=c==c,ie=Or(c),pe=f!==void 0,Se=f===null,Be=f==f,tt=Or(f);if(!Se&&!tt&&!ie&&c>f||ie&&pe&&Be&&!Se&&!tt||A&&pe&&Be||!x&&Be||!k)return 1;if(!A&&!ie&&!tt&&c<f||tt&&x&&k&&!A&&!ie||Se&&x&&k||!pe&&k||!Be)return-1}return 0}function Cr(c,f,x,A){for(var k=-1,ie=c.length,pe=x.length,Se=-1,Be=f.length,tt=Wn(ie-pe,0),nt=Mt(Be+tt),gt=!A;++Se<Be;)nt[Se]=f[Se];for(;++k<pe;)(gt||k<ie)&&(nt[x[k]]=c[k]);for(;tt--;)nt[Se++]=c[k++];return nt}function wh(c,f,x,A){for(var k=-1,ie=c.length,pe=-1,Se=x.length,Be=-1,tt=f.length,nt=Wn(ie-Se,0),gt=Mt(nt+tt),Ft=!A;++k<nt;)gt[k]=c[k];for(var kt=k;++Be<tt;)gt[kt+Be]=f[Be];for(;++pe<Se;)(Ft||k<ie)&&(gt[kt+x[pe]]=c[k++]);return gt}function Ai(c,f){var x=-1,A=c.length;for(f||(f=Mt(A));++x<A;)f[x]=c[x];return f}function ui(c,f,x,A){var k=!x;x||(x={});for(var ie=-1,pe=f.length;++ie<pe;){var Se=f[ie],Be=A?A(x[Se],c[Se],Se,x,c):void 0;Be===void 0&&(Be=c[Se]),k?mo(x,Se,Be):cs(x,Se,Be)}return x}function ms(c,f){return function(x,A){var k=on(x)?Nc:Jc,ie=f?f():{};return k(x,c,Yt(A,2),ie)}}function ni(c){return fn(function(f,x){var A=-1,k=x.length,ie=k>1?x[k-1]:void 0,pe=k>2?x[2]:void 0;for(ie=c.length>3&&typeof ie=="function"?(k--,ie):void 0,pe&&Qt(x[0],x[1],pe)&&(ie=k<3?void 0:ie,k=1),f=zn(f);++A<k;){var Se=x[A];Se&&c(f,Se,A,ie)}return f})}function Xt(c,f){return function(x,A){if(x==null)return x;if(!mr(x))return c(x,A);for(var k=x.length,ie=f?k:-1,pe=zn(x);(f?ie--:++ie<k)&&A(pe[ie],ie,pe)!==!1;);return x}}function hd(c){return function(f,x,A){for(var k=-1,ie=zn(f),pe=A(f),Se=pe.length;Se--;){var Be=pe[c?Se:++k];if(x(ie[Be],Be,ie)===!1)break}return f}}function ra(c){return function(f){var x=qs(f=bn(f))?zi(f):void 0,A=x?x[0]:f.charAt(0),k=x?Tt(x,1).join(""):f.slice(1);return A[c]()+k}}function gs(c){return function(f){return Xu(Pd(ga(f).replace(Al,"")),c,"")}}function zr(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var x=hs(c.prototype),A=c.apply(x,f);return ii(A)?A:x}}function zo(c){return function(f,x,A){var k=zn(f);if(!mr(f)){var ie=Yt(x,3);f=Ci(f),x=function(Se){return ie(k[Se],Se,k)}}var pe=c(f,x,A);return pe>-1?k[ie?f[pe]:pe]:void 0}}function jo(c){return bo(function(f){var x=f.length,A=x,k=Zn.prototype.thru;for(c&&f.reverse();A--;){var ie=f[A];if(typeof ie!="function")throw new dr($);if(k&&!pe&&la(ie)=="wrapper")var pe=new Zn([],!0)}for(A=pe?A:x;++A<x;){var Se=la(ie=f[A]),Be=Se=="wrapper"?vi(ie):void 0;pe=Be&&Pr(Be[0])&&Be[1]==424&&!Be[4].length&&Be[9]==1?pe[la(Be[0])].apply(pe,Be[3]):ie.length==1&&Pr(ie)?pe[Se]():pe.thru(ie)}return function(){var tt=arguments,nt=tt[0];if(pe&&tt.length==1&&on(nt))return pe.plant(nt).value();for(var gt=0,Ft=x?f[gt].apply(this,tt):nt;++gt<x;)Ft=f[gt].call(this,Ft);return Ft}})}function Wa(c,f,x,A,k,ie,pe,Se,Be,tt){var nt=128&f,gt=1&f,Ft=2&f,kt=24&f,$t=512&f,lt=Ft?void 0:zr(c);return function _t(){for(var Vt=arguments.length,Lt=Mt(Vt),jt=Vt;jt--;)Lt[jt]=arguments[jt];if(kt)var Kt=to(_t),dn=$p(Lt,Kt);if(A&&(Lt=Cr(Lt,A,k,kt)),ie&&(Lt=wh(Lt,ie,pe,kt)),Vt-=dn,kt&&Vt<tt){var zt=No(Lt,Kt);return Vl(c,f,Wa,_t.placeholder,x,Lt,zt,Se,Be,tt-Vt)}var en=gt?x:this,hi=Ft?en[c]:c;return Vt=Lt.length,Se?Lt=Bg(Lt,Se):$t&&Vt>1&&Lt.reverse(),nt&&Be<Vt&&(Lt.length=Be),this&&this!==ti&&this instanceof _t&&(hi=lt||zr(hi)),hi.apply(en,Lt)}}function Sh(c,f){return function(x,A){return function(k,ie,pe,Se){return vo(k,function(Be,tt,nt){ie(Se,pe(Be),tt,nt)}),Se}(x,c,f(A),{})}}function Xa(c,f){return function(x,A){var k;if(x===void 0&&A===void 0)return f;if(x!==void 0&&(k=x),A!==void 0){if(k===void 0)return A;typeof x=="string"||typeof A=="string"?(x=gi(x),A=gi(A)):(x=Dt(x),A=Dt(A)),k=c(x,A)}return k}}function qa(c){return bo(function(f){return f=Vn(f,cr(Yt())),fn(function(x){var A=this;return c(f,function(k){return ir(k,A,x)})})})}function oa(c,f){var x=(f=f===void 0?" ":gi(f)).length;if(x<2)return x?vh(f,c):f;var A=vh(f,sh(c/Do(f)));return qs(f)?Tt(zi(A),0,c).join(""):A.slice(0,c)}function jl(c){return function(f,x,A){return A&&typeof A!="number"&&Qt(f,x,A)&&(x=A=void 0),f=Wo(f),x===void 0?(x=f,f=0):x=Wo(x),function(k,ie,pe,Se){for(var Be=-1,tt=Wn(sh((ie-k)/(pe||1)),0),nt=Mt(tt);tt--;)nt[Se?tt:++Be]=k,k+=pe;return nt}(f,x,A=A===void 0?f<x?1:-1:Wo(A),c)}}function sa(c){return function(f,x){return typeof f=="string"&&typeof x=="string"||(f=Lr(f),x=Lr(x)),c(f,x)}}function Vl(c,f,x,A,k,ie,pe,Se,Be,tt){var nt=8&f;f|=nt?32:64,4&(f&=~(nt?64:32))||(f&=-4);var gt=[c,f,k,nt?ie:void 0,nt?pe:void 0,nt?void 0:ie,nt?void 0:pe,Se,Be,tt],Ft=x.apply(void 0,gt);return Pr(c)&&gf(Ft,gt),Ft.placeholder=A,vf(Ft,c,f)}function Ya(c){var f=Mr[c];return function(x,A){if(x=Lr(x),(A=A==null?0:wi(mn(A),292))&&Fo(x)){var k=(bn(x)+"e").split("e");return+((k=(bn(f(k[0]+"e"+(+k[1]+A)))+"e").split("e"))[0]+"e"+(+k[1]-A))}return f(x)}}var cd=Zs&&1/as(new Zs([,-0]))[1]==1/0?function(c){return new Zs(c)}:il;function Wl(c){return function(f){var x=Ri(f);return x==N?Qu(f):x==z?Cl(f):function(A,k){return Vn(k,function(ie){return[ie,A[ie]]})}(f,c(f))}}function En(c,f,x,A,k,ie,pe,Se){var Be=2&f;if(!Be&&typeof c!="function")throw new dr($);var tt=A?A.length:0;if(tt||(f&=-97,A=k=void 0),pe=pe===void 0?pe:Wn(mn(pe),0),Se=Se===void 0?Se:mn(Se),tt-=k?k.length:0,64&f){var nt=A,gt=k;A=k=void 0}var Ft=Be?void 0:vi(c),kt=[c,f,x,A,k,nt,gt,ie,pe,Se];if(Ft&&function(lt,_t){var Vt=lt[1],Lt=_t[1],jt=Vt|Lt,Kt=jt<131,dn=Lt==128&&Vt==8||Lt==128&&Vt==256&&lt[7].length<=_t[8]||Lt==384&&_t[7].length<=_t[8]&&Vt==8;if(!Kt&&!dn)return lt;1&Lt&&(lt[2]=_t[2],jt|=1&Vt?0:4);var zt=_t[3];if(zt){var en=lt[3];lt[3]=en?Cr(en,zt,_t[4]):zt,lt[4]=en?No(lt[3],L):_t[4]}(zt=_t[5])&&(en=lt[5],lt[5]=en?wh(en,zt,_t[6]):zt,lt[6]=en?No(lt[5],L):_t[6]),(zt=_t[7])&&(lt[7]=zt),128&Lt&&(lt[8]=lt[8]==null?_t[8]:wi(lt[8],_t[8])),lt[9]==null&&(lt[9]=_t[9]),lt[0]=_t[0],lt[1]=jt}(kt,Ft),c=kt[0],f=kt[1],x=kt[2],A=kt[3],k=kt[4],!(Se=kt[9]=kt[9]===void 0?Be?0:c.length:Wn(kt[9]-tt,0))&&24&f&&(f&=-25),f&&f!=1)$t=f==8||f==16?function(lt,_t,Vt){var Lt=zr(lt);return function jt(){for(var Kt=arguments.length,dn=Mt(Kt),zt=Kt,en=to(jt);zt--;)dn[zt]=arguments[zt];var hi=Kt<3&&dn[0]!==en&&dn[Kt-1]!==en?[]:No(dn,en);if((Kt-=hi.length)<Vt)return Vl(lt,_t,Wa,jt.placeholder,void 0,dn,hi,void 0,void 0,Vt-Kt);var Xi=this&&this!==ti&&this instanceof jt?Lt:lt;return ir(Xi,this,dn)}}(c,f,Se):f!=32&&f!=33||k.length?Wa.apply(void 0,kt):function(lt,_t,Vt,Lt){var jt=1&_t,Kt=zr(lt);return function dn(){for(var zt=-1,en=arguments.length,hi=-1,Xi=Lt.length,ci=Mt(Xi+en),oi=this&&this!==ti&&this instanceof dn?Kt:lt;++hi<Xi;)ci[hi]=Lt[hi];for(;en--;)ci[hi++]=arguments[++zt];return ir(oi,jt?Vt:this,ci)}}(c,f,x,A);else var $t=function(lt,_t,Vt){var Lt=1&_t,jt=zr(lt);return function Kt(){var dn=this&&this!==ti&&this instanceof Kt?jt:lt;return dn.apply(Lt?Vt:this,arguments)}}(c,f,x);return vf((Ft?lf:gf)($t,kt),c,f)}function Xl(c,f,x,A){return c===void 0||Wr(c,Br[x])&&!Rn.call(A,x)?f:c}function xo(c,f,x,A,k,ie){return ii(c)&&ii(f)&&(ie.set(f,c),pn(c,f,void 0,xo,ie),ie.delete(f)),c}function $a(c){return Qa(c)?void 0:c}function Wi(c,f,x,A,k,ie){var pe=1&x,Se=c.length,Be=f.length;if(Se!=Be&&!(pe&&Be>Se))return!1;var tt=ie.get(c),nt=ie.get(f);if(tt&&nt)return tt==f&&nt==c;var gt=-1,Ft=!0,kt=2&x?new kr:void 0;for(ie.set(c,f),ie.set(f,c);++gt<Se;){var $t=c[gt],lt=f[gt];if(A)var _t=pe?A(lt,$t,gt,f,c,ie):A($t,lt,gt,c,f,ie);if(_t!==void 0){if(_t)continue;Ft=!1;break}if(kt){if(!qu(f,function(Vt,Lt){if(!Da(kt,Lt)&&($t===Vt||k($t,Vt,x,A,ie)))return kt.push(Lt)})){Ft=!1;break}}else if($t!==lt&&!k($t,lt,x,A,ie)){Ft=!1;break}}return ie.delete(c),ie.delete(f),Ft}function bo(c){return md(ff(c,void 0,_d),c+"")}function or(c){return fr(c,Ci,jr)}function aa(c){return fr(c,Ui,ha)}var vi=Bo?function(c){return Bo.get(c)}:il;function la(c){for(var f=c.name+"",x=Ur[f],A=Rn.call(Ur,f)?x.length:0;A--;){var k=x[A],ie=k.func;if(ie==null||ie==c)return k.name}return f}function to(c){return(Rn.call(S,"placeholder")?S:c).placeholder}function Yt(){var c=S.iteratee||Bh;return c=c===Bh?of:c,arguments.length?c(arguments[0],arguments[1]):c}function Ja(c,f){var x,A,k=c.__data__;return((A=typeof(x=f))=="string"||A=="number"||A=="symbol"||A=="boolean"?x!=="__proto__":x===null)?k[typeof f=="string"?"string":"hash"]:k.map}function dd(c){for(var f=Ci(c),x=f.length;x--;){var A=f[x],k=c[A];f[x]=[A,k,df(k)]}return f}function ua(c,f){var x=function(A,k){return A==null?void 0:A[k]}(c,f);return Ha(x)?x:void 0}var jr=qc?function(c){return c==null?[]:(c=zn(c),co(qc(c),function(f){return nf.call(c,f)}))}:Hh,ha=qc?function(c){for(var f=[];c;)Lo(f,jr(c)),c=rh(c);return f}:Hh,Ri=Zi;function Za(c,f,x){for(var A=-1,k=(f=eo(f,c)).length,ie=!1;++A<k;){var pe=Vr(f[A]);if(!(ie=c!=null&&x(c,pe)))break;c=c[pe]}return ie||++A!=k?ie:!!(k=c==null?0:c.length)&&Ph(k)&&Ki(pe,k)&&(on(c)||ys(c))}function pd(c){return typeof c.constructor!="function"||ql(c)?{}:hs(rh(c))}function Dg(c){return on(c)||ys(c)||!!($s&&c&&c[$s])}function Ki(c,f){var x=typeof c;return!!(f=f==null?9007199254740991:f)&&(x=="number"||x!="symbol"&&J.test(c))&&c>-1&&c%1==0&&c<f}function Qt(c,f,x){if(!ii(x))return!1;var A=typeof f;return!!(A=="number"?mr(x)&&Ki(f,x.length):A=="string"&&f in x)&&Wr(x[f],c)}function At(c,f){if(on(c))return!1;var x=typeof c;return!(x!="number"&&x!="symbol"&&x!="boolean"&&c!=null&&!Or(c))||Fn.test(c)||!Dn.test(c)||f!=null&&c in zn(f)}function Pr(c){var f=la(c),x=S[f];if(typeof x!="function"||!(f in un.prototype))return!1;if(c===x)return!0;var A=vi(x);return!!A&&c===A[0]}(Fl&&Ri(new Fl(new ArrayBuffer(1)))!=Pe||Fa&&Ri(new Fa)!=N||hh&&Ri(hh.resolve())!="[object Promise]"||Zs&&Ri(new Zs)!=z||mt&&Ri(new mt)!=qe)&&(Ri=function(c){var f=Zi(c),x=f==ee?c.constructor:void 0,A=x?vs(x):"";if(A)switch(A){case Ng:return Pe;case mi:return N;case $c:return"[object Promise]";case Bn:return z;case $r:return qe}return f});var Fg=Ll?no:rl;function ql(c){var f=c&&c.constructor;return c===(typeof f=="function"&&f.prototype||Br)}function df(c){return c==c&&!ii(c)}function pf(c,f){return function(x){return x!=null&&x[c]===f&&(f!==void 0||c in zn(x))}}function ff(c,f,x){return f=Wn(f===void 0?c.length-1:f,0),function(){for(var A=arguments,k=-1,ie=Wn(A.length-f,0),pe=Mt(ie);++k<ie;)pe[k]=A[f+k];k=-1;for(var Se=Mt(f+1);++k<f;)Se[k]=A[k];return Se[f]=x(pe),ir(c,this,Se)}}function mf(c,f){return f.length<2?c:_o(c,li(f,0,-1))}function Bg(c,f){for(var x=c.length,A=wi(f.length,x),k=Ai(c);A--;){var ie=f[A];c[A]=Ki(ie,x)?k[ie]:void 0}return c}function fd(c,f){if((f!=="constructor"||typeof c[f]!="function")&&f!="__proto__")return c[f]}var gf=_f(lf),Yl=Lg||function(c,f){return ti.setTimeout(c,f)},md=_f(Bi);function vf(c,f,x){var A=f+"";return md(c,function(k,ie){var pe=ie.length;if(!pe)return k;var Se=pe-1;return ie[Se]=(pe>1?"& ":"")+ie[Se],ie=ie.join(pe>2?", ":" "),k.replace(Ln,`{
8
+ */(function(){var $="Expected a function",L="__lodash_placeholder__",Y=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],j="[object Arguments]",F="[object Array]",K="[object Boolean]",xe="[object Date]",Re="[object Error]",Ie="[object Function]",M="[object GeneratorFunction]",N="[object Map]",D="[object Number]",ee="[object Object]",C="[object RegExp]",z="[object Set]",V="[object String]",ne="[object Symbol]",qe="[object WeakMap]",ft="[object ArrayBuffer]",Pe="[object DataView]",ae="[object Float32Array]",Me="[object Float64Array]",De="[object Int8Array]",W="[object Int16Array]",ye="[object Int32Array]",Ce="[object Uint8Array]",Le="[object Uint16Array]",Ne="[object Uint32Array]",$e=/\b__p \+= '';/g,Qe=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vt=/&(?:amp|lt|gt|quot|#39);/g,ln=/[&<>"']/g,wt=RegExp(vt.source),Wt=RegExp(ln.source),qt=/<%-([\s\S]+?)%>/g,rn=/<%([\s\S]+?)%>/g,Bt=/<%=([\s\S]+?)%>/g,Dn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fn=/^\w*$/,Mn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jn=/[\\^$.*+?()[\]{}|]/g,An=RegExp(jn.source),In=/^\s+/,di=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fi=/\{\n\/\* \[wrapped with (.+)\] \*/,pi=/,? & /,uo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Co=/[()=,{}\[\]\/\s]/,Oa=/\\(\\)?/g,ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sr=/\w*$/,E=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,O=/^\[object .+?Constructor\]$/,Q=/^0o[0-7]+$/i,J=/^(?:0|[1-9]\d*)$/,Z=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ge=/['\n\r\u2028\u2029\\]/g,be="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\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",Fe="[\\ud800-\\udfff]",Ye="["+we+"]",ht="["+be+"]",xt="\\d+",Ot="[\\u2700-\\u27bf]",Gt="[a-z\\xdf-\\xf6\\xf8-\\xff]",fi="[^\\ud800-\\udfff"+we+xt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",nr="\\ud83c[\\udffb-\\udfff]",Po="[^\\ud800-\\udfff]",Hs="(?:\\ud83c[\\udde6-\\uddff]){2}",Gn="[\\ud800-\\udbff][\\udc00-\\udfff]",os="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Fp="(?:"+Gt+"|"+fi+")",zs="(?:"+os+"|"+fi+")",Bp="(?:"+ht+"|"+nr+")?",ss="[\\ufe0e\\ufe0f]?"+Bp+("(?:\\u200d(?:"+[Po,Hs,Gn].join("|")+")[\\ufe0e\\ufe0f]?"+Bp+")*"),Up="(?:"+[Ot,Hs,Gn].join("|")+")"+ss,kp="(?:"+[Po+ht+"?",ht,Hs,Gn,Fe].join("|")+")",Al=RegExp("['\u2019]","g"),Gp=RegExp(ht,"g"),js=RegExp(nr+"(?="+nr+")|"+kp+ss,"g"),Io=RegExp([os+"?"+Gt+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[Ye,os,"$"].join("|")+")",zs+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[Ye,os+Fp,"$"].join("|")+")",os+"?"+Fp+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",os+"+(?:['\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_])",xt,Up].join("|"),"g"),Vs=RegExp("[\\u200d\\ud800-\\udfff"+be+"\\ufe0e\\ufe0f]"),Hp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zp=["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"],jp=-1,Nn={};Nn[ae]=Nn[Me]=Nn[De]=Nn[W]=Nn[ye]=Nn[Ce]=Nn["[object Uint8ClampedArray]"]=Nn[Le]=Nn[Ne]=!0,Nn[j]=Nn[F]=Nn[ft]=Nn[K]=Nn[Pe]=Nn[xe]=Nn[Re]=Nn[Ie]=Nn[N]=Nn[D]=Nn[ee]=Nn[C]=Nn[z]=Nn[V]=Nn[qe]=!1;var Hn={};Hn[j]=Hn[F]=Hn[ft]=Hn[Pe]=Hn[K]=Hn[xe]=Hn[ae]=Hn[Me]=Hn[De]=Hn[W]=Hn[ye]=Hn[N]=Hn[D]=Hn[ee]=Hn[C]=Hn[z]=Hn[V]=Hn[ne]=Hn[Ce]=Hn["[object Uint8ClampedArray]"]=Hn[Le]=Hn[Ne]=!0,Hn[Re]=Hn[Ie]=Hn[qe]=!1;var Oo={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tr=parseFloat,Vp=parseInt,Pc=typeof b=="object"&&b&&b.Object===Object&&b,Wp=typeof self=="object"&&self&&self.Object===Object&&self,ti=Pc||Wp||Function("return this")(),Ws=R&&!R.nodeType&&R,La=Ws&&typeof te=="object"&&te&&!te.nodeType&&te,Ic=La&&La.exports===Ws,Gu=Ic&&Pc.process,Er=function(){try{var Ue=La&&La.require&&La.require("util").types;return Ue||Gu&&Gu.binding&&Gu.binding("util")}catch{}}(),Oc=Er&&Er.isArrayBuffer,Lc=Er&&Er.isDate,Hu=Er&&Er.isMap,zu=Er&&Er.isRegExp,ju=Er&&Er.isSet,Vu=Er&&Er.isTypedArray;function ir(Ue,rt,at){switch(at.length){case 0:return Ue.call(rt);case 1:return Ue.call(rt,at[0]);case 2:return Ue.call(rt,at[0],at[1]);case 3:return Ue.call(rt,at[0],at[1],at[2])}return Ue.apply(rt,at)}function Nc(Ue,rt,at,Mt){for(var Ht=-1,vn=Ue==null?0:Ue.length;++Ht<vn;){var ai=Ue[Ht];rt(Mt,ai,at(ai),Ue)}return Mt}function hr(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length;++at<Mt&&rt(Ue[at],at,Ue)!==!1;);return Ue}function Dc(Ue,rt){for(var at=Ue==null?0:Ue.length;at--&&rt(Ue[at],at,Ue)!==!1;);return Ue}function Fc(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length;++at<Mt;)if(!rt(Ue[at],at,Ue))return!1;return!0}function co(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length,Ht=0,vn=[];++at<Mt;){var ai=Ue[at];rt(ai,at,Ue)&&(vn[Ht++]=ai)}return vn}function Na(Ue,rt){return!!(Ue!=null&&Ue.length)&&Xs(Ue,rt,0)>-1}function Wu(Ue,rt,at){for(var Mt=-1,Ht=Ue==null?0:Ue.length;++Mt<Ht;)if(at(rt,Ue[Mt]))return!0;return!1}function Vn(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length,Ht=Array(Mt);++at<Mt;)Ht[at]=rt(Ue[at],at,Ue);return Ht}function Lo(Ue,rt){for(var at=-1,Mt=rt.length,Ht=Ue.length;++at<Mt;)Ue[Ht+at]=rt[at];return Ue}function Xu(Ue,rt,at,Mt){var Ht=-1,vn=Ue==null?0:Ue.length;for(Mt&&vn&&(at=Ue[++Ht]);++Ht<vn;)at=rt(at,Ue[Ht],Ht,Ue);return at}function Xp(Ue,rt,at,Mt){var Ht=Ue==null?0:Ue.length;for(Mt&&Ht&&(at=Ue[--Ht]);Ht--;)at=rt(at,Ue[Ht],Ht,Ue);return at}function qu(Ue,rt){for(var at=-1,Mt=Ue==null?0:Ue.length;++at<Mt;)if(rt(Ue[at],at,Ue))return!0;return!1}var qp=Yu("length");function Bc(Ue,rt,at){var Mt;return at(Ue,function(Ht,vn,ai){if(rt(Ht,vn,ai))return Mt=vn,!1}),Mt}function Rl(Ue,rt,at,Mt){for(var Ht=Ue.length,vn=at+(Mt?1:-1);Mt?vn--:++vn<Ht;)if(rt(Ue[vn],vn,Ue))return vn;return-1}function Xs(Ue,rt,at){return rt==rt?function(Mt,Ht,vn){for(var ai=vn-1,Mr=Mt.length;++ai<Mr;)if(Mt[ai]===Ht)return ai;return-1}(Ue,rt,at):Rl(Ue,Uc,at)}function Yp(Ue,rt,at,Mt){for(var Ht=at-1,vn=Ue.length;++Ht<vn;)if(Mt(Ue[Ht],rt))return Ht;return-1}function Uc(Ue){return Ue!=Ue}function kc(Ue,rt){var at=Ue==null?0:Ue.length;return at?Ju(Ue,rt)/at:NaN}function Yu(Ue){return function(rt){return rt==null?void 0:rt[Ue]}}function $u(Ue){return function(rt){return Ue==null?void 0:Ue[rt]}}function Gc(Ue,rt,at,Mt,Ht){return Ht(Ue,function(vn,ai,Mr){at=Mt?(Mt=!1,vn):rt(at,vn,ai,Mr)}),at}function Ju(Ue,rt){for(var at,Mt=-1,Ht=Ue.length;++Mt<Ht;){var vn=rt(Ue[Mt]);vn!==void 0&&(at=at===void 0?vn:at+vn)}return at}function Zu(Ue,rt){for(var at=-1,Mt=Array(Ue);++at<Ue;)Mt[at]=rt(at);return Mt}function Hc(Ue){return Ue&&Ue.slice(0,ls(Ue)+1).replace(In,"")}function cr(Ue){return function(rt){return Ue(rt)}}function Ku(Ue,rt){return Vn(rt,function(at){return Ue[at]})}function Da(Ue,rt){return Ue.has(rt)}function zc(Ue,rt){for(var at=-1,Mt=Ue.length;++at<Mt&&Xs(rt,Ue[at],0)>-1;);return at}function jc(Ue,rt){for(var at=Ue.length;at--&&Xs(rt,Ue[at],0)>-1;);return at}function $p(Ue,rt){for(var at=Ue.length,Mt=0;at--;)Ue[at]===rt&&++Mt;return Mt}var Jp=$u({\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=$u({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Kp(Ue){return"\\"+Oo[Ue]}function qs(Ue){return Vs.test(Ue)}function Qu(Ue){var rt=-1,at=Array(Ue.size);return Ue.forEach(function(Mt,Ht){at[++rt]=[Ht,Mt]}),at}function Vc(Ue,rt){return function(at){return Ue(rt(at))}}function No(Ue,rt){for(var at=-1,Mt=Ue.length,Ht=0,vn=[];++at<Mt;){var ai=Ue[at];ai!==rt&&ai!==L||(Ue[at]=L,vn[Ht++]=at)}return vn}function as(Ue){var rt=-1,at=Array(Ue.size);return Ue.forEach(function(Mt){at[++rt]=Mt}),at}function Cl(Ue){var rt=-1,at=Array(Ue.size);return Ue.forEach(function(Mt){at[++rt]=[Mt,Mt]}),at}function Do(Ue){return qs(Ue)?function(rt){for(var at=js.lastIndex=0;js.test(rt);)++at;return at}(Ue):qp(Ue)}function ji(Ue){return qs(Ue)?function(rt){return rt.match(js)||[]}(Ue):function(rt){return rt.split("")}(Ue)}function ls(Ue){for(var rt=Ue.length;rt--&&di.test(Ue.charAt(rt)););return rt}var Pl=$u({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Ys=function Ue(rt){var at,Mt=(rt=rt==null?ti:Ys.defaults(ti.Object(),rt,Ys.pick(ti,zp))).Array,Ht=rt.Date,vn=rt.Error,ai=rt.Function,Mr=rt.Math,zn=rt.Object,Il=rt.RegExp,Wc=rt.String,dr=rt.TypeError,Ol=Mt.prototype,Xc=ai.prototype,Br=zn.prototype,Ll=rt["__core-js_shared__"],eh=Xc.toString,Rn=Br.hasOwnProperty,Ag=0,Qp=(at=/[^.]+$/.exec(Ll&&Ll.keys&&Ll.keys.IE_PROTO||""))?"Symbol(src)_1."+at:"",th=Br.toString,Rg=eh.call(zn),Cg=ti._,Pg=Il("^"+eh.call(Rn).replace(jn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nh=Ic?rt.Buffer:void 0,us=rt.Symbol,ih=rt.Uint8Array,ef=nh?nh.allocUnsafe:void 0,rh=Vc(zn.getPrototypeOf,zn),tf=zn.create,nf=Br.propertyIsEnumerable,Nl=Ol.splice,$s=us?us.isConcatSpreadable:void 0,po=us?us.iterator:void 0,Js=us?us.toStringTag:void 0,oh=function(){try{var c=ua(zn,"defineProperty");return c({},"",{}),c}catch{}}(),Ig=rt.clearTimeout!==ti.clearTimeout&&rt.clearTimeout,Og=Ht&&Ht.now!==ti.Date.now&&Ht.now,Lg=rt.setTimeout!==ti.setTimeout&&rt.setTimeout,sh=Mr.ceil,ah=Mr.floor,qc=zn.getOwnPropertySymbols,Yc=nh?nh.isBuffer:void 0,Fo=rt.isFinite,Vi=Ol.join,lh=Vc(zn.keys,zn),Wn=Mr.max,wi=Mr.min,Ar=Ht.now,Wi=rt.parseInt,uh=Mr.random,Dl=Ol.reverse,Fl=ua(rt,"DataView"),Fa=ua(rt,"Map"),hh=ua(rt,"Promise"),Zs=ua(rt,"Set"),mt=ua(rt,"WeakMap"),Xn=ua(zn,"create"),Bo=mt&&new mt,Ur={},Ng=vs(Fl),mi=vs(Fa),$c=vs(hh),Bn=vs(Zs),$r=vs(mt),Bl=us?us.prototype:void 0,Ks=Bl?Bl.valueOf:void 0,Bi=Bl?Bl.toString:void 0;function S(c){if(ri(c)&&!on(c)&&!(c instanceof un)){if(c instanceof Zn)return c;if(Rn.call(c,"__wrapped__"))return yf(c)}return new Zn(c)}var hs=function(){function c(){}return function(f){if(!ii(f))return{};if(tf)return tf(f);c.prototype=f;var x=new c;return c.prototype=void 0,x}}();function Ul(){}function Zn(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=void 0}function un(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Jr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var A=c[f];this.set(A[0],A[1])}}function Zr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var A=c[f];this.set(A[0],A[1])}}function pr(c){var f=-1,x=c==null?0:c.length;for(this.clear();++f<x;){var A=c[f];this.set(A[0],A[1])}}function kr(c){var f=-1,x=c==null?0:c.length;for(this.__data__=new pr;++f<x;)this.add(c[f])}function Ji(c){var f=this.__data__=new Zr(c);this.size=f.size}function Uo(c,f){var x=on(c),A=!x&&ys(c),k=!x&&!A&&Vo(c),ie=!x&&!A&&!k&&ca(c),pe=x||A||k||ie,Se=pe?Zu(c.length,Wc):[],Be=Se.length;for(var tt in c)!f&&!Rn.call(c,tt)||pe&&(tt=="length"||k&&(tt=="offset"||tt=="parent")||ie&&(tt=="buffer"||tt=="byteLength"||tt=="byteOffset")||Ki(tt,Be))||Se.push(tt);return Se}function ko(c){var f=c.length;return f?c[fs(0,f-1)]:void 0}function Qs(c,f){return Th(Ai(c),Go(f,0,c.length))}function kl(c){return Th(Ai(c))}function Ba(c,f,x){(x!==void 0&&!Wr(c[f],x)||x===void 0&&!(f in c))&&mo(c,f,x)}function cs(c,f,x){var A=c[f];Rn.call(c,f)&&Wr(A,x)&&(x!==void 0||f in c)||mo(c,f,x)}function fo(c,f){for(var x=c.length;x--;)if(Wr(c[x][0],f))return x;return-1}function Jc(c,f,x,A){return rr(c,function(k,ie,pe){f(A,k,x(k),pe)}),A}function rf(c,f){return c&&ui(f,Ci(f),c)}function mo(c,f,x){f=="__proto__"&&oh?oh(c,f,{configurable:!0,enumerable:!0,value:x,writable:!0}):c[f]=x}function Gl(c,f){for(var x=-1,A=f.length,k=Mt(A),ie=c==null;++x<A;)k[x]=ie?void 0:Cd(c,f[x]);return k}function Go(c,f,x){return c==c&&(x!==void 0&&(c=c<=x?c:x),f!==void 0&&(c=c>=f?c:f)),c}function Mi(c,f,x,A,k,ie){var pe,Se=1&f,Be=2&f,tt=4&f;if(x&&(pe=k?x(c,A,k,ie):x(c)),pe!==void 0)return pe;if(!ii(c))return c;var nt=on(c);if(nt){if(pe=function(lt){var _t=lt.length,Vt=new lt.constructor(_t);return _t&&typeof lt[0]=="string"&&Rn.call(lt,"index")&&(Vt.index=lt.index,Vt.input=lt.input),Vt}(c),!Se)return Ai(c,pe)}else{var gt=Ri(c),Ft=gt==Ie||gt==M;if(Vo(c))return ld(c,Se);if(gt==ee||gt==j||Ft&&!k){if(pe=Be||Ft?{}:pd(c),!Se)return Be?function(lt,_t){return ui(lt,ha(lt),_t)}(c,function(lt,_t){return lt&&ui(_t,ki(_t),lt)}(pe,c)):function(lt,_t){return ui(lt,jr(lt),_t)}(c,rf(pe,c))}else{if(!Hn[gt])return k?c:{};pe=function(lt,_t,Vt){var Lt=lt.constructor;switch(_t){case ft:return ud(lt);case K:case xe:return new Lt(+lt);case Pe:return function(Kt,dn){var zt=dn?ud(Kt.buffer):Kt.buffer;return new Kt.constructor(zt,Kt.byteOffset,Kt.byteLength)}(lt,Vt);case ae:case Me:case De:case W:case ye:case Ce:case"[object Uint8ClampedArray]":case Le:case Ne:return ia(lt,Vt);case N:return new Lt;case D:case V:return new Lt(lt);case C:return function(Kt){var dn=new Kt.constructor(Kt.source,Sr.exec(Kt));return dn.lastIndex=Kt.lastIndex,dn}(lt);case z:return new Lt;case ne:return jt=lt,Ks?zn(Ks.call(jt)):{}}var jt}(c,gt,Se)}}ie||(ie=new Ji);var kt=ie.get(c);if(kt)return kt;ie.set(c,pe),Ff(c)?c.forEach(function(lt){pe.add(Mi(lt,f,x,lt,c,ie))}):Df(c)&&c.forEach(function(lt,_t){pe.set(_t,Mi(lt,f,x,_t,c,ie))});var $t=nt?void 0:(tt?Be?aa:or:Be?ki:Ci)(c);return hr($t||c,function(lt,_t){$t&&(lt=c[_t=lt]),cs(pe,_t,Mi(lt,f,x,_t,c,ie))}),pe}function go(c,f,x){var A=x.length;if(c==null)return!A;for(c=zn(c);A--;){var k=x[A],ie=f[k],pe=c[k];if(pe===void 0&&!(k in c)||!ie(pe))return!1}return!0}function ch(c,f,x){if(typeof c!="function")throw new dr($);return Yl(function(){c.apply(void 0,x)},f)}function ds(c,f,x,A){var k=-1,ie=Na,pe=!0,Se=c.length,Be=[],tt=f.length;if(!Se)return Be;x&&(f=Vn(f,cr(x))),A?(ie=Wu,pe=!1):f.length>=200&&(ie=Da,pe=!1,f=new kr(f));e:for(;++k<Se;){var nt=c[k],gt=x==null?nt:x(nt);if(nt=A||nt!==0?nt:0,pe&&gt==gt){for(var Ft=tt;Ft--;)if(f[Ft]===gt)continue e;Be.push(nt)}else ie(f,gt,A)||Be.push(nt)}return Be}S.templateSettings={escape:qt,evaluate:rn,interpolate:Bt,variable:"",imports:{_:S}},S.prototype=Ul.prototype,S.prototype.constructor=S,Zn.prototype=hs(Ul.prototype),Zn.prototype.constructor=Zn,un.prototype=hs(Ul.prototype),un.prototype.constructor=un,Jr.prototype.clear=function(){this.__data__=Xn?Xn(null):{},this.size=0},Jr.prototype.delete=function(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f},Jr.prototype.get=function(c){var f=this.__data__;if(Xn){var x=f[c];return x==="__lodash_hash_undefined__"?void 0:x}return Rn.call(f,c)?f[c]:void 0},Jr.prototype.has=function(c){var f=this.__data__;return Xn?f[c]!==void 0:Rn.call(f,c)},Jr.prototype.set=function(c,f){var x=this.__data__;return this.size+=this.has(c)?0:1,x[c]=Xn&&f===void 0?"__lodash_hash_undefined__":f,this},Zr.prototype.clear=function(){this.__data__=[],this.size=0},Zr.prototype.delete=function(c){var f=this.__data__,x=fo(f,c);return!(x<0)&&(x==f.length-1?f.pop():Nl.call(f,x,1),--this.size,!0)},Zr.prototype.get=function(c){var f=this.__data__,x=fo(f,c);return x<0?void 0:f[x][1]},Zr.prototype.has=function(c){return fo(this.__data__,c)>-1},Zr.prototype.set=function(c,f){var x=this.__data__,A=fo(x,c);return A<0?(++this.size,x.push([c,f])):x[A][1]=f,this},pr.prototype.clear=function(){this.size=0,this.__data__={hash:new Jr,map:new(Fa||Zr),string:new Jr}},pr.prototype.delete=function(c){var f=Ja(this,c).delete(c);return this.size-=f?1:0,f},pr.prototype.get=function(c){return Ja(this,c).get(c)},pr.prototype.has=function(c){return Ja(this,c).has(c)},pr.prototype.set=function(c,f){var x=Ja(this,c),A=x.size;return x.set(c,f),this.size+=x.size==A?0:1,this},kr.prototype.add=kr.prototype.push=function(c){return this.__data__.set(c,"__lodash_hash_undefined__"),this},kr.prototype.has=function(c){return this.__data__.has(c)},Ji.prototype.clear=function(){this.__data__=new Zr,this.size=0},Ji.prototype.delete=function(c){var f=this.__data__,x=f.delete(c);return this.size=f.size,x},Ji.prototype.get=function(c){return this.__data__.get(c)},Ji.prototype.has=function(c){return this.__data__.has(c)},Ji.prototype.set=function(c,f){var x=this.__data__;if(x instanceof Zr){var A=x.__data__;if(!Fa||A.length<199)return A.push([c,f]),this.size=++x.size,this;x=this.__data__=new pr(A)}return x.set(c,f),this.size=x.size,this};var rr=Xt(vo),dh=Xt(Zc,!0);function ph(c,f){var x=!0;return rr(c,function(A,k,ie){return x=!!f(A,k,ie)}),x}function Ua(c,f,x){for(var A=-1,k=c.length;++A<k;){var ie=c[A],pe=f(ie);if(pe!=null&&(Se===void 0?pe==pe&&!Or(pe):x(pe,Se)))var Se=pe,Be=ie}return Be}function Ho(c,f){var x=[];return rr(c,function(A,k,ie){f(A,k,ie)&&x.push(A)}),x}function Rt(c,f,x,A,k){var ie=-1,pe=c.length;for(x||(x=Dg),k||(k=[]);++ie<pe;){var Se=c[ie];f>0&&x(Se)?f>1?Rt(Se,f-1,x,A,k):Lo(k,Se):A||(k[k.length]=Se)}return k}var ps=hd(),Gr=hd(!0);function vo(c,f){return c&&ps(c,f,Ci)}function Zc(c,f){return c&&Gr(c,f,Ci)}function Kr(c,f){return co(f,function(x){return no(c[x])})}function _o(c,f){for(var x=0,A=(f=eo(f,c)).length;c!=null&&x<A;)c=c[Vr(f[x++])];return x&&x==A?c:void 0}function fr(c,f,x){var A=f(c);return on(c)?A:Lo(A,x(c))}function Zi(c){return c==null?c===void 0?"[object Undefined]":"[object Null]":Js&&Js in zn(c)?function(f){var x=Rn.call(f,Js),A=f[Js];try{f[Js]=void 0;var k=!0}catch{}var ie=th.call(f);return k&&(x?f[Js]=A:delete f[Js]),ie}(c):function(f){return th.call(f)}(c)}function fh(c,f){return c>f}function ea(c,f){return c!=null&&Rn.call(c,f)}function Kc(c,f){return c!=null&&f in zn(c)}function Qc(c,f,x){for(var A=x?Wu:Na,k=c[0].length,ie=c.length,pe=ie,Se=Mt(ie),Be=1/0,tt=[];pe--;){var nt=c[pe];pe&&f&&(nt=Vn(nt,cr(f))),Be=wi(nt.length,Be),Se[pe]=!x&&(f||k>=120&&nt.length>=120)?new kr(pe&&nt):void 0}nt=c[0];var gt=-1,Ft=Se[0];e:for(;++gt<k&&tt.length<Be;){var kt=nt[gt],$t=f?f(kt):kt;if(kt=x||kt!==0?kt:0,!(Ft?Da(Ft,$t):A(tt,$t,x))){for(pe=ie;--pe;){var lt=Se[pe];if(!(lt?Da(lt,$t):A(c[pe],$t,x)))continue e}Ft&&Ft.push($t),tt.push(kt)}}return tt}function ka(c,f,x){var A=(c=mf(c,f=eo(f,c)))==null?c:c[Vr(Ir(f))];return A==null?void 0:ir(A,c,x)}function ta(c){return ri(c)&&Zi(c)==j}function Rr(c,f,x,A,k){return c===f||(c==null||f==null||!ri(c)&&!ri(f)?c!=c&&f!=f:function(ie,pe,Se,Be,tt,nt){var gt=on(ie),Ft=on(pe),kt=gt?F:Ri(ie),$t=Ft?F:Ri(pe),lt=(kt=kt==j?ee:kt)==ee,_t=($t=$t==j?ee:$t)==ee,Vt=kt==$t;if(Vt&&Vo(ie)){if(!Vo(pe))return!1;gt=!0,lt=!1}if(Vt&&!lt)return nt||(nt=new Ji),gt||ca(ie)?Xi(ie,pe,Se,Be,tt,nt):function(zt,en,hi,qi,ci,oi,io){switch(hi){case Pe:if(zt.byteLength!=en.byteLength||zt.byteOffset!=en.byteOffset)return!1;zt=zt.buffer,en=en.buffer;case ft:return!(zt.byteLength!=en.byteLength||!oi(new ih(zt),new ih(en)));case K:case xe:case D:return Wr(+zt,+en);case Re:return zt.name==en.name&&zt.message==en.message;case C:case V:return zt==en+"";case N:var So=Qu;case z:var bs=1&qi;if(So||(So=as),zt.size!=en.size&&!bs)return!1;var ol=io.get(zt);if(ol)return ol==en;qi|=2,io.set(zt,en);var ws=Xi(So(zt),So(en),qi,ci,oi,io);return io.delete(zt),ws;case ne:if(Ks)return Ks.call(zt)==Ks.call(en)}return!1}(ie,pe,kt,Se,Be,tt,nt);if(!(1&Se)){var Lt=lt&&Rn.call(ie,"__wrapped__"),jt=_t&&Rn.call(pe,"__wrapped__");if(Lt||jt){var Kt=Lt?ie.value():ie,dn=jt?pe.value():pe;return nt||(nt=new Ji),tt(Kt,dn,Se,Be,nt)}}return Vt?(nt||(nt=new Ji),function(zt,en,hi,qi,ci,oi){var io=1&hi,So=or(zt),bs=So.length,ol=or(en).length;if(bs!=ol&&!io)return!1;for(var ws=bs;ws--;){var To=So[ws];if(!(io?To in en:Rn.call(en,To)))return!1}var Vh=oi.get(zt),Ld=oi.get(en);if(Vh&&Ld)return Vh==en&&Ld==zt;var Ss=!0;oi.set(zt,en),oi.set(en,zt);for(var va=io;++ws<bs;){To=So[ws];var _a=zt[To],sl=en[To];if(qi)var al=io?qi(sl,_a,To,en,zt,oi):qi(_a,sl,To,zt,en,oi);if(!(al===void 0?_a===sl||ci(_a,sl,hi,qi,oi):al)){Ss=!1;break}va||(va=To=="constructor")}if(Ss&&!va){var ou=zt.constructor,ya=en.constructor;ou==ya||!("constructor"in zt)||!("constructor"in en)||typeof ou=="function"&&ou instanceof ou&&typeof ya=="function"&&ya instanceof ya||(Ss=!1)}return oi.delete(zt),oi.delete(en),Ss}(ie,pe,Se,Be,tt,nt)):!1}(c,f,x,A,Rr,k))}function Ga(c,f,x,A){var k=x.length,ie=k,pe=!A;if(c==null)return!ie;for(c=zn(c);k--;){var Se=x[k];if(pe&&Se[2]?Se[1]!==c[Se[0]]:!(Se[0]in c))return!1}for(;++k<ie;){var Be=(Se=x[k])[0],tt=c[Be],nt=Se[1];if(pe&&Se[2]){if(tt===void 0&&!(Be in c))return!1}else{var gt=new Ji;if(A)var Ft=A(tt,nt,Be,c,f,gt);if(!(Ft===void 0?Rr(nt,tt,3,A,gt):Ft))return!1}}return!0}function Ha(c){return!(!ii(c)||(f=c,Qp&&Qp in f))&&(no(c)?Pg:O).test(vs(c));var f}function of(c){return typeof c=="function"?c:c==null?ar:typeof c=="object"?on(c)?nd(c[0],c[1]):af(c):Yf(c)}function ed(c){if(!ql(c))return lh(c);var f=[];for(var x in zn(c))Rn.call(c,x)&&x!="constructor"&&f.push(x);return f}function sf(c){if(!ii(c))return function(k){var ie=[];if(k!=null)for(var pe in zn(k))ie.push(pe);return ie}(c);var f=ql(c),x=[];for(var A in c)(A!="constructor"||!f&&Rn.call(c,A))&&x.push(A);return x}function mh(c,f){return c<f}function td(c,f){var x=-1,A=mr(c)?Mt(c.length):[];return rr(c,function(k,ie,pe){A[++x]=f(k,ie,pe)}),A}function af(c){var f=dd(c);return f.length==1&&f[0][2]?pf(f[0][0],f[0][1]):function(x){return x===c||Ga(x,c,f)}}function nd(c,f){return At(c)&&df(f)?pf(Vr(c),f):function(x){var A=Cd(x,c);return A===void 0&&A===f?Zl(x,c):Rr(f,A,3)}}function pn(c,f,x,A,k){c!==f&&ps(f,function(ie,pe){if(k||(k=new Ji),ii(ie))(function(Be,tt,nt,gt,Ft,kt,$t){var lt=fd(Be,nt),_t=fd(tt,nt),Vt=$t.get(_t);if(Vt)return void Ba(Be,nt,Vt);var Lt=kt?kt(lt,_t,nt+"",Be,tt,$t):void 0,jt=Lt===void 0;if(jt){var Kt=on(_t),dn=!Kt&&Vo(_t),zt=!Kt&&!dn&&ca(_t);Lt=_t,Kt||dn||zt?on(lt)?Lt=lt:Yn(lt)?Lt=Ai(lt):dn?(jt=!1,Lt=ld(_t,!0)):zt?(jt=!1,Lt=ia(_t,!0)):Lt=[]:Qa(_t)||ys(_t)?(Lt=lt,ys(lt)?Lt=Gf(lt):ii(lt)&&!no(lt)||(Lt=pd(_t))):jt=!1}jt&&($t.set(_t,Lt),Ft(Lt,_t,gt,kt,$t),$t.delete(_t)),Ba(Be,nt,Lt)})(c,f,pe,x,pn,A,k);else{var Se=A?A(fd(c,pe),ie,pe+"",c,f,k):void 0;Se===void 0&&(Se=ie),Ba(c,pe,Se)}},ki)}function Hr(c,f){var x=c.length;if(x)return Ki(f+=f<0?x:0,x)?c[f]:void 0}function yo(c,f,x){f=f.length?Vn(f,function(k){return on(k)?function(ie){return _o(ie,k.length===1?k[0]:k)}:k}):[ar];var A=-1;return f=Vn(f,cr(Yt())),function(k,ie){var pe=k.length;for(k.sort(ie);pe--;)k[pe]=k[pe].value;return k}(td(c,function(k,ie,pe){return{criteria:Vn(f,function(Se){return Se(k)}),index:++A,value:k}}),function(k,ie){return function(pe,Se,Be){for(var tt=-1,nt=pe.criteria,gt=Se.criteria,Ft=nt.length,kt=Be.length;++tt<Ft;){var $t=cf(nt[tt],gt[tt]);if($t){if(tt>=kt)return $t;var lt=Be[tt];return $t*(lt=="desc"?-1:1)}}return pe.index-Se.index}(k,ie,x)})}function gh(c,f,x){for(var A=-1,k=f.length,ie={};++A<k;){var pe=f[A],Se=_o(c,pe);x(Se,pe)&&qn(ie,eo(pe,c),Se)}return ie}function Qr(c,f,x,A){var k=A?Yp:Xs,ie=-1,pe=f.length,Se=c;for(c===f&&(f=Ai(f)),x&&(Se=Vn(c,cr(x)));++ie<pe;)for(var Be=0,tt=f[ie],nt=x?x(tt):tt;(Be=k(Se,nt,Be,A))>-1;)Se!==c&&Nl.call(Se,Be,1),Nl.call(c,Be,1);return c}function na(c,f){for(var x=c?f.length:0,A=x-1;x--;){var k=f[x];if(x==A||k!==ie){var ie=k;Ki(k)?Nl.call(c,k,1):ja(c,k)}}return c}function fs(c,f){return c+ah(uh()*(f-c+1))}function vh(c,f){var x="";if(!c||f<1||f>9007199254740991)return x;do f%2&&(x+=c),(f=ah(f/2))&&(c+=c);while(f);return x}function fn(c,f){return md(ff(c,f,ar),c+"")}function id(c){return ko(wo(c))}function rd(c,f){var x=wo(c);return Th(x,Go(f,0,x.length))}function qn(c,f,x,A){if(!ii(c))return c;for(var k=-1,ie=(f=eo(f,c)).length,pe=ie-1,Se=c;Se!=null&&++k<ie;){var Be=Vr(f[k]),tt=x;if(Be==="__proto__"||Be==="constructor"||Be==="prototype")return c;if(k!=pe){var nt=Se[Be];(tt=A?A(nt,Be,Se):void 0)===void 0&&(tt=ii(nt)?nt:Ki(f[k+1])?[]:{})}cs(Se,Be,tt),Se=Se[Be]}return c}var lf=Bo?function(c,f){return Bo.set(c,f),c}:ar,Ui=oh?function(c,f){return oh(c,"toString",{configurable:!0,enumerable:!1,value:nl(f),writable:!0})}:ar;function uf(c){return Th(wo(c))}function li(c,f,x){var A=-1,k=c.length;f<0&&(f=-f>k?0:k+f),(x=x>k?k:x)<0&&(x+=k),k=f>x?0:x-f>>>0,f>>>=0;for(var ie=Mt(k);++A<k;)ie[A]=c[A+f];return ie}function _h(c,f){var x;return rr(c,function(A,k,ie){return!(x=f(A,k,ie))}),!!x}function za(c,f,x){var A=0,k=c==null?A:c.length;if(typeof f=="number"&&f==f&&k<=2147483647){for(;A<k;){var ie=A+k>>>1,pe=c[ie];pe!==null&&!Or(pe)&&(x?pe<=f:pe<f)?A=ie+1:k=ie}return k}return Hl(c,f,ar,x)}function Hl(c,f,x,A){var k=0,ie=c==null?0:c.length;if(ie===0)return 0;for(var pe=(f=x(f))!=f,Se=f===null,Be=Or(f),tt=f===void 0;k<ie;){var nt=ah((k+ie)/2),gt=x(c[nt]),Ft=gt!==void 0,kt=gt===null,$t=gt==gt,lt=Or(gt);if(pe)var _t=A||$t;else _t=tt?$t&&(A||Ft):Se?$t&&Ft&&(A||!kt):Be?$t&&Ft&&!kt&&(A||!lt):!kt&&!lt&&(A?gt<=f:gt<f);_t?k=nt+1:ie=nt}return wi(ie,4294967294)}function yh(c,f){for(var x=-1,A=c.length,k=0,ie=[];++x<A;){var pe=c[x],Se=f?f(pe):pe;if(!x||!Wr(Se,Be)){var Be=Se;ie[k++]=pe===0?0:pe}}return ie}function Dt(c){return typeof c=="number"?c:Or(c)?NaN:+c}function gi(c){if(typeof c=="string")return c;if(on(c))return Vn(c,gi)+"";if(Or(c))return Bi?Bi.call(c):"";var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}function Tn(c,f,x){var A=-1,k=Na,ie=c.length,pe=!0,Se=[],Be=Se;if(x)pe=!1,k=Wu;else if(ie>=200){var tt=f?null:cd(c);if(tt)return as(tt);pe=!1,k=Da,Be=new kr}else Be=f?[]:Se;e:for(;++A<ie;){var nt=c[A],gt=f?f(nt):nt;if(nt=x||nt!==0?nt:0,pe&&gt==gt){for(var Ft=Be.length;Ft--;)if(Be[Ft]===gt)continue e;f&&Be.push(gt),Se.push(nt)}else k(Be,gt,x)||(Be!==Se&&Be.push(gt),Se.push(nt))}return Se}function ja(c,f){return(c=mf(c,f=eo(f,c)))==null||delete c[Vr(Ir(f))]}function gn(c,f,x,A){return qn(c,f,x(_o(c,f)),A)}function zl(c,f,x,A){for(var k=c.length,ie=A?k:-1;(A?ie--:++ie<k)&&f(c[ie],ie,c););return x?li(c,A?0:ie,A?ie+1:k):li(c,A?ie+1:0,A?k:ie)}function od(c,f){var x=c;return x instanceof un&&(x=x.value()),Xu(f,function(A,k){return k.func.apply(k.thisArg,Lo([A],k.args))},x)}function xh(c,f,x){var A=c.length;if(A<2)return A?Tn(c[0]):[];for(var k=-1,ie=Mt(A);++k<A;)for(var pe=c[k],Se=-1;++Se<A;)Se!=k&&(ie[k]=ds(ie[k]||pe,c[Se],f,x));return Tn(Rt(ie,1),f,x)}function sd(c,f,x){for(var A=-1,k=c.length,ie=f.length,pe={};++A<k;){var Se=A<ie?f[A]:void 0;x(pe,c[A],Se)}return pe}function Va(c){return Yn(c)?c:[]}function bh(c){return typeof c=="function"?c:ar}function eo(c,f){return on(c)?c:At(c,f)?[c]:Eh(bn(c))}var hf=fn;function Tt(c,f,x){var A=c.length;return x=x===void 0?A:x,!f&&x>=A?c:li(c,f,x)}var ad=Ig||function(c){return ti.clearTimeout(c)};function ld(c,f){if(f)return c.slice();var x=c.length,A=ef?ef(x):new c.constructor(x);return c.copy(A),A}function ud(c){var f=new c.constructor(c.byteLength);return new ih(f).set(new ih(c)),f}function ia(c,f){var x=f?ud(c.buffer):c.buffer;return new c.constructor(x,c.byteOffset,c.length)}function cf(c,f){if(c!==f){var x=c!==void 0,A=c===null,k=c==c,ie=Or(c),pe=f!==void 0,Se=f===null,Be=f==f,tt=Or(f);if(!Se&&!tt&&!ie&&c>f||ie&&pe&&Be&&!Se&&!tt||A&&pe&&Be||!x&&Be||!k)return 1;if(!A&&!ie&&!tt&&c<f||tt&&x&&k&&!A&&!ie||Se&&x&&k||!pe&&k||!Be)return-1}return 0}function Cr(c,f,x,A){for(var k=-1,ie=c.length,pe=x.length,Se=-1,Be=f.length,tt=Wn(ie-pe,0),nt=Mt(Be+tt),gt=!A;++Se<Be;)nt[Se]=f[Se];for(;++k<pe;)(gt||k<ie)&&(nt[x[k]]=c[k]);for(;tt--;)nt[Se++]=c[k++];return nt}function wh(c,f,x,A){for(var k=-1,ie=c.length,pe=-1,Se=x.length,Be=-1,tt=f.length,nt=Wn(ie-Se,0),gt=Mt(nt+tt),Ft=!A;++k<nt;)gt[k]=c[k];for(var kt=k;++Be<tt;)gt[kt+Be]=f[Be];for(;++pe<Se;)(Ft||k<ie)&&(gt[kt+x[pe]]=c[k++]);return gt}function Ai(c,f){var x=-1,A=c.length;for(f||(f=Mt(A));++x<A;)f[x]=c[x];return f}function ui(c,f,x,A){var k=!x;x||(x={});for(var ie=-1,pe=f.length;++ie<pe;){var Se=f[ie],Be=A?A(x[Se],c[Se],Se,x,c):void 0;Be===void 0&&(Be=c[Se]),k?mo(x,Se,Be):cs(x,Se,Be)}return x}function ms(c,f){return function(x,A){var k=on(x)?Nc:Jc,ie=f?f():{};return k(x,c,Yt(A,2),ie)}}function ni(c){return fn(function(f,x){var A=-1,k=x.length,ie=k>1?x[k-1]:void 0,pe=k>2?x[2]:void 0;for(ie=c.length>3&&typeof ie=="function"?(k--,ie):void 0,pe&&Qt(x[0],x[1],pe)&&(ie=k<3?void 0:ie,k=1),f=zn(f);++A<k;){var Se=x[A];Se&&c(f,Se,A,ie)}return f})}function Xt(c,f){return function(x,A){if(x==null)return x;if(!mr(x))return c(x,A);for(var k=x.length,ie=f?k:-1,pe=zn(x);(f?ie--:++ie<k)&&A(pe[ie],ie,pe)!==!1;);return x}}function hd(c){return function(f,x,A){for(var k=-1,ie=zn(f),pe=A(f),Se=pe.length;Se--;){var Be=pe[c?Se:++k];if(x(ie[Be],Be,ie)===!1)break}return f}}function ra(c){return function(f){var x=qs(f=bn(f))?ji(f):void 0,A=x?x[0]:f.charAt(0),k=x?Tt(x,1).join(""):f.slice(1);return A[c]()+k}}function gs(c){return function(f){return Xu(Pd(ga(f).replace(Al,"")),c,"")}}function zr(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var x=hs(c.prototype),A=c.apply(x,f);return ii(A)?A:x}}function zo(c){return function(f,x,A){var k=zn(f);if(!mr(f)){var ie=Yt(x,3);f=Ci(f),x=function(Se){return ie(k[Se],Se,k)}}var pe=c(f,x,A);return pe>-1?k[ie?f[pe]:pe]:void 0}}function jo(c){return bo(function(f){var x=f.length,A=x,k=Zn.prototype.thru;for(c&&f.reverse();A--;){var ie=f[A];if(typeof ie!="function")throw new dr($);if(k&&!pe&&la(ie)=="wrapper")var pe=new Zn([],!0)}for(A=pe?A:x;++A<x;){var Se=la(ie=f[A]),Be=Se=="wrapper"?vi(ie):void 0;pe=Be&&Pr(Be[0])&&Be[1]==424&&!Be[4].length&&Be[9]==1?pe[la(Be[0])].apply(pe,Be[3]):ie.length==1&&Pr(ie)?pe[Se]():pe.thru(ie)}return function(){var tt=arguments,nt=tt[0];if(pe&&tt.length==1&&on(nt))return pe.plant(nt).value();for(var gt=0,Ft=x?f[gt].apply(this,tt):nt;++gt<x;)Ft=f[gt].call(this,Ft);return Ft}})}function Wa(c,f,x,A,k,ie,pe,Se,Be,tt){var nt=128&f,gt=1&f,Ft=2&f,kt=24&f,$t=512&f,lt=Ft?void 0:zr(c);return function _t(){for(var Vt=arguments.length,Lt=Mt(Vt),jt=Vt;jt--;)Lt[jt]=arguments[jt];if(kt)var Kt=to(_t),dn=$p(Lt,Kt);if(A&&(Lt=Cr(Lt,A,k,kt)),ie&&(Lt=wh(Lt,ie,pe,kt)),Vt-=dn,kt&&Vt<tt){var zt=No(Lt,Kt);return Vl(c,f,Wa,_t.placeholder,x,Lt,zt,Se,Be,tt-Vt)}var en=gt?x:this,hi=Ft?en[c]:c;return Vt=Lt.length,Se?Lt=Bg(Lt,Se):$t&&Vt>1&&Lt.reverse(),nt&&Be<Vt&&(Lt.length=Be),this&&this!==ti&&this instanceof _t&&(hi=lt||zr(hi)),hi.apply(en,Lt)}}function Sh(c,f){return function(x,A){return function(k,ie,pe,Se){return vo(k,function(Be,tt,nt){ie(Se,pe(Be),tt,nt)}),Se}(x,c,f(A),{})}}function Xa(c,f){return function(x,A){var k;if(x===void 0&&A===void 0)return f;if(x!==void 0&&(k=x),A!==void 0){if(k===void 0)return A;typeof x=="string"||typeof A=="string"?(x=gi(x),A=gi(A)):(x=Dt(x),A=Dt(A)),k=c(x,A)}return k}}function qa(c){return bo(function(f){return f=Vn(f,cr(Yt())),fn(function(x){var A=this;return c(f,function(k){return ir(k,A,x)})})})}function oa(c,f){var x=(f=f===void 0?" ":gi(f)).length;if(x<2)return x?vh(f,c):f;var A=vh(f,sh(c/Do(f)));return qs(f)?Tt(ji(A),0,c).join(""):A.slice(0,c)}function jl(c){return function(f,x,A){return A&&typeof A!="number"&&Qt(f,x,A)&&(x=A=void 0),f=Wo(f),x===void 0?(x=f,f=0):x=Wo(x),function(k,ie,pe,Se){for(var Be=-1,tt=Wn(sh((ie-k)/(pe||1)),0),nt=Mt(tt);tt--;)nt[Se?tt:++Be]=k,k+=pe;return nt}(f,x,A=A===void 0?f<x?1:-1:Wo(A),c)}}function sa(c){return function(f,x){return typeof f=="string"&&typeof x=="string"||(f=Lr(f),x=Lr(x)),c(f,x)}}function Vl(c,f,x,A,k,ie,pe,Se,Be,tt){var nt=8&f;f|=nt?32:64,4&(f&=~(nt?64:32))||(f&=-4);var gt=[c,f,k,nt?ie:void 0,nt?pe:void 0,nt?void 0:ie,nt?void 0:pe,Se,Be,tt],Ft=x.apply(void 0,gt);return Pr(c)&&gf(Ft,gt),Ft.placeholder=A,vf(Ft,c,f)}function Ya(c){var f=Mr[c];return function(x,A){if(x=Lr(x),(A=A==null?0:wi(mn(A),292))&&Fo(x)){var k=(bn(x)+"e").split("e");return+((k=(bn(f(k[0]+"e"+(+k[1]+A)))+"e").split("e"))[0]+"e"+(+k[1]-A))}return f(x)}}var cd=Zs&&1/as(new Zs([,-0]))[1]==1/0?function(c){return new Zs(c)}:il;function Wl(c){return function(f){var x=Ri(f);return x==N?Qu(f):x==z?Cl(f):function(A,k){return Vn(k,function(ie){return[ie,A[ie]]})}(f,c(f))}}function En(c,f,x,A,k,ie,pe,Se){var Be=2&f;if(!Be&&typeof c!="function")throw new dr($);var tt=A?A.length:0;if(tt||(f&=-97,A=k=void 0),pe=pe===void 0?pe:Wn(mn(pe),0),Se=Se===void 0?Se:mn(Se),tt-=k?k.length:0,64&f){var nt=A,gt=k;A=k=void 0}var Ft=Be?void 0:vi(c),kt=[c,f,x,A,k,nt,gt,ie,pe,Se];if(Ft&&function(lt,_t){var Vt=lt[1],Lt=_t[1],jt=Vt|Lt,Kt=jt<131,dn=Lt==128&&Vt==8||Lt==128&&Vt==256&&lt[7].length<=_t[8]||Lt==384&&_t[7].length<=_t[8]&&Vt==8;if(!Kt&&!dn)return lt;1&Lt&&(lt[2]=_t[2],jt|=1&Vt?0:4);var zt=_t[3];if(zt){var en=lt[3];lt[3]=en?Cr(en,zt,_t[4]):zt,lt[4]=en?No(lt[3],L):_t[4]}(zt=_t[5])&&(en=lt[5],lt[5]=en?wh(en,zt,_t[6]):zt,lt[6]=en?No(lt[5],L):_t[6]),(zt=_t[7])&&(lt[7]=zt),128&Lt&&(lt[8]=lt[8]==null?_t[8]:wi(lt[8],_t[8])),lt[9]==null&&(lt[9]=_t[9]),lt[0]=_t[0],lt[1]=jt}(kt,Ft),c=kt[0],f=kt[1],x=kt[2],A=kt[3],k=kt[4],!(Se=kt[9]=kt[9]===void 0?Be?0:c.length:Wn(kt[9]-tt,0))&&24&f&&(f&=-25),f&&f!=1)$t=f==8||f==16?function(lt,_t,Vt){var Lt=zr(lt);return function jt(){for(var Kt=arguments.length,dn=Mt(Kt),zt=Kt,en=to(jt);zt--;)dn[zt]=arguments[zt];var hi=Kt<3&&dn[0]!==en&&dn[Kt-1]!==en?[]:No(dn,en);if((Kt-=hi.length)<Vt)return Vl(lt,_t,Wa,jt.placeholder,void 0,dn,hi,void 0,void 0,Vt-Kt);var qi=this&&this!==ti&&this instanceof jt?Lt:lt;return ir(qi,this,dn)}}(c,f,Se):f!=32&&f!=33||k.length?Wa.apply(void 0,kt):function(lt,_t,Vt,Lt){var jt=1&_t,Kt=zr(lt);return function dn(){for(var zt=-1,en=arguments.length,hi=-1,qi=Lt.length,ci=Mt(qi+en),oi=this&&this!==ti&&this instanceof dn?Kt:lt;++hi<qi;)ci[hi]=Lt[hi];for(;en--;)ci[hi++]=arguments[++zt];return ir(oi,jt?Vt:this,ci)}}(c,f,x,A);else var $t=function(lt,_t,Vt){var Lt=1&_t,jt=zr(lt);return function Kt(){var dn=this&&this!==ti&&this instanceof Kt?jt:lt;return dn.apply(Lt?Vt:this,arguments)}}(c,f,x);return vf((Ft?lf:gf)($t,kt),c,f)}function Xl(c,f,x,A){return c===void 0||Wr(c,Br[x])&&!Rn.call(A,x)?f:c}function xo(c,f,x,A,k,ie){return ii(c)&&ii(f)&&(ie.set(f,c),pn(c,f,void 0,xo,ie),ie.delete(f)),c}function $a(c){return Qa(c)?void 0:c}function Xi(c,f,x,A,k,ie){var pe=1&x,Se=c.length,Be=f.length;if(Se!=Be&&!(pe&&Be>Se))return!1;var tt=ie.get(c),nt=ie.get(f);if(tt&&nt)return tt==f&&nt==c;var gt=-1,Ft=!0,kt=2&x?new kr:void 0;for(ie.set(c,f),ie.set(f,c);++gt<Se;){var $t=c[gt],lt=f[gt];if(A)var _t=pe?A(lt,$t,gt,f,c,ie):A($t,lt,gt,c,f,ie);if(_t!==void 0){if(_t)continue;Ft=!1;break}if(kt){if(!qu(f,function(Vt,Lt){if(!Da(kt,Lt)&&($t===Vt||k($t,Vt,x,A,ie)))return kt.push(Lt)})){Ft=!1;break}}else if($t!==lt&&!k($t,lt,x,A,ie)){Ft=!1;break}}return ie.delete(c),ie.delete(f),Ft}function bo(c){return md(ff(c,void 0,_d),c+"")}function or(c){return fr(c,Ci,jr)}function aa(c){return fr(c,ki,ha)}var vi=Bo?function(c){return Bo.get(c)}:il;function la(c){for(var f=c.name+"",x=Ur[f],A=Rn.call(Ur,f)?x.length:0;A--;){var k=x[A],ie=k.func;if(ie==null||ie==c)return k.name}return f}function to(c){return(Rn.call(S,"placeholder")?S:c).placeholder}function Yt(){var c=S.iteratee||Bh;return c=c===Bh?of:c,arguments.length?c(arguments[0],arguments[1]):c}function Ja(c,f){var x,A,k=c.__data__;return((A=typeof(x=f))=="string"||A=="number"||A=="symbol"||A=="boolean"?x!=="__proto__":x===null)?k[typeof f=="string"?"string":"hash"]:k.map}function dd(c){for(var f=Ci(c),x=f.length;x--;){var A=f[x],k=c[A];f[x]=[A,k,df(k)]}return f}function ua(c,f){var x=function(A,k){return A==null?void 0:A[k]}(c,f);return Ha(x)?x:void 0}var jr=qc?function(c){return c==null?[]:(c=zn(c),co(qc(c),function(f){return nf.call(c,f)}))}:Hh,ha=qc?function(c){for(var f=[];c;)Lo(f,jr(c)),c=rh(c);return f}:Hh,Ri=Zi;function Za(c,f,x){for(var A=-1,k=(f=eo(f,c)).length,ie=!1;++A<k;){var pe=Vr(f[A]);if(!(ie=c!=null&&x(c,pe)))break;c=c[pe]}return ie||++A!=k?ie:!!(k=c==null?0:c.length)&&Ph(k)&&Ki(pe,k)&&(on(c)||ys(c))}function pd(c){return typeof c.constructor!="function"||ql(c)?{}:hs(rh(c))}function Dg(c){return on(c)||ys(c)||!!($s&&c&&c[$s])}function Ki(c,f){var x=typeof c;return!!(f=f==null?9007199254740991:f)&&(x=="number"||x!="symbol"&&J.test(c))&&c>-1&&c%1==0&&c<f}function Qt(c,f,x){if(!ii(x))return!1;var A=typeof f;return!!(A=="number"?mr(x)&&Ki(f,x.length):A=="string"&&f in x)&&Wr(x[f],c)}function At(c,f){if(on(c))return!1;var x=typeof c;return!(x!="number"&&x!="symbol"&&x!="boolean"&&c!=null&&!Or(c))||Fn.test(c)||!Dn.test(c)||f!=null&&c in zn(f)}function Pr(c){var f=la(c),x=S[f];if(typeof x!="function"||!(f in un.prototype))return!1;if(c===x)return!0;var A=vi(x);return!!A&&c===A[0]}(Fl&&Ri(new Fl(new ArrayBuffer(1)))!=Pe||Fa&&Ri(new Fa)!=N||hh&&Ri(hh.resolve())!="[object Promise]"||Zs&&Ri(new Zs)!=z||mt&&Ri(new mt)!=qe)&&(Ri=function(c){var f=Zi(c),x=f==ee?c.constructor:void 0,A=x?vs(x):"";if(A)switch(A){case Ng:return Pe;case mi:return N;case $c:return"[object Promise]";case Bn:return z;case $r:return qe}return f});var Fg=Ll?no:rl;function ql(c){var f=c&&c.constructor;return c===(typeof f=="function"&&f.prototype||Br)}function df(c){return c==c&&!ii(c)}function pf(c,f){return function(x){return x!=null&&x[c]===f&&(f!==void 0||c in zn(x))}}function ff(c,f,x){return f=Wn(f===void 0?c.length-1:f,0),function(){for(var A=arguments,k=-1,ie=Wn(A.length-f,0),pe=Mt(ie);++k<ie;)pe[k]=A[f+k];k=-1;for(var Se=Mt(f+1);++k<f;)Se[k]=A[k];return Se[f]=x(pe),ir(c,this,Se)}}function mf(c,f){return f.length<2?c:_o(c,li(f,0,-1))}function Bg(c,f){for(var x=c.length,A=wi(f.length,x),k=Ai(c);A--;){var ie=f[A];c[A]=Ki(ie,x)?k[ie]:void 0}return c}function fd(c,f){if((f!=="constructor"||typeof c[f]!="function")&&f!="__proto__")return c[f]}var gf=_f(lf),Yl=Lg||function(c,f){return ti.setTimeout(c,f)},md=_f(Ui);function vf(c,f,x){var A=f+"";return md(c,function(k,ie){var pe=ie.length;if(!pe)return k;var Se=pe-1;return ie[Se]=(pe>1?"& ":"")+ie[Se],ie=ie.join(pe>2?", ":" "),k.replace(Ln,`{
9
9
  /* [wrapped with `+ie+`] */
10
- `)}(A,function(k,ie){return hr(Y,function(pe){var Se="_."+pe[0];ie&pe[1]&&!Na(k,Se)&&k.push(Se)}),k.sort()}(function(k){var ie=k.match(Di);return ie?ie[1].split(pi):[]}(A),x)))}function _f(c){var f=0,x=0;return function(){var A=Ar(),k=16-(A-x);if(x=A,k>0){if(++f>=800)return arguments[0]}else f=0;return c.apply(void 0,arguments)}}function Th(c,f){var x=-1,A=c.length,k=A-1;for(f=f===void 0?A:f;++x<f;){var ie=fs(x,k),pe=c[ie];c[ie]=c[x],c[x]=pe}return c.length=f,c}var Eh=function(c){var f=$l(c,function(A){return x.size===500&&x.clear(),A}),x=f.cache;return f}(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Mn,function(x,A,k,ie){f.push(k?ie.replace(Oa,"$1"):A||x)}),f});function Vr(c){if(typeof c=="string"||Or(c))return c;var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}function vs(c){if(c!=null){try{return eh.call(c)}catch{}try{return c+""}catch{}}return""}function yf(c){if(c instanceof un)return c.clone();var f=new Zn(c.__wrapped__,c.__chain__);return f.__actions__=Ai(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}var Ug=fn(function(c,f){return Yn(c)?ds(c,Rt(f,1,Yn,!0)):[]}),xf=fn(function(c,f){var x=Ir(f);return Yn(x)&&(x=void 0),Yn(c)?ds(c,Rt(f,1,Yn,!0),Yt(x,2)):[]}),bf=fn(function(c,f){var x=Ir(f);return Yn(x)&&(x=void 0),Yn(c)?ds(c,Rt(f,1,Yn,!0),void 0,x):[]});function gd(c,f,x){var A=c==null?0:c.length;if(!A)return-1;var k=x==null?0:mn(x);return k<0&&(k=Wn(A+k,0)),Rl(c,Yt(f,3),k)}function vd(c,f,x){var A=c==null?0:c.length;if(!A)return-1;var k=A-1;return x!==void 0&&(k=mn(x),k=x<0?Wn(A+k,0):wi(k,A-1)),Rl(c,Yt(f,3),k,!0)}function _d(c){return c!=null&&c.length?Rt(c,1):[]}function yd(c){return c&&c.length?c[0]:void 0}var Ka=fn(function(c){var f=Vn(c,Va);return f.length&&f[0]===c[0]?Qc(f):[]}),sr=fn(function(c){var f=Ir(c),x=Vn(c,Va);return f===Ir(x)?f=void 0:x.pop(),x.length&&x[0]===c[0]?Qc(x,Yt(f,2)):[]}),Qi=fn(function(c){var f=Ir(c),x=Vn(c,Va);return(f=typeof f=="function"?f:void 0)&&x.pop(),x.length&&x[0]===c[0]?Qc(x,void 0,f):[]});function Ir(c){var f=c==null?0:c.length;return f?c[f-1]:void 0}var kg=fn(wf);function wf(c,f){return c&&c.length&&f&&f.length?Qr(c,f):c}var Gg=bo(function(c,f){var x=c==null?0:c.length,A=Gl(c,f);return na(c,Vn(f,function(k){return Ki(k,x)?+k:k}).sort(cf)),A});function xd(c){return c==null?c:Dl.call(c)}var Hg=fn(function(c){return Tn(Rt(c,1,Yn,!0))}),zg=fn(function(c){var f=Ir(c);return Yn(f)&&(f=void 0),Tn(Rt(c,1,Yn,!0),Yt(f,2))}),jg=fn(function(c){var f=Ir(c);return f=typeof f=="function"?f:void 0,Tn(Rt(c,1,Yn,!0),void 0,f)});function bd(c){if(!c||!c.length)return[];var f=0;return c=co(c,function(x){if(Yn(x))return f=Wn(x.length,f),!0}),Zu(f,function(x){return Vn(c,Yu(x))})}function Sf(c,f){if(!c||!c.length)return[];var x=bd(c);return f==null?x:Vn(x,function(A){return ir(f,void 0,A)})}var Vg=fn(function(c,f){return Yn(c)?ds(c,f):[]}),Wg=fn(function(c){return xh(co(c,Yn))}),Xg=fn(function(c){var f=Ir(c);return Yn(f)&&(f=void 0),xh(co(c,Yn),Yt(f,2))}),qg=fn(function(c){var f=Ir(c);return f=typeof f=="function"?f:void 0,xh(co(c,Yn),void 0,f)}),Yg=fn(bd),$g=fn(function(c){var f=c.length,x=f>1?c[f-1]:void 0;return x=typeof x=="function"?(c.pop(),x):void 0,Sf(c,x)});function Tf(c){var f=S(c);return f.__chain__=!0,f}function Mh(c,f){return f(c)}var Jg=bo(function(c){var f=c.length,x=f?c[0]:0,A=this.__wrapped__,k=function(ie){return Gl(ie,c)};return!(f>1||this.__actions__.length)&&A instanceof un&&Ki(x)?((A=A.slice(x,+x+(f?1:0))).__actions__.push({func:Mh,args:[k],thisArg:void 0}),new Zn(A,this.__chain__).thru(function(ie){return f&&!ie.length&&ie.push(void 0),ie})):this.thru(k)}),Zg=ms(function(c,f,x){Rn.call(c,x)?++c[x]:mo(c,x,1)}),Kg=zo(gd),Qg=zo(vd);function Ef(c,f){return(on(c)?hr:rr)(c,Yt(f,3))}function Mf(c,f){return(on(c)?Dc:dh)(c,Yt(f,3))}var ev=ms(function(c,f,x){Rn.call(c,x)?c[x].push(f):mo(c,x,[f])}),tv=fn(function(c,f,x){var A=-1,k=typeof f=="function",ie=mr(c)?Mt(c.length):[];return rr(c,function(pe){ie[++A]=k?ir(f,pe,x):ka(pe,f,x)}),ie}),nv=ms(function(c,f,x){mo(c,x,f)});function Ah(c,f){return(on(c)?Vn:td)(c,Yt(f,3))}var iv=ms(function(c,f,x){c[x?0:1].push(f)},function(){return[[],[]]}),rv=fn(function(c,f){if(c==null)return[];var x=f.length;return x>1&&Qt(c,f[0],f[1])?f=[]:x>2&&Qt(f[0],f[1],f[2])&&(f=[f[0]]),yo(c,Rt(f,1),[])}),Rh=Og||function(){return ti.Date.now()};function Af(c,f,x){return f=x?void 0:f,En(c,128,void 0,void 0,void 0,void 0,f=c&&f==null?c.length:f)}function Rf(c,f){var x;if(typeof f!="function")throw new dr($);return c=mn(c),function(){return--c>0&&(x=f.apply(this,arguments)),c<=1&&(f=void 0),x}}var wd=fn(function(c,f,x){var A=1;if(x.length){var k=No(x,to(wd));A|=32}return En(c,A,f,x,k)}),Cf=fn(function(c,f,x){var A=3;if(x.length){var k=No(x,to(Cf));A|=32}return En(f,A,c,x,k)});function Pf(c,f,x){var A,k,ie,pe,Se,Be,tt=0,nt=!1,gt=!1,Ft=!0;if(typeof c!="function")throw new dr($);function kt(jt){var Kt=A,dn=k;return A=k=void 0,tt=jt,pe=c.apply(dn,Kt)}function $t(jt){return tt=jt,Se=Yl(_t,f),nt?kt(jt):pe}function lt(jt){var Kt=jt-Be;return Be===void 0||Kt>=f||Kt<0||gt&&jt-tt>=ie}function _t(){var jt=Rh();if(lt(jt))return Vt(jt);Se=Yl(_t,function(Kt){var dn=f-(Kt-Be);return gt?wi(dn,ie-(Kt-tt)):dn}(jt))}function Vt(jt){return Se=void 0,Ft&&A?kt(jt):(A=k=void 0,pe)}function Lt(){var jt=Rh(),Kt=lt(jt);if(A=arguments,k=this,Be=jt,Kt){if(Se===void 0)return $t(Be);if(gt)return ad(Se),Se=Yl(_t,f),kt(Be)}return Se===void 0&&(Se=Yl(_t,f)),pe}return f=Lr(f)||0,ii(x)&&(nt=!!x.leading,ie=(gt="maxWait"in x)?Wn(Lr(x.maxWait)||0,f):ie,Ft="trailing"in x?!!x.trailing:Ft),Lt.cancel=function(){Se!==void 0&&ad(Se),tt=0,A=Be=k=Se=void 0},Lt.flush=function(){return Se===void 0?pe:Vt(Rh())},Lt}var ov=fn(function(c,f){return ch(c,1,f)}),sv=fn(function(c,f,x){return ch(c,Lr(f)||0,x)});function $l(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new dr($);var x=function(){var A=arguments,k=f?f.apply(this,A):A[0],ie=x.cache;if(ie.has(k))return ie.get(k);var pe=c.apply(this,A);return x.cache=ie.set(k,pe)||ie,pe};return x.cache=new($l.Cache||pr),x}function Jl(c){if(typeof c!="function")throw new dr($);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}$l.Cache=pr;var Sd=hf(function(c,f){var x=(f=f.length==1&&on(f[0])?Vn(f[0],cr(Yt())):Vn(Rt(f,1),cr(Yt()))).length;return fn(function(A){for(var k=-1,ie=wi(A.length,x);++k<ie;)A[k]=f[k].call(this,A[k]);return ir(c,this,A)})}),Ch=fn(function(c,f){return En(c,32,void 0,f,No(f,to(Ch)))}),If=fn(function(c,f){return En(c,64,void 0,f,No(f,to(If)))}),_s=bo(function(c,f){return En(c,256,void 0,void 0,void 0,f)});function Wr(c,f){return c===f||c!=c&&f!=f}var av=sa(fh),Of=sa(function(c,f){return c>=f}),ys=ta(function(){return arguments}())?ta:function(c){return ri(c)&&Rn.call(c,"callee")&&!nf.call(c,"callee")},on=Mt.isArray,lv=Oc?cr(Oc):function(c){return ri(c)&&Zi(c)==ft};function mr(c){return c!=null&&Ph(c.length)&&!no(c)}function Yn(c){return ri(c)&&mr(c)}var Vo=Yc||rl,Lf=Lc?cr(Lc):function(c){return ri(c)&&Zi(c)==xe};function Td(c){if(!ri(c))return!1;var f=Zi(c);return f==Re||f=="[object DOMException]"||typeof c.message=="string"&&typeof c.name=="string"&&!Qa(c)}function no(c){if(!ii(c))return!1;var f=Zi(c);return f==Ie||f==M||f=="[object AsyncFunction]"||f=="[object Proxy]"}function Nf(c){return typeof c=="number"&&c==mn(c)}function Ph(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991}function ii(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function ri(c){return c!=null&&typeof c=="object"}var Df=Hu?cr(Hu):function(c){return ri(c)&&Ri(c)==N};function Ed(c){return typeof c=="number"||ri(c)&&Zi(c)==D}function Qa(c){if(!ri(c)||Zi(c)!=ee)return!1;var f=rh(c);if(f===null)return!0;var x=Rn.call(f,"constructor")&&f.constructor;return typeof x=="function"&&x instanceof x&&eh.call(x)==Rg}var Md=zu?cr(zu):function(c){return ri(c)&&Zi(c)==C},Ff=ju?cr(ju):function(c){return ri(c)&&Ri(c)==z};function Ih(c){return typeof c=="string"||!on(c)&&ri(c)&&Zi(c)==V}function Or(c){return typeof c=="symbol"||ri(c)&&Zi(c)==ne}var ca=Vu?cr(Vu):function(c){return ri(c)&&Ph(c.length)&&!!Nn[Zi(c)]},Bf=sa(mh),uv=sa(function(c,f){return c<=f});function Uf(c){if(!c)return[];if(mr(c))return Ih(c)?zi(c):Ai(c);if(po&&c[po])return function(x){for(var A,k=[];!(A=x.next()).done;)k.push(A.value);return k}(c[po]());var f=Ri(c);return(f==N?Qu:f==z?as:wo)(c)}function Wo(c){return c?(c=Lr(c))===1/0||c===-1/0?17976931348623157e292*(c<0?-1:1):c==c?c:0:c===0?c:0}function mn(c){var f=Wo(c),x=f%1;return f==f?x?f-x:f:0}function kf(c){return c?Go(mn(c),0,4294967295):0}function Lr(c){if(typeof c=="number")return c;if(Or(c))return NaN;if(ii(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=ii(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=Hc(c);var x=I.test(c);return x||Q.test(c)?Vp(c.slice(2),x?2:8):E.test(c)?NaN:+c}function Gf(c){return ui(c,Ui(c))}function bn(c){return c==null?"":gi(c)}var Oh=ni(function(c,f){if(ql(f)||mr(f))ui(f,Ci(f),c);else for(var x in f)Rn.call(f,x)&&cs(c,x,f[x])}),Ad=ni(function(c,f){ui(f,Ui(f),c)}),Lh=ni(function(c,f,x,A){ui(f,Ui(f),c,A)}),hv=ni(function(c,f,x,A){ui(f,Ci(f),c,A)}),Hf=bo(Gl),Rd=fn(function(c,f){c=zn(c);var x=-1,A=f.length,k=A>2?f[2]:void 0;for(k&&Qt(f[0],f[1],k)&&(A=1);++x<A;)for(var ie=f[x],pe=Ui(ie),Se=-1,Be=pe.length;++Se<Be;){var tt=pe[Se],nt=c[tt];(nt===void 0||Wr(nt,Br[tt])&&!Rn.call(c,tt))&&(c[tt]=ie[tt])}return c}),da=fn(function(c){return c.push(void 0,xo),ir(el,void 0,c)});function Cd(c,f,x){var A=c==null?void 0:_o(c,f);return A===void 0?x:A}function Zl(c,f){return c!=null&&Za(c,f,Kc)}var cv=Sh(function(c,f,x){f!=null&&typeof f.toString!="function"&&(f=th.call(f)),c[f]=x},nl(ar)),dv=Sh(function(c,f,x){f!=null&&typeof f.toString!="function"&&(f=th.call(f)),Rn.call(c,f)?c[f].push(x):c[f]=[x]},Yt),Un=fn(ka);function Ci(c){return mr(c)?Uo(c):ed(c)}function Ui(c){return mr(c)?Uo(c,!0):sf(c)}var Kl=ni(function(c,f,x){pn(c,f,x)}),el=ni(function(c,f,x,A){pn(c,f,x,A)}),pa=bo(function(c,f){var x={};if(c==null)return x;var A=!1;f=Vn(f,function(ie){return ie=eo(ie,c),A||(A=ie.length>1),ie}),ui(c,aa(c),x),A&&(x=Mi(x,7,$a));for(var k=f.length;k--;)ja(x,f[k]);return x}),_i=bo(function(c,f){return c==null?{}:function(x,A){return gh(x,A,function(k,ie){return Zl(x,ie)})}(c,f)});function Xo(c,f){if(c==null)return{};var x=Vn(aa(c),function(A){return[A]});return f=Yt(f),gh(c,x,function(A,k){return f(A,k[0])})}var Ql=Wl(Ci),fa=Wl(Ui);function wo(c){return c==null?[]:Ku(c,Ci(c))}var tl=gs(function(c,f,x){return f=f.toLowerCase(),c+(x?ma(f):f)});function ma(c){return nu(bn(c).toLowerCase())}function ga(c){return(c=bn(c))&&c.replace(Z,Jp).replace(Gp,"")}var eu=gs(function(c,f,x){return c+(x?"-":"")+f.toLowerCase()}),zf=gs(function(c,f,x){return c+(x?" ":"")+f.toLowerCase()}),Nh=ra("toLowerCase"),tu=gs(function(c,f,x){return c+(x?"_":"")+f.toLowerCase()}),Dh=gs(function(c,f,x){return c+(x?" ":"")+nu(f)}),jf=gs(function(c,f,x){return c+(x?" ":"")+f.toUpperCase()}),nu=ra("toUpperCase");function Pd(c,f,x){return c=bn(c),(f=x?void 0:f)===void 0?function(A){return Hp.test(A)}(c)?function(A){return A.match(Io)||[]}(c):function(A){return A.match(uo)||[]}(c):c.match(f)||[]}var iu=fn(function(c,f){try{return ir(c,void 0,f)}catch(x){return Td(x)?x:new vn(x)}}),Fh=bo(function(c,f){return hr(f,function(x){x=Vr(x),mo(c,x,wd(c[x],c))}),c});function nl(c){return function(){return c}}var Vf=jo(),Wf=jo(!0);function ar(c){return c}function Bh(c){return of(typeof c=="function"?c:Mi(c,1))}var Xf=fn(function(c,f){return function(x){return ka(x,c,f)}}),pv=fn(function(c,f){return function(x){return ka(c,x,f)}});function Uh(c,f,x){var A=Ci(f),k=Kr(f,A);x!=null||ii(f)&&(k.length||!A.length)||(x=f,f=c,c=this,k=Kr(f,Ci(f)));var ie=!(ii(x)&&"chain"in x&&!x.chain),pe=no(c);return hr(k,function(Se){var Be=f[Se];c[Se]=Be,pe&&(c.prototype[Se]=function(){var tt=this.__chain__;if(ie||tt){var nt=c(this.__wrapped__),gt=nt.__actions__=Ai(this.__actions__);return gt.push({func:Be,args:arguments,thisArg:c}),nt.__chain__=tt,nt}return Be.apply(c,Lo([this.value()],arguments))})}),c}function il(){}var kh=qa(Vn),xs=qa(Fc),qf=qa(qu);function Yf(c){return At(c)?Yu(Vr(c)):function(f){return function(x){return _o(x,f)}}(c)}var Gh=jl(),$f=jl(!0);function Hh(){return[]}function rl(){return!1}var ru=Xa(function(c,f){return c+f},0),Id=Ya("ceil"),ki=Xa(function(c,f){return c/f},1),Jf=Ya("floor"),zh,Zf=Xa(function(c,f){return c*f},1),Od=Ya("round"),jh=Xa(function(c,f){return c-f},0);return S.after=function(c,f){if(typeof f!="function")throw new dr($);return c=mn(c),function(){if(--c<1)return f.apply(this,arguments)}},S.ary=Af,S.assign=Oh,S.assignIn=Ad,S.assignInWith=Lh,S.assignWith=hv,S.at=Hf,S.before=Rf,S.bind=wd,S.bindAll=Fh,S.bindKey=Cf,S.castArray=function(){if(!arguments.length)return[];var c=arguments[0];return on(c)?c:[c]},S.chain=Tf,S.chunk=function(c,f,x){f=(x?Qt(c,f,x):f===void 0)?1:Wn(mn(f),0);var A=c==null?0:c.length;if(!A||f<1)return[];for(var k=0,ie=0,pe=Mt(sh(A/f));k<A;)pe[ie++]=li(c,k,k+=f);return pe},S.compact=function(c){for(var f=-1,x=c==null?0:c.length,A=0,k=[];++f<x;){var ie=c[f];ie&&(k[A++]=ie)}return k},S.concat=function(){var c=arguments.length;if(!c)return[];for(var f=Mt(c-1),x=arguments[0],A=c;A--;)f[A-1]=arguments[A];return Lo(on(x)?Ai(x):[x],Rt(f,1))},S.cond=function(c){var f=c==null?0:c.length,x=Yt();return c=f?Vn(c,function(A){if(typeof A[1]!="function")throw new dr($);return[x(A[0]),A[1]]}):[],fn(function(A){for(var k=-1;++k<f;){var ie=c[k];if(ir(ie[0],this,A))return ir(ie[1],this,A)}})},S.conforms=function(c){return function(f){var x=Ci(f);return function(A){return go(A,f,x)}}(Mi(c,1))},S.constant=nl,S.countBy=Zg,S.create=function(c,f){var x=hs(c);return f==null?x:rf(x,f)},S.curry=function c(f,x,A){var k=En(f,8,void 0,void 0,void 0,void 0,void 0,x=A?void 0:x);return k.placeholder=c.placeholder,k},S.curryRight=function c(f,x,A){var k=En(f,16,void 0,void 0,void 0,void 0,void 0,x=A?void 0:x);return k.placeholder=c.placeholder,k},S.debounce=Pf,S.defaults=Rd,S.defaultsDeep=da,S.defer=ov,S.delay=sv,S.difference=Ug,S.differenceBy=xf,S.differenceWith=bf,S.drop=function(c,f,x){var A=c==null?0:c.length;return A?li(c,(f=x||f===void 0?1:mn(f))<0?0:f,A):[]},S.dropRight=function(c,f,x){var A=c==null?0:c.length;return A?li(c,0,(f=A-(f=x||f===void 0?1:mn(f)))<0?0:f):[]},S.dropRightWhile=function(c,f){return c&&c.length?zl(c,Yt(f,3),!0,!0):[]},S.dropWhile=function(c,f){return c&&c.length?zl(c,Yt(f,3),!0):[]},S.fill=function(c,f,x,A){var k=c==null?0:c.length;return k?(x&&typeof x!="number"&&Qt(c,f,x)&&(x=0,A=k),function(ie,pe,Se,Be){var tt=ie.length;for((Se=mn(Se))<0&&(Se=-Se>tt?0:tt+Se),(Be=Be===void 0||Be>tt?tt:mn(Be))<0&&(Be+=tt),Be=Se>Be?0:kf(Be);Se<Be;)ie[Se++]=pe;return ie}(c,f,x,A)):[]},S.filter=function(c,f){return(on(c)?co:Ho)(c,Yt(f,3))},S.flatMap=function(c,f){return Rt(Ah(c,f),1)},S.flatMapDeep=function(c,f){return Rt(Ah(c,f),1/0)},S.flatMapDepth=function(c,f,x){return x=x===void 0?1:mn(x),Rt(Ah(c,f),x)},S.flatten=_d,S.flattenDeep=function(c){return c!=null&&c.length?Rt(c,1/0):[]},S.flattenDepth=function(c,f){return c!=null&&c.length?Rt(c,f=f===void 0?1:mn(f)):[]},S.flip=function(c){return En(c,512)},S.flow=Vf,S.flowRight=Wf,S.fromPairs=function(c){for(var f=-1,x=c==null?0:c.length,A={};++f<x;){var k=c[f];A[k[0]]=k[1]}return A},S.functions=function(c){return c==null?[]:Kr(c,Ci(c))},S.functionsIn=function(c){return c==null?[]:Kr(c,Ui(c))},S.groupBy=ev,S.initial=function(c){return c!=null&&c.length?li(c,0,-1):[]},S.intersection=Ka,S.intersectionBy=sr,S.intersectionWith=Qi,S.invert=cv,S.invertBy=dv,S.invokeMap=tv,S.iteratee=Bh,S.keyBy=nv,S.keys=Ci,S.keysIn=Ui,S.map=Ah,S.mapKeys=function(c,f){var x={};return f=Yt(f,3),vo(c,function(A,k,ie){mo(x,f(A,k,ie),A)}),x},S.mapValues=function(c,f){var x={};return f=Yt(f,3),vo(c,function(A,k,ie){mo(x,k,f(A,k,ie))}),x},S.matches=function(c){return af(Mi(c,1))},S.matchesProperty=function(c,f){return nd(c,Mi(f,1))},S.memoize=$l,S.merge=Kl,S.mergeWith=el,S.method=Xf,S.methodOf=pv,S.mixin=Uh,S.negate=Jl,S.nthArg=function(c){return c=mn(c),fn(function(f){return Hr(f,c)})},S.omit=pa,S.omitBy=function(c,f){return Xo(c,Jl(Yt(f)))},S.once=function(c){return Rf(2,c)},S.orderBy=function(c,f,x,A){return c==null?[]:(on(f)||(f=f==null?[]:[f]),on(x=A?void 0:x)||(x=x==null?[]:[x]),yo(c,f,x))},S.over=kh,S.overArgs=Sd,S.overEvery=xs,S.overSome=qf,S.partial=Ch,S.partialRight=If,S.partition=iv,S.pick=_i,S.pickBy=Xo,S.property=Yf,S.propertyOf=function(c){return function(f){return c==null?void 0:_o(c,f)}},S.pull=kg,S.pullAll=wf,S.pullAllBy=function(c,f,x){return c&&c.length&&f&&f.length?Qr(c,f,Yt(x,2)):c},S.pullAllWith=function(c,f,x){return c&&c.length&&f&&f.length?Qr(c,f,void 0,x):c},S.pullAt=Gg,S.range=Gh,S.rangeRight=$f,S.rearg=_s,S.reject=function(c,f){return(on(c)?co:Ho)(c,Jl(Yt(f,3)))},S.remove=function(c,f){var x=[];if(!c||!c.length)return x;var A=-1,k=[],ie=c.length;for(f=Yt(f,3);++A<ie;){var pe=c[A];f(pe,A,c)&&(x.push(pe),k.push(A))}return na(c,k),x},S.rest=function(c,f){if(typeof c!="function")throw new dr($);return fn(c,f=f===void 0?f:mn(f))},S.reverse=xd,S.sampleSize=function(c,f,x){return f=(x?Qt(c,f,x):f===void 0)?1:mn(f),(on(c)?Qs:rd)(c,f)},S.set=function(c,f,x){return c==null?c:qn(c,f,x)},S.setWith=function(c,f,x,A){return A=typeof A=="function"?A:void 0,c==null?c:qn(c,f,x,A)},S.shuffle=function(c){return(on(c)?kl:uf)(c)},S.slice=function(c,f,x){var A=c==null?0:c.length;return A?(x&&typeof x!="number"&&Qt(c,f,x)?(f=0,x=A):(f=f==null?0:mn(f),x=x===void 0?A:mn(x)),li(c,f,x)):[]},S.sortBy=rv,S.sortedUniq=function(c){return c&&c.length?yh(c):[]},S.sortedUniqBy=function(c,f){return c&&c.length?yh(c,Yt(f,2)):[]},S.split=function(c,f,x){return x&&typeof x!="number"&&Qt(c,f,x)&&(f=x=void 0),(x=x===void 0?4294967295:x>>>0)?(c=bn(c))&&(typeof f=="string"||f!=null&&!Md(f))&&!(f=gi(f))&&qs(c)?Tt(zi(c),0,x):c.split(f,x):[]},S.spread=function(c,f){if(typeof c!="function")throw new dr($);return f=f==null?0:Wn(mn(f),0),fn(function(x){var A=x[f],k=Tt(x,0,f);return A&&Lo(k,A),ir(c,this,k)})},S.tail=function(c){var f=c==null?0:c.length;return f?li(c,1,f):[]},S.take=function(c,f,x){return c&&c.length?li(c,0,(f=x||f===void 0?1:mn(f))<0?0:f):[]},S.takeRight=function(c,f,x){var A=c==null?0:c.length;return A?li(c,(f=A-(f=x||f===void 0?1:mn(f)))<0?0:f,A):[]},S.takeRightWhile=function(c,f){return c&&c.length?zl(c,Yt(f,3),!1,!0):[]},S.takeWhile=function(c,f){return c&&c.length?zl(c,Yt(f,3)):[]},S.tap=function(c,f){return f(c),c},S.throttle=function(c,f,x){var A=!0,k=!0;if(typeof c!="function")throw new dr($);return ii(x)&&(A="leading"in x?!!x.leading:A,k="trailing"in x?!!x.trailing:k),Pf(c,f,{leading:A,maxWait:f,trailing:k})},S.thru=Mh,S.toArray=Uf,S.toPairs=Ql,S.toPairsIn=fa,S.toPath=function(c){return on(c)?Vn(c,Vr):Or(c)?[c]:Ai(Eh(bn(c)))},S.toPlainObject=Gf,S.transform=function(c,f,x){var A=on(c),k=A||Vo(c)||ca(c);if(f=Yt(f,4),x==null){var ie=c&&c.constructor;x=k?A?new ie:[]:ii(c)&&no(ie)?hs(rh(c)):{}}return(k?hr:vo)(c,function(pe,Se,Be){return f(x,pe,Se,Be)}),x},S.unary=function(c){return Af(c,1)},S.union=Hg,S.unionBy=zg,S.unionWith=jg,S.uniq=function(c){return c&&c.length?Tn(c):[]},S.uniqBy=function(c,f){return c&&c.length?Tn(c,Yt(f,2)):[]},S.uniqWith=function(c,f){return f=typeof f=="function"?f:void 0,c&&c.length?Tn(c,void 0,f):[]},S.unset=function(c,f){return c==null||ja(c,f)},S.unzip=bd,S.unzipWith=Sf,S.update=function(c,f,x){return c==null?c:gn(c,f,bh(x))},S.updateWith=function(c,f,x,A){return A=typeof A=="function"?A:void 0,c==null?c:gn(c,f,bh(x),A)},S.values=wo,S.valuesIn=function(c){return c==null?[]:Ku(c,Ui(c))},S.without=Vg,S.words=Pd,S.wrap=function(c,f){return Ch(bh(f),c)},S.xor=Wg,S.xorBy=Xg,S.xorWith=qg,S.zip=Yg,S.zipObject=function(c,f){return sd(c||[],f||[],cs)},S.zipObjectDeep=function(c,f){return sd(c||[],f||[],qn)},S.zipWith=$g,S.entries=Ql,S.entriesIn=fa,S.extend=Ad,S.extendWith=Lh,Uh(S,S),S.add=ru,S.attempt=iu,S.camelCase=tl,S.capitalize=ma,S.ceil=Id,S.clamp=function(c,f,x){return x===void 0&&(x=f,f=void 0),x!==void 0&&(x=(x=Lr(x))==x?x:0),f!==void 0&&(f=(f=Lr(f))==f?f:0),Go(Lr(c),f,x)},S.clone=function(c){return Mi(c,4)},S.cloneDeep=function(c){return Mi(c,5)},S.cloneDeepWith=function(c,f){return Mi(c,5,f=typeof f=="function"?f:void 0)},S.cloneWith=function(c,f){return Mi(c,4,f=typeof f=="function"?f:void 0)},S.conformsTo=function(c,f){return f==null||go(c,f,Ci(f))},S.deburr=ga,S.defaultTo=function(c,f){return c==null||c!=c?f:c},S.divide=ki,S.endsWith=function(c,f,x){c=bn(c),f=gi(f);var A=c.length,k=x=x===void 0?A:Go(mn(x),0,A);return(x-=f.length)>=0&&c.slice(x,k)==f},S.eq=Wr,S.escape=function(c){return(c=bn(c))&&Wt.test(c)?c.replace(ln,Zp):c},S.escapeRegExp=function(c){return(c=bn(c))&&An.test(c)?c.replace(jn,"\\$&"):c},S.every=function(c,f,x){var A=on(c)?Fc:ph;return x&&Qt(c,f,x)&&(f=void 0),A(c,Yt(f,3))},S.find=Kg,S.findIndex=gd,S.findKey=function(c,f){return Bc(c,Yt(f,3),vo)},S.findLast=Qg,S.findLastIndex=vd,S.findLastKey=function(c,f){return Bc(c,Yt(f,3),Zc)},S.floor=Jf,S.forEach=Ef,S.forEachRight=Mf,S.forIn=function(c,f){return c==null?c:ps(c,Yt(f,3),Ui)},S.forInRight=function(c,f){return c==null?c:Gr(c,Yt(f,3),Ui)},S.forOwn=function(c,f){return c&&vo(c,Yt(f,3))},S.forOwnRight=function(c,f){return c&&Zc(c,Yt(f,3))},S.get=Cd,S.gt=av,S.gte=Of,S.has=function(c,f){return c!=null&&Za(c,f,ea)},S.hasIn=Zl,S.head=yd,S.identity=ar,S.includes=function(c,f,x,A){c=mr(c)?c:wo(c),x=x&&!A?mn(x):0;var k=c.length;return x<0&&(x=Wn(k+x,0)),Ih(c)?x<=k&&c.indexOf(f,x)>-1:!!k&&Xs(c,f,x)>-1},S.indexOf=function(c,f,x){var A=c==null?0:c.length;if(!A)return-1;var k=x==null?0:mn(x);return k<0&&(k=Wn(A+k,0)),Xs(c,f,k)},S.inRange=function(c,f,x){return f=Wo(f),x===void 0?(x=f,f=0):x=Wo(x),function(A,k,ie){return A>=wi(k,ie)&&A<Wn(k,ie)}(c=Lr(c),f,x)},S.invoke=Un,S.isArguments=ys,S.isArray=on,S.isArrayBuffer=lv,S.isArrayLike=mr,S.isArrayLikeObject=Yn,S.isBoolean=function(c){return c===!0||c===!1||ri(c)&&Zi(c)==K},S.isBuffer=Vo,S.isDate=Lf,S.isElement=function(c){return ri(c)&&c.nodeType===1&&!Qa(c)},S.isEmpty=function(c){if(c==null)return!0;if(mr(c)&&(on(c)||typeof c=="string"||typeof c.splice=="function"||Vo(c)||ca(c)||ys(c)))return!c.length;var f=Ri(c);if(f==N||f==z)return!c.size;if(ql(c))return!ed(c).length;for(var x in c)if(Rn.call(c,x))return!1;return!0},S.isEqual=function(c,f){return Rr(c,f)},S.isEqualWith=function(c,f,x){var A=(x=typeof x=="function"?x:void 0)?x(c,f):void 0;return A===void 0?Rr(c,f,void 0,x):!!A},S.isError=Td,S.isFinite=function(c){return typeof c=="number"&&Fo(c)},S.isFunction=no,S.isInteger=Nf,S.isLength=Ph,S.isMap=Df,S.isMatch=function(c,f){return c===f||Ga(c,f,dd(f))},S.isMatchWith=function(c,f,x){return x=typeof x=="function"?x:void 0,Ga(c,f,dd(f),x)},S.isNaN=function(c){return Ed(c)&&c!=+c},S.isNative=function(c){if(Fg(c))throw new vn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ha(c)},S.isNil=function(c){return c==null},S.isNull=function(c){return c===null},S.isNumber=Ed,S.isObject=ii,S.isObjectLike=ri,S.isPlainObject=Qa,S.isRegExp=Md,S.isSafeInteger=function(c){return Nf(c)&&c>=-9007199254740991&&c<=9007199254740991},S.isSet=Ff,S.isString=Ih,S.isSymbol=Or,S.isTypedArray=ca,S.isUndefined=function(c){return c===void 0},S.isWeakMap=function(c){return ri(c)&&Ri(c)==qe},S.isWeakSet=function(c){return ri(c)&&Zi(c)=="[object WeakSet]"},S.join=function(c,f){return c==null?"":ji.call(c,f)},S.kebabCase=eu,S.last=Ir,S.lastIndexOf=function(c,f,x){var A=c==null?0:c.length;if(!A)return-1;var k=A;return x!==void 0&&(k=(k=mn(x))<0?Wn(A+k,0):wi(k,A-1)),f==f?function(ie,pe,Se){for(var Be=Se+1;Be--;)if(ie[Be]===pe)return Be;return Be}(c,f,k):Rl(c,Uc,k,!0)},S.lowerCase=zf,S.lowerFirst=Nh,S.lt=Bf,S.lte=uv,S.max=function(c){return c&&c.length?Ua(c,ar,fh):void 0},S.maxBy=function(c,f){return c&&c.length?Ua(c,Yt(f,2),fh):void 0},S.mean=function(c){return kc(c,ar)},S.meanBy=function(c,f){return kc(c,Yt(f,2))},S.min=function(c){return c&&c.length?Ua(c,ar,mh):void 0},S.minBy=function(c,f){return c&&c.length?Ua(c,Yt(f,2),mh):void 0},S.stubArray=Hh,S.stubFalse=rl,S.stubObject=function(){return{}},S.stubString=function(){return""},S.stubTrue=function(){return!0},S.multiply=Zf,S.nth=function(c,f){return c&&c.length?Hr(c,mn(f)):void 0},S.noConflict=function(){return ti._===this&&(ti._=Cg),this},S.noop=il,S.now=Rh,S.pad=function(c,f,x){c=bn(c);var A=(f=mn(f))?Do(c):0;if(!f||A>=f)return c;var k=(f-A)/2;return oa(ah(k),x)+c+oa(sh(k),x)},S.padEnd=function(c,f,x){c=bn(c);var A=(f=mn(f))?Do(c):0;return f&&A<f?c+oa(f-A,x):c},S.padStart=function(c,f,x){c=bn(c);var A=(f=mn(f))?Do(c):0;return f&&A<f?oa(f-A,x)+c:c},S.parseInt=function(c,f,x){return x||f==null?f=0:f&&(f=+f),Vi(bn(c).replace(In,""),f||0)},S.random=function(c,f,x){if(x&&typeof x!="boolean"&&Qt(c,f,x)&&(f=x=void 0),x===void 0&&(typeof f=="boolean"?(x=f,f=void 0):typeof c=="boolean"&&(x=c,c=void 0)),c===void 0&&f===void 0?(c=0,f=1):(c=Wo(c),f===void 0?(f=c,c=0):f=Wo(f)),c>f){var A=c;c=f,f=A}if(x||c%1||f%1){var k=uh();return wi(c+k*(f-c+Tr("1e-"+((k+"").length-1))),f)}return fs(c,f)},S.reduce=function(c,f,x){var A=on(c)?Xu:Gc,k=arguments.length<3;return A(c,Yt(f,4),x,k,rr)},S.reduceRight=function(c,f,x){var A=on(c)?Xp:Gc,k=arguments.length<3;return A(c,Yt(f,4),x,k,dh)},S.repeat=function(c,f,x){return f=(x?Qt(c,f,x):f===void 0)?1:mn(f),vh(bn(c),f)},S.replace=function(){var c=arguments,f=bn(c[0]);return c.length<3?f:f.replace(c[1],c[2])},S.result=function(c,f,x){var A=-1,k=(f=eo(f,c)).length;for(k||(k=1,c=void 0);++A<k;){var ie=c==null?void 0:c[Vr(f[A])];ie===void 0&&(A=k,ie=x),c=no(ie)?ie.call(c):ie}return c},S.round=Od,S.runInContext=Ue,S.sample=function(c){return(on(c)?ko:id)(c)},S.size=function(c){if(c==null)return 0;if(mr(c))return Ih(c)?Do(c):c.length;var f=Ri(c);return f==N||f==z?c.size:ed(c).length},S.snakeCase=tu,S.some=function(c,f,x){var A=on(c)?qu:_h;return x&&Qt(c,f,x)&&(f=void 0),A(c,Yt(f,3))},S.sortedIndex=function(c,f){return za(c,f)},S.sortedIndexBy=function(c,f,x){return Hl(c,f,Yt(x,2))},S.sortedIndexOf=function(c,f){var x=c==null?0:c.length;if(x){var A=za(c,f);if(A<x&&Wr(c[A],f))return A}return-1},S.sortedLastIndex=function(c,f){return za(c,f,!0)},S.sortedLastIndexBy=function(c,f,x){return Hl(c,f,Yt(x,2),!0)},S.sortedLastIndexOf=function(c,f){if(c!=null&&c.length){var x=za(c,f,!0)-1;if(Wr(c[x],f))return x}return-1},S.startCase=Dh,S.startsWith=function(c,f,x){return c=bn(c),x=x==null?0:Go(mn(x),0,c.length),f=gi(f),c.slice(x,x+f.length)==f},S.subtract=jh,S.sum=function(c){return c&&c.length?Ju(c,ar):0},S.sumBy=function(c,f){return c&&c.length?Ju(c,Yt(f,2)):0},S.template=function(c,f,x){var A=S.templateSettings;x&&Qt(c,f,x)&&(f=void 0),c=bn(c),f=Lh({},f,A,Xl);var k,ie,pe=Lh({},f.imports,A.imports,Xl),Se=Ci(pe),Be=Ku(pe,Se),tt=0,nt=f.interpolate||se,gt="__p += '",Ft=Il((f.escape||se).source+"|"+nt.source+"|"+(nt===Bt?ho:se).source+"|"+(f.evaluate||se).source+"|$","g"),kt="//# sourceURL="+(Rn.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jp+"]")+`
10
+ `)}(A,function(k,ie){return hr(Y,function(pe){var Se="_."+pe[0];ie&pe[1]&&!Na(k,Se)&&k.push(Se)}),k.sort()}(function(k){var ie=k.match(Fi);return ie?ie[1].split(pi):[]}(A),x)))}function _f(c){var f=0,x=0;return function(){var A=Ar(),k=16-(A-x);if(x=A,k>0){if(++f>=800)return arguments[0]}else f=0;return c.apply(void 0,arguments)}}function Th(c,f){var x=-1,A=c.length,k=A-1;for(f=f===void 0?A:f;++x<f;){var ie=fs(x,k),pe=c[ie];c[ie]=c[x],c[x]=pe}return c.length=f,c}var Eh=function(c){var f=$l(c,function(A){return x.size===500&&x.clear(),A}),x=f.cache;return f}(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Mn,function(x,A,k,ie){f.push(k?ie.replace(Oa,"$1"):A||x)}),f});function Vr(c){if(typeof c=="string"||Or(c))return c;var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}function vs(c){if(c!=null){try{return eh.call(c)}catch{}try{return c+""}catch{}}return""}function yf(c){if(c instanceof un)return c.clone();var f=new Zn(c.__wrapped__,c.__chain__);return f.__actions__=Ai(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}var Ug=fn(function(c,f){return Yn(c)?ds(c,Rt(f,1,Yn,!0)):[]}),xf=fn(function(c,f){var x=Ir(f);return Yn(x)&&(x=void 0),Yn(c)?ds(c,Rt(f,1,Yn,!0),Yt(x,2)):[]}),bf=fn(function(c,f){var x=Ir(f);return Yn(x)&&(x=void 0),Yn(c)?ds(c,Rt(f,1,Yn,!0),void 0,x):[]});function gd(c,f,x){var A=c==null?0:c.length;if(!A)return-1;var k=x==null?0:mn(x);return k<0&&(k=Wn(A+k,0)),Rl(c,Yt(f,3),k)}function vd(c,f,x){var A=c==null?0:c.length;if(!A)return-1;var k=A-1;return x!==void 0&&(k=mn(x),k=x<0?Wn(A+k,0):wi(k,A-1)),Rl(c,Yt(f,3),k,!0)}function _d(c){return c!=null&&c.length?Rt(c,1):[]}function yd(c){return c&&c.length?c[0]:void 0}var Ka=fn(function(c){var f=Vn(c,Va);return f.length&&f[0]===c[0]?Qc(f):[]}),sr=fn(function(c){var f=Ir(c),x=Vn(c,Va);return f===Ir(x)?f=void 0:x.pop(),x.length&&x[0]===c[0]?Qc(x,Yt(f,2)):[]}),Qi=fn(function(c){var f=Ir(c),x=Vn(c,Va);return(f=typeof f=="function"?f:void 0)&&x.pop(),x.length&&x[0]===c[0]?Qc(x,void 0,f):[]});function Ir(c){var f=c==null?0:c.length;return f?c[f-1]:void 0}var kg=fn(wf);function wf(c,f){return c&&c.length&&f&&f.length?Qr(c,f):c}var Gg=bo(function(c,f){var x=c==null?0:c.length,A=Gl(c,f);return na(c,Vn(f,function(k){return Ki(k,x)?+k:k}).sort(cf)),A});function xd(c){return c==null?c:Dl.call(c)}var Hg=fn(function(c){return Tn(Rt(c,1,Yn,!0))}),zg=fn(function(c){var f=Ir(c);return Yn(f)&&(f=void 0),Tn(Rt(c,1,Yn,!0),Yt(f,2))}),jg=fn(function(c){var f=Ir(c);return f=typeof f=="function"?f:void 0,Tn(Rt(c,1,Yn,!0),void 0,f)});function bd(c){if(!c||!c.length)return[];var f=0;return c=co(c,function(x){if(Yn(x))return f=Wn(x.length,f),!0}),Zu(f,function(x){return Vn(c,Yu(x))})}function Sf(c,f){if(!c||!c.length)return[];var x=bd(c);return f==null?x:Vn(x,function(A){return ir(f,void 0,A)})}var Vg=fn(function(c,f){return Yn(c)?ds(c,f):[]}),Wg=fn(function(c){return xh(co(c,Yn))}),Xg=fn(function(c){var f=Ir(c);return Yn(f)&&(f=void 0),xh(co(c,Yn),Yt(f,2))}),qg=fn(function(c){var f=Ir(c);return f=typeof f=="function"?f:void 0,xh(co(c,Yn),void 0,f)}),Yg=fn(bd),$g=fn(function(c){var f=c.length,x=f>1?c[f-1]:void 0;return x=typeof x=="function"?(c.pop(),x):void 0,Sf(c,x)});function Tf(c){var f=S(c);return f.__chain__=!0,f}function Mh(c,f){return f(c)}var Jg=bo(function(c){var f=c.length,x=f?c[0]:0,A=this.__wrapped__,k=function(ie){return Gl(ie,c)};return!(f>1||this.__actions__.length)&&A instanceof un&&Ki(x)?((A=A.slice(x,+x+(f?1:0))).__actions__.push({func:Mh,args:[k],thisArg:void 0}),new Zn(A,this.__chain__).thru(function(ie){return f&&!ie.length&&ie.push(void 0),ie})):this.thru(k)}),Zg=ms(function(c,f,x){Rn.call(c,x)?++c[x]:mo(c,x,1)}),Kg=zo(gd),Qg=zo(vd);function Ef(c,f){return(on(c)?hr:rr)(c,Yt(f,3))}function Mf(c,f){return(on(c)?Dc:dh)(c,Yt(f,3))}var ev=ms(function(c,f,x){Rn.call(c,x)?c[x].push(f):mo(c,x,[f])}),tv=fn(function(c,f,x){var A=-1,k=typeof f=="function",ie=mr(c)?Mt(c.length):[];return rr(c,function(pe){ie[++A]=k?ir(f,pe,x):ka(pe,f,x)}),ie}),nv=ms(function(c,f,x){mo(c,x,f)});function Ah(c,f){return(on(c)?Vn:td)(c,Yt(f,3))}var iv=ms(function(c,f,x){c[x?0:1].push(f)},function(){return[[],[]]}),rv=fn(function(c,f){if(c==null)return[];var x=f.length;return x>1&&Qt(c,f[0],f[1])?f=[]:x>2&&Qt(f[0],f[1],f[2])&&(f=[f[0]]),yo(c,Rt(f,1),[])}),Rh=Og||function(){return ti.Date.now()};function Af(c,f,x){return f=x?void 0:f,En(c,128,void 0,void 0,void 0,void 0,f=c&&f==null?c.length:f)}function Rf(c,f){var x;if(typeof f!="function")throw new dr($);return c=mn(c),function(){return--c>0&&(x=f.apply(this,arguments)),c<=1&&(f=void 0),x}}var wd=fn(function(c,f,x){var A=1;if(x.length){var k=No(x,to(wd));A|=32}return En(c,A,f,x,k)}),Cf=fn(function(c,f,x){var A=3;if(x.length){var k=No(x,to(Cf));A|=32}return En(f,A,c,x,k)});function Pf(c,f,x){var A,k,ie,pe,Se,Be,tt=0,nt=!1,gt=!1,Ft=!0;if(typeof c!="function")throw new dr($);function kt(jt){var Kt=A,dn=k;return A=k=void 0,tt=jt,pe=c.apply(dn,Kt)}function $t(jt){return tt=jt,Se=Yl(_t,f),nt?kt(jt):pe}function lt(jt){var Kt=jt-Be;return Be===void 0||Kt>=f||Kt<0||gt&&jt-tt>=ie}function _t(){var jt=Rh();if(lt(jt))return Vt(jt);Se=Yl(_t,function(Kt){var dn=f-(Kt-Be);return gt?wi(dn,ie-(Kt-tt)):dn}(jt))}function Vt(jt){return Se=void 0,Ft&&A?kt(jt):(A=k=void 0,pe)}function Lt(){var jt=Rh(),Kt=lt(jt);if(A=arguments,k=this,Be=jt,Kt){if(Se===void 0)return $t(Be);if(gt)return ad(Se),Se=Yl(_t,f),kt(Be)}return Se===void 0&&(Se=Yl(_t,f)),pe}return f=Lr(f)||0,ii(x)&&(nt=!!x.leading,ie=(gt="maxWait"in x)?Wn(Lr(x.maxWait)||0,f):ie,Ft="trailing"in x?!!x.trailing:Ft),Lt.cancel=function(){Se!==void 0&&ad(Se),tt=0,A=Be=k=Se=void 0},Lt.flush=function(){return Se===void 0?pe:Vt(Rh())},Lt}var ov=fn(function(c,f){return ch(c,1,f)}),sv=fn(function(c,f,x){return ch(c,Lr(f)||0,x)});function $l(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new dr($);var x=function(){var A=arguments,k=f?f.apply(this,A):A[0],ie=x.cache;if(ie.has(k))return ie.get(k);var pe=c.apply(this,A);return x.cache=ie.set(k,pe)||ie,pe};return x.cache=new($l.Cache||pr),x}function Jl(c){if(typeof c!="function")throw new dr($);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}$l.Cache=pr;var Sd=hf(function(c,f){var x=(f=f.length==1&&on(f[0])?Vn(f[0],cr(Yt())):Vn(Rt(f,1),cr(Yt()))).length;return fn(function(A){for(var k=-1,ie=wi(A.length,x);++k<ie;)A[k]=f[k].call(this,A[k]);return ir(c,this,A)})}),Ch=fn(function(c,f){return En(c,32,void 0,f,No(f,to(Ch)))}),If=fn(function(c,f){return En(c,64,void 0,f,No(f,to(If)))}),_s=bo(function(c,f){return En(c,256,void 0,void 0,void 0,f)});function Wr(c,f){return c===f||c!=c&&f!=f}var av=sa(fh),Of=sa(function(c,f){return c>=f}),ys=ta(function(){return arguments}())?ta:function(c){return ri(c)&&Rn.call(c,"callee")&&!nf.call(c,"callee")},on=Mt.isArray,lv=Oc?cr(Oc):function(c){return ri(c)&&Zi(c)==ft};function mr(c){return c!=null&&Ph(c.length)&&!no(c)}function Yn(c){return ri(c)&&mr(c)}var Vo=Yc||rl,Lf=Lc?cr(Lc):function(c){return ri(c)&&Zi(c)==xe};function Td(c){if(!ri(c))return!1;var f=Zi(c);return f==Re||f=="[object DOMException]"||typeof c.message=="string"&&typeof c.name=="string"&&!Qa(c)}function no(c){if(!ii(c))return!1;var f=Zi(c);return f==Ie||f==M||f=="[object AsyncFunction]"||f=="[object Proxy]"}function Nf(c){return typeof c=="number"&&c==mn(c)}function Ph(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991}function ii(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function ri(c){return c!=null&&typeof c=="object"}var Df=Hu?cr(Hu):function(c){return ri(c)&&Ri(c)==N};function Ed(c){return typeof c=="number"||ri(c)&&Zi(c)==D}function Qa(c){if(!ri(c)||Zi(c)!=ee)return!1;var f=rh(c);if(f===null)return!0;var x=Rn.call(f,"constructor")&&f.constructor;return typeof x=="function"&&x instanceof x&&eh.call(x)==Rg}var Md=zu?cr(zu):function(c){return ri(c)&&Zi(c)==C},Ff=ju?cr(ju):function(c){return ri(c)&&Ri(c)==z};function Ih(c){return typeof c=="string"||!on(c)&&ri(c)&&Zi(c)==V}function Or(c){return typeof c=="symbol"||ri(c)&&Zi(c)==ne}var ca=Vu?cr(Vu):function(c){return ri(c)&&Ph(c.length)&&!!Nn[Zi(c)]},Bf=sa(mh),uv=sa(function(c,f){return c<=f});function Uf(c){if(!c)return[];if(mr(c))return Ih(c)?ji(c):Ai(c);if(po&&c[po])return function(x){for(var A,k=[];!(A=x.next()).done;)k.push(A.value);return k}(c[po]());var f=Ri(c);return(f==N?Qu:f==z?as:wo)(c)}function Wo(c){return c?(c=Lr(c))===1/0||c===-1/0?17976931348623157e292*(c<0?-1:1):c==c?c:0:c===0?c:0}function mn(c){var f=Wo(c),x=f%1;return f==f?x?f-x:f:0}function kf(c){return c?Go(mn(c),0,4294967295):0}function Lr(c){if(typeof c=="number")return c;if(Or(c))return NaN;if(ii(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=ii(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=Hc(c);var x=I.test(c);return x||Q.test(c)?Vp(c.slice(2),x?2:8):E.test(c)?NaN:+c}function Gf(c){return ui(c,ki(c))}function bn(c){return c==null?"":gi(c)}var Oh=ni(function(c,f){if(ql(f)||mr(f))ui(f,Ci(f),c);else for(var x in f)Rn.call(f,x)&&cs(c,x,f[x])}),Ad=ni(function(c,f){ui(f,ki(f),c)}),Lh=ni(function(c,f,x,A){ui(f,ki(f),c,A)}),hv=ni(function(c,f,x,A){ui(f,Ci(f),c,A)}),Hf=bo(Gl),Rd=fn(function(c,f){c=zn(c);var x=-1,A=f.length,k=A>2?f[2]:void 0;for(k&&Qt(f[0],f[1],k)&&(A=1);++x<A;)for(var ie=f[x],pe=ki(ie),Se=-1,Be=pe.length;++Se<Be;){var tt=pe[Se],nt=c[tt];(nt===void 0||Wr(nt,Br[tt])&&!Rn.call(c,tt))&&(c[tt]=ie[tt])}return c}),da=fn(function(c){return c.push(void 0,xo),ir(el,void 0,c)});function Cd(c,f,x){var A=c==null?void 0:_o(c,f);return A===void 0?x:A}function Zl(c,f){return c!=null&&Za(c,f,Kc)}var cv=Sh(function(c,f,x){f!=null&&typeof f.toString!="function"&&(f=th.call(f)),c[f]=x},nl(ar)),dv=Sh(function(c,f,x){f!=null&&typeof f.toString!="function"&&(f=th.call(f)),Rn.call(c,f)?c[f].push(x):c[f]=[x]},Yt),Un=fn(ka);function Ci(c){return mr(c)?Uo(c):ed(c)}function ki(c){return mr(c)?Uo(c,!0):sf(c)}var Kl=ni(function(c,f,x){pn(c,f,x)}),el=ni(function(c,f,x,A){pn(c,f,x,A)}),pa=bo(function(c,f){var x={};if(c==null)return x;var A=!1;f=Vn(f,function(ie){return ie=eo(ie,c),A||(A=ie.length>1),ie}),ui(c,aa(c),x),A&&(x=Mi(x,7,$a));for(var k=f.length;k--;)ja(x,f[k]);return x}),_i=bo(function(c,f){return c==null?{}:function(x,A){return gh(x,A,function(k,ie){return Zl(x,ie)})}(c,f)});function Xo(c,f){if(c==null)return{};var x=Vn(aa(c),function(A){return[A]});return f=Yt(f),gh(c,x,function(A,k){return f(A,k[0])})}var Ql=Wl(Ci),fa=Wl(ki);function wo(c){return c==null?[]:Ku(c,Ci(c))}var tl=gs(function(c,f,x){return f=f.toLowerCase(),c+(x?ma(f):f)});function ma(c){return nu(bn(c).toLowerCase())}function ga(c){return(c=bn(c))&&c.replace(Z,Jp).replace(Gp,"")}var eu=gs(function(c,f,x){return c+(x?"-":"")+f.toLowerCase()}),zf=gs(function(c,f,x){return c+(x?" ":"")+f.toLowerCase()}),Nh=ra("toLowerCase"),tu=gs(function(c,f,x){return c+(x?"_":"")+f.toLowerCase()}),Dh=gs(function(c,f,x){return c+(x?" ":"")+nu(f)}),jf=gs(function(c,f,x){return c+(x?" ":"")+f.toUpperCase()}),nu=ra("toUpperCase");function Pd(c,f,x){return c=bn(c),(f=x?void 0:f)===void 0?function(A){return Hp.test(A)}(c)?function(A){return A.match(Io)||[]}(c):function(A){return A.match(uo)||[]}(c):c.match(f)||[]}var iu=fn(function(c,f){try{return ir(c,void 0,f)}catch(x){return Td(x)?x:new vn(x)}}),Fh=bo(function(c,f){return hr(f,function(x){x=Vr(x),mo(c,x,wd(c[x],c))}),c});function nl(c){return function(){return c}}var Vf=jo(),Wf=jo(!0);function ar(c){return c}function Bh(c){return of(typeof c=="function"?c:Mi(c,1))}var Xf=fn(function(c,f){return function(x){return ka(x,c,f)}}),pv=fn(function(c,f){return function(x){return ka(c,x,f)}});function Uh(c,f,x){var A=Ci(f),k=Kr(f,A);x!=null||ii(f)&&(k.length||!A.length)||(x=f,f=c,c=this,k=Kr(f,Ci(f)));var ie=!(ii(x)&&"chain"in x&&!x.chain),pe=no(c);return hr(k,function(Se){var Be=f[Se];c[Se]=Be,pe&&(c.prototype[Se]=function(){var tt=this.__chain__;if(ie||tt){var nt=c(this.__wrapped__),gt=nt.__actions__=Ai(this.__actions__);return gt.push({func:Be,args:arguments,thisArg:c}),nt.__chain__=tt,nt}return Be.apply(c,Lo([this.value()],arguments))})}),c}function il(){}var kh=qa(Vn),xs=qa(Fc),qf=qa(qu);function Yf(c){return At(c)?Yu(Vr(c)):function(f){return function(x){return _o(x,f)}}(c)}var Gh=jl(),$f=jl(!0);function Hh(){return[]}function rl(){return!1}var ru=Xa(function(c,f){return c+f},0),Id=Ya("ceil"),Gi=Xa(function(c,f){return c/f},1),Jf=Ya("floor"),zh,Zf=Xa(function(c,f){return c*f},1),Od=Ya("round"),jh=Xa(function(c,f){return c-f},0);return S.after=function(c,f){if(typeof f!="function")throw new dr($);return c=mn(c),function(){if(--c<1)return f.apply(this,arguments)}},S.ary=Af,S.assign=Oh,S.assignIn=Ad,S.assignInWith=Lh,S.assignWith=hv,S.at=Hf,S.before=Rf,S.bind=wd,S.bindAll=Fh,S.bindKey=Cf,S.castArray=function(){if(!arguments.length)return[];var c=arguments[0];return on(c)?c:[c]},S.chain=Tf,S.chunk=function(c,f,x){f=(x?Qt(c,f,x):f===void 0)?1:Wn(mn(f),0);var A=c==null?0:c.length;if(!A||f<1)return[];for(var k=0,ie=0,pe=Mt(sh(A/f));k<A;)pe[ie++]=li(c,k,k+=f);return pe},S.compact=function(c){for(var f=-1,x=c==null?0:c.length,A=0,k=[];++f<x;){var ie=c[f];ie&&(k[A++]=ie)}return k},S.concat=function(){var c=arguments.length;if(!c)return[];for(var f=Mt(c-1),x=arguments[0],A=c;A--;)f[A-1]=arguments[A];return Lo(on(x)?Ai(x):[x],Rt(f,1))},S.cond=function(c){var f=c==null?0:c.length,x=Yt();return c=f?Vn(c,function(A){if(typeof A[1]!="function")throw new dr($);return[x(A[0]),A[1]]}):[],fn(function(A){for(var k=-1;++k<f;){var ie=c[k];if(ir(ie[0],this,A))return ir(ie[1],this,A)}})},S.conforms=function(c){return function(f){var x=Ci(f);return function(A){return go(A,f,x)}}(Mi(c,1))},S.constant=nl,S.countBy=Zg,S.create=function(c,f){var x=hs(c);return f==null?x:rf(x,f)},S.curry=function c(f,x,A){var k=En(f,8,void 0,void 0,void 0,void 0,void 0,x=A?void 0:x);return k.placeholder=c.placeholder,k},S.curryRight=function c(f,x,A){var k=En(f,16,void 0,void 0,void 0,void 0,void 0,x=A?void 0:x);return k.placeholder=c.placeholder,k},S.debounce=Pf,S.defaults=Rd,S.defaultsDeep=da,S.defer=ov,S.delay=sv,S.difference=Ug,S.differenceBy=xf,S.differenceWith=bf,S.drop=function(c,f,x){var A=c==null?0:c.length;return A?li(c,(f=x||f===void 0?1:mn(f))<0?0:f,A):[]},S.dropRight=function(c,f,x){var A=c==null?0:c.length;return A?li(c,0,(f=A-(f=x||f===void 0?1:mn(f)))<0?0:f):[]},S.dropRightWhile=function(c,f){return c&&c.length?zl(c,Yt(f,3),!0,!0):[]},S.dropWhile=function(c,f){return c&&c.length?zl(c,Yt(f,3),!0):[]},S.fill=function(c,f,x,A){var k=c==null?0:c.length;return k?(x&&typeof x!="number"&&Qt(c,f,x)&&(x=0,A=k),function(ie,pe,Se,Be){var tt=ie.length;for((Se=mn(Se))<0&&(Se=-Se>tt?0:tt+Se),(Be=Be===void 0||Be>tt?tt:mn(Be))<0&&(Be+=tt),Be=Se>Be?0:kf(Be);Se<Be;)ie[Se++]=pe;return ie}(c,f,x,A)):[]},S.filter=function(c,f){return(on(c)?co:Ho)(c,Yt(f,3))},S.flatMap=function(c,f){return Rt(Ah(c,f),1)},S.flatMapDeep=function(c,f){return Rt(Ah(c,f),1/0)},S.flatMapDepth=function(c,f,x){return x=x===void 0?1:mn(x),Rt(Ah(c,f),x)},S.flatten=_d,S.flattenDeep=function(c){return c!=null&&c.length?Rt(c,1/0):[]},S.flattenDepth=function(c,f){return c!=null&&c.length?Rt(c,f=f===void 0?1:mn(f)):[]},S.flip=function(c){return En(c,512)},S.flow=Vf,S.flowRight=Wf,S.fromPairs=function(c){for(var f=-1,x=c==null?0:c.length,A={};++f<x;){var k=c[f];A[k[0]]=k[1]}return A},S.functions=function(c){return c==null?[]:Kr(c,Ci(c))},S.functionsIn=function(c){return c==null?[]:Kr(c,ki(c))},S.groupBy=ev,S.initial=function(c){return c!=null&&c.length?li(c,0,-1):[]},S.intersection=Ka,S.intersectionBy=sr,S.intersectionWith=Qi,S.invert=cv,S.invertBy=dv,S.invokeMap=tv,S.iteratee=Bh,S.keyBy=nv,S.keys=Ci,S.keysIn=ki,S.map=Ah,S.mapKeys=function(c,f){var x={};return f=Yt(f,3),vo(c,function(A,k,ie){mo(x,f(A,k,ie),A)}),x},S.mapValues=function(c,f){var x={};return f=Yt(f,3),vo(c,function(A,k,ie){mo(x,k,f(A,k,ie))}),x},S.matches=function(c){return af(Mi(c,1))},S.matchesProperty=function(c,f){return nd(c,Mi(f,1))},S.memoize=$l,S.merge=Kl,S.mergeWith=el,S.method=Xf,S.methodOf=pv,S.mixin=Uh,S.negate=Jl,S.nthArg=function(c){return c=mn(c),fn(function(f){return Hr(f,c)})},S.omit=pa,S.omitBy=function(c,f){return Xo(c,Jl(Yt(f)))},S.once=function(c){return Rf(2,c)},S.orderBy=function(c,f,x,A){return c==null?[]:(on(f)||(f=f==null?[]:[f]),on(x=A?void 0:x)||(x=x==null?[]:[x]),yo(c,f,x))},S.over=kh,S.overArgs=Sd,S.overEvery=xs,S.overSome=qf,S.partial=Ch,S.partialRight=If,S.partition=iv,S.pick=_i,S.pickBy=Xo,S.property=Yf,S.propertyOf=function(c){return function(f){return c==null?void 0:_o(c,f)}},S.pull=kg,S.pullAll=wf,S.pullAllBy=function(c,f,x){return c&&c.length&&f&&f.length?Qr(c,f,Yt(x,2)):c},S.pullAllWith=function(c,f,x){return c&&c.length&&f&&f.length?Qr(c,f,void 0,x):c},S.pullAt=Gg,S.range=Gh,S.rangeRight=$f,S.rearg=_s,S.reject=function(c,f){return(on(c)?co:Ho)(c,Jl(Yt(f,3)))},S.remove=function(c,f){var x=[];if(!c||!c.length)return x;var A=-1,k=[],ie=c.length;for(f=Yt(f,3);++A<ie;){var pe=c[A];f(pe,A,c)&&(x.push(pe),k.push(A))}return na(c,k),x},S.rest=function(c,f){if(typeof c!="function")throw new dr($);return fn(c,f=f===void 0?f:mn(f))},S.reverse=xd,S.sampleSize=function(c,f,x){return f=(x?Qt(c,f,x):f===void 0)?1:mn(f),(on(c)?Qs:rd)(c,f)},S.set=function(c,f,x){return c==null?c:qn(c,f,x)},S.setWith=function(c,f,x,A){return A=typeof A=="function"?A:void 0,c==null?c:qn(c,f,x,A)},S.shuffle=function(c){return(on(c)?kl:uf)(c)},S.slice=function(c,f,x){var A=c==null?0:c.length;return A?(x&&typeof x!="number"&&Qt(c,f,x)?(f=0,x=A):(f=f==null?0:mn(f),x=x===void 0?A:mn(x)),li(c,f,x)):[]},S.sortBy=rv,S.sortedUniq=function(c){return c&&c.length?yh(c):[]},S.sortedUniqBy=function(c,f){return c&&c.length?yh(c,Yt(f,2)):[]},S.split=function(c,f,x){return x&&typeof x!="number"&&Qt(c,f,x)&&(f=x=void 0),(x=x===void 0?4294967295:x>>>0)?(c=bn(c))&&(typeof f=="string"||f!=null&&!Md(f))&&!(f=gi(f))&&qs(c)?Tt(ji(c),0,x):c.split(f,x):[]},S.spread=function(c,f){if(typeof c!="function")throw new dr($);return f=f==null?0:Wn(mn(f),0),fn(function(x){var A=x[f],k=Tt(x,0,f);return A&&Lo(k,A),ir(c,this,k)})},S.tail=function(c){var f=c==null?0:c.length;return f?li(c,1,f):[]},S.take=function(c,f,x){return c&&c.length?li(c,0,(f=x||f===void 0?1:mn(f))<0?0:f):[]},S.takeRight=function(c,f,x){var A=c==null?0:c.length;return A?li(c,(f=A-(f=x||f===void 0?1:mn(f)))<0?0:f,A):[]},S.takeRightWhile=function(c,f){return c&&c.length?zl(c,Yt(f,3),!1,!0):[]},S.takeWhile=function(c,f){return c&&c.length?zl(c,Yt(f,3)):[]},S.tap=function(c,f){return f(c),c},S.throttle=function(c,f,x){var A=!0,k=!0;if(typeof c!="function")throw new dr($);return ii(x)&&(A="leading"in x?!!x.leading:A,k="trailing"in x?!!x.trailing:k),Pf(c,f,{leading:A,maxWait:f,trailing:k})},S.thru=Mh,S.toArray=Uf,S.toPairs=Ql,S.toPairsIn=fa,S.toPath=function(c){return on(c)?Vn(c,Vr):Or(c)?[c]:Ai(Eh(bn(c)))},S.toPlainObject=Gf,S.transform=function(c,f,x){var A=on(c),k=A||Vo(c)||ca(c);if(f=Yt(f,4),x==null){var ie=c&&c.constructor;x=k?A?new ie:[]:ii(c)&&no(ie)?hs(rh(c)):{}}return(k?hr:vo)(c,function(pe,Se,Be){return f(x,pe,Se,Be)}),x},S.unary=function(c){return Af(c,1)},S.union=Hg,S.unionBy=zg,S.unionWith=jg,S.uniq=function(c){return c&&c.length?Tn(c):[]},S.uniqBy=function(c,f){return c&&c.length?Tn(c,Yt(f,2)):[]},S.uniqWith=function(c,f){return f=typeof f=="function"?f:void 0,c&&c.length?Tn(c,void 0,f):[]},S.unset=function(c,f){return c==null||ja(c,f)},S.unzip=bd,S.unzipWith=Sf,S.update=function(c,f,x){return c==null?c:gn(c,f,bh(x))},S.updateWith=function(c,f,x,A){return A=typeof A=="function"?A:void 0,c==null?c:gn(c,f,bh(x),A)},S.values=wo,S.valuesIn=function(c){return c==null?[]:Ku(c,ki(c))},S.without=Vg,S.words=Pd,S.wrap=function(c,f){return Ch(bh(f),c)},S.xor=Wg,S.xorBy=Xg,S.xorWith=qg,S.zip=Yg,S.zipObject=function(c,f){return sd(c||[],f||[],cs)},S.zipObjectDeep=function(c,f){return sd(c||[],f||[],qn)},S.zipWith=$g,S.entries=Ql,S.entriesIn=fa,S.extend=Ad,S.extendWith=Lh,Uh(S,S),S.add=ru,S.attempt=iu,S.camelCase=tl,S.capitalize=ma,S.ceil=Id,S.clamp=function(c,f,x){return x===void 0&&(x=f,f=void 0),x!==void 0&&(x=(x=Lr(x))==x?x:0),f!==void 0&&(f=(f=Lr(f))==f?f:0),Go(Lr(c),f,x)},S.clone=function(c){return Mi(c,4)},S.cloneDeep=function(c){return Mi(c,5)},S.cloneDeepWith=function(c,f){return Mi(c,5,f=typeof f=="function"?f:void 0)},S.cloneWith=function(c,f){return Mi(c,4,f=typeof f=="function"?f:void 0)},S.conformsTo=function(c,f){return f==null||go(c,f,Ci(f))},S.deburr=ga,S.defaultTo=function(c,f){return c==null||c!=c?f:c},S.divide=Gi,S.endsWith=function(c,f,x){c=bn(c),f=gi(f);var A=c.length,k=x=x===void 0?A:Go(mn(x),0,A);return(x-=f.length)>=0&&c.slice(x,k)==f},S.eq=Wr,S.escape=function(c){return(c=bn(c))&&Wt.test(c)?c.replace(ln,Zp):c},S.escapeRegExp=function(c){return(c=bn(c))&&An.test(c)?c.replace(jn,"\\$&"):c},S.every=function(c,f,x){var A=on(c)?Fc:ph;return x&&Qt(c,f,x)&&(f=void 0),A(c,Yt(f,3))},S.find=Kg,S.findIndex=gd,S.findKey=function(c,f){return Bc(c,Yt(f,3),vo)},S.findLast=Qg,S.findLastIndex=vd,S.findLastKey=function(c,f){return Bc(c,Yt(f,3),Zc)},S.floor=Jf,S.forEach=Ef,S.forEachRight=Mf,S.forIn=function(c,f){return c==null?c:ps(c,Yt(f,3),ki)},S.forInRight=function(c,f){return c==null?c:Gr(c,Yt(f,3),ki)},S.forOwn=function(c,f){return c&&vo(c,Yt(f,3))},S.forOwnRight=function(c,f){return c&&Zc(c,Yt(f,3))},S.get=Cd,S.gt=av,S.gte=Of,S.has=function(c,f){return c!=null&&Za(c,f,ea)},S.hasIn=Zl,S.head=yd,S.identity=ar,S.includes=function(c,f,x,A){c=mr(c)?c:wo(c),x=x&&!A?mn(x):0;var k=c.length;return x<0&&(x=Wn(k+x,0)),Ih(c)?x<=k&&c.indexOf(f,x)>-1:!!k&&Xs(c,f,x)>-1},S.indexOf=function(c,f,x){var A=c==null?0:c.length;if(!A)return-1;var k=x==null?0:mn(x);return k<0&&(k=Wn(A+k,0)),Xs(c,f,k)},S.inRange=function(c,f,x){return f=Wo(f),x===void 0?(x=f,f=0):x=Wo(x),function(A,k,ie){return A>=wi(k,ie)&&A<Wn(k,ie)}(c=Lr(c),f,x)},S.invoke=Un,S.isArguments=ys,S.isArray=on,S.isArrayBuffer=lv,S.isArrayLike=mr,S.isArrayLikeObject=Yn,S.isBoolean=function(c){return c===!0||c===!1||ri(c)&&Zi(c)==K},S.isBuffer=Vo,S.isDate=Lf,S.isElement=function(c){return ri(c)&&c.nodeType===1&&!Qa(c)},S.isEmpty=function(c){if(c==null)return!0;if(mr(c)&&(on(c)||typeof c=="string"||typeof c.splice=="function"||Vo(c)||ca(c)||ys(c)))return!c.length;var f=Ri(c);if(f==N||f==z)return!c.size;if(ql(c))return!ed(c).length;for(var x in c)if(Rn.call(c,x))return!1;return!0},S.isEqual=function(c,f){return Rr(c,f)},S.isEqualWith=function(c,f,x){var A=(x=typeof x=="function"?x:void 0)?x(c,f):void 0;return A===void 0?Rr(c,f,void 0,x):!!A},S.isError=Td,S.isFinite=function(c){return typeof c=="number"&&Fo(c)},S.isFunction=no,S.isInteger=Nf,S.isLength=Ph,S.isMap=Df,S.isMatch=function(c,f){return c===f||Ga(c,f,dd(f))},S.isMatchWith=function(c,f,x){return x=typeof x=="function"?x:void 0,Ga(c,f,dd(f),x)},S.isNaN=function(c){return Ed(c)&&c!=+c},S.isNative=function(c){if(Fg(c))throw new vn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ha(c)},S.isNil=function(c){return c==null},S.isNull=function(c){return c===null},S.isNumber=Ed,S.isObject=ii,S.isObjectLike=ri,S.isPlainObject=Qa,S.isRegExp=Md,S.isSafeInteger=function(c){return Nf(c)&&c>=-9007199254740991&&c<=9007199254740991},S.isSet=Ff,S.isString=Ih,S.isSymbol=Or,S.isTypedArray=ca,S.isUndefined=function(c){return c===void 0},S.isWeakMap=function(c){return ri(c)&&Ri(c)==qe},S.isWeakSet=function(c){return ri(c)&&Zi(c)=="[object WeakSet]"},S.join=function(c,f){return c==null?"":Vi.call(c,f)},S.kebabCase=eu,S.last=Ir,S.lastIndexOf=function(c,f,x){var A=c==null?0:c.length;if(!A)return-1;var k=A;return x!==void 0&&(k=(k=mn(x))<0?Wn(A+k,0):wi(k,A-1)),f==f?function(ie,pe,Se){for(var Be=Se+1;Be--;)if(ie[Be]===pe)return Be;return Be}(c,f,k):Rl(c,Uc,k,!0)},S.lowerCase=zf,S.lowerFirst=Nh,S.lt=Bf,S.lte=uv,S.max=function(c){return c&&c.length?Ua(c,ar,fh):void 0},S.maxBy=function(c,f){return c&&c.length?Ua(c,Yt(f,2),fh):void 0},S.mean=function(c){return kc(c,ar)},S.meanBy=function(c,f){return kc(c,Yt(f,2))},S.min=function(c){return c&&c.length?Ua(c,ar,mh):void 0},S.minBy=function(c,f){return c&&c.length?Ua(c,Yt(f,2),mh):void 0},S.stubArray=Hh,S.stubFalse=rl,S.stubObject=function(){return{}},S.stubString=function(){return""},S.stubTrue=function(){return!0},S.multiply=Zf,S.nth=function(c,f){return c&&c.length?Hr(c,mn(f)):void 0},S.noConflict=function(){return ti._===this&&(ti._=Cg),this},S.noop=il,S.now=Rh,S.pad=function(c,f,x){c=bn(c);var A=(f=mn(f))?Do(c):0;if(!f||A>=f)return c;var k=(f-A)/2;return oa(ah(k),x)+c+oa(sh(k),x)},S.padEnd=function(c,f,x){c=bn(c);var A=(f=mn(f))?Do(c):0;return f&&A<f?c+oa(f-A,x):c},S.padStart=function(c,f,x){c=bn(c);var A=(f=mn(f))?Do(c):0;return f&&A<f?oa(f-A,x)+c:c},S.parseInt=function(c,f,x){return x||f==null?f=0:f&&(f=+f),Wi(bn(c).replace(In,""),f||0)},S.random=function(c,f,x){if(x&&typeof x!="boolean"&&Qt(c,f,x)&&(f=x=void 0),x===void 0&&(typeof f=="boolean"?(x=f,f=void 0):typeof c=="boolean"&&(x=c,c=void 0)),c===void 0&&f===void 0?(c=0,f=1):(c=Wo(c),f===void 0?(f=c,c=0):f=Wo(f)),c>f){var A=c;c=f,f=A}if(x||c%1||f%1){var k=uh();return wi(c+k*(f-c+Tr("1e-"+((k+"").length-1))),f)}return fs(c,f)},S.reduce=function(c,f,x){var A=on(c)?Xu:Gc,k=arguments.length<3;return A(c,Yt(f,4),x,k,rr)},S.reduceRight=function(c,f,x){var A=on(c)?Xp:Gc,k=arguments.length<3;return A(c,Yt(f,4),x,k,dh)},S.repeat=function(c,f,x){return f=(x?Qt(c,f,x):f===void 0)?1:mn(f),vh(bn(c),f)},S.replace=function(){var c=arguments,f=bn(c[0]);return c.length<3?f:f.replace(c[1],c[2])},S.result=function(c,f,x){var A=-1,k=(f=eo(f,c)).length;for(k||(k=1,c=void 0);++A<k;){var ie=c==null?void 0:c[Vr(f[A])];ie===void 0&&(A=k,ie=x),c=no(ie)?ie.call(c):ie}return c},S.round=Od,S.runInContext=Ue,S.sample=function(c){return(on(c)?ko:id)(c)},S.size=function(c){if(c==null)return 0;if(mr(c))return Ih(c)?Do(c):c.length;var f=Ri(c);return f==N||f==z?c.size:ed(c).length},S.snakeCase=tu,S.some=function(c,f,x){var A=on(c)?qu:_h;return x&&Qt(c,f,x)&&(f=void 0),A(c,Yt(f,3))},S.sortedIndex=function(c,f){return za(c,f)},S.sortedIndexBy=function(c,f,x){return Hl(c,f,Yt(x,2))},S.sortedIndexOf=function(c,f){var x=c==null?0:c.length;if(x){var A=za(c,f);if(A<x&&Wr(c[A],f))return A}return-1},S.sortedLastIndex=function(c,f){return za(c,f,!0)},S.sortedLastIndexBy=function(c,f,x){return Hl(c,f,Yt(x,2),!0)},S.sortedLastIndexOf=function(c,f){if(c!=null&&c.length){var x=za(c,f,!0)-1;if(Wr(c[x],f))return x}return-1},S.startCase=Dh,S.startsWith=function(c,f,x){return c=bn(c),x=x==null?0:Go(mn(x),0,c.length),f=gi(f),c.slice(x,x+f.length)==f},S.subtract=jh,S.sum=function(c){return c&&c.length?Ju(c,ar):0},S.sumBy=function(c,f){return c&&c.length?Ju(c,Yt(f,2)):0},S.template=function(c,f,x){var A=S.templateSettings;x&&Qt(c,f,x)&&(f=void 0),c=bn(c),f=Lh({},f,A,Xl);var k,ie,pe=Lh({},f.imports,A.imports,Xl),Se=Ci(pe),Be=Ku(pe,Se),tt=0,nt=f.interpolate||se,gt="__p += '",Ft=Il((f.escape||se).source+"|"+nt.source+"|"+(nt===Bt?ho:se).source+"|"+(f.evaluate||se).source+"|$","g"),kt="//# sourceURL="+(Rn.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jp+"]")+`
11
11
  `;c.replace(Ft,function(_t,Vt,Lt,jt,Kt,dn){return Lt||(Lt=jt),gt+=c.slice(tt,dn).replace(ge,Kp),Vt&&(k=!0,gt+=`' +
12
12
  __e(`+Vt+`) +
13
13
  '`),Kt&&(ie=!0,gt+=`';
@@ -24,8 +24,8 @@ __p += '`),Lt&&(gt+=`' +
24
24
  function print() { __p += __j.call(arguments, '') }
25
25
  `:`;
26
26
  `)+gt+`return __p
27
- }`;var lt=iu(function(){return ai(Se,kt+"return "+gt).apply(void 0,Be)});if(lt.source=gt,Td(lt))throw lt;return lt},S.times=function(c,f){if((c=mn(c))<1||c>9007199254740991)return[];var x=4294967295,A=wi(c,4294967295);c-=4294967295;for(var k=Zu(A,f=Yt(f));++x<c;)f(x);return k},S.toFinite=Wo,S.toInteger=mn,S.toLength=kf,S.toLower=function(c){return bn(c).toLowerCase()},S.toNumber=Lr,S.toSafeInteger=function(c){return c?Go(mn(c),-9007199254740991,9007199254740991):c===0?c:0},S.toString=bn,S.toUpper=function(c){return bn(c).toUpperCase()},S.trim=function(c,f,x){if((c=bn(c))&&(x||f===void 0))return Hc(c);if(!c||!(f=gi(f)))return c;var A=zi(c),k=zi(f);return Tt(A,zc(A,k),jc(A,k)+1).join("")},S.trimEnd=function(c,f,x){if((c=bn(c))&&(x||f===void 0))return c.slice(0,ls(c)+1);if(!c||!(f=gi(f)))return c;var A=zi(c);return Tt(A,0,jc(A,zi(f))+1).join("")},S.trimStart=function(c,f,x){if((c=bn(c))&&(x||f===void 0))return c.replace(In,"");if(!c||!(f=gi(f)))return c;var A=zi(c);return Tt(A,zc(A,zi(f))).join("")},S.truncate=function(c,f){var x=30,A="...";if(ii(f)){var k="separator"in f?f.separator:k;x="length"in f?mn(f.length):x,A="omission"in f?gi(f.omission):A}var ie=(c=bn(c)).length;if(qs(c)){var pe=zi(c);ie=pe.length}if(x>=ie)return c;var Se=x-Do(A);if(Se<1)return A;var Be=pe?Tt(pe,0,Se).join(""):c.slice(0,Se);if(k===void 0)return Be+A;if(pe&&(Se+=Be.length-Se),Md(k)){if(c.slice(Se).search(k)){var tt,nt=Be;for(k.global||(k=Il(k.source,bn(Sr.exec(k))+"g")),k.lastIndex=0;tt=k.exec(nt);)var gt=tt.index;Be=Be.slice(0,gt===void 0?Se:gt)}}else if(c.indexOf(gi(k),Se)!=Se){var Ft=Be.lastIndexOf(k);Ft>-1&&(Be=Be.slice(0,Ft))}return Be+A},S.unescape=function(c){return(c=bn(c))&&wt.test(c)?c.replace(vt,Pl):c},S.uniqueId=function(c){var f=++Ag;return bn(c)+f},S.upperCase=jf,S.upperFirst=nu,S.each=Ef,S.eachRight=Mf,S.first=yd,Uh(S,(zh={},vo(S,function(c,f){Rn.call(S.prototype,f)||(zh[f]=c)}),zh),{chain:!1}),S.VERSION="4.17.21",hr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){S[c].placeholder=S}),hr(["drop","take"],function(c,f){un.prototype[c]=function(x){x=x===void 0?1:Wn(mn(x),0);var A=this.__filtered__&&!f?new un(this):this.clone();return A.__filtered__?A.__takeCount__=wi(x,A.__takeCount__):A.__views__.push({size:wi(x,4294967295),type:c+(A.__dir__<0?"Right":"")}),A},un.prototype[c+"Right"]=function(x){return this.reverse()[c](x).reverse()}}),hr(["filter","map","takeWhile"],function(c,f){var x=f+1,A=x==1||x==3;un.prototype[c]=function(k){var ie=this.clone();return ie.__iteratees__.push({iteratee:Yt(k,3),type:x}),ie.__filtered__=ie.__filtered__||A,ie}}),hr(["head","last"],function(c,f){var x="take"+(f?"Right":"");un.prototype[c]=function(){return this[x](1).value()[0]}}),hr(["initial","tail"],function(c,f){var x="drop"+(f?"":"Right");un.prototype[c]=function(){return this.__filtered__?new un(this):this[x](1)}}),un.prototype.compact=function(){return this.filter(ar)},un.prototype.find=function(c){return this.filter(c).head()},un.prototype.findLast=function(c){return this.reverse().find(c)},un.prototype.invokeMap=fn(function(c,f){return typeof c=="function"?new un(this):this.map(function(x){return ka(x,c,f)})}),un.prototype.reject=function(c){return this.filter(Jl(Yt(c)))},un.prototype.slice=function(c,f){c=mn(c);var x=this;return x.__filtered__&&(c>0||f<0)?new un(x):(c<0?x=x.takeRight(-c):c&&(x=x.drop(c)),f!==void 0&&(x=(f=mn(f))<0?x.dropRight(-f):x.take(f-c)),x)},un.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},un.prototype.toArray=function(){return this.take(4294967295)},vo(un.prototype,function(c,f){var x=/^(?:filter|find|map|reject)|While$/.test(f),A=/^(?:head|last)$/.test(f),k=S[A?"take"+(f=="last"?"Right":""):f],ie=A||/^find/.test(f);k&&(S.prototype[f]=function(){var pe=this.__wrapped__,Se=A?[1]:arguments,Be=pe instanceof un,tt=Se[0],nt=Be||on(pe),gt=function(Vt){var Lt=k.apply(S,Lo([Vt],Se));return A&&Ft?Lt[0]:Lt};nt&&x&&typeof tt=="function"&&tt.length!=1&&(Be=nt=!1);var Ft=this.__chain__,kt=!!this.__actions__.length,$t=ie&&!Ft,lt=Be&&!kt;if(!ie&&nt){pe=lt?pe:new un(this);var _t=c.apply(pe,Se);return _t.__actions__.push({func:Mh,args:[gt],thisArg:void 0}),new Zn(_t,Ft)}return $t&&lt?c.apply(this,Se):(_t=this.thru(gt),$t?A?_t.value()[0]:_t.value():_t)})}),hr(["pop","push","shift","sort","splice","unshift"],function(c){var f=Ol[c],x=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",A=/^(?:pop|shift)$/.test(c);S.prototype[c]=function(){var k=arguments;if(A&&!this.__chain__){var ie=this.value();return f.apply(on(ie)?ie:[],k)}return this[x](function(pe){return f.apply(on(pe)?pe:[],k)})}}),vo(un.prototype,function(c,f){var x=S[f];if(x){var A=x.name+"";Rn.call(Ur,A)||(Ur[A]=[]),Ur[A].push({name:f,func:x})}}),Ur[Wa(void 0,2).name]=[{name:"wrapper",func:void 0}],un.prototype.clone=function(){var c=new un(this.__wrapped__);return c.__actions__=Ai(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Ai(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Ai(this.__views__),c},un.prototype.reverse=function(){if(this.__filtered__){var c=new un(this);c.__dir__=-1,c.__filtered__=!0}else(c=this.clone()).__dir__*=-1;return c},un.prototype.value=function(){var c=this.__wrapped__.value(),f=this.__dir__,x=on(c),A=f<0,k=x?c.length:0,ie=function(dn,zt,en){for(var hi=-1,Xi=en.length;++hi<Xi;){var ci=en[hi],oi=ci.size;switch(ci.type){case"drop":dn+=oi;break;case"dropRight":zt-=oi;break;case"take":zt=wi(zt,dn+oi);break;case"takeRight":dn=Wn(dn,zt-oi)}}return{start:dn,end:zt}}(0,k,this.__views__),pe=ie.start,Se=ie.end,Be=Se-pe,tt=A?Se:pe-1,nt=this.__iteratees__,gt=nt.length,Ft=0,kt=wi(Be,this.__takeCount__);if(!x||!A&&k==Be&&kt==Be)return od(c,this.__actions__);var $t=[];e:for(;Be--&&Ft<kt;){for(var lt=-1,_t=c[tt+=f];++lt<gt;){var Vt=nt[lt],Lt=Vt.iteratee,jt=Vt.type,Kt=Lt(_t);if(jt==2)_t=Kt;else if(!Kt){if(jt==1)continue e;break e}}$t[Ft++]=_t}return $t},S.prototype.at=Jg,S.prototype.chain=function(){return Tf(this)},S.prototype.commit=function(){return new Zn(this.value(),this.__chain__)},S.prototype.next=function(){this.__values__===void 0&&(this.__values__=Uf(this.value()));var c=this.__index__>=this.__values__.length;return{done:c,value:c?void 0:this.__values__[this.__index__++]}},S.prototype.plant=function(c){for(var f,x=this;x instanceof Ul;){var A=yf(x);A.__index__=0,A.__values__=void 0,f?k.__wrapped__=A:f=A;var k=A;x=x.__wrapped__}return k.__wrapped__=c,f},S.prototype.reverse=function(){var c=this.__wrapped__;if(c instanceof un){var f=c;return this.__actions__.length&&(f=new un(this)),(f=f.reverse()).__actions__.push({func:Mh,args:[xd],thisArg:void 0}),new Zn(f,this.__chain__)}return this.thru(xd)},S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=function(){return od(this.__wrapped__,this.__actions__)},S.prototype.first=S.prototype.head,po&&(S.prototype[po]=function(){return this}),S}();ti._=Ys,(fe=function(){return Ys}.call(R,v,R,te))===void 0||(te.exports=fe)}).call(this)}).call(this,v(4),v(8)(T))},function(T,R,v){(function(b){T.exports=function te(fe,$,L){function Y(K,xe){if(!$[K]){if(!fe[K]){if(j)return j(K,!0);var Re=new Error("Cannot find module '"+K+"'");throw Re.code="MODULE_NOT_FOUND",Re}var Ie=$[K]={exports:{}};fe[K][0].call(Ie.exports,function(M){var N=fe[K][1][M];return Y(N||M)},Ie,Ie.exports,te,fe,$,L)}return $[K].exports}for(var j=!1,F=0;F<L.length;F++)Y(L[F]);return Y}({1:[function(te,fe,$){(function(L){var Y,j,F=L.MutationObserver||L.WebKitMutationObserver;if(F){var K=0,xe=new F(N),Re=L.document.createTextNode("");xe.observe(Re,{characterData:!0}),Y=function(){Re.data=K=++K%2}}else if(L.setImmediate||L.MessageChannel===void 0)Y="document"in L&&"onreadystatechange"in L.document.createElement("script")?function(){var D=L.document.createElement("script");D.onreadystatechange=function(){N(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},L.document.documentElement.appendChild(D)}:function(){setTimeout(N,0)};else{var Ie=new L.MessageChannel;Ie.port1.onmessage=N,Y=function(){Ie.port2.postMessage(0)}}var M=[];function N(){var D,ee;j=!0;for(var C=M.length;C;){for(ee=M,M=[],D=-1;++D<C;)ee[D]();C=M.length}j=!1}fe.exports=function(D){M.push(D)!==1||j||Y()}}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(te,fe,$){var L=te(1);function Y(){}var j={},F=["REJECTED"],K=["FULFILLED"],xe=["PENDING"];function Re(C){if(typeof C!="function")throw new TypeError("resolver must be a function");this.state=xe,this.queue=[],this.outcome=void 0,C!==Y&&D(this,C)}function Ie(C,z,V){this.promise=C,typeof z=="function"&&(this.onFulfilled=z,this.callFulfilled=this.otherCallFulfilled),typeof V=="function"&&(this.onRejected=V,this.callRejected=this.otherCallRejected)}function M(C,z,V){L(function(){var ne;try{ne=z(V)}catch(qe){return j.reject(C,qe)}ne===C?j.reject(C,new TypeError("Cannot resolve promise with itself")):j.resolve(C,ne)})}function N(C){var z=C&&C.then;if(C&&(typeof C=="object"||typeof C=="function")&&typeof z=="function")return function(){z.apply(C,arguments)}}function D(C,z){var V=!1;function ne(Pe){V||(V=!0,j.reject(C,Pe))}function qe(Pe){V||(V=!0,j.resolve(C,Pe))}var ft=ee(function(){z(qe,ne)});ft.status==="error"&&ne(ft.value)}function ee(C,z){var V={};try{V.value=C(z),V.status="success"}catch(ne){V.status="error",V.value=ne}return V}fe.exports=Re,Re.prototype.catch=function(C){return this.then(null,C)},Re.prototype.then=function(C,z){if(typeof C!="function"&&this.state===K||typeof z!="function"&&this.state===F)return this;var V=new this.constructor(Y);return this.state!==xe?M(V,this.state===K?C:z,this.outcome):this.queue.push(new Ie(V,C,z)),V},Ie.prototype.callFulfilled=function(C){j.resolve(this.promise,C)},Ie.prototype.otherCallFulfilled=function(C){M(this.promise,this.onFulfilled,C)},Ie.prototype.callRejected=function(C){j.reject(this.promise,C)},Ie.prototype.otherCallRejected=function(C){M(this.promise,this.onRejected,C)},j.resolve=function(C,z){var V=ee(N,z);if(V.status==="error")return j.reject(C,V.value);var ne=V.value;if(ne)D(C,ne);else{C.state=K,C.outcome=z;for(var qe=-1,ft=C.queue.length;++qe<ft;)C.queue[qe].callFulfilled(z)}return C},j.reject=function(C,z){C.state=F,C.outcome=z;for(var V=-1,ne=C.queue.length;++V<ne;)C.queue[V].callRejected(z);return C},Re.resolve=function(C){return C instanceof this?C:j.resolve(new this(Y),C)},Re.reject=function(C){var z=new this(Y);return j.reject(z,C)},Re.all=function(C){var z=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=C.length,ne=!1;if(!V)return this.resolve([]);for(var qe=new Array(V),ft=0,Pe=-1,ae=new this(Y);++Pe<V;)Me(C[Pe],Pe);return ae;function Me(De,W){z.resolve(De).then(function(ye){qe[W]=ye,++ft!==V||ne||(ne=!0,j.resolve(ae,qe))},function(ye){ne||(ne=!0,j.reject(ae,ye))})}},Re.race=function(C){var z=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=C.length,ne=!1;if(!V)return this.resolve([]);for(var qe,ft=-1,Pe=new this(Y);++ft<V;)qe=C[ft],z.resolve(qe).then(function(ae){ne||(ne=!0,j.resolve(Pe,ae))},function(ae){ne||(ne=!0,j.reject(Pe,ae))});return Pe}},{1:1}],3:[function(te,fe,$){(function(L){typeof L.Promise!="function"&&(L.Promise=te(2))}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(te,fe,$){var L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},Y=function(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}();function j(E,I){E=E||[],I=I||{};try{return new Blob(E,I)}catch(J){if(J.name!=="TypeError")throw J;for(var O=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),Q=0;Q<E.length;Q+=1)O.append(E[Q]);return O.getBlob(I.type)}}typeof Promise=="undefined"&&te(3);var F=Promise;function K(E,I){I&&E.then(function(O){I(null,O)},function(O){I(O)})}function xe(E,I,O){typeof I=="function"&&E.then(I),typeof O=="function"&&E.catch(O)}function Re(E){return typeof E!="string"&&(console.warn(E+" used as a key, but it is not a string."),E=String(E)),E}function Ie(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var M=void 0,N={},D=Object.prototype.toString;function ee(E){return typeof M=="boolean"?F.resolve(M):function(I){return new F(function(O){var Q=I.transaction("local-forage-detect-blob-support","readwrite"),J=j([""]);Q.objectStore("local-forage-detect-blob-support").put(J,"key"),Q.onabort=function(Z){Z.preventDefault(),Z.stopPropagation(),O(!1)},Q.oncomplete=function(){var Z=navigator.userAgent.match(/Chrome\/(\d+)/),se=navigator.userAgent.match(/Edge\//);O(se||!Z||parseInt(Z[1],10)>=43)}}).catch(function(){return!1})}(E).then(function(I){return M=I})}function C(E){var I=N[E.name],O={};O.promise=new F(function(Q,J){O.resolve=Q,O.reject=J}),I.deferredOperations.push(O),I.dbReady?I.dbReady=I.dbReady.then(function(){return O.promise}):I.dbReady=O.promise}function z(E){var I=N[E.name].deferredOperations.pop();if(I)return I.resolve(),I.promise}function V(E,I){var O=N[E.name].deferredOperations.pop();if(O)return O.reject(I),O.promise}function ne(E,I){return new F(function(O,Q){if(N[E.name]=N[E.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},E.db){if(!I)return O(E.db);C(E),E.db.close()}var J=[E.name];I&&J.push(E.version);var Z=Y.open.apply(Y,J);I&&(Z.onupgradeneeded=function(se){var ge=Z.result;try{ge.createObjectStore(E.storeName),se.oldVersion<=1&&ge.createObjectStore("local-forage-detect-blob-support")}catch(be){if(be.name!=="ConstraintError")throw be;console.warn('The database "'+E.name+'" has been upgraded from version '+se.oldVersion+" to version "+se.newVersion+', but the storage "'+E.storeName+'" already exists.')}}),Z.onerror=function(se){se.preventDefault(),Q(Z.error)},Z.onsuccess=function(){O(Z.result),z(E)}})}function qe(E){return ne(E,!1)}function ft(E){return ne(E,!0)}function Pe(E,I){if(!E.db)return!0;var O=!E.db.objectStoreNames.contains(E.storeName),Q=E.version<E.db.version,J=E.version>E.db.version;if(Q&&(E.version!==I&&console.warn('The database "'+E.name+`" can't be downgraded from version `+E.db.version+" to version "+E.version+"."),E.version=E.db.version),J||O){if(O){var Z=E.db.version+1;Z>E.version&&(E.version=Z)}return!0}return!1}function ae(E){return j([function(I){for(var O=I.length,Q=new ArrayBuffer(O),J=new Uint8Array(Q),Z=0;Z<O;Z++)J[Z]=I.charCodeAt(Z);return Q}(atob(E.data))],{type:E.type})}function Me(E){return E&&E.__local_forage_encoded_blob}function De(E){var I=this,O=I._initReady().then(function(){var Q=N[I._dbInfo.name];if(Q&&Q.dbReady)return Q.dbReady});return xe(O,E,E),O}function W(E,I,O,Q){Q===void 0&&(Q=1);try{var J=E.db.transaction(E.storeName,I);O(null,J)}catch(Z){if(Q>0&&(!E.db||Z.name==="InvalidStateError"||Z.name==="NotFoundError"))return F.resolve().then(function(){if(!E.db||Z.name==="NotFoundError"&&!E.db.objectStoreNames.contains(E.storeName)&&E.version<=E.db.version)return E.db&&(E.version=E.db.version+1),ft(E)}).then(function(){return function(se){C(se);for(var ge=N[se.name],be=ge.forages,we=0;we<be.length;we++){var Fe=be[we];Fe._dbInfo.db&&(Fe._dbInfo.db.close(),Fe._dbInfo.db=null)}return se.db=null,qe(se).then(function(Ye){return se.db=Ye,Pe(se)?ft(se):Ye}).then(function(Ye){se.db=ge.db=Ye;for(var ht=0;ht<be.length;ht++)be[ht]._dbInfo.db=Ye}).catch(function(Ye){throw V(se,Ye),Ye})}(E).then(function(){W(E,I,O,Q-1)})}).catch(O);O(Z)}}var ye={_driver:"asyncStorage",_initStorage:function(E){var I=this,O={db:null};if(E)for(var Q in E)O[Q]=E[Q];var J=N[O.name];J||(J={forages:[],db:null,dbReady:null,deferredOperations:[]},N[O.name]=J),J.forages.push(I),I._initReady||(I._initReady=I.ready,I.ready=De);var Z=[];function se(){return F.resolve()}for(var ge=0;ge<J.forages.length;ge++){var be=J.forages[ge];be!==I&&Z.push(be._initReady().catch(se))}var we=J.forages.slice(0);return F.all(Z).then(function(){return O.db=J.db,qe(O)}).then(function(Fe){return O.db=Fe,Pe(O,I._defaultConfig.version)?ft(O):Fe}).then(function(Fe){O.db=J.db=Fe,I._dbInfo=O;for(var Ye=0;Ye<we.length;Ye++){var ht=we[Ye];ht!==I&&(ht._dbInfo.db=O.db,ht._dbInfo.version=O.version)}})},_support:function(){try{if(!Y||!Y.open)return!1;var E=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),I=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!E||I)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).openCursor(),we=1;be.onsuccess=function(){var Fe=be.result;if(Fe){var Ye=Fe.value;Me(Ye)&&(Ye=ae(Ye));var ht=E(Ye,Fe.key,we++);ht!==void 0?J(ht):Fe.continue()}else J()},be.onerror=function(){Z(be.error)}}catch(Fe){Z(Fe)}})}).catch(Z)});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).get(E);be.onsuccess=function(){var we=be.result;we===void 0&&(we=null),Me(we)&&(we=ae(we)),J(we)},be.onerror=function(){Z(be.error)}}catch(we){Z(we)}})}).catch(Z)});return K(Q,I),Q},setItem:function(E,I,O){var Q=this;E=Re(E);var J=new F(function(Z,se){var ge;Q.ready().then(function(){return ge=Q._dbInfo,D.call(I)==="[object Blob]"?ee(ge.db).then(function(be){return be?I:(we=I,new F(function(Fe,Ye){var ht=new FileReader;ht.onerror=Ye,ht.onloadend=function(xt){var Ot=btoa(xt.target.result||"");Fe({__local_forage_encoded_blob:!0,data:Ot,type:we.type})},ht.readAsBinaryString(we)}));var we}):I}).then(function(be){W(Q._dbInfo,"readwrite",function(we,Fe){if(we)return se(we);try{var Ye=Fe.objectStore(Q._dbInfo.storeName);be===null&&(be=void 0);var ht=Ye.put(be,E);Fe.oncomplete=function(){be===void 0&&(be=null),Z(be)},Fe.onabort=Fe.onerror=function(){var xt=ht.error?ht.error:ht.transaction.error;se(xt)}}catch(xt){se(xt)}})}).catch(se)});return K(J,O),J},removeItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readwrite",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).delete(E);ge.oncomplete=function(){J()},ge.onerror=function(){Z(be.error)},ge.onabort=function(){var we=be.error?be.error:be.transaction.error;Z(we)}}catch(we){Z(we)}})}).catch(Z)});return K(Q,I),Q},clear:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readwrite",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).clear();se.oncomplete=function(){Q()},se.onabort=se.onerror=function(){var be=ge.error?ge.error:ge.transaction.error;J(be)}}catch(be){J(be)}})}).catch(J)});return K(O,E),O},length:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readonly",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).count();ge.onsuccess=function(){Q(ge.result)},ge.onerror=function(){J(ge.error)}}catch(be){J(be)}})}).catch(J)});return K(O,E),O},key:function(E,I){var O=this,Q=new F(function(J,Z){E<0?J(null):O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName),we=!1,Fe=be.openKeyCursor();Fe.onsuccess=function(){var Ye=Fe.result;Ye?E===0||we?J(Ye.key):(we=!0,Ye.advance(E)):J(null)},Fe.onerror=function(){Z(Fe.error)}}catch(Ye){Z(Ye)}})}).catch(Z)});return K(Q,I),Q},keys:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readonly",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).openKeyCursor(),be=[];ge.onsuccess=function(){var we=ge.result;we?(be.push(we.key),we.continue()):Q(be)},ge.onerror=function(){J(ge.error)}}catch(we){J(we)}})}).catch(J)});return K(O,E),O},dropInstance:function(E,I){I=Ie.apply(this,arguments);var O=this.config();(E=typeof E!="function"&&E||{}).name||(E.name=E.name||O.name,E.storeName=E.storeName||O.storeName);var Q,J=this;if(E.name){var Z=E.name===O.name&&J._dbInfo.db,se=Z?F.resolve(J._dbInfo.db):qe(E).then(function(ge){var be=N[E.name],we=be.forages;be.db=ge;for(var Fe=0;Fe<we.length;Fe++)we[Fe]._dbInfo.db=ge;return ge});Q=E.storeName?se.then(function(ge){if(ge.objectStoreNames.contains(E.storeName)){var be=ge.version+1;C(E);var we=N[E.name],Fe=we.forages;ge.close();for(var Ye=0;Ye<Fe.length;Ye++){var ht=Fe[Ye];ht._dbInfo.db=null,ht._dbInfo.version=be}return new F(function(xt,Ot){var Gt=Y.open(E.name,be);Gt.onerror=function(fi){Gt.result.close(),Ot(fi)},Gt.onupgradeneeded=function(){Gt.result.deleteObjectStore(E.storeName)},Gt.onsuccess=function(){var fi=Gt.result;fi.close(),xt(fi)}}).then(function(xt){we.db=xt;for(var Ot=0;Ot<Fe.length;Ot++){var Gt=Fe[Ot];Gt._dbInfo.db=xt,z(Gt._dbInfo)}}).catch(function(xt){throw(V(E,xt)||F.resolve()).catch(function(){}),xt})}}):se.then(function(ge){C(E);var be=N[E.name],we=be.forages;ge.close();for(var Fe=0;Fe<we.length;Fe++)we[Fe]._dbInfo.db=null;return new F(function(Ye,ht){var xt=Y.deleteDatabase(E.name);xt.onerror=xt.onblocked=function(Ot){var Gt=xt.result;Gt&&Gt.close(),ht(Ot)},xt.onsuccess=function(){var Ot=xt.result;Ot&&Ot.close(),Ye(Ot)}}).then(function(Ye){be.db=Ye;for(var ht=0;ht<we.length;ht++)z(we[ht]._dbInfo)}).catch(function(Ye){throw(V(E,Ye)||F.resolve()).catch(function(){}),Ye})})}else Q=F.reject("Invalid arguments");return K(Q,I),Q}},Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Le=/^~~local_forage_type~([^~]+)~/,Ne=9,$e=Ne+4,Qe=Object.prototype.toString;function bt(E){var I,O,Q,J,Z,se=.75*E.length,ge=E.length,be=0;E[E.length-1]==="="&&(se--,E[E.length-2]==="="&&se--);var we=new ArrayBuffer(se),Fe=new Uint8Array(we);for(I=0;I<ge;I+=4)O=Ce.indexOf(E[I]),Q=Ce.indexOf(E[I+1]),J=Ce.indexOf(E[I+2]),Z=Ce.indexOf(E[I+3]),Fe[be++]=O<<2|Q>>4,Fe[be++]=(15&Q)<<4|J>>2,Fe[be++]=(3&J)<<6|63&Z;return we}function vt(E){var I,O=new Uint8Array(E),Q="";for(I=0;I<O.length;I+=3)Q+=Ce[O[I]>>2],Q+=Ce[(3&O[I])<<4|O[I+1]>>4],Q+=Ce[(15&O[I+1])<<2|O[I+2]>>6],Q+=Ce[63&O[I+2]];return O.length%3==2?Q=Q.substring(0,Q.length-1)+"=":O.length%3==1&&(Q=Q.substring(0,Q.length-2)+"=="),Q}var ln={serialize:function(E,I){var O="";if(E&&(O=Qe.call(E)),E&&(O==="[object ArrayBuffer]"||E.buffer&&Qe.call(E.buffer)==="[object ArrayBuffer]")){var Q,J="__lfsc__:";E instanceof ArrayBuffer?(Q=E,J+="arbf"):(Q=E.buffer,O==="[object Int8Array]"?J+="si08":O==="[object Uint8Array]"?J+="ui08":O==="[object Uint8ClampedArray]"?J+="uic8":O==="[object Int16Array]"?J+="si16":O==="[object Uint16Array]"?J+="ur16":O==="[object Int32Array]"?J+="si32":O==="[object Uint32Array]"?J+="ui32":O==="[object Float32Array]"?J+="fl32":O==="[object Float64Array]"?J+="fl64":I(new Error("Failed to get type for BinaryArray"))),I(J+vt(Q))}else if(O==="[object Blob]"){var Z=new FileReader;Z.onload=function(){var se="~~local_forage_type~"+E.type+"~"+vt(this.result);I("__lfsc__:blob"+se)},Z.readAsArrayBuffer(E)}else try{I(JSON.stringify(E))}catch(se){console.error("Couldn't convert value into a JSON string: ",E),I(null,se)}},deserialize:function(E){if(E.substring(0,Ne)!=="__lfsc__:")return JSON.parse(E);var I,O=E.substring($e),Q=E.substring(Ne,$e);if(Q==="blob"&&Le.test(O)){var J=O.match(Le);I=J[1],O=O.substring(J[0].length)}var Z=bt(O);switch(Q){case"arbf":return Z;case"blob":return j([Z],{type:I});case"si08":return new Int8Array(Z);case"ui08":return new Uint8Array(Z);case"uic8":return new Uint8ClampedArray(Z);case"si16":return new Int16Array(Z);case"ur16":return new Uint16Array(Z);case"si32":return new Int32Array(Z);case"ui32":return new Uint32Array(Z);case"fl32":return new Float32Array(Z);case"fl64":return new Float64Array(Z);default:throw new Error("Unkown type: "+Q)}},stringToBuffer:bt,bufferToString:vt};function wt(E,I,O,Q){E.executeSql("CREATE TABLE IF NOT EXISTS "+I.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],O,Q)}function Wt(E,I,O,Q,J,Z){E.executeSql(O,Q,J,function(se,ge){ge.code===ge.SYNTAX_ERR?se.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[I.storeName],function(be,we){we.rows.length?Z(be,ge):wt(be,I,function(){be.executeSql(O,Q,J,Z)},Z)},Z):Z(se,ge)},Z)}function qt(E,I,O,Q){var J=this;E=Re(E);var Z=new F(function(se,ge){J.ready().then(function(){I===void 0&&(I=null);var be=I,we=J._dbInfo;we.serializer.serialize(I,function(Fe,Ye){Ye?ge(Ye):we.db.transaction(function(ht){Wt(ht,we,"INSERT OR REPLACE INTO "+we.storeName+" (key, value) VALUES (?, ?)",[E,Fe],function(){se(be)},function(xt,Ot){ge(Ot)})},function(ht){if(ht.code===ht.QUOTA_ERR){if(Q>0)return void se(qt.apply(J,[E,be,O,Q-1]));ge(ht)}})})}).catch(ge)});return K(Z,O),Z}function rn(E){return new F(function(I,O){E.transaction(function(Q){Q.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(J,Z){for(var se=[],ge=0;ge<Z.rows.length;ge++)se.push(Z.rows.item(ge).name);I({db:E,storeNames:se})},function(J,Z){O(Z)})},function(Q){O(Q)})})}var Bt={_driver:"webSQLStorage",_initStorage:function(E){var I=this,O={db:null};if(E)for(var Q in E)O[Q]=typeof E[Q]!="string"?E[Q].toString():E[Q];var J=new F(function(Z,se){try{O.db=openDatabase(O.name,String(O.version),O.description,O.size)}catch(ge){return se(ge)}O.db.transaction(function(ge){wt(ge,O,function(){I._dbInfo=O,Z()},function(be,we){se(we)})},se)});return O.serializer=ln,J},_support:typeof openDatabase=="function",iterate:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT * FROM "+se.storeName,[],function(be,we){for(var Fe=we.rows,Ye=Fe.length,ht=0;ht<Ye;ht++){var xt=Fe.item(ht),Ot=xt.value;if(Ot&&(Ot=se.serializer.deserialize(Ot)),(Ot=E(Ot,xt.key,ht+1))!==void 0)return void J(Ot)}J()},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT * FROM "+se.storeName+" WHERE key = ? LIMIT 1",[E],function(be,we){var Fe=we.rows.length?we.rows.item(0).value:null;Fe&&(Fe=se.serializer.deserialize(Fe)),J(Fe)},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},setItem:function(E,I,O){return qt.apply(this,[E,I,O,1])},removeItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"DELETE FROM "+se.storeName+" WHERE key = ?",[E],function(){J()},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},clear:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"DELETE FROM "+Z.storeName,[],function(){Q()},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},length:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"SELECT COUNT(key) as c FROM "+Z.storeName,[],function(ge,be){var we=be.rows.item(0).c;Q(we)},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},key:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT key FROM "+se.storeName+" WHERE id = ? LIMIT 1",[E+1],function(be,we){var Fe=we.rows.length?we.rows.item(0).key:null;J(Fe)},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},keys:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"SELECT key FROM "+Z.storeName,[],function(ge,be){for(var we=[],Fe=0;Fe<be.rows.length;Fe++)we.push(be.rows.item(Fe).key);Q(we)},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},dropInstance:function(E,I){I=Ie.apply(this,arguments);var O=this.config();(E=typeof E!="function"&&E||{}).name||(E.name=E.name||O.name,E.storeName=E.storeName||O.storeName);var Q,J=this;return K(Q=E.name?new F(function(Z){var se;se=E.name===O.name?J._dbInfo.db:openDatabase(E.name,"","",0),E.storeName?Z({db:se,storeNames:[E.storeName]}):Z(rn(se))}).then(function(Z){return new F(function(se,ge){Z.db.transaction(function(be){function we(xt){return new F(function(Ot,Gt){be.executeSql("DROP TABLE IF EXISTS "+xt,[],function(){Ot()},function(fi,nr){Gt(nr)})})}for(var Fe=[],Ye=0,ht=Z.storeNames.length;Ye<ht;Ye++)Fe.push(we(Z.storeNames[Ye]));F.all(Fe).then(function(){se()}).catch(function(xt){ge(xt)})},function(be){ge(be)})})}):F.reject("Invalid arguments"),I),Q}};function Dn(E,I){var O=E.name+"/";return E.storeName!==I.storeName&&(O+=E.storeName+"/"),O}function Fn(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var Mn={_driver:"localStorageWrapper",_initStorage:function(E){var I={};if(E)for(var O in E)I[O]=E[O];return I.keyPrefix=Dn(E,this._defaultConfig),Fn()?(this._dbInfo=I,I.serializer=ln,F.resolve()):F.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(E,I){var O=this,Q=O.ready().then(function(){for(var J=O._dbInfo,Z=J.keyPrefix,se=Z.length,ge=localStorage.length,be=1,we=0;we<ge;we++){var Fe=localStorage.key(we);if(Fe.indexOf(Z)===0){var Ye=localStorage.getItem(Fe);if(Ye&&(Ye=J.serializer.deserialize(Ye)),(Ye=E(Ye,Fe.substring(se),be++))!==void 0)return Ye}}});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=O.ready().then(function(){var J=O._dbInfo,Z=localStorage.getItem(J.keyPrefix+E);return Z&&(Z=J.serializer.deserialize(Z)),Z});return K(Q,I),Q},setItem:function(E,I,O){var Q=this;E=Re(E);var J=Q.ready().then(function(){I===void 0&&(I=null);var Z=I;return new F(function(se,ge){var be=Q._dbInfo;be.serializer.serialize(I,function(we,Fe){if(Fe)ge(Fe);else try{localStorage.setItem(be.keyPrefix+E,we),se(Z)}catch(Ye){Ye.name!=="QuotaExceededError"&&Ye.name!=="NS_ERROR_DOM_QUOTA_REACHED"||ge(Ye),ge(Ye)}})})});return K(J,O),J},removeItem:function(E,I){var O=this;E=Re(E);var Q=O.ready().then(function(){var J=O._dbInfo;localStorage.removeItem(J.keyPrefix+E)});return K(Q,I),Q},clear:function(E){var I=this,O=I.ready().then(function(){for(var Q=I._dbInfo.keyPrefix,J=localStorage.length-1;J>=0;J--){var Z=localStorage.key(J);Z.indexOf(Q)===0&&localStorage.removeItem(Z)}});return K(O,E),O},length:function(E){var I=this.keys().then(function(O){return O.length});return K(I,E),I},key:function(E,I){var O=this,Q=O.ready().then(function(){var J,Z=O._dbInfo;try{J=localStorage.key(E)}catch{J=null}return J&&(J=J.substring(Z.keyPrefix.length)),J});return K(Q,I),Q},keys:function(E){var I=this,O=I.ready().then(function(){for(var Q=I._dbInfo,J=localStorage.length,Z=[],se=0;se<J;se++){var ge=localStorage.key(se);ge.indexOf(Q.keyPrefix)===0&&Z.push(ge.substring(Q.keyPrefix.length))}return Z});return K(O,E),O},dropInstance:function(E,I){if(I=Ie.apply(this,arguments),!(E=typeof E!="function"&&E||{}).name){var O=this.config();E.name=E.name||O.name,E.storeName=E.storeName||O.storeName}var Q,J=this;return K(Q=E.name?new F(function(Z){E.storeName?Z(Dn(E,J._defaultConfig)):Z(E.name+"/")}).then(function(Z){for(var se=localStorage.length-1;se>=0;se--){var ge=localStorage.key(se);ge.indexOf(Z)===0&&localStorage.removeItem(ge)}}):F.reject("Invalid arguments"),I),Q}},jn=function(E,I){for(var O,Q,J=E.length,Z=0;Z<J;){if((O=E[Z])===(Q=I)||typeof O=="number"&&typeof Q=="number"&&isNaN(O)&&isNaN(Q))return!0;Z++}return!1},An=Array.isArray||function(E){return Object.prototype.toString.call(E)==="[object Array]"},In={},di={},Ln={INDEXEDDB:ye,WEBSQL:Bt,LOCALSTORAGE:Mn},Di=[Ln.INDEXEDDB._driver,Ln.WEBSQL._driver,Ln.LOCALSTORAGE._driver],pi=["dropInstance"],uo=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pi),Co={description:"",driver:Di.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Oa(E,I){E[I]=function(){var O=arguments;return E.ready().then(function(){return E[I].apply(E,O)})}}function ho(){for(var E=1;E<arguments.length;E++){var I=arguments[E];if(I)for(var O in I)I.hasOwnProperty(O)&&(An(I[O])?arguments[0][O]=I[O].slice():arguments[0][O]=I[O])}return arguments[0]}var Sr=new(function(){function E(I){for(var O in function(Z,se){if(!(Z instanceof se))throw new TypeError("Cannot call a class as a function")}(this,E),Ln)if(Ln.hasOwnProperty(O)){var Q=Ln[O],J=Q._driver;this[O]=J,In[J]||this.defineDriver(Q)}this._defaultConfig=ho({},Co),this._config=ho({},this._defaultConfig,I),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return E.prototype.config=function(I){if((I===void 0?"undefined":L(I))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var O in I){if(O==="storeName"&&(I[O]=I[O].replace(/\W/g,"_")),O==="version"&&typeof I[O]!="number")return new Error("Database version must be a number.");this._config[O]=I[O]}return!("driver"in I)||!I.driver||this.setDriver(this._config.driver)}return typeof I=="string"?this._config[I]:this._config},E.prototype.defineDriver=function(I,O,Q){var J=new F(function(Z,se){try{var ge=I._driver,be=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!I._driver)return void se(be);for(var we=uo.concat("_initStorage"),Fe=0,Ye=we.length;Fe<Ye;Fe++){var ht=we[Fe];if((!jn(pi,ht)||I[ht])&&typeof I[ht]!="function")return void se(be)}(function(){for(var Ot=function(Po){return function(){var Hs=new Error("Method "+Po+" is not implemented by the current driver"),Gn=F.reject(Hs);return K(Gn,arguments[arguments.length-1]),Gn}},Gt=0,fi=pi.length;Gt<fi;Gt++){var nr=pi[Gt];I[nr]||(I[nr]=Ot(nr))}})();var xt=function(Ot){In[ge]&&console.info("Redefining LocalForage driver: "+ge),In[ge]=I,di[ge]=Ot,Z()};"_support"in I?I._support&&typeof I._support=="function"?I._support().then(xt,se):xt(!!I._support):xt(!0)}catch(Ot){se(Ot)}});return xe(J,O,Q),J},E.prototype.driver=function(){return this._driver||null},E.prototype.getDriver=function(I,O,Q){var J=In[I]?F.resolve(In[I]):F.reject(new Error("Driver not found."));return xe(J,O,Q),J},E.prototype.getSerializer=function(I){var O=F.resolve(ln);return xe(O,I),O},E.prototype.ready=function(I){var O=this,Q=O._driverSet.then(function(){return O._ready===null&&(O._ready=O._initDriver()),O._ready});return xe(Q,I,I),Q},E.prototype.setDriver=function(I,O,Q){var J=this;An(I)||(I=[I]);var Z=this._getSupportedDrivers(I);function se(){J._config.driver=J.driver()}function ge(we){return J._extend(we),se(),J._ready=J._initStorage(J._config),J._ready}var be=this._driverSet!==null?this._driverSet.catch(function(){return F.resolve()}):F.resolve();return this._driverSet=be.then(function(){var we=Z[0];return J._dbInfo=null,J._ready=null,J.getDriver(we).then(function(Fe){J._driver=Fe._driver,se(),J._wrapLibraryMethodsWithReady(),J._initDriver=function(Ye){return function(){var ht=0;return function xt(){for(;ht<Ye.length;){var Ot=Ye[ht];return ht++,J._dbInfo=null,J._ready=null,J.getDriver(Ot).then(ge).catch(xt)}se();var Gt=new Error("No available storage method found.");return J._driverSet=F.reject(Gt),J._driverSet}()}}(Z)})}).catch(function(){se();var we=new Error("No available storage method found.");return J._driverSet=F.reject(we),J._driverSet}),xe(this._driverSet,O,Q),this._driverSet},E.prototype.supports=function(I){return!!di[I]},E.prototype._extend=function(I){ho(this,I)},E.prototype._getSupportedDrivers=function(I){for(var O=[],Q=0,J=I.length;Q<J;Q++){var Z=I[Q];this.supports(Z)&&O.push(Z)}return O},E.prototype._wrapLibraryMethodsWithReady=function(){for(var I=0,O=uo.length;I<O;I++)Oa(this,uo[I])},E.prototype.createInstance=function(I){return new E(I)},E}());fe.exports=Sr},{3:3}]},{},[4])(4)}).call(this,v(4))},function(T,R,v){var b;(function(te){function fe(C,z){var V=(65535&C)+(65535&z);return(C>>16)+(z>>16)+(V>>16)<<16|65535&V}function $(C,z,V,ne,qe,ft){return fe((Pe=fe(fe(z,C),fe(ne,ft)))<<(ae=qe)|Pe>>>32-ae,V);var Pe,ae}function L(C,z,V,ne,qe,ft,Pe){return $(z&V|~z&ne,C,z,qe,ft,Pe)}function Y(C,z,V,ne,qe,ft,Pe){return $(z&ne|V&~ne,C,z,qe,ft,Pe)}function j(C,z,V,ne,qe,ft,Pe){return $(z^V^ne,C,z,qe,ft,Pe)}function F(C,z,V,ne,qe,ft,Pe){return $(V^(z|~ne),C,z,qe,ft,Pe)}function K(C,z){var V,ne,qe,ft,Pe;C[z>>5]|=128<<z%32,C[14+(z+64>>>9<<4)]=z;var ae=1732584193,Me=-271733879,De=-1732584194,W=271733878;for(V=0;V<C.length;V+=16)ne=ae,qe=Me,ft=De,Pe=W,ae=L(ae,Me,De,W,C[V],7,-680876936),W=L(W,ae,Me,De,C[V+1],12,-389564586),De=L(De,W,ae,Me,C[V+2],17,606105819),Me=L(Me,De,W,ae,C[V+3],22,-1044525330),ae=L(ae,Me,De,W,C[V+4],7,-176418897),W=L(W,ae,Me,De,C[V+5],12,1200080426),De=L(De,W,ae,Me,C[V+6],17,-1473231341),Me=L(Me,De,W,ae,C[V+7],22,-45705983),ae=L(ae,Me,De,W,C[V+8],7,1770035416),W=L(W,ae,Me,De,C[V+9],12,-1958414417),De=L(De,W,ae,Me,C[V+10],17,-42063),Me=L(Me,De,W,ae,C[V+11],22,-1990404162),ae=L(ae,Me,De,W,C[V+12],7,1804603682),W=L(W,ae,Me,De,C[V+13],12,-40341101),De=L(De,W,ae,Me,C[V+14],17,-1502002290),ae=Y(ae,Me=L(Me,De,W,ae,C[V+15],22,1236535329),De,W,C[V+1],5,-165796510),W=Y(W,ae,Me,De,C[V+6],9,-1069501632),De=Y(De,W,ae,Me,C[V+11],14,643717713),Me=Y(Me,De,W,ae,C[V],20,-373897302),ae=Y(ae,Me,De,W,C[V+5],5,-701558691),W=Y(W,ae,Me,De,C[V+10],9,38016083),De=Y(De,W,ae,Me,C[V+15],14,-660478335),Me=Y(Me,De,W,ae,C[V+4],20,-405537848),ae=Y(ae,Me,De,W,C[V+9],5,568446438),W=Y(W,ae,Me,De,C[V+14],9,-1019803690),De=Y(De,W,ae,Me,C[V+3],14,-187363961),Me=Y(Me,De,W,ae,C[V+8],20,1163531501),ae=Y(ae,Me,De,W,C[V+13],5,-1444681467),W=Y(W,ae,Me,De,C[V+2],9,-51403784),De=Y(De,W,ae,Me,C[V+7],14,1735328473),ae=j(ae,Me=Y(Me,De,W,ae,C[V+12],20,-1926607734),De,W,C[V+5],4,-378558),W=j(W,ae,Me,De,C[V+8],11,-2022574463),De=j(De,W,ae,Me,C[V+11],16,1839030562),Me=j(Me,De,W,ae,C[V+14],23,-35309556),ae=j(ae,Me,De,W,C[V+1],4,-1530992060),W=j(W,ae,Me,De,C[V+4],11,1272893353),De=j(De,W,ae,Me,C[V+7],16,-155497632),Me=j(Me,De,W,ae,C[V+10],23,-1094730640),ae=j(ae,Me,De,W,C[V+13],4,681279174),W=j(W,ae,Me,De,C[V],11,-358537222),De=j(De,W,ae,Me,C[V+3],16,-722521979),Me=j(Me,De,W,ae,C[V+6],23,76029189),ae=j(ae,Me,De,W,C[V+9],4,-640364487),W=j(W,ae,Me,De,C[V+12],11,-421815835),De=j(De,W,ae,Me,C[V+15],16,530742520),ae=F(ae,Me=j(Me,De,W,ae,C[V+2],23,-995338651),De,W,C[V],6,-198630844),W=F(W,ae,Me,De,C[V+7],10,1126891415),De=F(De,W,ae,Me,C[V+14],15,-1416354905),Me=F(Me,De,W,ae,C[V+5],21,-57434055),ae=F(ae,Me,De,W,C[V+12],6,1700485571),W=F(W,ae,Me,De,C[V+3],10,-1894986606),De=F(De,W,ae,Me,C[V+10],15,-1051523),Me=F(Me,De,W,ae,C[V+1],21,-2054922799),ae=F(ae,Me,De,W,C[V+8],6,1873313359),W=F(W,ae,Me,De,C[V+15],10,-30611744),De=F(De,W,ae,Me,C[V+6],15,-1560198380),Me=F(Me,De,W,ae,C[V+13],21,1309151649),ae=F(ae,Me,De,W,C[V+4],6,-145523070),W=F(W,ae,Me,De,C[V+11],10,-1120210379),De=F(De,W,ae,Me,C[V+2],15,718787259),Me=F(Me,De,W,ae,C[V+9],21,-343485551),ae=fe(ae,ne),Me=fe(Me,qe),De=fe(De,ft),W=fe(W,Pe);return[ae,Me,De,W]}function xe(C){var z,V="",ne=32*C.length;for(z=0;z<ne;z+=8)V+=String.fromCharCode(C[z>>5]>>>z%32&255);return V}function Re(C){var z,V=[];for(V[(C.length>>2)-1]=void 0,z=0;z<V.length;z+=1)V[z]=0;var ne=8*C.length;for(z=0;z<ne;z+=8)V[z>>5]|=(255&C.charCodeAt(z/8))<<z%32;return V}function Ie(C){var z,V,ne="";for(V=0;V<C.length;V+=1)z=C.charCodeAt(V),ne+="0123456789abcdef".charAt(z>>>4&15)+"0123456789abcdef".charAt(15&z);return ne}function M(C){return unescape(encodeURIComponent(C))}function N(C){return function(z){return xe(K(Re(z),8*z.length))}(M(C))}function D(C,z){return function(V,ne){var qe,ft,Pe=Re(V),ae=[],Me=[];for(ae[15]=Me[15]=void 0,Pe.length>16&&(Pe=K(Pe,8*V.length)),qe=0;qe<16;qe+=1)ae[qe]=909522486^Pe[qe],Me[qe]=1549556828^Pe[qe];return ft=K(ae.concat(Re(ne)),512+8*ne.length),xe(K(Me.concat(ft),640))}(M(C),M(z))}function ee(C,z,V){return z?V?D(z,C):Ie(D(z,C)):V?N(C):Ie(N(C))}(b=function(){return ee}.call(R,v,R,T))===void 0||(T.exports=b)})()},function(T,R){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}T.exports=v},function(T,R,v){var b=v(58),te=v(59);function fe(){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}R.parse=C,R.resolve=function(z,V){return C(z,!1,!0).resolve(V)},R.resolveObject=function(z,V){return z?C(z,!1,!0).resolveObject(V):V},R.format=function(z){return te.isString(z)&&(z=C(z)),z instanceof fe?z.format():fe.prototype.format.call(z)},R.Url=fe;var $=/^([a-z0-9.+-]+:)/i,L=/:[0-9]*$/,Y=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,j=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
28
- `," "]),F=["'"].concat(j),K=["%","/","?",";","#"].concat(F),xe=["/","?","#"],Re=/^[+a-z0-9A-Z_-]{0,63}$/,Ie=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},N={javascript:!0,"javascript:":!0},D={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ee=v(60);function C(z,V,ne){if(z&&te.isObject(z)&&z instanceof fe)return z;var qe=new fe;return qe.parse(z,V,ne),qe}fe.prototype.parse=function(z,V,ne){if(!te.isString(z))throw new TypeError("Parameter 'url' must be a string, not "+typeof z);var qe=z.indexOf("?"),ft=qe!==-1&&qe<z.indexOf("#")?"?":"#",Pe=z.split(ft);Pe[0]=Pe[0].replace(/\\/g,"/");var ae=z=Pe.join(ft);if(ae=ae.trim(),!ne&&z.split("#").length===1){var Me=Y.exec(ae);if(Me)return this.path=ae,this.href=ae,this.pathname=Me[1],Me[2]?(this.search=Me[2],this.query=V?ee.parse(this.search.substr(1)):this.search.substr(1)):V&&(this.search="",this.query={}),this}var De=$.exec(ae);if(De){var W=(De=De[0]).toLowerCase();this.protocol=W,ae=ae.substr(De.length)}if(ne||De||ae.match(/^\/\/[^@\/]+@[^@\/]+/)){var ye=ae.substr(0,2)==="//";!ye||De&&N[De]||(ae=ae.substr(2),this.slashes=!0)}if(!N[De]&&(ye||De&&!D[De])){for(var Ce,Le,Ne=-1,$e=0;$e<xe.length;$e++)(Qe=ae.indexOf(xe[$e]))!==-1&&(Ne===-1||Qe<Ne)&&(Ne=Qe);for((Le=Ne===-1?ae.lastIndexOf("@"):ae.lastIndexOf("@",Ne))!==-1&&(Ce=ae.slice(0,Le),ae=ae.slice(Le+1),this.auth=decodeURIComponent(Ce)),Ne=-1,$e=0;$e<K.length;$e++){var Qe;(Qe=ae.indexOf(K[$e]))!==-1&&(Ne===-1||Qe<Ne)&&(Ne=Qe)}Ne===-1&&(Ne=ae.length),this.host=ae.slice(0,Ne),ae=ae.slice(Ne),this.parseHost(),this.hostname=this.hostname||"";var bt=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!bt)for(var vt=this.hostname.split(/\./),ln=($e=0,vt.length);$e<ln;$e++){var wt=vt[$e];if(wt&&!wt.match(Re)){for(var Wt="",qt=0,rn=wt.length;qt<rn;qt++)wt.charCodeAt(qt)>127?Wt+="x":Wt+=wt[qt];if(!Wt.match(Re)){var Bt=vt.slice(0,$e),Dn=vt.slice($e+1),Fn=wt.match(Ie);Fn&&(Bt.push(Fn[1]),Dn.unshift(Fn[2])),Dn.length&&(ae="/"+Dn.join(".")+ae),this.hostname=Bt.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),bt||(this.hostname=b.toASCII(this.hostname));var Mn=this.port?":"+this.port:"",jn=this.hostname||"";this.host=jn+Mn,this.href+=this.host,bt&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ae[0]!=="/"&&(ae="/"+ae))}if(!M[W])for($e=0,ln=F.length;$e<ln;$e++){var An=F[$e];if(ae.indexOf(An)!==-1){var In=encodeURIComponent(An);In===An&&(In=escape(An)),ae=ae.split(An).join(In)}}var di=ae.indexOf("#");di!==-1&&(this.hash=ae.substr(di),ae=ae.slice(0,di));var Ln=ae.indexOf("?");if(Ln!==-1?(this.search=ae.substr(Ln),this.query=ae.substr(Ln+1),V&&(this.query=ee.parse(this.query)),ae=ae.slice(0,Ln)):V&&(this.search="",this.query={}),ae&&(this.pathname=ae),D[W]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Mn=this.pathname||"";var Di=this.search||"";this.path=Mn+Di}return this.href=this.format(),this},fe.prototype.format=function(){var z=this.auth||"";z&&(z=(z=encodeURIComponent(z)).replace(/%3A/i,":"),z+="@");var V=this.protocol||"",ne=this.pathname||"",qe=this.hash||"",ft=!1,Pe="";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&&te.isObject(this.query)&&Object.keys(this.query).length&&(Pe=ee.stringify(this.query));var ae=this.search||Pe&&"?"+Pe||"";return V&&V.substr(-1)!==":"&&(V+=":"),this.slashes||(!V||D[V])&&ft!==!1?(ft="//"+(ft||""),ne&&ne.charAt(0)!=="/"&&(ne="/"+ne)):ft||(ft=""),qe&&qe.charAt(0)!=="#"&&(qe="#"+qe),ae&&ae.charAt(0)!=="?"&&(ae="?"+ae),V+ft+(ne=ne.replace(/[?#]/g,function(Me){return encodeURIComponent(Me)}))+(ae=ae.replace("#","%23"))+qe},fe.prototype.resolve=function(z){return this.resolveObject(C(z,!1,!0)).format()},fe.prototype.resolveObject=function(z){if(te.isString(z)){var V=new fe;V.parse(z,!1,!0),z=V}for(var ne=new fe,qe=Object.keys(this),ft=0;ft<qe.length;ft++){var Pe=qe[ft];ne[Pe]=this[Pe]}if(ne.hash=z.hash,z.href==="")return ne.href=ne.format(),ne;if(z.slashes&&!z.protocol){for(var ae=Object.keys(z),Me=0;Me<ae.length;Me++){var De=ae[Me];De!=="protocol"&&(ne[De]=z[De])}return D[ne.protocol]&&ne.hostname&&!ne.pathname&&(ne.path=ne.pathname="/"),ne.href=ne.format(),ne}if(z.protocol&&z.protocol!==ne.protocol){if(!D[z.protocol]){for(var W=Object.keys(z),ye=0;ye<W.length;ye++){var Ce=W[ye];ne[Ce]=z[Ce]}return ne.href=ne.format(),ne}if(ne.protocol=z.protocol,z.host||N[z.protocol])ne.pathname=z.pathname;else{for(var Le=(z.pathname||"").split("/");Le.length&&!(z.host=Le.shift()););z.host||(z.host=""),z.hostname||(z.hostname=""),Le[0]!==""&&Le.unshift(""),Le.length<2&&Le.unshift(""),ne.pathname=Le.join("/")}if(ne.search=z.search,ne.query=z.query,ne.host=z.host||"",ne.auth=z.auth,ne.hostname=z.hostname||z.host,ne.port=z.port,ne.pathname||ne.search){var Ne=ne.pathname||"",$e=ne.search||"";ne.path=Ne+$e}return ne.slashes=ne.slashes||z.slashes,ne.href=ne.format(),ne}var Qe=ne.pathname&&ne.pathname.charAt(0)==="/",bt=z.host||z.pathname&&z.pathname.charAt(0)==="/",vt=bt||Qe||ne.host&&z.pathname,ln=vt,wt=ne.pathname&&ne.pathname.split("/")||[],Wt=(Le=z.pathname&&z.pathname.split("/")||[],ne.protocol&&!D[ne.protocol]);if(Wt&&(ne.hostname="",ne.port=null,ne.host&&(wt[0]===""?wt[0]=ne.host:wt.unshift(ne.host)),ne.host="",z.protocol&&(z.hostname=null,z.port=null,z.host&&(Le[0]===""?Le[0]=z.host:Le.unshift(z.host)),z.host=null),vt=vt&&(Le[0]===""||wt[0]==="")),bt)ne.host=z.host||z.host===""?z.host:ne.host,ne.hostname=z.hostname||z.hostname===""?z.hostname:ne.hostname,ne.search=z.search,ne.query=z.query,wt=Le;else if(Le.length)wt||(wt=[]),wt.pop(),wt=wt.concat(Le),ne.search=z.search,ne.query=z.query;else if(!te.isNullOrUndefined(z.search))return Wt&&(ne.hostname=ne.host=wt.shift(),(Fn=!!(ne.host&&ne.host.indexOf("@")>0)&&ne.host.split("@"))&&(ne.auth=Fn.shift(),ne.host=ne.hostname=Fn.shift())),ne.search=z.search,ne.query=z.query,te.isNull(ne.pathname)&&te.isNull(ne.search)||(ne.path=(ne.pathname?ne.pathname:"")+(ne.search?ne.search:"")),ne.href=ne.format(),ne;if(!wt.length)return ne.pathname=null,ne.search?ne.path="/"+ne.search:ne.path=null,ne.href=ne.format(),ne;for(var qt=wt.slice(-1)[0],rn=(ne.host||z.host||wt.length>1)&&(qt==="."||qt==="..")||qt==="",Bt=0,Dn=wt.length;Dn>=0;Dn--)(qt=wt[Dn])==="."?wt.splice(Dn,1):qt===".."?(wt.splice(Dn,1),Bt++):Bt&&(wt.splice(Dn,1),Bt--);if(!vt&&!ln)for(;Bt--;Bt)wt.unshift("..");!vt||wt[0]===""||wt[0]&&wt[0].charAt(0)==="/"||wt.unshift(""),rn&&wt.join("/").substr(-1)!=="/"&&wt.push("");var Fn,Mn=wt[0]===""||wt[0]&&wt[0].charAt(0)==="/";return Wt&&(ne.hostname=ne.host=Mn?"":wt.length?wt.shift():"",(Fn=!!(ne.host&&ne.host.indexOf("@")>0)&&ne.host.split("@"))&&(ne.auth=Fn.shift(),ne.host=ne.hostname=Fn.shift())),(vt=vt||ne.host&&wt.length)&&!Mn&&wt.unshift(""),wt.length?ne.pathname=wt.join("/"):(ne.pathname=null,ne.path=null),te.isNull(ne.pathname)&&te.isNull(ne.search)||(ne.path=(ne.pathname?ne.pathname:"")+(ne.search?ne.search:"")),ne.auth=z.auth||ne.auth,ne.slashes=ne.slashes||z.slashes,ne.href=ne.format(),ne},fe.prototype.parseHost=function(){var z=this.host,V=L.exec(z);V&&((V=V[0])!==":"&&(this.port=V.substr(1)),z=z.substr(0,z.length-V.length)),z&&(this.hostname=z)}},function(T,R,v){(function(b){T.exports=function te(fe,$,L){function Y(K,xe){if(!$[K]){if(!fe[K]){if(j)return j(K,!0);var Re=new Error("Cannot find module '"+K+"'");throw Re.code="MODULE_NOT_FOUND",Re}var Ie=$[K]={exports:{}};fe[K][0].call(Ie.exports,function(M){var N=fe[K][1][M];return Y(N||M)},Ie,Ie.exports,te,fe,$,L)}return $[K].exports}for(var j=!1,F=0;F<L.length;F++)Y(L[F]);return Y}({1:[function(te,fe,$){(function(L){var Y,j,F=L.MutationObserver||L.WebKitMutationObserver;if(F){var K=0,xe=new F(N),Re=L.document.createTextNode("");xe.observe(Re,{characterData:!0}),Y=function(){Re.data=K=++K%2}}else if(L.setImmediate||L.MessageChannel===void 0)Y="document"in L&&"onreadystatechange"in L.document.createElement("script")?function(){var D=L.document.createElement("script");D.onreadystatechange=function(){N(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},L.document.documentElement.appendChild(D)}:function(){setTimeout(N,0)};else{var Ie=new L.MessageChannel;Ie.port1.onmessage=N,Y=function(){Ie.port2.postMessage(0)}}var M=[];function N(){var D,ee;j=!0;for(var C=M.length;C;){for(ee=M,M=[],D=-1;++D<C;)ee[D]();C=M.length}j=!1}fe.exports=function(D){M.push(D)!==1||j||Y()}}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(te,fe,$){var L=te(1);function Y(){}var j={},F=["REJECTED"],K=["FULFILLED"],xe=["PENDING"];function Re(C){if(typeof C!="function")throw new TypeError("resolver must be a function");this.state=xe,this.queue=[],this.outcome=void 0,C!==Y&&D(this,C)}function Ie(C,z,V){this.promise=C,typeof z=="function"&&(this.onFulfilled=z,this.callFulfilled=this.otherCallFulfilled),typeof V=="function"&&(this.onRejected=V,this.callRejected=this.otherCallRejected)}function M(C,z,V){L(function(){var ne;try{ne=z(V)}catch(qe){return j.reject(C,qe)}ne===C?j.reject(C,new TypeError("Cannot resolve promise with itself")):j.resolve(C,ne)})}function N(C){var z=C&&C.then;if(C&&(typeof C=="object"||typeof C=="function")&&typeof z=="function")return function(){z.apply(C,arguments)}}function D(C,z){var V=!1;function ne(Pe){V||(V=!0,j.reject(C,Pe))}function qe(Pe){V||(V=!0,j.resolve(C,Pe))}var ft=ee(function(){z(qe,ne)});ft.status==="error"&&ne(ft.value)}function ee(C,z){var V={};try{V.value=C(z),V.status="success"}catch(ne){V.status="error",V.value=ne}return V}fe.exports=Re,Re.prototype.catch=function(C){return this.then(null,C)},Re.prototype.then=function(C,z){if(typeof C!="function"&&this.state===K||typeof z!="function"&&this.state===F)return this;var V=new this.constructor(Y);return this.state!==xe?M(V,this.state===K?C:z,this.outcome):this.queue.push(new Ie(V,C,z)),V},Ie.prototype.callFulfilled=function(C){j.resolve(this.promise,C)},Ie.prototype.otherCallFulfilled=function(C){M(this.promise,this.onFulfilled,C)},Ie.prototype.callRejected=function(C){j.reject(this.promise,C)},Ie.prototype.otherCallRejected=function(C){M(this.promise,this.onRejected,C)},j.resolve=function(C,z){var V=ee(N,z);if(V.status==="error")return j.reject(C,V.value);var ne=V.value;if(ne)D(C,ne);else{C.state=K,C.outcome=z;for(var qe=-1,ft=C.queue.length;++qe<ft;)C.queue[qe].callFulfilled(z)}return C},j.reject=function(C,z){C.state=F,C.outcome=z;for(var V=-1,ne=C.queue.length;++V<ne;)C.queue[V].callRejected(z);return C},Re.resolve=function(C){return C instanceof this?C:j.resolve(new this(Y),C)},Re.reject=function(C){var z=new this(Y);return j.reject(z,C)},Re.all=function(C){var z=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=C.length,ne=!1;if(!V)return this.resolve([]);for(var qe=new Array(V),ft=0,Pe=-1,ae=new this(Y);++Pe<V;)Me(C[Pe],Pe);return ae;function Me(De,W){z.resolve(De).then(function(ye){qe[W]=ye,++ft!==V||ne||(ne=!0,j.resolve(ae,qe))},function(ye){ne||(ne=!0,j.reject(ae,ye))})}},Re.race=function(C){var z=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=C.length,ne=!1;if(!V)return this.resolve([]);for(var qe,ft=-1,Pe=new this(Y);++ft<V;)qe=C[ft],z.resolve(qe).then(function(ae){ne||(ne=!0,j.resolve(Pe,ae))},function(ae){ne||(ne=!0,j.reject(Pe,ae))});return Pe}},{1:1}],3:[function(te,fe,$){(function(L){typeof L.Promise!="function"&&(L.Promise=te(2))}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(te,fe,$){var L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},Y=function(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}();function j(E,I){E=E||[],I=I||{};try{return new Blob(E,I)}catch(J){if(J.name!=="TypeError")throw J;for(var O=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),Q=0;Q<E.length;Q+=1)O.append(E[Q]);return O.getBlob(I.type)}}typeof Promise=="undefined"&&te(3);var F=Promise;function K(E,I){I&&E.then(function(O){I(null,O)},function(O){I(O)})}function xe(E,I,O){typeof I=="function"&&E.then(I),typeof O=="function"&&E.catch(O)}function Re(E){return typeof E!="string"&&(console.warn(E+" used as a key, but it is not a string."),E=String(E)),E}function Ie(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var M=void 0,N={},D=Object.prototype.toString;function ee(E){return typeof M=="boolean"?F.resolve(M):function(I){return new F(function(O){var Q=I.transaction("local-forage-detect-blob-support","readwrite"),J=j([""]);Q.objectStore("local-forage-detect-blob-support").put(J,"key"),Q.onabort=function(Z){Z.preventDefault(),Z.stopPropagation(),O(!1)},Q.oncomplete=function(){var Z=navigator.userAgent.match(/Chrome\/(\d+)/),se=navigator.userAgent.match(/Edge\//);O(se||!Z||parseInt(Z[1],10)>=43)}}).catch(function(){return!1})}(E).then(function(I){return M=I})}function C(E){var I=N[E.name],O={};O.promise=new F(function(Q,J){O.resolve=Q,O.reject=J}),I.deferredOperations.push(O),I.dbReady?I.dbReady=I.dbReady.then(function(){return O.promise}):I.dbReady=O.promise}function z(E){var I=N[E.name].deferredOperations.pop();if(I)return I.resolve(),I.promise}function V(E,I){var O=N[E.name].deferredOperations.pop();if(O)return O.reject(I),O.promise}function ne(E,I){return new F(function(O,Q){if(N[E.name]=N[E.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},E.db){if(!I)return O(E.db);C(E),E.db.close()}var J=[E.name];I&&J.push(E.version);var Z=Y.open.apply(Y,J);I&&(Z.onupgradeneeded=function(se){var ge=Z.result;try{ge.createObjectStore(E.storeName),se.oldVersion<=1&&ge.createObjectStore("local-forage-detect-blob-support")}catch(be){if(be.name!=="ConstraintError")throw be;console.warn('The database "'+E.name+'" has been upgraded from version '+se.oldVersion+" to version "+se.newVersion+', but the storage "'+E.storeName+'" already exists.')}}),Z.onerror=function(se){se.preventDefault(),Q(Z.error)},Z.onsuccess=function(){var se=Z.result;se.onversionchange=function(ge){ge.target.close()},O(se),z(E)}})}function qe(E){return ne(E,!1)}function ft(E){return ne(E,!0)}function Pe(E,I){if(!E.db)return!0;var O=!E.db.objectStoreNames.contains(E.storeName),Q=E.version<E.db.version,J=E.version>E.db.version;if(Q&&(E.version!==I&&console.warn('The database "'+E.name+`" can't be downgraded from version `+E.db.version+" to version "+E.version+"."),E.version=E.db.version),J||O){if(O){var Z=E.db.version+1;Z>E.version&&(E.version=Z)}return!0}return!1}function ae(E){return j([function(I){for(var O=I.length,Q=new ArrayBuffer(O),J=new Uint8Array(Q),Z=0;Z<O;Z++)J[Z]=I.charCodeAt(Z);return Q}(atob(E.data))],{type:E.type})}function Me(E){return E&&E.__local_forage_encoded_blob}function De(E){var I=this,O=I._initReady().then(function(){var Q=N[I._dbInfo.name];if(Q&&Q.dbReady)return Q.dbReady});return xe(O,E,E),O}function W(E,I,O,Q){Q===void 0&&(Q=1);try{var J=E.db.transaction(E.storeName,I);O(null,J)}catch(Z){if(Q>0&&(!E.db||Z.name==="InvalidStateError"||Z.name==="NotFoundError"))return F.resolve().then(function(){if(!E.db||Z.name==="NotFoundError"&&!E.db.objectStoreNames.contains(E.storeName)&&E.version<=E.db.version)return E.db&&(E.version=E.db.version+1),ft(E)}).then(function(){return function(se){C(se);for(var ge=N[se.name],be=ge.forages,we=0;we<be.length;we++){var Fe=be[we];Fe._dbInfo.db&&(Fe._dbInfo.db.close(),Fe._dbInfo.db=null)}return se.db=null,qe(se).then(function(Ye){return se.db=Ye,Pe(se)?ft(se):Ye}).then(function(Ye){se.db=ge.db=Ye;for(var ht=0;ht<be.length;ht++)be[ht]._dbInfo.db=Ye}).catch(function(Ye){throw V(se,Ye),Ye})}(E).then(function(){W(E,I,O,Q-1)})}).catch(O);O(Z)}}var ye={_driver:"asyncStorage",_initStorage:function(E){var I=this,O={db:null};if(E)for(var Q in E)O[Q]=E[Q];var J=N[O.name];J||(J={forages:[],db:null,dbReady:null,deferredOperations:[]},N[O.name]=J),J.forages.push(I),I._initReady||(I._initReady=I.ready,I.ready=De);var Z=[];function se(){return F.resolve()}for(var ge=0;ge<J.forages.length;ge++){var be=J.forages[ge];be!==I&&Z.push(be._initReady().catch(se))}var we=J.forages.slice(0);return F.all(Z).then(function(){return O.db=J.db,qe(O)}).then(function(Fe){return O.db=Fe,Pe(O,I._defaultConfig.version)?ft(O):Fe}).then(function(Fe){O.db=J.db=Fe,I._dbInfo=O;for(var Ye=0;Ye<we.length;Ye++){var ht=we[Ye];ht!==I&&(ht._dbInfo.db=O.db,ht._dbInfo.version=O.version)}})},_support:function(){try{if(!Y||!Y.open)return!1;var E=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),I=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!E||I)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).openCursor(),we=1;be.onsuccess=function(){var Fe=be.result;if(Fe){var Ye=Fe.value;Me(Ye)&&(Ye=ae(Ye));var ht=E(Ye,Fe.key,we++);ht!==void 0?J(ht):Fe.continue()}else J()},be.onerror=function(){Z(be.error)}}catch(Fe){Z(Fe)}})}).catch(Z)});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).get(E);be.onsuccess=function(){var we=be.result;we===void 0&&(we=null),Me(we)&&(we=ae(we)),J(we)},be.onerror=function(){Z(be.error)}}catch(we){Z(we)}})}).catch(Z)});return K(Q,I),Q},setItem:function(E,I,O){var Q=this;E=Re(E);var J=new F(function(Z,se){var ge;Q.ready().then(function(){return ge=Q._dbInfo,D.call(I)==="[object Blob]"?ee(ge.db).then(function(be){return be?I:(we=I,new F(function(Fe,Ye){var ht=new FileReader;ht.onerror=Ye,ht.onloadend=function(xt){var Ot=btoa(xt.target.result||"");Fe({__local_forage_encoded_blob:!0,data:Ot,type:we.type})},ht.readAsBinaryString(we)}));var we}):I}).then(function(be){W(Q._dbInfo,"readwrite",function(we,Fe){if(we)return se(we);try{var Ye=Fe.objectStore(Q._dbInfo.storeName);be===null&&(be=void 0);var ht=Ye.put(be,E);Fe.oncomplete=function(){be===void 0&&(be=null),Z(be)},Fe.onabort=Fe.onerror=function(){var xt=ht.error?ht.error:ht.transaction.error;se(xt)}}catch(xt){se(xt)}})}).catch(se)});return K(J,O),J},removeItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readwrite",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).delete(E);ge.oncomplete=function(){J()},ge.onerror=function(){Z(be.error)},ge.onabort=function(){var we=be.error?be.error:be.transaction.error;Z(we)}}catch(we){Z(we)}})}).catch(Z)});return K(Q,I),Q},clear:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readwrite",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).clear();se.oncomplete=function(){Q()},se.onabort=se.onerror=function(){var be=ge.error?ge.error:ge.transaction.error;J(be)}}catch(be){J(be)}})}).catch(J)});return K(O,E),O},length:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readonly",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).count();ge.onsuccess=function(){Q(ge.result)},ge.onerror=function(){J(ge.error)}}catch(be){J(be)}})}).catch(J)});return K(O,E),O},key:function(E,I){var O=this,Q=new F(function(J,Z){E<0?J(null):O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName),we=!1,Fe=be.openKeyCursor();Fe.onsuccess=function(){var Ye=Fe.result;Ye?E===0||we?J(Ye.key):(we=!0,Ye.advance(E)):J(null)},Fe.onerror=function(){Z(Fe.error)}}catch(Ye){Z(Ye)}})}).catch(Z)});return K(Q,I),Q},keys:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readonly",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).openKeyCursor(),be=[];ge.onsuccess=function(){var we=ge.result;we?(be.push(we.key),we.continue()):Q(be)},ge.onerror=function(){J(ge.error)}}catch(we){J(we)}})}).catch(J)});return K(O,E),O},dropInstance:function(E,I){I=Ie.apply(this,arguments);var O=this.config();(E=typeof E!="function"&&E||{}).name||(E.name=E.name||O.name,E.storeName=E.storeName||O.storeName);var Q,J=this;if(E.name){var Z=E.name===O.name&&J._dbInfo.db,se=Z?F.resolve(J._dbInfo.db):qe(E).then(function(ge){var be=N[E.name],we=be.forages;be.db=ge;for(var Fe=0;Fe<we.length;Fe++)we[Fe]._dbInfo.db=ge;return ge});Q=E.storeName?se.then(function(ge){if(ge.objectStoreNames.contains(E.storeName)){var be=ge.version+1;C(E);var we=N[E.name],Fe=we.forages;ge.close();for(var Ye=0;Ye<Fe.length;Ye++){var ht=Fe[Ye];ht._dbInfo.db=null,ht._dbInfo.version=be}return new F(function(xt,Ot){var Gt=Y.open(E.name,be);Gt.onerror=function(fi){Gt.result.close(),Ot(fi)},Gt.onupgradeneeded=function(){Gt.result.deleteObjectStore(E.storeName)},Gt.onsuccess=function(){var fi=Gt.result;fi.close(),xt(fi)}}).then(function(xt){we.db=xt;for(var Ot=0;Ot<Fe.length;Ot++){var Gt=Fe[Ot];Gt._dbInfo.db=xt,z(Gt._dbInfo)}}).catch(function(xt){throw(V(E,xt)||F.resolve()).catch(function(){}),xt})}}):se.then(function(ge){C(E);var be=N[E.name],we=be.forages;ge.close();for(var Fe=0;Fe<we.length;Fe++)we[Fe]._dbInfo.db=null;return new F(function(Ye,ht){var xt=Y.deleteDatabase(E.name);xt.onerror=function(){var Ot=xt.result;Ot&&Ot.close(),ht(xt.error)},xt.onblocked=function(){console.warn('dropInstance blocked for database "'+E.name+'" until all open connections are closed')},xt.onsuccess=function(){var Ot=xt.result;Ot&&Ot.close(),Ye(Ot)}}).then(function(Ye){be.db=Ye;for(var ht=0;ht<we.length;ht++)z(we[ht]._dbInfo)}).catch(function(Ye){throw(V(E,Ye)||F.resolve()).catch(function(){}),Ye})})}else Q=F.reject("Invalid arguments");return K(Q,I),Q}},Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Le=/^~~local_forage_type~([^~]+)~/,Ne=9,$e=Ne+4,Qe=Object.prototype.toString;function bt(E){var I,O,Q,J,Z,se=.75*E.length,ge=E.length,be=0;E[E.length-1]==="="&&(se--,E[E.length-2]==="="&&se--);var we=new ArrayBuffer(se),Fe=new Uint8Array(we);for(I=0;I<ge;I+=4)O=Ce.indexOf(E[I]),Q=Ce.indexOf(E[I+1]),J=Ce.indexOf(E[I+2]),Z=Ce.indexOf(E[I+3]),Fe[be++]=O<<2|Q>>4,Fe[be++]=(15&Q)<<4|J>>2,Fe[be++]=(3&J)<<6|63&Z;return we}function vt(E){var I,O=new Uint8Array(E),Q="";for(I=0;I<O.length;I+=3)Q+=Ce[O[I]>>2],Q+=Ce[(3&O[I])<<4|O[I+1]>>4],Q+=Ce[(15&O[I+1])<<2|O[I+2]>>6],Q+=Ce[63&O[I+2]];return O.length%3==2?Q=Q.substring(0,Q.length-1)+"=":O.length%3==1&&(Q=Q.substring(0,Q.length-2)+"=="),Q}var ln={serialize:function(E,I){var O="";if(E&&(O=Qe.call(E)),E&&(O==="[object ArrayBuffer]"||E.buffer&&Qe.call(E.buffer)==="[object ArrayBuffer]")){var Q,J="__lfsc__:";E instanceof ArrayBuffer?(Q=E,J+="arbf"):(Q=E.buffer,O==="[object Int8Array]"?J+="si08":O==="[object Uint8Array]"?J+="ui08":O==="[object Uint8ClampedArray]"?J+="uic8":O==="[object Int16Array]"?J+="si16":O==="[object Uint16Array]"?J+="ur16":O==="[object Int32Array]"?J+="si32":O==="[object Uint32Array]"?J+="ui32":O==="[object Float32Array]"?J+="fl32":O==="[object Float64Array]"?J+="fl64":I(new Error("Failed to get type for BinaryArray"))),I(J+vt(Q))}else if(O==="[object Blob]"){var Z=new FileReader;Z.onload=function(){var se="~~local_forage_type~"+E.type+"~"+vt(this.result);I("__lfsc__:blob"+se)},Z.readAsArrayBuffer(E)}else try{I(JSON.stringify(E))}catch(se){console.error("Couldn't convert value into a JSON string: ",E),I(null,se)}},deserialize:function(E){if(E.substring(0,Ne)!=="__lfsc__:")return JSON.parse(E);var I,O=E.substring($e),Q=E.substring(Ne,$e);if(Q==="blob"&&Le.test(O)){var J=O.match(Le);I=J[1],O=O.substring(J[0].length)}var Z=bt(O);switch(Q){case"arbf":return Z;case"blob":return j([Z],{type:I});case"si08":return new Int8Array(Z);case"ui08":return new Uint8Array(Z);case"uic8":return new Uint8ClampedArray(Z);case"si16":return new Int16Array(Z);case"ur16":return new Uint16Array(Z);case"si32":return new Int32Array(Z);case"ui32":return new Uint32Array(Z);case"fl32":return new Float32Array(Z);case"fl64":return new Float64Array(Z);default:throw new Error("Unkown type: "+Q)}},stringToBuffer:bt,bufferToString:vt};function wt(E,I,O,Q){E.executeSql("CREATE TABLE IF NOT EXISTS "+I.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],O,Q)}function Wt(E,I,O,Q,J,Z){E.executeSql(O,Q,J,function(se,ge){ge.code===ge.SYNTAX_ERR?se.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[I.storeName],function(be,we){we.rows.length?Z(be,ge):wt(be,I,function(){be.executeSql(O,Q,J,Z)},Z)},Z):Z(se,ge)},Z)}function qt(E,I,O,Q){var J=this;E=Re(E);var Z=new F(function(se,ge){J.ready().then(function(){I===void 0&&(I=null);var be=I,we=J._dbInfo;we.serializer.serialize(I,function(Fe,Ye){Ye?ge(Ye):we.db.transaction(function(ht){Wt(ht,we,"INSERT OR REPLACE INTO "+we.storeName+" (key, value) VALUES (?, ?)",[E,Fe],function(){se(be)},function(xt,Ot){ge(Ot)})},function(ht){if(ht.code===ht.QUOTA_ERR){if(Q>0)return void se(qt.apply(J,[E,be,O,Q-1]));ge(ht)}})})}).catch(ge)});return K(Z,O),Z}function rn(E){return new F(function(I,O){E.transaction(function(Q){Q.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(J,Z){for(var se=[],ge=0;ge<Z.rows.length;ge++)se.push(Z.rows.item(ge).name);I({db:E,storeNames:se})},function(J,Z){O(Z)})},function(Q){O(Q)})})}var Bt={_driver:"webSQLStorage",_initStorage:function(E){var I=this,O={db:null};if(E)for(var Q in E)O[Q]=typeof E[Q]!="string"?E[Q].toString():E[Q];var J=new F(function(Z,se){try{O.db=openDatabase(O.name,String(O.version),O.description,O.size)}catch(ge){return se(ge)}O.db.transaction(function(ge){wt(ge,O,function(){I._dbInfo=O,Z()},function(be,we){se(we)})},se)});return O.serializer=ln,J},_support:typeof openDatabase=="function",iterate:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT * FROM "+se.storeName,[],function(be,we){for(var Fe=we.rows,Ye=Fe.length,ht=0;ht<Ye;ht++){var xt=Fe.item(ht),Ot=xt.value;if(Ot&&(Ot=se.serializer.deserialize(Ot)),(Ot=E(Ot,xt.key,ht+1))!==void 0)return void J(Ot)}J()},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT * FROM "+se.storeName+" WHERE key = ? LIMIT 1",[E],function(be,we){var Fe=we.rows.length?we.rows.item(0).value:null;Fe&&(Fe=se.serializer.deserialize(Fe)),J(Fe)},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},setItem:function(E,I,O){return qt.apply(this,[E,I,O,1])},removeItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"DELETE FROM "+se.storeName+" WHERE key = ?",[E],function(){J()},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},clear:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"DELETE FROM "+Z.storeName,[],function(){Q()},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},length:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"SELECT COUNT(key) as c FROM "+Z.storeName,[],function(ge,be){var we=be.rows.item(0).c;Q(we)},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},key:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT key FROM "+se.storeName+" WHERE id = ? LIMIT 1",[E+1],function(be,we){var Fe=we.rows.length?we.rows.item(0).key:null;J(Fe)},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},keys:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"SELECT key FROM "+Z.storeName,[],function(ge,be){for(var we=[],Fe=0;Fe<be.rows.length;Fe++)we.push(be.rows.item(Fe).key);Q(we)},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},dropInstance:function(E,I){I=Ie.apply(this,arguments);var O=this.config();(E=typeof E!="function"&&E||{}).name||(E.name=E.name||O.name,E.storeName=E.storeName||O.storeName);var Q,J=this;return K(Q=E.name?new F(function(Z){var se;se=E.name===O.name?J._dbInfo.db:openDatabase(E.name,"","",0),E.storeName?Z({db:se,storeNames:[E.storeName]}):Z(rn(se))}).then(function(Z){return new F(function(se,ge){Z.db.transaction(function(be){function we(xt){return new F(function(Ot,Gt){be.executeSql("DROP TABLE IF EXISTS "+xt,[],function(){Ot()},function(fi,nr){Gt(nr)})})}for(var Fe=[],Ye=0,ht=Z.storeNames.length;Ye<ht;Ye++)Fe.push(we(Z.storeNames[Ye]));F.all(Fe).then(function(){se()}).catch(function(xt){ge(xt)})},function(be){ge(be)})})}):F.reject("Invalid arguments"),I),Q}};function Dn(E,I){var O=E.name+"/";return E.storeName!==I.storeName&&(O+=E.storeName+"/"),O}function Fn(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var Mn={_driver:"localStorageWrapper",_initStorage:function(E){var I={};if(E)for(var O in E)I[O]=E[O];return I.keyPrefix=Dn(E,this._defaultConfig),Fn()?(this._dbInfo=I,I.serializer=ln,F.resolve()):F.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(E,I){var O=this,Q=O.ready().then(function(){for(var J=O._dbInfo,Z=J.keyPrefix,se=Z.length,ge=localStorage.length,be=1,we=0;we<ge;we++){var Fe=localStorage.key(we);if(Fe.indexOf(Z)===0){var Ye=localStorage.getItem(Fe);if(Ye&&(Ye=J.serializer.deserialize(Ye)),(Ye=E(Ye,Fe.substring(se),be++))!==void 0)return Ye}}});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=O.ready().then(function(){var J=O._dbInfo,Z=localStorage.getItem(J.keyPrefix+E);return Z&&(Z=J.serializer.deserialize(Z)),Z});return K(Q,I),Q},setItem:function(E,I,O){var Q=this;E=Re(E);var J=Q.ready().then(function(){I===void 0&&(I=null);var Z=I;return new F(function(se,ge){var be=Q._dbInfo;be.serializer.serialize(I,function(we,Fe){if(Fe)ge(Fe);else try{localStorage.setItem(be.keyPrefix+E,we),se(Z)}catch(Ye){Ye.name!=="QuotaExceededError"&&Ye.name!=="NS_ERROR_DOM_QUOTA_REACHED"||ge(Ye),ge(Ye)}})})});return K(J,O),J},removeItem:function(E,I){var O=this;E=Re(E);var Q=O.ready().then(function(){var J=O._dbInfo;localStorage.removeItem(J.keyPrefix+E)});return K(Q,I),Q},clear:function(E){var I=this,O=I.ready().then(function(){for(var Q=I._dbInfo.keyPrefix,J=localStorage.length-1;J>=0;J--){var Z=localStorage.key(J);Z.indexOf(Q)===0&&localStorage.removeItem(Z)}});return K(O,E),O},length:function(E){var I=this.keys().then(function(O){return O.length});return K(I,E),I},key:function(E,I){var O=this,Q=O.ready().then(function(){var J,Z=O._dbInfo;try{J=localStorage.key(E)}catch{J=null}return J&&(J=J.substring(Z.keyPrefix.length)),J});return K(Q,I),Q},keys:function(E){var I=this,O=I.ready().then(function(){for(var Q=I._dbInfo,J=localStorage.length,Z=[],se=0;se<J;se++){var ge=localStorage.key(se);ge.indexOf(Q.keyPrefix)===0&&Z.push(ge.substring(Q.keyPrefix.length))}return Z});return K(O,E),O},dropInstance:function(E,I){if(I=Ie.apply(this,arguments),!(E=typeof E!="function"&&E||{}).name){var O=this.config();E.name=E.name||O.name,E.storeName=E.storeName||O.storeName}var Q,J=this;return K(Q=E.name?new F(function(Z){E.storeName?Z(Dn(E,J._defaultConfig)):Z(E.name+"/")}).then(function(Z){for(var se=localStorage.length-1;se>=0;se--){var ge=localStorage.key(se);ge.indexOf(Z)===0&&localStorage.removeItem(ge)}}):F.reject("Invalid arguments"),I),Q}},jn=function(E,I){for(var O,Q,J=E.length,Z=0;Z<J;){if((O=E[Z])===(Q=I)||typeof O=="number"&&typeof Q=="number"&&isNaN(O)&&isNaN(Q))return!0;Z++}return!1},An=Array.isArray||function(E){return Object.prototype.toString.call(E)==="[object Array]"},In={},di={},Ln={INDEXEDDB:ye,WEBSQL:Bt,LOCALSTORAGE:Mn},Di=[Ln.INDEXEDDB._driver,Ln.WEBSQL._driver,Ln.LOCALSTORAGE._driver],pi=["dropInstance"],uo=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pi),Co={description:"",driver:Di.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Oa(E,I){E[I]=function(){var O=arguments;return E.ready().then(function(){return E[I].apply(E,O)})}}function ho(){for(var E=1;E<arguments.length;E++){var I=arguments[E];if(I)for(var O in I)I.hasOwnProperty(O)&&(An(I[O])?arguments[0][O]=I[O].slice():arguments[0][O]=I[O])}return arguments[0]}var Sr=new(function(){function E(I){for(var O in function(Z,se){if(!(Z instanceof se))throw new TypeError("Cannot call a class as a function")}(this,E),Ln)if(Ln.hasOwnProperty(O)){var Q=Ln[O],J=Q._driver;this[O]=J,In[J]||this.defineDriver(Q)}this._defaultConfig=ho({},Co),this._config=ho({},this._defaultConfig,I),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return E.prototype.config=function(I){if((I===void 0?"undefined":L(I))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var O in I){if(O==="storeName"&&(I[O]=I[O].replace(/\W/g,"_")),O==="version"&&typeof I[O]!="number")return new Error("Database version must be a number.");this._config[O]=I[O]}return!("driver"in I)||!I.driver||this.setDriver(this._config.driver)}return typeof I=="string"?this._config[I]:this._config},E.prototype.defineDriver=function(I,O,Q){var J=new F(function(Z,se){try{var ge=I._driver,be=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!I._driver)return void se(be);for(var we=uo.concat("_initStorage"),Fe=0,Ye=we.length;Fe<Ye;Fe++){var ht=we[Fe];if((!jn(pi,ht)||I[ht])&&typeof I[ht]!="function")return void se(be)}(function(){for(var Ot=function(Po){return function(){var Hs=new Error("Method "+Po+" is not implemented by the current driver"),Gn=F.reject(Hs);return K(Gn,arguments[arguments.length-1]),Gn}},Gt=0,fi=pi.length;Gt<fi;Gt++){var nr=pi[Gt];I[nr]||(I[nr]=Ot(nr))}})();var xt=function(Ot){In[ge]&&console.info("Redefining LocalForage driver: "+ge),In[ge]=I,di[ge]=Ot,Z()};"_support"in I?I._support&&typeof I._support=="function"?I._support().then(xt,se):xt(!!I._support):xt(!0)}catch(Ot){se(Ot)}});return xe(J,O,Q),J},E.prototype.driver=function(){return this._driver||null},E.prototype.getDriver=function(I,O,Q){var J=In[I]?F.resolve(In[I]):F.reject(new Error("Driver not found."));return xe(J,O,Q),J},E.prototype.getSerializer=function(I){var O=F.resolve(ln);return xe(O,I),O},E.prototype.ready=function(I){var O=this,Q=O._driverSet.then(function(){return O._ready===null&&(O._ready=O._initDriver()),O._ready});return xe(Q,I,I),Q},E.prototype.setDriver=function(I,O,Q){var J=this;An(I)||(I=[I]);var Z=this._getSupportedDrivers(I);function se(){J._config.driver=J.driver()}function ge(we){return J._extend(we),se(),J._ready=J._initStorage(J._config),J._ready}var be=this._driverSet!==null?this._driverSet.catch(function(){return F.resolve()}):F.resolve();return this._driverSet=be.then(function(){var we=Z[0];return J._dbInfo=null,J._ready=null,J.getDriver(we).then(function(Fe){J._driver=Fe._driver,se(),J._wrapLibraryMethodsWithReady(),J._initDriver=function(Ye){return function(){var ht=0;return function xt(){for(;ht<Ye.length;){var Ot=Ye[ht];return ht++,J._dbInfo=null,J._ready=null,J.getDriver(Ot).then(ge).catch(xt)}se();var Gt=new Error("No available storage method found.");return J._driverSet=F.reject(Gt),J._driverSet}()}}(Z)})}).catch(function(){se();var we=new Error("No available storage method found.");return J._driverSet=F.reject(we),J._driverSet}),xe(this._driverSet,O,Q),this._driverSet},E.prototype.supports=function(I){return!!di[I]},E.prototype._extend=function(I){ho(this,I)},E.prototype._getSupportedDrivers=function(I){for(var O=[],Q=0,J=I.length;Q<J;Q++){var Z=I[Q];this.supports(Z)&&O.push(Z)}return O},E.prototype._wrapLibraryMethodsWithReady=function(){for(var I=0,O=uo.length;I<O;I++)Oa(this,uo[I])},E.prototype.createInstance=function(I){return new E(I)},E}());fe.exports=Sr},{3:3}]},{},[4])(4)}).call(this,v(4))},function(T,R,v){var b=v(63);T.exports=function(te,fe){fe=fe||{};var $=new b,L=fe.inPlace||!1,Y=te.map(function(F){return L?F:{width:F.width,height:F.height,item:F}});Y=Y.sort(function(F,K){return K.width*K.height-F.width*F.height}),$.fit(Y);var j={width:Y.reduce(function(F,K){return Math.max(F,K.x+K.width)},0),height:Y.reduce(function(F,K){return Math.max(F,K.y+K.height)},0)};return L||(j.items=Y),j}},function(T,R){T.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(T,R,v){var b=Object.prototype.hasOwnProperty,te="~";function fe(){}function $(F,K,xe){this.fn=F,this.context=K,this.once=xe||!1}function L(F,K,xe,Re,Ie){if(typeof xe!="function")throw new TypeError("The listener must be a function");var M=new $(xe,Re||F,Ie),N=te?te+K:K;return F._events[N]?F._events[N].fn?F._events[N]=[F._events[N],M]:F._events[N].push(M):(F._events[N]=M,F._eventsCount++),F}function Y(F,K){--F._eventsCount==0?F._events=new fe:delete F._events[K]}function j(){this._events=new fe,this._eventsCount=0}Object.create&&(fe.prototype=Object.create(null),new fe().__proto__||(te=!1)),j.prototype.eventNames=function(){var F,K,xe=[];if(this._eventsCount===0)return xe;for(K in F=this._events)b.call(F,K)&&xe.push(te?K.slice(1):K);return Object.getOwnPropertySymbols?xe.concat(Object.getOwnPropertySymbols(F)):xe},j.prototype.listeners=function(F){var K=te?te+F:F,xe=this._events[K];if(!xe)return[];if(xe.fn)return[xe.fn];for(var Re=0,Ie=xe.length,M=new Array(Ie);Re<Ie;Re++)M[Re]=xe[Re].fn;return M},j.prototype.listenerCount=function(F){var K=te?te+F:F,xe=this._events[K];return xe?xe.fn?1:xe.length:0},j.prototype.emit=function(F,K,xe,Re,Ie,M){var N=te?te+F:F;if(!this._events[N])return!1;var D,ee,C=this._events[N],z=arguments.length;if(C.fn){switch(C.once&&this.removeListener(F,C.fn,void 0,!0),z){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,K),!0;case 3:return C.fn.call(C.context,K,xe),!0;case 4:return C.fn.call(C.context,K,xe,Re),!0;case 5:return C.fn.call(C.context,K,xe,Re,Ie),!0;case 6:return C.fn.call(C.context,K,xe,Re,Ie,M),!0}for(ee=1,D=new Array(z-1);ee<z;ee++)D[ee-1]=arguments[ee];C.fn.apply(C.context,D)}else{var V,ne=C.length;for(ee=0;ee<ne;ee++)switch(C[ee].once&&this.removeListener(F,C[ee].fn,void 0,!0),z){case 1:C[ee].fn.call(C[ee].context);break;case 2:C[ee].fn.call(C[ee].context,K);break;case 3:C[ee].fn.call(C[ee].context,K,xe);break;case 4:C[ee].fn.call(C[ee].context,K,xe,Re);break;default:if(!D)for(V=1,D=new Array(z-1);V<z;V++)D[V-1]=arguments[V];C[ee].fn.apply(C[ee].context,D)}}return!0},j.prototype.on=function(F,K,xe){return L(this,F,K,xe,!1)},j.prototype.once=function(F,K,xe){return L(this,F,K,xe,!0)},j.prototype.removeListener=function(F,K,xe,Re){var Ie=te?te+F:F;if(!this._events[Ie])return this;if(!K)return Y(this,Ie),this;var M=this._events[Ie];if(M.fn)M.fn!==K||Re&&!M.once||xe&&M.context!==xe||Y(this,Ie);else{for(var N=0,D=[],ee=M.length;N<ee;N++)(M[N].fn!==K||Re&&!M[N].once||xe&&M[N].context!==xe)&&D.push(M[N]);D.length?this._events[Ie]=D.length===1?D[0]:D:Y(this,Ie)}return this},j.prototype.removeAllListeners=function(F){var K;return F?(K=te?te+F:F,this._events[K]&&Y(this,K)):(this._events=new fe,this._eventsCount=0),this},j.prototype.off=j.prototype.removeListener,j.prototype.addListener=j.prototype.on,j.prefixed=te,j.EventEmitter=j,T.exports=j},function(T,R,v){function b(W,ye,Ce){Ce=Ce||2;var Le,Ne,$e,Qe,bt,vt,ln,wt=ye&&ye.length,Wt=wt?ye[0]*Ce:W.length,qt=te(W,0,Wt,Ce,!0),rn=[];if(!qt||qt.next===qt.prev)return rn;if(wt&&(qt=function(Dn,Fn,Mn,jn){var An,In,di,Ln,Di,pi=[];for(An=0,In=Fn.length;An<In;An++)di=Fn[An]*jn,Ln=An<In-1?Fn[An+1]*jn:Dn.length,(Di=te(Dn,di,Ln,jn,!1))===Di.next&&(Di.steiner=!0),pi.push(M(Di));for(pi.sort(K),An=0;An<pi.length;An++)Mn=fe(Mn=xe(pi[An],Mn),Mn.next);return Mn}(W,ye,qt,Ce)),W.length>80*Ce){Le=$e=W[0],Ne=Qe=W[1];for(var Bt=Ce;Bt<Wt;Bt+=Ce)(bt=W[Bt])<Le&&(Le=bt),(vt=W[Bt+1])<Ne&&(Ne=vt),bt>$e&&($e=bt),vt>Qe&&(Qe=vt);ln=(ln=Math.max($e-Le,Qe-Ne))!==0?1/ln:0}return $(qt,rn,Ce,Le,Ne,ln),rn}function te(W,ye,Ce,Le,Ne){var $e,Qe;if(Ne===De(W,ye,Ce,Le)>0)for($e=ye;$e<Ce;$e+=Le)Qe=Pe($e,W[$e],W[$e+1],Qe);else for($e=Ce-Le;$e>=ye;$e-=Le)Qe=Pe($e,W[$e],W[$e+1],Qe);return Qe&&C(Qe,Qe.next)&&(ae(Qe),Qe=Qe.next),Qe}function fe(W,ye){if(!W)return W;ye||(ye=W);var Ce,Le=W;do if(Ce=!1,Le.steiner||!C(Le,Le.next)&&ee(Le.prev,Le,Le.next)!==0)Le=Le.next;else{if(ae(Le),(Le=ye=Le.prev)===Le.next)break;Ce=!0}while(Ce||Le!==ye);return ye}function $(W,ye,Ce,Le,Ne,$e,Qe){if(W){!Qe&&$e&&function(wt,Wt,qt,rn){var Bt=wt;do Bt.z===null&&(Bt.z=Ie(Bt.x,Bt.y,Wt,qt,rn)),Bt.prevZ=Bt.prev,Bt.nextZ=Bt.next,Bt=Bt.next;while(Bt!==wt);Bt.prevZ.nextZ=null,Bt.prevZ=null,function(Dn){var Fn,Mn,jn,An,In,di,Ln,Di,pi=1;do{for(Mn=Dn,Dn=null,In=null,di=0;Mn;){for(di++,jn=Mn,Ln=0,Fn=0;Fn<pi&&(Ln++,jn=jn.nextZ);Fn++);for(Di=pi;Ln>0||Di>0&&jn;)Ln!==0&&(Di===0||!jn||Mn.z<=jn.z)?(An=Mn,Mn=Mn.nextZ,Ln--):(An=jn,jn=jn.nextZ,Di--),In?In.nextZ=An:Dn=An,An.prevZ=In,In=An;Mn=jn}In.nextZ=null,pi*=2}while(di>1)}(Bt)}(W,Le,Ne,$e);for(var bt,vt,ln=W;W.prev!==W.next;)if(bt=W.prev,vt=W.next,$e?Y(W,Le,Ne,$e):L(W))ye.push(bt.i/Ce),ye.push(W.i/Ce),ye.push(vt.i/Ce),ae(W),W=vt.next,ln=vt.next;else if((W=vt)===ln){Qe?Qe===1?$(W=j(fe(W),ye,Ce),ye,Ce,Le,Ne,$e,2):Qe===2&&F(W,ye,Ce,Le,Ne,$e):$(fe(W),ye,Ce,Le,Ne,$e,1);break}}}function L(W){var ye=W.prev,Ce=W,Le=W.next;if(ee(ye,Ce,Le)>=0)return!1;for(var Ne=W.next.next;Ne!==W.prev;){if(N(ye.x,ye.y,Ce.x,Ce.y,Le.x,Le.y,Ne.x,Ne.y)&&ee(Ne.prev,Ne,Ne.next)>=0)return!1;Ne=Ne.next}return!0}function Y(W,ye,Ce,Le){var Ne=W.prev,$e=W,Qe=W.next;if(ee(Ne,$e,Qe)>=0)return!1;for(var bt=Ne.x<$e.x?Ne.x<Qe.x?Ne.x:Qe.x:$e.x<Qe.x?$e.x:Qe.x,vt=Ne.y<$e.y?Ne.y<Qe.y?Ne.y:Qe.y:$e.y<Qe.y?$e.y:Qe.y,ln=Ne.x>$e.x?Ne.x>Qe.x?Ne.x:Qe.x:$e.x>Qe.x?$e.x:Qe.x,wt=Ne.y>$e.y?Ne.y>Qe.y?Ne.y:Qe.y:$e.y>Qe.y?$e.y:Qe.y,Wt=Ie(bt,vt,ye,Ce,Le),qt=Ie(ln,wt,ye,Ce,Le),rn=W.prevZ,Bt=W.nextZ;rn&&rn.z>=Wt&&Bt&&Bt.z<=qt;){if(rn!==W.prev&&rn!==W.next&&N(Ne.x,Ne.y,$e.x,$e.y,Qe.x,Qe.y,rn.x,rn.y)&&ee(rn.prev,rn,rn.next)>=0||(rn=rn.prevZ,Bt!==W.prev&&Bt!==W.next&&N(Ne.x,Ne.y,$e.x,$e.y,Qe.x,Qe.y,Bt.x,Bt.y)&&ee(Bt.prev,Bt,Bt.next)>=0))return!1;Bt=Bt.nextZ}for(;rn&&rn.z>=Wt;){if(rn!==W.prev&&rn!==W.next&&N(Ne.x,Ne.y,$e.x,$e.y,Qe.x,Qe.y,rn.x,rn.y)&&ee(rn.prev,rn,rn.next)>=0)return!1;rn=rn.prevZ}for(;Bt&&Bt.z<=qt;){if(Bt!==W.prev&&Bt!==W.next&&N(Ne.x,Ne.y,$e.x,$e.y,Qe.x,Qe.y,Bt.x,Bt.y)&&ee(Bt.prev,Bt,Bt.next)>=0)return!1;Bt=Bt.nextZ}return!0}function j(W,ye,Ce){var Le=W;do{var Ne=Le.prev,$e=Le.next.next;!C(Ne,$e)&&z(Ne,Le,Le.next,$e)&&qe(Ne,$e)&&qe($e,Ne)&&(ye.push(Ne.i/Ce),ye.push(Le.i/Ce),ye.push($e.i/Ce),ae(Le),ae(Le.next),Le=W=$e),Le=Le.next}while(Le!==W);return fe(Le)}function F(W,ye,Ce,Le,Ne,$e){var Qe=W;do{for(var bt=Qe.next.next;bt!==Qe.prev;){if(Qe.i!==bt.i&&D(Qe,bt)){var vt=ft(Qe,bt);return Qe=fe(Qe,Qe.next),vt=fe(vt,vt.next),$(Qe,ye,Ce,Le,Ne,$e),void $(vt,ye,Ce,Le,Ne,$e)}bt=bt.next}Qe=Qe.next}while(Qe!==W)}function K(W,ye){return W.x-ye.x}function xe(W,ye){var Ce=function($e,Qe){var bt,vt=Qe,ln=$e.x,wt=$e.y,Wt=-1/0;do{if(wt<=vt.y&&wt>=vt.next.y&&vt.next.y!==vt.y){var qt=vt.x+(wt-vt.y)*(vt.next.x-vt.x)/(vt.next.y-vt.y);if(qt<=ln&&qt>Wt){if(Wt=qt,qt===ln){if(wt===vt.y)return vt;if(wt===vt.next.y)return vt.next}bt=vt.x<vt.next.x?vt:vt.next}}vt=vt.next}while(vt!==Qe);if(!bt)return null;if(ln===Wt)return bt;var rn,Bt=bt,Dn=bt.x,Fn=bt.y,Mn=1/0;vt=bt;do ln>=vt.x&&vt.x>=Dn&&ln!==vt.x&&N(wt<Fn?ln:Wt,wt,Dn,Fn,wt<Fn?Wt:ln,wt,vt.x,vt.y)&&(rn=Math.abs(wt-vt.y)/(ln-vt.x),qe(vt,$e)&&(rn<Mn||rn===Mn&&(vt.x>bt.x||vt.x===bt.x&&Re(bt,vt)))&&(bt=vt,Mn=rn)),vt=vt.next;while(vt!==Bt);return bt}(W,ye);if(!Ce)return ye;var Le=ft(Ce,W),Ne=fe(Ce,Ce.next);return fe(Le,Le.next),ye===Ce?Ne:ye}function Re(W,ye){return ee(W.prev,W,ye.prev)<0&&ee(ye.next,W,W.next)<0}function Ie(W,ye,Ce,Le,Ne){return(W=1431655765&((W=858993459&((W=252645135&((W=16711935&((W=32767*(W-Ce)*Ne)|W<<8))|W<<4))|W<<2))|W<<1))|(ye=1431655765&((ye=858993459&((ye=252645135&((ye=16711935&((ye=32767*(ye-Le)*Ne)|ye<<8))|ye<<4))|ye<<2))|ye<<1))<<1}function M(W){var ye=W,Ce=W;do(ye.x<Ce.x||ye.x===Ce.x&&ye.y<Ce.y)&&(Ce=ye),ye=ye.next;while(ye!==W);return Ce}function N(W,ye,Ce,Le,Ne,$e,Qe,bt){return(Ne-Qe)*(ye-bt)-(W-Qe)*($e-bt)>=0&&(W-Qe)*(Le-bt)-(Ce-Qe)*(ye-bt)>=0&&(Ce-Qe)*($e-bt)-(Ne-Qe)*(Le-bt)>=0}function D(W,ye){return W.next.i!==ye.i&&W.prev.i!==ye.i&&!function(Ce,Le){var Ne=Ce;do{if(Ne.i!==Ce.i&&Ne.next.i!==Ce.i&&Ne.i!==Le.i&&Ne.next.i!==Le.i&&z(Ne,Ne.next,Ce,Le))return!0;Ne=Ne.next}while(Ne!==Ce);return!1}(W,ye)&&(qe(W,ye)&&qe(ye,W)&&function(Ce,Le){var Ne=Ce,$e=!1,Qe=(Ce.x+Le.x)/2,bt=(Ce.y+Le.y)/2;do Ne.y>bt!=Ne.next.y>bt&&Ne.next.y!==Ne.y&&Qe<(Ne.next.x-Ne.x)*(bt-Ne.y)/(Ne.next.y-Ne.y)+Ne.x&&($e=!$e),Ne=Ne.next;while(Ne!==Ce);return $e}(W,ye)&&(ee(W.prev,W,ye.prev)||ee(W,ye.prev,ye))||C(W,ye)&&ee(W.prev,W,W.next)>0&&ee(ye.prev,ye,ye.next)>0)}function ee(W,ye,Ce){return(ye.y-W.y)*(Ce.x-ye.x)-(ye.x-W.x)*(Ce.y-ye.y)}function C(W,ye){return W.x===ye.x&&W.y===ye.y}function z(W,ye,Ce,Le){var Ne=ne(ee(W,ye,Ce)),$e=ne(ee(W,ye,Le)),Qe=ne(ee(Ce,Le,W)),bt=ne(ee(Ce,Le,ye));return Ne!==$e&&Qe!==bt||!(Ne!==0||!V(W,Ce,ye))||!($e!==0||!V(W,Le,ye))||!(Qe!==0||!V(Ce,W,Le))||!(bt!==0||!V(Ce,ye,Le))}function V(W,ye,Ce){return ye.x<=Math.max(W.x,Ce.x)&&ye.x>=Math.min(W.x,Ce.x)&&ye.y<=Math.max(W.y,Ce.y)&&ye.y>=Math.min(W.y,Ce.y)}function ne(W){return W>0?1:W<0?-1:0}function qe(W,ye){return ee(W.prev,W,W.next)<0?ee(W,ye,W.next)>=0&&ee(W,W.prev,ye)>=0:ee(W,ye,W.prev)<0||ee(W,W.next,ye)<0}function ft(W,ye){var Ce=new Me(W.i,W.x,W.y),Le=new Me(ye.i,ye.x,ye.y),Ne=W.next,$e=ye.prev;return W.next=ye,ye.prev=W,Ce.next=Ne,Ne.prev=Ce,Le.next=Ce,Ce.prev=Le,$e.next=Le,Le.prev=$e,Le}function Pe(W,ye,Ce,Le){var Ne=new Me(W,ye,Ce);return Le?(Ne.next=Le.next,Ne.prev=Le,Le.next.prev=Ne,Le.next=Ne):(Ne.prev=Ne,Ne.next=Ne),Ne}function ae(W){W.next.prev=W.prev,W.prev.next=W.next,W.prevZ&&(W.prevZ.nextZ=W.nextZ),W.nextZ&&(W.nextZ.prevZ=W.prevZ)}function Me(W,ye,Ce){this.i=W,this.x=ye,this.y=Ce,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function De(W,ye,Ce,Le){for(var Ne=0,$e=ye,Qe=Ce-Le;$e<Ce;$e+=Le)Ne+=(W[Qe]-W[$e])*(W[$e+1]+W[Qe+1]),Qe=$e;return Ne}T.exports=b,T.exports.default=b,b.deviation=function(W,ye,Ce,Le){var Ne=ye&&ye.length,$e=Ne?ye[0]*Ce:W.length,Qe=Math.abs(De(W,0,$e,Ce));if(Ne)for(var bt=0,vt=ye.length;bt<vt;bt++){var ln=ye[bt]*Ce,wt=bt<vt-1?ye[bt+1]*Ce:W.length;Qe-=Math.abs(De(W,ln,wt,Ce))}var Wt=0;for(bt=0;bt<Le.length;bt+=3){var qt=Le[bt]*Ce,rn=Le[bt+1]*Ce,Bt=Le[bt+2]*Ce;Wt+=Math.abs((W[qt]-W[Bt])*(W[rn+1]-W[qt+1])-(W[qt]-W[rn])*(W[Bt+1]-W[qt+1]))}return Qe===0&&Wt===0?0:Math.abs((Wt-Qe)/Qe)},b.flatten=function(W){for(var ye=W[0][0].length,Ce={vertices:[],holes:[],dimensions:ye},Le=0,Ne=0;Ne<W.length;Ne++){for(var $e=0;$e<W[Ne].length;$e++)for(var Qe=0;Qe<ye;Qe++)Ce.vertices.push(W[Ne][$e][Qe]);Ne>0&&(Le+=W[Ne-1].length,Ce.holes.push(Le))}return Ce}},function(T,R){T.exports=`varying vec2 vUv;
27
+ }`;var lt=iu(function(){return ai(Se,kt+"return "+gt).apply(void 0,Be)});if(lt.source=gt,Td(lt))throw lt;return lt},S.times=function(c,f){if((c=mn(c))<1||c>9007199254740991)return[];var x=4294967295,A=wi(c,4294967295);c-=4294967295;for(var k=Zu(A,f=Yt(f));++x<c;)f(x);return k},S.toFinite=Wo,S.toInteger=mn,S.toLength=kf,S.toLower=function(c){return bn(c).toLowerCase()},S.toNumber=Lr,S.toSafeInteger=function(c){return c?Go(mn(c),-9007199254740991,9007199254740991):c===0?c:0},S.toString=bn,S.toUpper=function(c){return bn(c).toUpperCase()},S.trim=function(c,f,x){if((c=bn(c))&&(x||f===void 0))return Hc(c);if(!c||!(f=gi(f)))return c;var A=ji(c),k=ji(f);return Tt(A,zc(A,k),jc(A,k)+1).join("")},S.trimEnd=function(c,f,x){if((c=bn(c))&&(x||f===void 0))return c.slice(0,ls(c)+1);if(!c||!(f=gi(f)))return c;var A=ji(c);return Tt(A,0,jc(A,ji(f))+1).join("")},S.trimStart=function(c,f,x){if((c=bn(c))&&(x||f===void 0))return c.replace(In,"");if(!c||!(f=gi(f)))return c;var A=ji(c);return Tt(A,zc(A,ji(f))).join("")},S.truncate=function(c,f){var x=30,A="...";if(ii(f)){var k="separator"in f?f.separator:k;x="length"in f?mn(f.length):x,A="omission"in f?gi(f.omission):A}var ie=(c=bn(c)).length;if(qs(c)){var pe=ji(c);ie=pe.length}if(x>=ie)return c;var Se=x-Do(A);if(Se<1)return A;var Be=pe?Tt(pe,0,Se).join(""):c.slice(0,Se);if(k===void 0)return Be+A;if(pe&&(Se+=Be.length-Se),Md(k)){if(c.slice(Se).search(k)){var tt,nt=Be;for(k.global||(k=Il(k.source,bn(Sr.exec(k))+"g")),k.lastIndex=0;tt=k.exec(nt);)var gt=tt.index;Be=Be.slice(0,gt===void 0?Se:gt)}}else if(c.indexOf(gi(k),Se)!=Se){var Ft=Be.lastIndexOf(k);Ft>-1&&(Be=Be.slice(0,Ft))}return Be+A},S.unescape=function(c){return(c=bn(c))&&wt.test(c)?c.replace(vt,Pl):c},S.uniqueId=function(c){var f=++Ag;return bn(c)+f},S.upperCase=jf,S.upperFirst=nu,S.each=Ef,S.eachRight=Mf,S.first=yd,Uh(S,(zh={},vo(S,function(c,f){Rn.call(S.prototype,f)||(zh[f]=c)}),zh),{chain:!1}),S.VERSION="4.17.21",hr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){S[c].placeholder=S}),hr(["drop","take"],function(c,f){un.prototype[c]=function(x){x=x===void 0?1:Wn(mn(x),0);var A=this.__filtered__&&!f?new un(this):this.clone();return A.__filtered__?A.__takeCount__=wi(x,A.__takeCount__):A.__views__.push({size:wi(x,4294967295),type:c+(A.__dir__<0?"Right":"")}),A},un.prototype[c+"Right"]=function(x){return this.reverse()[c](x).reverse()}}),hr(["filter","map","takeWhile"],function(c,f){var x=f+1,A=x==1||x==3;un.prototype[c]=function(k){var ie=this.clone();return ie.__iteratees__.push({iteratee:Yt(k,3),type:x}),ie.__filtered__=ie.__filtered__||A,ie}}),hr(["head","last"],function(c,f){var x="take"+(f?"Right":"");un.prototype[c]=function(){return this[x](1).value()[0]}}),hr(["initial","tail"],function(c,f){var x="drop"+(f?"":"Right");un.prototype[c]=function(){return this.__filtered__?new un(this):this[x](1)}}),un.prototype.compact=function(){return this.filter(ar)},un.prototype.find=function(c){return this.filter(c).head()},un.prototype.findLast=function(c){return this.reverse().find(c)},un.prototype.invokeMap=fn(function(c,f){return typeof c=="function"?new un(this):this.map(function(x){return ka(x,c,f)})}),un.prototype.reject=function(c){return this.filter(Jl(Yt(c)))},un.prototype.slice=function(c,f){c=mn(c);var x=this;return x.__filtered__&&(c>0||f<0)?new un(x):(c<0?x=x.takeRight(-c):c&&(x=x.drop(c)),f!==void 0&&(x=(f=mn(f))<0?x.dropRight(-f):x.take(f-c)),x)},un.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},un.prototype.toArray=function(){return this.take(4294967295)},vo(un.prototype,function(c,f){var x=/^(?:filter|find|map|reject)|While$/.test(f),A=/^(?:head|last)$/.test(f),k=S[A?"take"+(f=="last"?"Right":""):f],ie=A||/^find/.test(f);k&&(S.prototype[f]=function(){var pe=this.__wrapped__,Se=A?[1]:arguments,Be=pe instanceof un,tt=Se[0],nt=Be||on(pe),gt=function(Vt){var Lt=k.apply(S,Lo([Vt],Se));return A&&Ft?Lt[0]:Lt};nt&&x&&typeof tt=="function"&&tt.length!=1&&(Be=nt=!1);var Ft=this.__chain__,kt=!!this.__actions__.length,$t=ie&&!Ft,lt=Be&&!kt;if(!ie&&nt){pe=lt?pe:new un(this);var _t=c.apply(pe,Se);return _t.__actions__.push({func:Mh,args:[gt],thisArg:void 0}),new Zn(_t,Ft)}return $t&&lt?c.apply(this,Se):(_t=this.thru(gt),$t?A?_t.value()[0]:_t.value():_t)})}),hr(["pop","push","shift","sort","splice","unshift"],function(c){var f=Ol[c],x=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",A=/^(?:pop|shift)$/.test(c);S.prototype[c]=function(){var k=arguments;if(A&&!this.__chain__){var ie=this.value();return f.apply(on(ie)?ie:[],k)}return this[x](function(pe){return f.apply(on(pe)?pe:[],k)})}}),vo(un.prototype,function(c,f){var x=S[f];if(x){var A=x.name+"";Rn.call(Ur,A)||(Ur[A]=[]),Ur[A].push({name:f,func:x})}}),Ur[Wa(void 0,2).name]=[{name:"wrapper",func:void 0}],un.prototype.clone=function(){var c=new un(this.__wrapped__);return c.__actions__=Ai(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Ai(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Ai(this.__views__),c},un.prototype.reverse=function(){if(this.__filtered__){var c=new un(this);c.__dir__=-1,c.__filtered__=!0}else(c=this.clone()).__dir__*=-1;return c},un.prototype.value=function(){var c=this.__wrapped__.value(),f=this.__dir__,x=on(c),A=f<0,k=x?c.length:0,ie=function(dn,zt,en){for(var hi=-1,qi=en.length;++hi<qi;){var ci=en[hi],oi=ci.size;switch(ci.type){case"drop":dn+=oi;break;case"dropRight":zt-=oi;break;case"take":zt=wi(zt,dn+oi);break;case"takeRight":dn=Wn(dn,zt-oi)}}return{start:dn,end:zt}}(0,k,this.__views__),pe=ie.start,Se=ie.end,Be=Se-pe,tt=A?Se:pe-1,nt=this.__iteratees__,gt=nt.length,Ft=0,kt=wi(Be,this.__takeCount__);if(!x||!A&&k==Be&&kt==Be)return od(c,this.__actions__);var $t=[];e:for(;Be--&&Ft<kt;){for(var lt=-1,_t=c[tt+=f];++lt<gt;){var Vt=nt[lt],Lt=Vt.iteratee,jt=Vt.type,Kt=Lt(_t);if(jt==2)_t=Kt;else if(!Kt){if(jt==1)continue e;break e}}$t[Ft++]=_t}return $t},S.prototype.at=Jg,S.prototype.chain=function(){return Tf(this)},S.prototype.commit=function(){return new Zn(this.value(),this.__chain__)},S.prototype.next=function(){this.__values__===void 0&&(this.__values__=Uf(this.value()));var c=this.__index__>=this.__values__.length;return{done:c,value:c?void 0:this.__values__[this.__index__++]}},S.prototype.plant=function(c){for(var f,x=this;x instanceof Ul;){var A=yf(x);A.__index__=0,A.__values__=void 0,f?k.__wrapped__=A:f=A;var k=A;x=x.__wrapped__}return k.__wrapped__=c,f},S.prototype.reverse=function(){var c=this.__wrapped__;if(c instanceof un){var f=c;return this.__actions__.length&&(f=new un(this)),(f=f.reverse()).__actions__.push({func:Mh,args:[xd],thisArg:void 0}),new Zn(f,this.__chain__)}return this.thru(xd)},S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=function(){return od(this.__wrapped__,this.__actions__)},S.prototype.first=S.prototype.head,po&&(S.prototype[po]=function(){return this}),S}();ti._=Ys,(fe=function(){return Ys}.call(R,v,R,te))===void 0||(te.exports=fe)}).call(this)}).call(this,v(4),v(8)(T))},function(T,R,v){(function(b){T.exports=function te(fe,$,L){function Y(K,xe){if(!$[K]){if(!fe[K]){if(j)return j(K,!0);var Re=new Error("Cannot find module '"+K+"'");throw Re.code="MODULE_NOT_FOUND",Re}var Ie=$[K]={exports:{}};fe[K][0].call(Ie.exports,function(M){var N=fe[K][1][M];return Y(N||M)},Ie,Ie.exports,te,fe,$,L)}return $[K].exports}for(var j=!1,F=0;F<L.length;F++)Y(L[F]);return Y}({1:[function(te,fe,$){(function(L){var Y,j,F=L.MutationObserver||L.WebKitMutationObserver;if(F){var K=0,xe=new F(N),Re=L.document.createTextNode("");xe.observe(Re,{characterData:!0}),Y=function(){Re.data=K=++K%2}}else if(L.setImmediate||L.MessageChannel===void 0)Y="document"in L&&"onreadystatechange"in L.document.createElement("script")?function(){var D=L.document.createElement("script");D.onreadystatechange=function(){N(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},L.document.documentElement.appendChild(D)}:function(){setTimeout(N,0)};else{var Ie=new L.MessageChannel;Ie.port1.onmessage=N,Y=function(){Ie.port2.postMessage(0)}}var M=[];function N(){var D,ee;j=!0;for(var C=M.length;C;){for(ee=M,M=[],D=-1;++D<C;)ee[D]();C=M.length}j=!1}fe.exports=function(D){M.push(D)!==1||j||Y()}}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(te,fe,$){var L=te(1);function Y(){}var j={},F=["REJECTED"],K=["FULFILLED"],xe=["PENDING"];function Re(C){if(typeof C!="function")throw new TypeError("resolver must be a function");this.state=xe,this.queue=[],this.outcome=void 0,C!==Y&&D(this,C)}function Ie(C,z,V){this.promise=C,typeof z=="function"&&(this.onFulfilled=z,this.callFulfilled=this.otherCallFulfilled),typeof V=="function"&&(this.onRejected=V,this.callRejected=this.otherCallRejected)}function M(C,z,V){L(function(){var ne;try{ne=z(V)}catch(qe){return j.reject(C,qe)}ne===C?j.reject(C,new TypeError("Cannot resolve promise with itself")):j.resolve(C,ne)})}function N(C){var z=C&&C.then;if(C&&(typeof C=="object"||typeof C=="function")&&typeof z=="function")return function(){z.apply(C,arguments)}}function D(C,z){var V=!1;function ne(Pe){V||(V=!0,j.reject(C,Pe))}function qe(Pe){V||(V=!0,j.resolve(C,Pe))}var ft=ee(function(){z(qe,ne)});ft.status==="error"&&ne(ft.value)}function ee(C,z){var V={};try{V.value=C(z),V.status="success"}catch(ne){V.status="error",V.value=ne}return V}fe.exports=Re,Re.prototype.catch=function(C){return this.then(null,C)},Re.prototype.then=function(C,z){if(typeof C!="function"&&this.state===K||typeof z!="function"&&this.state===F)return this;var V=new this.constructor(Y);return this.state!==xe?M(V,this.state===K?C:z,this.outcome):this.queue.push(new Ie(V,C,z)),V},Ie.prototype.callFulfilled=function(C){j.resolve(this.promise,C)},Ie.prototype.otherCallFulfilled=function(C){M(this.promise,this.onFulfilled,C)},Ie.prototype.callRejected=function(C){j.reject(this.promise,C)},Ie.prototype.otherCallRejected=function(C){M(this.promise,this.onRejected,C)},j.resolve=function(C,z){var V=ee(N,z);if(V.status==="error")return j.reject(C,V.value);var ne=V.value;if(ne)D(C,ne);else{C.state=K,C.outcome=z;for(var qe=-1,ft=C.queue.length;++qe<ft;)C.queue[qe].callFulfilled(z)}return C},j.reject=function(C,z){C.state=F,C.outcome=z;for(var V=-1,ne=C.queue.length;++V<ne;)C.queue[V].callRejected(z);return C},Re.resolve=function(C){return C instanceof this?C:j.resolve(new this(Y),C)},Re.reject=function(C){var z=new this(Y);return j.reject(z,C)},Re.all=function(C){var z=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=C.length,ne=!1;if(!V)return this.resolve([]);for(var qe=new Array(V),ft=0,Pe=-1,ae=new this(Y);++Pe<V;)Me(C[Pe],Pe);return ae;function Me(De,W){z.resolve(De).then(function(ye){qe[W]=ye,++ft!==V||ne||(ne=!0,j.resolve(ae,qe))},function(ye){ne||(ne=!0,j.reject(ae,ye))})}},Re.race=function(C){var z=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=C.length,ne=!1;if(!V)return this.resolve([]);for(var qe,ft=-1,Pe=new this(Y);++ft<V;)qe=C[ft],z.resolve(qe).then(function(ae){ne||(ne=!0,j.resolve(Pe,ae))},function(ae){ne||(ne=!0,j.reject(Pe,ae))});return Pe}},{1:1}],3:[function(te,fe,$){(function(L){typeof L.Promise!="function"&&(L.Promise=te(2))}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(te,fe,$){var L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},Y=function(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}();function j(E,I){E=E||[],I=I||{};try{return new Blob(E,I)}catch(J){if(J.name!=="TypeError")throw J;for(var O=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),Q=0;Q<E.length;Q+=1)O.append(E[Q]);return O.getBlob(I.type)}}typeof Promise=="undefined"&&te(3);var F=Promise;function K(E,I){I&&E.then(function(O){I(null,O)},function(O){I(O)})}function xe(E,I,O){typeof I=="function"&&E.then(I),typeof O=="function"&&E.catch(O)}function Re(E){return typeof E!="string"&&(console.warn(E+" used as a key, but it is not a string."),E=String(E)),E}function Ie(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var M=void 0,N={},D=Object.prototype.toString;function ee(E){return typeof M=="boolean"?F.resolve(M):function(I){return new F(function(O){var Q=I.transaction("local-forage-detect-blob-support","readwrite"),J=j([""]);Q.objectStore("local-forage-detect-blob-support").put(J,"key"),Q.onabort=function(Z){Z.preventDefault(),Z.stopPropagation(),O(!1)},Q.oncomplete=function(){var Z=navigator.userAgent.match(/Chrome\/(\d+)/),se=navigator.userAgent.match(/Edge\//);O(se||!Z||parseInt(Z[1],10)>=43)}}).catch(function(){return!1})}(E).then(function(I){return M=I})}function C(E){var I=N[E.name],O={};O.promise=new F(function(Q,J){O.resolve=Q,O.reject=J}),I.deferredOperations.push(O),I.dbReady?I.dbReady=I.dbReady.then(function(){return O.promise}):I.dbReady=O.promise}function z(E){var I=N[E.name].deferredOperations.pop();if(I)return I.resolve(),I.promise}function V(E,I){var O=N[E.name].deferredOperations.pop();if(O)return O.reject(I),O.promise}function ne(E,I){return new F(function(O,Q){if(N[E.name]=N[E.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},E.db){if(!I)return O(E.db);C(E),E.db.close()}var J=[E.name];I&&J.push(E.version);var Z=Y.open.apply(Y,J);I&&(Z.onupgradeneeded=function(se){var ge=Z.result;try{ge.createObjectStore(E.storeName),se.oldVersion<=1&&ge.createObjectStore("local-forage-detect-blob-support")}catch(be){if(be.name!=="ConstraintError")throw be;console.warn('The database "'+E.name+'" has been upgraded from version '+se.oldVersion+" to version "+se.newVersion+', but the storage "'+E.storeName+'" already exists.')}}),Z.onerror=function(se){se.preventDefault(),Q(Z.error)},Z.onsuccess=function(){O(Z.result),z(E)}})}function qe(E){return ne(E,!1)}function ft(E){return ne(E,!0)}function Pe(E,I){if(!E.db)return!0;var O=!E.db.objectStoreNames.contains(E.storeName),Q=E.version<E.db.version,J=E.version>E.db.version;if(Q&&(E.version!==I&&console.warn('The database "'+E.name+`" can't be downgraded from version `+E.db.version+" to version "+E.version+"."),E.version=E.db.version),J||O){if(O){var Z=E.db.version+1;Z>E.version&&(E.version=Z)}return!0}return!1}function ae(E){return j([function(I){for(var O=I.length,Q=new ArrayBuffer(O),J=new Uint8Array(Q),Z=0;Z<O;Z++)J[Z]=I.charCodeAt(Z);return Q}(atob(E.data))],{type:E.type})}function Me(E){return E&&E.__local_forage_encoded_blob}function De(E){var I=this,O=I._initReady().then(function(){var Q=N[I._dbInfo.name];if(Q&&Q.dbReady)return Q.dbReady});return xe(O,E,E),O}function W(E,I,O,Q){Q===void 0&&(Q=1);try{var J=E.db.transaction(E.storeName,I);O(null,J)}catch(Z){if(Q>0&&(!E.db||Z.name==="InvalidStateError"||Z.name==="NotFoundError"))return F.resolve().then(function(){if(!E.db||Z.name==="NotFoundError"&&!E.db.objectStoreNames.contains(E.storeName)&&E.version<=E.db.version)return E.db&&(E.version=E.db.version+1),ft(E)}).then(function(){return function(se){C(se);for(var ge=N[se.name],be=ge.forages,we=0;we<be.length;we++){var Fe=be[we];Fe._dbInfo.db&&(Fe._dbInfo.db.close(),Fe._dbInfo.db=null)}return se.db=null,qe(se).then(function(Ye){return se.db=Ye,Pe(se)?ft(se):Ye}).then(function(Ye){se.db=ge.db=Ye;for(var ht=0;ht<be.length;ht++)be[ht]._dbInfo.db=Ye}).catch(function(Ye){throw V(se,Ye),Ye})}(E).then(function(){W(E,I,O,Q-1)})}).catch(O);O(Z)}}var ye={_driver:"asyncStorage",_initStorage:function(E){var I=this,O={db:null};if(E)for(var Q in E)O[Q]=E[Q];var J=N[O.name];J||(J={forages:[],db:null,dbReady:null,deferredOperations:[]},N[O.name]=J),J.forages.push(I),I._initReady||(I._initReady=I.ready,I.ready=De);var Z=[];function se(){return F.resolve()}for(var ge=0;ge<J.forages.length;ge++){var be=J.forages[ge];be!==I&&Z.push(be._initReady().catch(se))}var we=J.forages.slice(0);return F.all(Z).then(function(){return O.db=J.db,qe(O)}).then(function(Fe){return O.db=Fe,Pe(O,I._defaultConfig.version)?ft(O):Fe}).then(function(Fe){O.db=J.db=Fe,I._dbInfo=O;for(var Ye=0;Ye<we.length;Ye++){var ht=we[Ye];ht!==I&&(ht._dbInfo.db=O.db,ht._dbInfo.version=O.version)}})},_support:function(){try{if(!Y||!Y.open)return!1;var E=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),I=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!E||I)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).openCursor(),we=1;be.onsuccess=function(){var Fe=be.result;if(Fe){var Ye=Fe.value;Me(Ye)&&(Ye=ae(Ye));var ht=E(Ye,Fe.key,we++);ht!==void 0?J(ht):Fe.continue()}else J()},be.onerror=function(){Z(be.error)}}catch(Fe){Z(Fe)}})}).catch(Z)});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).get(E);be.onsuccess=function(){var we=be.result;we===void 0&&(we=null),Me(we)&&(we=ae(we)),J(we)},be.onerror=function(){Z(be.error)}}catch(we){Z(we)}})}).catch(Z)});return K(Q,I),Q},setItem:function(E,I,O){var Q=this;E=Re(E);var J=new F(function(Z,se){var ge;Q.ready().then(function(){return ge=Q._dbInfo,D.call(I)==="[object Blob]"?ee(ge.db).then(function(be){return be?I:(we=I,new F(function(Fe,Ye){var ht=new FileReader;ht.onerror=Ye,ht.onloadend=function(xt){var Ot=btoa(xt.target.result||"");Fe({__local_forage_encoded_blob:!0,data:Ot,type:we.type})},ht.readAsBinaryString(we)}));var we}):I}).then(function(be){W(Q._dbInfo,"readwrite",function(we,Fe){if(we)return se(we);try{var Ye=Fe.objectStore(Q._dbInfo.storeName);be===null&&(be=void 0);var ht=Ye.put(be,E);Fe.oncomplete=function(){be===void 0&&(be=null),Z(be)},Fe.onabort=Fe.onerror=function(){var xt=ht.error?ht.error:ht.transaction.error;se(xt)}}catch(xt){se(xt)}})}).catch(se)});return K(J,O),J},removeItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readwrite",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).delete(E);ge.oncomplete=function(){J()},ge.onerror=function(){Z(be.error)},ge.onabort=function(){var we=be.error?be.error:be.transaction.error;Z(we)}}catch(we){Z(we)}})}).catch(Z)});return K(Q,I),Q},clear:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readwrite",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).clear();se.oncomplete=function(){Q()},se.onabort=se.onerror=function(){var be=ge.error?ge.error:ge.transaction.error;J(be)}}catch(be){J(be)}})}).catch(J)});return K(O,E),O},length:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readonly",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).count();ge.onsuccess=function(){Q(ge.result)},ge.onerror=function(){J(ge.error)}}catch(be){J(be)}})}).catch(J)});return K(O,E),O},key:function(E,I){var O=this,Q=new F(function(J,Z){E<0?J(null):O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName),we=!1,Fe=be.openKeyCursor();Fe.onsuccess=function(){var Ye=Fe.result;Ye?E===0||we?J(Ye.key):(we=!0,Ye.advance(E)):J(null)},Fe.onerror=function(){Z(Fe.error)}}catch(Ye){Z(Ye)}})}).catch(Z)});return K(Q,I),Q},keys:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readonly",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).openKeyCursor(),be=[];ge.onsuccess=function(){var we=ge.result;we?(be.push(we.key),we.continue()):Q(be)},ge.onerror=function(){J(ge.error)}}catch(we){J(we)}})}).catch(J)});return K(O,E),O},dropInstance:function(E,I){I=Ie.apply(this,arguments);var O=this.config();(E=typeof E!="function"&&E||{}).name||(E.name=E.name||O.name,E.storeName=E.storeName||O.storeName);var Q,J=this;if(E.name){var Z=E.name===O.name&&J._dbInfo.db,se=Z?F.resolve(J._dbInfo.db):qe(E).then(function(ge){var be=N[E.name],we=be.forages;be.db=ge;for(var Fe=0;Fe<we.length;Fe++)we[Fe]._dbInfo.db=ge;return ge});Q=E.storeName?se.then(function(ge){if(ge.objectStoreNames.contains(E.storeName)){var be=ge.version+1;C(E);var we=N[E.name],Fe=we.forages;ge.close();for(var Ye=0;Ye<Fe.length;Ye++){var ht=Fe[Ye];ht._dbInfo.db=null,ht._dbInfo.version=be}return new F(function(xt,Ot){var Gt=Y.open(E.name,be);Gt.onerror=function(fi){Gt.result.close(),Ot(fi)},Gt.onupgradeneeded=function(){Gt.result.deleteObjectStore(E.storeName)},Gt.onsuccess=function(){var fi=Gt.result;fi.close(),xt(fi)}}).then(function(xt){we.db=xt;for(var Ot=0;Ot<Fe.length;Ot++){var Gt=Fe[Ot];Gt._dbInfo.db=xt,z(Gt._dbInfo)}}).catch(function(xt){throw(V(E,xt)||F.resolve()).catch(function(){}),xt})}}):se.then(function(ge){C(E);var be=N[E.name],we=be.forages;ge.close();for(var Fe=0;Fe<we.length;Fe++)we[Fe]._dbInfo.db=null;return new F(function(Ye,ht){var xt=Y.deleteDatabase(E.name);xt.onerror=xt.onblocked=function(Ot){var Gt=xt.result;Gt&&Gt.close(),ht(Ot)},xt.onsuccess=function(){var Ot=xt.result;Ot&&Ot.close(),Ye(Ot)}}).then(function(Ye){be.db=Ye;for(var ht=0;ht<we.length;ht++)z(we[ht]._dbInfo)}).catch(function(Ye){throw(V(E,Ye)||F.resolve()).catch(function(){}),Ye})})}else Q=F.reject("Invalid arguments");return K(Q,I),Q}},Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Le=/^~~local_forage_type~([^~]+)~/,Ne=9,$e=Ne+4,Qe=Object.prototype.toString;function bt(E){var I,O,Q,J,Z,se=.75*E.length,ge=E.length,be=0;E[E.length-1]==="="&&(se--,E[E.length-2]==="="&&se--);var we=new ArrayBuffer(se),Fe=new Uint8Array(we);for(I=0;I<ge;I+=4)O=Ce.indexOf(E[I]),Q=Ce.indexOf(E[I+1]),J=Ce.indexOf(E[I+2]),Z=Ce.indexOf(E[I+3]),Fe[be++]=O<<2|Q>>4,Fe[be++]=(15&Q)<<4|J>>2,Fe[be++]=(3&J)<<6|63&Z;return we}function vt(E){var I,O=new Uint8Array(E),Q="";for(I=0;I<O.length;I+=3)Q+=Ce[O[I]>>2],Q+=Ce[(3&O[I])<<4|O[I+1]>>4],Q+=Ce[(15&O[I+1])<<2|O[I+2]>>6],Q+=Ce[63&O[I+2]];return O.length%3==2?Q=Q.substring(0,Q.length-1)+"=":O.length%3==1&&(Q=Q.substring(0,Q.length-2)+"=="),Q}var ln={serialize:function(E,I){var O="";if(E&&(O=Qe.call(E)),E&&(O==="[object ArrayBuffer]"||E.buffer&&Qe.call(E.buffer)==="[object ArrayBuffer]")){var Q,J="__lfsc__:";E instanceof ArrayBuffer?(Q=E,J+="arbf"):(Q=E.buffer,O==="[object Int8Array]"?J+="si08":O==="[object Uint8Array]"?J+="ui08":O==="[object Uint8ClampedArray]"?J+="uic8":O==="[object Int16Array]"?J+="si16":O==="[object Uint16Array]"?J+="ur16":O==="[object Int32Array]"?J+="si32":O==="[object Uint32Array]"?J+="ui32":O==="[object Float32Array]"?J+="fl32":O==="[object Float64Array]"?J+="fl64":I(new Error("Failed to get type for BinaryArray"))),I(J+vt(Q))}else if(O==="[object Blob]"){var Z=new FileReader;Z.onload=function(){var se="~~local_forage_type~"+E.type+"~"+vt(this.result);I("__lfsc__:blob"+se)},Z.readAsArrayBuffer(E)}else try{I(JSON.stringify(E))}catch(se){console.error("Couldn't convert value into a JSON string: ",E),I(null,se)}},deserialize:function(E){if(E.substring(0,Ne)!=="__lfsc__:")return JSON.parse(E);var I,O=E.substring($e),Q=E.substring(Ne,$e);if(Q==="blob"&&Le.test(O)){var J=O.match(Le);I=J[1],O=O.substring(J[0].length)}var Z=bt(O);switch(Q){case"arbf":return Z;case"blob":return j([Z],{type:I});case"si08":return new Int8Array(Z);case"ui08":return new Uint8Array(Z);case"uic8":return new Uint8ClampedArray(Z);case"si16":return new Int16Array(Z);case"ur16":return new Uint16Array(Z);case"si32":return new Int32Array(Z);case"ui32":return new Uint32Array(Z);case"fl32":return new Float32Array(Z);case"fl64":return new Float64Array(Z);default:throw new Error("Unkown type: "+Q)}},stringToBuffer:bt,bufferToString:vt};function wt(E,I,O,Q){E.executeSql("CREATE TABLE IF NOT EXISTS "+I.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],O,Q)}function Wt(E,I,O,Q,J,Z){E.executeSql(O,Q,J,function(se,ge){ge.code===ge.SYNTAX_ERR?se.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[I.storeName],function(be,we){we.rows.length?Z(be,ge):wt(be,I,function(){be.executeSql(O,Q,J,Z)},Z)},Z):Z(se,ge)},Z)}function qt(E,I,O,Q){var J=this;E=Re(E);var Z=new F(function(se,ge){J.ready().then(function(){I===void 0&&(I=null);var be=I,we=J._dbInfo;we.serializer.serialize(I,function(Fe,Ye){Ye?ge(Ye):we.db.transaction(function(ht){Wt(ht,we,"INSERT OR REPLACE INTO "+we.storeName+" (key, value) VALUES (?, ?)",[E,Fe],function(){se(be)},function(xt,Ot){ge(Ot)})},function(ht){if(ht.code===ht.QUOTA_ERR){if(Q>0)return void se(qt.apply(J,[E,be,O,Q-1]));ge(ht)}})})}).catch(ge)});return K(Z,O),Z}function rn(E){return new F(function(I,O){E.transaction(function(Q){Q.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(J,Z){for(var se=[],ge=0;ge<Z.rows.length;ge++)se.push(Z.rows.item(ge).name);I({db:E,storeNames:se})},function(J,Z){O(Z)})},function(Q){O(Q)})})}var Bt={_driver:"webSQLStorage",_initStorage:function(E){var I=this,O={db:null};if(E)for(var Q in E)O[Q]=typeof E[Q]!="string"?E[Q].toString():E[Q];var J=new F(function(Z,se){try{O.db=openDatabase(O.name,String(O.version),O.description,O.size)}catch(ge){return se(ge)}O.db.transaction(function(ge){wt(ge,O,function(){I._dbInfo=O,Z()},function(be,we){se(we)})},se)});return O.serializer=ln,J},_support:typeof openDatabase=="function",iterate:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT * FROM "+se.storeName,[],function(be,we){for(var Fe=we.rows,Ye=Fe.length,ht=0;ht<Ye;ht++){var xt=Fe.item(ht),Ot=xt.value;if(Ot&&(Ot=se.serializer.deserialize(Ot)),(Ot=E(Ot,xt.key,ht+1))!==void 0)return void J(Ot)}J()},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT * FROM "+se.storeName+" WHERE key = ? LIMIT 1",[E],function(be,we){var Fe=we.rows.length?we.rows.item(0).value:null;Fe&&(Fe=se.serializer.deserialize(Fe)),J(Fe)},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},setItem:function(E,I,O){return qt.apply(this,[E,I,O,1])},removeItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"DELETE FROM "+se.storeName+" WHERE key = ?",[E],function(){J()},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},clear:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"DELETE FROM "+Z.storeName,[],function(){Q()},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},length:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"SELECT COUNT(key) as c FROM "+Z.storeName,[],function(ge,be){var we=be.rows.item(0).c;Q(we)},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},key:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT key FROM "+se.storeName+" WHERE id = ? LIMIT 1",[E+1],function(be,we){var Fe=we.rows.length?we.rows.item(0).key:null;J(Fe)},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},keys:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"SELECT key FROM "+Z.storeName,[],function(ge,be){for(var we=[],Fe=0;Fe<be.rows.length;Fe++)we.push(be.rows.item(Fe).key);Q(we)},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},dropInstance:function(E,I){I=Ie.apply(this,arguments);var O=this.config();(E=typeof E!="function"&&E||{}).name||(E.name=E.name||O.name,E.storeName=E.storeName||O.storeName);var Q,J=this;return K(Q=E.name?new F(function(Z){var se;se=E.name===O.name?J._dbInfo.db:openDatabase(E.name,"","",0),E.storeName?Z({db:se,storeNames:[E.storeName]}):Z(rn(se))}).then(function(Z){return new F(function(se,ge){Z.db.transaction(function(be){function we(xt){return new F(function(Ot,Gt){be.executeSql("DROP TABLE IF EXISTS "+xt,[],function(){Ot()},function(fi,nr){Gt(nr)})})}for(var Fe=[],Ye=0,ht=Z.storeNames.length;Ye<ht;Ye++)Fe.push(we(Z.storeNames[Ye]));F.all(Fe).then(function(){se()}).catch(function(xt){ge(xt)})},function(be){ge(be)})})}):F.reject("Invalid arguments"),I),Q}};function Dn(E,I){var O=E.name+"/";return E.storeName!==I.storeName&&(O+=E.storeName+"/"),O}function Fn(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var Mn={_driver:"localStorageWrapper",_initStorage:function(E){var I={};if(E)for(var O in E)I[O]=E[O];return I.keyPrefix=Dn(E,this._defaultConfig),Fn()?(this._dbInfo=I,I.serializer=ln,F.resolve()):F.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(E,I){var O=this,Q=O.ready().then(function(){for(var J=O._dbInfo,Z=J.keyPrefix,se=Z.length,ge=localStorage.length,be=1,we=0;we<ge;we++){var Fe=localStorage.key(we);if(Fe.indexOf(Z)===0){var Ye=localStorage.getItem(Fe);if(Ye&&(Ye=J.serializer.deserialize(Ye)),(Ye=E(Ye,Fe.substring(se),be++))!==void 0)return Ye}}});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=O.ready().then(function(){var J=O._dbInfo,Z=localStorage.getItem(J.keyPrefix+E);return Z&&(Z=J.serializer.deserialize(Z)),Z});return K(Q,I),Q},setItem:function(E,I,O){var Q=this;E=Re(E);var J=Q.ready().then(function(){I===void 0&&(I=null);var Z=I;return new F(function(se,ge){var be=Q._dbInfo;be.serializer.serialize(I,function(we,Fe){if(Fe)ge(Fe);else try{localStorage.setItem(be.keyPrefix+E,we),se(Z)}catch(Ye){Ye.name!=="QuotaExceededError"&&Ye.name!=="NS_ERROR_DOM_QUOTA_REACHED"||ge(Ye),ge(Ye)}})})});return K(J,O),J},removeItem:function(E,I){var O=this;E=Re(E);var Q=O.ready().then(function(){var J=O._dbInfo;localStorage.removeItem(J.keyPrefix+E)});return K(Q,I),Q},clear:function(E){var I=this,O=I.ready().then(function(){for(var Q=I._dbInfo.keyPrefix,J=localStorage.length-1;J>=0;J--){var Z=localStorage.key(J);Z.indexOf(Q)===0&&localStorage.removeItem(Z)}});return K(O,E),O},length:function(E){var I=this.keys().then(function(O){return O.length});return K(I,E),I},key:function(E,I){var O=this,Q=O.ready().then(function(){var J,Z=O._dbInfo;try{J=localStorage.key(E)}catch{J=null}return J&&(J=J.substring(Z.keyPrefix.length)),J});return K(Q,I),Q},keys:function(E){var I=this,O=I.ready().then(function(){for(var Q=I._dbInfo,J=localStorage.length,Z=[],se=0;se<J;se++){var ge=localStorage.key(se);ge.indexOf(Q.keyPrefix)===0&&Z.push(ge.substring(Q.keyPrefix.length))}return Z});return K(O,E),O},dropInstance:function(E,I){if(I=Ie.apply(this,arguments),!(E=typeof E!="function"&&E||{}).name){var O=this.config();E.name=E.name||O.name,E.storeName=E.storeName||O.storeName}var Q,J=this;return K(Q=E.name?new F(function(Z){E.storeName?Z(Dn(E,J._defaultConfig)):Z(E.name+"/")}).then(function(Z){for(var se=localStorage.length-1;se>=0;se--){var ge=localStorage.key(se);ge.indexOf(Z)===0&&localStorage.removeItem(ge)}}):F.reject("Invalid arguments"),I),Q}},jn=function(E,I){for(var O,Q,J=E.length,Z=0;Z<J;){if((O=E[Z])===(Q=I)||typeof O=="number"&&typeof Q=="number"&&isNaN(O)&&isNaN(Q))return!0;Z++}return!1},An=Array.isArray||function(E){return Object.prototype.toString.call(E)==="[object Array]"},In={},di={},Ln={INDEXEDDB:ye,WEBSQL:Bt,LOCALSTORAGE:Mn},Fi=[Ln.INDEXEDDB._driver,Ln.WEBSQL._driver,Ln.LOCALSTORAGE._driver],pi=["dropInstance"],uo=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pi),Co={description:"",driver:Fi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Oa(E,I){E[I]=function(){var O=arguments;return E.ready().then(function(){return E[I].apply(E,O)})}}function ho(){for(var E=1;E<arguments.length;E++){var I=arguments[E];if(I)for(var O in I)I.hasOwnProperty(O)&&(An(I[O])?arguments[0][O]=I[O].slice():arguments[0][O]=I[O])}return arguments[0]}var Sr=new(function(){function E(I){for(var O in function(Z,se){if(!(Z instanceof se))throw new TypeError("Cannot call a class as a function")}(this,E),Ln)if(Ln.hasOwnProperty(O)){var Q=Ln[O],J=Q._driver;this[O]=J,In[J]||this.defineDriver(Q)}this._defaultConfig=ho({},Co),this._config=ho({},this._defaultConfig,I),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return E.prototype.config=function(I){if((I===void 0?"undefined":L(I))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var O in I){if(O==="storeName"&&(I[O]=I[O].replace(/\W/g,"_")),O==="version"&&typeof I[O]!="number")return new Error("Database version must be a number.");this._config[O]=I[O]}return!("driver"in I)||!I.driver||this.setDriver(this._config.driver)}return typeof I=="string"?this._config[I]:this._config},E.prototype.defineDriver=function(I,O,Q){var J=new F(function(Z,se){try{var ge=I._driver,be=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!I._driver)return void se(be);for(var we=uo.concat("_initStorage"),Fe=0,Ye=we.length;Fe<Ye;Fe++){var ht=we[Fe];if((!jn(pi,ht)||I[ht])&&typeof I[ht]!="function")return void se(be)}(function(){for(var Ot=function(Po){return function(){var Hs=new Error("Method "+Po+" is not implemented by the current driver"),Gn=F.reject(Hs);return K(Gn,arguments[arguments.length-1]),Gn}},Gt=0,fi=pi.length;Gt<fi;Gt++){var nr=pi[Gt];I[nr]||(I[nr]=Ot(nr))}})();var xt=function(Ot){In[ge]&&console.info("Redefining LocalForage driver: "+ge),In[ge]=I,di[ge]=Ot,Z()};"_support"in I?I._support&&typeof I._support=="function"?I._support().then(xt,se):xt(!!I._support):xt(!0)}catch(Ot){se(Ot)}});return xe(J,O,Q),J},E.prototype.driver=function(){return this._driver||null},E.prototype.getDriver=function(I,O,Q){var J=In[I]?F.resolve(In[I]):F.reject(new Error("Driver not found."));return xe(J,O,Q),J},E.prototype.getSerializer=function(I){var O=F.resolve(ln);return xe(O,I),O},E.prototype.ready=function(I){var O=this,Q=O._driverSet.then(function(){return O._ready===null&&(O._ready=O._initDriver()),O._ready});return xe(Q,I,I),Q},E.prototype.setDriver=function(I,O,Q){var J=this;An(I)||(I=[I]);var Z=this._getSupportedDrivers(I);function se(){J._config.driver=J.driver()}function ge(we){return J._extend(we),se(),J._ready=J._initStorage(J._config),J._ready}var be=this._driverSet!==null?this._driverSet.catch(function(){return F.resolve()}):F.resolve();return this._driverSet=be.then(function(){var we=Z[0];return J._dbInfo=null,J._ready=null,J.getDriver(we).then(function(Fe){J._driver=Fe._driver,se(),J._wrapLibraryMethodsWithReady(),J._initDriver=function(Ye){return function(){var ht=0;return function xt(){for(;ht<Ye.length;){var Ot=Ye[ht];return ht++,J._dbInfo=null,J._ready=null,J.getDriver(Ot).then(ge).catch(xt)}se();var Gt=new Error("No available storage method found.");return J._driverSet=F.reject(Gt),J._driverSet}()}}(Z)})}).catch(function(){se();var we=new Error("No available storage method found.");return J._driverSet=F.reject(we),J._driverSet}),xe(this._driverSet,O,Q),this._driverSet},E.prototype.supports=function(I){return!!di[I]},E.prototype._extend=function(I){ho(this,I)},E.prototype._getSupportedDrivers=function(I){for(var O=[],Q=0,J=I.length;Q<J;Q++){var Z=I[Q];this.supports(Z)&&O.push(Z)}return O},E.prototype._wrapLibraryMethodsWithReady=function(){for(var I=0,O=uo.length;I<O;I++)Oa(this,uo[I])},E.prototype.createInstance=function(I){return new E(I)},E}());fe.exports=Sr},{3:3}]},{},[4])(4)}).call(this,v(4))},function(T,R,v){var b;(function(te){function fe(C,z){var V=(65535&C)+(65535&z);return(C>>16)+(z>>16)+(V>>16)<<16|65535&V}function $(C,z,V,ne,qe,ft){return fe((Pe=fe(fe(z,C),fe(ne,ft)))<<(ae=qe)|Pe>>>32-ae,V);var Pe,ae}function L(C,z,V,ne,qe,ft,Pe){return $(z&V|~z&ne,C,z,qe,ft,Pe)}function Y(C,z,V,ne,qe,ft,Pe){return $(z&ne|V&~ne,C,z,qe,ft,Pe)}function j(C,z,V,ne,qe,ft,Pe){return $(z^V^ne,C,z,qe,ft,Pe)}function F(C,z,V,ne,qe,ft,Pe){return $(V^(z|~ne),C,z,qe,ft,Pe)}function K(C,z){var V,ne,qe,ft,Pe;C[z>>5]|=128<<z%32,C[14+(z+64>>>9<<4)]=z;var ae=1732584193,Me=-271733879,De=-1732584194,W=271733878;for(V=0;V<C.length;V+=16)ne=ae,qe=Me,ft=De,Pe=W,ae=L(ae,Me,De,W,C[V],7,-680876936),W=L(W,ae,Me,De,C[V+1],12,-389564586),De=L(De,W,ae,Me,C[V+2],17,606105819),Me=L(Me,De,W,ae,C[V+3],22,-1044525330),ae=L(ae,Me,De,W,C[V+4],7,-176418897),W=L(W,ae,Me,De,C[V+5],12,1200080426),De=L(De,W,ae,Me,C[V+6],17,-1473231341),Me=L(Me,De,W,ae,C[V+7],22,-45705983),ae=L(ae,Me,De,W,C[V+8],7,1770035416),W=L(W,ae,Me,De,C[V+9],12,-1958414417),De=L(De,W,ae,Me,C[V+10],17,-42063),Me=L(Me,De,W,ae,C[V+11],22,-1990404162),ae=L(ae,Me,De,W,C[V+12],7,1804603682),W=L(W,ae,Me,De,C[V+13],12,-40341101),De=L(De,W,ae,Me,C[V+14],17,-1502002290),ae=Y(ae,Me=L(Me,De,W,ae,C[V+15],22,1236535329),De,W,C[V+1],5,-165796510),W=Y(W,ae,Me,De,C[V+6],9,-1069501632),De=Y(De,W,ae,Me,C[V+11],14,643717713),Me=Y(Me,De,W,ae,C[V],20,-373897302),ae=Y(ae,Me,De,W,C[V+5],5,-701558691),W=Y(W,ae,Me,De,C[V+10],9,38016083),De=Y(De,W,ae,Me,C[V+15],14,-660478335),Me=Y(Me,De,W,ae,C[V+4],20,-405537848),ae=Y(ae,Me,De,W,C[V+9],5,568446438),W=Y(W,ae,Me,De,C[V+14],9,-1019803690),De=Y(De,W,ae,Me,C[V+3],14,-187363961),Me=Y(Me,De,W,ae,C[V+8],20,1163531501),ae=Y(ae,Me,De,W,C[V+13],5,-1444681467),W=Y(W,ae,Me,De,C[V+2],9,-51403784),De=Y(De,W,ae,Me,C[V+7],14,1735328473),ae=j(ae,Me=Y(Me,De,W,ae,C[V+12],20,-1926607734),De,W,C[V+5],4,-378558),W=j(W,ae,Me,De,C[V+8],11,-2022574463),De=j(De,W,ae,Me,C[V+11],16,1839030562),Me=j(Me,De,W,ae,C[V+14],23,-35309556),ae=j(ae,Me,De,W,C[V+1],4,-1530992060),W=j(W,ae,Me,De,C[V+4],11,1272893353),De=j(De,W,ae,Me,C[V+7],16,-155497632),Me=j(Me,De,W,ae,C[V+10],23,-1094730640),ae=j(ae,Me,De,W,C[V+13],4,681279174),W=j(W,ae,Me,De,C[V],11,-358537222),De=j(De,W,ae,Me,C[V+3],16,-722521979),Me=j(Me,De,W,ae,C[V+6],23,76029189),ae=j(ae,Me,De,W,C[V+9],4,-640364487),W=j(W,ae,Me,De,C[V+12],11,-421815835),De=j(De,W,ae,Me,C[V+15],16,530742520),ae=F(ae,Me=j(Me,De,W,ae,C[V+2],23,-995338651),De,W,C[V],6,-198630844),W=F(W,ae,Me,De,C[V+7],10,1126891415),De=F(De,W,ae,Me,C[V+14],15,-1416354905),Me=F(Me,De,W,ae,C[V+5],21,-57434055),ae=F(ae,Me,De,W,C[V+12],6,1700485571),W=F(W,ae,Me,De,C[V+3],10,-1894986606),De=F(De,W,ae,Me,C[V+10],15,-1051523),Me=F(Me,De,W,ae,C[V+1],21,-2054922799),ae=F(ae,Me,De,W,C[V+8],6,1873313359),W=F(W,ae,Me,De,C[V+15],10,-30611744),De=F(De,W,ae,Me,C[V+6],15,-1560198380),Me=F(Me,De,W,ae,C[V+13],21,1309151649),ae=F(ae,Me,De,W,C[V+4],6,-145523070),W=F(W,ae,Me,De,C[V+11],10,-1120210379),De=F(De,W,ae,Me,C[V+2],15,718787259),Me=F(Me,De,W,ae,C[V+9],21,-343485551),ae=fe(ae,ne),Me=fe(Me,qe),De=fe(De,ft),W=fe(W,Pe);return[ae,Me,De,W]}function xe(C){var z,V="",ne=32*C.length;for(z=0;z<ne;z+=8)V+=String.fromCharCode(C[z>>5]>>>z%32&255);return V}function Re(C){var z,V=[];for(V[(C.length>>2)-1]=void 0,z=0;z<V.length;z+=1)V[z]=0;var ne=8*C.length;for(z=0;z<ne;z+=8)V[z>>5]|=(255&C.charCodeAt(z/8))<<z%32;return V}function Ie(C){var z,V,ne="";for(V=0;V<C.length;V+=1)z=C.charCodeAt(V),ne+="0123456789abcdef".charAt(z>>>4&15)+"0123456789abcdef".charAt(15&z);return ne}function M(C){return unescape(encodeURIComponent(C))}function N(C){return function(z){return xe(K(Re(z),8*z.length))}(M(C))}function D(C,z){return function(V,ne){var qe,ft,Pe=Re(V),ae=[],Me=[];for(ae[15]=Me[15]=void 0,Pe.length>16&&(Pe=K(Pe,8*V.length)),qe=0;qe<16;qe+=1)ae[qe]=909522486^Pe[qe],Me[qe]=1549556828^Pe[qe];return ft=K(ae.concat(Re(ne)),512+8*ne.length),xe(K(Me.concat(ft),640))}(M(C),M(z))}function ee(C,z,V){return z?V?D(z,C):Ie(D(z,C)):V?N(C):Ie(N(C))}(b=function(){return ee}.call(R,v,R,T))===void 0||(T.exports=b)})()},function(T,R){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}T.exports=v},function(T,R,v){var b=v(58),te=v(59);function fe(){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}R.parse=C,R.resolve=function(z,V){return C(z,!1,!0).resolve(V)},R.resolveObject=function(z,V){return z?C(z,!1,!0).resolveObject(V):V},R.format=function(z){return te.isString(z)&&(z=C(z)),z instanceof fe?z.format():fe.prototype.format.call(z)},R.Url=fe;var $=/^([a-z0-9.+-]+:)/i,L=/:[0-9]*$/,Y=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,j=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
28
+ `," "]),F=["'"].concat(j),K=["%","/","?",";","#"].concat(F),xe=["/","?","#"],Re=/^[+a-z0-9A-Z_-]{0,63}$/,Ie=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},N={javascript:!0,"javascript:":!0},D={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ee=v(60);function C(z,V,ne){if(z&&te.isObject(z)&&z instanceof fe)return z;var qe=new fe;return qe.parse(z,V,ne),qe}fe.prototype.parse=function(z,V,ne){if(!te.isString(z))throw new TypeError("Parameter 'url' must be a string, not "+typeof z);var qe=z.indexOf("?"),ft=qe!==-1&&qe<z.indexOf("#")?"?":"#",Pe=z.split(ft);Pe[0]=Pe[0].replace(/\\/g,"/");var ae=z=Pe.join(ft);if(ae=ae.trim(),!ne&&z.split("#").length===1){var Me=Y.exec(ae);if(Me)return this.path=ae,this.href=ae,this.pathname=Me[1],Me[2]?(this.search=Me[2],this.query=V?ee.parse(this.search.substr(1)):this.search.substr(1)):V&&(this.search="",this.query={}),this}var De=$.exec(ae);if(De){var W=(De=De[0]).toLowerCase();this.protocol=W,ae=ae.substr(De.length)}if(ne||De||ae.match(/^\/\/[^@\/]+@[^@\/]+/)){var ye=ae.substr(0,2)==="//";!ye||De&&N[De]||(ae=ae.substr(2),this.slashes=!0)}if(!N[De]&&(ye||De&&!D[De])){for(var Ce,Le,Ne=-1,$e=0;$e<xe.length;$e++)(Qe=ae.indexOf(xe[$e]))!==-1&&(Ne===-1||Qe<Ne)&&(Ne=Qe);for((Le=Ne===-1?ae.lastIndexOf("@"):ae.lastIndexOf("@",Ne))!==-1&&(Ce=ae.slice(0,Le),ae=ae.slice(Le+1),this.auth=decodeURIComponent(Ce)),Ne=-1,$e=0;$e<K.length;$e++){var Qe;(Qe=ae.indexOf(K[$e]))!==-1&&(Ne===-1||Qe<Ne)&&(Ne=Qe)}Ne===-1&&(Ne=ae.length),this.host=ae.slice(0,Ne),ae=ae.slice(Ne),this.parseHost(),this.hostname=this.hostname||"";var bt=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!bt)for(var vt=this.hostname.split(/\./),ln=($e=0,vt.length);$e<ln;$e++){var wt=vt[$e];if(wt&&!wt.match(Re)){for(var Wt="",qt=0,rn=wt.length;qt<rn;qt++)wt.charCodeAt(qt)>127?Wt+="x":Wt+=wt[qt];if(!Wt.match(Re)){var Bt=vt.slice(0,$e),Dn=vt.slice($e+1),Fn=wt.match(Ie);Fn&&(Bt.push(Fn[1]),Dn.unshift(Fn[2])),Dn.length&&(ae="/"+Dn.join(".")+ae),this.hostname=Bt.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),bt||(this.hostname=b.toASCII(this.hostname));var Mn=this.port?":"+this.port:"",jn=this.hostname||"";this.host=jn+Mn,this.href+=this.host,bt&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ae[0]!=="/"&&(ae="/"+ae))}if(!M[W])for($e=0,ln=F.length;$e<ln;$e++){var An=F[$e];if(ae.indexOf(An)!==-1){var In=encodeURIComponent(An);In===An&&(In=escape(An)),ae=ae.split(An).join(In)}}var di=ae.indexOf("#");di!==-1&&(this.hash=ae.substr(di),ae=ae.slice(0,di));var Ln=ae.indexOf("?");if(Ln!==-1?(this.search=ae.substr(Ln),this.query=ae.substr(Ln+1),V&&(this.query=ee.parse(this.query)),ae=ae.slice(0,Ln)):V&&(this.search="",this.query={}),ae&&(this.pathname=ae),D[W]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Mn=this.pathname||"";var Fi=this.search||"";this.path=Mn+Fi}return this.href=this.format(),this},fe.prototype.format=function(){var z=this.auth||"";z&&(z=(z=encodeURIComponent(z)).replace(/%3A/i,":"),z+="@");var V=this.protocol||"",ne=this.pathname||"",qe=this.hash||"",ft=!1,Pe="";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&&te.isObject(this.query)&&Object.keys(this.query).length&&(Pe=ee.stringify(this.query));var ae=this.search||Pe&&"?"+Pe||"";return V&&V.substr(-1)!==":"&&(V+=":"),this.slashes||(!V||D[V])&&ft!==!1?(ft="//"+(ft||""),ne&&ne.charAt(0)!=="/"&&(ne="/"+ne)):ft||(ft=""),qe&&qe.charAt(0)!=="#"&&(qe="#"+qe),ae&&ae.charAt(0)!=="?"&&(ae="?"+ae),V+ft+(ne=ne.replace(/[?#]/g,function(Me){return encodeURIComponent(Me)}))+(ae=ae.replace("#","%23"))+qe},fe.prototype.resolve=function(z){return this.resolveObject(C(z,!1,!0)).format()},fe.prototype.resolveObject=function(z){if(te.isString(z)){var V=new fe;V.parse(z,!1,!0),z=V}for(var ne=new fe,qe=Object.keys(this),ft=0;ft<qe.length;ft++){var Pe=qe[ft];ne[Pe]=this[Pe]}if(ne.hash=z.hash,z.href==="")return ne.href=ne.format(),ne;if(z.slashes&&!z.protocol){for(var ae=Object.keys(z),Me=0;Me<ae.length;Me++){var De=ae[Me];De!=="protocol"&&(ne[De]=z[De])}return D[ne.protocol]&&ne.hostname&&!ne.pathname&&(ne.path=ne.pathname="/"),ne.href=ne.format(),ne}if(z.protocol&&z.protocol!==ne.protocol){if(!D[z.protocol]){for(var W=Object.keys(z),ye=0;ye<W.length;ye++){var Ce=W[ye];ne[Ce]=z[Ce]}return ne.href=ne.format(),ne}if(ne.protocol=z.protocol,z.host||N[z.protocol])ne.pathname=z.pathname;else{for(var Le=(z.pathname||"").split("/");Le.length&&!(z.host=Le.shift()););z.host||(z.host=""),z.hostname||(z.hostname=""),Le[0]!==""&&Le.unshift(""),Le.length<2&&Le.unshift(""),ne.pathname=Le.join("/")}if(ne.search=z.search,ne.query=z.query,ne.host=z.host||"",ne.auth=z.auth,ne.hostname=z.hostname||z.host,ne.port=z.port,ne.pathname||ne.search){var Ne=ne.pathname||"",$e=ne.search||"";ne.path=Ne+$e}return ne.slashes=ne.slashes||z.slashes,ne.href=ne.format(),ne}var Qe=ne.pathname&&ne.pathname.charAt(0)==="/",bt=z.host||z.pathname&&z.pathname.charAt(0)==="/",vt=bt||Qe||ne.host&&z.pathname,ln=vt,wt=ne.pathname&&ne.pathname.split("/")||[],Wt=(Le=z.pathname&&z.pathname.split("/")||[],ne.protocol&&!D[ne.protocol]);if(Wt&&(ne.hostname="",ne.port=null,ne.host&&(wt[0]===""?wt[0]=ne.host:wt.unshift(ne.host)),ne.host="",z.protocol&&(z.hostname=null,z.port=null,z.host&&(Le[0]===""?Le[0]=z.host:Le.unshift(z.host)),z.host=null),vt=vt&&(Le[0]===""||wt[0]==="")),bt)ne.host=z.host||z.host===""?z.host:ne.host,ne.hostname=z.hostname||z.hostname===""?z.hostname:ne.hostname,ne.search=z.search,ne.query=z.query,wt=Le;else if(Le.length)wt||(wt=[]),wt.pop(),wt=wt.concat(Le),ne.search=z.search,ne.query=z.query;else if(!te.isNullOrUndefined(z.search))return Wt&&(ne.hostname=ne.host=wt.shift(),(Fn=!!(ne.host&&ne.host.indexOf("@")>0)&&ne.host.split("@"))&&(ne.auth=Fn.shift(),ne.host=ne.hostname=Fn.shift())),ne.search=z.search,ne.query=z.query,te.isNull(ne.pathname)&&te.isNull(ne.search)||(ne.path=(ne.pathname?ne.pathname:"")+(ne.search?ne.search:"")),ne.href=ne.format(),ne;if(!wt.length)return ne.pathname=null,ne.search?ne.path="/"+ne.search:ne.path=null,ne.href=ne.format(),ne;for(var qt=wt.slice(-1)[0],rn=(ne.host||z.host||wt.length>1)&&(qt==="."||qt==="..")||qt==="",Bt=0,Dn=wt.length;Dn>=0;Dn--)(qt=wt[Dn])==="."?wt.splice(Dn,1):qt===".."?(wt.splice(Dn,1),Bt++):Bt&&(wt.splice(Dn,1),Bt--);if(!vt&&!ln)for(;Bt--;Bt)wt.unshift("..");!vt||wt[0]===""||wt[0]&&wt[0].charAt(0)==="/"||wt.unshift(""),rn&&wt.join("/").substr(-1)!=="/"&&wt.push("");var Fn,Mn=wt[0]===""||wt[0]&&wt[0].charAt(0)==="/";return Wt&&(ne.hostname=ne.host=Mn?"":wt.length?wt.shift():"",(Fn=!!(ne.host&&ne.host.indexOf("@")>0)&&ne.host.split("@"))&&(ne.auth=Fn.shift(),ne.host=ne.hostname=Fn.shift())),(vt=vt||ne.host&&wt.length)&&!Mn&&wt.unshift(""),wt.length?ne.pathname=wt.join("/"):(ne.pathname=null,ne.path=null),te.isNull(ne.pathname)&&te.isNull(ne.search)||(ne.path=(ne.pathname?ne.pathname:"")+(ne.search?ne.search:"")),ne.auth=z.auth||ne.auth,ne.slashes=ne.slashes||z.slashes,ne.href=ne.format(),ne},fe.prototype.parseHost=function(){var z=this.host,V=L.exec(z);V&&((V=V[0])!==":"&&(this.port=V.substr(1)),z=z.substr(0,z.length-V.length)),z&&(this.hostname=z)}},function(T,R,v){(function(b){T.exports=function te(fe,$,L){function Y(K,xe){if(!$[K]){if(!fe[K]){if(j)return j(K,!0);var Re=new Error("Cannot find module '"+K+"'");throw Re.code="MODULE_NOT_FOUND",Re}var Ie=$[K]={exports:{}};fe[K][0].call(Ie.exports,function(M){var N=fe[K][1][M];return Y(N||M)},Ie,Ie.exports,te,fe,$,L)}return $[K].exports}for(var j=!1,F=0;F<L.length;F++)Y(L[F]);return Y}({1:[function(te,fe,$){(function(L){var Y,j,F=L.MutationObserver||L.WebKitMutationObserver;if(F){var K=0,xe=new F(N),Re=L.document.createTextNode("");xe.observe(Re,{characterData:!0}),Y=function(){Re.data=K=++K%2}}else if(L.setImmediate||L.MessageChannel===void 0)Y="document"in L&&"onreadystatechange"in L.document.createElement("script")?function(){var D=L.document.createElement("script");D.onreadystatechange=function(){N(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},L.document.documentElement.appendChild(D)}:function(){setTimeout(N,0)};else{var Ie=new L.MessageChannel;Ie.port1.onmessage=N,Y=function(){Ie.port2.postMessage(0)}}var M=[];function N(){var D,ee;j=!0;for(var C=M.length;C;){for(ee=M,M=[],D=-1;++D<C;)ee[D]();C=M.length}j=!1}fe.exports=function(D){M.push(D)!==1||j||Y()}}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(te,fe,$){var L=te(1);function Y(){}var j={},F=["REJECTED"],K=["FULFILLED"],xe=["PENDING"];function Re(C){if(typeof C!="function")throw new TypeError("resolver must be a function");this.state=xe,this.queue=[],this.outcome=void 0,C!==Y&&D(this,C)}function Ie(C,z,V){this.promise=C,typeof z=="function"&&(this.onFulfilled=z,this.callFulfilled=this.otherCallFulfilled),typeof V=="function"&&(this.onRejected=V,this.callRejected=this.otherCallRejected)}function M(C,z,V){L(function(){var ne;try{ne=z(V)}catch(qe){return j.reject(C,qe)}ne===C?j.reject(C,new TypeError("Cannot resolve promise with itself")):j.resolve(C,ne)})}function N(C){var z=C&&C.then;if(C&&(typeof C=="object"||typeof C=="function")&&typeof z=="function")return function(){z.apply(C,arguments)}}function D(C,z){var V=!1;function ne(Pe){V||(V=!0,j.reject(C,Pe))}function qe(Pe){V||(V=!0,j.resolve(C,Pe))}var ft=ee(function(){z(qe,ne)});ft.status==="error"&&ne(ft.value)}function ee(C,z){var V={};try{V.value=C(z),V.status="success"}catch(ne){V.status="error",V.value=ne}return V}fe.exports=Re,Re.prototype.catch=function(C){return this.then(null,C)},Re.prototype.then=function(C,z){if(typeof C!="function"&&this.state===K||typeof z!="function"&&this.state===F)return this;var V=new this.constructor(Y);return this.state!==xe?M(V,this.state===K?C:z,this.outcome):this.queue.push(new Ie(V,C,z)),V},Ie.prototype.callFulfilled=function(C){j.resolve(this.promise,C)},Ie.prototype.otherCallFulfilled=function(C){M(this.promise,this.onFulfilled,C)},Ie.prototype.callRejected=function(C){j.reject(this.promise,C)},Ie.prototype.otherCallRejected=function(C){M(this.promise,this.onRejected,C)},j.resolve=function(C,z){var V=ee(N,z);if(V.status==="error")return j.reject(C,V.value);var ne=V.value;if(ne)D(C,ne);else{C.state=K,C.outcome=z;for(var qe=-1,ft=C.queue.length;++qe<ft;)C.queue[qe].callFulfilled(z)}return C},j.reject=function(C,z){C.state=F,C.outcome=z;for(var V=-1,ne=C.queue.length;++V<ne;)C.queue[V].callRejected(z);return C},Re.resolve=function(C){return C instanceof this?C:j.resolve(new this(Y),C)},Re.reject=function(C){var z=new this(Y);return j.reject(z,C)},Re.all=function(C){var z=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=C.length,ne=!1;if(!V)return this.resolve([]);for(var qe=new Array(V),ft=0,Pe=-1,ae=new this(Y);++Pe<V;)Me(C[Pe],Pe);return ae;function Me(De,W){z.resolve(De).then(function(ye){qe[W]=ye,++ft!==V||ne||(ne=!0,j.resolve(ae,qe))},function(ye){ne||(ne=!0,j.reject(ae,ye))})}},Re.race=function(C){var z=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=C.length,ne=!1;if(!V)return this.resolve([]);for(var qe,ft=-1,Pe=new this(Y);++ft<V;)qe=C[ft],z.resolve(qe).then(function(ae){ne||(ne=!0,j.resolve(Pe,ae))},function(ae){ne||(ne=!0,j.reject(Pe,ae))});return Pe}},{1:1}],3:[function(te,fe,$){(function(L){typeof L.Promise!="function"&&(L.Promise=te(2))}).call(this,b!==void 0?b:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(te,fe,$){var L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},Y=function(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}();function j(E,I){E=E||[],I=I||{};try{return new Blob(E,I)}catch(J){if(J.name!=="TypeError")throw J;for(var O=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),Q=0;Q<E.length;Q+=1)O.append(E[Q]);return O.getBlob(I.type)}}typeof Promise=="undefined"&&te(3);var F=Promise;function K(E,I){I&&E.then(function(O){I(null,O)},function(O){I(O)})}function xe(E,I,O){typeof I=="function"&&E.then(I),typeof O=="function"&&E.catch(O)}function Re(E){return typeof E!="string"&&(console.warn(E+" used as a key, but it is not a string."),E=String(E)),E}function Ie(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var M=void 0,N={},D=Object.prototype.toString;function ee(E){return typeof M=="boolean"?F.resolve(M):function(I){return new F(function(O){var Q=I.transaction("local-forage-detect-blob-support","readwrite"),J=j([""]);Q.objectStore("local-forage-detect-blob-support").put(J,"key"),Q.onabort=function(Z){Z.preventDefault(),Z.stopPropagation(),O(!1)},Q.oncomplete=function(){var Z=navigator.userAgent.match(/Chrome\/(\d+)/),se=navigator.userAgent.match(/Edge\//);O(se||!Z||parseInt(Z[1],10)>=43)}}).catch(function(){return!1})}(E).then(function(I){return M=I})}function C(E){var I=N[E.name],O={};O.promise=new F(function(Q,J){O.resolve=Q,O.reject=J}),I.deferredOperations.push(O),I.dbReady?I.dbReady=I.dbReady.then(function(){return O.promise}):I.dbReady=O.promise}function z(E){var I=N[E.name].deferredOperations.pop();if(I)return I.resolve(),I.promise}function V(E,I){var O=N[E.name].deferredOperations.pop();if(O)return O.reject(I),O.promise}function ne(E,I){return new F(function(O,Q){if(N[E.name]=N[E.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},E.db){if(!I)return O(E.db);C(E),E.db.close()}var J=[E.name];I&&J.push(E.version);var Z=Y.open.apply(Y,J);I&&(Z.onupgradeneeded=function(se){var ge=Z.result;try{ge.createObjectStore(E.storeName),se.oldVersion<=1&&ge.createObjectStore("local-forage-detect-blob-support")}catch(be){if(be.name!=="ConstraintError")throw be;console.warn('The database "'+E.name+'" has been upgraded from version '+se.oldVersion+" to version "+se.newVersion+', but the storage "'+E.storeName+'" already exists.')}}),Z.onerror=function(se){se.preventDefault(),Q(Z.error)},Z.onsuccess=function(){var se=Z.result;se.onversionchange=function(ge){ge.target.close()},O(se),z(E)}})}function qe(E){return ne(E,!1)}function ft(E){return ne(E,!0)}function Pe(E,I){if(!E.db)return!0;var O=!E.db.objectStoreNames.contains(E.storeName),Q=E.version<E.db.version,J=E.version>E.db.version;if(Q&&(E.version!==I&&console.warn('The database "'+E.name+`" can't be downgraded from version `+E.db.version+" to version "+E.version+"."),E.version=E.db.version),J||O){if(O){var Z=E.db.version+1;Z>E.version&&(E.version=Z)}return!0}return!1}function ae(E){return j([function(I){for(var O=I.length,Q=new ArrayBuffer(O),J=new Uint8Array(Q),Z=0;Z<O;Z++)J[Z]=I.charCodeAt(Z);return Q}(atob(E.data))],{type:E.type})}function Me(E){return E&&E.__local_forage_encoded_blob}function De(E){var I=this,O=I._initReady().then(function(){var Q=N[I._dbInfo.name];if(Q&&Q.dbReady)return Q.dbReady});return xe(O,E,E),O}function W(E,I,O,Q){Q===void 0&&(Q=1);try{var J=E.db.transaction(E.storeName,I);O(null,J)}catch(Z){if(Q>0&&(!E.db||Z.name==="InvalidStateError"||Z.name==="NotFoundError"))return F.resolve().then(function(){if(!E.db||Z.name==="NotFoundError"&&!E.db.objectStoreNames.contains(E.storeName)&&E.version<=E.db.version)return E.db&&(E.version=E.db.version+1),ft(E)}).then(function(){return function(se){C(se);for(var ge=N[se.name],be=ge.forages,we=0;we<be.length;we++){var Fe=be[we];Fe._dbInfo.db&&(Fe._dbInfo.db.close(),Fe._dbInfo.db=null)}return se.db=null,qe(se).then(function(Ye){return se.db=Ye,Pe(se)?ft(se):Ye}).then(function(Ye){se.db=ge.db=Ye;for(var ht=0;ht<be.length;ht++)be[ht]._dbInfo.db=Ye}).catch(function(Ye){throw V(se,Ye),Ye})}(E).then(function(){W(E,I,O,Q-1)})}).catch(O);O(Z)}}var ye={_driver:"asyncStorage",_initStorage:function(E){var I=this,O={db:null};if(E)for(var Q in E)O[Q]=E[Q];var J=N[O.name];J||(J={forages:[],db:null,dbReady:null,deferredOperations:[]},N[O.name]=J),J.forages.push(I),I._initReady||(I._initReady=I.ready,I.ready=De);var Z=[];function se(){return F.resolve()}for(var ge=0;ge<J.forages.length;ge++){var be=J.forages[ge];be!==I&&Z.push(be._initReady().catch(se))}var we=J.forages.slice(0);return F.all(Z).then(function(){return O.db=J.db,qe(O)}).then(function(Fe){return O.db=Fe,Pe(O,I._defaultConfig.version)?ft(O):Fe}).then(function(Fe){O.db=J.db=Fe,I._dbInfo=O;for(var Ye=0;Ye<we.length;Ye++){var ht=we[Ye];ht!==I&&(ht._dbInfo.db=O.db,ht._dbInfo.version=O.version)}})},_support:function(){try{if(!Y||!Y.open)return!1;var E=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),I=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!E||I)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}(),iterate:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).openCursor(),we=1;be.onsuccess=function(){var Fe=be.result;if(Fe){var Ye=Fe.value;Me(Ye)&&(Ye=ae(Ye));var ht=E(Ye,Fe.key,we++);ht!==void 0?J(ht):Fe.continue()}else J()},be.onerror=function(){Z(be.error)}}catch(Fe){Z(Fe)}})}).catch(Z)});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).get(E);be.onsuccess=function(){var we=be.result;we===void 0&&(we=null),Me(we)&&(we=ae(we)),J(we)},be.onerror=function(){Z(be.error)}}catch(we){Z(we)}})}).catch(Z)});return K(Q,I),Q},setItem:function(E,I,O){var Q=this;E=Re(E);var J=new F(function(Z,se){var ge;Q.ready().then(function(){return ge=Q._dbInfo,D.call(I)==="[object Blob]"?ee(ge.db).then(function(be){return be?I:(we=I,new F(function(Fe,Ye){var ht=new FileReader;ht.onerror=Ye,ht.onloadend=function(xt){var Ot=btoa(xt.target.result||"");Fe({__local_forage_encoded_blob:!0,data:Ot,type:we.type})},ht.readAsBinaryString(we)}));var we}):I}).then(function(be){W(Q._dbInfo,"readwrite",function(we,Fe){if(we)return se(we);try{var Ye=Fe.objectStore(Q._dbInfo.storeName);be===null&&(be=void 0);var ht=Ye.put(be,E);Fe.oncomplete=function(){be===void 0&&(be=null),Z(be)},Fe.onabort=Fe.onerror=function(){var xt=ht.error?ht.error:ht.transaction.error;se(xt)}}catch(xt){se(xt)}})}).catch(se)});return K(J,O),J},removeItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){W(O._dbInfo,"readwrite",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName).delete(E);ge.oncomplete=function(){J()},ge.onerror=function(){Z(be.error)},ge.onabort=function(){var we=be.error?be.error:be.transaction.error;Z(we)}}catch(we){Z(we)}})}).catch(Z)});return K(Q,I),Q},clear:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readwrite",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).clear();se.oncomplete=function(){Q()},se.onabort=se.onerror=function(){var be=ge.error?ge.error:ge.transaction.error;J(be)}}catch(be){J(be)}})}).catch(J)});return K(O,E),O},length:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readonly",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).count();ge.onsuccess=function(){Q(ge.result)},ge.onerror=function(){J(ge.error)}}catch(be){J(be)}})}).catch(J)});return K(O,E),O},key:function(E,I){var O=this,Q=new F(function(J,Z){E<0?J(null):O.ready().then(function(){W(O._dbInfo,"readonly",function(se,ge){if(se)return Z(se);try{var be=ge.objectStore(O._dbInfo.storeName),we=!1,Fe=be.openKeyCursor();Fe.onsuccess=function(){var Ye=Fe.result;Ye?E===0||we?J(Ye.key):(we=!0,Ye.advance(E)):J(null)},Fe.onerror=function(){Z(Fe.error)}}catch(Ye){Z(Ye)}})}).catch(Z)});return K(Q,I),Q},keys:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){W(I._dbInfo,"readonly",function(Z,se){if(Z)return J(Z);try{var ge=se.objectStore(I._dbInfo.storeName).openKeyCursor(),be=[];ge.onsuccess=function(){var we=ge.result;we?(be.push(we.key),we.continue()):Q(be)},ge.onerror=function(){J(ge.error)}}catch(we){J(we)}})}).catch(J)});return K(O,E),O},dropInstance:function(E,I){I=Ie.apply(this,arguments);var O=this.config();(E=typeof E!="function"&&E||{}).name||(E.name=E.name||O.name,E.storeName=E.storeName||O.storeName);var Q,J=this;if(E.name){var Z=E.name===O.name&&J._dbInfo.db,se=Z?F.resolve(J._dbInfo.db):qe(E).then(function(ge){var be=N[E.name],we=be.forages;be.db=ge;for(var Fe=0;Fe<we.length;Fe++)we[Fe]._dbInfo.db=ge;return ge});Q=E.storeName?se.then(function(ge){if(ge.objectStoreNames.contains(E.storeName)){var be=ge.version+1;C(E);var we=N[E.name],Fe=we.forages;ge.close();for(var Ye=0;Ye<Fe.length;Ye++){var ht=Fe[Ye];ht._dbInfo.db=null,ht._dbInfo.version=be}return new F(function(xt,Ot){var Gt=Y.open(E.name,be);Gt.onerror=function(fi){Gt.result.close(),Ot(fi)},Gt.onupgradeneeded=function(){Gt.result.deleteObjectStore(E.storeName)},Gt.onsuccess=function(){var fi=Gt.result;fi.close(),xt(fi)}}).then(function(xt){we.db=xt;for(var Ot=0;Ot<Fe.length;Ot++){var Gt=Fe[Ot];Gt._dbInfo.db=xt,z(Gt._dbInfo)}}).catch(function(xt){throw(V(E,xt)||F.resolve()).catch(function(){}),xt})}}):se.then(function(ge){C(E);var be=N[E.name],we=be.forages;ge.close();for(var Fe=0;Fe<we.length;Fe++)we[Fe]._dbInfo.db=null;return new F(function(Ye,ht){var xt=Y.deleteDatabase(E.name);xt.onerror=function(){var Ot=xt.result;Ot&&Ot.close(),ht(xt.error)},xt.onblocked=function(){console.warn('dropInstance blocked for database "'+E.name+'" until all open connections are closed')},xt.onsuccess=function(){var Ot=xt.result;Ot&&Ot.close(),Ye(Ot)}}).then(function(Ye){be.db=Ye;for(var ht=0;ht<we.length;ht++)z(we[ht]._dbInfo)}).catch(function(Ye){throw(V(E,Ye)||F.resolve()).catch(function(){}),Ye})})}else Q=F.reject("Invalid arguments");return K(Q,I),Q}},Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Le=/^~~local_forage_type~([^~]+)~/,Ne=9,$e=Ne+4,Qe=Object.prototype.toString;function bt(E){var I,O,Q,J,Z,se=.75*E.length,ge=E.length,be=0;E[E.length-1]==="="&&(se--,E[E.length-2]==="="&&se--);var we=new ArrayBuffer(se),Fe=new Uint8Array(we);for(I=0;I<ge;I+=4)O=Ce.indexOf(E[I]),Q=Ce.indexOf(E[I+1]),J=Ce.indexOf(E[I+2]),Z=Ce.indexOf(E[I+3]),Fe[be++]=O<<2|Q>>4,Fe[be++]=(15&Q)<<4|J>>2,Fe[be++]=(3&J)<<6|63&Z;return we}function vt(E){var I,O=new Uint8Array(E),Q="";for(I=0;I<O.length;I+=3)Q+=Ce[O[I]>>2],Q+=Ce[(3&O[I])<<4|O[I+1]>>4],Q+=Ce[(15&O[I+1])<<2|O[I+2]>>6],Q+=Ce[63&O[I+2]];return O.length%3==2?Q=Q.substring(0,Q.length-1)+"=":O.length%3==1&&(Q=Q.substring(0,Q.length-2)+"=="),Q}var ln={serialize:function(E,I){var O="";if(E&&(O=Qe.call(E)),E&&(O==="[object ArrayBuffer]"||E.buffer&&Qe.call(E.buffer)==="[object ArrayBuffer]")){var Q,J="__lfsc__:";E instanceof ArrayBuffer?(Q=E,J+="arbf"):(Q=E.buffer,O==="[object Int8Array]"?J+="si08":O==="[object Uint8Array]"?J+="ui08":O==="[object Uint8ClampedArray]"?J+="uic8":O==="[object Int16Array]"?J+="si16":O==="[object Uint16Array]"?J+="ur16":O==="[object Int32Array]"?J+="si32":O==="[object Uint32Array]"?J+="ui32":O==="[object Float32Array]"?J+="fl32":O==="[object Float64Array]"?J+="fl64":I(new Error("Failed to get type for BinaryArray"))),I(J+vt(Q))}else if(O==="[object Blob]"){var Z=new FileReader;Z.onload=function(){var se="~~local_forage_type~"+E.type+"~"+vt(this.result);I("__lfsc__:blob"+se)},Z.readAsArrayBuffer(E)}else try{I(JSON.stringify(E))}catch(se){console.error("Couldn't convert value into a JSON string: ",E),I(null,se)}},deserialize:function(E){if(E.substring(0,Ne)!=="__lfsc__:")return JSON.parse(E);var I,O=E.substring($e),Q=E.substring(Ne,$e);if(Q==="blob"&&Le.test(O)){var J=O.match(Le);I=J[1],O=O.substring(J[0].length)}var Z=bt(O);switch(Q){case"arbf":return Z;case"blob":return j([Z],{type:I});case"si08":return new Int8Array(Z);case"ui08":return new Uint8Array(Z);case"uic8":return new Uint8ClampedArray(Z);case"si16":return new Int16Array(Z);case"ur16":return new Uint16Array(Z);case"si32":return new Int32Array(Z);case"ui32":return new Uint32Array(Z);case"fl32":return new Float32Array(Z);case"fl64":return new Float64Array(Z);default:throw new Error("Unkown type: "+Q)}},stringToBuffer:bt,bufferToString:vt};function wt(E,I,O,Q){E.executeSql("CREATE TABLE IF NOT EXISTS "+I.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],O,Q)}function Wt(E,I,O,Q,J,Z){E.executeSql(O,Q,J,function(se,ge){ge.code===ge.SYNTAX_ERR?se.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[I.storeName],function(be,we){we.rows.length?Z(be,ge):wt(be,I,function(){be.executeSql(O,Q,J,Z)},Z)},Z):Z(se,ge)},Z)}function qt(E,I,O,Q){var J=this;E=Re(E);var Z=new F(function(se,ge){J.ready().then(function(){I===void 0&&(I=null);var be=I,we=J._dbInfo;we.serializer.serialize(I,function(Fe,Ye){Ye?ge(Ye):we.db.transaction(function(ht){Wt(ht,we,"INSERT OR REPLACE INTO "+we.storeName+" (key, value) VALUES (?, ?)",[E,Fe],function(){se(be)},function(xt,Ot){ge(Ot)})},function(ht){if(ht.code===ht.QUOTA_ERR){if(Q>0)return void se(qt.apply(J,[E,be,O,Q-1]));ge(ht)}})})}).catch(ge)});return K(Z,O),Z}function rn(E){return new F(function(I,O){E.transaction(function(Q){Q.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(J,Z){for(var se=[],ge=0;ge<Z.rows.length;ge++)se.push(Z.rows.item(ge).name);I({db:E,storeNames:se})},function(J,Z){O(Z)})},function(Q){O(Q)})})}var Bt={_driver:"webSQLStorage",_initStorage:function(E){var I=this,O={db:null};if(E)for(var Q in E)O[Q]=typeof E[Q]!="string"?E[Q].toString():E[Q];var J=new F(function(Z,se){try{O.db=openDatabase(O.name,String(O.version),O.description,O.size)}catch(ge){return se(ge)}O.db.transaction(function(ge){wt(ge,O,function(){I._dbInfo=O,Z()},function(be,we){se(we)})},se)});return O.serializer=ln,J},_support:typeof openDatabase=="function",iterate:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT * FROM "+se.storeName,[],function(be,we){for(var Fe=we.rows,Ye=Fe.length,ht=0;ht<Ye;ht++){var xt=Fe.item(ht),Ot=xt.value;if(Ot&&(Ot=se.serializer.deserialize(Ot)),(Ot=E(Ot,xt.key,ht+1))!==void 0)return void J(Ot)}J()},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT * FROM "+se.storeName+" WHERE key = ? LIMIT 1",[E],function(be,we){var Fe=we.rows.length?we.rows.item(0).value:null;Fe&&(Fe=se.serializer.deserialize(Fe)),J(Fe)},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},setItem:function(E,I,O){return qt.apply(this,[E,I,O,1])},removeItem:function(E,I){var O=this;E=Re(E);var Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"DELETE FROM "+se.storeName+" WHERE key = ?",[E],function(){J()},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},clear:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"DELETE FROM "+Z.storeName,[],function(){Q()},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},length:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"SELECT COUNT(key) as c FROM "+Z.storeName,[],function(ge,be){var we=be.rows.item(0).c;Q(we)},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},key:function(E,I){var O=this,Q=new F(function(J,Z){O.ready().then(function(){var se=O._dbInfo;se.db.transaction(function(ge){Wt(ge,se,"SELECT key FROM "+se.storeName+" WHERE id = ? LIMIT 1",[E+1],function(be,we){var Fe=we.rows.length?we.rows.item(0).key:null;J(Fe)},function(be,we){Z(we)})})}).catch(Z)});return K(Q,I),Q},keys:function(E){var I=this,O=new F(function(Q,J){I.ready().then(function(){var Z=I._dbInfo;Z.db.transaction(function(se){Wt(se,Z,"SELECT key FROM "+Z.storeName,[],function(ge,be){for(var we=[],Fe=0;Fe<be.rows.length;Fe++)we.push(be.rows.item(Fe).key);Q(we)},function(ge,be){J(be)})})}).catch(J)});return K(O,E),O},dropInstance:function(E,I){I=Ie.apply(this,arguments);var O=this.config();(E=typeof E!="function"&&E||{}).name||(E.name=E.name||O.name,E.storeName=E.storeName||O.storeName);var Q,J=this;return K(Q=E.name?new F(function(Z){var se;se=E.name===O.name?J._dbInfo.db:openDatabase(E.name,"","",0),E.storeName?Z({db:se,storeNames:[E.storeName]}):Z(rn(se))}).then(function(Z){return new F(function(se,ge){Z.db.transaction(function(be){function we(xt){return new F(function(Ot,Gt){be.executeSql("DROP TABLE IF EXISTS "+xt,[],function(){Ot()},function(fi,nr){Gt(nr)})})}for(var Fe=[],Ye=0,ht=Z.storeNames.length;Ye<ht;Ye++)Fe.push(we(Z.storeNames[Ye]));F.all(Fe).then(function(){se()}).catch(function(xt){ge(xt)})},function(be){ge(be)})})}):F.reject("Invalid arguments"),I),Q}};function Dn(E,I){var O=E.name+"/";return E.storeName!==I.storeName&&(O+=E.storeName+"/"),O}function Fn(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch{return!0}}()||localStorage.length>0}var Mn={_driver:"localStorageWrapper",_initStorage:function(E){var I={};if(E)for(var O in E)I[O]=E[O];return I.keyPrefix=Dn(E,this._defaultConfig),Fn()?(this._dbInfo=I,I.serializer=ln,F.resolve()):F.reject()},_support:function(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(E,I){var O=this,Q=O.ready().then(function(){for(var J=O._dbInfo,Z=J.keyPrefix,se=Z.length,ge=localStorage.length,be=1,we=0;we<ge;we++){var Fe=localStorage.key(we);if(Fe.indexOf(Z)===0){var Ye=localStorage.getItem(Fe);if(Ye&&(Ye=J.serializer.deserialize(Ye)),(Ye=E(Ye,Fe.substring(se),be++))!==void 0)return Ye}}});return K(Q,I),Q},getItem:function(E,I){var O=this;E=Re(E);var Q=O.ready().then(function(){var J=O._dbInfo,Z=localStorage.getItem(J.keyPrefix+E);return Z&&(Z=J.serializer.deserialize(Z)),Z});return K(Q,I),Q},setItem:function(E,I,O){var Q=this;E=Re(E);var J=Q.ready().then(function(){I===void 0&&(I=null);var Z=I;return new F(function(se,ge){var be=Q._dbInfo;be.serializer.serialize(I,function(we,Fe){if(Fe)ge(Fe);else try{localStorage.setItem(be.keyPrefix+E,we),se(Z)}catch(Ye){Ye.name!=="QuotaExceededError"&&Ye.name!=="NS_ERROR_DOM_QUOTA_REACHED"||ge(Ye),ge(Ye)}})})});return K(J,O),J},removeItem:function(E,I){var O=this;E=Re(E);var Q=O.ready().then(function(){var J=O._dbInfo;localStorage.removeItem(J.keyPrefix+E)});return K(Q,I),Q},clear:function(E){var I=this,O=I.ready().then(function(){for(var Q=I._dbInfo.keyPrefix,J=localStorage.length-1;J>=0;J--){var Z=localStorage.key(J);Z.indexOf(Q)===0&&localStorage.removeItem(Z)}});return K(O,E),O},length:function(E){var I=this.keys().then(function(O){return O.length});return K(I,E),I},key:function(E,I){var O=this,Q=O.ready().then(function(){var J,Z=O._dbInfo;try{J=localStorage.key(E)}catch{J=null}return J&&(J=J.substring(Z.keyPrefix.length)),J});return K(Q,I),Q},keys:function(E){var I=this,O=I.ready().then(function(){for(var Q=I._dbInfo,J=localStorage.length,Z=[],se=0;se<J;se++){var ge=localStorage.key(se);ge.indexOf(Q.keyPrefix)===0&&Z.push(ge.substring(Q.keyPrefix.length))}return Z});return K(O,E),O},dropInstance:function(E,I){if(I=Ie.apply(this,arguments),!(E=typeof E!="function"&&E||{}).name){var O=this.config();E.name=E.name||O.name,E.storeName=E.storeName||O.storeName}var Q,J=this;return K(Q=E.name?new F(function(Z){E.storeName?Z(Dn(E,J._defaultConfig)):Z(E.name+"/")}).then(function(Z){for(var se=localStorage.length-1;se>=0;se--){var ge=localStorage.key(se);ge.indexOf(Z)===0&&localStorage.removeItem(ge)}}):F.reject("Invalid arguments"),I),Q}},jn=function(E,I){for(var O,Q,J=E.length,Z=0;Z<J;){if((O=E[Z])===(Q=I)||typeof O=="number"&&typeof Q=="number"&&isNaN(O)&&isNaN(Q))return!0;Z++}return!1},An=Array.isArray||function(E){return Object.prototype.toString.call(E)==="[object Array]"},In={},di={},Ln={INDEXEDDB:ye,WEBSQL:Bt,LOCALSTORAGE:Mn},Fi=[Ln.INDEXEDDB._driver,Ln.WEBSQL._driver,Ln.LOCALSTORAGE._driver],pi=["dropInstance"],uo=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pi),Co={description:"",driver:Fi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Oa(E,I){E[I]=function(){var O=arguments;return E.ready().then(function(){return E[I].apply(E,O)})}}function ho(){for(var E=1;E<arguments.length;E++){var I=arguments[E];if(I)for(var O in I)I.hasOwnProperty(O)&&(An(I[O])?arguments[0][O]=I[O].slice():arguments[0][O]=I[O])}return arguments[0]}var Sr=new(function(){function E(I){for(var O in function(Z,se){if(!(Z instanceof se))throw new TypeError("Cannot call a class as a function")}(this,E),Ln)if(Ln.hasOwnProperty(O)){var Q=Ln[O],J=Q._driver;this[O]=J,In[J]||this.defineDriver(Q)}this._defaultConfig=ho({},Co),this._config=ho({},this._defaultConfig,I),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return E.prototype.config=function(I){if((I===void 0?"undefined":L(I))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var O in I){if(O==="storeName"&&(I[O]=I[O].replace(/\W/g,"_")),O==="version"&&typeof I[O]!="number")return new Error("Database version must be a number.");this._config[O]=I[O]}return!("driver"in I)||!I.driver||this.setDriver(this._config.driver)}return typeof I=="string"?this._config[I]:this._config},E.prototype.defineDriver=function(I,O,Q){var J=new F(function(Z,se){try{var ge=I._driver,be=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!I._driver)return void se(be);for(var we=uo.concat("_initStorage"),Fe=0,Ye=we.length;Fe<Ye;Fe++){var ht=we[Fe];if((!jn(pi,ht)||I[ht])&&typeof I[ht]!="function")return void se(be)}(function(){for(var Ot=function(Po){return function(){var Hs=new Error("Method "+Po+" is not implemented by the current driver"),Gn=F.reject(Hs);return K(Gn,arguments[arguments.length-1]),Gn}},Gt=0,fi=pi.length;Gt<fi;Gt++){var nr=pi[Gt];I[nr]||(I[nr]=Ot(nr))}})();var xt=function(Ot){In[ge]&&console.info("Redefining LocalForage driver: "+ge),In[ge]=I,di[ge]=Ot,Z()};"_support"in I?I._support&&typeof I._support=="function"?I._support().then(xt,se):xt(!!I._support):xt(!0)}catch(Ot){se(Ot)}});return xe(J,O,Q),J},E.prototype.driver=function(){return this._driver||null},E.prototype.getDriver=function(I,O,Q){var J=In[I]?F.resolve(In[I]):F.reject(new Error("Driver not found."));return xe(J,O,Q),J},E.prototype.getSerializer=function(I){var O=F.resolve(ln);return xe(O,I),O},E.prototype.ready=function(I){var O=this,Q=O._driverSet.then(function(){return O._ready===null&&(O._ready=O._initDriver()),O._ready});return xe(Q,I,I),Q},E.prototype.setDriver=function(I,O,Q){var J=this;An(I)||(I=[I]);var Z=this._getSupportedDrivers(I);function se(){J._config.driver=J.driver()}function ge(we){return J._extend(we),se(),J._ready=J._initStorage(J._config),J._ready}var be=this._driverSet!==null?this._driverSet.catch(function(){return F.resolve()}):F.resolve();return this._driverSet=be.then(function(){var we=Z[0];return J._dbInfo=null,J._ready=null,J.getDriver(we).then(function(Fe){J._driver=Fe._driver,se(),J._wrapLibraryMethodsWithReady(),J._initDriver=function(Ye){return function(){var ht=0;return function xt(){for(;ht<Ye.length;){var Ot=Ye[ht];return ht++,J._dbInfo=null,J._ready=null,J.getDriver(Ot).then(ge).catch(xt)}se();var Gt=new Error("No available storage method found.");return J._driverSet=F.reject(Gt),J._driverSet}()}}(Z)})}).catch(function(){se();var we=new Error("No available storage method found.");return J._driverSet=F.reject(we),J._driverSet}),xe(this._driverSet,O,Q),this._driverSet},E.prototype.supports=function(I){return!!di[I]},E.prototype._extend=function(I){ho(this,I)},E.prototype._getSupportedDrivers=function(I){for(var O=[],Q=0,J=I.length;Q<J;Q++){var Z=I[Q];this.supports(Z)&&O.push(Z)}return O},E.prototype._wrapLibraryMethodsWithReady=function(){for(var I=0,O=uo.length;I<O;I++)Oa(this,uo[I])},E.prototype.createInstance=function(I){return new E(I)},E}());fe.exports=Sr},{3:3}]},{},[4])(4)}).call(this,v(4))},function(T,R,v){var b=v(63);T.exports=function(te,fe){fe=fe||{};var $=new b,L=fe.inPlace||!1,Y=te.map(function(F){return L?F:{width:F.width,height:F.height,item:F}});Y=Y.sort(function(F,K){return K.width*K.height-F.width*F.height}),$.fit(Y);var j={width:Y.reduce(function(F,K){return Math.max(F,K.x+K.width)},0),height:Y.reduce(function(F,K){return Math.max(F,K.y+K.height)},0)};return L||(j.items=Y),j}},function(T,R){T.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(T,R,v){var b=Object.prototype.hasOwnProperty,te="~";function fe(){}function $(F,K,xe){this.fn=F,this.context=K,this.once=xe||!1}function L(F,K,xe,Re,Ie){if(typeof xe!="function")throw new TypeError("The listener must be a function");var M=new $(xe,Re||F,Ie),N=te?te+K:K;return F._events[N]?F._events[N].fn?F._events[N]=[F._events[N],M]:F._events[N].push(M):(F._events[N]=M,F._eventsCount++),F}function Y(F,K){--F._eventsCount==0?F._events=new fe:delete F._events[K]}function j(){this._events=new fe,this._eventsCount=0}Object.create&&(fe.prototype=Object.create(null),new fe().__proto__||(te=!1)),j.prototype.eventNames=function(){var F,K,xe=[];if(this._eventsCount===0)return xe;for(K in F=this._events)b.call(F,K)&&xe.push(te?K.slice(1):K);return Object.getOwnPropertySymbols?xe.concat(Object.getOwnPropertySymbols(F)):xe},j.prototype.listeners=function(F){var K=te?te+F:F,xe=this._events[K];if(!xe)return[];if(xe.fn)return[xe.fn];for(var Re=0,Ie=xe.length,M=new Array(Ie);Re<Ie;Re++)M[Re]=xe[Re].fn;return M},j.prototype.listenerCount=function(F){var K=te?te+F:F,xe=this._events[K];return xe?xe.fn?1:xe.length:0},j.prototype.emit=function(F,K,xe,Re,Ie,M){var N=te?te+F:F;if(!this._events[N])return!1;var D,ee,C=this._events[N],z=arguments.length;if(C.fn){switch(C.once&&this.removeListener(F,C.fn,void 0,!0),z){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,K),!0;case 3:return C.fn.call(C.context,K,xe),!0;case 4:return C.fn.call(C.context,K,xe,Re),!0;case 5:return C.fn.call(C.context,K,xe,Re,Ie),!0;case 6:return C.fn.call(C.context,K,xe,Re,Ie,M),!0}for(ee=1,D=new Array(z-1);ee<z;ee++)D[ee-1]=arguments[ee];C.fn.apply(C.context,D)}else{var V,ne=C.length;for(ee=0;ee<ne;ee++)switch(C[ee].once&&this.removeListener(F,C[ee].fn,void 0,!0),z){case 1:C[ee].fn.call(C[ee].context);break;case 2:C[ee].fn.call(C[ee].context,K);break;case 3:C[ee].fn.call(C[ee].context,K,xe);break;case 4:C[ee].fn.call(C[ee].context,K,xe,Re);break;default:if(!D)for(V=1,D=new Array(z-1);V<z;V++)D[V-1]=arguments[V];C[ee].fn.apply(C[ee].context,D)}}return!0},j.prototype.on=function(F,K,xe){return L(this,F,K,xe,!1)},j.prototype.once=function(F,K,xe){return L(this,F,K,xe,!0)},j.prototype.removeListener=function(F,K,xe,Re){var Ie=te?te+F:F;if(!this._events[Ie])return this;if(!K)return Y(this,Ie),this;var M=this._events[Ie];if(M.fn)M.fn!==K||Re&&!M.once||xe&&M.context!==xe||Y(this,Ie);else{for(var N=0,D=[],ee=M.length;N<ee;N++)(M[N].fn!==K||Re&&!M[N].once||xe&&M[N].context!==xe)&&D.push(M[N]);D.length?this._events[Ie]=D.length===1?D[0]:D:Y(this,Ie)}return this},j.prototype.removeAllListeners=function(F){var K;return F?(K=te?te+F:F,this._events[K]&&Y(this,K)):(this._events=new fe,this._eventsCount=0),this},j.prototype.off=j.prototype.removeListener,j.prototype.addListener=j.prototype.on,j.prefixed=te,j.EventEmitter=j,T.exports=j},function(T,R,v){function b(W,ye,Ce){Ce=Ce||2;var Le,Ne,$e,Qe,bt,vt,ln,wt=ye&&ye.length,Wt=wt?ye[0]*Ce:W.length,qt=te(W,0,Wt,Ce,!0),rn=[];if(!qt||qt.next===qt.prev)return rn;if(wt&&(qt=function(Dn,Fn,Mn,jn){var An,In,di,Ln,Fi,pi=[];for(An=0,In=Fn.length;An<In;An++)di=Fn[An]*jn,Ln=An<In-1?Fn[An+1]*jn:Dn.length,(Fi=te(Dn,di,Ln,jn,!1))===Fi.next&&(Fi.steiner=!0),pi.push(M(Fi));for(pi.sort(K),An=0;An<pi.length;An++)Mn=fe(Mn=xe(pi[An],Mn),Mn.next);return Mn}(W,ye,qt,Ce)),W.length>80*Ce){Le=$e=W[0],Ne=Qe=W[1];for(var Bt=Ce;Bt<Wt;Bt+=Ce)(bt=W[Bt])<Le&&(Le=bt),(vt=W[Bt+1])<Ne&&(Ne=vt),bt>$e&&($e=bt),vt>Qe&&(Qe=vt);ln=(ln=Math.max($e-Le,Qe-Ne))!==0?1/ln:0}return $(qt,rn,Ce,Le,Ne,ln),rn}function te(W,ye,Ce,Le,Ne){var $e,Qe;if(Ne===De(W,ye,Ce,Le)>0)for($e=ye;$e<Ce;$e+=Le)Qe=Pe($e,W[$e],W[$e+1],Qe);else for($e=Ce-Le;$e>=ye;$e-=Le)Qe=Pe($e,W[$e],W[$e+1],Qe);return Qe&&C(Qe,Qe.next)&&(ae(Qe),Qe=Qe.next),Qe}function fe(W,ye){if(!W)return W;ye||(ye=W);var Ce,Le=W;do if(Ce=!1,Le.steiner||!C(Le,Le.next)&&ee(Le.prev,Le,Le.next)!==0)Le=Le.next;else{if(ae(Le),(Le=ye=Le.prev)===Le.next)break;Ce=!0}while(Ce||Le!==ye);return ye}function $(W,ye,Ce,Le,Ne,$e,Qe){if(W){!Qe&&$e&&function(wt,Wt,qt,rn){var Bt=wt;do Bt.z===null&&(Bt.z=Ie(Bt.x,Bt.y,Wt,qt,rn)),Bt.prevZ=Bt.prev,Bt.nextZ=Bt.next,Bt=Bt.next;while(Bt!==wt);Bt.prevZ.nextZ=null,Bt.prevZ=null,function(Dn){var Fn,Mn,jn,An,In,di,Ln,Fi,pi=1;do{for(Mn=Dn,Dn=null,In=null,di=0;Mn;){for(di++,jn=Mn,Ln=0,Fn=0;Fn<pi&&(Ln++,jn=jn.nextZ);Fn++);for(Fi=pi;Ln>0||Fi>0&&jn;)Ln!==0&&(Fi===0||!jn||Mn.z<=jn.z)?(An=Mn,Mn=Mn.nextZ,Ln--):(An=jn,jn=jn.nextZ,Fi--),In?In.nextZ=An:Dn=An,An.prevZ=In,In=An;Mn=jn}In.nextZ=null,pi*=2}while(di>1)}(Bt)}(W,Le,Ne,$e);for(var bt,vt,ln=W;W.prev!==W.next;)if(bt=W.prev,vt=W.next,$e?Y(W,Le,Ne,$e):L(W))ye.push(bt.i/Ce),ye.push(W.i/Ce),ye.push(vt.i/Ce),ae(W),W=vt.next,ln=vt.next;else if((W=vt)===ln){Qe?Qe===1?$(W=j(fe(W),ye,Ce),ye,Ce,Le,Ne,$e,2):Qe===2&&F(W,ye,Ce,Le,Ne,$e):$(fe(W),ye,Ce,Le,Ne,$e,1);break}}}function L(W){var ye=W.prev,Ce=W,Le=W.next;if(ee(ye,Ce,Le)>=0)return!1;for(var Ne=W.next.next;Ne!==W.prev;){if(N(ye.x,ye.y,Ce.x,Ce.y,Le.x,Le.y,Ne.x,Ne.y)&&ee(Ne.prev,Ne,Ne.next)>=0)return!1;Ne=Ne.next}return!0}function Y(W,ye,Ce,Le){var Ne=W.prev,$e=W,Qe=W.next;if(ee(Ne,$e,Qe)>=0)return!1;for(var bt=Ne.x<$e.x?Ne.x<Qe.x?Ne.x:Qe.x:$e.x<Qe.x?$e.x:Qe.x,vt=Ne.y<$e.y?Ne.y<Qe.y?Ne.y:Qe.y:$e.y<Qe.y?$e.y:Qe.y,ln=Ne.x>$e.x?Ne.x>Qe.x?Ne.x:Qe.x:$e.x>Qe.x?$e.x:Qe.x,wt=Ne.y>$e.y?Ne.y>Qe.y?Ne.y:Qe.y:$e.y>Qe.y?$e.y:Qe.y,Wt=Ie(bt,vt,ye,Ce,Le),qt=Ie(ln,wt,ye,Ce,Le),rn=W.prevZ,Bt=W.nextZ;rn&&rn.z>=Wt&&Bt&&Bt.z<=qt;){if(rn!==W.prev&&rn!==W.next&&N(Ne.x,Ne.y,$e.x,$e.y,Qe.x,Qe.y,rn.x,rn.y)&&ee(rn.prev,rn,rn.next)>=0||(rn=rn.prevZ,Bt!==W.prev&&Bt!==W.next&&N(Ne.x,Ne.y,$e.x,$e.y,Qe.x,Qe.y,Bt.x,Bt.y)&&ee(Bt.prev,Bt,Bt.next)>=0))return!1;Bt=Bt.nextZ}for(;rn&&rn.z>=Wt;){if(rn!==W.prev&&rn!==W.next&&N(Ne.x,Ne.y,$e.x,$e.y,Qe.x,Qe.y,rn.x,rn.y)&&ee(rn.prev,rn,rn.next)>=0)return!1;rn=rn.prevZ}for(;Bt&&Bt.z<=qt;){if(Bt!==W.prev&&Bt!==W.next&&N(Ne.x,Ne.y,$e.x,$e.y,Qe.x,Qe.y,Bt.x,Bt.y)&&ee(Bt.prev,Bt,Bt.next)>=0)return!1;Bt=Bt.nextZ}return!0}function j(W,ye,Ce){var Le=W;do{var Ne=Le.prev,$e=Le.next.next;!C(Ne,$e)&&z(Ne,Le,Le.next,$e)&&qe(Ne,$e)&&qe($e,Ne)&&(ye.push(Ne.i/Ce),ye.push(Le.i/Ce),ye.push($e.i/Ce),ae(Le),ae(Le.next),Le=W=$e),Le=Le.next}while(Le!==W);return fe(Le)}function F(W,ye,Ce,Le,Ne,$e){var Qe=W;do{for(var bt=Qe.next.next;bt!==Qe.prev;){if(Qe.i!==bt.i&&D(Qe,bt)){var vt=ft(Qe,bt);return Qe=fe(Qe,Qe.next),vt=fe(vt,vt.next),$(Qe,ye,Ce,Le,Ne,$e),void $(vt,ye,Ce,Le,Ne,$e)}bt=bt.next}Qe=Qe.next}while(Qe!==W)}function K(W,ye){return W.x-ye.x}function xe(W,ye){var Ce=function($e,Qe){var bt,vt=Qe,ln=$e.x,wt=$e.y,Wt=-1/0;do{if(wt<=vt.y&&wt>=vt.next.y&&vt.next.y!==vt.y){var qt=vt.x+(wt-vt.y)*(vt.next.x-vt.x)/(vt.next.y-vt.y);if(qt<=ln&&qt>Wt){if(Wt=qt,qt===ln){if(wt===vt.y)return vt;if(wt===vt.next.y)return vt.next}bt=vt.x<vt.next.x?vt:vt.next}}vt=vt.next}while(vt!==Qe);if(!bt)return null;if(ln===Wt)return bt;var rn,Bt=bt,Dn=bt.x,Fn=bt.y,Mn=1/0;vt=bt;do ln>=vt.x&&vt.x>=Dn&&ln!==vt.x&&N(wt<Fn?ln:Wt,wt,Dn,Fn,wt<Fn?Wt:ln,wt,vt.x,vt.y)&&(rn=Math.abs(wt-vt.y)/(ln-vt.x),qe(vt,$e)&&(rn<Mn||rn===Mn&&(vt.x>bt.x||vt.x===bt.x&&Re(bt,vt)))&&(bt=vt,Mn=rn)),vt=vt.next;while(vt!==Bt);return bt}(W,ye);if(!Ce)return ye;var Le=ft(Ce,W),Ne=fe(Ce,Ce.next);return fe(Le,Le.next),ye===Ce?Ne:ye}function Re(W,ye){return ee(W.prev,W,ye.prev)<0&&ee(ye.next,W,W.next)<0}function Ie(W,ye,Ce,Le,Ne){return(W=1431655765&((W=858993459&((W=252645135&((W=16711935&((W=32767*(W-Ce)*Ne)|W<<8))|W<<4))|W<<2))|W<<1))|(ye=1431655765&((ye=858993459&((ye=252645135&((ye=16711935&((ye=32767*(ye-Le)*Ne)|ye<<8))|ye<<4))|ye<<2))|ye<<1))<<1}function M(W){var ye=W,Ce=W;do(ye.x<Ce.x||ye.x===Ce.x&&ye.y<Ce.y)&&(Ce=ye),ye=ye.next;while(ye!==W);return Ce}function N(W,ye,Ce,Le,Ne,$e,Qe,bt){return(Ne-Qe)*(ye-bt)-(W-Qe)*($e-bt)>=0&&(W-Qe)*(Le-bt)-(Ce-Qe)*(ye-bt)>=0&&(Ce-Qe)*($e-bt)-(Ne-Qe)*(Le-bt)>=0}function D(W,ye){return W.next.i!==ye.i&&W.prev.i!==ye.i&&!function(Ce,Le){var Ne=Ce;do{if(Ne.i!==Ce.i&&Ne.next.i!==Ce.i&&Ne.i!==Le.i&&Ne.next.i!==Le.i&&z(Ne,Ne.next,Ce,Le))return!0;Ne=Ne.next}while(Ne!==Ce);return!1}(W,ye)&&(qe(W,ye)&&qe(ye,W)&&function(Ce,Le){var Ne=Ce,$e=!1,Qe=(Ce.x+Le.x)/2,bt=(Ce.y+Le.y)/2;do Ne.y>bt!=Ne.next.y>bt&&Ne.next.y!==Ne.y&&Qe<(Ne.next.x-Ne.x)*(bt-Ne.y)/(Ne.next.y-Ne.y)+Ne.x&&($e=!$e),Ne=Ne.next;while(Ne!==Ce);return $e}(W,ye)&&(ee(W.prev,W,ye.prev)||ee(W,ye.prev,ye))||C(W,ye)&&ee(W.prev,W,W.next)>0&&ee(ye.prev,ye,ye.next)>0)}function ee(W,ye,Ce){return(ye.y-W.y)*(Ce.x-ye.x)-(ye.x-W.x)*(Ce.y-ye.y)}function C(W,ye){return W.x===ye.x&&W.y===ye.y}function z(W,ye,Ce,Le){var Ne=ne(ee(W,ye,Ce)),$e=ne(ee(W,ye,Le)),Qe=ne(ee(Ce,Le,W)),bt=ne(ee(Ce,Le,ye));return Ne!==$e&&Qe!==bt||!(Ne!==0||!V(W,Ce,ye))||!($e!==0||!V(W,Le,ye))||!(Qe!==0||!V(Ce,W,Le))||!(bt!==0||!V(Ce,ye,Le))}function V(W,ye,Ce){return ye.x<=Math.max(W.x,Ce.x)&&ye.x>=Math.min(W.x,Ce.x)&&ye.y<=Math.max(W.y,Ce.y)&&ye.y>=Math.min(W.y,Ce.y)}function ne(W){return W>0?1:W<0?-1:0}function qe(W,ye){return ee(W.prev,W,W.next)<0?ee(W,ye,W.next)>=0&&ee(W,W.prev,ye)>=0:ee(W,ye,W.prev)<0||ee(W,W.next,ye)<0}function ft(W,ye){var Ce=new Me(W.i,W.x,W.y),Le=new Me(ye.i,ye.x,ye.y),Ne=W.next,$e=ye.prev;return W.next=ye,ye.prev=W,Ce.next=Ne,Ne.prev=Ce,Le.next=Ce,Ce.prev=Le,$e.next=Le,Le.prev=$e,Le}function Pe(W,ye,Ce,Le){var Ne=new Me(W,ye,Ce);return Le?(Ne.next=Le.next,Ne.prev=Le,Le.next.prev=Ne,Le.next=Ne):(Ne.prev=Ne,Ne.next=Ne),Ne}function ae(W){W.next.prev=W.prev,W.prev.next=W.next,W.prevZ&&(W.prevZ.nextZ=W.nextZ),W.nextZ&&(W.nextZ.prevZ=W.prevZ)}function Me(W,ye,Ce){this.i=W,this.x=ye,this.y=Ce,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function De(W,ye,Ce,Le){for(var Ne=0,$e=ye,Qe=Ce-Le;$e<Ce;$e+=Le)Ne+=(W[Qe]-W[$e])*(W[$e+1]+W[Qe+1]),Qe=$e;return Ne}T.exports=b,T.exports.default=b,b.deviation=function(W,ye,Ce,Le){var Ne=ye&&ye.length,$e=Ne?ye[0]*Ce:W.length,Qe=Math.abs(De(W,0,$e,Ce));if(Ne)for(var bt=0,vt=ye.length;bt<vt;bt++){var ln=ye[bt]*Ce,wt=bt<vt-1?ye[bt+1]*Ce:W.length;Qe-=Math.abs(De(W,ln,wt,Ce))}var Wt=0;for(bt=0;bt<Le.length;bt+=3){var qt=Le[bt]*Ce,rn=Le[bt+1]*Ce,Bt=Le[bt+2]*Ce;Wt+=Math.abs((W[qt]-W[Bt])*(W[rn+1]-W[qt+1])-(W[qt]-W[rn])*(W[Bt+1]-W[qt+1]))}return Qe===0&&Wt===0?0:Math.abs((Wt-Qe)/Qe)},b.flatten=function(W){for(var ye=W[0][0].length,Ce={vertices:[],holes:[],dimensions:ye},Le=0,Ne=0;Ne<W.length;Ne++){for(var $e=0;$e<W[Ne].length;$e++)for(var Qe=0;Qe<ye;Qe++)Ce.vertices.push(W[Ne][$e][Qe]);Ne>0&&(Le+=W[Ne-1].length,Ce.holes.push(Le))}return Ce}},function(T,R){T.exports=`varying vec2 vUv;
29
29
  void main() {
30
30
  vUv = uv;
31
31
  gl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);
@@ -1824,11 +1824,11 @@ void main() {
1824
1824
  vec4 color1 = texture2D(uSampler, vTextureCoord);
1825
1825
  gl_FragColor = color1 * alpha;
1826
1826
  }
1827
- `},function(T,R,v){var b;(function(te,fe){var $="model",L="name",Y="type",j="vendor",F="version",K="mobile",xe="tablet",Re="smarttv",Ie=function(Pe){for(var ae={},Me=0;Me<Pe.length;Me++)ae[Pe[Me].toUpperCase()]=Pe[Me];return ae},M=function(Pe,ae){return typeof Pe=="string"&&N(ae).indexOf(N(Pe))!==-1},N=function(Pe){return Pe.toLowerCase()},D=function(Pe,ae){if(typeof Pe=="string")return Pe=Pe.replace(/^\s\s*/,"").replace(/\s\s*$/,""),ae===void 0?Pe:Pe.substring(0,255)},ee=function(Pe,ae){for(var Me,De,W,ye,Ce,Le,Ne=0;Ne<ae.length&&!Ce;){var $e=ae[Ne],Qe=ae[Ne+1];for(Me=De=0;Me<$e.length&&!Ce;)if(Ce=$e[Me++].exec(Pe))for(W=0;W<Qe.length;W++)Le=Ce[++De],typeof(ye=Qe[W])=="object"&&ye.length>0?ye.length===2?typeof ye[1]=="function"?this[ye[0]]=ye[1].call(this,Le):this[ye[0]]=ye[1]:ye.length===3?typeof ye[1]!="function"||ye[1].exec&&ye[1].test?this[ye[0]]=Le?Le.replace(ye[1],ye[2]):void 0:this[ye[0]]=Le?ye[1].call(this,Le,ye[2]):void 0:ye.length===4&&(this[ye[0]]=Le?ye[3].call(this,Le.replace(ye[1],ye[2])):void 0):this[ye]=Le||void 0;Ne+=2}},C=function(Pe,ae){for(var Me in ae)if(typeof ae[Me]=="object"&&ae[Me].length>0){for(var De=0;De<ae[Me].length;De++)if(M(ae[Me][De],Pe))return Me==="?"?void 0:Me}else if(M(ae[Me],Pe))return Me==="?"?void 0:Me;return Pe},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},V={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[F,[L,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[F,[L,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[L,F],[/opios[\/ ]+([\w\.]+)/i],[F,[L,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[F,[L,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[L,F],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[F,[L,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[F,[L,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[F,[L,"WeChat"]],[/konqueror\/([\w\.]+)/i],[F,[L,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[F,[L,"IE"]],[/yabrowser\/([\w\.]+)/i],[F,[L,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[L,/(.+)/,"$1 Secure Browser"],F],[/\bfocus\/([\w\.]+)/i],[F,[L,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[F,[L,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[F,[L,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[F,[L,"Dolphin"]],[/coast\/([\w\.]+)/i],[F,[L,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[F,[L,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[F,[L,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[L,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[L,/(.+)/,"$1 Browser"],F],[/(comodo_dragon)\/([\w\.]+)/i],[[L,/_/g," "],F],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[L,F],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[L],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[L,"Facebook"],F],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[L,F],[/\bgsa\/([\w\.]+) .*safari\//i],[F,[L,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[F,[L,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[L,"Chrome WebView"],F],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[F,[L,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[L,F],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[F,[L,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[F,L],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[L,[F,C,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[L,F],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[L,"Netscape"],F],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[F,[L,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[L,F]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",N]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",N]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",N]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[$,[j,"Samsung"],[Y,xe]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[$,[j,"Samsung"],[Y,K]],[/\((ip(?:hone|od)[\w ]*);/i],[$,[j,"Apple"],[Y,K]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[$,[j,"Apple"],[Y,xe]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[$,[j,"Huawei"],[Y,xe]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[$,[j,"Huawei"],[Y,K]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[$,/_/g," "],[j,"Xiaomi"],[Y,K]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[$,/_/g," "],[j,"Xiaomi"],[Y,xe]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[$,[j,"OPPO"],[Y,K]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[$,[j,"Vivo"],[Y,K]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[$,[j,"Realme"],[Y,K]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[$,[j,"Motorola"],[Y,K]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[$,[j,"Motorola"],[Y,xe]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[$,[j,"LG"],[Y,xe]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[$,[j,"LG"],[Y,K]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[$,[j,"Lenovo"],[Y,xe]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[$,/_/g," "],[j,"Nokia"],[Y,K]],[/(pixel c)\b/i],[$,[j,"Google"],[Y,xe]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[$,[j,"Google"],[Y,K]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[$,[j,"Sony"],[Y,K]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[$,"Xperia Tablet"],[j,"Sony"],[Y,xe]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[$,[j,"OnePlus"],[Y,K]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[$,[j,"Amazon"],[Y,xe]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[$,/(.+)/g,"Fire Phone $1"],[j,"Amazon"],[Y,K]],[/(playbook);[-\w\),; ]+(rim)/i],[$,j,[Y,xe]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[$,[j,"BlackBerry"],[Y,K]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[$,[j,"ASUS"],[Y,xe]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[$,[j,"ASUS"],[Y,K]],[/(nexus 9)/i],[$,[j,"HTC"],[Y,xe]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[j,[$,/_/g," "],[Y,K]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[$,[j,"Acer"],[Y,xe]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[$,[j,"Meizu"],[Y,K]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[$,[j,"Sharp"],[Y,K]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[j,$,[Y,K]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[j,$,[Y,xe]],[/(surface duo)/i],[$,[j,"Microsoft"],[Y,xe]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[$,[j,"Fairphone"],[Y,K]],[/(u304aa)/i],[$,[j,"AT&T"],[Y,K]],[/\bsie-(\w*)/i],[$,[j,"Siemens"],[Y,K]],[/\b(rct\w+) b/i],[$,[j,"RCA"],[Y,xe]],[/\b(venue[\d ]{2,7}) b/i],[$,[j,"Dell"],[Y,xe]],[/\b(q(?:mv|ta)\w+) b/i],[$,[j,"Verizon"],[Y,xe]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[$,[j,"Barnes & Noble"],[Y,xe]],[/\b(tm\d{3}\w+) b/i],[$,[j,"NuVision"],[Y,xe]],[/\b(k88) b/i],[$,[j,"ZTE"],[Y,xe]],[/\b(nx\d{3}j) b/i],[$,[j,"ZTE"],[Y,K]],[/\b(gen\d{3}) b.+49h/i],[$,[j,"Swiss"],[Y,K]],[/\b(zur\d{3}) b/i],[$,[j,"Swiss"],[Y,xe]],[/\b((zeki)?tb.*\b) b/i],[$,[j,"Zeki"],[Y,xe]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[j,"Dragon Touch"],$,[Y,xe]],[/\b(ns-?\w{0,9}) b/i],[$,[j,"Insignia"],[Y,xe]],[/\b((nxa|next)-?\w{0,9}) b/i],[$,[j,"NextBook"],[Y,xe]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[j,"Voice"],$,[Y,K]],[/\b(lvtel\-)?(v1[12]) b/i],[[j,"LvTel"],$,[Y,K]],[/\b(ph-1) /i],[$,[j,"Essential"],[Y,K]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[$,[j,"Envizen"],[Y,xe]],[/\b(trio[-\w\. ]+) b/i],[$,[j,"MachSpeed"],[Y,xe]],[/\btu_(1491) b/i],[$,[j,"Rotor"],[Y,xe]],[/(shield[\w ]+) b/i],[$,[j,"Nvidia"],[Y,xe]],[/(sprint) (\w+)/i],[j,$,[Y,K]],[/(kin\.[onetw]{3})/i],[[$,/\./g," "],[j,"Microsoft"],[Y,K]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[$,[j,"Zebra"],[Y,xe]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[$,[j,"Zebra"],[Y,K]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[j,$,[Y,"console"]],[/droid.+; (shield) bui/i],[$,[j,"Nvidia"],[Y,"console"]],[/(playstation [345portablevi]+)/i],[$,[j,"Sony"],[Y,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[$,[j,"Microsoft"],[Y,"console"]],[/smart-tv.+(samsung)/i],[j,[Y,Re]],[/hbbtv.+maple;(\d+)/i],[[$,/^/,"SmartTV"],[j,"Samsung"],[Y,Re]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[j,"LG"],[Y,Re]],[/(apple) ?tv/i],[j,[$,"Apple TV"],[Y,Re]],[/crkey/i],[[$,"Chromecast"],[j,"Google"],[Y,Re]],[/droid.+aft(\w)( bui|\))/i],[$,[j,"Amazon"],[Y,Re]],[/\(dtv[\);].+(aquos)/i],[$,[j,"Sharp"],[Y,Re]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[j,D],[$,D],[Y,Re]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[Y,Re]],[/((pebble))app/i],[j,$,[Y,"wearable"]],[/droid.+; (glass) \d/i],[$,[j,"Google"],[Y,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[$,[j,"Zebra"],[Y,"wearable"]],[/(quest( 2)?)/i],[$,[j,"Facebook"],[Y,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[j,[Y,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[$,[Y,K]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[$,[Y,xe]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[Y,xe]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[Y,K]],[/(android[-\w\. ]{0,9});.+buil/i],[$,[j,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[F,[L,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[F,[L,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[L,F],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[F,L]],os:[[/microsoft (windows) (vista|xp)/i],[L,F],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[L,[F,C,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[L,"Windows"],[F,C,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[F,/_/g,"."],[L,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[L,"Mac OS"],[F,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[F,L],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[L,F],[/\(bb(10);/i],[F,[L,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[F,[L,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[F,[L,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[F,[L,"webOS"]],[/crkey\/([\d\.]+)/i],[F,[L,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[L,"Chromium OS"],F],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[L,F],[/(sunos) ?([\w\.\d]*)/i],[[L,"Solaris"],F],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[L,F]]},ne=function(Pe,ae){if(typeof Pe=="object"&&(ae=Pe,Pe=void 0),!(this instanceof ne))return new ne(Pe,ae).getResult();var Me=Pe||(te!==void 0&&te.navigator&&te.navigator.userAgent?te.navigator.userAgent:""),De=ae?function(W,ye){var Ce={};for(var Le in W)ye[Le]&&ye[Le].length%2==0?Ce[Le]=ye[Le].concat(W[Le]):Ce[Le]=W[Le];return Ce}(V,ae):V;return this.getBrowser=function(){var W,ye={};return ye[L]=void 0,ye[F]=void 0,ee.call(ye,Me,De.browser),ye.major=typeof(W=ye.version)=="string"?W.replace(/[^\d\.]/g,"").split(".")[0]:void 0,ye},this.getCPU=function(){var W={architecture:void 0};return ee.call(W,Me,De.cpu),W},this.getDevice=function(){var W={vendor:void 0,model:void 0,type:void 0};return ee.call(W,Me,De.device),W},this.getEngine=function(){var W={name:void 0,version:void 0};return ee.call(W,Me,De.engine),W},this.getOS=function(){var W={name:void 0,version:void 0};return ee.call(W,Me,De.os),W},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Me},this.setUA=function(W){return Me=typeof W=="string"&&W.length>255?D(W,255):W,this},this.setUA(Me),this};ne.VERSION="1.0.2",ne.BROWSER=Ie([L,F,"major"]),ne.CPU=Ie(["architecture"]),ne.DEVICE=Ie([$,j,Y,"console",K,Re,xe,"wearable","embedded"]),ne.ENGINE=ne.OS=Ie([L,F]),R!==void 0?(T!==void 0&&T.exports&&(R=T.exports=ne),R.UAParser=ne):v(64)?(b=function(){return ne}.call(R,v,R,T))===void 0||(T.exports=b):te!==void 0&&(te.UAParser=ne);var qe=te!==void 0&&(te.jQuery||te.Zepto);if(qe&&!qe.ua){var ft=new ne;qe.ua=ft.getResult(),qe.ua.get=function(){return ft.getUA()},qe.ua.set=function(Pe){ft.setUA(Pe);var ae=ft.getResult();for(var Me in ae)qe.ua[Me]=ae[Me]}}})(typeof window=="object"?window:this)},function(T,R,v){(function(b){var te=b!==void 0&&b||typeof self!="undefined"&&self||window,fe=Function.prototype.apply;function $(L,Y){this._id=L,this._clearFn=Y}R.setTimeout=function(){return new $(fe.call(setTimeout,te,arguments),clearTimeout)},R.setInterval=function(){return new $(fe.call(setInterval,te,arguments),clearInterval)},R.clearTimeout=R.clearInterval=function(L){L&&L.close()},$.prototype.unref=$.prototype.ref=function(){},$.prototype.close=function(){this._clearFn.call(te,this._id)},R.enroll=function(L,Y){clearTimeout(L._idleTimeoutId),L._idleTimeout=Y},R.unenroll=function(L){clearTimeout(L._idleTimeoutId),L._idleTimeout=-1},R._unrefActive=R.active=function(L){clearTimeout(L._idleTimeoutId);var Y=L._idleTimeout;Y>=0&&(L._idleTimeoutId=setTimeout(function(){L._onTimeout&&L._onTimeout()},Y))},v(56),R.setImmediate=typeof self!="undefined"&&self.setImmediate||b!==void 0&&b.setImmediate||this&&this.setImmediate,R.clearImmediate=typeof self!="undefined"&&self.clearImmediate||b!==void 0&&b.clearImmediate||this&&this.clearImmediate}).call(this,v(4))},function(T,R,v){(function(b,te){(function(fe,$){if(!fe.setImmediate){var L,Y,j,F,K,xe=1,Re={},Ie=!1,M=fe.document,N=Object.getPrototypeOf&&Object.getPrototypeOf(fe);N=N&&N.setTimeout?N:fe,{}.toString.call(fe.process)==="[object process]"?L=function(C){te.nextTick(function(){ee(C)})}:function(){if(fe.postMessage&&!fe.importScripts){var C=!0,z=fe.onmessage;return fe.onmessage=function(){C=!1},fe.postMessage("","*"),fe.onmessage=z,C}}()?(F="setImmediate$"+Math.random()+"$",K=function(C){C.source===fe&&typeof C.data=="string"&&C.data.indexOf(F)===0&&ee(+C.data.slice(F.length))},fe.addEventListener?fe.addEventListener("message",K,!1):fe.attachEvent("onmessage",K),L=function(C){fe.postMessage(F+C,"*")}):fe.MessageChannel?((j=new MessageChannel).port1.onmessage=function(C){ee(C.data)},L=function(C){j.port2.postMessage(C)}):M&&"onreadystatechange"in M.createElement("script")?(Y=M.documentElement,L=function(C){var z=M.createElement("script");z.onreadystatechange=function(){ee(C),z.onreadystatechange=null,Y.removeChild(z),z=null},Y.appendChild(z)}):L=function(C){setTimeout(ee,0,C)},N.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var z=new Array(arguments.length-1),V=0;V<z.length;V++)z[V]=arguments[V+1];var ne={callback:C,args:z};return Re[xe]=ne,L(xe),xe++},N.clearImmediate=D}function D(C){delete Re[C]}function ee(C){if(Ie)setTimeout(ee,0,C);else{var z=Re[C];if(z){Ie=!0;try{(function(V){var ne=V.callback,qe=V.args;switch(qe.length){case 0:ne();break;case 1:ne(qe[0]);break;case 2:ne(qe[0],qe[1]);break;case 3:ne(qe[0],qe[1],qe[2]);break;default:ne.apply(void 0,qe)}})(z)}finally{D(C),Ie=!1}}}}})(typeof self=="undefined"?b===void 0?this:b:self)}).call(this,v(4),v(57))},function(T,R){var v,b,te=T.exports={};function fe(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function L(N){if(v===setTimeout)return setTimeout(N,0);if((v===fe||!v)&&setTimeout)return v=setTimeout,setTimeout(N,0);try{return v(N,0)}catch{try{return v.call(null,N,0)}catch{return v.call(this,N,0)}}}(function(){try{v=typeof setTimeout=="function"?setTimeout:fe}catch{v=fe}try{b=typeof clearTimeout=="function"?clearTimeout:$}catch{b=$}})();var Y,j=[],F=!1,K=-1;function xe(){F&&Y&&(F=!1,Y.length?j=Y.concat(j):K=-1,j.length&&Re())}function Re(){if(!F){var N=L(xe);F=!0;for(var D=j.length;D;){for(Y=j,j=[];++K<D;)Y&&Y[K].run();K=-1,D=j.length}Y=null,F=!1,function(ee){if(b===clearTimeout)return clearTimeout(ee);if((b===$||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(ee);try{b(ee)}catch{try{return b.call(null,ee)}catch{return b.call(this,ee)}}}(N)}}function Ie(N,D){this.fun=N,this.array=D}function M(){}te.nextTick=function(N){var D=new Array(arguments.length-1);if(arguments.length>1)for(var ee=1;ee<arguments.length;ee++)D[ee-1]=arguments[ee];j.push(new Ie(N,D)),j.length!==1||F||L(Re)},Ie.prototype.run=function(){this.fun.apply(null,this.array)},te.title="browser",te.browser=!0,te.env={},te.argv=[],te.version="",te.versions={},te.on=M,te.addListener=M,te.once=M,te.off=M,te.removeListener=M,te.removeAllListeners=M,te.emit=M,te.prependListener=M,te.prependOnceListener=M,te.listeners=function(N){return[]},te.binding=function(N){throw new Error("process.binding is not supported")},te.cwd=function(){return"/"},te.chdir=function(N){throw new Error("process.chdir is not supported")},te.umask=function(){return 0}},function(T,R,v){(function(b,te){var fe;/*! https://mths.be/punycode v1.4.1 by @mathias */(function($){R&&R.nodeType,b&&b.nodeType;var L=typeof te=="object"&&te;L.global!==L&&L.window!==L&&L.self;var Y,j=2147483647,F=/^xn--/,K=/[^\x20-\x7E]/,xe=/[\x2E\u3002\uFF0E\uFF61]/g,Re={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ie=Math.floor,M=String.fromCharCode;function N(Pe){throw new RangeError(Re[Pe])}function D(Pe,ae){for(var Me=Pe.length,De=[];Me--;)De[Me]=ae(Pe[Me]);return De}function ee(Pe,ae){var Me=Pe.split("@"),De="";return Me.length>1&&(De=Me[0]+"@",Pe=Me[1]),De+D((Pe=Pe.replace(xe,".")).split("."),ae).join(".")}function C(Pe){for(var ae,Me,De=[],W=0,ye=Pe.length;W<ye;)(ae=Pe.charCodeAt(W++))>=55296&&ae<=56319&&W<ye?(64512&(Me=Pe.charCodeAt(W++)))==56320?De.push(((1023&ae)<<10)+(1023&Me)+65536):(De.push(ae),W--):De.push(ae);return De}function z(Pe){return D(Pe,function(ae){var Me="";return ae>65535&&(Me+=M((ae-=65536)>>>10&1023|55296),ae=56320|1023&ae),Me+=M(ae)}).join("")}function V(Pe,ae){return Pe+22+75*(Pe<26)-((ae!=0)<<5)}function ne(Pe,ae,Me){var De=0;for(Pe=Me?Ie(Pe/700):Pe>>1,Pe+=Ie(Pe/ae);Pe>455;De+=36)Pe=Ie(Pe/35);return Ie(De+36*Pe/(Pe+38))}function qe(Pe){var ae,Me,De,W,ye,Ce,Le,Ne,$e,Qe,bt,vt=[],ln=Pe.length,wt=0,Wt=128,qt=72;for((Me=Pe.lastIndexOf("-"))<0&&(Me=0),De=0;De<Me;++De)Pe.charCodeAt(De)>=128&&N("not-basic"),vt.push(Pe.charCodeAt(De));for(W=Me>0?Me+1:0;W<ln;){for(ye=wt,Ce=1,Le=36;W>=ln&&N("invalid-input"),((Ne=(bt=Pe.charCodeAt(W++))-48<10?bt-22:bt-65<26?bt-65:bt-97<26?bt-97:36)>=36||Ne>Ie((j-wt)/Ce))&&N("overflow"),wt+=Ne*Ce,!(Ne<($e=Le<=qt?1:Le>=qt+26?26:Le-qt));Le+=36)Ce>Ie(j/(Qe=36-$e))&&N("overflow"),Ce*=Qe;qt=ne(wt-ye,ae=vt.length+1,ye==0),Ie(wt/ae)>j-Wt&&N("overflow"),Wt+=Ie(wt/ae),wt%=ae,vt.splice(wt++,0,Wt)}return z(vt)}function ft(Pe){var ae,Me,De,W,ye,Ce,Le,Ne,$e,Qe,bt,vt,ln,wt,Wt,qt=[];for(vt=(Pe=C(Pe)).length,ae=128,Me=0,ye=72,Ce=0;Ce<vt;++Ce)(bt=Pe[Ce])<128&&qt.push(M(bt));for(De=W=qt.length,W&&qt.push("-");De<vt;){for(Le=j,Ce=0;Ce<vt;++Ce)(bt=Pe[Ce])>=ae&&bt<Le&&(Le=bt);for(Le-ae>Ie((j-Me)/(ln=De+1))&&N("overflow"),Me+=(Le-ae)*ln,ae=Le,Ce=0;Ce<vt;++Ce)if((bt=Pe[Ce])<ae&&++Me>j&&N("overflow"),bt==ae){for(Ne=Me,$e=36;!(Ne<(Qe=$e<=ye?1:$e>=ye+26?26:$e-ye));$e+=36)Wt=Ne-Qe,wt=36-Qe,qt.push(M(V(Qe+Wt%wt,0))),Ne=Ie(Wt/wt);qt.push(M(V(Ne,0))),ye=ne(Me,ln,De==W),Me=0,++De}++Me,++ae}return qt.join("")}Y={version:"1.4.1",ucs2:{decode:C,encode:z},decode:qe,encode:ft,toASCII:function(Pe){return ee(Pe,function(ae){return K.test(ae)?"xn--"+ft(ae):ae})},toUnicode:function(Pe){return ee(Pe,function(ae){return F.test(ae)?qe(ae.slice(4).toLowerCase()):ae})}},(fe=function(){return Y}.call(R,v,R,b))===void 0||(b.exports=fe)})()}).call(this,v(8)(T),v(4))},function(T,R,v){T.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(T,R,v){R.decode=R.parse=v(61),R.encode=R.stringify=v(62)},function(T,R,v){function b(fe,$){return Object.prototype.hasOwnProperty.call(fe,$)}T.exports=function(fe,$,L,Y){$=$||"&",L=L||"=";var j={};if(typeof fe!="string"||fe.length===0)return j;var F=/\+/g;fe=fe.split($);var K=1e3;Y&&typeof Y.maxKeys=="number"&&(K=Y.maxKeys);var xe=fe.length;K>0&&xe>K&&(xe=K);for(var Re=0;Re<xe;++Re){var Ie,M,N,D,ee=fe[Re].replace(F,"%20"),C=ee.indexOf(L);C>=0?(Ie=ee.substr(0,C),M=ee.substr(C+1)):(Ie=ee,M=""),N=decodeURIComponent(Ie),D=decodeURIComponent(M),b(j,N)?te(j[N])?j[N].push(D):j[N]=[j[N],D]:j[N]=D}return j};var te=Array.isArray||function(fe){return Object.prototype.toString.call(fe)==="[object Array]"}},function(T,R,v){var b=function(L){switch(typeof L){case"string":return L;case"boolean":return L?"true":"false";case"number":return isFinite(L)?L:"";default:return""}};T.exports=function(L,Y,j,F){return Y=Y||"&",j=j||"=",L===null&&(L=void 0),typeof L=="object"?fe($(L),function(K){var xe=encodeURIComponent(b(K))+j;return te(L[K])?fe(L[K],function(Re){return xe+encodeURIComponent(b(Re))}).join(Y):xe+encodeURIComponent(b(L[K]))}).join(Y):F?encodeURIComponent(b(F))+j+encodeURIComponent(b(L)):""};var te=Array.isArray||function(L){return Object.prototype.toString.call(L)==="[object Array]"};function fe(L,Y){if(L.map)return L.map(Y);for(var j=[],F=0;F<L.length;F++)j.push(Y(L[F],F));return j}var $=Object.keys||function(L){var Y=[];for(var j in L)Object.prototype.hasOwnProperty.call(L,j)&&Y.push(j);return Y}},function(T,R){var v=function(){};v.prototype={fit:function(b){var te,fe,$,L,Y=b.length,j=Y>0?b[0].width:0,F=Y>0?b[0].height:0;for(this.root={x:0,y:0,width:j,height:F},te=0;te<Y;te++)$=b[te],(fe=this.findNode(this.root,$.width,$.height))?(L=this.splitNode(fe,$.width,$.height),$.x=L.x,$.y=L.y):(L=this.growNode($.width,$.height),$.x=L.x,$.y=L.y)},findNode:function(b,te,fe){return b.used?this.findNode(b.right,te,fe)||this.findNode(b.down,te,fe):te<=b.width&&fe<=b.height?b:null},splitNode:function(b,te,fe){return b.used=!0,b.down={x:b.x,y:b.y+fe,width:b.width,height:b.height-fe},b.right={x:b.x+te,y:b.y,width:b.width-te,height:fe},b},growNode:function(b,te){var fe=b<=this.root.width,$=te<=this.root.height,L=$&&this.root.height>=this.root.width+b,Y=fe&&this.root.width>=this.root.height+te;return L?this.growRight(b,te):Y?this.growDown(b,te):$?this.growRight(b,te):fe?this.growDown(b,te):null},growRight:function(b,te){var fe;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}},(fe=this.findNode(this.root,b,te))?this.splitNode(fe,b,te):null},growDown:function(b,te){var fe;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+te,down:{x:0,y:this.root.height,width:this.root.width,height:te},right:this.root},(fe=this.findNode(this.root,b,te))?this.splitNode(fe,b,te):null}},T.exports=v},function(T,R){(function(v){T.exports=v}).call(this,{})},function(T,R,v){v.r(R),v.d(R,"delay",function(){return VS}),v.d(R,"waitUntil",function(){return N_}),v.d(R,"SLIDE_EVENTS",function(){return Ro}),v.d(R,"Slide",function(){return HI});var b={};v.r(b),v.d(b,"ACESFilmicToneMapping",function(){return Q}),v.d(b,"AddEquation",function(){return Ce}),v.d(b,"AddOperation",function(){return ho}),v.d(b,"AdditiveAnimationBlendMode",function(){return Ue}),v.d(b,"AdditiveBlending",function(){return Me}),v.d(b,"AlphaFormat",function(){return Hn}),v.d(b,"AlwaysDepth",function(){return An}),v.d(b,"AlwaysStencilFunc",function(){return Nl}),v.d(b,"AmbientLight",function(){return am}),v.d(b,"AmbientLightProbe",function(){return Iy}),v.d(b,"AnimationClip",function(){return Gd}),v.d(b,"AnimationLoader",function(){return dE}),v.d(b,"AnimationMixer",function(){return Hy}),v.d(b,"AnimationObjectGroup",function(){return Gy}),v.d(b,"AnimationUtils",function(){return si}),v.d(b,"ArcCurve",function(){return io}),v.d(b,"ArrayCamera",function(){return Rd}),v.d(b,"ArrowHelper",function(){return VE}),v.d(b,"Audio",function(){return Gv}),v.d(b,"AudioAnalyser",function(){return Uy}),v.d(b,"AudioContext",function(){return kv}),v.d(b,"AudioListener",function(){return xE}),v.d(b,"AudioLoader",function(){return Cy}),v.d(b,"AxesHelper",function(){return rx}),v.d(b,"AxisHelper",function(){return bM}),v.d(b,"BackSide",function(){return V}),v.d(b,"BasicDepthPacking",function(){return Ol}),v.d(b,"BasicShadowMap",function(){return N}),v.d(b,"BinaryTextureLoader",function(){return MM}),v.d(b,"Bone",function(){return kh}),v.d(b,"BooleanKeyframeTrack",function(){return uu}),v.d(b,"BoundingBoxHelper",function(){return wM}),v.d(b,"Box2",function(){return nc}),v.d(b,"Box3",function(){return Zn}),v.d(b,"Box3Helper",function(){return zE}),v.d(b,"BoxBufferGeometry",function(){return xo}),v.d(b,"BoxGeometry",function(){return xo}),v.d(b,"BoxHelper",function(){return nx}),v.d(b,"BufferAttribute",function(){return gn}),v.d(b,"BufferGeometry",function(){return Xt}),v.d(b,"BufferGeometryLoader",function(){return Ty}),v.d(b,"ByteType",function(){return Up}),v.d(b,"Cache",function(){return cu}),v.d(b,"Camera",function(){return aa}),v.d(b,"CameraHelper",function(){return HE}),v.d(b,"CanvasRenderer",function(){return RM}),v.d(b,"CanvasTexture",function(){return $t}),v.d(b,"CatmullRomCurve3",function(){return Vh}),v.d(b,"CineonToneMapping",function(){return O}),v.d(b,"CircleBufferGeometry",function(){return _t}),v.d(b,"CircleGeometry",function(){return _t}),v.d(b,"ClampToEdgeWrapping",function(){return xt}),v.d(b,"Clock",function(){return Ny}),v.d(b,"Color",function(){return Dt}),v.d(b,"ColorKeyframeTrack",function(){return Mv}),v.d(b,"CompressedTexture",function(){return kt}),v.d(b,"CompressedTextureLoader",function(){return pE}),v.d(b,"ConeBufferGeometry",function(){return Lt}),v.d(b,"ConeGeometry",function(){return Lt}),v.d(b,"CubeCamera",function(){return la}),v.d(b,"CubeReflectionMapping",function(){return se}),v.d(b,"CubeRefractionMapping",function(){return ge}),v.d(b,"CubeTexture",function(){return to}),v.d(b,"CubeTextureLoader",function(){return py}),v.d(b,"CubeUVReflectionMapping",function(){return Fe}),v.d(b,"CubeUVRefractionMapping",function(){return Ye}),v.d(b,"CubicBezierCurve",function(){return _a}),v.d(b,"CubicBezierCurve3",function(){return sl}),v.d(b,"CubicInterpolant",function(){return uy}),v.d(b,"CullFaceBack",function(){return Re}),v.d(b,"CullFaceFront",function(){return Ie}),v.d(b,"CullFaceFrontBack",function(){return M}),v.d(b,"CullFaceNone",function(){return xe}),v.d(b,"Curve",function(){return ci}),v.d(b,"CurvePath",function(){return my}),v.d(b,"CustomBlending",function(){return ye}),v.d(b,"CustomToneMapping",function(){return J}),v.d(b,"CylinderBufferGeometry",function(){return Vt}),v.d(b,"CylinderGeometry",function(){return Vt}),v.d(b,"Cylindrical",function(){return NE}),v.d(b,"DataTexture",function(){return xs}),v.d(b,"DataTexture2DArray",function(){return Eh}),v.d(b,"DataTexture3D",function(){return Vr}),v.d(b,"DataTextureLoader",function(){return fy}),v.d(b,"DataUtils",function(){return XE}),v.d(b,"DecrementStencilOp",function(){return th}),v.d(b,"DecrementWrapStencilOp",function(){return Cg}),v.d(b,"DefaultLoadingManager",function(){return dy}),v.d(b,"DepthFormat",function(){return ti}),v.d(b,"DepthStencilFormat",function(){return Ws}),v.d(b,"DepthTexture",function(){return lt}),v.d(b,"DirectionalLight",function(){return sm}),v.d(b,"DirectionalLightHelper",function(){return GE}),v.d(b,"DiscreteInterpolant",function(){return hy}),v.d(b,"DodecahedronBufferGeometry",function(){return Kt}),v.d(b,"DodecahedronGeometry",function(){return Kt}),v.d(b,"DoubleSide",function(){return ne}),v.d(b,"DstAlphaFactor",function(){return rn}),v.d(b,"DstColorFactor",function(){return Dn}),v.d(b,"DynamicBufferAttribute",function(){return cM}),v.d(b,"DynamicCopyUsage",function(){return sh}),v.d(b,"DynamicDrawUsage",function(){return po}),v.d(b,"DynamicReadUsage",function(){return Ig}),v.d(b,"EdgesGeometry",function(){return Xi}),v.d(b,"EdgesHelper",function(){return SM}),v.d(b,"EllipseCurve",function(){return oi}),v.d(b,"EqualDepth",function(){return Ln}),v.d(b,"EqualStencilFunc",function(){return ih}),v.d(b,"EquirectangularReflectionMapping",function(){return be}),v.d(b,"EquirectangularRefractionMapping",function(){return we}),v.d(b,"Euler",function(){return ea}),v.d(b,"EventDispatcher",function(){return Fo}),v.d(b,"ExtrudeBufferGeometry",function(){return qo}),v.d(b,"ExtrudeGeometry",function(){return qo}),v.d(b,"FaceColors",function(){return eM}),v.d(b,"FileLoader",function(){return Jo}),v.d(b,"FlatShading",function(){return qe}),v.d(b,"Float16BufferAttribute",function(){return hf}),v.d(b,"Float32Attribute",function(){return yM}),v.d(b,"Float32BufferAttribute",function(){return Tt}),v.d(b,"Float64Attribute",function(){return xM}),v.d(b,"Float64BufferAttribute",function(){return ad}),v.d(b,"FloatType",function(){return Io}),v.d(b,"Fog",function(){return Kl}),v.d(b,"FogExp2",function(){return Ui}),v.d(b,"Font",function(){return Uv}),v.d(b,"FontLoader",function(){return vE}),v.d(b,"FrontSide",function(){return z}),v.d(b,"Frustum",function(){return Za}),v.d(b,"GLBufferAttribute",function(){return jy}),v.d(b,"GLSL1",function(){return qc}),v.d(b,"GLSL3",function(){return Yc}),v.d(b,"GammaEncoding",function(){return ai}),v.d(b,"GreaterDepth",function(){return pi}),v.d(b,"GreaterEqualDepth",function(){return Di}),v.d(b,"GreaterEqualStencilFunc",function(){return nf}),v.d(b,"GreaterStencilFunc",function(){return rh}),v.d(b,"GridHelper",function(){return Qy}),v.d(b,"Group",function(){return da}),v.d(b,"HalfFloatType",function(){return Vs}),v.d(b,"HemisphereLight",function(){return Cv}),v.d(b,"HemisphereLightHelper",function(){return UE}),v.d(b,"HemisphereLightProbe",function(){return Py}),v.d(b,"IcosahedronBufferGeometry",function(){return Xh}),v.d(b,"IcosahedronGeometry",function(){return Xh}),v.d(b,"ImageBitmapLoader",function(){return Ay}),v.d(b,"ImageLoader",function(){return Hd}),v.d(b,"ImageUtils",function(){return Ur}),v.d(b,"ImmediateRenderObject",function(){return Yy}),v.d(b,"IncrementStencilOp",function(){return Qp}),v.d(b,"IncrementWrapStencilOp",function(){return Rg}),v.d(b,"InstancedBufferAttribute",function(){return Bv}),v.d(b,"InstancedBufferGeometry",function(){return Fv}),v.d(b,"InstancedInterleavedBuffer",function(){return zy}),v.d(b,"InstancedMesh",function(){return Id}),v.d(b,"Int16Attribute",function(){return mM}),v.d(b,"Int16BufferAttribute",function(){return sd}),v.d(b,"Int32Attribute",function(){return vM}),v.d(b,"Int32BufferAttribute",function(){return bh}),v.d(b,"Int8Attribute",function(){return dM}),v.d(b,"Int8BufferAttribute",function(){return zl}),v.d(b,"IntType",function(){return Gp}),v.d(b,"InterleavedBuffer",function(){return pa}),v.d(b,"InterleavedBufferAttribute",function(){return Xo}),v.d(b,"Interpolant",function(){return xa}),v.d(b,"InterpolateDiscrete",function(){return as}),v.d(b,"InterpolateLinear",function(){return Cl}),v.d(b,"InterpolateSmooth",function(){return Do}),v.d(b,"InvertStencilOp",function(){return Pg}),v.d(b,"JSONLoader",function(){return CM}),v.d(b,"KeepStencilOp",function(){return Rn}),v.d(b,"KeyframeTrack",function(){return Yo}),v.d(b,"LOD",function(){return Wf}),v.d(b,"LatheBufferGeometry",function(){return qh}),v.d(b,"LatheGeometry",function(){return qh}),v.d(b,"Layers",function(){return Kc}),v.d(b,"LensFlare",function(){return IM}),v.d(b,"LessDepth",function(){return In}),v.d(b,"LessEqualDepth",function(){return di}),v.d(b,"LessEqualStencilFunc",function(){return ef}),v.d(b,"LessStencilFunc",function(){return us}),v.d(b,"Light",function(){return Zo}),v.d(b,"LightProbe",function(){return jd}),v.d(b,"Line",function(){return c}),v.d(b,"Line3",function(){return qy}),v.d(b,"LineBasicMaterial",function(){return ki}),v.d(b,"LineCurve",function(){return al}),v.d(b,"LineCurve3",function(){return ou}),v.d(b,"LineDashedMaterial",function(){return Tv}),v.d(b,"LineLoop",function(){return k}),v.d(b,"LinePieces",function(){return KE}),v.d(b,"LineSegments",function(){return A}),v.d(b,"LineStrip",function(){return ZE}),v.d(b,"LinearEncoding",function(){return Ht}),v.d(b,"LinearFilter",function(){return Gn}),v.d(b,"LinearInterpolant",function(){return Ev}),v.d(b,"LinearMipMapLinearFilter",function(){return Bp}),v.d(b,"LinearMipMapNearestFilter",function(){return Fp}),v.d(b,"LinearMipmapLinearFilter",function(){return zs}),v.d(b,"LinearMipmapNearestFilter",function(){return os}),v.d(b,"LinearToneMapping",function(){return E}),v.d(b,"Loader",function(){return gr}),v.d(b,"LoaderUtils",function(){return lm}),v.d(b,"LoadingManager",function(){return Av}),v.d(b,"LogLuvEncoding",function(){return zn}),v.d(b,"LoopOnce",function(){return Qu}),v.d(b,"LoopPingPong",function(){return No}),v.d(b,"LoopRepeat",function(){return Vc}),v.d(b,"LuminanceAlphaFormat",function(){return Pc}),v.d(b,"LuminanceFormat",function(){return Vp}),v.d(b,"MOUSE",function(){return F}),v.d(b,"Material",function(){return Bi}),v.d(b,"MaterialLoader",function(){return Sy}),v.d(b,"Math",function(){return Zs}),v.d(b,"MathUtils",function(){return Zs}),v.d(b,"Matrix3",function(){return Xn}),v.d(b,"Matrix4",function(){return Rt}),v.d(b,"MaxEquation",function(){return Qe}),v.d(b,"Mesh",function(){return En}),v.d(b,"MeshBasicMaterial",function(){return gi}),v.d(b,"MeshDepthMaterial",function(){return bn}),v.d(b,"MeshDistanceMaterial",function(){return Oh}),v.d(b,"MeshFaceMaterial",function(){return nM}),v.d(b,"MeshLambertMaterial",function(){return om}),v.d(b,"MeshMatcapMaterial",function(){return Sv}),v.d(b,"MeshNormalMaterial",function(){return wv}),v.d(b,"MeshPhongMaterial",function(){return rm}),v.d(b,"MeshPhysicalMaterial",function(){return xv}),v.d(b,"MeshStandardMaterial",function(){return im}),v.d(b,"MeshToonMaterial",function(){return bv}),v.d(b,"MinEquation",function(){return $e}),v.d(b,"MirroredRepeatWrapping",function(){return Ot}),v.d(b,"MixOperation",function(){return Oa}),v.d(b,"MultiMaterial",function(){return iM}),v.d(b,"MultiplyBlending",function(){return W}),v.d(b,"MultiplyOperation",function(){return Co}),v.d(b,"NearestFilter",function(){return Gt}),v.d(b,"NearestMipMapLinearFilter",function(){return Hs}),v.d(b,"NearestMipMapNearestFilter",function(){return nr}),v.d(b,"NearestMipmapLinearFilter",function(){return Po}),v.d(b,"NearestMipmapNearestFilter",function(){return fi}),v.d(b,"NeverDepth",function(){return jn}),v.d(b,"NeverStencilFunc",function(){return nh}),v.d(b,"NoBlending",function(){return Pe}),v.d(b,"NoColors",function(){return QE}),v.d(b,"NoToneMapping",function(){return Sr}),v.d(b,"NormalAnimationBlendMode",function(){return Ys}),v.d(b,"NormalBlending",function(){return ae}),v.d(b,"NotEqualDepth",function(){return uo}),v.d(b,"NotEqualStencilFunc",function(){return tf}),v.d(b,"NumberKeyframeTrack",function(){return Ud}),v.d(b,"Object3D",function(){return pn}),v.d(b,"ObjectLoader",function(){return fE}),v.d(b,"ObjectSpaceNormalMap",function(){return Ll}),v.d(b,"OctahedronBufferGeometry",function(){return su}),v.d(b,"OctahedronGeometry",function(){return su}),v.d(b,"OneFactor",function(){return vt}),v.d(b,"OneMinusDstAlphaFactor",function(){return Bt}),v.d(b,"OneMinusDstColorFactor",function(){return Fn}),v.d(b,"OneMinusSrcAlphaFactor",function(){return qt}),v.d(b,"OneMinusSrcColorFactor",function(){return wt}),v.d(b,"OrthographicCamera",function(){return tc}),v.d(b,"PCFShadowMap",function(){return D}),v.d(b,"PCFSoftShadowMap",function(){return ee}),v.d(b,"PMREMGenerator",function(){return YE}),v.d(b,"ParametricBufferGeometry",function(){return Bd}),v.d(b,"ParametricGeometry",function(){return Bd}),v.d(b,"Particle",function(){return oM}),v.d(b,"ParticleBasicMaterial",function(){return lM}),v.d(b,"ParticleSystem",function(){return sM}),v.d(b,"ParticleSystemMaterial",function(){return uM}),v.d(b,"Path",function(){return du}),v.d(b,"PerspectiveCamera",function(){return vi}),v.d(b,"Plane",function(){return jr}),v.d(b,"PlaneBufferGeometry",function(){return Ki}),v.d(b,"PlaneGeometry",function(){return Ki}),v.d(b,"PlaneHelper",function(){return jE}),v.d(b,"PointCloud",function(){return rM}),v.d(b,"PointCloudMaterial",function(){return aM}),v.d(b,"PointLight",function(){return Lv}),v.d(b,"PointLightHelper",function(){return FE}),v.d(b,"Points",function(){return nt}),v.d(b,"PointsMaterial",function(){return ie}),v.d(b,"PolarGridHelper",function(){return kE}),v.d(b,"PolyhedronBufferGeometry",function(){return jt}),v.d(b,"PolyhedronGeometry",function(){return jt}),v.d(b,"PositionalAudio",function(){return wE}),v.d(b,"PropertyBinding",function(){return On}),v.d(b,"PropertyMixer",function(){return ky}),v.d(b,"QuadraticBezierCurve",function(){return ya}),v.d(b,"QuadraticBezierCurve3",function(){return fv}),v.d(b,"Quaternion",function(){return Fi}),v.d(b,"QuaternionKeyframeTrack",function(){return ec}),v.d(b,"QuaternionLinearInterpolant",function(){return cy}),v.d(b,"REVISION",function(){return j}),v.d(b,"RGBADepthPacking",function(){return Xc}),v.d(b,"RGBAFormat",function(){return Tr}),v.d(b,"RGBAIntegerFormat",function(){return Lc}),v.d(b,"RGBA_ASTC_10x10_Format",function(){return Uc}),v.d(b,"RGBA_ASTC_10x5_Format",function(){return Rl}),v.d(b,"RGBA_ASTC_10x6_Format",function(){return Xs}),v.d(b,"RGBA_ASTC_10x8_Format",function(){return Yp}),v.d(b,"RGBA_ASTC_12x10_Format",function(){return kc}),v.d(b,"RGBA_ASTC_12x12_Format",function(){return Yu}),v.d(b,"RGBA_ASTC_4x4_Format",function(){return Wu}),v.d(b,"RGBA_ASTC_5x4_Format",function(){return Vn}),v.d(b,"RGBA_ASTC_5x5_Format",function(){return Lo}),v.d(b,"RGBA_ASTC_6x5_Format",function(){return Xu}),v.d(b,"RGBA_ASTC_6x6_Format",function(){return Xp}),v.d(b,"RGBA_ASTC_8x5_Format",function(){return qu}),v.d(b,"RGBA_ASTC_8x6_Format",function(){return qp}),v.d(b,"RGBA_ASTC_8x8_Format",function(){return Bc}),v.d(b,"RGBA_BPTC_Format",function(){return $u}),v.d(b,"RGBA_ETC2_EAC_Format",function(){return Na}),v.d(b,"RGBA_PVRTC_2BPPV1_Format",function(){return Dc}),v.d(b,"RGBA_PVRTC_4BPPV1_Format",function(){return hr}),v.d(b,"RGBA_S3TC_DXT1_Format",function(){return zu}),v.d(b,"RGBA_S3TC_DXT3_Format",function(){return ju}),v.d(b,"RGBA_S3TC_DXT5_Format",function(){return Vu}),v.d(b,"RGBDEncoding",function(){return dr}),v.d(b,"RGBEEncoding",function(){return Mr}),v.d(b,"RGBEFormat",function(){return Wp}),v.d(b,"RGBFormat",function(){return Oo}),v.d(b,"RGBIntegerFormat",function(){return Oc}),v.d(b,"RGBM16Encoding",function(){return Wc}),v.d(b,"RGBM7Encoding",function(){return Il}),v.d(b,"RGB_ETC1_Format",function(){return Fc}),v.d(b,"RGB_ETC2_Format",function(){return co}),v.d(b,"RGB_PVRTC_2BPPV1_Format",function(){return Nc}),v.d(b,"RGB_PVRTC_4BPPV1_Format",function(){return ir}),v.d(b,"RGB_S3TC_DXT1_Format",function(){return Hu}),v.d(b,"RGFormat",function(){return Gu}),v.d(b,"RGIntegerFormat",function(){return Er}),v.d(b,"RawShaderMaterial",function(){return Qh}),v.d(b,"Ray",function(){return Ho}),v.d(b,"Raycaster",function(){return OE}),v.d(b,"RectAreaLight",function(){return Nv}),v.d(b,"RedFormat",function(){return La}),v.d(b,"RedIntegerFormat",function(){return Ic}),v.d(b,"ReinhardToneMapping",function(){return I}),v.d(b,"RepeatWrapping",function(){return ht}),v.d(b,"ReplaceStencilOp",function(){return Ag}),v.d(b,"ReverseSubtractEquation",function(){return Ne}),v.d(b,"RingBufferGeometry",function(){return Yh}),v.d(b,"RingGeometry",function(){return Yh}),v.d(b,"SRGB8_ALPHA8_ASTC_10x10_Format",function(){return Zp}),v.d(b,"SRGB8_ALPHA8_ASTC_10x5_Format",function(){return jc}),v.d(b,"SRGB8_ALPHA8_ASTC_10x6_Format",function(){return $p}),v.d(b,"SRGB8_ALPHA8_ASTC_10x8_Format",function(){return Jp}),v.d(b,"SRGB8_ALPHA8_ASTC_12x10_Format",function(){return Kp}),v.d(b,"SRGB8_ALPHA8_ASTC_12x12_Format",function(){return qs}),v.d(b,"SRGB8_ALPHA8_ASTC_4x4_Format",function(){return Gc}),v.d(b,"SRGB8_ALPHA8_ASTC_5x4_Format",function(){return Ju}),v.d(b,"SRGB8_ALPHA8_ASTC_5x5_Format",function(){return Zu}),v.d(b,"SRGB8_ALPHA8_ASTC_6x5_Format",function(){return Hc}),v.d(b,"SRGB8_ALPHA8_ASTC_6x6_Format",function(){return cr}),v.d(b,"SRGB8_ALPHA8_ASTC_8x5_Format",function(){return Ku}),v.d(b,"SRGB8_ALPHA8_ASTC_8x6_Format",function(){return Da}),v.d(b,"SRGB8_ALPHA8_ASTC_8x8_Format",function(){return zc}),v.d(b,"Scene",function(){return el}),v.d(b,"SceneUtils",function(){return PM}),v.d(b,"ShaderChunk",function(){return Qt}),v.d(b,"ShaderLib",function(){return Pr}),v.d(b,"ShaderMaterial",function(){return or}),v.d(b,"ShadowMaterial",function(){return yv}),v.d(b,"Shape",function(){return ul}),v.d(b,"ShapeBufferGeometry",function(){return au}),v.d(b,"ShapeGeometry",function(){return au}),v.d(b,"ShapePath",function(){return Ry}),v.d(b,"ShapeUtils",function(){return Ts}),v.d(b,"ShortType",function(){return kp}),v.d(b,"Skeleton",function(){return Gh}),v.d(b,"SkeletonHelper",function(){return Jy}),v.d(b,"SkinnedMesh",function(){return il}),v.d(b,"SmoothShading",function(){return ft}),v.d(b,"Sphere",function(){return Mi}),v.d(b,"SphereBufferGeometry",function(){return lu}),v.d(b,"SphereGeometry",function(){return lu}),v.d(b,"Spherical",function(){return LE}),v.d(b,"SphericalHarmonics3",function(){return Dv}),v.d(b,"SplineCurve",function(){return Kf}),v.d(b,"SpotLight",function(){return Iv}),v.d(b,"SpotLightHelper",function(){return DE}),v.d(b,"Sprite",function(){return iu}),v.d(b,"SpriteMaterial",function(){return Ql}),v.d(b,"SrcAlphaFactor",function(){return Wt}),v.d(b,"SrcAlphaSaturateFactor",function(){return Mn}),v.d(b,"SrcColorFactor",function(){return ln}),v.d(b,"StaticCopyUsage",function(){return Lg}),v.d(b,"StaticDrawUsage",function(){return $s}),v.d(b,"StaticReadUsage",function(){return oh}),v.d(b,"StereoCamera",function(){return _E}),v.d(b,"StreamCopyUsage",function(){return ah}),v.d(b,"StreamDrawUsage",function(){return Js}),v.d(b,"StreamReadUsage",function(){return Og}),v.d(b,"StringKeyframeTrack",function(){return hu}),v.d(b,"SubtractEquation",function(){return Le}),v.d(b,"SubtractiveBlending",function(){return De}),v.d(b,"TOUCH",function(){return K}),v.d(b,"TangentSpaceNormalMap",function(){return Br}),v.d(b,"TetrahedronBufferGeometry",function(){return $h}),v.d(b,"TetrahedronGeometry",function(){return $h}),v.d(b,"TextBufferGeometry",function(){return nm}),v.d(b,"TextGeometry",function(){return nm}),v.d(b,"Texture",function(){return mi}),v.d(b,"TextureLoader",function(){return Rv}),v.d(b,"TorusBufferGeometry",function(){return Jh}),v.d(b,"TorusGeometry",function(){return Jh}),v.d(b,"TorusKnotBufferGeometry",function(){return Zh}),v.d(b,"TorusKnotGeometry",function(){return Zh}),v.d(b,"Triangle",function(){return qn}),v.d(b,"TriangleFanDrawMode",function(){return Mt}),v.d(b,"TriangleStripDrawMode",function(){return at}),v.d(b,"TrianglesDrawMode",function(){return rt}),v.d(b,"TubeBufferGeometry",function(){return Kh}),v.d(b,"TubeGeometry",function(){return Kh}),v.d(b,"UVMapping",function(){return Z}),v.d(b,"Uint16Attribute",function(){return gM}),v.d(b,"Uint16BufferAttribute",function(){return Va}),v.d(b,"Uint32Attribute",function(){return _M}),v.d(b,"Uint32BufferAttribute",function(){return eo}),v.d(b,"Uint8Attribute",function(){return pM}),v.d(b,"Uint8BufferAttribute",function(){return od}),v.d(b,"Uint8ClampedAttribute",function(){return fM}),v.d(b,"Uint8ClampedBufferAttribute",function(){return xh}),v.d(b,"Uniform",function(){return hm}),v.d(b,"UniformsLib",function(){return At}),v.d(b,"UniformsUtils",function(){return bo}),v.d(b,"UnsignedByteType",function(){return ss}),v.d(b,"UnsignedInt248Type",function(){return Nn}),v.d(b,"UnsignedIntType",function(){return js}),v.d(b,"UnsignedShort4444Type",function(){return Hp}),v.d(b,"UnsignedShort5551Type",function(){return zp}),v.d(b,"UnsignedShort565Type",function(){return jp}),v.d(b,"UnsignedShortType",function(){return Al}),v.d(b,"VSMShadowMap",function(){return C}),v.d(b,"Vector2",function(){return mt}),v.d(b,"Vector3",function(){return S}),v.d(b,"Vector4",function(){return Bn}),v.d(b,"VectorKeyframeTrack",function(){return kd}),v.d(b,"Vertex",function(){return hM}),v.d(b,"VertexColors",function(){return tM}),v.d(b,"VideoTexture",function(){return Ft}),v.d(b,"WebGL1Renderer",function(){return Ci}),v.d(b,"WebGLCubeRenderTarget",function(){return Yt}),v.d(b,"WebGLMultipleRenderTargets",function(){return Bl}),v.d(b,"WebGLMultisampleRenderTarget",function(){return Ks}),v.d(b,"WebGLRenderTarget",function(){return $r}),v.d(b,"WebGLRenderTargetCube",function(){return AM}),v.d(b,"WebGLRenderer",function(){return Un}),v.d(b,"WebGLUtils",function(){return Hf}),v.d(b,"WireframeGeometry",function(){return _v}),v.d(b,"WireframeHelper",function(){return TM}),v.d(b,"WrapAroundEnding",function(){return Pl}),v.d(b,"XHRLoader",function(){return EM}),v.d(b,"ZeroCurvatureEnding",function(){return zi}),v.d(b,"ZeroFactor",function(){return bt}),v.d(b,"ZeroSlopeEnding",function(){return ls}),v.d(b,"ZeroStencilOp",function(){return eh}),v.d(b,"sRGBEncoding",function(){return vn});var te={};v.r(te),v.d(te,"isMobile",function(){return Ko}),v.d(te,"EventEmitter",function(){return oc.a}),v.d(te,"earcut",function(){return o0.a}),v.d(te,"BaseTextureCache",function(){return Eo}),v.d(te,"CanvasRenderTarget",function(){return v0}),v.d(te,"DATA_URI",function(){return Yx}),v.d(te,"ProgramCache",function(){return g0}),v.d(te,"TextureCache",function(){return Xr}),v.d(te,"clearTextureCache",function(){return u2}),v.d(te,"correctBlendMode",function(){return d0}),v.d(te,"createIndicesForQuads",function(){return Wx}),v.d(te,"decomposeDataUri",function(){return h2}),v.d(te,"deprecation",function(){return fl}),v.d(te,"destroyTextureCache",function(){return l2}),v.d(te,"determineCrossOrigin",function(){return $x}),v.d(te,"getBufferType",function(){return Tm}),v.d(te,"getResolutionOfUrl",function(){return $d}),v.d(te,"hex2rgb",function(){return bu}),v.d(te,"hex2string",function(){return u0}),v.d(te,"interleaveTypedArrays",function(){return s2}),v.d(te,"isPow2",function(){return f0}),v.d(te,"isWebGLSupported",function(){return jx}),v.d(te,"log2",function(){return m0}),v.d(te,"nextPow2",function(){return Yd}),v.d(te,"premultiplyBlendMode",function(){return c0}),v.d(te,"premultiplyRgba",function(){return Vx}),v.d(te,"premultiplyTint",function(){return Sm}),v.d(te,"premultiplyTintToRgba",function(){return p0}),v.d(te,"removeItems",function(){return wu}),v.d(te,"rgb2hex",function(){return r2}),v.d(te,"sayHello",function(){return zx}),v.d(te,"sign",function(){return Su}),v.d(te,"skipHello",function(){return n2}),v.d(te,"string2hex",function(){return h0}),v.d(te,"trimCanvas",function(){return qx}),v.d(te,"uid",function(){return pl}),v.d(te,"url",function(){return xu});var fe=v(6),$=v(0),L=v.n($),Y=v(1);/**
1827
+ `},function(T,R,v){var b;(function(te,fe){var $="model",L="name",Y="type",j="vendor",F="version",K="mobile",xe="tablet",Re="smarttv",Ie=function(Pe){for(var ae={},Me=0;Me<Pe.length;Me++)ae[Pe[Me].toUpperCase()]=Pe[Me];return ae},M=function(Pe,ae){return typeof Pe=="string"&&N(ae).indexOf(N(Pe))!==-1},N=function(Pe){return Pe.toLowerCase()},D=function(Pe,ae){if(typeof Pe=="string")return Pe=Pe.replace(/^\s\s*/,"").replace(/\s\s*$/,""),ae===void 0?Pe:Pe.substring(0,255)},ee=function(Pe,ae){for(var Me,De,W,ye,Ce,Le,Ne=0;Ne<ae.length&&!Ce;){var $e=ae[Ne],Qe=ae[Ne+1];for(Me=De=0;Me<$e.length&&!Ce;)if(Ce=$e[Me++].exec(Pe))for(W=0;W<Qe.length;W++)Le=Ce[++De],typeof(ye=Qe[W])=="object"&&ye.length>0?ye.length===2?typeof ye[1]=="function"?this[ye[0]]=ye[1].call(this,Le):this[ye[0]]=ye[1]:ye.length===3?typeof ye[1]!="function"||ye[1].exec&&ye[1].test?this[ye[0]]=Le?Le.replace(ye[1],ye[2]):void 0:this[ye[0]]=Le?ye[1].call(this,Le,ye[2]):void 0:ye.length===4&&(this[ye[0]]=Le?ye[3].call(this,Le.replace(ye[1],ye[2])):void 0):this[ye]=Le||void 0;Ne+=2}},C=function(Pe,ae){for(var Me in ae)if(typeof ae[Me]=="object"&&ae[Me].length>0){for(var De=0;De<ae[Me].length;De++)if(M(ae[Me][De],Pe))return Me==="?"?void 0:Me}else if(M(ae[Me],Pe))return Me==="?"?void 0:Me;return Pe},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},V={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[F,[L,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[F,[L,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[L,F],[/opios[\/ ]+([\w\.]+)/i],[F,[L,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[F,[L,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[L,F],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[F,[L,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[F,[L,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[F,[L,"WeChat"]],[/konqueror\/([\w\.]+)/i],[F,[L,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[F,[L,"IE"]],[/yabrowser\/([\w\.]+)/i],[F,[L,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[L,/(.+)/,"$1 Secure Browser"],F],[/\bfocus\/([\w\.]+)/i],[F,[L,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[F,[L,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[F,[L,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[F,[L,"Dolphin"]],[/coast\/([\w\.]+)/i],[F,[L,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[F,[L,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[F,[L,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[L,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[L,/(.+)/,"$1 Browser"],F],[/(comodo_dragon)\/([\w\.]+)/i],[[L,/_/g," "],F],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[L,F],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[L],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[L,"Facebook"],F],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[L,F],[/\bgsa\/([\w\.]+) .*safari\//i],[F,[L,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[F,[L,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[L,"Chrome WebView"],F],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[F,[L,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[L,F],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[F,[L,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[F,L],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[L,[F,C,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[L,F],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[L,"Netscape"],F],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[F,[L,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[L,F]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",N]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",N]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",N]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[$,[j,"Samsung"],[Y,xe]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[$,[j,"Samsung"],[Y,K]],[/\((ip(?:hone|od)[\w ]*);/i],[$,[j,"Apple"],[Y,K]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[$,[j,"Apple"],[Y,xe]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[$,[j,"Huawei"],[Y,xe]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[$,[j,"Huawei"],[Y,K]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[$,/_/g," "],[j,"Xiaomi"],[Y,K]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[$,/_/g," "],[j,"Xiaomi"],[Y,xe]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[$,[j,"OPPO"],[Y,K]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[$,[j,"Vivo"],[Y,K]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[$,[j,"Realme"],[Y,K]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[$,[j,"Motorola"],[Y,K]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[$,[j,"Motorola"],[Y,xe]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[$,[j,"LG"],[Y,xe]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[$,[j,"LG"],[Y,K]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[$,[j,"Lenovo"],[Y,xe]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[$,/_/g," "],[j,"Nokia"],[Y,K]],[/(pixel c)\b/i],[$,[j,"Google"],[Y,xe]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[$,[j,"Google"],[Y,K]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[$,[j,"Sony"],[Y,K]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[$,"Xperia Tablet"],[j,"Sony"],[Y,xe]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[$,[j,"OnePlus"],[Y,K]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[$,[j,"Amazon"],[Y,xe]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[$,/(.+)/g,"Fire Phone $1"],[j,"Amazon"],[Y,K]],[/(playbook);[-\w\),; ]+(rim)/i],[$,j,[Y,xe]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[$,[j,"BlackBerry"],[Y,K]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[$,[j,"ASUS"],[Y,xe]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[$,[j,"ASUS"],[Y,K]],[/(nexus 9)/i],[$,[j,"HTC"],[Y,xe]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[j,[$,/_/g," "],[Y,K]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[$,[j,"Acer"],[Y,xe]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[$,[j,"Meizu"],[Y,K]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[$,[j,"Sharp"],[Y,K]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[j,$,[Y,K]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[j,$,[Y,xe]],[/(surface duo)/i],[$,[j,"Microsoft"],[Y,xe]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[$,[j,"Fairphone"],[Y,K]],[/(u304aa)/i],[$,[j,"AT&T"],[Y,K]],[/\bsie-(\w*)/i],[$,[j,"Siemens"],[Y,K]],[/\b(rct\w+) b/i],[$,[j,"RCA"],[Y,xe]],[/\b(venue[\d ]{2,7}) b/i],[$,[j,"Dell"],[Y,xe]],[/\b(q(?:mv|ta)\w+) b/i],[$,[j,"Verizon"],[Y,xe]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[$,[j,"Barnes & Noble"],[Y,xe]],[/\b(tm\d{3}\w+) b/i],[$,[j,"NuVision"],[Y,xe]],[/\b(k88) b/i],[$,[j,"ZTE"],[Y,xe]],[/\b(nx\d{3}j) b/i],[$,[j,"ZTE"],[Y,K]],[/\b(gen\d{3}) b.+49h/i],[$,[j,"Swiss"],[Y,K]],[/\b(zur\d{3}) b/i],[$,[j,"Swiss"],[Y,xe]],[/\b((zeki)?tb.*\b) b/i],[$,[j,"Zeki"],[Y,xe]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[j,"Dragon Touch"],$,[Y,xe]],[/\b(ns-?\w{0,9}) b/i],[$,[j,"Insignia"],[Y,xe]],[/\b((nxa|next)-?\w{0,9}) b/i],[$,[j,"NextBook"],[Y,xe]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[j,"Voice"],$,[Y,K]],[/\b(lvtel\-)?(v1[12]) b/i],[[j,"LvTel"],$,[Y,K]],[/\b(ph-1) /i],[$,[j,"Essential"],[Y,K]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[$,[j,"Envizen"],[Y,xe]],[/\b(trio[-\w\. ]+) b/i],[$,[j,"MachSpeed"],[Y,xe]],[/\btu_(1491) b/i],[$,[j,"Rotor"],[Y,xe]],[/(shield[\w ]+) b/i],[$,[j,"Nvidia"],[Y,xe]],[/(sprint) (\w+)/i],[j,$,[Y,K]],[/(kin\.[onetw]{3})/i],[[$,/\./g," "],[j,"Microsoft"],[Y,K]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[$,[j,"Zebra"],[Y,xe]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[$,[j,"Zebra"],[Y,K]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[j,$,[Y,"console"]],[/droid.+; (shield) bui/i],[$,[j,"Nvidia"],[Y,"console"]],[/(playstation [345portablevi]+)/i],[$,[j,"Sony"],[Y,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[$,[j,"Microsoft"],[Y,"console"]],[/smart-tv.+(samsung)/i],[j,[Y,Re]],[/hbbtv.+maple;(\d+)/i],[[$,/^/,"SmartTV"],[j,"Samsung"],[Y,Re]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[j,"LG"],[Y,Re]],[/(apple) ?tv/i],[j,[$,"Apple TV"],[Y,Re]],[/crkey/i],[[$,"Chromecast"],[j,"Google"],[Y,Re]],[/droid.+aft(\w)( bui|\))/i],[$,[j,"Amazon"],[Y,Re]],[/\(dtv[\);].+(aquos)/i],[$,[j,"Sharp"],[Y,Re]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[j,D],[$,D],[Y,Re]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[Y,Re]],[/((pebble))app/i],[j,$,[Y,"wearable"]],[/droid.+; (glass) \d/i],[$,[j,"Google"],[Y,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[$,[j,"Zebra"],[Y,"wearable"]],[/(quest( 2)?)/i],[$,[j,"Facebook"],[Y,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[j,[Y,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[$,[Y,K]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[$,[Y,xe]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[Y,xe]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[Y,K]],[/(android[-\w\. ]{0,9});.+buil/i],[$,[j,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[F,[L,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[F,[L,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[L,F],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[F,L]],os:[[/microsoft (windows) (vista|xp)/i],[L,F],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[L,[F,C,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[L,"Windows"],[F,C,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[F,/_/g,"."],[L,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[L,"Mac OS"],[F,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[F,L],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[L,F],[/\(bb(10);/i],[F,[L,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[F,[L,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[F,[L,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[F,[L,"webOS"]],[/crkey\/([\d\.]+)/i],[F,[L,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[L,"Chromium OS"],F],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[L,F],[/(sunos) ?([\w\.\d]*)/i],[[L,"Solaris"],F],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[L,F]]},ne=function(Pe,ae){if(typeof Pe=="object"&&(ae=Pe,Pe=void 0),!(this instanceof ne))return new ne(Pe,ae).getResult();var Me=Pe||(te!==void 0&&te.navigator&&te.navigator.userAgent?te.navigator.userAgent:""),De=ae?function(W,ye){var Ce={};for(var Le in W)ye[Le]&&ye[Le].length%2==0?Ce[Le]=ye[Le].concat(W[Le]):Ce[Le]=W[Le];return Ce}(V,ae):V;return this.getBrowser=function(){var W,ye={};return ye[L]=void 0,ye[F]=void 0,ee.call(ye,Me,De.browser),ye.major=typeof(W=ye.version)=="string"?W.replace(/[^\d\.]/g,"").split(".")[0]:void 0,ye},this.getCPU=function(){var W={architecture:void 0};return ee.call(W,Me,De.cpu),W},this.getDevice=function(){var W={vendor:void 0,model:void 0,type:void 0};return ee.call(W,Me,De.device),W},this.getEngine=function(){var W={name:void 0,version:void 0};return ee.call(W,Me,De.engine),W},this.getOS=function(){var W={name:void 0,version:void 0};return ee.call(W,Me,De.os),W},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Me},this.setUA=function(W){return Me=typeof W=="string"&&W.length>255?D(W,255):W,this},this.setUA(Me),this};ne.VERSION="1.0.2",ne.BROWSER=Ie([L,F,"major"]),ne.CPU=Ie(["architecture"]),ne.DEVICE=Ie([$,j,Y,"console",K,Re,xe,"wearable","embedded"]),ne.ENGINE=ne.OS=Ie([L,F]),R!==void 0?(T!==void 0&&T.exports&&(R=T.exports=ne),R.UAParser=ne):v(64)?(b=function(){return ne}.call(R,v,R,T))===void 0||(T.exports=b):te!==void 0&&(te.UAParser=ne);var qe=te!==void 0&&(te.jQuery||te.Zepto);if(qe&&!qe.ua){var ft=new ne;qe.ua=ft.getResult(),qe.ua.get=function(){return ft.getUA()},qe.ua.set=function(Pe){ft.setUA(Pe);var ae=ft.getResult();for(var Me in ae)qe.ua[Me]=ae[Me]}}})(typeof window=="object"?window:this)},function(T,R,v){(function(b){var te=b!==void 0&&b||typeof self!="undefined"&&self||window,fe=Function.prototype.apply;function $(L,Y){this._id=L,this._clearFn=Y}R.setTimeout=function(){return new $(fe.call(setTimeout,te,arguments),clearTimeout)},R.setInterval=function(){return new $(fe.call(setInterval,te,arguments),clearInterval)},R.clearTimeout=R.clearInterval=function(L){L&&L.close()},$.prototype.unref=$.prototype.ref=function(){},$.prototype.close=function(){this._clearFn.call(te,this._id)},R.enroll=function(L,Y){clearTimeout(L._idleTimeoutId),L._idleTimeout=Y},R.unenroll=function(L){clearTimeout(L._idleTimeoutId),L._idleTimeout=-1},R._unrefActive=R.active=function(L){clearTimeout(L._idleTimeoutId);var Y=L._idleTimeout;Y>=0&&(L._idleTimeoutId=setTimeout(function(){L._onTimeout&&L._onTimeout()},Y))},v(56),R.setImmediate=typeof self!="undefined"&&self.setImmediate||b!==void 0&&b.setImmediate||this&&this.setImmediate,R.clearImmediate=typeof self!="undefined"&&self.clearImmediate||b!==void 0&&b.clearImmediate||this&&this.clearImmediate}).call(this,v(4))},function(T,R,v){(function(b,te){(function(fe,$){if(!fe.setImmediate){var L,Y,j,F,K,xe=1,Re={},Ie=!1,M=fe.document,N=Object.getPrototypeOf&&Object.getPrototypeOf(fe);N=N&&N.setTimeout?N:fe,{}.toString.call(fe.process)==="[object process]"?L=function(C){te.nextTick(function(){ee(C)})}:function(){if(fe.postMessage&&!fe.importScripts){var C=!0,z=fe.onmessage;return fe.onmessage=function(){C=!1},fe.postMessage("","*"),fe.onmessage=z,C}}()?(F="setImmediate$"+Math.random()+"$",K=function(C){C.source===fe&&typeof C.data=="string"&&C.data.indexOf(F)===0&&ee(+C.data.slice(F.length))},fe.addEventListener?fe.addEventListener("message",K,!1):fe.attachEvent("onmessage",K),L=function(C){fe.postMessage(F+C,"*")}):fe.MessageChannel?((j=new MessageChannel).port1.onmessage=function(C){ee(C.data)},L=function(C){j.port2.postMessage(C)}):M&&"onreadystatechange"in M.createElement("script")?(Y=M.documentElement,L=function(C){var z=M.createElement("script");z.onreadystatechange=function(){ee(C),z.onreadystatechange=null,Y.removeChild(z),z=null},Y.appendChild(z)}):L=function(C){setTimeout(ee,0,C)},N.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var z=new Array(arguments.length-1),V=0;V<z.length;V++)z[V]=arguments[V+1];var ne={callback:C,args:z};return Re[xe]=ne,L(xe),xe++},N.clearImmediate=D}function D(C){delete Re[C]}function ee(C){if(Ie)setTimeout(ee,0,C);else{var z=Re[C];if(z){Ie=!0;try{(function(V){var ne=V.callback,qe=V.args;switch(qe.length){case 0:ne();break;case 1:ne(qe[0]);break;case 2:ne(qe[0],qe[1]);break;case 3:ne(qe[0],qe[1],qe[2]);break;default:ne.apply(void 0,qe)}})(z)}finally{D(C),Ie=!1}}}}})(typeof self=="undefined"?b===void 0?this:b:self)}).call(this,v(4),v(57))},function(T,R){var v,b,te=T.exports={};function fe(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function L(N){if(v===setTimeout)return setTimeout(N,0);if((v===fe||!v)&&setTimeout)return v=setTimeout,setTimeout(N,0);try{return v(N,0)}catch{try{return v.call(null,N,0)}catch{return v.call(this,N,0)}}}(function(){try{v=typeof setTimeout=="function"?setTimeout:fe}catch{v=fe}try{b=typeof clearTimeout=="function"?clearTimeout:$}catch{b=$}})();var Y,j=[],F=!1,K=-1;function xe(){F&&Y&&(F=!1,Y.length?j=Y.concat(j):K=-1,j.length&&Re())}function Re(){if(!F){var N=L(xe);F=!0;for(var D=j.length;D;){for(Y=j,j=[];++K<D;)Y&&Y[K].run();K=-1,D=j.length}Y=null,F=!1,function(ee){if(b===clearTimeout)return clearTimeout(ee);if((b===$||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(ee);try{b(ee)}catch{try{return b.call(null,ee)}catch{return b.call(this,ee)}}}(N)}}function Ie(N,D){this.fun=N,this.array=D}function M(){}te.nextTick=function(N){var D=new Array(arguments.length-1);if(arguments.length>1)for(var ee=1;ee<arguments.length;ee++)D[ee-1]=arguments[ee];j.push(new Ie(N,D)),j.length!==1||F||L(Re)},Ie.prototype.run=function(){this.fun.apply(null,this.array)},te.title="browser",te.browser=!0,te.env={},te.argv=[],te.version="",te.versions={},te.on=M,te.addListener=M,te.once=M,te.off=M,te.removeListener=M,te.removeAllListeners=M,te.emit=M,te.prependListener=M,te.prependOnceListener=M,te.listeners=function(N){return[]},te.binding=function(N){throw new Error("process.binding is not supported")},te.cwd=function(){return"/"},te.chdir=function(N){throw new Error("process.chdir is not supported")},te.umask=function(){return 0}},function(T,R,v){(function(b,te){var fe;/*! https://mths.be/punycode v1.4.1 by @mathias */(function($){R&&R.nodeType,b&&b.nodeType;var L=typeof te=="object"&&te;L.global!==L&&L.window!==L&&L.self;var Y,j=2147483647,F=/^xn--/,K=/[^\x20-\x7E]/,xe=/[\x2E\u3002\uFF0E\uFF61]/g,Re={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ie=Math.floor,M=String.fromCharCode;function N(Pe){throw new RangeError(Re[Pe])}function D(Pe,ae){for(var Me=Pe.length,De=[];Me--;)De[Me]=ae(Pe[Me]);return De}function ee(Pe,ae){var Me=Pe.split("@"),De="";return Me.length>1&&(De=Me[0]+"@",Pe=Me[1]),De+D((Pe=Pe.replace(xe,".")).split("."),ae).join(".")}function C(Pe){for(var ae,Me,De=[],W=0,ye=Pe.length;W<ye;)(ae=Pe.charCodeAt(W++))>=55296&&ae<=56319&&W<ye?(64512&(Me=Pe.charCodeAt(W++)))==56320?De.push(((1023&ae)<<10)+(1023&Me)+65536):(De.push(ae),W--):De.push(ae);return De}function z(Pe){return D(Pe,function(ae){var Me="";return ae>65535&&(Me+=M((ae-=65536)>>>10&1023|55296),ae=56320|1023&ae),Me+=M(ae)}).join("")}function V(Pe,ae){return Pe+22+75*(Pe<26)-((ae!=0)<<5)}function ne(Pe,ae,Me){var De=0;for(Pe=Me?Ie(Pe/700):Pe>>1,Pe+=Ie(Pe/ae);Pe>455;De+=36)Pe=Ie(Pe/35);return Ie(De+36*Pe/(Pe+38))}function qe(Pe){var ae,Me,De,W,ye,Ce,Le,Ne,$e,Qe,bt,vt=[],ln=Pe.length,wt=0,Wt=128,qt=72;for((Me=Pe.lastIndexOf("-"))<0&&(Me=0),De=0;De<Me;++De)Pe.charCodeAt(De)>=128&&N("not-basic"),vt.push(Pe.charCodeAt(De));for(W=Me>0?Me+1:0;W<ln;){for(ye=wt,Ce=1,Le=36;W>=ln&&N("invalid-input"),((Ne=(bt=Pe.charCodeAt(W++))-48<10?bt-22:bt-65<26?bt-65:bt-97<26?bt-97:36)>=36||Ne>Ie((j-wt)/Ce))&&N("overflow"),wt+=Ne*Ce,!(Ne<($e=Le<=qt?1:Le>=qt+26?26:Le-qt));Le+=36)Ce>Ie(j/(Qe=36-$e))&&N("overflow"),Ce*=Qe;qt=ne(wt-ye,ae=vt.length+1,ye==0),Ie(wt/ae)>j-Wt&&N("overflow"),Wt+=Ie(wt/ae),wt%=ae,vt.splice(wt++,0,Wt)}return z(vt)}function ft(Pe){var ae,Me,De,W,ye,Ce,Le,Ne,$e,Qe,bt,vt,ln,wt,Wt,qt=[];for(vt=(Pe=C(Pe)).length,ae=128,Me=0,ye=72,Ce=0;Ce<vt;++Ce)(bt=Pe[Ce])<128&&qt.push(M(bt));for(De=W=qt.length,W&&qt.push("-");De<vt;){for(Le=j,Ce=0;Ce<vt;++Ce)(bt=Pe[Ce])>=ae&&bt<Le&&(Le=bt);for(Le-ae>Ie((j-Me)/(ln=De+1))&&N("overflow"),Me+=(Le-ae)*ln,ae=Le,Ce=0;Ce<vt;++Ce)if((bt=Pe[Ce])<ae&&++Me>j&&N("overflow"),bt==ae){for(Ne=Me,$e=36;!(Ne<(Qe=$e<=ye?1:$e>=ye+26?26:$e-ye));$e+=36)Wt=Ne-Qe,wt=36-Qe,qt.push(M(V(Qe+Wt%wt,0))),Ne=Ie(Wt/wt);qt.push(M(V(Ne,0))),ye=ne(Me,ln,De==W),Me=0,++De}++Me,++ae}return qt.join("")}Y={version:"1.4.1",ucs2:{decode:C,encode:z},decode:qe,encode:ft,toASCII:function(Pe){return ee(Pe,function(ae){return K.test(ae)?"xn--"+ft(ae):ae})},toUnicode:function(Pe){return ee(Pe,function(ae){return F.test(ae)?qe(ae.slice(4).toLowerCase()):ae})}},(fe=function(){return Y}.call(R,v,R,b))===void 0||(b.exports=fe)})()}).call(this,v(8)(T),v(4))},function(T,R,v){T.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(T,R,v){R.decode=R.parse=v(61),R.encode=R.stringify=v(62)},function(T,R,v){function b(fe,$){return Object.prototype.hasOwnProperty.call(fe,$)}T.exports=function(fe,$,L,Y){$=$||"&",L=L||"=";var j={};if(typeof fe!="string"||fe.length===0)return j;var F=/\+/g;fe=fe.split($);var K=1e3;Y&&typeof Y.maxKeys=="number"&&(K=Y.maxKeys);var xe=fe.length;K>0&&xe>K&&(xe=K);for(var Re=0;Re<xe;++Re){var Ie,M,N,D,ee=fe[Re].replace(F,"%20"),C=ee.indexOf(L);C>=0?(Ie=ee.substr(0,C),M=ee.substr(C+1)):(Ie=ee,M=""),N=decodeURIComponent(Ie),D=decodeURIComponent(M),b(j,N)?te(j[N])?j[N].push(D):j[N]=[j[N],D]:j[N]=D}return j};var te=Array.isArray||function(fe){return Object.prototype.toString.call(fe)==="[object Array]"}},function(T,R,v){var b=function(L){switch(typeof L){case"string":return L;case"boolean":return L?"true":"false";case"number":return isFinite(L)?L:"";default:return""}};T.exports=function(L,Y,j,F){return Y=Y||"&",j=j||"=",L===null&&(L=void 0),typeof L=="object"?fe($(L),function(K){var xe=encodeURIComponent(b(K))+j;return te(L[K])?fe(L[K],function(Re){return xe+encodeURIComponent(b(Re))}).join(Y):xe+encodeURIComponent(b(L[K]))}).join(Y):F?encodeURIComponent(b(F))+j+encodeURIComponent(b(L)):""};var te=Array.isArray||function(L){return Object.prototype.toString.call(L)==="[object Array]"};function fe(L,Y){if(L.map)return L.map(Y);for(var j=[],F=0;F<L.length;F++)j.push(Y(L[F],F));return j}var $=Object.keys||function(L){var Y=[];for(var j in L)Object.prototype.hasOwnProperty.call(L,j)&&Y.push(j);return Y}},function(T,R){var v=function(){};v.prototype={fit:function(b){var te,fe,$,L,Y=b.length,j=Y>0?b[0].width:0,F=Y>0?b[0].height:0;for(this.root={x:0,y:0,width:j,height:F},te=0;te<Y;te++)$=b[te],(fe=this.findNode(this.root,$.width,$.height))?(L=this.splitNode(fe,$.width,$.height),$.x=L.x,$.y=L.y):(L=this.growNode($.width,$.height),$.x=L.x,$.y=L.y)},findNode:function(b,te,fe){return b.used?this.findNode(b.right,te,fe)||this.findNode(b.down,te,fe):te<=b.width&&fe<=b.height?b:null},splitNode:function(b,te,fe){return b.used=!0,b.down={x:b.x,y:b.y+fe,width:b.width,height:b.height-fe},b.right={x:b.x+te,y:b.y,width:b.width-te,height:fe},b},growNode:function(b,te){var fe=b<=this.root.width,$=te<=this.root.height,L=$&&this.root.height>=this.root.width+b,Y=fe&&this.root.width>=this.root.height+te;return L?this.growRight(b,te):Y?this.growDown(b,te):$?this.growRight(b,te):fe?this.growDown(b,te):null},growRight:function(b,te){var fe;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}},(fe=this.findNode(this.root,b,te))?this.splitNode(fe,b,te):null},growDown:function(b,te){var fe;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+te,down:{x:0,y:this.root.height,width:this.root.width,height:te},right:this.root},(fe=this.findNode(this.root,b,te))?this.splitNode(fe,b,te):null}},T.exports=v},function(T,R){(function(v){T.exports=v}).call(this,{})},function(T,R,v){v.r(R),v.d(R,"delay",function(){return VS}),v.d(R,"waitUntil",function(){return N_}),v.d(R,"SLIDE_EVENTS",function(){return Ro}),v.d(R,"Slide",function(){return HI});var b={};v.r(b),v.d(b,"ACESFilmicToneMapping",function(){return Q}),v.d(b,"AddEquation",function(){return Ce}),v.d(b,"AddOperation",function(){return ho}),v.d(b,"AdditiveAnimationBlendMode",function(){return Ue}),v.d(b,"AdditiveBlending",function(){return Me}),v.d(b,"AlphaFormat",function(){return Hn}),v.d(b,"AlwaysDepth",function(){return An}),v.d(b,"AlwaysStencilFunc",function(){return Nl}),v.d(b,"AmbientLight",function(){return am}),v.d(b,"AmbientLightProbe",function(){return Iy}),v.d(b,"AnimationClip",function(){return Gd}),v.d(b,"AnimationLoader",function(){return dE}),v.d(b,"AnimationMixer",function(){return Hy}),v.d(b,"AnimationObjectGroup",function(){return Gy}),v.d(b,"AnimationUtils",function(){return si}),v.d(b,"ArcCurve",function(){return io}),v.d(b,"ArrayCamera",function(){return Rd}),v.d(b,"ArrowHelper",function(){return VE}),v.d(b,"Audio",function(){return Gv}),v.d(b,"AudioAnalyser",function(){return Uy}),v.d(b,"AudioContext",function(){return kv}),v.d(b,"AudioListener",function(){return xE}),v.d(b,"AudioLoader",function(){return Cy}),v.d(b,"AxesHelper",function(){return rx}),v.d(b,"AxisHelper",function(){return bM}),v.d(b,"BackSide",function(){return V}),v.d(b,"BasicDepthPacking",function(){return Ol}),v.d(b,"BasicShadowMap",function(){return N}),v.d(b,"BinaryTextureLoader",function(){return MM}),v.d(b,"Bone",function(){return kh}),v.d(b,"BooleanKeyframeTrack",function(){return uu}),v.d(b,"BoundingBoxHelper",function(){return wM}),v.d(b,"Box2",function(){return nc}),v.d(b,"Box3",function(){return Zn}),v.d(b,"Box3Helper",function(){return zE}),v.d(b,"BoxBufferGeometry",function(){return xo}),v.d(b,"BoxGeometry",function(){return xo}),v.d(b,"BoxHelper",function(){return nx}),v.d(b,"BufferAttribute",function(){return gn}),v.d(b,"BufferGeometry",function(){return Xt}),v.d(b,"BufferGeometryLoader",function(){return Ty}),v.d(b,"ByteType",function(){return Up}),v.d(b,"Cache",function(){return cu}),v.d(b,"Camera",function(){return aa}),v.d(b,"CameraHelper",function(){return HE}),v.d(b,"CanvasRenderer",function(){return RM}),v.d(b,"CanvasTexture",function(){return $t}),v.d(b,"CatmullRomCurve3",function(){return Vh}),v.d(b,"CineonToneMapping",function(){return O}),v.d(b,"CircleBufferGeometry",function(){return _t}),v.d(b,"CircleGeometry",function(){return _t}),v.d(b,"ClampToEdgeWrapping",function(){return xt}),v.d(b,"Clock",function(){return Ny}),v.d(b,"Color",function(){return Dt}),v.d(b,"ColorKeyframeTrack",function(){return Mv}),v.d(b,"CompressedTexture",function(){return kt}),v.d(b,"CompressedTextureLoader",function(){return pE}),v.d(b,"ConeBufferGeometry",function(){return Lt}),v.d(b,"ConeGeometry",function(){return Lt}),v.d(b,"CubeCamera",function(){return la}),v.d(b,"CubeReflectionMapping",function(){return se}),v.d(b,"CubeRefractionMapping",function(){return ge}),v.d(b,"CubeTexture",function(){return to}),v.d(b,"CubeTextureLoader",function(){return py}),v.d(b,"CubeUVReflectionMapping",function(){return Fe}),v.d(b,"CubeUVRefractionMapping",function(){return Ye}),v.d(b,"CubicBezierCurve",function(){return _a}),v.d(b,"CubicBezierCurve3",function(){return sl}),v.d(b,"CubicInterpolant",function(){return uy}),v.d(b,"CullFaceBack",function(){return Re}),v.d(b,"CullFaceFront",function(){return Ie}),v.d(b,"CullFaceFrontBack",function(){return M}),v.d(b,"CullFaceNone",function(){return xe}),v.d(b,"Curve",function(){return ci}),v.d(b,"CurvePath",function(){return my}),v.d(b,"CustomBlending",function(){return ye}),v.d(b,"CustomToneMapping",function(){return J}),v.d(b,"CylinderBufferGeometry",function(){return Vt}),v.d(b,"CylinderGeometry",function(){return Vt}),v.d(b,"Cylindrical",function(){return NE}),v.d(b,"DataTexture",function(){return xs}),v.d(b,"DataTexture2DArray",function(){return Eh}),v.d(b,"DataTexture3D",function(){return Vr}),v.d(b,"DataTextureLoader",function(){return fy}),v.d(b,"DataUtils",function(){return XE}),v.d(b,"DecrementStencilOp",function(){return th}),v.d(b,"DecrementWrapStencilOp",function(){return Cg}),v.d(b,"DefaultLoadingManager",function(){return dy}),v.d(b,"DepthFormat",function(){return ti}),v.d(b,"DepthStencilFormat",function(){return Ws}),v.d(b,"DepthTexture",function(){return lt}),v.d(b,"DirectionalLight",function(){return sm}),v.d(b,"DirectionalLightHelper",function(){return GE}),v.d(b,"DiscreteInterpolant",function(){return hy}),v.d(b,"DodecahedronBufferGeometry",function(){return Kt}),v.d(b,"DodecahedronGeometry",function(){return Kt}),v.d(b,"DoubleSide",function(){return ne}),v.d(b,"DstAlphaFactor",function(){return rn}),v.d(b,"DstColorFactor",function(){return Dn}),v.d(b,"DynamicBufferAttribute",function(){return cM}),v.d(b,"DynamicCopyUsage",function(){return sh}),v.d(b,"DynamicDrawUsage",function(){return po}),v.d(b,"DynamicReadUsage",function(){return Ig}),v.d(b,"EdgesGeometry",function(){return qi}),v.d(b,"EdgesHelper",function(){return SM}),v.d(b,"EllipseCurve",function(){return oi}),v.d(b,"EqualDepth",function(){return Ln}),v.d(b,"EqualStencilFunc",function(){return ih}),v.d(b,"EquirectangularReflectionMapping",function(){return be}),v.d(b,"EquirectangularRefractionMapping",function(){return we}),v.d(b,"Euler",function(){return ea}),v.d(b,"EventDispatcher",function(){return Fo}),v.d(b,"ExtrudeBufferGeometry",function(){return qo}),v.d(b,"ExtrudeGeometry",function(){return qo}),v.d(b,"FaceColors",function(){return eM}),v.d(b,"FileLoader",function(){return Jo}),v.d(b,"FlatShading",function(){return qe}),v.d(b,"Float16BufferAttribute",function(){return hf}),v.d(b,"Float32Attribute",function(){return yM}),v.d(b,"Float32BufferAttribute",function(){return Tt}),v.d(b,"Float64Attribute",function(){return xM}),v.d(b,"Float64BufferAttribute",function(){return ad}),v.d(b,"FloatType",function(){return Io}),v.d(b,"Fog",function(){return Kl}),v.d(b,"FogExp2",function(){return ki}),v.d(b,"Font",function(){return Uv}),v.d(b,"FontLoader",function(){return vE}),v.d(b,"FrontSide",function(){return z}),v.d(b,"Frustum",function(){return Za}),v.d(b,"GLBufferAttribute",function(){return jy}),v.d(b,"GLSL1",function(){return qc}),v.d(b,"GLSL3",function(){return Yc}),v.d(b,"GammaEncoding",function(){return ai}),v.d(b,"GreaterDepth",function(){return pi}),v.d(b,"GreaterEqualDepth",function(){return Fi}),v.d(b,"GreaterEqualStencilFunc",function(){return nf}),v.d(b,"GreaterStencilFunc",function(){return rh}),v.d(b,"GridHelper",function(){return Qy}),v.d(b,"Group",function(){return da}),v.d(b,"HalfFloatType",function(){return Vs}),v.d(b,"HemisphereLight",function(){return Cv}),v.d(b,"HemisphereLightHelper",function(){return UE}),v.d(b,"HemisphereLightProbe",function(){return Py}),v.d(b,"IcosahedronBufferGeometry",function(){return Xh}),v.d(b,"IcosahedronGeometry",function(){return Xh}),v.d(b,"ImageBitmapLoader",function(){return Ay}),v.d(b,"ImageLoader",function(){return Hd}),v.d(b,"ImageUtils",function(){return Ur}),v.d(b,"ImmediateRenderObject",function(){return Yy}),v.d(b,"IncrementStencilOp",function(){return Qp}),v.d(b,"IncrementWrapStencilOp",function(){return Rg}),v.d(b,"InstancedBufferAttribute",function(){return Bv}),v.d(b,"InstancedBufferGeometry",function(){return Fv}),v.d(b,"InstancedInterleavedBuffer",function(){return zy}),v.d(b,"InstancedMesh",function(){return Id}),v.d(b,"Int16Attribute",function(){return mM}),v.d(b,"Int16BufferAttribute",function(){return sd}),v.d(b,"Int32Attribute",function(){return vM}),v.d(b,"Int32BufferAttribute",function(){return bh}),v.d(b,"Int8Attribute",function(){return dM}),v.d(b,"Int8BufferAttribute",function(){return zl}),v.d(b,"IntType",function(){return Gp}),v.d(b,"InterleavedBuffer",function(){return pa}),v.d(b,"InterleavedBufferAttribute",function(){return Xo}),v.d(b,"Interpolant",function(){return xa}),v.d(b,"InterpolateDiscrete",function(){return as}),v.d(b,"InterpolateLinear",function(){return Cl}),v.d(b,"InterpolateSmooth",function(){return Do}),v.d(b,"InvertStencilOp",function(){return Pg}),v.d(b,"JSONLoader",function(){return CM}),v.d(b,"KeepStencilOp",function(){return Rn}),v.d(b,"KeyframeTrack",function(){return Yo}),v.d(b,"LOD",function(){return Wf}),v.d(b,"LatheBufferGeometry",function(){return qh}),v.d(b,"LatheGeometry",function(){return qh}),v.d(b,"Layers",function(){return Kc}),v.d(b,"LensFlare",function(){return IM}),v.d(b,"LessDepth",function(){return In}),v.d(b,"LessEqualDepth",function(){return di}),v.d(b,"LessEqualStencilFunc",function(){return ef}),v.d(b,"LessStencilFunc",function(){return us}),v.d(b,"Light",function(){return Zo}),v.d(b,"LightProbe",function(){return jd}),v.d(b,"Line",function(){return c}),v.d(b,"Line3",function(){return qy}),v.d(b,"LineBasicMaterial",function(){return Gi}),v.d(b,"LineCurve",function(){return al}),v.d(b,"LineCurve3",function(){return ou}),v.d(b,"LineDashedMaterial",function(){return Tv}),v.d(b,"LineLoop",function(){return k}),v.d(b,"LinePieces",function(){return KE}),v.d(b,"LineSegments",function(){return A}),v.d(b,"LineStrip",function(){return ZE}),v.d(b,"LinearEncoding",function(){return Ht}),v.d(b,"LinearFilter",function(){return Gn}),v.d(b,"LinearInterpolant",function(){return Ev}),v.d(b,"LinearMipMapLinearFilter",function(){return Bp}),v.d(b,"LinearMipMapNearestFilter",function(){return Fp}),v.d(b,"LinearMipmapLinearFilter",function(){return zs}),v.d(b,"LinearMipmapNearestFilter",function(){return os}),v.d(b,"LinearToneMapping",function(){return E}),v.d(b,"Loader",function(){return gr}),v.d(b,"LoaderUtils",function(){return lm}),v.d(b,"LoadingManager",function(){return Av}),v.d(b,"LogLuvEncoding",function(){return zn}),v.d(b,"LoopOnce",function(){return Qu}),v.d(b,"LoopPingPong",function(){return No}),v.d(b,"LoopRepeat",function(){return Vc}),v.d(b,"LuminanceAlphaFormat",function(){return Pc}),v.d(b,"LuminanceFormat",function(){return Vp}),v.d(b,"MOUSE",function(){return F}),v.d(b,"Material",function(){return Ui}),v.d(b,"MaterialLoader",function(){return Sy}),v.d(b,"Math",function(){return Zs}),v.d(b,"MathUtils",function(){return Zs}),v.d(b,"Matrix3",function(){return Xn}),v.d(b,"Matrix4",function(){return Rt}),v.d(b,"MaxEquation",function(){return Qe}),v.d(b,"Mesh",function(){return En}),v.d(b,"MeshBasicMaterial",function(){return gi}),v.d(b,"MeshDepthMaterial",function(){return bn}),v.d(b,"MeshDistanceMaterial",function(){return Oh}),v.d(b,"MeshFaceMaterial",function(){return nM}),v.d(b,"MeshLambertMaterial",function(){return om}),v.d(b,"MeshMatcapMaterial",function(){return Sv}),v.d(b,"MeshNormalMaterial",function(){return wv}),v.d(b,"MeshPhongMaterial",function(){return rm}),v.d(b,"MeshPhysicalMaterial",function(){return xv}),v.d(b,"MeshStandardMaterial",function(){return im}),v.d(b,"MeshToonMaterial",function(){return bv}),v.d(b,"MinEquation",function(){return $e}),v.d(b,"MirroredRepeatWrapping",function(){return Ot}),v.d(b,"MixOperation",function(){return Oa}),v.d(b,"MultiMaterial",function(){return iM}),v.d(b,"MultiplyBlending",function(){return W}),v.d(b,"MultiplyOperation",function(){return Co}),v.d(b,"NearestFilter",function(){return Gt}),v.d(b,"NearestMipMapLinearFilter",function(){return Hs}),v.d(b,"NearestMipMapNearestFilter",function(){return nr}),v.d(b,"NearestMipmapLinearFilter",function(){return Po}),v.d(b,"NearestMipmapNearestFilter",function(){return fi}),v.d(b,"NeverDepth",function(){return jn}),v.d(b,"NeverStencilFunc",function(){return nh}),v.d(b,"NoBlending",function(){return Pe}),v.d(b,"NoColors",function(){return QE}),v.d(b,"NoToneMapping",function(){return Sr}),v.d(b,"NormalAnimationBlendMode",function(){return Ys}),v.d(b,"NormalBlending",function(){return ae}),v.d(b,"NotEqualDepth",function(){return uo}),v.d(b,"NotEqualStencilFunc",function(){return tf}),v.d(b,"NumberKeyframeTrack",function(){return Ud}),v.d(b,"Object3D",function(){return pn}),v.d(b,"ObjectLoader",function(){return fE}),v.d(b,"ObjectSpaceNormalMap",function(){return Ll}),v.d(b,"OctahedronBufferGeometry",function(){return su}),v.d(b,"OctahedronGeometry",function(){return su}),v.d(b,"OneFactor",function(){return vt}),v.d(b,"OneMinusDstAlphaFactor",function(){return Bt}),v.d(b,"OneMinusDstColorFactor",function(){return Fn}),v.d(b,"OneMinusSrcAlphaFactor",function(){return qt}),v.d(b,"OneMinusSrcColorFactor",function(){return wt}),v.d(b,"OrthographicCamera",function(){return tc}),v.d(b,"PCFShadowMap",function(){return D}),v.d(b,"PCFSoftShadowMap",function(){return ee}),v.d(b,"PMREMGenerator",function(){return YE}),v.d(b,"ParametricBufferGeometry",function(){return Bd}),v.d(b,"ParametricGeometry",function(){return Bd}),v.d(b,"Particle",function(){return oM}),v.d(b,"ParticleBasicMaterial",function(){return lM}),v.d(b,"ParticleSystem",function(){return sM}),v.d(b,"ParticleSystemMaterial",function(){return uM}),v.d(b,"Path",function(){return du}),v.d(b,"PerspectiveCamera",function(){return vi}),v.d(b,"Plane",function(){return jr}),v.d(b,"PlaneBufferGeometry",function(){return Ki}),v.d(b,"PlaneGeometry",function(){return Ki}),v.d(b,"PlaneHelper",function(){return jE}),v.d(b,"PointCloud",function(){return rM}),v.d(b,"PointCloudMaterial",function(){return aM}),v.d(b,"PointLight",function(){return Lv}),v.d(b,"PointLightHelper",function(){return FE}),v.d(b,"Points",function(){return nt}),v.d(b,"PointsMaterial",function(){return ie}),v.d(b,"PolarGridHelper",function(){return kE}),v.d(b,"PolyhedronBufferGeometry",function(){return jt}),v.d(b,"PolyhedronGeometry",function(){return jt}),v.d(b,"PositionalAudio",function(){return wE}),v.d(b,"PropertyBinding",function(){return On}),v.d(b,"PropertyMixer",function(){return ky}),v.d(b,"QuadraticBezierCurve",function(){return ya}),v.d(b,"QuadraticBezierCurve3",function(){return fv}),v.d(b,"Quaternion",function(){return Bi}),v.d(b,"QuaternionKeyframeTrack",function(){return ec}),v.d(b,"QuaternionLinearInterpolant",function(){return cy}),v.d(b,"REVISION",function(){return j}),v.d(b,"RGBADepthPacking",function(){return Xc}),v.d(b,"RGBAFormat",function(){return Tr}),v.d(b,"RGBAIntegerFormat",function(){return Lc}),v.d(b,"RGBA_ASTC_10x10_Format",function(){return Uc}),v.d(b,"RGBA_ASTC_10x5_Format",function(){return Rl}),v.d(b,"RGBA_ASTC_10x6_Format",function(){return Xs}),v.d(b,"RGBA_ASTC_10x8_Format",function(){return Yp}),v.d(b,"RGBA_ASTC_12x10_Format",function(){return kc}),v.d(b,"RGBA_ASTC_12x12_Format",function(){return Yu}),v.d(b,"RGBA_ASTC_4x4_Format",function(){return Wu}),v.d(b,"RGBA_ASTC_5x4_Format",function(){return Vn}),v.d(b,"RGBA_ASTC_5x5_Format",function(){return Lo}),v.d(b,"RGBA_ASTC_6x5_Format",function(){return Xu}),v.d(b,"RGBA_ASTC_6x6_Format",function(){return Xp}),v.d(b,"RGBA_ASTC_8x5_Format",function(){return qu}),v.d(b,"RGBA_ASTC_8x6_Format",function(){return qp}),v.d(b,"RGBA_ASTC_8x8_Format",function(){return Bc}),v.d(b,"RGBA_BPTC_Format",function(){return $u}),v.d(b,"RGBA_ETC2_EAC_Format",function(){return Na}),v.d(b,"RGBA_PVRTC_2BPPV1_Format",function(){return Dc}),v.d(b,"RGBA_PVRTC_4BPPV1_Format",function(){return hr}),v.d(b,"RGBA_S3TC_DXT1_Format",function(){return zu}),v.d(b,"RGBA_S3TC_DXT3_Format",function(){return ju}),v.d(b,"RGBA_S3TC_DXT5_Format",function(){return Vu}),v.d(b,"RGBDEncoding",function(){return dr}),v.d(b,"RGBEEncoding",function(){return Mr}),v.d(b,"RGBEFormat",function(){return Wp}),v.d(b,"RGBFormat",function(){return Oo}),v.d(b,"RGBIntegerFormat",function(){return Oc}),v.d(b,"RGBM16Encoding",function(){return Wc}),v.d(b,"RGBM7Encoding",function(){return Il}),v.d(b,"RGB_ETC1_Format",function(){return Fc}),v.d(b,"RGB_ETC2_Format",function(){return co}),v.d(b,"RGB_PVRTC_2BPPV1_Format",function(){return Nc}),v.d(b,"RGB_PVRTC_4BPPV1_Format",function(){return ir}),v.d(b,"RGB_S3TC_DXT1_Format",function(){return Hu}),v.d(b,"RGFormat",function(){return Gu}),v.d(b,"RGIntegerFormat",function(){return Er}),v.d(b,"RawShaderMaterial",function(){return Qh}),v.d(b,"Ray",function(){return Ho}),v.d(b,"Raycaster",function(){return OE}),v.d(b,"RectAreaLight",function(){return Nv}),v.d(b,"RedFormat",function(){return La}),v.d(b,"RedIntegerFormat",function(){return Ic}),v.d(b,"ReinhardToneMapping",function(){return I}),v.d(b,"RepeatWrapping",function(){return ht}),v.d(b,"ReplaceStencilOp",function(){return Ag}),v.d(b,"ReverseSubtractEquation",function(){return Ne}),v.d(b,"RingBufferGeometry",function(){return Yh}),v.d(b,"RingGeometry",function(){return Yh}),v.d(b,"SRGB8_ALPHA8_ASTC_10x10_Format",function(){return Zp}),v.d(b,"SRGB8_ALPHA8_ASTC_10x5_Format",function(){return jc}),v.d(b,"SRGB8_ALPHA8_ASTC_10x6_Format",function(){return $p}),v.d(b,"SRGB8_ALPHA8_ASTC_10x8_Format",function(){return Jp}),v.d(b,"SRGB8_ALPHA8_ASTC_12x10_Format",function(){return Kp}),v.d(b,"SRGB8_ALPHA8_ASTC_12x12_Format",function(){return qs}),v.d(b,"SRGB8_ALPHA8_ASTC_4x4_Format",function(){return Gc}),v.d(b,"SRGB8_ALPHA8_ASTC_5x4_Format",function(){return Ju}),v.d(b,"SRGB8_ALPHA8_ASTC_5x5_Format",function(){return Zu}),v.d(b,"SRGB8_ALPHA8_ASTC_6x5_Format",function(){return Hc}),v.d(b,"SRGB8_ALPHA8_ASTC_6x6_Format",function(){return cr}),v.d(b,"SRGB8_ALPHA8_ASTC_8x5_Format",function(){return Ku}),v.d(b,"SRGB8_ALPHA8_ASTC_8x6_Format",function(){return Da}),v.d(b,"SRGB8_ALPHA8_ASTC_8x8_Format",function(){return zc}),v.d(b,"Scene",function(){return el}),v.d(b,"SceneUtils",function(){return PM}),v.d(b,"ShaderChunk",function(){return Qt}),v.d(b,"ShaderLib",function(){return Pr}),v.d(b,"ShaderMaterial",function(){return or}),v.d(b,"ShadowMaterial",function(){return yv}),v.d(b,"Shape",function(){return ul}),v.d(b,"ShapeBufferGeometry",function(){return au}),v.d(b,"ShapeGeometry",function(){return au}),v.d(b,"ShapePath",function(){return Ry}),v.d(b,"ShapeUtils",function(){return Ts}),v.d(b,"ShortType",function(){return kp}),v.d(b,"Skeleton",function(){return Gh}),v.d(b,"SkeletonHelper",function(){return Jy}),v.d(b,"SkinnedMesh",function(){return il}),v.d(b,"SmoothShading",function(){return ft}),v.d(b,"Sphere",function(){return Mi}),v.d(b,"SphereBufferGeometry",function(){return lu}),v.d(b,"SphereGeometry",function(){return lu}),v.d(b,"Spherical",function(){return LE}),v.d(b,"SphericalHarmonics3",function(){return Dv}),v.d(b,"SplineCurve",function(){return Kf}),v.d(b,"SpotLight",function(){return Iv}),v.d(b,"SpotLightHelper",function(){return DE}),v.d(b,"Sprite",function(){return iu}),v.d(b,"SpriteMaterial",function(){return Ql}),v.d(b,"SrcAlphaFactor",function(){return Wt}),v.d(b,"SrcAlphaSaturateFactor",function(){return Mn}),v.d(b,"SrcColorFactor",function(){return ln}),v.d(b,"StaticCopyUsage",function(){return Lg}),v.d(b,"StaticDrawUsage",function(){return $s}),v.d(b,"StaticReadUsage",function(){return oh}),v.d(b,"StereoCamera",function(){return _E}),v.d(b,"StreamCopyUsage",function(){return ah}),v.d(b,"StreamDrawUsage",function(){return Js}),v.d(b,"StreamReadUsage",function(){return Og}),v.d(b,"StringKeyframeTrack",function(){return hu}),v.d(b,"SubtractEquation",function(){return Le}),v.d(b,"SubtractiveBlending",function(){return De}),v.d(b,"TOUCH",function(){return K}),v.d(b,"TangentSpaceNormalMap",function(){return Br}),v.d(b,"TetrahedronBufferGeometry",function(){return $h}),v.d(b,"TetrahedronGeometry",function(){return $h}),v.d(b,"TextBufferGeometry",function(){return nm}),v.d(b,"TextGeometry",function(){return nm}),v.d(b,"Texture",function(){return mi}),v.d(b,"TextureLoader",function(){return Rv}),v.d(b,"TorusBufferGeometry",function(){return Jh}),v.d(b,"TorusGeometry",function(){return Jh}),v.d(b,"TorusKnotBufferGeometry",function(){return Zh}),v.d(b,"TorusKnotGeometry",function(){return Zh}),v.d(b,"Triangle",function(){return qn}),v.d(b,"TriangleFanDrawMode",function(){return Mt}),v.d(b,"TriangleStripDrawMode",function(){return at}),v.d(b,"TrianglesDrawMode",function(){return rt}),v.d(b,"TubeBufferGeometry",function(){return Kh}),v.d(b,"TubeGeometry",function(){return Kh}),v.d(b,"UVMapping",function(){return Z}),v.d(b,"Uint16Attribute",function(){return gM}),v.d(b,"Uint16BufferAttribute",function(){return Va}),v.d(b,"Uint32Attribute",function(){return _M}),v.d(b,"Uint32BufferAttribute",function(){return eo}),v.d(b,"Uint8Attribute",function(){return pM}),v.d(b,"Uint8BufferAttribute",function(){return od}),v.d(b,"Uint8ClampedAttribute",function(){return fM}),v.d(b,"Uint8ClampedBufferAttribute",function(){return xh}),v.d(b,"Uniform",function(){return hm}),v.d(b,"UniformsLib",function(){return At}),v.d(b,"UniformsUtils",function(){return bo}),v.d(b,"UnsignedByteType",function(){return ss}),v.d(b,"UnsignedInt248Type",function(){return Nn}),v.d(b,"UnsignedIntType",function(){return js}),v.d(b,"UnsignedShort4444Type",function(){return Hp}),v.d(b,"UnsignedShort5551Type",function(){return zp}),v.d(b,"UnsignedShort565Type",function(){return jp}),v.d(b,"UnsignedShortType",function(){return Al}),v.d(b,"VSMShadowMap",function(){return C}),v.d(b,"Vector2",function(){return mt}),v.d(b,"Vector3",function(){return S}),v.d(b,"Vector4",function(){return Bn}),v.d(b,"VectorKeyframeTrack",function(){return kd}),v.d(b,"Vertex",function(){return hM}),v.d(b,"VertexColors",function(){return tM}),v.d(b,"VideoTexture",function(){return Ft}),v.d(b,"WebGL1Renderer",function(){return Ci}),v.d(b,"WebGLCubeRenderTarget",function(){return Yt}),v.d(b,"WebGLMultipleRenderTargets",function(){return Bl}),v.d(b,"WebGLMultisampleRenderTarget",function(){return Ks}),v.d(b,"WebGLRenderTarget",function(){return $r}),v.d(b,"WebGLRenderTargetCube",function(){return AM}),v.d(b,"WebGLRenderer",function(){return Un}),v.d(b,"WebGLUtils",function(){return Hf}),v.d(b,"WireframeGeometry",function(){return _v}),v.d(b,"WireframeHelper",function(){return TM}),v.d(b,"WrapAroundEnding",function(){return Pl}),v.d(b,"XHRLoader",function(){return EM}),v.d(b,"ZeroCurvatureEnding",function(){return ji}),v.d(b,"ZeroFactor",function(){return bt}),v.d(b,"ZeroSlopeEnding",function(){return ls}),v.d(b,"ZeroStencilOp",function(){return eh}),v.d(b,"sRGBEncoding",function(){return vn});var te={};v.r(te),v.d(te,"isMobile",function(){return Ko}),v.d(te,"EventEmitter",function(){return oc.a}),v.d(te,"earcut",function(){return o0.a}),v.d(te,"BaseTextureCache",function(){return Eo}),v.d(te,"CanvasRenderTarget",function(){return v0}),v.d(te,"DATA_URI",function(){return Yx}),v.d(te,"ProgramCache",function(){return g0}),v.d(te,"TextureCache",function(){return Xr}),v.d(te,"clearTextureCache",function(){return u2}),v.d(te,"correctBlendMode",function(){return d0}),v.d(te,"createIndicesForQuads",function(){return Wx}),v.d(te,"decomposeDataUri",function(){return h2}),v.d(te,"deprecation",function(){return fl}),v.d(te,"destroyTextureCache",function(){return l2}),v.d(te,"determineCrossOrigin",function(){return $x}),v.d(te,"getBufferType",function(){return Tm}),v.d(te,"getResolutionOfUrl",function(){return $d}),v.d(te,"hex2rgb",function(){return bu}),v.d(te,"hex2string",function(){return u0}),v.d(te,"interleaveTypedArrays",function(){return s2}),v.d(te,"isPow2",function(){return f0}),v.d(te,"isWebGLSupported",function(){return jx}),v.d(te,"log2",function(){return m0}),v.d(te,"nextPow2",function(){return Yd}),v.d(te,"premultiplyBlendMode",function(){return c0}),v.d(te,"premultiplyRgba",function(){return Vx}),v.d(te,"premultiplyTint",function(){return Sm}),v.d(te,"premultiplyTintToRgba",function(){return p0}),v.d(te,"removeItems",function(){return wu}),v.d(te,"rgb2hex",function(){return r2}),v.d(te,"sayHello",function(){return zx}),v.d(te,"sign",function(){return Su}),v.d(te,"skipHello",function(){return n2}),v.d(te,"string2hex",function(){return h0}),v.d(te,"trimCanvas",function(){return qx}),v.d(te,"uid",function(){return pl}),v.d(te,"url",function(){return xu});var fe=v(6),$=v(0),L=v.n($),Y=v(1);/**
1828
1828
  * @license
1829
1829
  * Copyright 2010-2021 Three.js Authors
1830
1830
  * SPDX-License-Identifier: MIT
1831
- */const j="130",F={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},K={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},xe=0,Re=1,Ie=2,M=3,N=0,D=1,ee=2,C=3,z=0,V=1,ne=2,qe=1,ft=2,Pe=0,ae=1,Me=2,De=3,W=4,ye=5,Ce=100,Le=101,Ne=102,$e=103,Qe=104,bt=200,vt=201,ln=202,wt=203,Wt=204,qt=205,rn=206,Bt=207,Dn=208,Fn=209,Mn=210,jn=0,An=1,In=2,di=3,Ln=4,Di=5,pi=6,uo=7,Co=0,Oa=1,ho=2,Sr=0,E=1,I=2,O=3,Q=4,J=5,Z=300,se=301,ge=302,be=303,we=304,Fe=306,Ye=307,ht=1e3,xt=1001,Ot=1002,Gt=1003,fi=1004,nr=1004,Po=1005,Hs=1005,Gn=1006,os=1007,Fp=1007,zs=1008,Bp=1008,ss=1009,Up=1010,kp=1011,Al=1012,Gp=1013,js=1014,Io=1015,Vs=1016,Hp=1017,zp=1018,jp=1019,Nn=1020,Hn=1021,Oo=1022,Tr=1023,Vp=1024,Pc=1025,Wp=Tr,ti=1026,Ws=1027,La=1028,Ic=1029,Gu=1030,Er=1031,Oc=1032,Lc=1033,Hu=33776,zu=33777,ju=33778,Vu=33779,ir=35840,Nc=35841,hr=35842,Dc=35843,Fc=36196,co=37492,Na=37496,Wu=37808,Vn=37809,Lo=37810,Xu=37811,Xp=37812,qu=37813,qp=37814,Bc=37815,Rl=37816,Xs=37817,Yp=37818,Uc=37819,kc=37820,Yu=37821,$u=36492,Gc=37840,Ju=37841,Zu=37842,Hc=37843,cr=37844,Ku=37845,Da=37846,zc=37847,jc=37848,$p=37849,Jp=37850,Zp=37851,Kp=37852,qs=37853,Qu=2200,Vc=2201,No=2202,as=2300,Cl=2301,Do=2302,zi=2400,ls=2401,Pl=2402,Ys=2500,Ue=2501,rt=0,at=1,Mt=2,Ht=3e3,vn=3001,ai=3007,Mr=3002,zn=3003,Il=3004,Wc=3005,dr=3006,Ol=3200,Xc=3201,Br=0,Ll=1,eh=0,Rn=7680,Ag=7681,Qp=7682,th=7683,Rg=34055,Cg=34056,Pg=5386,nh=512,us=513,ih=514,ef=515,rh=516,tf=517,nf=518,Nl=519,$s=35044,po=35048,Js=35040,oh=35045,Ig=35049,Og=35041,Lg=35046,sh=35050,ah=35042,qc="100",Yc="300 es";class Fo{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 r=n.indexOf(t);r!==-1&&n.splice(r,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 r=0,o=n.length;r<o;r++)n[r].call(this,e);e.target=null}}}const ji=[];for(let i=0;i<256;i++)ji[i]=(i<16?"0":"")+i.toString(16);let lh=1234567;const Wn=Math.PI/180,wi=180/Math.PI;function Ar(){const i=4294967295*Math.random()|0,e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(ji[255&i]+ji[i>>8&255]+ji[i>>16&255]+ji[i>>24&255]+"-"+ji[255&e]+ji[e>>8&255]+"-"+ji[e>>16&15|64]+ji[e>>24&255]+"-"+ji[63&t|128]+ji[t>>8&255]+"-"+ji[t>>16&255]+ji[t>>24&255]+ji[255&n]+ji[n>>8&255]+ji[n>>16&255]+ji[n>>24&255]).toUpperCase()}function Vi(i,e,t){return Math.max(e,Math.min(t,i))}function uh(i,e){return(i%e+e)%e}function Dl(i,e,t){return(1-t)*i+t*e}function Fl(i){return(i&i-1)==0&&i!==0}function Fa(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function hh(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}var Zs=Object.freeze({__proto__:null,DEG2RAD:Wn,RAD2DEG:wi,generateUUID:Ar,clamp:Vi,euclideanModulo:uh,mapLinear:function(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)},inverseLerp:function(i,e,t){return i!==e?(t-i)/(e-i):0},lerp:Dl,damp:function(i,e,t,n){return Dl(i,e,1-Math.exp(-t*n))},pingpong:function(i,e=1){return e-Math.abs(uh(i,2*e)-e)},smoothstep:function(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e))*i*(3-2*i)},smootherstep:function(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e))*i*i*(i*(6*i-15)+10)},randInt:function(i,e){return i+Math.floor(Math.random()*(e-i+1))},randFloat:function(i,e){return i+Math.random()*(e-i)},randFloatSpread:function(i){return i*(.5-Math.random())},seededRandom:function(i){return i!==void 0&&(lh=i%2147483647),lh=16807*lh%2147483647,(lh-1)/2147483646},degToRad:function(i){return i*Wn},radToDeg:function(i){return i*wi},isPowerOfTwo:Fl,ceilPowerOfTwo:Fa,floorPowerOfTwo:hh,setQuaternionFromProperEuler:function(i,e,t,n,r){const o=Math.cos,s=Math.sin,a=o(t/2),l=s(t/2),u=o((e+n)/2),h=s((e+n)/2),d=o((e-n)/2),p=s((e-n)/2),m=o((n-e)/2),g=s((n-e)/2);switch(r){case"XYX":i.set(a*h,l*d,l*p,a*u);break;case"YZY":i.set(l*p,a*h,l*d,a*u);break;case"ZXZ":i.set(l*d,l*p,a*h,a*u);break;case"XZX":i.set(a*h,l*g,l*m,a*u);break;case"YXY":i.set(l*m,a*h,l*g,a*u);break;case"ZYZ":i.set(l*g,l*m,a*h,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class mt{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,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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),r=Math.sin(t),o=this.x-e.x,s=this.y-e.y;return this.x=o*n-s*r+e.x,this.y=o*r+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}mt.prototype.isVector2=!0;class Xn{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,r,o,s,a,l,u){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=o,h[5]=l,h[6]=n,h[7]=s,h[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,r=t.elements,o=this.elements,s=n[0],a=n[3],l=n[6],u=n[1],h=n[4],d=n[7],p=n[2],m=n[5],g=n[8],_=r[0],y=r[3],w=r[6],P=r[1],B=r[4],G=r[7],U=r[2],X=r[5],H=r[8];return o[0]=s*_+a*P+l*U,o[3]=s*y+a*B+l*X,o[6]=s*w+a*G+l*H,o[1]=u*_+h*P+d*U,o[4]=u*y+h*B+d*X,o[7]=u*w+h*G+d*H,o[2]=p*_+m*P+g*U,o[5]=p*y+m*B+g*X,o[8]=p*w+m*G+g*H,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],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],h=e[8];return t*s*h-t*a*u-n*o*h+n*a*l+r*o*u-r*s*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=h*s-a*u,p=a*l-h*o,m=u*o-s*l,g=t*d+n*p+r*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]=(r*u-h*n)*_,e[2]=(a*n-r*s)*_,e[3]=p*_,e[4]=(h*t-r*l)*_,e[5]=(r*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,r,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,-r*u,r*l,-r*(-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),r=this.elements,o=r[0],s=r[3],a=r[6],l=r[1],u=r[4],h=r[7];return r[0]=t*o+n*l,r[3]=t*s+n*u,r[6]=t*a+n*h,r[1]=-n*o+t*l,r[4]=-n*s+t*u,r[7]=-n*a+t*h,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 r=0;r<9;r++)if(t[r]!==n[r])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 Bo;Xn.prototype.isMatrix3=!0;class Ur{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Bo===void 0&&(Bo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Bo.width=e.width,Bo.height=e.height;const n=Bo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Bo}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 Ng=0;class mi extends Fo{constructor(e=mi.DEFAULT_IMAGE,t=mi.DEFAULT_MAPPING,n=xt,r=xt,o=Gn,s=zs,a=Tr,l=ss,u=1,h=Ht){super(),Object.defineProperty(this,"id",{value:Ng++}),this.uuid=Ar(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=o,this.minFilter=s,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=l,this.offset=new mt(0,0),this.repeat=new mt(1,1),this.center=new mt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Xn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,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 r=this.image;if(r.uuid===void 0&&(r.uuid=Ar()),!t&&e.images[r.uuid]===void 0){let o;if(Array.isArray(r)){o=[];for(let s=0,a=r.length;s<a;s++)r[s].isDataTexture?o.push($c(r[s].image)):o.push($c(r[s]))}else o=$c(r);e.images[r.uuid]={uuid:r.uuid,url:o}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Z)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ht:e.x=e.x-Math.floor(e.x);break;case xt:e.x=e.x<0?0:1;break;case Ot: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 ht:e.y=e.y-Math.floor(e.y);break;case xt:e.y=e.y<0?0:1;break;case Ot: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 $c(i){return typeof HTMLImageElement!="undefined"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&i instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap?Ur.getDataURL(i):i.data?{data:Array.prototype.slice.call(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}mi.DEFAULT_IMAGE=void 0,mi.DEFAULT_MAPPING=Z,mi.prototype.isTexture=!0;class Bn{constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}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,r){return this.x=e,this.y=t,this.z=n,this.w=r,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,r=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r+s[12]*o,this.y=s[1]*t+s[5]*n+s[9]*r+s[13]*o,this.z=s[2]*t+s[6]*n+s[10]*r+s[14]*o,this.w=s[3]*t+s[7]*n+s[11]*r+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,r,o;const s=e.elements,a=s[0],l=s[4],u=s[8],h=s[1],d=s[5],p=s[9],m=s[2],g=s[6],_=s[10];if(Math.abs(l-h)<.01&&Math.abs(u-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(l+h)<.1&&Math.abs(u+m)<.1&&Math.abs(p+g)<.1&&Math.abs(a+d+_-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(a+1)/2,P=(d+1)/2,B=(_+1)/2,G=(l+h)/4,U=(u+m)/4,X=(p+g)/4;return w>P&&w>B?w<.01?(n=0,r=.707106781,o=.707106781):(n=Math.sqrt(w),r=G/n,o=U/n):P>B?P<.01?(n=.707106781,r=0,o=.707106781):(r=Math.sqrt(P),n=G/r,o=X/r):B<.01?(n=.707106781,r=.707106781,o=0):(o=Math.sqrt(B),n=U/o,r=X/o),this.set(n,r,o,t),this}let y=Math.sqrt((g-p)*(g-p)+(u-m)*(u-m)+(h-l)*(h-l));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(u-m)/y,this.z=(h-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}}Bn.prototype.isVector4=!0;class $r extends Fo{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new Bn(0,0,e,t),this.scissorTest=!1,this.viewport=new Bn(0,0,e,t),this.texture=new mi(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:Gn,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=U_({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}$r.prototype.isWebGLRenderTarget=!0;class Bl extends $r{constructor(e,t,n){super(e,t);const r=this.texture;this.texture=[];for(let o=0;o<n;o++)this.texture[o]=r.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 r=0,o=this.texture.length;r<o;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].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 Ks extends $r{constructor(e,t,n){super(e,t,n),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}Ks.prototype.isWebGLMultisampleRenderTarget=!0;class Fi{constructor(e=0,t=0,n=0,r=1){this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,r)}static slerpFlat(e,t,n,r,o,s,a){let l=n[r+0],u=n[r+1],h=n[r+2],d=n[r+3];const p=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]=h,void(e[t+3]=d);if(a===1)return e[t+0]=p,e[t+1]=m,e[t+2]=g,void(e[t+3]=_);if(d!==_||l!==p||u!==m||h!==g){let y=1-a;const w=l*p+u*m+h*g+d*_,P=w>=0?1:-1,B=1-w*w;if(B>Number.EPSILON){const U=Math.sqrt(B),X=Math.atan2(U,w*P);y=Math.sin(y*X)/U,a=Math.sin(a*X)/U}const G=a*P;if(l=l*y+p*G,u=u*y+m*G,h=h*y+g*G,d=d*y+_*G,y===1-a){const U=1/Math.sqrt(l*l+u*u+h*h+d*d);l*=U,u*=U,h*=U,d*=U}}e[t]=l,e[t+1]=u,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,r,o,s){const a=n[r],l=n[r+1],u=n[r+2],h=n[r+3],d=o[s],p=o[s+1],m=o[s+2],g=o[s+3];return e[t]=a*g+h*d+l*m-u*p,e[t+1]=l*g+h*p+u*d-a*m,e[t+2]=u*g+h*m+a*p-l*d,e[t+3]=h*g-a*d-l*p-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,r){return this._x=e,this._y=t,this._z=n,this._w=r,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,r=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,u=a(n/2),h=a(r/2),d=a(o/2),p=l(n/2),m=l(r/2),g=l(o/2);switch(s){case"XYZ":this._x=p*h*d+u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d-p*m*g;break;case"YXZ":this._x=p*h*d+u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d+p*m*g;break;case"ZXY":this._x=p*h*d-u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d-p*m*g;break;case"ZYX":this._x=p*h*d-u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d+p*m*g;break;case"YZX":this._x=p*h*d+u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d-p*m*g;break;case"XZY":this._x=p*h*d-u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d+p*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,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],o=t[8],s=t[1],a=t[5],l=t[9],u=t[2],h=t[6],d=t[10],p=n+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(o-u)*m,this._z=(s-r)*m}else if(n>a&&n>d){const m=2*Math.sqrt(1+n-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+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=(r+s)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-n-a);this._w=(s-r)/m,this._x=(o+u)/m,this._y=(l+h)/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(Vi(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),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,r=e._y,o=e._z,s=e._w,a=t._x,l=t._y,u=t._z,h=t._w;return this._x=n*h+s*a+r*u-o*l,this._y=r*h+s*l+o*a-n*u,this._z=o*h+s*u+n*l-r*a,this._w=s*h-n*a-r*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,r=this._y,o=this._z,s=this._w;let a=s*e._w+n*e._x+r*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=r,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*r+t*this._y,this._z=m*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),h=Math.atan2(u,a),d=Math.sin((1-t)*h)/u,p=Math.sin(t*h)/u;return this._w=s*d+this._w*p,this._x=n*d+this._x*p,this._y=r*d+this._y*p,this._z=o*d+this._z*p,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(){}}Fi.prototype.isQuaternion=!0;class S{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(Ul.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ul.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*r,this.y=o[1]*t+o[4]*n+o[7]*r,this.z=o[2]*t+o[5]*n+o[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,o=e.elements,s=1/(o[3]*t+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*r+o[12])*s,this.y=(o[1]*t+o[5]*n+o[9]*r+o[13])*s,this.z=(o[2]*t+o[6]*n+o[10]*r+o[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,o=e.x,s=e.y,a=e.z,l=e.w,u=l*t+s*r-a*n,h=l*n+a*t-o*r,d=l*r+o*n-s*t,p=-o*t-s*n-a*r;return this.x=u*l+p*-o+h*-a-d*-s,this.y=h*l+p*-s+d*-o-u*-a,this.z=d*l+p*-a+u*-s-h*-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,r=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r,this.y=o[1]*t+o[5]*n+o[9]*r,this.z=o[2]*t+o[6]*n+o[10]*r,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,r=e.y,o=e.z,s=t.x,a=t.y,l=t.z;return this.x=r*l-o*a,this.y=o*s-n*l,this.z=n*a-r*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 hs.copy(this).projectOnVector(e),this.sub(hs)}reflect(e){return this.sub(hs.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(Vi(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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 r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*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(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,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}}S.prototype.isVector3=!0;const hs=new S,Ul=new Fi;class Zn{constructor(e=new S(1/0,1/0,1/0),t=new S(-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,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=e.length;l<u;l+=3){const h=e[l],d=e[l+1],p=e[l+2];h<t&&(t=h),d<n&&(n=d),p<r&&(r=p),h>o&&(o=h),d>s&&(s=d),p>a&&(a=p)}return this.min.set(t,n,r),this.max.set(o,s,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=e.count;l<u;l++){const h=e.getX(l),d=e.getY(l),p=e.getZ(l);h<t&&(t=h),d<n&&(n=d),p<r&&(r=p),h>o&&(o=h),d>s&&(s=d),p>a&&(a=p)}return this.min.set(t,n,r),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=Jr.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(),Zr.copy(t.boundingBox),Zr.applyMatrix4(e.matrixWorld),this.union(Zr));const n=e.children;for(let r=0,o=n.length;r<o;r++)this.expandByObject(n[r]);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,Jr),Jr.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(kl),Ba.subVectors(this.max,kl),pr.subVectors(e.a,kl),kr.subVectors(e.b,kl),Ji.subVectors(e.c,kl),Uo.subVectors(kr,pr),ko.subVectors(Ji,kr),Qs.subVectors(pr,Ji);let t=[0,-Uo.z,Uo.y,0,-ko.z,ko.y,0,-Qs.z,Qs.y,Uo.z,0,-Uo.x,ko.z,0,-ko.x,Qs.z,0,-Qs.x,-Uo.y,Uo.x,0,-ko.y,ko.x,0,-Qs.y,Qs.x,0];return!!Jc(t,pr,kr,Ji,Ba)&&(t=[1,0,0,0,1,0,0,0,1],!!Jc(t,pr,kr,Ji,Ba)&&(cs.crossVectors(Uo,ko),t=[cs.x,cs.y,cs.z],Jc(t,pr,kr,Ji,Ba)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Jr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Jr).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()||(un[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),un[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),un[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),un[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),un[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),un[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),un[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),un[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(un)),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)}}Zn.prototype.isBox3=!0;const un=[new S,new S,new S,new S,new S,new S,new S,new S],Jr=new S,Zr=new Zn,pr=new S,kr=new S,Ji=new S,Uo=new S,ko=new S,Qs=new S,kl=new S,Ba=new S,cs=new S,fo=new S;function Jc(i,e,t,n,r){for(let o=0,s=i.length-3;o<=s;o+=3){fo.fromArray(i,o);const a=r.x*Math.abs(fo.x)+r.y*Math.abs(fo.y)+r.z*Math.abs(fo.z),l=e.dot(fo),u=t.dot(fo),h=n.dot(fo);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>a)return!1}return!0}const rf=new Zn,mo=new S,Gl=new S,Go=new S;class Mi{constructor(e=new S,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):rf.setFromPoints(e).getCenter(n);let r=0;for(let o=0,s=e.length;o<s;o++)r=Math.max(r,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(r),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){Go.subVectors(e,this.center);const t=Go.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=.5*(n-this.radius);this.center.add(Go.multiplyScalar(r/n)),this.radius+=r}return this}union(e){return Gl.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(mo.copy(e.center).add(Gl)),this.expandByPoint(mo.copy(e.center).sub(Gl)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const go=new S,ch=new S,ds=new S,rr=new S,dh=new S,ph=new S,Ua=new S;class Ho{constructor(e=new S,t=new S(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,go)),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=go.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(go.copy(this.direction).multiplyScalar(t).add(this.origin),go.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){ch.copy(e).add(t).multiplyScalar(.5),ds.copy(t).sub(e).normalize(),rr.copy(this.origin).sub(ch);const o=.5*e.distanceTo(t),s=-this.direction.dot(ds),a=rr.dot(this.direction),l=-rr.dot(ds),u=rr.lengthSq(),h=Math.abs(1-s*s);let d,p,m,g;if(h>0)if(d=s*l-a,p=s*a-l,g=o*h,d>=0)if(p>=-g)if(p<=g){const _=1/h;d*=_,p*=_,m=d*(d+s*p+2*a)+p*(s*d+p+2*l)+u}else p=o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;else p=-o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;else p<=-g?(d=Math.max(0,-(-s*o+a)),p=d>0?-o:Math.min(Math.max(-o,-l),o),m=-d*d+p*(p+2*l)+u):p<=g?(d=0,p=Math.min(Math.max(-o,-l),o),m=p*(p+2*l)+u):(d=Math.max(0,-(s*o+a)),p=d>0?o:Math.min(Math.max(-o,-l),o),m=-d*d+p*(p+2*l)+u);else p=s>0?-o:o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;return n&&n.copy(this.direction).multiplyScalar(d).add(this.origin),r&&r.copy(ds).multiplyScalar(p).add(ch),m}intersectSphere(e,t){go.subVectors(e.center,this.origin);const n=go.dot(this.direction),r=go.dot(go)-n*n,o=e.radius*e.radius;if(r>o)return null;const s=Math.sqrt(o-r),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,r,o,s,a,l;const u=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return u>=0?(n=(e.min.x-p.x)*u,r=(e.max.x-p.x)*u):(n=(e.max.x-p.x)*u,r=(e.min.x-p.x)*u),h>=0?(o=(e.min.y-p.y)*h,s=(e.max.y-p.y)*h):(o=(e.max.y-p.y)*h,s=(e.min.y-p.y)*h),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),d>=0?(a=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),n>l||a>r?null:((a>n||n!=n)&&(n=a),(l<r||r!=r)&&(r=l),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return this.intersectBox(e,go)!==null}intersectTriangle(e,t,n,r,o){dh.subVectors(t,e),ph.subVectors(n,e),Ua.crossVectors(dh,ph);let s,a=this.direction.dot(Ua);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}rr.subVectors(this.origin,e);const l=s*this.direction.dot(ph.crossVectors(rr,ph));if(l<0)return null;const u=s*this.direction.dot(dh.cross(rr));if(u<0||l+u>a)return null;const h=-s*rr.dot(Ua);return h<0?null:this.at(h/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 Rt{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,r,o,s,a,l,u,h,d,p,m,g,_,y){const w=this.elements;return w[0]=e,w[4]=t,w[8]=n,w[12]=r,w[1]=o,w[5]=s,w[9]=a,w[13]=l,w[2]=u,w[6]=h,w[10]=d,w[14]=p,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 Rt().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,r=1/ps.setFromMatrixColumn(e,0).length(),o=1/ps.setFromMatrixColumn(e,1).length(),s=1/ps.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,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,r=e.y,o=e.z,s=Math.cos(n),a=Math.sin(n),l=Math.cos(r),u=Math.sin(r),h=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const p=s*h,m=s*d,g=a*h,_=a*d;t[0]=l*h,t[4]=-l*d,t[8]=u,t[1]=m+g*u,t[5]=p-_*u,t[9]=-a*l,t[2]=_-p*u,t[6]=g+m*u,t[10]=s*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,g=u*h,_=u*d;t[0]=p+_*a,t[4]=g*a-m,t[8]=s*u,t[1]=s*d,t[5]=s*h,t[9]=-a,t[2]=m*a-g,t[6]=_+p*a,t[10]=s*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,g=u*h,_=u*d;t[0]=p-_*a,t[4]=-s*d,t[8]=g+m*a,t[1]=m+g*a,t[5]=s*h,t[9]=_-p*a,t[2]=-s*u,t[6]=a,t[10]=s*l}else if(e.order==="ZYX"){const p=s*h,m=s*d,g=a*h,_=a*d;t[0]=l*h,t[4]=g*u-m,t[8]=p*u+_,t[1]=l*d,t[5]=_*u+p,t[9]=m*u-g,t[2]=-u,t[6]=a*l,t[10]=s*l}else if(e.order==="YZX"){const p=s*l,m=s*u,g=a*l,_=a*u;t[0]=l*h,t[4]=_-p*d,t[8]=g*d+m,t[1]=d,t[5]=s*h,t[9]=-a*h,t[2]=-u*h,t[6]=m*d+g,t[10]=p-_*d}else if(e.order==="XZY"){const p=s*l,m=s*u,g=a*l,_=a*u;t[0]=l*h,t[4]=-d,t[8]=u*h,t[1]=p*d+_,t[5]=s*h,t[9]=m*d-g,t[2]=g*d-m,t[6]=a*h,t[10]=_*d+p}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(vo,e,Zc)}lookAt(e,t,n){const r=this.elements;return fr.subVectors(e,t),fr.lengthSq()===0&&(fr.z=1),fr.normalize(),Kr.crossVectors(n,fr),Kr.lengthSq()===0&&(Math.abs(n.z)===1?fr.x+=1e-4:fr.z+=1e-4,fr.normalize(),Kr.crossVectors(n,fr)),Kr.normalize(),_o.crossVectors(fr,Kr),r[0]=Kr.x,r[4]=_o.x,r[8]=fr.x,r[1]=Kr.y,r[5]=_o.y,r[9]=fr.y,r[2]=Kr.z,r[6]=_o.z,r[10]=fr.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,r=t.elements,o=this.elements,s=n[0],a=n[4],l=n[8],u=n[12],h=n[1],d=n[5],p=n[9],m=n[13],g=n[2],_=n[6],y=n[10],w=n[14],P=n[3],B=n[7],G=n[11],U=n[15],X=r[0],H=r[4],q=r[8],me=r[12],ue=r[1],oe=r[5],ce=r[9],le=r[13],_e=r[2],je=r[6],ke=r[10],Ee=r[14],Ae=r[3],Je=r[7],st=r[11],ct=r[15];return o[0]=s*X+a*ue+l*_e+u*Ae,o[4]=s*H+a*oe+l*je+u*Je,o[8]=s*q+a*ce+l*ke+u*st,o[12]=s*me+a*le+l*Ee+u*ct,o[1]=h*X+d*ue+p*_e+m*Ae,o[5]=h*H+d*oe+p*je+m*Je,o[9]=h*q+d*ce+p*ke+m*st,o[13]=h*me+d*le+p*Ee+m*ct,o[2]=g*X+_*ue+y*_e+w*Ae,o[6]=g*H+_*oe+y*je+w*Je,o[10]=g*q+_*ce+y*ke+w*st,o[14]=g*me+_*le+y*Ee+w*ct,o[3]=P*X+B*ue+G*_e+U*Ae,o[7]=P*H+B*oe+G*je+U*Je,o[11]=P*q+B*ce+G*ke+U*st,o[15]=P*me+B*le+G*Ee+U*ct,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],r=e[8],o=e[12],s=e[1],a=e[5],l=e[9],u=e[13],h=e[2],d=e[6],p=e[10],m=e[14];return e[3]*(+o*l*d-r*u*d-o*a*p+n*u*p+r*a*m-n*l*m)+e[7]*(+t*l*m-t*u*p+o*s*p-r*s*m+r*u*h-o*l*h)+e[11]*(+t*u*d-t*a*m-o*s*d+n*s*m+o*a*h-n*u*h)+e[15]*(-r*a*h-t*l*d+t*a*p+r*s*d-n*s*p+n*l*h)}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 r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=e[9],p=e[10],m=e[11],g=e[12],_=e[13],y=e[14],w=e[15],P=d*y*u-_*p*u+_*l*m-a*y*m-d*l*w+a*p*w,B=g*p*u-h*y*u-g*l*m+s*y*m+h*l*w-s*p*w,G=h*_*u-g*d*u+g*a*m-s*_*m-h*a*w+s*d*w,U=g*d*l-h*_*l-g*a*p+s*_*p+h*a*y-s*d*y,X=t*P+n*B+r*G+o*U;if(X===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const H=1/X;return e[0]=P*H,e[1]=(_*p*o-d*y*o-_*r*m+n*y*m+d*r*w-n*p*w)*H,e[2]=(a*y*o-_*l*o+_*r*u-n*y*u-a*r*w+n*l*w)*H,e[3]=(d*l*o-a*p*o-d*r*u+n*p*u+a*r*m-n*l*m)*H,e[4]=B*H,e[5]=(h*y*o-g*p*o+g*r*m-t*y*m-h*r*w+t*p*w)*H,e[6]=(g*l*o-s*y*o-g*r*u+t*y*u+s*r*w-t*l*w)*H,e[7]=(s*p*o-h*l*o+h*r*u-t*p*u-s*r*m+t*l*m)*H,e[8]=G*H,e[9]=(g*d*o-h*_*o-g*n*m+t*_*m+h*n*w-t*d*w)*H,e[10]=(s*_*o-g*a*o+g*n*u-t*_*u-s*n*w+t*a*w)*H,e[11]=(h*a*o-s*d*o-h*n*u+t*d*u+s*n*m-t*a*m)*H,e[12]=U*H,e[13]=(h*_*r-g*d*r+g*n*p-t*_*p-h*n*y+t*d*y)*H,e[14]=(g*a*r-s*_*r-g*n*l+t*_*l+s*n*y-t*a*y)*H,e[15]=(s*d*r-h*a*r+h*n*l-t*d*l-s*n*p+t*a*p)*H,this}scale(e){const t=this.elements,n=e.x,r=e.y,o=e.z;return t[0]*=n,t[4]*=r,t[8]*=o,t[1]*=n,t[5]*=r,t[9]*=o,t[2]*=n,t[6]*=r,t[10]*=o,t[3]*=n,t[7]*=r,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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}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),r=Math.sin(t),o=1-n,s=e.x,a=e.y,l=e.z,u=o*s,h=o*a;return this.set(u*s+n,u*a-r*l,u*l+r*a,0,u*a+r*l,h*a+n,h*l-r*s,0,u*l-r*a,h*l+r*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,r,o,s){return this.set(1,n,o,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,o=t._x,s=t._y,a=t._z,l=t._w,u=o+o,h=s+s,d=a+a,p=o*u,m=o*h,g=o*d,_=s*h,y=s*d,w=a*d,P=l*u,B=l*h,G=l*d,U=n.x,X=n.y,H=n.z;return r[0]=(1-(_+w))*U,r[1]=(m+G)*U,r[2]=(g-B)*U,r[3]=0,r[4]=(m-G)*X,r[5]=(1-(p+w))*X,r[6]=(y+P)*X,r[7]=0,r[8]=(g+B)*H,r[9]=(y-P)*H,r[10]=(1-(p+_))*H,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let o=ps.set(r[0],r[1],r[2]).length();const s=ps.set(r[4],r[5],r[6]).length(),a=ps.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),e.x=r[12],e.y=r[13],e.z=r[14],Gr.copy(this);const l=1/o,u=1/s,h=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]*=h,Gr.elements[9]*=h,Gr.elements[10]*=h,t.setFromRotationMatrix(Gr),n.x=o,n.y=s,n.z=a,this}makePerspective(e,t,n,r,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-r),h=(t+e)/(t-e),d=(n+r)/(n-r),p=-(s+o)/(s-o),m=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=u,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,o,s){const a=this.elements,l=1/(t-e),u=1/(n-r),h=1/(s-o),d=(t+e)*l,p=(n+r)*u,m=(s+o)*h;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]=-p,a[2]=0,a[6]=0,a[10]=-2*h,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 r=0;r<16;r++)if(t[r]!==n[r])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}}Rt.prototype.isMatrix4=!0;const ps=new S,Gr=new Rt,vo=new S(0,0,0),Zc=new S(1,1,1),Kr=new S,_o=new S,fr=new S,Zi=new Rt,fh=new Fi;class ea{constructor(e=0,t=0,n=0,r=ea.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=r}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,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,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 r=e.elements,o=r[0],s=r[4],a=r[8],l=r[1],u=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(Vi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Vi(h,-1,1)),Math.abs(h)<.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(Vi(p,-1,1)),Math.abs(p)<.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(-Vi(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Vi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-Vi(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,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 Zi.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Zi,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return fh.setFromEuler(this),this.setFromQuaternion(fh,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 S(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}ea.prototype.isEuler=!0,ea.DefaultOrder="XYZ",ea.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Kc{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 Qc=0;const ka=new S,ta=new Fi,Rr=new Rt,Ga=new S,Ha=new S,of=new S,ed=new Fi,sf=new S(1,0,0),mh=new S(0,1,0),td=new S(0,0,1),af={type:"added"},nd={type:"removed"};class pn extends Fo{constructor(){super(),Object.defineProperty(this,"id",{value:Qc++}),this.uuid=Ar(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=pn.DefaultUp.clone();const e=new S,t=new ea,n=new Fi,r=new S(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:r},modelViewMatrix:{value:new Rt},normalMatrix:{value:new Xn}}),this.matrix=new Rt,this.matrixWorld=new Rt,this.matrixAutoUpdate=pn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Kc,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 ta.setFromAxisAngle(e,t),this.quaternion.multiply(ta),this}rotateOnWorldAxis(e,t){return ta.setFromAxisAngle(e,t),this.quaternion.premultiply(ta),this}rotateX(e){return this.rotateOnAxis(sf,e)}rotateY(e){return this.rotateOnAxis(mh,e)}rotateZ(e){return this.rotateOnAxis(td,e)}translateOnAxis(e,t){return ka.copy(e).applyQuaternion(this.quaternion),this.position.add(ka.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(sf,e)}translateY(e){return this.translateOnAxis(mh,e)}translateZ(e){return this.translateOnAxis(td,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Rr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ga.copy(e):Ga.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Ha.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rr.lookAt(Ha,Ga,this.up):Rr.lookAt(Ga,Ha,this.up),this.quaternion.setFromRotationMatrix(Rr),r&&(Rr.extractRotation(r.matrixWorld),ta.setFromRotationMatrix(Rr),this.quaternion.premultiply(ta.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(af)):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(nd)),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(nd)}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,r=this.children.length;n<r;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(Ha,e,of),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ha,ed,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,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;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,r=t.length;n<r;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 r=this.children;for(let o=0,s=r.length;o<s;o++)r[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 r={};function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.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,h=l.length;u<h;u++){const d=l[u];o(e.shapes,d)}else o(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),r.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]));r.material=a}else r.material=o(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(o(e.animations,l))}}if(t){const a=s(e.geometries),l=s(e.materials),u=s(e.textures),h=s(e.images),d=s(e.shapes),p=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),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),p.length>0&&(n.skeletons=p),m.length>0&&(n.animations=m)}return n.object=r,n;function s(a){const l=[];for(const u in a){const h=a[u];delete h.metadata,l.push(h)}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 r=e.children[n];this.add(r.clone())}return this}}pn.DefaultUp=new S(0,1,0),pn.DefaultMatrixAutoUpdate=!0,pn.prototype.isObject3D=!0;const Hr=new S,yo=new S,gh=new S,Qr=new S,na=new S,fs=new S,vh=new S,fn=new S,id=new S,rd=new S;class qn{constructor(e=new S,t=new S,n=new S){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Hr.subVectors(e,t),r.cross(Hr);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(e,t,n,r,o){Hr.subVectors(r,t),yo.subVectors(n,t),gh.subVectors(e,t);const s=Hr.dot(Hr),a=Hr.dot(yo),l=Hr.dot(gh),u=yo.dot(yo),h=yo.dot(gh),d=s*u-a*a;if(d===0)return o.set(-2,-1,-1);const p=1/d,m=(u*l-a*h)*p,g=(s*h-a*l)*p;return o.set(1-m-g,g,m)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Qr),Qr.x>=0&&Qr.y>=0&&Qr.x+Qr.y<=1}static getUV(e,t,n,r,o,s,a,l){return this.getBarycoord(e,t,n,r,Qr),l.set(0,0),l.addScaledVector(o,Qr.x),l.addScaledVector(s,Qr.y),l.addScaledVector(a,Qr.z),l}static isFrontFacing(e,t,n,r){return Hr.subVectors(n,t),yo.subVectors(e,t),Hr.cross(yo).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),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 Hr.subVectors(this.c,this.b),yo.subVectors(this.a,this.b),.5*Hr.cross(yo).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,o){return qn.getUV(e,this.a,this.b,this.c,t,n,r,o)}containsPoint(e){return qn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,o=this.c;let s,a;na.subVectors(r,n),fs.subVectors(o,n),fn.subVectors(e,n);const l=na.dot(fn),u=fs.dot(fn);if(l<=0&&u<=0)return t.copy(n);id.subVectors(e,r);const h=na.dot(id),d=fs.dot(id);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*u;if(p<=0&&l>=0&&h<=0)return s=l/(l-h),t.copy(n).addScaledVector(na,s);rd.subVectors(e,o);const m=na.dot(rd),g=fs.dot(rd);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(fs,a);const y=h*g-m*d;if(y<=0&&d-h>=0&&m-g>=0)return vh.subVectors(o,r),a=(d-h)/(d-h+(m-g)),t.copy(r).addScaledVector(vh,a);const w=1/(y+_+p);return s=_*w,a=p*w,t.copy(n).addScaledVector(na,s).addScaledVector(fs,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let lf=0;class Bi extends Fo{constructor(){super(),Object.defineProperty(this,"id",{value:lf++}),this.uuid=Ar(),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=Wt,this.blendDst=qt,this.blendEquation=Ce,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=di,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Nl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Rn,this.stencilZFail=Rn,this.stencilZPass=Rn,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===qe;continue}const r=this[t];r!==void 0?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.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 r(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=r(e.textures),s=r(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 r=t.length;n=new Array(r);for(let o=0;o!==r;++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++}}Bi.prototype.isMaterial=!0;const uf={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},li={h:0,s:0,l:0},_h={h:0,s:0,l:0};function za(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+6*(e-i)*t:t<.5?e:t<2/3?i+6*(e-i)*(2/3-t):i}function Hl(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function yh(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}class Dt{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=uh(e,1),t=Vi(t,0,1),n=Vi(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,o=2*n-r;this.r=za(o,r,e+1/3),this.g=za(o,r,e),this.b=za(o,r,e-1/3)}return this}setStyle(e){function t(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let r;const o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const a=parseFloat(r[1])/360,l=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(a,l,u)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],o=r.length;if(o===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(o===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=uf[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=Hl(e.r),this.g=Hl(e.g),this.b=Hl(e.b),this}copyLinearToSRGB(e){return this.r=yh(e.r),this.g=yh(e.g),this.b=yh(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,r=this.b,o=Math.max(t,n,r),s=Math.min(t,n,r);let a,l;const u=(s+o)/2;if(s===o)a=0,l=0;else{const h=o-s;switch(l=u<=.5?h/(o+s):h/(2-o-s),o){case t:a=(n-r)/h+(n<r?6:0);break;case n:a=(r-t)/h+2;break;case r:a=(t-n)/h+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(li),li.h+=e,li.s+=t,li.l+=n,this.setHSL(li.h,li.s,li.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(li),e.getHSL(_h);const n=Dl(li.h,_h.h,t),r=Dl(li.s,_h.s,t),o=Dl(li.l,_h.l,t);return this.setHSL(n,r,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()}}Dt.NAMES=uf,Dt.prototype.isColor=!0,Dt.prototype.r=1,Dt.prototype.g=1,Dt.prototype.b=1;class gi extends Bi{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new Dt(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=Co,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}}gi.prototype.isMeshBasicMaterial=!0;const Tn=new S,ja=new mt;class gn{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=$s,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 r=0,o=this.itemSize;r<o;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let r=0,o=e.length;r<o;r++){let s=e[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),s=new Dt),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 r=0,o=e.length;r<o;r++){let s=e[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),s=new mt),t[n++]=s.x,t[n++]=s.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let r=0,o=e.length;r<o;r++){let s=e[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),s=new S),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 r=0,o=e.length;r<o;r++){let s=e[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),s=new Bn),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++)ja.fromBufferAttribute(this,t),ja.applyMatrix3(e),this.setXY(t,ja.x,ja.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Tn.fromBufferAttribute(this,t),Tn.applyMatrix3(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.applyMatrix4(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.applyNormalMatrix(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.transformDirection(e),this.setXYZ(t,Tn.x,Tn.y,Tn.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,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,o){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,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!==$s&&(e.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(e.updateRange=this.updateRange),e}}gn.prototype.isBufferAttribute=!0;class zl extends gn{constructor(e,t,n){super(new Int8Array(e),t,n)}}class od extends gn{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class xh extends gn{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class sd extends gn{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Va extends gn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class bh extends gn{constructor(e,t,n){super(new Int32Array(e),t,n)}}class eo extends gn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class hf extends gn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}hf.prototype.isFloat16BufferAttribute=!0;class Tt extends gn{constructor(e,t,n){super(new Float32Array(e),t,n)}}class ad extends gn{constructor(e,t,n){super(new Float64Array(e),t,n)}}function ld(i){if(i.length===0)return-1/0;let e=i[0];for(let t=1,n=i.length;t<n;++t)i[t]>e&&(e=i[t]);return e}const ud={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ia(i,e){return new ud[i](e)}let cf=0;const Cr=new Rt,wh=new pn,Ai=new S,ui=new Zn,ms=new Zn,ni=new S;class Xt extends Fo{constructor(){super(),Object.defineProperty(this,"id",{value:cf++}),this.uuid=Ar(),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(ld(e)>65535?eo:Va)(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 Xn().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Cr.makeRotationFromQuaternion(e),this.applyMatrix4(Cr),this}rotateX(e){return Cr.makeRotationX(e),this.applyMatrix4(Cr),this}rotateY(e){return Cr.makeRotationY(e),this.applyMatrix4(Cr),this}rotateZ(e){return Cr.makeRotationZ(e),this.applyMatrix4(Cr),this}translate(e,t,n){return Cr.makeTranslation(e,t,n),this.applyMatrix4(Cr),this}scale(e,t,n){return Cr.makeScale(e,t,n),this.applyMatrix4(Cr),this}lookAt(e){return wh.lookAt(e),wh.updateMatrix(),this.applyMatrix4(wh.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ai).negate(),this.translate(Ai.x,Ai.y,Ai.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];t.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new Tt(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Zn);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 S(-1/0,-1/0,-1/0),new S(1/0,1/0,1/0));if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const o=t[n];ui.setFromBufferAttribute(o),this.morphTargetsRelative?(ni.addVectors(this.boundingBox.min,ui.min),this.boundingBox.expandByPoint(ni),ni.addVectors(this.boundingBox.max,ui.max),this.boundingBox.expandByPoint(ni)):(this.boundingBox.expandByPoint(ui.min),this.boundingBox.expandByPoint(ui.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 Mi);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 S,1/0);if(e){const n=this.boundingSphere.center;if(ui.setFromBufferAttribute(e),t)for(let o=0,s=t.length;o<s;o++){const a=t[o];ms.setFromBufferAttribute(a),this.morphTargetsRelative?(ni.addVectors(ui.min,ms.min),ui.expandByPoint(ni),ni.addVectors(ui.max,ms.max),ui.expandByPoint(ni)):(ui.expandByPoint(ms.min),ui.expandByPoint(ms.max))}ui.getCenter(n);let r=0;for(let o=0,s=e.count;o<s;o++)ni.fromBufferAttribute(e,o),r=Math.max(r,n.distanceToSquared(ni));if(t)for(let o=0,s=t.length;o<s;o++){const a=t[o],l=this.morphTargetsRelative;for(let u=0,h=a.count;u<h;u++)ni.fromBufferAttribute(a,u),l&&(Ai.fromBufferAttribute(e,u),ni.add(Ai)),r=Math.max(r,n.distanceToSquared(ni))}this.boundingSphere.radius=Math.sqrt(r),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,r=t.position.array,o=t.normal.array,s=t.uv.array,a=r.length/3;t.tangent===void 0&&this.setAttribute("tangent",new gn(new Float32Array(4*a),4));const l=t.tangent.array,u=[],h=[];for(let ue=0;ue<a;ue++)u[ue]=new S,h[ue]=new S;const d=new S,p=new S,m=new S,g=new mt,_=new mt,y=new mt,w=new S,P=new S;function B(ue,oe,ce){d.fromArray(r,3*ue),p.fromArray(r,3*oe),m.fromArray(r,3*ce),g.fromArray(s,2*ue),_.fromArray(s,2*oe),y.fromArray(s,2*ce),p.sub(d),m.sub(d),_.sub(g),y.sub(g);const le=1/(_.x*y.y-y.x*_.y);isFinite(le)&&(w.copy(p).multiplyScalar(y.y).addScaledVector(m,-_.y).multiplyScalar(le),P.copy(m).multiplyScalar(_.x).addScaledVector(p,-y.x).multiplyScalar(le),u[ue].add(w),u[oe].add(w),u[ce].add(w),h[ue].add(P),h[oe].add(P),h[ce].add(P))}let G=this.groups;G.length===0&&(G=[{start:0,count:n.length}]);for(let ue=0,oe=G.length;ue<oe;++ue){const ce=G[ue],le=ce.start;for(let _e=le,je=le+ce.count;_e<je;_e+=3)B(n[_e+0],n[_e+1],n[_e+2])}const U=new S,X=new S,H=new S,q=new S;function me(ue){H.fromArray(o,3*ue),q.copy(H);const oe=u[ue];U.copy(oe),U.sub(H.multiplyScalar(H.dot(oe))).normalize(),X.crossVectors(q,oe);const ce=X.dot(h[ue])<0?-1:1;l[4*ue]=U.x,l[4*ue+1]=U.y,l[4*ue+2]=U.z,l[4*ue+3]=ce}for(let ue=0,oe=G.length;ue<oe;++ue){const ce=G[ue],le=ce.start;for(let _e=le,je=le+ce.count;_e<je;_e+=3)me(n[_e+0]),me(n[_e+1]),me(n[_e+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 gn(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let p=0,m=n.count;p<m;p++)n.setXYZ(p,0,0,0);const r=new S,o=new S,s=new S,a=new S,l=new S,u=new S,h=new S,d=new S;if(e)for(let p=0,m=e.count;p<m;p+=3){const g=e.getX(p+0),_=e.getX(p+1),y=e.getX(p+2);r.fromBufferAttribute(t,g),o.fromBufferAttribute(t,_),s.fromBufferAttribute(t,y),h.subVectors(s,o),d.subVectors(r,o),h.cross(d),a.fromBufferAttribute(n,g),l.fromBufferAttribute(n,_),u.fromBufferAttribute(n,y),a.add(h),l.add(h),u.add(h),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 p=0,m=t.count;p<m;p+=3)r.fromBufferAttribute(t,p+0),o.fromBufferAttribute(t,p+1),s.fromBufferAttribute(t,p+2),h.subVectors(s,o),d.subVectors(r,o),h.cross(d),n.setXYZ(p+0,h.x,h.y,h.z),n.setXYZ(p+1,h.x,h.y,h.z),n.setXYZ(p+2,h.x,h.y,h.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 r in n){if(e.attributes[r]===void 0)continue;const o=n[r].array,s=e.attributes[r],a=s.array,l=s.itemSize*t,u=Math.min(a.length,o.length-l);for(let h=0,d=l;h<u;h++,d++)o[d]=a[h]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)ni.fromBufferAttribute(e,t),ni.normalize(),e.setXYZ(t,ni.x,ni.y,ni.z)}toNonIndexed(){function e(a,l){const u=a.array,h=a.itemSize,d=a.normalized,p=new u.constructor(l.length*h);let m=0,g=0;for(let _=0,y=l.length;_<y;_++){m=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*h;for(let w=0;w<h;w++)p[g++]=u[m++]}return new gn(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Xt,n=this.index.array,r=this.attributes;for(const a in r){const l=e(r[a],n);t.setAttribute(a,l)}const o=this.morphAttributes;for(const a in o){const l=[],u=o[a];for(let h=0,d=u.length;h<d;h++){const p=e(u[h],n);l.push(p)}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 r={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],h=[];for(let d=0,p=u.length;d<p;d++){const m=u[d];h.push(m.toJSON(e.data))}h.length>0&&(r[l]=h,o=!0)}o&&(e.data.morphAttributes=r,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 Xt().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 r=e.attributes;for(const u in r){const h=r[u];this.setAttribute(u,h.clone(t))}const o=e.morphAttributes;for(const u in o){const h=[],d=o[u];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(t));this.morphAttributes[u]=h}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let u=0,h=s.length;u<h;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"})}}Xt.prototype.isBufferGeometry=!0;const hd=new Rt,ra=new Ho,gs=new Mi,zr=new S,zo=new S,jo=new S,Wa=new S,Sh=new S,Xa=new S,qa=new S,oa=new S,jl=new S,sa=new mt,Vl=new mt,Ya=new mt,cd=new S,Wl=new S;class En extends pn{constructor(e=new Xt,t=new gi){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 r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[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,r=this.material,o=this.matrixWorld;if(r===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),gs.copy(n.boundingSphere),gs.applyMatrix4(o),e.ray.intersectsSphere(gs)===!1)||(hd.copy(o).invert(),ra.copy(e.ray).applyMatrix4(hd),n.boundingBox!==null&&ra.intersectsBox(n.boundingBox)===!1))return;let s;if(n.isBufferGeometry){const a=n.index,l=n.attributes.position,u=n.morphAttributes.position,h=n.morphTargetsRelative,d=n.attributes.uv,p=n.attributes.uv2,m=n.groups,g=n.drawRange;if(a!==null)if(Array.isArray(r))for(let _=0,y=m.length;_<y;_++){const w=m[_],P=r[w.materialIndex];for(let B=Math.max(w.start,g.start),G=Math.min(w.start+w.count,g.start+g.count);B<G;B+=3){const U=a.getX(B),X=a.getX(B+1),H=a.getX(B+2);s=Xl(this,P,e,ra,l,u,h,d,p,U,X,H),s&&(s.faceIndex=Math.floor(B/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(_),P=a.getX(_+1),B=a.getX(_+2);s=Xl(this,r,e,ra,l,u,h,d,p,w,P,B),s&&(s.faceIndex=Math.floor(_/3),t.push(s))}else if(l!==void 0)if(Array.isArray(r))for(let _=0,y=m.length;_<y;_++){const w=m[_],P=r[w.materialIndex];for(let B=Math.max(w.start,g.start),G=Math.min(w.start+w.count,g.start+g.count);B<G;B+=3)s=Xl(this,P,e,ra,l,u,h,d,p,B,B+1,B+2),s&&(s.faceIndex=Math.floor(B/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=Xl(this,r,e,ra,l,u,h,d,p,_,_+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 Xl(i,e,t,n,r,o,s,a,l,u,h,d){zr.fromBufferAttribute(r,u),zo.fromBufferAttribute(r,h),jo.fromBufferAttribute(r,d);const p=i.morphTargetInfluences;if(e.morphTargets&&o&&p){qa.set(0,0,0),oa.set(0,0,0),jl.set(0,0,0);for(let g=0,_=o.length;g<_;g++){const y=p[g],w=o[g];y!==0&&(Wa.fromBufferAttribute(w,u),Sh.fromBufferAttribute(w,h),Xa.fromBufferAttribute(w,d),s?(qa.addScaledVector(Wa,y),oa.addScaledVector(Sh,y),jl.addScaledVector(Xa,y)):(qa.addScaledVector(Wa.sub(zr),y),oa.addScaledVector(Sh.sub(zo),y),jl.addScaledVector(Xa.sub(jo),y)))}zr.add(qa),zo.add(oa),jo.add(jl)}i.isSkinnedMesh&&(i.boneTransform(u,zr),i.boneTransform(h,zo),i.boneTransform(d,jo));const m=function(g,_,y,w,P,B,G,U){let X;if(X=_.side===V?w.intersectTriangle(G,B,P,!0,U):w.intersectTriangle(P,B,G,_.side!==ne,U),X===null)return null;Wl.copy(U),Wl.applyMatrix4(g.matrixWorld);const H=y.ray.origin.distanceTo(Wl);return H<y.near||H>y.far?null:{distance:H,point:Wl.clone(),object:g}}(i,e,t,n,zr,zo,jo,cd);if(m){a&&(sa.fromBufferAttribute(a,u),Vl.fromBufferAttribute(a,h),Ya.fromBufferAttribute(a,d),m.uv=qn.getUV(cd,zr,zo,jo,sa,Vl,Ya,new mt)),l&&(sa.fromBufferAttribute(l,u),Vl.fromBufferAttribute(l,h),Ya.fromBufferAttribute(l,d),m.uv2=qn.getUV(cd,zr,zo,jo,sa,Vl,Ya,new mt));const g={a:u,b:h,c:d,normal:new S,materialIndex:0};qn.getNormal(zr,zo,jo,g.normal),m.face=g}return m}En.prototype.isMesh=!0;class xo extends Xt{constructor(e=1,t=1,n=1,r=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:o,depthSegments:s};const a=this;r=Math.floor(r),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],h=[],d=[];let p=0,m=0;function g(_,y,w,P,B,G,U,X,H,q,me){const ue=G/H,oe=U/q,ce=G/2,le=U/2,_e=X/2,je=H+1,ke=q+1;let Ee=0,Ae=0;const Je=new S;for(let st=0;st<ke;st++){const ct=st*oe-le;for(let he=0;he<je;he++){const de=he*ue-ce;Je[_]=de*P,Je[y]=ct*B,Je[w]=_e,u.push(Je.x,Je.y,Je.z),Je[_]=0,Je[y]=0,Je[w]=X>0?1:-1,h.push(Je.x,Je.y,Je.z),d.push(he/H),d.push(1-st/q),Ee+=1}}for(let st=0;st<q;st++)for(let ct=0;ct<H;ct++){const he=p+ct+je*st,de=p+ct+je*(st+1),Ke=p+(ct+1)+je*(st+1),Ve=p+(ct+1)+je*st;l.push(he,de,Ve),l.push(de,Ke,Ve),Ae+=6}a.addGroup(m,Ae,me),m+=Ae,p+=Ee}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,r,s,2),g("x","z","y",1,-1,e,n,-t,r,s,3),g("x","y","z",1,-1,e,t,n,r,o,4),g("x","y","z",-1,-1,e,t,-n,r,o,5),this.setIndex(l),this.setAttribute("position",new Tt(u,3)),this.setAttribute("normal",new Tt(h,3)),this.setAttribute("uv",new Tt(d,2))}static fromJSON(e){return new xo(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function $a(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function Wi(i){const e={};for(let t=0;t<i.length;t++){const n=$a(i[t]);for(const r in n)e[r]=n[r]}return e}const bo={clone:$a,merge:Wi};class or extends Bi{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
1831
+ */const j="130",F={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},K={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},xe=0,Re=1,Ie=2,M=3,N=0,D=1,ee=2,C=3,z=0,V=1,ne=2,qe=1,ft=2,Pe=0,ae=1,Me=2,De=3,W=4,ye=5,Ce=100,Le=101,Ne=102,$e=103,Qe=104,bt=200,vt=201,ln=202,wt=203,Wt=204,qt=205,rn=206,Bt=207,Dn=208,Fn=209,Mn=210,jn=0,An=1,In=2,di=3,Ln=4,Fi=5,pi=6,uo=7,Co=0,Oa=1,ho=2,Sr=0,E=1,I=2,O=3,Q=4,J=5,Z=300,se=301,ge=302,be=303,we=304,Fe=306,Ye=307,ht=1e3,xt=1001,Ot=1002,Gt=1003,fi=1004,nr=1004,Po=1005,Hs=1005,Gn=1006,os=1007,Fp=1007,zs=1008,Bp=1008,ss=1009,Up=1010,kp=1011,Al=1012,Gp=1013,js=1014,Io=1015,Vs=1016,Hp=1017,zp=1018,jp=1019,Nn=1020,Hn=1021,Oo=1022,Tr=1023,Vp=1024,Pc=1025,Wp=Tr,ti=1026,Ws=1027,La=1028,Ic=1029,Gu=1030,Er=1031,Oc=1032,Lc=1033,Hu=33776,zu=33777,ju=33778,Vu=33779,ir=35840,Nc=35841,hr=35842,Dc=35843,Fc=36196,co=37492,Na=37496,Wu=37808,Vn=37809,Lo=37810,Xu=37811,Xp=37812,qu=37813,qp=37814,Bc=37815,Rl=37816,Xs=37817,Yp=37818,Uc=37819,kc=37820,Yu=37821,$u=36492,Gc=37840,Ju=37841,Zu=37842,Hc=37843,cr=37844,Ku=37845,Da=37846,zc=37847,jc=37848,$p=37849,Jp=37850,Zp=37851,Kp=37852,qs=37853,Qu=2200,Vc=2201,No=2202,as=2300,Cl=2301,Do=2302,ji=2400,ls=2401,Pl=2402,Ys=2500,Ue=2501,rt=0,at=1,Mt=2,Ht=3e3,vn=3001,ai=3007,Mr=3002,zn=3003,Il=3004,Wc=3005,dr=3006,Ol=3200,Xc=3201,Br=0,Ll=1,eh=0,Rn=7680,Ag=7681,Qp=7682,th=7683,Rg=34055,Cg=34056,Pg=5386,nh=512,us=513,ih=514,ef=515,rh=516,tf=517,nf=518,Nl=519,$s=35044,po=35048,Js=35040,oh=35045,Ig=35049,Og=35041,Lg=35046,sh=35050,ah=35042,qc="100",Yc="300 es";class Fo{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 r=n.indexOf(t);r!==-1&&n.splice(r,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 r=0,o=n.length;r<o;r++)n[r].call(this,e);e.target=null}}}const Vi=[];for(let i=0;i<256;i++)Vi[i]=(i<16?"0":"")+i.toString(16);let lh=1234567;const Wn=Math.PI/180,wi=180/Math.PI;function Ar(){const i=4294967295*Math.random()|0,e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Vi[255&i]+Vi[i>>8&255]+Vi[i>>16&255]+Vi[i>>24&255]+"-"+Vi[255&e]+Vi[e>>8&255]+"-"+Vi[e>>16&15|64]+Vi[e>>24&255]+"-"+Vi[63&t|128]+Vi[t>>8&255]+"-"+Vi[t>>16&255]+Vi[t>>24&255]+Vi[255&n]+Vi[n>>8&255]+Vi[n>>16&255]+Vi[n>>24&255]).toUpperCase()}function Wi(i,e,t){return Math.max(e,Math.min(t,i))}function uh(i,e){return(i%e+e)%e}function Dl(i,e,t){return(1-t)*i+t*e}function Fl(i){return(i&i-1)==0&&i!==0}function Fa(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function hh(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}var Zs=Object.freeze({__proto__:null,DEG2RAD:Wn,RAD2DEG:wi,generateUUID:Ar,clamp:Wi,euclideanModulo:uh,mapLinear:function(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)},inverseLerp:function(i,e,t){return i!==e?(t-i)/(e-i):0},lerp:Dl,damp:function(i,e,t,n){return Dl(i,e,1-Math.exp(-t*n))},pingpong:function(i,e=1){return e-Math.abs(uh(i,2*e)-e)},smoothstep:function(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e))*i*(3-2*i)},smootherstep:function(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e))*i*i*(i*(6*i-15)+10)},randInt:function(i,e){return i+Math.floor(Math.random()*(e-i+1))},randFloat:function(i,e){return i+Math.random()*(e-i)},randFloatSpread:function(i){return i*(.5-Math.random())},seededRandom:function(i){return i!==void 0&&(lh=i%2147483647),lh=16807*lh%2147483647,(lh-1)/2147483646},degToRad:function(i){return i*Wn},radToDeg:function(i){return i*wi},isPowerOfTwo:Fl,ceilPowerOfTwo:Fa,floorPowerOfTwo:hh,setQuaternionFromProperEuler:function(i,e,t,n,r){const o=Math.cos,s=Math.sin,a=o(t/2),l=s(t/2),u=o((e+n)/2),h=s((e+n)/2),d=o((e-n)/2),p=s((e-n)/2),m=o((n-e)/2),g=s((n-e)/2);switch(r){case"XYX":i.set(a*h,l*d,l*p,a*u);break;case"YZY":i.set(l*p,a*h,l*d,a*u);break;case"ZXZ":i.set(l*d,l*p,a*h,a*u);break;case"XZX":i.set(a*h,l*g,l*m,a*u);break;case"YXY":i.set(l*m,a*h,l*g,a*u);break;case"ZYZ":i.set(l*g,l*m,a*h,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class mt{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,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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),r=Math.sin(t),o=this.x-e.x,s=this.y-e.y;return this.x=o*n-s*r+e.x,this.y=o*r+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}mt.prototype.isVector2=!0;class Xn{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,r,o,s,a,l,u){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=o,h[5]=l,h[6]=n,h[7]=s,h[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,r=t.elements,o=this.elements,s=n[0],a=n[3],l=n[6],u=n[1],h=n[4],d=n[7],p=n[2],m=n[5],g=n[8],_=r[0],y=r[3],w=r[6],P=r[1],B=r[4],G=r[7],U=r[2],X=r[5],H=r[8];return o[0]=s*_+a*P+l*U,o[3]=s*y+a*B+l*X,o[6]=s*w+a*G+l*H,o[1]=u*_+h*P+d*U,o[4]=u*y+h*B+d*X,o[7]=u*w+h*G+d*H,o[2]=p*_+m*P+g*U,o[5]=p*y+m*B+g*X,o[8]=p*w+m*G+g*H,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],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],h=e[8];return t*s*h-t*a*u-n*o*h+n*a*l+r*o*u-r*s*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=h*s-a*u,p=a*l-h*o,m=u*o-s*l,g=t*d+n*p+r*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]=(r*u-h*n)*_,e[2]=(a*n-r*s)*_,e[3]=p*_,e[4]=(h*t-r*l)*_,e[5]=(r*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,r,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,-r*u,r*l,-r*(-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),r=this.elements,o=r[0],s=r[3],a=r[6],l=r[1],u=r[4],h=r[7];return r[0]=t*o+n*l,r[3]=t*s+n*u,r[6]=t*a+n*h,r[1]=-n*o+t*l,r[4]=-n*s+t*u,r[7]=-n*a+t*h,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 r=0;r<9;r++)if(t[r]!==n[r])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 Bo;Xn.prototype.isMatrix3=!0;class Ur{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Bo===void 0&&(Bo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Bo.width=e.width,Bo.height=e.height;const n=Bo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Bo}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 Ng=0;class mi extends Fo{constructor(e=mi.DEFAULT_IMAGE,t=mi.DEFAULT_MAPPING,n=xt,r=xt,o=Gn,s=zs,a=Tr,l=ss,u=1,h=Ht){super(),Object.defineProperty(this,"id",{value:Ng++}),this.uuid=Ar(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=o,this.minFilter=s,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=l,this.offset=new mt(0,0),this.repeat=new mt(1,1),this.center=new mt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Xn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,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 r=this.image;if(r.uuid===void 0&&(r.uuid=Ar()),!t&&e.images[r.uuid]===void 0){let o;if(Array.isArray(r)){o=[];for(let s=0,a=r.length;s<a;s++)r[s].isDataTexture?o.push($c(r[s].image)):o.push($c(r[s]))}else o=$c(r);e.images[r.uuid]={uuid:r.uuid,url:o}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Z)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ht:e.x=e.x-Math.floor(e.x);break;case xt:e.x=e.x<0?0:1;break;case Ot: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 ht:e.y=e.y-Math.floor(e.y);break;case xt:e.y=e.y<0?0:1;break;case Ot: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 $c(i){return typeof HTMLImageElement!="undefined"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&i instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap?Ur.getDataURL(i):i.data?{data:Array.prototype.slice.call(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}mi.DEFAULT_IMAGE=void 0,mi.DEFAULT_MAPPING=Z,mi.prototype.isTexture=!0;class Bn{constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}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,r){return this.x=e,this.y=t,this.z=n,this.w=r,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,r=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r+s[12]*o,this.y=s[1]*t+s[5]*n+s[9]*r+s[13]*o,this.z=s[2]*t+s[6]*n+s[10]*r+s[14]*o,this.w=s[3]*t+s[7]*n+s[11]*r+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,r,o;const s=e.elements,a=s[0],l=s[4],u=s[8],h=s[1],d=s[5],p=s[9],m=s[2],g=s[6],_=s[10];if(Math.abs(l-h)<.01&&Math.abs(u-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(l+h)<.1&&Math.abs(u+m)<.1&&Math.abs(p+g)<.1&&Math.abs(a+d+_-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(a+1)/2,P=(d+1)/2,B=(_+1)/2,G=(l+h)/4,U=(u+m)/4,X=(p+g)/4;return w>P&&w>B?w<.01?(n=0,r=.707106781,o=.707106781):(n=Math.sqrt(w),r=G/n,o=U/n):P>B?P<.01?(n=.707106781,r=0,o=.707106781):(r=Math.sqrt(P),n=G/r,o=X/r):B<.01?(n=.707106781,r=.707106781,o=0):(o=Math.sqrt(B),n=U/o,r=X/o),this.set(n,r,o,t),this}let y=Math.sqrt((g-p)*(g-p)+(u-m)*(u-m)+(h-l)*(h-l));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(u-m)/y,this.z=(h-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}}Bn.prototype.isVector4=!0;class $r extends Fo{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new Bn(0,0,e,t),this.scissorTest=!1,this.viewport=new Bn(0,0,e,t),this.texture=new mi(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:Gn,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=U_({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}$r.prototype.isWebGLRenderTarget=!0;class Bl extends $r{constructor(e,t,n){super(e,t);const r=this.texture;this.texture=[];for(let o=0;o<n;o++)this.texture[o]=r.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 r=0,o=this.texture.length;r<o;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].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 Ks extends $r{constructor(e,t,n){super(e,t,n),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}Ks.prototype.isWebGLMultisampleRenderTarget=!0;class Bi{constructor(e=0,t=0,n=0,r=1){this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,r)}static slerpFlat(e,t,n,r,o,s,a){let l=n[r+0],u=n[r+1],h=n[r+2],d=n[r+3];const p=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]=h,void(e[t+3]=d);if(a===1)return e[t+0]=p,e[t+1]=m,e[t+2]=g,void(e[t+3]=_);if(d!==_||l!==p||u!==m||h!==g){let y=1-a;const w=l*p+u*m+h*g+d*_,P=w>=0?1:-1,B=1-w*w;if(B>Number.EPSILON){const U=Math.sqrt(B),X=Math.atan2(U,w*P);y=Math.sin(y*X)/U,a=Math.sin(a*X)/U}const G=a*P;if(l=l*y+p*G,u=u*y+m*G,h=h*y+g*G,d=d*y+_*G,y===1-a){const U=1/Math.sqrt(l*l+u*u+h*h+d*d);l*=U,u*=U,h*=U,d*=U}}e[t]=l,e[t+1]=u,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,r,o,s){const a=n[r],l=n[r+1],u=n[r+2],h=n[r+3],d=o[s],p=o[s+1],m=o[s+2],g=o[s+3];return e[t]=a*g+h*d+l*m-u*p,e[t+1]=l*g+h*p+u*d-a*m,e[t+2]=u*g+h*m+a*p-l*d,e[t+3]=h*g-a*d-l*p-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,r){return this._x=e,this._y=t,this._z=n,this._w=r,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,r=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,u=a(n/2),h=a(r/2),d=a(o/2),p=l(n/2),m=l(r/2),g=l(o/2);switch(s){case"XYZ":this._x=p*h*d+u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d-p*m*g;break;case"YXZ":this._x=p*h*d+u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d+p*m*g;break;case"ZXY":this._x=p*h*d-u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d-p*m*g;break;case"ZYX":this._x=p*h*d-u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d+p*m*g;break;case"YZX":this._x=p*h*d+u*m*g,this._y=u*m*d+p*h*g,this._z=u*h*g-p*m*d,this._w=u*h*d-p*m*g;break;case"XZY":this._x=p*h*d-u*m*g,this._y=u*m*d-p*h*g,this._z=u*h*g+p*m*d,this._w=u*h*d+p*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,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],o=t[8],s=t[1],a=t[5],l=t[9],u=t[2],h=t[6],d=t[10],p=n+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(o-u)*m,this._z=(s-r)*m}else if(n>a&&n>d){const m=2*Math.sqrt(1+n-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+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=(r+s)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-n-a);this._w=(s-r)/m,this._x=(o+u)/m,this._y=(l+h)/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(Wi(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),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,r=e._y,o=e._z,s=e._w,a=t._x,l=t._y,u=t._z,h=t._w;return this._x=n*h+s*a+r*u-o*l,this._y=r*h+s*l+o*a-n*u,this._z=o*h+s*u+n*l-r*a,this._w=s*h-n*a-r*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,r=this._y,o=this._z,s=this._w;let a=s*e._w+n*e._x+r*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=r,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*r+t*this._y,this._z=m*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),h=Math.atan2(u,a),d=Math.sin((1-t)*h)/u,p=Math.sin(t*h)/u;return this._w=s*d+this._w*p,this._x=n*d+this._x*p,this._y=r*d+this._y*p,this._z=o*d+this._z*p,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(){}}Bi.prototype.isQuaternion=!0;class S{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(Ul.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ul.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*r,this.y=o[1]*t+o[4]*n+o[7]*r,this.z=o[2]*t+o[5]*n+o[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,o=e.elements,s=1/(o[3]*t+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*r+o[12])*s,this.y=(o[1]*t+o[5]*n+o[9]*r+o[13])*s,this.z=(o[2]*t+o[6]*n+o[10]*r+o[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,o=e.x,s=e.y,a=e.z,l=e.w,u=l*t+s*r-a*n,h=l*n+a*t-o*r,d=l*r+o*n-s*t,p=-o*t-s*n-a*r;return this.x=u*l+p*-o+h*-a-d*-s,this.y=h*l+p*-s+d*-o-u*-a,this.z=d*l+p*-a+u*-s-h*-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,r=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r,this.y=o[1]*t+o[5]*n+o[9]*r,this.z=o[2]*t+o[6]*n+o[10]*r,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,r=e.y,o=e.z,s=t.x,a=t.y,l=t.z;return this.x=r*l-o*a,this.y=o*s-n*l,this.z=n*a-r*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 hs.copy(this).projectOnVector(e),this.sub(hs)}reflect(e){return this.sub(hs.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(Wi(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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 r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*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(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,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}}S.prototype.isVector3=!0;const hs=new S,Ul=new Bi;class Zn{constructor(e=new S(1/0,1/0,1/0),t=new S(-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,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=e.length;l<u;l+=3){const h=e[l],d=e[l+1],p=e[l+2];h<t&&(t=h),d<n&&(n=d),p<r&&(r=p),h>o&&(o=h),d>s&&(s=d),p>a&&(a=p)}return this.min.set(t,n,r),this.max.set(o,s,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,u=e.count;l<u;l++){const h=e.getX(l),d=e.getY(l),p=e.getZ(l);h<t&&(t=h),d<n&&(n=d),p<r&&(r=p),h>o&&(o=h),d>s&&(s=d),p>a&&(a=p)}return this.min.set(t,n,r),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=Jr.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(),Zr.copy(t.boundingBox),Zr.applyMatrix4(e.matrixWorld),this.union(Zr));const n=e.children;for(let r=0,o=n.length;r<o;r++)this.expandByObject(n[r]);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,Jr),Jr.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(kl),Ba.subVectors(this.max,kl),pr.subVectors(e.a,kl),kr.subVectors(e.b,kl),Ji.subVectors(e.c,kl),Uo.subVectors(kr,pr),ko.subVectors(Ji,kr),Qs.subVectors(pr,Ji);let t=[0,-Uo.z,Uo.y,0,-ko.z,ko.y,0,-Qs.z,Qs.y,Uo.z,0,-Uo.x,ko.z,0,-ko.x,Qs.z,0,-Qs.x,-Uo.y,Uo.x,0,-ko.y,ko.x,0,-Qs.y,Qs.x,0];return!!Jc(t,pr,kr,Ji,Ba)&&(t=[1,0,0,0,1,0,0,0,1],!!Jc(t,pr,kr,Ji,Ba)&&(cs.crossVectors(Uo,ko),t=[cs.x,cs.y,cs.z],Jc(t,pr,kr,Ji,Ba)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Jr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Jr).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()||(un[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),un[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),un[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),un[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),un[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),un[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),un[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),un[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(un)),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)}}Zn.prototype.isBox3=!0;const un=[new S,new S,new S,new S,new S,new S,new S,new S],Jr=new S,Zr=new Zn,pr=new S,kr=new S,Ji=new S,Uo=new S,ko=new S,Qs=new S,kl=new S,Ba=new S,cs=new S,fo=new S;function Jc(i,e,t,n,r){for(let o=0,s=i.length-3;o<=s;o+=3){fo.fromArray(i,o);const a=r.x*Math.abs(fo.x)+r.y*Math.abs(fo.y)+r.z*Math.abs(fo.z),l=e.dot(fo),u=t.dot(fo),h=n.dot(fo);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>a)return!1}return!0}const rf=new Zn,mo=new S,Gl=new S,Go=new S;class Mi{constructor(e=new S,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):rf.setFromPoints(e).getCenter(n);let r=0;for(let o=0,s=e.length;o<s;o++)r=Math.max(r,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(r),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){Go.subVectors(e,this.center);const t=Go.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=.5*(n-this.radius);this.center.add(Go.multiplyScalar(r/n)),this.radius+=r}return this}union(e){return Gl.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(mo.copy(e.center).add(Gl)),this.expandByPoint(mo.copy(e.center).sub(Gl)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const go=new S,ch=new S,ds=new S,rr=new S,dh=new S,ph=new S,Ua=new S;class Ho{constructor(e=new S,t=new S(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,go)),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=go.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(go.copy(this.direction).multiplyScalar(t).add(this.origin),go.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){ch.copy(e).add(t).multiplyScalar(.5),ds.copy(t).sub(e).normalize(),rr.copy(this.origin).sub(ch);const o=.5*e.distanceTo(t),s=-this.direction.dot(ds),a=rr.dot(this.direction),l=-rr.dot(ds),u=rr.lengthSq(),h=Math.abs(1-s*s);let d,p,m,g;if(h>0)if(d=s*l-a,p=s*a-l,g=o*h,d>=0)if(p>=-g)if(p<=g){const _=1/h;d*=_,p*=_,m=d*(d+s*p+2*a)+p*(s*d+p+2*l)+u}else p=o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;else p=-o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;else p<=-g?(d=Math.max(0,-(-s*o+a)),p=d>0?-o:Math.min(Math.max(-o,-l),o),m=-d*d+p*(p+2*l)+u):p<=g?(d=0,p=Math.min(Math.max(-o,-l),o),m=p*(p+2*l)+u):(d=Math.max(0,-(s*o+a)),p=d>0?o:Math.min(Math.max(-o,-l),o),m=-d*d+p*(p+2*l)+u);else p=s>0?-o:o,d=Math.max(0,-(s*p+a)),m=-d*d+p*(p+2*l)+u;return n&&n.copy(this.direction).multiplyScalar(d).add(this.origin),r&&r.copy(ds).multiplyScalar(p).add(ch),m}intersectSphere(e,t){go.subVectors(e.center,this.origin);const n=go.dot(this.direction),r=go.dot(go)-n*n,o=e.radius*e.radius;if(r>o)return null;const s=Math.sqrt(o-r),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,r,o,s,a,l;const u=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return u>=0?(n=(e.min.x-p.x)*u,r=(e.max.x-p.x)*u):(n=(e.max.x-p.x)*u,r=(e.min.x-p.x)*u),h>=0?(o=(e.min.y-p.y)*h,s=(e.max.y-p.y)*h):(o=(e.max.y-p.y)*h,s=(e.min.y-p.y)*h),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),d>=0?(a=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),n>l||a>r?null:((a>n||n!=n)&&(n=a),(l<r||r!=r)&&(r=l),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return this.intersectBox(e,go)!==null}intersectTriangle(e,t,n,r,o){dh.subVectors(t,e),ph.subVectors(n,e),Ua.crossVectors(dh,ph);let s,a=this.direction.dot(Ua);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}rr.subVectors(this.origin,e);const l=s*this.direction.dot(ph.crossVectors(rr,ph));if(l<0)return null;const u=s*this.direction.dot(dh.cross(rr));if(u<0||l+u>a)return null;const h=-s*rr.dot(Ua);return h<0?null:this.at(h/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 Rt{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,r,o,s,a,l,u,h,d,p,m,g,_,y){const w=this.elements;return w[0]=e,w[4]=t,w[8]=n,w[12]=r,w[1]=o,w[5]=s,w[9]=a,w[13]=l,w[2]=u,w[6]=h,w[10]=d,w[14]=p,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 Rt().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,r=1/ps.setFromMatrixColumn(e,0).length(),o=1/ps.setFromMatrixColumn(e,1).length(),s=1/ps.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,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,r=e.y,o=e.z,s=Math.cos(n),a=Math.sin(n),l=Math.cos(r),u=Math.sin(r),h=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const p=s*h,m=s*d,g=a*h,_=a*d;t[0]=l*h,t[4]=-l*d,t[8]=u,t[1]=m+g*u,t[5]=p-_*u,t[9]=-a*l,t[2]=_-p*u,t[6]=g+m*u,t[10]=s*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,g=u*h,_=u*d;t[0]=p+_*a,t[4]=g*a-m,t[8]=s*u,t[1]=s*d,t[5]=s*h,t[9]=-a,t[2]=m*a-g,t[6]=_+p*a,t[10]=s*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,g=u*h,_=u*d;t[0]=p-_*a,t[4]=-s*d,t[8]=g+m*a,t[1]=m+g*a,t[5]=s*h,t[9]=_-p*a,t[2]=-s*u,t[6]=a,t[10]=s*l}else if(e.order==="ZYX"){const p=s*h,m=s*d,g=a*h,_=a*d;t[0]=l*h,t[4]=g*u-m,t[8]=p*u+_,t[1]=l*d,t[5]=_*u+p,t[9]=m*u-g,t[2]=-u,t[6]=a*l,t[10]=s*l}else if(e.order==="YZX"){const p=s*l,m=s*u,g=a*l,_=a*u;t[0]=l*h,t[4]=_-p*d,t[8]=g*d+m,t[1]=d,t[5]=s*h,t[9]=-a*h,t[2]=-u*h,t[6]=m*d+g,t[10]=p-_*d}else if(e.order==="XZY"){const p=s*l,m=s*u,g=a*l,_=a*u;t[0]=l*h,t[4]=-d,t[8]=u*h,t[1]=p*d+_,t[5]=s*h,t[9]=m*d-g,t[2]=g*d-m,t[6]=a*h,t[10]=_*d+p}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(vo,e,Zc)}lookAt(e,t,n){const r=this.elements;return fr.subVectors(e,t),fr.lengthSq()===0&&(fr.z=1),fr.normalize(),Kr.crossVectors(n,fr),Kr.lengthSq()===0&&(Math.abs(n.z)===1?fr.x+=1e-4:fr.z+=1e-4,fr.normalize(),Kr.crossVectors(n,fr)),Kr.normalize(),_o.crossVectors(fr,Kr),r[0]=Kr.x,r[4]=_o.x,r[8]=fr.x,r[1]=Kr.y,r[5]=_o.y,r[9]=fr.y,r[2]=Kr.z,r[6]=_o.z,r[10]=fr.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,r=t.elements,o=this.elements,s=n[0],a=n[4],l=n[8],u=n[12],h=n[1],d=n[5],p=n[9],m=n[13],g=n[2],_=n[6],y=n[10],w=n[14],P=n[3],B=n[7],G=n[11],U=n[15],X=r[0],H=r[4],q=r[8],me=r[12],ue=r[1],oe=r[5],ce=r[9],le=r[13],_e=r[2],je=r[6],ke=r[10],Ee=r[14],Ae=r[3],Je=r[7],st=r[11],ct=r[15];return o[0]=s*X+a*ue+l*_e+u*Ae,o[4]=s*H+a*oe+l*je+u*Je,o[8]=s*q+a*ce+l*ke+u*st,o[12]=s*me+a*le+l*Ee+u*ct,o[1]=h*X+d*ue+p*_e+m*Ae,o[5]=h*H+d*oe+p*je+m*Je,o[9]=h*q+d*ce+p*ke+m*st,o[13]=h*me+d*le+p*Ee+m*ct,o[2]=g*X+_*ue+y*_e+w*Ae,o[6]=g*H+_*oe+y*je+w*Je,o[10]=g*q+_*ce+y*ke+w*st,o[14]=g*me+_*le+y*Ee+w*ct,o[3]=P*X+B*ue+G*_e+U*Ae,o[7]=P*H+B*oe+G*je+U*Je,o[11]=P*q+B*ce+G*ke+U*st,o[15]=P*me+B*le+G*Ee+U*ct,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],r=e[8],o=e[12],s=e[1],a=e[5],l=e[9],u=e[13],h=e[2],d=e[6],p=e[10],m=e[14];return e[3]*(+o*l*d-r*u*d-o*a*p+n*u*p+r*a*m-n*l*m)+e[7]*(+t*l*m-t*u*p+o*s*p-r*s*m+r*u*h-o*l*h)+e[11]*(+t*u*d-t*a*m-o*s*d+n*s*m+o*a*h-n*u*h)+e[15]*(-r*a*h-t*l*d+t*a*p+r*s*d-n*s*p+n*l*h)}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 r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=e[9],p=e[10],m=e[11],g=e[12],_=e[13],y=e[14],w=e[15],P=d*y*u-_*p*u+_*l*m-a*y*m-d*l*w+a*p*w,B=g*p*u-h*y*u-g*l*m+s*y*m+h*l*w-s*p*w,G=h*_*u-g*d*u+g*a*m-s*_*m-h*a*w+s*d*w,U=g*d*l-h*_*l-g*a*p+s*_*p+h*a*y-s*d*y,X=t*P+n*B+r*G+o*U;if(X===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const H=1/X;return e[0]=P*H,e[1]=(_*p*o-d*y*o-_*r*m+n*y*m+d*r*w-n*p*w)*H,e[2]=(a*y*o-_*l*o+_*r*u-n*y*u-a*r*w+n*l*w)*H,e[3]=(d*l*o-a*p*o-d*r*u+n*p*u+a*r*m-n*l*m)*H,e[4]=B*H,e[5]=(h*y*o-g*p*o+g*r*m-t*y*m-h*r*w+t*p*w)*H,e[6]=(g*l*o-s*y*o-g*r*u+t*y*u+s*r*w-t*l*w)*H,e[7]=(s*p*o-h*l*o+h*r*u-t*p*u-s*r*m+t*l*m)*H,e[8]=G*H,e[9]=(g*d*o-h*_*o-g*n*m+t*_*m+h*n*w-t*d*w)*H,e[10]=(s*_*o-g*a*o+g*n*u-t*_*u-s*n*w+t*a*w)*H,e[11]=(h*a*o-s*d*o-h*n*u+t*d*u+s*n*m-t*a*m)*H,e[12]=U*H,e[13]=(h*_*r-g*d*r+g*n*p-t*_*p-h*n*y+t*d*y)*H,e[14]=(g*a*r-s*_*r-g*n*l+t*_*l+s*n*y-t*a*y)*H,e[15]=(s*d*r-h*a*r+h*n*l-t*d*l-s*n*p+t*a*p)*H,this}scale(e){const t=this.elements,n=e.x,r=e.y,o=e.z;return t[0]*=n,t[4]*=r,t[8]*=o,t[1]*=n,t[5]*=r,t[9]*=o,t[2]*=n,t[6]*=r,t[10]*=o,t[3]*=n,t[7]*=r,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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}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),r=Math.sin(t),o=1-n,s=e.x,a=e.y,l=e.z,u=o*s,h=o*a;return this.set(u*s+n,u*a-r*l,u*l+r*a,0,u*a+r*l,h*a+n,h*l-r*s,0,u*l-r*a,h*l+r*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,r,o,s){return this.set(1,n,o,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,o=t._x,s=t._y,a=t._z,l=t._w,u=o+o,h=s+s,d=a+a,p=o*u,m=o*h,g=o*d,_=s*h,y=s*d,w=a*d,P=l*u,B=l*h,G=l*d,U=n.x,X=n.y,H=n.z;return r[0]=(1-(_+w))*U,r[1]=(m+G)*U,r[2]=(g-B)*U,r[3]=0,r[4]=(m-G)*X,r[5]=(1-(p+w))*X,r[6]=(y+P)*X,r[7]=0,r[8]=(g+B)*H,r[9]=(y-P)*H,r[10]=(1-(p+_))*H,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let o=ps.set(r[0],r[1],r[2]).length();const s=ps.set(r[4],r[5],r[6]).length(),a=ps.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),e.x=r[12],e.y=r[13],e.z=r[14],Gr.copy(this);const l=1/o,u=1/s,h=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]*=h,Gr.elements[9]*=h,Gr.elements[10]*=h,t.setFromRotationMatrix(Gr),n.x=o,n.y=s,n.z=a,this}makePerspective(e,t,n,r,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-r),h=(t+e)/(t-e),d=(n+r)/(n-r),p=-(s+o)/(s-o),m=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=u,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,o,s){const a=this.elements,l=1/(t-e),u=1/(n-r),h=1/(s-o),d=(t+e)*l,p=(n+r)*u,m=(s+o)*h;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]=-p,a[2]=0,a[6]=0,a[10]=-2*h,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 r=0;r<16;r++)if(t[r]!==n[r])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}}Rt.prototype.isMatrix4=!0;const ps=new S,Gr=new Rt,vo=new S(0,0,0),Zc=new S(1,1,1),Kr=new S,_o=new S,fr=new S,Zi=new Rt,fh=new Bi;class ea{constructor(e=0,t=0,n=0,r=ea.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=r}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,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,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 r=e.elements,o=r[0],s=r[4],a=r[8],l=r[1],u=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(Wi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Wi(h,-1,1)),Math.abs(h)<.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(Wi(p,-1,1)),Math.abs(p)<.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(-Wi(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Wi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-Wi(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,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 Zi.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Zi,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return fh.setFromEuler(this),this.setFromQuaternion(fh,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 S(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}ea.prototype.isEuler=!0,ea.DefaultOrder="XYZ",ea.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Kc{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 Qc=0;const ka=new S,ta=new Bi,Rr=new Rt,Ga=new S,Ha=new S,of=new S,ed=new Bi,sf=new S(1,0,0),mh=new S(0,1,0),td=new S(0,0,1),af={type:"added"},nd={type:"removed"};class pn extends Fo{constructor(){super(),Object.defineProperty(this,"id",{value:Qc++}),this.uuid=Ar(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=pn.DefaultUp.clone();const e=new S,t=new ea,n=new Bi,r=new S(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:r},modelViewMatrix:{value:new Rt},normalMatrix:{value:new Xn}}),this.matrix=new Rt,this.matrixWorld=new Rt,this.matrixAutoUpdate=pn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Kc,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 ta.setFromAxisAngle(e,t),this.quaternion.multiply(ta),this}rotateOnWorldAxis(e,t){return ta.setFromAxisAngle(e,t),this.quaternion.premultiply(ta),this}rotateX(e){return this.rotateOnAxis(sf,e)}rotateY(e){return this.rotateOnAxis(mh,e)}rotateZ(e){return this.rotateOnAxis(td,e)}translateOnAxis(e,t){return ka.copy(e).applyQuaternion(this.quaternion),this.position.add(ka.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(sf,e)}translateY(e){return this.translateOnAxis(mh,e)}translateZ(e){return this.translateOnAxis(td,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Rr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ga.copy(e):Ga.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Ha.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rr.lookAt(Ha,Ga,this.up):Rr.lookAt(Ga,Ha,this.up),this.quaternion.setFromRotationMatrix(Rr),r&&(Rr.extractRotation(r.matrixWorld),ta.setFromRotationMatrix(Rr),this.quaternion.premultiply(ta.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(af)):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(nd)),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(nd)}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,r=this.children.length;n<r;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(Ha,e,of),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ha,ed,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,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;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,r=t.length;n<r;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 r=this.children;for(let o=0,s=r.length;o<s;o++)r[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 r={};function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.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,h=l.length;u<h;u++){const d=l[u];o(e.shapes,d)}else o(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),r.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]));r.material=a}else r.material=o(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(o(e.animations,l))}}if(t){const a=s(e.geometries),l=s(e.materials),u=s(e.textures),h=s(e.images),d=s(e.shapes),p=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),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),p.length>0&&(n.skeletons=p),m.length>0&&(n.animations=m)}return n.object=r,n;function s(a){const l=[];for(const u in a){const h=a[u];delete h.metadata,l.push(h)}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 r=e.children[n];this.add(r.clone())}return this}}pn.DefaultUp=new S(0,1,0),pn.DefaultMatrixAutoUpdate=!0,pn.prototype.isObject3D=!0;const Hr=new S,yo=new S,gh=new S,Qr=new S,na=new S,fs=new S,vh=new S,fn=new S,id=new S,rd=new S;class qn{constructor(e=new S,t=new S,n=new S){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Hr.subVectors(e,t),r.cross(Hr);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(e,t,n,r,o){Hr.subVectors(r,t),yo.subVectors(n,t),gh.subVectors(e,t);const s=Hr.dot(Hr),a=Hr.dot(yo),l=Hr.dot(gh),u=yo.dot(yo),h=yo.dot(gh),d=s*u-a*a;if(d===0)return o.set(-2,-1,-1);const p=1/d,m=(u*l-a*h)*p,g=(s*h-a*l)*p;return o.set(1-m-g,g,m)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Qr),Qr.x>=0&&Qr.y>=0&&Qr.x+Qr.y<=1}static getUV(e,t,n,r,o,s,a,l){return this.getBarycoord(e,t,n,r,Qr),l.set(0,0),l.addScaledVector(o,Qr.x),l.addScaledVector(s,Qr.y),l.addScaledVector(a,Qr.z),l}static isFrontFacing(e,t,n,r){return Hr.subVectors(n,t),yo.subVectors(e,t),Hr.cross(yo).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),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 Hr.subVectors(this.c,this.b),yo.subVectors(this.a,this.b),.5*Hr.cross(yo).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,o){return qn.getUV(e,this.a,this.b,this.c,t,n,r,o)}containsPoint(e){return qn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,o=this.c;let s,a;na.subVectors(r,n),fs.subVectors(o,n),fn.subVectors(e,n);const l=na.dot(fn),u=fs.dot(fn);if(l<=0&&u<=0)return t.copy(n);id.subVectors(e,r);const h=na.dot(id),d=fs.dot(id);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*u;if(p<=0&&l>=0&&h<=0)return s=l/(l-h),t.copy(n).addScaledVector(na,s);rd.subVectors(e,o);const m=na.dot(rd),g=fs.dot(rd);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(fs,a);const y=h*g-m*d;if(y<=0&&d-h>=0&&m-g>=0)return vh.subVectors(o,r),a=(d-h)/(d-h+(m-g)),t.copy(r).addScaledVector(vh,a);const w=1/(y+_+p);return s=_*w,a=p*w,t.copy(n).addScaledVector(na,s).addScaledVector(fs,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let lf=0;class Ui extends Fo{constructor(){super(),Object.defineProperty(this,"id",{value:lf++}),this.uuid=Ar(),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=Wt,this.blendDst=qt,this.blendEquation=Ce,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=di,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Nl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Rn,this.stencilZFail=Rn,this.stencilZPass=Rn,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===qe;continue}const r=this[t];r!==void 0?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.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 r(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=r(e.textures),s=r(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 r=t.length;n=new Array(r);for(let o=0;o!==r;++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++}}Ui.prototype.isMaterial=!0;const uf={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},li={h:0,s:0,l:0},_h={h:0,s:0,l:0};function za(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+6*(e-i)*t:t<.5?e:t<2/3?i+6*(e-i)*(2/3-t):i}function Hl(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function yh(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}class Dt{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=uh(e,1),t=Wi(t,0,1),n=Wi(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,o=2*n-r;this.r=za(o,r,e+1/3),this.g=za(o,r,e),this.b=za(o,r,e-1/3)}return this}setStyle(e){function t(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let r;const o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const a=parseFloat(r[1])/360,l=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(a,l,u)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],o=r.length;if(o===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(o===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=uf[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=Hl(e.r),this.g=Hl(e.g),this.b=Hl(e.b),this}copyLinearToSRGB(e){return this.r=yh(e.r),this.g=yh(e.g),this.b=yh(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,r=this.b,o=Math.max(t,n,r),s=Math.min(t,n,r);let a,l;const u=(s+o)/2;if(s===o)a=0,l=0;else{const h=o-s;switch(l=u<=.5?h/(o+s):h/(2-o-s),o){case t:a=(n-r)/h+(n<r?6:0);break;case n:a=(r-t)/h+2;break;case r:a=(t-n)/h+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(li),li.h+=e,li.s+=t,li.l+=n,this.setHSL(li.h,li.s,li.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(li),e.getHSL(_h);const n=Dl(li.h,_h.h,t),r=Dl(li.s,_h.s,t),o=Dl(li.l,_h.l,t);return this.setHSL(n,r,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()}}Dt.NAMES=uf,Dt.prototype.isColor=!0,Dt.prototype.r=1,Dt.prototype.g=1,Dt.prototype.b=1;class gi extends Ui{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new Dt(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=Co,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}}gi.prototype.isMeshBasicMaterial=!0;const Tn=new S,ja=new mt;class gn{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=$s,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 r=0,o=this.itemSize;r<o;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let r=0,o=e.length;r<o;r++){let s=e[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),s=new Dt),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 r=0,o=e.length;r<o;r++){let s=e[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),s=new mt),t[n++]=s.x,t[n++]=s.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let r=0,o=e.length;r<o;r++){let s=e[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),s=new S),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 r=0,o=e.length;r<o;r++){let s=e[r];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),s=new Bn),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++)ja.fromBufferAttribute(this,t),ja.applyMatrix3(e),this.setXY(t,ja.x,ja.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Tn.fromBufferAttribute(this,t),Tn.applyMatrix3(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.applyMatrix4(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.applyNormalMatrix(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.transformDirection(e),this.setXYZ(t,Tn.x,Tn.y,Tn.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,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,o){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,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!==$s&&(e.usage=this.usage),this.updateRange.offset===0&&this.updateRange.count===-1||(e.updateRange=this.updateRange),e}}gn.prototype.isBufferAttribute=!0;class zl extends gn{constructor(e,t,n){super(new Int8Array(e),t,n)}}class od extends gn{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class xh extends gn{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class sd extends gn{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Va extends gn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class bh extends gn{constructor(e,t,n){super(new Int32Array(e),t,n)}}class eo extends gn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class hf extends gn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}hf.prototype.isFloat16BufferAttribute=!0;class Tt extends gn{constructor(e,t,n){super(new Float32Array(e),t,n)}}class ad extends gn{constructor(e,t,n){super(new Float64Array(e),t,n)}}function ld(i){if(i.length===0)return-1/0;let e=i[0];for(let t=1,n=i.length;t<n;++t)i[t]>e&&(e=i[t]);return e}const ud={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ia(i,e){return new ud[i](e)}let cf=0;const Cr=new Rt,wh=new pn,Ai=new S,ui=new Zn,ms=new Zn,ni=new S;class Xt extends Fo{constructor(){super(),Object.defineProperty(this,"id",{value:cf++}),this.uuid=Ar(),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(ld(e)>65535?eo:Va)(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 Xn().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Cr.makeRotationFromQuaternion(e),this.applyMatrix4(Cr),this}rotateX(e){return Cr.makeRotationX(e),this.applyMatrix4(Cr),this}rotateY(e){return Cr.makeRotationY(e),this.applyMatrix4(Cr),this}rotateZ(e){return Cr.makeRotationZ(e),this.applyMatrix4(Cr),this}translate(e,t,n){return Cr.makeTranslation(e,t,n),this.applyMatrix4(Cr),this}scale(e,t,n){return Cr.makeScale(e,t,n),this.applyMatrix4(Cr),this}lookAt(e){return wh.lookAt(e),wh.updateMatrix(),this.applyMatrix4(wh.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ai).negate(),this.translate(Ai.x,Ai.y,Ai.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];t.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new Tt(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Zn);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 S(-1/0,-1/0,-1/0),new S(1/0,1/0,1/0));if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const o=t[n];ui.setFromBufferAttribute(o),this.morphTargetsRelative?(ni.addVectors(this.boundingBox.min,ui.min),this.boundingBox.expandByPoint(ni),ni.addVectors(this.boundingBox.max,ui.max),this.boundingBox.expandByPoint(ni)):(this.boundingBox.expandByPoint(ui.min),this.boundingBox.expandByPoint(ui.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 Mi);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 S,1/0);if(e){const n=this.boundingSphere.center;if(ui.setFromBufferAttribute(e),t)for(let o=0,s=t.length;o<s;o++){const a=t[o];ms.setFromBufferAttribute(a),this.morphTargetsRelative?(ni.addVectors(ui.min,ms.min),ui.expandByPoint(ni),ni.addVectors(ui.max,ms.max),ui.expandByPoint(ni)):(ui.expandByPoint(ms.min),ui.expandByPoint(ms.max))}ui.getCenter(n);let r=0;for(let o=0,s=e.count;o<s;o++)ni.fromBufferAttribute(e,o),r=Math.max(r,n.distanceToSquared(ni));if(t)for(let o=0,s=t.length;o<s;o++){const a=t[o],l=this.morphTargetsRelative;for(let u=0,h=a.count;u<h;u++)ni.fromBufferAttribute(a,u),l&&(Ai.fromBufferAttribute(e,u),ni.add(Ai)),r=Math.max(r,n.distanceToSquared(ni))}this.boundingSphere.radius=Math.sqrt(r),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,r=t.position.array,o=t.normal.array,s=t.uv.array,a=r.length/3;t.tangent===void 0&&this.setAttribute("tangent",new gn(new Float32Array(4*a),4));const l=t.tangent.array,u=[],h=[];for(let ue=0;ue<a;ue++)u[ue]=new S,h[ue]=new S;const d=new S,p=new S,m=new S,g=new mt,_=new mt,y=new mt,w=new S,P=new S;function B(ue,oe,ce){d.fromArray(r,3*ue),p.fromArray(r,3*oe),m.fromArray(r,3*ce),g.fromArray(s,2*ue),_.fromArray(s,2*oe),y.fromArray(s,2*ce),p.sub(d),m.sub(d),_.sub(g),y.sub(g);const le=1/(_.x*y.y-y.x*_.y);isFinite(le)&&(w.copy(p).multiplyScalar(y.y).addScaledVector(m,-_.y).multiplyScalar(le),P.copy(m).multiplyScalar(_.x).addScaledVector(p,-y.x).multiplyScalar(le),u[ue].add(w),u[oe].add(w),u[ce].add(w),h[ue].add(P),h[oe].add(P),h[ce].add(P))}let G=this.groups;G.length===0&&(G=[{start:0,count:n.length}]);for(let ue=0,oe=G.length;ue<oe;++ue){const ce=G[ue],le=ce.start;for(let _e=le,je=le+ce.count;_e<je;_e+=3)B(n[_e+0],n[_e+1],n[_e+2])}const U=new S,X=new S,H=new S,q=new S;function me(ue){H.fromArray(o,3*ue),q.copy(H);const oe=u[ue];U.copy(oe),U.sub(H.multiplyScalar(H.dot(oe))).normalize(),X.crossVectors(q,oe);const ce=X.dot(h[ue])<0?-1:1;l[4*ue]=U.x,l[4*ue+1]=U.y,l[4*ue+2]=U.z,l[4*ue+3]=ce}for(let ue=0,oe=G.length;ue<oe;++ue){const ce=G[ue],le=ce.start;for(let _e=le,je=le+ce.count;_e<je;_e+=3)me(n[_e+0]),me(n[_e+1]),me(n[_e+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 gn(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let p=0,m=n.count;p<m;p++)n.setXYZ(p,0,0,0);const r=new S,o=new S,s=new S,a=new S,l=new S,u=new S,h=new S,d=new S;if(e)for(let p=0,m=e.count;p<m;p+=3){const g=e.getX(p+0),_=e.getX(p+1),y=e.getX(p+2);r.fromBufferAttribute(t,g),o.fromBufferAttribute(t,_),s.fromBufferAttribute(t,y),h.subVectors(s,o),d.subVectors(r,o),h.cross(d),a.fromBufferAttribute(n,g),l.fromBufferAttribute(n,_),u.fromBufferAttribute(n,y),a.add(h),l.add(h),u.add(h),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 p=0,m=t.count;p<m;p+=3)r.fromBufferAttribute(t,p+0),o.fromBufferAttribute(t,p+1),s.fromBufferAttribute(t,p+2),h.subVectors(s,o),d.subVectors(r,o),h.cross(d),n.setXYZ(p+0,h.x,h.y,h.z),n.setXYZ(p+1,h.x,h.y,h.z),n.setXYZ(p+2,h.x,h.y,h.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 r in n){if(e.attributes[r]===void 0)continue;const o=n[r].array,s=e.attributes[r],a=s.array,l=s.itemSize*t,u=Math.min(a.length,o.length-l);for(let h=0,d=l;h<u;h++,d++)o[d]=a[h]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)ni.fromBufferAttribute(e,t),ni.normalize(),e.setXYZ(t,ni.x,ni.y,ni.z)}toNonIndexed(){function e(a,l){const u=a.array,h=a.itemSize,d=a.normalized,p=new u.constructor(l.length*h);let m=0,g=0;for(let _=0,y=l.length;_<y;_++){m=a.isInterleavedBufferAttribute?l[_]*a.data.stride+a.offset:l[_]*h;for(let w=0;w<h;w++)p[g++]=u[m++]}return new gn(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Xt,n=this.index.array,r=this.attributes;for(const a in r){const l=e(r[a],n);t.setAttribute(a,l)}const o=this.morphAttributes;for(const a in o){const l=[],u=o[a];for(let h=0,d=u.length;h<d;h++){const p=e(u[h],n);l.push(p)}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 r={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],h=[];for(let d=0,p=u.length;d<p;d++){const m=u[d];h.push(m.toJSON(e.data))}h.length>0&&(r[l]=h,o=!0)}o&&(e.data.morphAttributes=r,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 Xt().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 r=e.attributes;for(const u in r){const h=r[u];this.setAttribute(u,h.clone(t))}const o=e.morphAttributes;for(const u in o){const h=[],d=o[u];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(t));this.morphAttributes[u]=h}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let u=0,h=s.length;u<h;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"})}}Xt.prototype.isBufferGeometry=!0;const hd=new Rt,ra=new Ho,gs=new Mi,zr=new S,zo=new S,jo=new S,Wa=new S,Sh=new S,Xa=new S,qa=new S,oa=new S,jl=new S,sa=new mt,Vl=new mt,Ya=new mt,cd=new S,Wl=new S;class En extends pn{constructor(e=new Xt,t=new gi){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 r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[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,r=this.material,o=this.matrixWorld;if(r===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),gs.copy(n.boundingSphere),gs.applyMatrix4(o),e.ray.intersectsSphere(gs)===!1)||(hd.copy(o).invert(),ra.copy(e.ray).applyMatrix4(hd),n.boundingBox!==null&&ra.intersectsBox(n.boundingBox)===!1))return;let s;if(n.isBufferGeometry){const a=n.index,l=n.attributes.position,u=n.morphAttributes.position,h=n.morphTargetsRelative,d=n.attributes.uv,p=n.attributes.uv2,m=n.groups,g=n.drawRange;if(a!==null)if(Array.isArray(r))for(let _=0,y=m.length;_<y;_++){const w=m[_],P=r[w.materialIndex];for(let B=Math.max(w.start,g.start),G=Math.min(w.start+w.count,g.start+g.count);B<G;B+=3){const U=a.getX(B),X=a.getX(B+1),H=a.getX(B+2);s=Xl(this,P,e,ra,l,u,h,d,p,U,X,H),s&&(s.faceIndex=Math.floor(B/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(_),P=a.getX(_+1),B=a.getX(_+2);s=Xl(this,r,e,ra,l,u,h,d,p,w,P,B),s&&(s.faceIndex=Math.floor(_/3),t.push(s))}else if(l!==void 0)if(Array.isArray(r))for(let _=0,y=m.length;_<y;_++){const w=m[_],P=r[w.materialIndex];for(let B=Math.max(w.start,g.start),G=Math.min(w.start+w.count,g.start+g.count);B<G;B+=3)s=Xl(this,P,e,ra,l,u,h,d,p,B,B+1,B+2),s&&(s.faceIndex=Math.floor(B/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=Xl(this,r,e,ra,l,u,h,d,p,_,_+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 Xl(i,e,t,n,r,o,s,a,l,u,h,d){zr.fromBufferAttribute(r,u),zo.fromBufferAttribute(r,h),jo.fromBufferAttribute(r,d);const p=i.morphTargetInfluences;if(e.morphTargets&&o&&p){qa.set(0,0,0),oa.set(0,0,0),jl.set(0,0,0);for(let g=0,_=o.length;g<_;g++){const y=p[g],w=o[g];y!==0&&(Wa.fromBufferAttribute(w,u),Sh.fromBufferAttribute(w,h),Xa.fromBufferAttribute(w,d),s?(qa.addScaledVector(Wa,y),oa.addScaledVector(Sh,y),jl.addScaledVector(Xa,y)):(qa.addScaledVector(Wa.sub(zr),y),oa.addScaledVector(Sh.sub(zo),y),jl.addScaledVector(Xa.sub(jo),y)))}zr.add(qa),zo.add(oa),jo.add(jl)}i.isSkinnedMesh&&(i.boneTransform(u,zr),i.boneTransform(h,zo),i.boneTransform(d,jo));const m=function(g,_,y,w,P,B,G,U){let X;if(X=_.side===V?w.intersectTriangle(G,B,P,!0,U):w.intersectTriangle(P,B,G,_.side!==ne,U),X===null)return null;Wl.copy(U),Wl.applyMatrix4(g.matrixWorld);const H=y.ray.origin.distanceTo(Wl);return H<y.near||H>y.far?null:{distance:H,point:Wl.clone(),object:g}}(i,e,t,n,zr,zo,jo,cd);if(m){a&&(sa.fromBufferAttribute(a,u),Vl.fromBufferAttribute(a,h),Ya.fromBufferAttribute(a,d),m.uv=qn.getUV(cd,zr,zo,jo,sa,Vl,Ya,new mt)),l&&(sa.fromBufferAttribute(l,u),Vl.fromBufferAttribute(l,h),Ya.fromBufferAttribute(l,d),m.uv2=qn.getUV(cd,zr,zo,jo,sa,Vl,Ya,new mt));const g={a:u,b:h,c:d,normal:new S,materialIndex:0};qn.getNormal(zr,zo,jo,g.normal),m.face=g}return m}En.prototype.isMesh=!0;class xo extends Xt{constructor(e=1,t=1,n=1,r=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:o,depthSegments:s};const a=this;r=Math.floor(r),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],h=[],d=[];let p=0,m=0;function g(_,y,w,P,B,G,U,X,H,q,me){const ue=G/H,oe=U/q,ce=G/2,le=U/2,_e=X/2,je=H+1,ke=q+1;let Ee=0,Ae=0;const Je=new S;for(let st=0;st<ke;st++){const ct=st*oe-le;for(let he=0;he<je;he++){const de=he*ue-ce;Je[_]=de*P,Je[y]=ct*B,Je[w]=_e,u.push(Je.x,Je.y,Je.z),Je[_]=0,Je[y]=0,Je[w]=X>0?1:-1,h.push(Je.x,Je.y,Je.z),d.push(he/H),d.push(1-st/q),Ee+=1}}for(let st=0;st<q;st++)for(let ct=0;ct<H;ct++){const he=p+ct+je*st,de=p+ct+je*(st+1),Ke=p+(ct+1)+je*(st+1),Ve=p+(ct+1)+je*st;l.push(he,de,Ve),l.push(de,Ke,Ve),Ae+=6}a.addGroup(m,Ae,me),m+=Ae,p+=Ee}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,r,s,2),g("x","z","y",1,-1,e,n,-t,r,s,3),g("x","y","z",1,-1,e,t,n,r,o,4),g("x","y","z",-1,-1,e,t,-n,r,o,5),this.setIndex(l),this.setAttribute("position",new Tt(u,3)),this.setAttribute("normal",new Tt(h,3)),this.setAttribute("uv",new Tt(d,2))}static fromJSON(e){return new xo(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function $a(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function Xi(i){const e={};for(let t=0;t<i.length;t++){const n=$a(i[t]);for(const r in n)e[r]=n[r]}return e}const bo={clone:$a,merge:Xi};class or extends Ui{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
1832
1832
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
1833
1833
  }`,this.fragmentShader=`void main() {
1834
1834
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
@@ -4671,7 +4671,7 @@ void main() {
4671
4671
  #include <logdepthbuf_vertex>
4672
4672
  #include <clipping_planes_vertex>
4673
4673
  #include <fog_vertex>
4674
- }`},At={common:{diffuse:{value:new Dt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Xn},uv2Transform:{value:new Xn},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 mt(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 Dt(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 Dt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Xn}},sprite:{diffuse:{value:new Dt(16777215)},opacity:{value:1},center:{value:new mt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Xn}}},Pr={basic:{uniforms:Wi([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.fog]),vertexShader:Qt.meshbasic_vert,fragmentShader:Qt.meshbasic_frag},lambert:{uniforms:Wi([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.fog,At.lights,{emissive:{value:new Dt(0)}}]),vertexShader:Qt.meshlambert_vert,fragmentShader:Qt.meshlambert_frag},phong:{uniforms:Wi([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.fog,At.lights,{emissive:{value:new Dt(0)},specular:{value:new Dt(1118481)},shininess:{value:30}}]),vertexShader:Qt.meshphong_vert,fragmentShader:Qt.meshphong_frag},standard:{uniforms:Wi([At.common,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.roughnessmap,At.metalnessmap,At.fog,At.lights,{emissive:{value:new Dt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},toon:{uniforms:Wi([At.common,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.gradientmap,At.fog,At.lights,{emissive:{value:new Dt(0)}}]),vertexShader:Qt.meshtoon_vert,fragmentShader:Qt.meshtoon_frag},matcap:{uniforms:Wi([At.common,At.bumpmap,At.normalmap,At.displacementmap,At.fog,{matcap:{value:null}}]),vertexShader:Qt.meshmatcap_vert,fragmentShader:Qt.meshmatcap_frag},points:{uniforms:Wi([At.points,At.fog]),vertexShader:Qt.points_vert,fragmentShader:Qt.points_frag},dashed:{uniforms:Wi([At.common,At.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qt.linedashed_vert,fragmentShader:Qt.linedashed_frag},depth:{uniforms:Wi([At.common,At.displacementmap]),vertexShader:Qt.depth_vert,fragmentShader:Qt.depth_frag},normal:{uniforms:Wi([At.common,At.bumpmap,At.normalmap,At.displacementmap,{opacity:{value:1}}]),vertexShader:Qt.normal_vert,fragmentShader:Qt.normal_frag},sprite:{uniforms:Wi([At.sprite,At.fog]),vertexShader:Qt.sprite_vert,fragmentShader:Qt.sprite_frag},background:{uniforms:{uvTransform:{value:new Xn},t2D:{value:null}},vertexShader:Qt.background_vert,fragmentShader:Qt.background_frag},cube:{uniforms:Wi([At.envmap,{opacity:{value:1}}]),vertexShader:Qt.cube_vert,fragmentShader:Qt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qt.equirect_vert,fragmentShader:Qt.equirect_frag},distanceRGBA:{uniforms:Wi([At.common,At.displacementmap,{referencePosition:{value:new S},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qt.distanceRGBA_vert,fragmentShader:Qt.distanceRGBA_frag},shadow:{uniforms:Wi([At.lights,At.fog,{color:{value:new Dt(0)},opacity:{value:1}}]),vertexShader:Qt.shadow_vert,fragmentShader:Qt.shadow_frag}};function Fg(i,e,t,n,r){const o=new Dt(0);let s,a,l=0,u=null,h=0,d=null;function p(m,g){t.buffers.color.setClear(m.r,m.g,m.b,g,r)}return{getClearColor:function(){return o},setClearColor:function(m,g=1){o.set(m),l=g,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,p(o,l)},render:function(m,g){let _=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=e.get(y));const w=i.xr,P=w.getSession&&w.getSession();P&&P.environmentBlendMode==="additive"&&(y=null),y===null?p(o,l):y&&y.isColor&&(p(y,1),_=!0),(i.autoClear||_)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Fe)?(a===void 0&&(a=new En(new xo(1,1,1),new or({name:"BackgroundCubeMaterial",uniforms:$a(Pr.cube.uniforms),vertexShader:Pr.cube.vertexShader,fragmentShader:Pr.cube.fragmentShader,side:V,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(B,G,U){this.matrixWorld.copyPosition(U.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&&h===y.version&&d===i.toneMapping||(a.material.needsUpdate=!0,u=y,h=y.version,d=i.toneMapping),m.unshift(a,a.geometry,a.material,0,0,null)):y&&y.isTexture&&(s===void 0&&(s=new En(new Ki(2,2),new or({name:"BackgroundMaterial",uniforms:$a(Pr.background.uniforms),vertexShader:Pr.background.vertexShader,fragmentShader:Pr.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&&h===y.version&&d===i.toneMapping||(s.material.needsUpdate=!0,u=y,h=y.version,d=i.toneMapping),m.unshift(s,s.geometry,s.material,0,0,null))}}}function ql(i,e,t,n){const r=i.getParameter(34921),o=n.isWebGL2?null:e.get("OES_vertex_array_object"),s=n.isWebGL2||o!==null,a={},l=p(null);let u=l;function h(G){return n.isWebGL2?i.bindVertexArray(G):o.bindVertexArrayOES(G)}function d(G){return n.isWebGL2?i.deleteVertexArray(G):o.deleteVertexArrayOES(G)}function p(G){const U=[],X=[],H=[];for(let q=0;q<r;q++)U[q]=0,X[q]=0,H[q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:U,enabledAttributes:X,attributeDivisors:H,object:G,attributes:{},index:null}}function m(){const G=u.newAttributes;for(let U=0,X=G.length;U<X;U++)G[U]=0}function g(G){_(G,0)}function _(G,U){const X=u.newAttributes,H=u.enabledAttributes,q=u.attributeDivisors;X[G]=1,H[G]===0&&(i.enableVertexAttribArray(G),H[G]=1),q[G]!==U&&((n.isWebGL2?i:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](G,U),q[G]=U)}function y(){const G=u.newAttributes,U=u.enabledAttributes;for(let X=0,H=U.length;X<H;X++)U[X]!==G[X]&&(i.disableVertexAttribArray(X),U[X]=0)}function w(G,U,X,H,q,me){n.isWebGL2!==!0||X!==5124&&X!==5125?i.vertexAttribPointer(G,U,X,H,q,me):i.vertexAttribIPointer(G,U,X,q,me)}function P(){B(),u!==l&&(u=l,h(u.object))}function B(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(G,U,X,H,q){let me=!1;if(s){const ue=function(oe,ce,le){const _e=le.wireframe===!0;let je=a[oe.id];je===void 0&&(je={},a[oe.id]=je);let ke=je[ce.id];ke===void 0&&(ke={},je[ce.id]=ke);let Ee=ke[_e];return Ee===void 0&&(Ee=p(n.isWebGL2?i.createVertexArray():o.createVertexArrayOES()),ke[_e]=Ee),Ee}(H,X,U);u!==ue&&(u=ue,h(u.object)),me=function(oe,ce){const le=u.attributes,_e=oe.attributes;let je=0;for(const ke in _e){const Ee=le[ke],Ae=_e[ke];if(Ee===void 0||Ee.attribute!==Ae||Ee.data!==Ae.data)return!0;je++}return u.attributesNum!==je||u.index!==ce}(H,q),me&&function(oe,ce){const le={},_e=oe.attributes;let je=0;for(const ke in _e){const Ee=_e[ke],Ae={};Ae.attribute=Ee,Ee.data&&(Ae.data=Ee.data),le[ke]=Ae,je++}u.attributes=le,u.attributesNum=je,u.index=ce}(H,q)}else{const ue=U.wireframe===!0;u.geometry===H.id&&u.program===X.id&&u.wireframe===ue||(u.geometry=H.id,u.program=X.id,u.wireframe=ue,me=!0)}G.isInstancedMesh===!0&&(me=!0),q!==null&&t.update(q,34963),me&&(function(ue,oe,ce,le){if(n.isWebGL2===!1&&(ue.isInstancedMesh||le.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;m();const _e=le.attributes,je=ce.getAttributes(),ke=oe.defaultAttributeValues;for(const Ee in je){const Ae=je[Ee];if(Ae>=0){const Je=_e[Ee];if(Je!==void 0){const st=Je.normalized,ct=Je.itemSize,he=t.get(Je);if(he===void 0)continue;const de=he.buffer,Ke=he.type,Ve=he.bytesPerElement;if(Je.isInterleavedBufferAttribute){const ze=Je.data,dt=ze.stride,pt=Je.offset;ze&&ze.isInstancedInterleavedBuffer?(_(Ae,ze.meshPerAttribute),le._maxInstanceCount===void 0&&(le._maxInstanceCount=ze.meshPerAttribute*ze.count)):g(Ae),i.bindBuffer(34962,de),w(Ae,ct,Ke,st,dt*Ve,pt*Ve)}else Je.isInstancedBufferAttribute?(_(Ae,Je.meshPerAttribute),le._maxInstanceCount===void 0&&(le._maxInstanceCount=Je.meshPerAttribute*Je.count)):g(Ae),i.bindBuffer(34962,de),w(Ae,ct,Ke,st,0,0)}else if(Ee==="instanceMatrix"){const st=t.get(ue.instanceMatrix);if(st===void 0)continue;const ct=st.buffer,he=st.type;_(Ae+0,1),_(Ae+1,1),_(Ae+2,1),_(Ae+3,1),i.bindBuffer(34962,ct),i.vertexAttribPointer(Ae+0,4,he,!1,64,0),i.vertexAttribPointer(Ae+1,4,he,!1,64,16),i.vertexAttribPointer(Ae+2,4,he,!1,64,32),i.vertexAttribPointer(Ae+3,4,he,!1,64,48)}else if(Ee==="instanceColor"){const st=t.get(ue.instanceColor);if(st===void 0)continue;const ct=st.buffer,he=st.type;_(Ae,1),i.bindBuffer(34962,ct),i.vertexAttribPointer(Ae,3,he,!1,12,0)}else if(ke!==void 0){const st=ke[Ee];if(st!==void 0)switch(st.length){case 2:i.vertexAttrib2fv(Ae,st);break;case 3:i.vertexAttrib3fv(Ae,st);break;case 4:i.vertexAttrib4fv(Ae,st);break;default:i.vertexAttrib1fv(Ae,st)}}}}y()}(G,U,X,H),q!==null&&i.bindBuffer(34963,t.get(q).buffer))},reset:P,resetDefaultState:B,dispose:function(){P();for(const G in a){const U=a[G];for(const X in U){const H=U[X];for(const q in H)d(H[q].object),delete H[q];delete U[X]}delete a[G]}},releaseStatesOfGeometry:function(G){if(a[G.id]===void 0)return;const U=a[G.id];for(const X in U){const H=U[X];for(const q in H)d(H[q].object),delete H[q];delete U[X]}delete a[G.id]},releaseStatesOfProgram:function(G){for(const U in a){const X=a[U];if(X[G.id]===void 0)continue;const H=X[G.id];for(const q in H)d(H[q].object),delete H[q];delete X[G.id]}},initAttributes:m,enableAttribute:g,disableUnusedAttributes:y}}function df(i,e,t,n){const r=n.isWebGL2;let o;this.setMode=function(s){o=s},this.render=function(s,a){i.drawArrays(o,s,a),t.update(a,o,1)},this.renderInstances=function(s,a,l){if(l===0)return;let u,h;if(r)u=i,h="drawArraysInstanced";else if(u=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",u===null)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](o,s,a,l),t.update(a,o,l)}}function pf(i,e,t){let n;function r(G){if(G==="highp"){if(i.getShaderPrecisionFormat(35633,36338).precision>0&&i.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";G="mediump"}return G==="mediump"&&i.getShaderPrecisionFormat(35633,36337).precision>0&&i.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext!="undefined"&&i instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&i instanceof WebGL2ComputeRenderingContext;let s=t.precision!==void 0?t.precision:"highp";const a=r(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,h=i.getParameter(34930),d=i.getParameter(35660),p=i.getParameter(3379),m=i.getParameter(34076),g=i.getParameter(34921),_=i.getParameter(36347),y=i.getParameter(36348),w=i.getParameter(36349),P=d>0,B=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 G=e.get("EXT_texture_filter_anisotropic");n=i.getParameter(G.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:_,maxVaryings:y,maxFragmentUniforms:w,vertexTextures:P,floatFragmentTextures:B,floatVertexTextures:P&&B,maxSamples:o?i.getParameter(36183):0}}function ff(i){const e=this;let t=null,n=0,r=!1,o=!1;const s=new jr,a=new Xn,l={value:null,needsUpdate:!1};function u(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(d,p,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*_,P=p.matrixWorldInverse;a.getNormalMatrix(P),(y===null||y.length<w)&&(y=new Float32Array(w));for(let B=0,G=m;B!==_;++B,G+=4)s.copy(d[B]).applyMatrix4(P,a),s.normal.toArray(y,G),y[G+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,p,m){const g=d.length!==0||p||n!==0||r;return r=p,t=h(d,m,0),n=d.length,g},this.beginShadows=function(){o=!0,h(null)},this.endShadows=function(){o=!1,u()},this.setState=function(d,p,m){const g=d.clippingPlanes,_=d.clipIntersection,y=d.clipShadows,w=i.get(d);if(!r||g===null||g.length===0||o&&!y)o?h(null):u();else{const P=o?0:n,B=4*P;let G=w.clippingState||null;l.value=G,G=h(g,p,B,m);for(let U=0;U!==B;++U)G[U]=t[U];w.clippingState=G,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=P}}}function mf(i){let e=new WeakMap;function t(r,o){return o===be?r.mapping=se:o===we&&(r.mapping=ge),r}function n(r){const o=r.target;o.removeEventListener("dispose",n);const s=e.get(o);s!==void 0&&(e.delete(o),s.dispose())}return{get:function(r){if(r&&r.isTexture){const o=r.mapping;if(o===be||o===we){if(e.has(r))return t(e.get(r).texture,r.mapping);{const s=r.image;if(s&&s.height>0){const a=i.getRenderTarget(),l=new Yt(s.height/2);return l.fromEquirectangularTexture(i,r),e.set(r,l),i.setRenderTarget(a),r.addEventListener("dispose",n),t(l.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}function Bg(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let r;switch(n){case"WEBGL_depth_texture":r=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=i.getExtension(n)}return e[n]=r,r}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 r=t(n);return r===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function fd(i,e,t,n){const r={},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 r[u.id];const h=o.get(u);h&&(e.remove(h),o.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,t.memory.geometries--}function a(l){const u=[],h=l.index,d=l.attributes.position;let p=0;if(h!==null){const _=h.array;p=h.version;for(let y=0,w=_.length;y<w;y+=3){const P=_[y+0],B=_[y+1],G=_[y+2];u.push(P,B,B,G,G,P)}}else{const _=d.array;p=d.version;for(let y=0,w=_.length/3-1;y<w;y+=3){const P=y+0,B=y+1,G=y+2;u.push(P,B,B,G,G,P)}}const m=new(ld(u)>65535?eo:Va)(u,1);m.version=p;const g=o.get(l);g&&e.remove(g),o.set(l,m)}return{get:function(l,u){return r[u.id]===!0||(u.addEventListener("dispose",s),r[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 h=l.morphAttributes;for(const d in h){const p=h[d];for(let m=0,g=p.length;m<g;m++)e.update(p[m],34962)}},getWireframeAttribute:function(l){const u=o.get(l);if(u){const h=l.index;h!==null&&u.version<h.version&&a(l)}else a(l);return o.get(l)}}}function gf(i,e,t,n){const r=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){i.drawElements(o,u,s,l*a),t.update(u,o,1)},this.renderInstances=function(l,u,h){if(h===0)return;let d,p;if(r)d=i,p="drawElementsInstanced";else if(d=e.get("ANGLE_instanced_arrays"),p="drawElementsInstancedANGLE",d===null)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");d[p](o,u,s,l*a,h),t.update(u,o,h)}}function Yl(i){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,r){switch(e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function md(i,e){return i[0]-e[0]}function vf(i,e){return Math.abs(e[1])-Math.abs(i[1])}function _f(i){const e={},t=new Float32Array(8),n=[];for(let r=0;r<8;r++)n[r]=[r,0];return{update:function(r,o,s,a){const l=r.morphTargetInfluences,u=l===void 0?0:l.length;let h=e[o.id];if(h===void 0||h.length!==u){h=[];for(let _=0;_<u;_++)h[_]=[_,0];e[o.id]=h}for(let _=0;_<u;_++){const y=h[_];y[0]=_,y[1]=l[_]}h.sort(vf);for(let _=0;_<8;_++)_<u&&h[_][1]?(n[_][0]=h[_][0],n[_][1]=h[_][1]):(n[_][0]=Number.MAX_SAFE_INTEGER,n[_][1]=0);n.sort(md);const d=s.morphTargets&&o.morphAttributes.position,p=s.morphNormals&&o.morphAttributes.normal;let m=0;for(let _=0;_<8;_++){const y=n[_],w=y[0],P=y[1];w!==Number.MAX_SAFE_INTEGER&&P?(d&&o.getAttribute("morphTarget"+_)!==d[w]&&o.setAttribute("morphTarget"+_,d[w]),p&&o.getAttribute("morphNormal"+_)!==p[w]&&o.setAttribute("morphNormal"+_,p[w]),t[_]=P,m+=P):(d&&o.hasAttribute("morphTarget"+_)===!0&&o.deleteAttribute("morphTarget"+_),p&&o.hasAttribute("morphNormal"+_)===!0&&o.deleteAttribute("morphNormal"+_),t[_]=0)}const g=o.morphTargetsRelative?1:1-m;a.getUniforms().setValue(i,"morphTargetBaseInfluence",g),a.getUniforms().setValue(i,"morphTargetInfluences",t)}}}function Th(i,e,t,n){let r=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 r.get(u)!==a&&(e.update(u),r.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(){r=new WeakMap}}}Pr.physical={uniforms:Wi([Pr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new mt(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Dt(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new mt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Dt(0)}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag};class Eh extends mi{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Gt,this.minFilter=Gt,this.wrapR=xt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Eh.prototype.isDataTexture2DArray=!0;class Vr extends mi{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Gt,this.minFilter=Gt,this.wrapR=xt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Vr.prototype.isDataTexture3D=!0;const vs=new mi,yf=new Eh,Ug=new Vr,xf=new to,bf=[],gd=[],vd=new Float32Array(16),_d=new Float32Array(9),yd=new Float32Array(4);function Ka(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let o=bf[r];if(o===void 0&&(o=new Float32Array(r),bf[r]=o),e!==0){n.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=t,i[s].toArray(o,a)}return o}function sr(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function Qi(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function Ir(i,e){let t=gd[e];t===void 0&&(t=new Int32Array(e),gd[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function kg(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function wf(i,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y||(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(sr(t,e))return;i.uniform2fv(this.addr,e),Qi(t,e)}}function Gg(i,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y&&t[2]===e.z||(i.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||(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(sr(t,e))return;i.uniform3fv(this.addr,e),Qi(t,e)}}function xd(i,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||(i.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(sr(t,e))return;i.uniform4fv(this.addr,e),Qi(t,e)}}function Hg(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(sr(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),Qi(t,e)}else{if(sr(t,n))return;yd.set(n),i.uniformMatrix2fv(this.addr,!1,yd),Qi(t,n)}}function zg(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(sr(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),Qi(t,e)}else{if(sr(t,n))return;_d.set(n),i.uniformMatrix3fv(this.addr,!1,_d),Qi(t,n)}}function jg(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(sr(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),Qi(t,e)}else{if(sr(t,n))return;vd.set(n),i.uniformMatrix4fv(this.addr,!1,vd),Qi(t,n)}}function bd(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function Sf(i,e){const t=this.cache;sr(t,e)||(i.uniform2iv(this.addr,e),Qi(t,e))}function Vg(i,e){const t=this.cache;sr(t,e)||(i.uniform3iv(this.addr,e),Qi(t,e))}function Wg(i,e){const t=this.cache;sr(t,e)||(i.uniform4iv(this.addr,e),Qi(t,e))}function Xg(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function qg(i,e){const t=this.cache;sr(t,e)||(i.uniform2uiv(this.addr,e),Qi(t,e))}function Yg(i,e){const t=this.cache;sr(t,e)||(i.uniform3uiv(this.addr,e),Qi(t,e))}function $g(i,e){const t=this.cache;sr(t,e)||(i.uniform4uiv(this.addr,e),Qi(t,e))}function Tf(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.safeSetTexture2D(e||vs,r)}function Mh(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||Ug,r)}function Jg(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.safeSetTextureCube(e||xf,r)}function Zg(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||yf,r)}function Kg(i,e){i.uniform1fv(this.addr,e)}function Qg(i,e){const t=Ka(e,this.size,2);i.uniform2fv(this.addr,t)}function Ef(i,e){const t=Ka(e,this.size,3);i.uniform3fv(this.addr,t)}function Mf(i,e){const t=Ka(e,this.size,4);i.uniform4fv(this.addr,t)}function ev(i,e){const t=Ka(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function tv(i,e){const t=Ka(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function nv(i,e){const t=Ka(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function Ah(i,e){i.uniform1iv(this.addr,e)}function iv(i,e){i.uniform2iv(this.addr,e)}function rv(i,e){i.uniform3iv(this.addr,e)}function Rh(i,e){i.uniform4iv(this.addr,e)}function Af(i,e){i.uniform1uiv(this.addr,e)}function Rf(i,e){i.uniform2uiv(this.addr,e)}function wd(i,e){i.uniform3uiv(this.addr,e)}function Cf(i,e){i.uniform4uiv(this.addr,e)}function Pf(i,e,t){const n=e.length,r=Ir(t,n);i.uniform1iv(this.addr,r);for(let o=0;o!==n;++o)t.safeSetTexture2D(e[o]||vs,r[o])}function ov(i,e,t){const n=e.length,r=Ir(t,n);i.uniform1iv(this.addr,r);for(let o=0;o!==n;++o)t.safeSetTextureCube(e[o]||xf,r[o])}function sv(i,e,t){this.id=i,this.addr=t,this.cache=[],this.setValue=function(n){switch(n){case 5126:return kg;case 35664:return wf;case 35665:return Gg;case 35666:return xd;case 35674:return Hg;case 35675:return zg;case 35676:return jg;case 5124:case 35670:return bd;case 35667:case 35671:return Sf;case 35668:case 35672:return Vg;case 35669:case 35673:return Wg;case 5125:return Xg;case 36294:return qg;case 36295:return Yg;case 36296:return $g;case 35678:case 36198:case 36298:case 36306:case 35682:return Tf;case 35679:case 36299:case 36307:return Mh;case 35680:case 36300:case 36308:case 36293:return Jg;case 36289:case 36303:case 36311:case 36292:return Zg}}(e.type)}function $l(i,e,t){this.id=i,this.addr=t,this.cache=[],this.size=e.size,this.setValue=function(n){switch(n){case 5126:return Kg;case 35664:return Qg;case 35665:return Ef;case 35666:return Mf;case 35674:return ev;case 35675:return tv;case 35676:return nv;case 5124:case 35670:return Ah;case 35667:case 35671:return iv;case 35668:case 35672:return rv;case 35669:case 35673:return Rh;case 5125:return Af;case 36294:return Rf;case 36295:return wd;case 36296:return Cf;case 35678:case 36198:case 36298:case 36306:case 35682:return Pf;case 35680:case 36300:case 36308:case 36293:return ov}}(e.type)}function Jl(i){this.id=i,this.seq=[],this.map={}}$l.prototype.updateCache=function(i){const e=this.cache;i instanceof Float32Array&&e.length!==i.length&&(this.cache=new Float32Array(i.length)),Qi(e,i)},Jl.prototype.setValue=function(i,e,t){const n=this.seq;for(let r=0,o=n.length;r!==o;++r){const s=n[r];s.setValue(i,e[s.id],t)}};const Sd=/(\w+)(\])?(\[|\.)?/g;function Ch(i,e){i.seq.push(e),i.map[e.id]=e}function If(i,e,t){const n=i.name,r=n.length;for(Sd.lastIndex=0;;){const o=Sd.exec(n),s=Sd.lastIndex;let a=o[1];const l=o[2]==="]",u=o[3];if(l&&(a|=0),u===void 0||u==="["&&s+2===r){Ch(t,u===void 0?new sv(a,i,e):new $l(a,i,e));break}{let h=t.map[a];h===void 0&&(h=new Jl(a),Ch(t,h)),t=h}}}function _s(i,e){this.seq=[],this.map={};const t=i.getProgramParameter(e,35718);for(let n=0;n<t;++n){const r=i.getActiveUniform(e,n);If(r,i.getUniformLocation(e,r.name),this)}}function Wr(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}_s.prototype.setValue=function(i,e,t,n){const r=this.map[e];r!==void 0&&r.setValue(i,t,n)},_s.prototype.setOptional=function(i,e,t){const n=e[t];n!==void 0&&this.setValue(i,t,n)},_s.upload=function(i,e,t,n){for(let r=0,o=e.length;r!==o;++r){const s=e[r],a=t[s.id];a.needsUpdate!==!1&&s.setValue(i,a.value,n)}},_s.seqWithValue=function(i,e){const t=[];for(let n=0,r=i.length;n!==r;++n){const o=i[n];o.id in e&&t.push(o)}return t};let av=0;function Of(i){switch(i){case Ht:return["Linear","( value )"];case vn:return["sRGB","( value )"];case Mr:return["RGBE","( value )"];case Il:return["RGBM","( value, 7.0 )"];case Wc:return["RGBM","( value, 16.0 )"];case dr:return["RGBD","( value, 256.0 )"];case ai:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case zn:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",i),["Linear","( value )"]}}function ys(i,e,t){const n=i.getShaderParameter(e,35713),r=i.getShaderInfoLog(e).trim();return n&&r===""?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+t+`
4674
+ }`},At={common:{diffuse:{value:new Dt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Xn},uv2Transform:{value:new Xn},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 mt(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 Dt(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 Dt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Xn}},sprite:{diffuse:{value:new Dt(16777215)},opacity:{value:1},center:{value:new mt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Xn}}},Pr={basic:{uniforms:Xi([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.fog]),vertexShader:Qt.meshbasic_vert,fragmentShader:Qt.meshbasic_frag},lambert:{uniforms:Xi([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.fog,At.lights,{emissive:{value:new Dt(0)}}]),vertexShader:Qt.meshlambert_vert,fragmentShader:Qt.meshlambert_frag},phong:{uniforms:Xi([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.fog,At.lights,{emissive:{value:new Dt(0)},specular:{value:new Dt(1118481)},shininess:{value:30}}]),vertexShader:Qt.meshphong_vert,fragmentShader:Qt.meshphong_frag},standard:{uniforms:Xi([At.common,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.roughnessmap,At.metalnessmap,At.fog,At.lights,{emissive:{value:new Dt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},toon:{uniforms:Xi([At.common,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.gradientmap,At.fog,At.lights,{emissive:{value:new Dt(0)}}]),vertexShader:Qt.meshtoon_vert,fragmentShader:Qt.meshtoon_frag},matcap:{uniforms:Xi([At.common,At.bumpmap,At.normalmap,At.displacementmap,At.fog,{matcap:{value:null}}]),vertexShader:Qt.meshmatcap_vert,fragmentShader:Qt.meshmatcap_frag},points:{uniforms:Xi([At.points,At.fog]),vertexShader:Qt.points_vert,fragmentShader:Qt.points_frag},dashed:{uniforms:Xi([At.common,At.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qt.linedashed_vert,fragmentShader:Qt.linedashed_frag},depth:{uniforms:Xi([At.common,At.displacementmap]),vertexShader:Qt.depth_vert,fragmentShader:Qt.depth_frag},normal:{uniforms:Xi([At.common,At.bumpmap,At.normalmap,At.displacementmap,{opacity:{value:1}}]),vertexShader:Qt.normal_vert,fragmentShader:Qt.normal_frag},sprite:{uniforms:Xi([At.sprite,At.fog]),vertexShader:Qt.sprite_vert,fragmentShader:Qt.sprite_frag},background:{uniforms:{uvTransform:{value:new Xn},t2D:{value:null}},vertexShader:Qt.background_vert,fragmentShader:Qt.background_frag},cube:{uniforms:Xi([At.envmap,{opacity:{value:1}}]),vertexShader:Qt.cube_vert,fragmentShader:Qt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qt.equirect_vert,fragmentShader:Qt.equirect_frag},distanceRGBA:{uniforms:Xi([At.common,At.displacementmap,{referencePosition:{value:new S},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qt.distanceRGBA_vert,fragmentShader:Qt.distanceRGBA_frag},shadow:{uniforms:Xi([At.lights,At.fog,{color:{value:new Dt(0)},opacity:{value:1}}]),vertexShader:Qt.shadow_vert,fragmentShader:Qt.shadow_frag}};function Fg(i,e,t,n,r){const o=new Dt(0);let s,a,l=0,u=null,h=0,d=null;function p(m,g){t.buffers.color.setClear(m.r,m.g,m.b,g,r)}return{getClearColor:function(){return o},setClearColor:function(m,g=1){o.set(m),l=g,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,p(o,l)},render:function(m,g){let _=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=e.get(y));const w=i.xr,P=w.getSession&&w.getSession();P&&P.environmentBlendMode==="additive"&&(y=null),y===null?p(o,l):y&&y.isColor&&(p(y,1),_=!0),(i.autoClear||_)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Fe)?(a===void 0&&(a=new En(new xo(1,1,1),new or({name:"BackgroundCubeMaterial",uniforms:$a(Pr.cube.uniforms),vertexShader:Pr.cube.vertexShader,fragmentShader:Pr.cube.fragmentShader,side:V,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(B,G,U){this.matrixWorld.copyPosition(U.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&&h===y.version&&d===i.toneMapping||(a.material.needsUpdate=!0,u=y,h=y.version,d=i.toneMapping),m.unshift(a,a.geometry,a.material,0,0,null)):y&&y.isTexture&&(s===void 0&&(s=new En(new Ki(2,2),new or({name:"BackgroundMaterial",uniforms:$a(Pr.background.uniforms),vertexShader:Pr.background.vertexShader,fragmentShader:Pr.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&&h===y.version&&d===i.toneMapping||(s.material.needsUpdate=!0,u=y,h=y.version,d=i.toneMapping),m.unshift(s,s.geometry,s.material,0,0,null))}}}function ql(i,e,t,n){const r=i.getParameter(34921),o=n.isWebGL2?null:e.get("OES_vertex_array_object"),s=n.isWebGL2||o!==null,a={},l=p(null);let u=l;function h(G){return n.isWebGL2?i.bindVertexArray(G):o.bindVertexArrayOES(G)}function d(G){return n.isWebGL2?i.deleteVertexArray(G):o.deleteVertexArrayOES(G)}function p(G){const U=[],X=[],H=[];for(let q=0;q<r;q++)U[q]=0,X[q]=0,H[q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:U,enabledAttributes:X,attributeDivisors:H,object:G,attributes:{},index:null}}function m(){const G=u.newAttributes;for(let U=0,X=G.length;U<X;U++)G[U]=0}function g(G){_(G,0)}function _(G,U){const X=u.newAttributes,H=u.enabledAttributes,q=u.attributeDivisors;X[G]=1,H[G]===0&&(i.enableVertexAttribArray(G),H[G]=1),q[G]!==U&&((n.isWebGL2?i:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](G,U),q[G]=U)}function y(){const G=u.newAttributes,U=u.enabledAttributes;for(let X=0,H=U.length;X<H;X++)U[X]!==G[X]&&(i.disableVertexAttribArray(X),U[X]=0)}function w(G,U,X,H,q,me){n.isWebGL2!==!0||X!==5124&&X!==5125?i.vertexAttribPointer(G,U,X,H,q,me):i.vertexAttribIPointer(G,U,X,q,me)}function P(){B(),u!==l&&(u=l,h(u.object))}function B(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(G,U,X,H,q){let me=!1;if(s){const ue=function(oe,ce,le){const _e=le.wireframe===!0;let je=a[oe.id];je===void 0&&(je={},a[oe.id]=je);let ke=je[ce.id];ke===void 0&&(ke={},je[ce.id]=ke);let Ee=ke[_e];return Ee===void 0&&(Ee=p(n.isWebGL2?i.createVertexArray():o.createVertexArrayOES()),ke[_e]=Ee),Ee}(H,X,U);u!==ue&&(u=ue,h(u.object)),me=function(oe,ce){const le=u.attributes,_e=oe.attributes;let je=0;for(const ke in _e){const Ee=le[ke],Ae=_e[ke];if(Ee===void 0||Ee.attribute!==Ae||Ee.data!==Ae.data)return!0;je++}return u.attributesNum!==je||u.index!==ce}(H,q),me&&function(oe,ce){const le={},_e=oe.attributes;let je=0;for(const ke in _e){const Ee=_e[ke],Ae={};Ae.attribute=Ee,Ee.data&&(Ae.data=Ee.data),le[ke]=Ae,je++}u.attributes=le,u.attributesNum=je,u.index=ce}(H,q)}else{const ue=U.wireframe===!0;u.geometry===H.id&&u.program===X.id&&u.wireframe===ue||(u.geometry=H.id,u.program=X.id,u.wireframe=ue,me=!0)}G.isInstancedMesh===!0&&(me=!0),q!==null&&t.update(q,34963),me&&(function(ue,oe,ce,le){if(n.isWebGL2===!1&&(ue.isInstancedMesh||le.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;m();const _e=le.attributes,je=ce.getAttributes(),ke=oe.defaultAttributeValues;for(const Ee in je){const Ae=je[Ee];if(Ae>=0){const Je=_e[Ee];if(Je!==void 0){const st=Je.normalized,ct=Je.itemSize,he=t.get(Je);if(he===void 0)continue;const de=he.buffer,Ke=he.type,Ve=he.bytesPerElement;if(Je.isInterleavedBufferAttribute){const ze=Je.data,dt=ze.stride,pt=Je.offset;ze&&ze.isInstancedInterleavedBuffer?(_(Ae,ze.meshPerAttribute),le._maxInstanceCount===void 0&&(le._maxInstanceCount=ze.meshPerAttribute*ze.count)):g(Ae),i.bindBuffer(34962,de),w(Ae,ct,Ke,st,dt*Ve,pt*Ve)}else Je.isInstancedBufferAttribute?(_(Ae,Je.meshPerAttribute),le._maxInstanceCount===void 0&&(le._maxInstanceCount=Je.meshPerAttribute*Je.count)):g(Ae),i.bindBuffer(34962,de),w(Ae,ct,Ke,st,0,0)}else if(Ee==="instanceMatrix"){const st=t.get(ue.instanceMatrix);if(st===void 0)continue;const ct=st.buffer,he=st.type;_(Ae+0,1),_(Ae+1,1),_(Ae+2,1),_(Ae+3,1),i.bindBuffer(34962,ct),i.vertexAttribPointer(Ae+0,4,he,!1,64,0),i.vertexAttribPointer(Ae+1,4,he,!1,64,16),i.vertexAttribPointer(Ae+2,4,he,!1,64,32),i.vertexAttribPointer(Ae+3,4,he,!1,64,48)}else if(Ee==="instanceColor"){const st=t.get(ue.instanceColor);if(st===void 0)continue;const ct=st.buffer,he=st.type;_(Ae,1),i.bindBuffer(34962,ct),i.vertexAttribPointer(Ae,3,he,!1,12,0)}else if(ke!==void 0){const st=ke[Ee];if(st!==void 0)switch(st.length){case 2:i.vertexAttrib2fv(Ae,st);break;case 3:i.vertexAttrib3fv(Ae,st);break;case 4:i.vertexAttrib4fv(Ae,st);break;default:i.vertexAttrib1fv(Ae,st)}}}}y()}(G,U,X,H),q!==null&&i.bindBuffer(34963,t.get(q).buffer))},reset:P,resetDefaultState:B,dispose:function(){P();for(const G in a){const U=a[G];for(const X in U){const H=U[X];for(const q in H)d(H[q].object),delete H[q];delete U[X]}delete a[G]}},releaseStatesOfGeometry:function(G){if(a[G.id]===void 0)return;const U=a[G.id];for(const X in U){const H=U[X];for(const q in H)d(H[q].object),delete H[q];delete U[X]}delete a[G.id]},releaseStatesOfProgram:function(G){for(const U in a){const X=a[U];if(X[G.id]===void 0)continue;const H=X[G.id];for(const q in H)d(H[q].object),delete H[q];delete X[G.id]}},initAttributes:m,enableAttribute:g,disableUnusedAttributes:y}}function df(i,e,t,n){const r=n.isWebGL2;let o;this.setMode=function(s){o=s},this.render=function(s,a){i.drawArrays(o,s,a),t.update(a,o,1)},this.renderInstances=function(s,a,l){if(l===0)return;let u,h;if(r)u=i,h="drawArraysInstanced";else if(u=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",u===null)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](o,s,a,l),t.update(a,o,l)}}function pf(i,e,t){let n;function r(G){if(G==="highp"){if(i.getShaderPrecisionFormat(35633,36338).precision>0&&i.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";G="mediump"}return G==="mediump"&&i.getShaderPrecisionFormat(35633,36337).precision>0&&i.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext!="undefined"&&i instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&i instanceof WebGL2ComputeRenderingContext;let s=t.precision!==void 0?t.precision:"highp";const a=r(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,h=i.getParameter(34930),d=i.getParameter(35660),p=i.getParameter(3379),m=i.getParameter(34076),g=i.getParameter(34921),_=i.getParameter(36347),y=i.getParameter(36348),w=i.getParameter(36349),P=d>0,B=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 G=e.get("EXT_texture_filter_anisotropic");n=i.getParameter(G.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:_,maxVaryings:y,maxFragmentUniforms:w,vertexTextures:P,floatFragmentTextures:B,floatVertexTextures:P&&B,maxSamples:o?i.getParameter(36183):0}}function ff(i){const e=this;let t=null,n=0,r=!1,o=!1;const s=new jr,a=new Xn,l={value:null,needsUpdate:!1};function u(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(d,p,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*_,P=p.matrixWorldInverse;a.getNormalMatrix(P),(y===null||y.length<w)&&(y=new Float32Array(w));for(let B=0,G=m;B!==_;++B,G+=4)s.copy(d[B]).applyMatrix4(P,a),s.normal.toArray(y,G),y[G+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,p,m){const g=d.length!==0||p||n!==0||r;return r=p,t=h(d,m,0),n=d.length,g},this.beginShadows=function(){o=!0,h(null)},this.endShadows=function(){o=!1,u()},this.setState=function(d,p,m){const g=d.clippingPlanes,_=d.clipIntersection,y=d.clipShadows,w=i.get(d);if(!r||g===null||g.length===0||o&&!y)o?h(null):u();else{const P=o?0:n,B=4*P;let G=w.clippingState||null;l.value=G,G=h(g,p,B,m);for(let U=0;U!==B;++U)G[U]=t[U];w.clippingState=G,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=P}}}function mf(i){let e=new WeakMap;function t(r,o){return o===be?r.mapping=se:o===we&&(r.mapping=ge),r}function n(r){const o=r.target;o.removeEventListener("dispose",n);const s=e.get(o);s!==void 0&&(e.delete(o),s.dispose())}return{get:function(r){if(r&&r.isTexture){const o=r.mapping;if(o===be||o===we){if(e.has(r))return t(e.get(r).texture,r.mapping);{const s=r.image;if(s&&s.height>0){const a=i.getRenderTarget(),l=new Yt(s.height/2);return l.fromEquirectangularTexture(i,r),e.set(r,l),i.setRenderTarget(a),r.addEventListener("dispose",n),t(l.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}function Bg(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let r;switch(n){case"WEBGL_depth_texture":r=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=i.getExtension(n)}return e[n]=r,r}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 r=t(n);return r===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function fd(i,e,t,n){const r={},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 r[u.id];const h=o.get(u);h&&(e.remove(h),o.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,t.memory.geometries--}function a(l){const u=[],h=l.index,d=l.attributes.position;let p=0;if(h!==null){const _=h.array;p=h.version;for(let y=0,w=_.length;y<w;y+=3){const P=_[y+0],B=_[y+1],G=_[y+2];u.push(P,B,B,G,G,P)}}else{const _=d.array;p=d.version;for(let y=0,w=_.length/3-1;y<w;y+=3){const P=y+0,B=y+1,G=y+2;u.push(P,B,B,G,G,P)}}const m=new(ld(u)>65535?eo:Va)(u,1);m.version=p;const g=o.get(l);g&&e.remove(g),o.set(l,m)}return{get:function(l,u){return r[u.id]===!0||(u.addEventListener("dispose",s),r[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 h=l.morphAttributes;for(const d in h){const p=h[d];for(let m=0,g=p.length;m<g;m++)e.update(p[m],34962)}},getWireframeAttribute:function(l){const u=o.get(l);if(u){const h=l.index;h!==null&&u.version<h.version&&a(l)}else a(l);return o.get(l)}}}function gf(i,e,t,n){const r=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){i.drawElements(o,u,s,l*a),t.update(u,o,1)},this.renderInstances=function(l,u,h){if(h===0)return;let d,p;if(r)d=i,p="drawElementsInstanced";else if(d=e.get("ANGLE_instanced_arrays"),p="drawElementsInstancedANGLE",d===null)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");d[p](o,u,s,l*a,h),t.update(u,o,h)}}function Yl(i){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,r){switch(e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function md(i,e){return i[0]-e[0]}function vf(i,e){return Math.abs(e[1])-Math.abs(i[1])}function _f(i){const e={},t=new Float32Array(8),n=[];for(let r=0;r<8;r++)n[r]=[r,0];return{update:function(r,o,s,a){const l=r.morphTargetInfluences,u=l===void 0?0:l.length;let h=e[o.id];if(h===void 0||h.length!==u){h=[];for(let _=0;_<u;_++)h[_]=[_,0];e[o.id]=h}for(let _=0;_<u;_++){const y=h[_];y[0]=_,y[1]=l[_]}h.sort(vf);for(let _=0;_<8;_++)_<u&&h[_][1]?(n[_][0]=h[_][0],n[_][1]=h[_][1]):(n[_][0]=Number.MAX_SAFE_INTEGER,n[_][1]=0);n.sort(md);const d=s.morphTargets&&o.morphAttributes.position,p=s.morphNormals&&o.morphAttributes.normal;let m=0;for(let _=0;_<8;_++){const y=n[_],w=y[0],P=y[1];w!==Number.MAX_SAFE_INTEGER&&P?(d&&o.getAttribute("morphTarget"+_)!==d[w]&&o.setAttribute("morphTarget"+_,d[w]),p&&o.getAttribute("morphNormal"+_)!==p[w]&&o.setAttribute("morphNormal"+_,p[w]),t[_]=P,m+=P):(d&&o.hasAttribute("morphTarget"+_)===!0&&o.deleteAttribute("morphTarget"+_),p&&o.hasAttribute("morphNormal"+_)===!0&&o.deleteAttribute("morphNormal"+_),t[_]=0)}const g=o.morphTargetsRelative?1:1-m;a.getUniforms().setValue(i,"morphTargetBaseInfluence",g),a.getUniforms().setValue(i,"morphTargetInfluences",t)}}}function Th(i,e,t,n){let r=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 r.get(u)!==a&&(e.update(u),r.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(){r=new WeakMap}}}Pr.physical={uniforms:Xi([Pr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new mt(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Dt(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new mt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Dt(0)}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag};class Eh extends mi{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Gt,this.minFilter=Gt,this.wrapR=xt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Eh.prototype.isDataTexture2DArray=!0;class Vr extends mi{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Gt,this.minFilter=Gt,this.wrapR=xt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Vr.prototype.isDataTexture3D=!0;const vs=new mi,yf=new Eh,Ug=new Vr,xf=new to,bf=[],gd=[],vd=new Float32Array(16),_d=new Float32Array(9),yd=new Float32Array(4);function Ka(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let o=bf[r];if(o===void 0&&(o=new Float32Array(r),bf[r]=o),e!==0){n.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=t,i[s].toArray(o,a)}return o}function sr(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function Qi(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function Ir(i,e){let t=gd[e];t===void 0&&(t=new Int32Array(e),gd[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function kg(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function wf(i,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y||(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(sr(t,e))return;i.uniform2fv(this.addr,e),Qi(t,e)}}function Gg(i,e){const t=this.cache;if(e.x!==void 0)t[0]===e.x&&t[1]===e.y&&t[2]===e.z||(i.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||(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(sr(t,e))return;i.uniform3fv(this.addr,e),Qi(t,e)}}function xd(i,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||(i.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(sr(t,e))return;i.uniform4fv(this.addr,e),Qi(t,e)}}function Hg(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(sr(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),Qi(t,e)}else{if(sr(t,n))return;yd.set(n),i.uniformMatrix2fv(this.addr,!1,yd),Qi(t,n)}}function zg(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(sr(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),Qi(t,e)}else{if(sr(t,n))return;_d.set(n),i.uniformMatrix3fv(this.addr,!1,_d),Qi(t,n)}}function jg(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(sr(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),Qi(t,e)}else{if(sr(t,n))return;vd.set(n),i.uniformMatrix4fv(this.addr,!1,vd),Qi(t,n)}}function bd(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function Sf(i,e){const t=this.cache;sr(t,e)||(i.uniform2iv(this.addr,e),Qi(t,e))}function Vg(i,e){const t=this.cache;sr(t,e)||(i.uniform3iv(this.addr,e),Qi(t,e))}function Wg(i,e){const t=this.cache;sr(t,e)||(i.uniform4iv(this.addr,e),Qi(t,e))}function Xg(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function qg(i,e){const t=this.cache;sr(t,e)||(i.uniform2uiv(this.addr,e),Qi(t,e))}function Yg(i,e){const t=this.cache;sr(t,e)||(i.uniform3uiv(this.addr,e),Qi(t,e))}function $g(i,e){const t=this.cache;sr(t,e)||(i.uniform4uiv(this.addr,e),Qi(t,e))}function Tf(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.safeSetTexture2D(e||vs,r)}function Mh(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||Ug,r)}function Jg(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.safeSetTextureCube(e||xf,r)}function Zg(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||yf,r)}function Kg(i,e){i.uniform1fv(this.addr,e)}function Qg(i,e){const t=Ka(e,this.size,2);i.uniform2fv(this.addr,t)}function Ef(i,e){const t=Ka(e,this.size,3);i.uniform3fv(this.addr,t)}function Mf(i,e){const t=Ka(e,this.size,4);i.uniform4fv(this.addr,t)}function ev(i,e){const t=Ka(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function tv(i,e){const t=Ka(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function nv(i,e){const t=Ka(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function Ah(i,e){i.uniform1iv(this.addr,e)}function iv(i,e){i.uniform2iv(this.addr,e)}function rv(i,e){i.uniform3iv(this.addr,e)}function Rh(i,e){i.uniform4iv(this.addr,e)}function Af(i,e){i.uniform1uiv(this.addr,e)}function Rf(i,e){i.uniform2uiv(this.addr,e)}function wd(i,e){i.uniform3uiv(this.addr,e)}function Cf(i,e){i.uniform4uiv(this.addr,e)}function Pf(i,e,t){const n=e.length,r=Ir(t,n);i.uniform1iv(this.addr,r);for(let o=0;o!==n;++o)t.safeSetTexture2D(e[o]||vs,r[o])}function ov(i,e,t){const n=e.length,r=Ir(t,n);i.uniform1iv(this.addr,r);for(let o=0;o!==n;++o)t.safeSetTextureCube(e[o]||xf,r[o])}function sv(i,e,t){this.id=i,this.addr=t,this.cache=[],this.setValue=function(n){switch(n){case 5126:return kg;case 35664:return wf;case 35665:return Gg;case 35666:return xd;case 35674:return Hg;case 35675:return zg;case 35676:return jg;case 5124:case 35670:return bd;case 35667:case 35671:return Sf;case 35668:case 35672:return Vg;case 35669:case 35673:return Wg;case 5125:return Xg;case 36294:return qg;case 36295:return Yg;case 36296:return $g;case 35678:case 36198:case 36298:case 36306:case 35682:return Tf;case 35679:case 36299:case 36307:return Mh;case 35680:case 36300:case 36308:case 36293:return Jg;case 36289:case 36303:case 36311:case 36292:return Zg}}(e.type)}function $l(i,e,t){this.id=i,this.addr=t,this.cache=[],this.size=e.size,this.setValue=function(n){switch(n){case 5126:return Kg;case 35664:return Qg;case 35665:return Ef;case 35666:return Mf;case 35674:return ev;case 35675:return tv;case 35676:return nv;case 5124:case 35670:return Ah;case 35667:case 35671:return iv;case 35668:case 35672:return rv;case 35669:case 35673:return Rh;case 5125:return Af;case 36294:return Rf;case 36295:return wd;case 36296:return Cf;case 35678:case 36198:case 36298:case 36306:case 35682:return Pf;case 35680:case 36300:case 36308:case 36293:return ov}}(e.type)}function Jl(i){this.id=i,this.seq=[],this.map={}}$l.prototype.updateCache=function(i){const e=this.cache;i instanceof Float32Array&&e.length!==i.length&&(this.cache=new Float32Array(i.length)),Qi(e,i)},Jl.prototype.setValue=function(i,e,t){const n=this.seq;for(let r=0,o=n.length;r!==o;++r){const s=n[r];s.setValue(i,e[s.id],t)}};const Sd=/(\w+)(\])?(\[|\.)?/g;function Ch(i,e){i.seq.push(e),i.map[e.id]=e}function If(i,e,t){const n=i.name,r=n.length;for(Sd.lastIndex=0;;){const o=Sd.exec(n),s=Sd.lastIndex;let a=o[1];const l=o[2]==="]",u=o[3];if(l&&(a|=0),u===void 0||u==="["&&s+2===r){Ch(t,u===void 0?new sv(a,i,e):new $l(a,i,e));break}{let h=t.map[a];h===void 0&&(h=new Jl(a),Ch(t,h)),t=h}}}function _s(i,e){this.seq=[],this.map={};const t=i.getProgramParameter(e,35718);for(let n=0;n<t;++n){const r=i.getActiveUniform(e,n);If(r,i.getUniformLocation(e,r.name),this)}}function Wr(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}_s.prototype.setValue=function(i,e,t,n){const r=this.map[e];r!==void 0&&r.setValue(i,t,n)},_s.prototype.setOptional=function(i,e,t){const n=e[t];n!==void 0&&this.setValue(i,t,n)},_s.upload=function(i,e,t,n){for(let r=0,o=e.length;r!==o;++r){const s=e[r],a=t[s.id];a.needsUpdate!==!1&&s.setValue(i,a.value,n)}},_s.seqWithValue=function(i,e){const t=[];for(let n=0,r=i.length;n!==r;++n){const o=i[n];o.id in e&&t.push(o)}return t};let av=0;function Of(i){switch(i){case Ht:return["Linear","( value )"];case vn:return["sRGB","( value )"];case Mr:return["RGBE","( value )"];case Il:return["RGBM","( value, 7.0 )"];case Wc:return["RGBM","( value, 16.0 )"];case dr:return["RGBD","( value, 256.0 )"];case ai:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case zn:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",i),["Linear","( value )"]}}function ys(i,e,t){const n=i.getShaderParameter(e,35713),r=i.getShaderInfoLog(e).trim();return n&&r===""?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+t+`
4675
4675
  `+r+function(o){const s=o.split(`
4676
4676
  `);for(let a=0;a<s.length;a++)s[a]=a+1+": "+s[a];return s.join(`
4677
4677
  `)}(i.getShaderSource(e))}function on(i,e){const t=Of(e);return"vec4 "+i+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function lv(i,e){const t=Of(e);return"vec4 "+i+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function mr(i,e){let t;switch(e){case E:t="Linear";break;case I:t="Reinhard";break;case O:t="OptimizedCineon";break;case Q:t="ACESFilmic";break;case J:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function Yn(i){return i!==""}function Vo(i,e){return i.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 Lf(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Td=/^[ \t]*#include +<([\w\d./]+)>/gm;function no(i){return i.replace(Td,Nf)}function Nf(i,e){const t=Qt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return no(t)}const Ph=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ii=/#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 ri(i){return i.replace(ii,Ed).replace(Ph,Df)}function Df(i,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ed(i,e,t,n)}function Ed(i,e,t,n){let r="";for(let o=parseInt(e);o<parseInt(t);o++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function Qa(i){let e="precision "+i.precision+` float;
@@ -4694,7 +4694,7 @@ precision `+i.precision+" int;";return i.precision==="highp"?e+=`
4694
4694
  `)+`
4695
4695
  `+y,w=["#define varying in",t.glslVersion===Yc?"":"out highp vec4 pc_fragColor;",t.glslVersion===Yc?"":"#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(`
4696
4696
  `)+`
4697
- `+w);const B=P+w+a,G=Wr(r,35633,P+y+s),U=Wr(r,35632,B);if(r.attachShader(_,G),r.attachShader(_,U),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_),i.debug.checkShaderErrors){const q=r.getProgramInfoLog(_).trim(),me=r.getShaderInfoLog(G).trim(),ue=r.getShaderInfoLog(U).trim();let oe=!0,ce=!0;if(r.getProgramParameter(_,35714)===!1){oe=!1;const le=ys(r,G,"vertex"),_e=ys(r,U,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(_,35715),"gl.getProgramInfoLog",q,le,_e)}else q!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",q):me!==""&&ue!==""||(ce=!1);ce&&(this.diagnostics={runnable:oe,programLog:q,vertexShader:{log:me,prefix:y},fragmentShader:{log:ue,prefix:w}})}let X,H;return r.deleteShader(G),r.deleteShader(U),this.getUniforms=function(){return X===void 0&&(X=new _s(r,_)),X},this.getAttributes=function(){return H===void 0&&(H=function(q,me){const ue={},oe=q.getProgramParameter(me,35721);for(let ce=0;ce<oe;ce++){const le=q.getActiveAttrib(me,ce).name;ue[le]=q.getAttribLocation(me,le)}return ue}(r,_)),H},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.name=t.shaderName,this.id=av++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=G,this.fragmentShader=U,this}function Ff(i,e,t,n,r,o){const s=[],a=n.isWebGL2,l=n.logarithmicDepthBuffer,u=n.floatVertexTextures,h=n.maxVertexUniforms,d=n.vertexTextures;let p=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=Ht,w}return{getParameters:function(y,w,P,B,G){const U=B.fog,X=y.isMeshStandardMaterial?B.environment:null,H=e.get(y.envMap||X),q=m[y.type],me=G.isSkinnedMesh?function(le){const _e=le.skeleton.bones;if(u)return 1024;{const je=h,ke=Math.floor((je-20)/4),Ee=Math.min(ke,_e.length);return Ee<_e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+_e.length+" bones. This GPU supports "+Ee+"."),0):Ee}}(G):0;let ue,oe;if(y.precision!==null&&(p=n.getMaxPrecision(y.precision),p!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",p,"instead.")),q){const le=Pr[q];ue=le.vertexShader,oe=le.fragmentShader}else ue=y.vertexShader,oe=y.fragmentShader;const ce=i.getRenderTarget();return{isWebGL2:a,shaderID:q,shaderName:y.type,vertexShader:ue,fragmentShader:oe,defines:y.defines,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:p,instancing:G.isInstancedMesh===!0,instancingColor:G.isInstancedMesh===!0&&G.instanceColor!==null,supportsVertexTextures:d,outputEncoding:ce!==null?_(ce.texture):i.outputEncoding,map:!!y.map,mapEncoding:_(y.map),matcap:!!y.matcap,matcapEncoding:_(y.matcap),envMap:!!H,envMapMode:H&&H.mapping,envMapEncoding:_(H),envMapCubeUV:!!H&&(H.mapping===Fe||H.mapping===Ye),lightMap:!!y.lightMap,lightMapEncoding:_(y.lightMap),aoMap:!!y.aoMap,emissiveMap:!!y.emissiveMap,emissiveMapEncoding:_(y.emissiveMap),bumpMap:!!y.bumpMap,normalMap:!!y.normalMap,objectSpaceNormalMap:y.normalMapType===Ll,tangentSpaceNormalMap:y.normalMapType===Br,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&&G.geometry&&G.geometry.attributes.color&&G.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:!!U,useFog:y.fog,fogExp2:U&&U.isFogExp2,flatShading:!!y.flatShading,sizeAttenuation:y.sizeAttenuation,logarithmicDepthBuffer:l,skinning:G.isSkinnedMesh===!0&&me>0,maxBones:me,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:i.shadowMap.enabled&&P.length>0,shadowMapType:i.shadowMap.type,toneMapping:y.toneMapped?i.toneMapping:Sr,physicallyCorrectLights:i.physicallyCorrectLights,premultipliedAlpha:y.premultipliedAlpha,alphaTest:y.alphaTest,doubleSided:y.side===ne,flipSided:y.side===V,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 P in y.defines)w.push(P),w.push(y.defines[P]);if(y.isRawShaderMaterial===!1){for(let P=0;P<g.length;P++)w.push(y[g[P]]);w.push(i.outputEncoding),w.push(i.gammaFactor)}return w.push(y.customProgramCacheKey),w.join()},getUniforms:function(y){const w=m[y.type];let P;if(w){const B=Pr[w];P=bo.clone(B.uniforms)}else P=y.uniforms;return P},acquireProgram:function(y,w){let P;for(let B=0,G=s.length;B<G;B++){const U=s[B];if(U.cacheKey===w){P=U,++P.usedTimes;break}}return P===void 0&&(P=new Md(i,w,y,r),s.push(P)),P},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 Ih(){let i=new WeakMap;return{get:function(e){let t=i.get(e);return t===void 0&&(t={},i.set(e,t)),t},remove:function(e){i.delete(e)},update:function(e,t,n){i.get(e)[t]=n},dispose:function(){i=new WeakMap}}}function Or(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.program!==e.program?i.program.id-e.program.id:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function ca(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function Bf(i){const e=[];let t=0;const n=[],r=[],o=[],s={id:-1};function a(l,u,h,d,p,m){let g=e[t];const _=i.get(h);return g===void 0?(g={id:l.id,object:l,geometry:u,material:h,program:_.program||s,groupOrder:d,renderOrder:l.renderOrder,z:p,group:m},e[t]=g):(g.id=l.id,g.object=l,g.geometry=u,g.material=h,g.program=_.program||s,g.groupOrder=d,g.renderOrder=l.renderOrder,g.z=p,g.group=m),t++,g}return{opaque:n,transmissive:r,transparent:o,init:function(){t=0,n.length=0,r.length=0,o.length=0},push:function(l,u,h,d,p,m){const g=a(l,u,h,d,p,m);h.transmission>0?r.push(g):h.transparent===!0?o.push(g):n.push(g)},unshift:function(l,u,h,d,p,m){const g=a(l,u,h,d,p,m);h.transmission>0?r.unshift(g):h.transparent===!0?o.unshift(g):n.unshift(g)},finish:function(){for(let l=t,u=e.length;l<u;l++){const h=e[l];if(h.id===null)break;h.id=null,h.object=null,h.geometry=null,h.material=null,h.program=null,h.group=null}},sort:function(l,u){n.length>1&&n.sort(l||Or),r.length>1&&r.sort(u||ca),o.length>1&&o.sort(u||ca)}}}function uv(i){let e=new WeakMap;return{get:function(t,n){let r;return e.has(t)===!1?(r=new Bf(i),e.set(t,[r])):n>=e.get(t).length?(r=new Bf(i),e.get(t).push(r)):r=e.get(t)[n],r},dispose:function(){e=new WeakMap}}}function Uf(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new S,color:new Dt};break;case"SpotLight":t={position:new S,direction:new S,color:new Dt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new S,color:new Dt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new S,skyColor:new Dt,groundColor:new Dt};break;case"RectAreaLight":t={color:new Dt,position:new S,halfWidth:new S,halfHeight:new S}}return i[e.id]=t,t}}}let Wo=0;function mn(i,e){return(e.castShadow?1:0)-(i.castShadow?1:0)}function kf(i,e){const t=new Uf,n=function(){const l={};return{get:function(u){if(l[u.id]!==void 0)return l[u.id];let h;switch(u.type){case"DirectionalLight":case"SpotLight":h={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt};break;case"PointLight":h={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt,shadowCameraNear:1,shadowCameraFar:1e3}}return l[u.id]=h,h}}}(),r={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++)r.probe.push(new S);const o=new S,s=new Rt,a=new Rt;return{setup:function(l){let u=0,h=0,d=0;for(let U=0;U<9;U++)r.probe[U].set(0,0,0);let p=0,m=0,g=0,_=0,y=0,w=0,P=0,B=0;l.sort(mn);for(let U=0,X=l.length;U<X;U++){const H=l[U],q=H.color,me=H.intensity,ue=H.distance,oe=H.shadow&&H.shadow.map?H.shadow.map.texture:null;if(H.isAmbientLight)u+=q.r*me,h+=q.g*me,d+=q.b*me;else if(H.isLightProbe)for(let ce=0;ce<9;ce++)r.probe[ce].addScaledVector(H.sh.coefficients[ce],me);else if(H.isDirectionalLight){const ce=t.get(H);if(ce.color.copy(H.color).multiplyScalar(H.intensity),H.castShadow){const le=H.shadow,_e=n.get(H);_e.shadowBias=le.bias,_e.shadowNormalBias=le.normalBias,_e.shadowRadius=le.radius,_e.shadowMapSize=le.mapSize,r.directionalShadow[p]=_e,r.directionalShadowMap[p]=oe,r.directionalShadowMatrix[p]=H.shadow.matrix,w++}r.directional[p]=ce,p++}else if(H.isSpotLight){const ce=t.get(H);if(ce.position.setFromMatrixPosition(H.matrixWorld),ce.color.copy(q).multiplyScalar(me),ce.distance=ue,ce.coneCos=Math.cos(H.angle),ce.penumbraCos=Math.cos(H.angle*(1-H.penumbra)),ce.decay=H.decay,H.castShadow){const le=H.shadow,_e=n.get(H);_e.shadowBias=le.bias,_e.shadowNormalBias=le.normalBias,_e.shadowRadius=le.radius,_e.shadowMapSize=le.mapSize,r.spotShadow[g]=_e,r.spotShadowMap[g]=oe,r.spotShadowMatrix[g]=H.shadow.matrix,B++}r.spot[g]=ce,g++}else if(H.isRectAreaLight){const ce=t.get(H);ce.color.copy(q).multiplyScalar(me),ce.halfWidth.set(.5*H.width,0,0),ce.halfHeight.set(0,.5*H.height,0),r.rectArea[_]=ce,_++}else if(H.isPointLight){const ce=t.get(H);if(ce.color.copy(H.color).multiplyScalar(H.intensity),ce.distance=H.distance,ce.decay=H.decay,H.castShadow){const le=H.shadow,_e=n.get(H);_e.shadowBias=le.bias,_e.shadowNormalBias=le.normalBias,_e.shadowRadius=le.radius,_e.shadowMapSize=le.mapSize,_e.shadowCameraNear=le.camera.near,_e.shadowCameraFar=le.camera.far,r.pointShadow[m]=_e,r.pointShadowMap[m]=oe,r.pointShadowMatrix[m]=H.shadow.matrix,P++}r.point[m]=ce,m++}else if(H.isHemisphereLight){const ce=t.get(H);ce.skyColor.copy(H.color).multiplyScalar(me),ce.groundColor.copy(H.groundColor).multiplyScalar(me),r.hemi[y]=ce,y++}}_>0&&(e.isWebGL2||i.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=At.LTC_FLOAT_1,r.rectAreaLTC2=At.LTC_FLOAT_2):i.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=At.LTC_HALF_1,r.rectAreaLTC2=At.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=u,r.ambient[1]=h,r.ambient[2]=d;const G=r.hash;G.directionalLength===p&&G.pointLength===m&&G.spotLength===g&&G.rectAreaLength===_&&G.hemiLength===y&&G.numDirectionalShadows===w&&G.numPointShadows===P&&G.numSpotShadows===B||(r.directional.length=p,r.spot.length=g,r.rectArea.length=_,r.point.length=m,r.hemi.length=y,r.directionalShadow.length=w,r.directionalShadowMap.length=w,r.pointShadow.length=P,r.pointShadowMap.length=P,r.spotShadow.length=B,r.spotShadowMap.length=B,r.directionalShadowMatrix.length=w,r.pointShadowMatrix.length=P,r.spotShadowMatrix.length=B,G.directionalLength=p,G.pointLength=m,G.spotLength=g,G.rectAreaLength=_,G.hemiLength=y,G.numDirectionalShadows=w,G.numPointShadows=P,G.numSpotShadows=B,r.version=Wo++)},setupView:function(l,u){let h=0,d=0,p=0,m=0,g=0;const _=u.matrixWorldInverse;for(let y=0,w=l.length;y<w;y++){const P=l[y];if(P.isDirectionalLight){const B=r.directional[h];B.direction.setFromMatrixPosition(P.matrixWorld),o.setFromMatrixPosition(P.target.matrixWorld),B.direction.sub(o),B.direction.transformDirection(_),h++}else if(P.isSpotLight){const B=r.spot[p];B.position.setFromMatrixPosition(P.matrixWorld),B.position.applyMatrix4(_),B.direction.setFromMatrixPosition(P.matrixWorld),o.setFromMatrixPosition(P.target.matrixWorld),B.direction.sub(o),B.direction.transformDirection(_),p++}else if(P.isRectAreaLight){const B=r.rectArea[m];B.position.setFromMatrixPosition(P.matrixWorld),B.position.applyMatrix4(_),a.identity(),s.copy(P.matrixWorld),s.premultiply(_),a.extractRotation(s),B.halfWidth.set(.5*P.width,0,0),B.halfHeight.set(0,.5*P.height,0),B.halfWidth.applyMatrix4(a),B.halfHeight.applyMatrix4(a),m++}else if(P.isPointLight){const B=r.point[d];B.position.setFromMatrixPosition(P.matrixWorld),B.position.applyMatrix4(_),d++}else if(P.isHemisphereLight){const B=r.hemi[g];B.direction.setFromMatrixPosition(P.matrixWorld),B.direction.transformDirection(_),B.direction.normalize(),g++}}},state:r}}function Lr(i,e){const t=new kf(i,e),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:t},setupLights:function(){t.setup(n)},setupLightsView:function(o){t.setupView(n,o)},pushLight:function(o){n.push(o)},pushShadow:function(o){r.push(o)}}}function Gf(i,e){let t=new WeakMap;return{get:function(n,r=0){let o;return t.has(n)===!1?(o=new Lr(i,e),t.set(n,[o])):r>=t.get(n).length?(o=new Lr(i,e),t.get(n).push(o)):o=t.get(n)[r],o},dispose:function(){t=new WeakMap}}}class bn extends Bi{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=Ol,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}}bn.prototype.isMeshDepthMaterial=!0;class Oh extends Bi{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new S,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}}Oh.prototype.isMeshDistanceMaterial=!0;function Ad(i,e,t){let n=new Za;const r=new mt,o=new mt,s=new Bn,a=[],l=[],u={},h=t.maxTextureSize,d={0:V,1:z,2:ne},p=new or({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new mt},radius:{value:4}},vertexShader:`void main() {
4697
+ `+w);const B=P+w+a,G=Wr(r,35633,P+y+s),U=Wr(r,35632,B);if(r.attachShader(_,G),r.attachShader(_,U),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_),i.debug.checkShaderErrors){const q=r.getProgramInfoLog(_).trim(),me=r.getShaderInfoLog(G).trim(),ue=r.getShaderInfoLog(U).trim();let oe=!0,ce=!0;if(r.getProgramParameter(_,35714)===!1){oe=!1;const le=ys(r,G,"vertex"),_e=ys(r,U,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(_,35715),"gl.getProgramInfoLog",q,le,_e)}else q!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",q):me!==""&&ue!==""||(ce=!1);ce&&(this.diagnostics={runnable:oe,programLog:q,vertexShader:{log:me,prefix:y},fragmentShader:{log:ue,prefix:w}})}let X,H;return r.deleteShader(G),r.deleteShader(U),this.getUniforms=function(){return X===void 0&&(X=new _s(r,_)),X},this.getAttributes=function(){return H===void 0&&(H=function(q,me){const ue={},oe=q.getProgramParameter(me,35721);for(let ce=0;ce<oe;ce++){const le=q.getActiveAttrib(me,ce).name;ue[le]=q.getAttribLocation(me,le)}return ue}(r,_)),H},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.name=t.shaderName,this.id=av++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=G,this.fragmentShader=U,this}function Ff(i,e,t,n,r,o){const s=[],a=n.isWebGL2,l=n.logarithmicDepthBuffer,u=n.floatVertexTextures,h=n.maxVertexUniforms,d=n.vertexTextures;let p=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=Ht,w}return{getParameters:function(y,w,P,B,G){const U=B.fog,X=y.isMeshStandardMaterial?B.environment:null,H=e.get(y.envMap||X),q=m[y.type],me=G.isSkinnedMesh?function(le){const _e=le.skeleton.bones;if(u)return 1024;{const je=h,ke=Math.floor((je-20)/4),Ee=Math.min(ke,_e.length);return Ee<_e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+_e.length+" bones. This GPU supports "+Ee+"."),0):Ee}}(G):0;let ue,oe;if(y.precision!==null&&(p=n.getMaxPrecision(y.precision),p!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",p,"instead.")),q){const le=Pr[q];ue=le.vertexShader,oe=le.fragmentShader}else ue=y.vertexShader,oe=y.fragmentShader;const ce=i.getRenderTarget();return{isWebGL2:a,shaderID:q,shaderName:y.type,vertexShader:ue,fragmentShader:oe,defines:y.defines,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:p,instancing:G.isInstancedMesh===!0,instancingColor:G.isInstancedMesh===!0&&G.instanceColor!==null,supportsVertexTextures:d,outputEncoding:ce!==null?_(ce.texture):i.outputEncoding,map:!!y.map,mapEncoding:_(y.map),matcap:!!y.matcap,matcapEncoding:_(y.matcap),envMap:!!H,envMapMode:H&&H.mapping,envMapEncoding:_(H),envMapCubeUV:!!H&&(H.mapping===Fe||H.mapping===Ye),lightMap:!!y.lightMap,lightMapEncoding:_(y.lightMap),aoMap:!!y.aoMap,emissiveMap:!!y.emissiveMap,emissiveMapEncoding:_(y.emissiveMap),bumpMap:!!y.bumpMap,normalMap:!!y.normalMap,objectSpaceNormalMap:y.normalMapType===Ll,tangentSpaceNormalMap:y.normalMapType===Br,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&&G.geometry&&G.geometry.attributes.color&&G.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:!!U,useFog:y.fog,fogExp2:U&&U.isFogExp2,flatShading:!!y.flatShading,sizeAttenuation:y.sizeAttenuation,logarithmicDepthBuffer:l,skinning:G.isSkinnedMesh===!0&&me>0,maxBones:me,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:i.shadowMap.enabled&&P.length>0,shadowMapType:i.shadowMap.type,toneMapping:y.toneMapped?i.toneMapping:Sr,physicallyCorrectLights:i.physicallyCorrectLights,premultipliedAlpha:y.premultipliedAlpha,alphaTest:y.alphaTest,doubleSided:y.side===ne,flipSided:y.side===V,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 P in y.defines)w.push(P),w.push(y.defines[P]);if(y.isRawShaderMaterial===!1){for(let P=0;P<g.length;P++)w.push(y[g[P]]);w.push(i.outputEncoding),w.push(i.gammaFactor)}return w.push(y.customProgramCacheKey),w.join()},getUniforms:function(y){const w=m[y.type];let P;if(w){const B=Pr[w];P=bo.clone(B.uniforms)}else P=y.uniforms;return P},acquireProgram:function(y,w){let P;for(let B=0,G=s.length;B<G;B++){const U=s[B];if(U.cacheKey===w){P=U,++P.usedTimes;break}}return P===void 0&&(P=new Md(i,w,y,r),s.push(P)),P},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 Ih(){let i=new WeakMap;return{get:function(e){let t=i.get(e);return t===void 0&&(t={},i.set(e,t)),t},remove:function(e){i.delete(e)},update:function(e,t,n){i.get(e)[t]=n},dispose:function(){i=new WeakMap}}}function Or(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.program!==e.program?i.program.id-e.program.id:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function ca(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function Bf(i){const e=[];let t=0;const n=[],r=[],o=[],s={id:-1};function a(l,u,h,d,p,m){let g=e[t];const _=i.get(h);return g===void 0?(g={id:l.id,object:l,geometry:u,material:h,program:_.program||s,groupOrder:d,renderOrder:l.renderOrder,z:p,group:m},e[t]=g):(g.id=l.id,g.object=l,g.geometry=u,g.material=h,g.program=_.program||s,g.groupOrder=d,g.renderOrder=l.renderOrder,g.z=p,g.group=m),t++,g}return{opaque:n,transmissive:r,transparent:o,init:function(){t=0,n.length=0,r.length=0,o.length=0},push:function(l,u,h,d,p,m){const g=a(l,u,h,d,p,m);h.transmission>0?r.push(g):h.transparent===!0?o.push(g):n.push(g)},unshift:function(l,u,h,d,p,m){const g=a(l,u,h,d,p,m);h.transmission>0?r.unshift(g):h.transparent===!0?o.unshift(g):n.unshift(g)},finish:function(){for(let l=t,u=e.length;l<u;l++){const h=e[l];if(h.id===null)break;h.id=null,h.object=null,h.geometry=null,h.material=null,h.program=null,h.group=null}},sort:function(l,u){n.length>1&&n.sort(l||Or),r.length>1&&r.sort(u||ca),o.length>1&&o.sort(u||ca)}}}function uv(i){let e=new WeakMap;return{get:function(t,n){let r;return e.has(t)===!1?(r=new Bf(i),e.set(t,[r])):n>=e.get(t).length?(r=new Bf(i),e.get(t).push(r)):r=e.get(t)[n],r},dispose:function(){e=new WeakMap}}}function Uf(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new S,color:new Dt};break;case"SpotLight":t={position:new S,direction:new S,color:new Dt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new S,color:new Dt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new S,skyColor:new Dt,groundColor:new Dt};break;case"RectAreaLight":t={color:new Dt,position:new S,halfWidth:new S,halfHeight:new S}}return i[e.id]=t,t}}}let Wo=0;function mn(i,e){return(e.castShadow?1:0)-(i.castShadow?1:0)}function kf(i,e){const t=new Uf,n=function(){const l={};return{get:function(u){if(l[u.id]!==void 0)return l[u.id];let h;switch(u.type){case"DirectionalLight":case"SpotLight":h={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt};break;case"PointLight":h={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt,shadowCameraNear:1,shadowCameraFar:1e3}}return l[u.id]=h,h}}}(),r={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++)r.probe.push(new S);const o=new S,s=new Rt,a=new Rt;return{setup:function(l){let u=0,h=0,d=0;for(let U=0;U<9;U++)r.probe[U].set(0,0,0);let p=0,m=0,g=0,_=0,y=0,w=0,P=0,B=0;l.sort(mn);for(let U=0,X=l.length;U<X;U++){const H=l[U],q=H.color,me=H.intensity,ue=H.distance,oe=H.shadow&&H.shadow.map?H.shadow.map.texture:null;if(H.isAmbientLight)u+=q.r*me,h+=q.g*me,d+=q.b*me;else if(H.isLightProbe)for(let ce=0;ce<9;ce++)r.probe[ce].addScaledVector(H.sh.coefficients[ce],me);else if(H.isDirectionalLight){const ce=t.get(H);if(ce.color.copy(H.color).multiplyScalar(H.intensity),H.castShadow){const le=H.shadow,_e=n.get(H);_e.shadowBias=le.bias,_e.shadowNormalBias=le.normalBias,_e.shadowRadius=le.radius,_e.shadowMapSize=le.mapSize,r.directionalShadow[p]=_e,r.directionalShadowMap[p]=oe,r.directionalShadowMatrix[p]=H.shadow.matrix,w++}r.directional[p]=ce,p++}else if(H.isSpotLight){const ce=t.get(H);if(ce.position.setFromMatrixPosition(H.matrixWorld),ce.color.copy(q).multiplyScalar(me),ce.distance=ue,ce.coneCos=Math.cos(H.angle),ce.penumbraCos=Math.cos(H.angle*(1-H.penumbra)),ce.decay=H.decay,H.castShadow){const le=H.shadow,_e=n.get(H);_e.shadowBias=le.bias,_e.shadowNormalBias=le.normalBias,_e.shadowRadius=le.radius,_e.shadowMapSize=le.mapSize,r.spotShadow[g]=_e,r.spotShadowMap[g]=oe,r.spotShadowMatrix[g]=H.shadow.matrix,B++}r.spot[g]=ce,g++}else if(H.isRectAreaLight){const ce=t.get(H);ce.color.copy(q).multiplyScalar(me),ce.halfWidth.set(.5*H.width,0,0),ce.halfHeight.set(0,.5*H.height,0),r.rectArea[_]=ce,_++}else if(H.isPointLight){const ce=t.get(H);if(ce.color.copy(H.color).multiplyScalar(H.intensity),ce.distance=H.distance,ce.decay=H.decay,H.castShadow){const le=H.shadow,_e=n.get(H);_e.shadowBias=le.bias,_e.shadowNormalBias=le.normalBias,_e.shadowRadius=le.radius,_e.shadowMapSize=le.mapSize,_e.shadowCameraNear=le.camera.near,_e.shadowCameraFar=le.camera.far,r.pointShadow[m]=_e,r.pointShadowMap[m]=oe,r.pointShadowMatrix[m]=H.shadow.matrix,P++}r.point[m]=ce,m++}else if(H.isHemisphereLight){const ce=t.get(H);ce.skyColor.copy(H.color).multiplyScalar(me),ce.groundColor.copy(H.groundColor).multiplyScalar(me),r.hemi[y]=ce,y++}}_>0&&(e.isWebGL2||i.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=At.LTC_FLOAT_1,r.rectAreaLTC2=At.LTC_FLOAT_2):i.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=At.LTC_HALF_1,r.rectAreaLTC2=At.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=u,r.ambient[1]=h,r.ambient[2]=d;const G=r.hash;G.directionalLength===p&&G.pointLength===m&&G.spotLength===g&&G.rectAreaLength===_&&G.hemiLength===y&&G.numDirectionalShadows===w&&G.numPointShadows===P&&G.numSpotShadows===B||(r.directional.length=p,r.spot.length=g,r.rectArea.length=_,r.point.length=m,r.hemi.length=y,r.directionalShadow.length=w,r.directionalShadowMap.length=w,r.pointShadow.length=P,r.pointShadowMap.length=P,r.spotShadow.length=B,r.spotShadowMap.length=B,r.directionalShadowMatrix.length=w,r.pointShadowMatrix.length=P,r.spotShadowMatrix.length=B,G.directionalLength=p,G.pointLength=m,G.spotLength=g,G.rectAreaLength=_,G.hemiLength=y,G.numDirectionalShadows=w,G.numPointShadows=P,G.numSpotShadows=B,r.version=Wo++)},setupView:function(l,u){let h=0,d=0,p=0,m=0,g=0;const _=u.matrixWorldInverse;for(let y=0,w=l.length;y<w;y++){const P=l[y];if(P.isDirectionalLight){const B=r.directional[h];B.direction.setFromMatrixPosition(P.matrixWorld),o.setFromMatrixPosition(P.target.matrixWorld),B.direction.sub(o),B.direction.transformDirection(_),h++}else if(P.isSpotLight){const B=r.spot[p];B.position.setFromMatrixPosition(P.matrixWorld),B.position.applyMatrix4(_),B.direction.setFromMatrixPosition(P.matrixWorld),o.setFromMatrixPosition(P.target.matrixWorld),B.direction.sub(o),B.direction.transformDirection(_),p++}else if(P.isRectAreaLight){const B=r.rectArea[m];B.position.setFromMatrixPosition(P.matrixWorld),B.position.applyMatrix4(_),a.identity(),s.copy(P.matrixWorld),s.premultiply(_),a.extractRotation(s),B.halfWidth.set(.5*P.width,0,0),B.halfHeight.set(0,.5*P.height,0),B.halfWidth.applyMatrix4(a),B.halfHeight.applyMatrix4(a),m++}else if(P.isPointLight){const B=r.point[d];B.position.setFromMatrixPosition(P.matrixWorld),B.position.applyMatrix4(_),d++}else if(P.isHemisphereLight){const B=r.hemi[g];B.direction.setFromMatrixPosition(P.matrixWorld),B.direction.transformDirection(_),B.direction.normalize(),g++}}},state:r}}function Lr(i,e){const t=new kf(i,e),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:t},setupLights:function(){t.setup(n)},setupLightsView:function(o){t.setupView(n,o)},pushLight:function(o){n.push(o)},pushShadow:function(o){r.push(o)}}}function Gf(i,e){let t=new WeakMap;return{get:function(n,r=0){let o;return t.has(n)===!1?(o=new Lr(i,e),t.set(n,[o])):r>=t.get(n).length?(o=new Lr(i,e),t.get(n).push(o)):o=t.get(n)[r],o},dispose:function(){t=new WeakMap}}}class bn extends Ui{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=Ol,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}}bn.prototype.isMeshDepthMaterial=!0;class Oh extends Ui{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new S,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}}Oh.prototype.isMeshDistanceMaterial=!0;function Ad(i,e,t){let n=new Za;const r=new mt,o=new mt,s=new Bn,a=[],l=[],u={},h=t.maxTextureSize,d={0:V,1:z,2:ne},p=new or({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new mt},radius:{value:4}},vertexShader:`void main() {
4698
4698
  gl_Position = vec4( position, 1.0 );
4699
4699
  }`,fragmentShader:`uniform sampler2D shadow_pass;
4700
4700
  uniform vec2 resolution;
@@ -4719,8 +4719,8 @@ void main() {
4719
4719
  squared_mean = squared_mean * HALF_SAMPLE_RATE;
4720
4720
  float std_dev = sqrt( squared_mean - mean * mean );
4721
4721
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
4722
- }`}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new Xt;g.setAttribute("position",new gn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new En(g,p),y=this;function w(X,H){const q=e.update(_);p.uniforms.shadow_pass.value=X.map.texture,p.uniforms.resolution.value=X.mapSize,p.uniforms.radius.value=X.radius,i.setRenderTarget(X.mapPass),i.clear(),i.renderBufferDirect(H,null,q,p,_,null),m.uniforms.shadow_pass.value=X.mapPass.texture,m.uniforms.resolution.value=X.mapSize,m.uniforms.radius.value=X.radius,i.setRenderTarget(X.map),i.clear(),i.renderBufferDirect(H,null,q,m,_,null)}function P(X){const H=X<<0;let q=a[H];return q===void 0&&(q=new bn({depthPacking:Xc,morphTargets:X}),a[H]=q),q}function B(X){const H=X<<0;let q=l[H];return q===void 0&&(q=new Oh({morphTargets:X}),l[H]=q),q}function G(X,H,q,me,ue,oe,ce){let le=null,_e=P,je=X.customDepthMaterial;if(me.isPointLight===!0&&(_e=B,je=X.customDistanceMaterial),je===void 0){let ke=!1;q.morphTargets===!0&&(ke=H.morphAttributes&&H.morphAttributes.position&&H.morphAttributes.position.length>0),le=_e(ke)}else le=je;if(i.localClippingEnabled&&q.clipShadows===!0&&q.clippingPlanes.length!==0){const ke=le.uuid,Ee=q.uuid;let Ae=u[ke];Ae===void 0&&(Ae={},u[ke]=Ae);let Je=Ae[Ee];Je===void 0&&(Je=le.clone(),Ae[Ee]=Je),le=Je}return le.visible=q.visible,le.wireframe=q.wireframe,le.side=ce===C?q.shadowSide!==null?q.shadowSide:q.side:q.shadowSide!==null?q.shadowSide:d[q.side],le.clipShadows=q.clipShadows,le.clippingPlanes=q.clippingPlanes,le.clipIntersection=q.clipIntersection,le.wireframeLinewidth=q.wireframeLinewidth,le.linewidth=q.linewidth,me.isPointLight===!0&&le.isMeshDistanceMaterial===!0&&(le.referencePosition.setFromMatrixPosition(me.matrixWorld),le.nearDistance=ue,le.farDistance=oe),le}function U(X,H,q,me,ue){if(X.visible===!1)return;if(X.layers.test(H.layers)&&(X.isMesh||X.isLine||X.isPoints)&&(X.castShadow||X.receiveShadow&&ue===C)&&(!X.frustumCulled||n.intersectsObject(X))){X.modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,X.matrixWorld);const ce=e.update(X),le=X.material;if(Array.isArray(le)){const _e=ce.groups;for(let je=0,ke=_e.length;je<ke;je++){const Ee=_e[je],Ae=le[Ee.materialIndex];if(Ae&&Ae.visible){const Je=G(X,ce,Ae,me,q.near,q.far,ue);i.renderBufferDirect(q,null,ce,Je,X,Ee)}}}else if(le.visible){const _e=G(X,ce,le,me,q.near,q.far,ue);i.renderBufferDirect(q,null,ce,_e,X,null)}}const oe=X.children;for(let ce=0,le=oe.length;ce<le;ce++)U(oe[ce],H,q,me,ue)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=D,this.render=function(X,H,q){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||X.length===0)return;const me=i.getRenderTarget(),ue=i.getActiveCubeFace(),oe=i.getActiveMipmapLevel(),ce=i.state;ce.setBlending(Pe),ce.buffers.color.setClear(1,1,1,1),ce.buffers.depth.setTest(!0),ce.setScissorTest(!1);for(let le=0,_e=X.length;le<_e;le++){const je=X[le],ke=je.shadow;if(ke===void 0){console.warn("THREE.WebGLShadowMap:",je,"has no shadow.");continue}if(ke.autoUpdate===!1&&ke.needsUpdate===!1)continue;r.copy(ke.mapSize);const Ee=ke.getFrameExtents();if(r.multiply(Ee),o.copy(ke.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(o.x=Math.floor(h/Ee.x),r.x=o.x*Ee.x,ke.mapSize.x=o.x),r.y>h&&(o.y=Math.floor(h/Ee.y),r.y=o.y*Ee.y,ke.mapSize.y=o.y)),ke.map===null&&!ke.isPointLightShadow&&this.type===C){const Je={minFilter:Gn,magFilter:Gn,format:Tr};ke.map=new $r(r.x,r.y,Je),ke.map.texture.name=je.name+".shadowMap",ke.mapPass=new $r(r.x,r.y,Je),ke.camera.updateProjectionMatrix()}if(ke.map===null){const Je={minFilter:Gt,magFilter:Gt,format:Tr};ke.map=new $r(r.x,r.y,Je),ke.map.texture.name=je.name+".shadowMap",ke.camera.updateProjectionMatrix()}i.setRenderTarget(ke.map),i.clear();const Ae=ke.getViewportCount();for(let Je=0;Je<Ae;Je++){const st=ke.getViewport(Je);s.set(o.x*st.x,o.y*st.y,o.x*st.z,o.y*st.w),ce.viewport(s),ke.updateMatrices(je,Je),n=ke.getFrustum(),U(H,q,ke.camera,je,this.type)}ke.isPointLightShadow||this.type!==C||w(ke,q),ke.needsUpdate=!1}y.needsUpdate=!1,i.setRenderTarget(me,ue,oe)}}function Lh(i,e,t){const n=t.isWebGL2,r=new function(){let re=!1;const Te=new Bn;let Ge=null;const He=new Bn(0,0,0,0);return{setMask:function(Oe){Ge===Oe||re||(i.colorMask(Oe,Oe,Oe,Oe),Ge=Oe)},setLocked:function(Oe){re=Oe},setClear:function(Oe,et,Ct,It,Pt){Pt===!0&&(Oe*=It,et*=It,Ct*=It),Te.set(Oe,et,Ct,It),He.equals(Te)===!1&&(i.clearColor(Oe,et,Ct,It),He.copy(Te))},reset:function(){re=!1,Ge=null,He.set(-1,0,0,0)}}},o=new function(){let re=!1,Te=null,Ge=null,He=null;return{setTest:function(Oe){Oe?ct(2929):he(2929)},setMask:function(Oe){Te===Oe||re||(i.depthMask(Oe),Te=Oe)},setFunc:function(Oe){if(Ge!==Oe){if(Oe)switch(Oe){case jn:i.depthFunc(512);break;case An:i.depthFunc(519);break;case In:i.depthFunc(513);break;case di:i.depthFunc(515);break;case Ln:i.depthFunc(514);break;case Di:i.depthFunc(518);break;case pi:i.depthFunc(516);break;case uo:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);Ge=Oe}},setLocked:function(Oe){re=Oe},setClear:function(Oe){He!==Oe&&(i.clearDepth(Oe),He=Oe)},reset:function(){re=!1,Te=null,Ge=null,He=null}}},s=new function(){let re=!1,Te=null,Ge=null,He=null,Oe=null,et=null,Ct=null,It=null,Pt=null;return{setTest:function(hn){re||(hn?ct(2960):he(2960))},setMask:function(hn){Te===hn||re||(i.stencilMask(hn),Te=hn)},setFunc:function(hn,Ei,kn){Ge===hn&&He===Ei&&Oe===kn||(i.stencilFunc(hn,Ei,kn),Ge=hn,He=Ei,Oe=kn)},setOp:function(hn,Ei,kn){et===hn&&Ct===Ei&&It===kn||(i.stencilOp(hn,Ei,kn),et=hn,Ct=Ei,It=kn)},setLocked:function(hn){re=hn},setClear:function(hn){Pt!==hn&&(i.clearStencil(hn),Pt=hn)},reset:function(){re=!1,Te=null,Ge=null,He=null,Oe=null,et=null,Ct=null,It=null,Pt=null}}};let a={},l=null,u={},h=null,d=!1,p=null,m=null,g=null,_=null,y=null,w=null,P=null,B=!1,G=null,U=null,X=null,H=null,q=null;const me=i.getParameter(35661);let ue=!1,oe=0;const ce=i.getParameter(7938);ce.indexOf("WebGL")!==-1?(oe=parseFloat(/^WebGL (\d)/.exec(ce)[1]),ue=oe>=1):ce.indexOf("OpenGL ES")!==-1&&(oe=parseFloat(/^OpenGL ES (\d)/.exec(ce)[1]),ue=oe>=2);let le=null,_e={};const je=i.getParameter(3088),ke=i.getParameter(2978),Ee=new Bn().fromArray(je),Ae=new Bn().fromArray(ke);function Je(re,Te,Ge){const He=new Uint8Array(4),Oe=i.createTexture();i.bindTexture(re,Oe),i.texParameteri(re,10241,9728),i.texParameteri(re,10240,9728);for(let et=0;et<Ge;et++)i.texImage2D(Te+et,0,6408,1,1,0,6408,5121,He);return Oe}const st={};function ct(re){a[re]!==!0&&(i.enable(re),a[re]=!0)}function he(re){a[re]!==!1&&(i.disable(re),a[re]=!1)}st[3553]=Je(3553,3553,1),st[34067]=Je(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),ct(2929),o.setFunc(di),ze(!1),dt(Re),ct(2884),Ve(Pe);const de={[Ce]:32774,[Le]:32778,[Ne]:32779};if(n)de[$e]=32775,de[Qe]=32776;else{const re=e.get("EXT_blend_minmax");re!==null&&(de[$e]=re.MIN_EXT,de[Qe]=re.MAX_EXT)}const Ke={[bt]:0,[vt]:1,[ln]:768,[Wt]:770,[Mn]:776,[Dn]:774,[rn]:772,[wt]:769,[qt]:771,[Fn]:775,[Bt]:773};function Ve(re,Te,Ge,He,Oe,et,Ct,It){if(re!==Pe){if(d===!1&&(ct(3042),d=!0),re===ye)Oe=Oe||Te,et=et||Ge,Ct=Ct||He,Te===m&&Oe===y||(i.blendEquationSeparate(de[Te],de[Oe]),m=Te,y=Oe),Ge===g&&He===_&&et===w&&Ct===P||(i.blendFuncSeparate(Ke[Ge],Ke[He],Ke[et],Ke[Ct]),g=Ge,_=He,w=et,P=Ct),p=re,B=null;else if(re!==p||It!==B){if(m===Ce&&y===Ce||(i.blendEquation(32774),m=Ce,y=Ce),It)switch(re){case ae:i.blendFuncSeparate(1,771,1,771);break;case Me:i.blendFunc(1,1);break;case De:i.blendFuncSeparate(0,0,769,771);break;case W:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",re)}else switch(re){case ae:i.blendFuncSeparate(770,771,1,771);break;case Me:i.blendFunc(770,1);break;case De:i.blendFunc(0,769);break;case W:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",re)}g=null,_=null,w=null,P=null,p=re,B=It}}else d===!0&&(he(3042),d=!1)}function ze(re){G!==re&&(re?i.frontFace(2304):i.frontFace(2305),G=re)}function dt(re){re!==xe?(ct(2884),re!==U&&(re===Re?i.cullFace(1029):re===Ie?i.cullFace(1028):i.cullFace(1032))):he(2884),U=re}function pt(re,Te,Ge){re?(ct(32823),H===Te&&q===Ge||(i.polygonOffset(Te,Ge),H=Te,q=Ge)):he(32823)}function Ze(re){re===void 0&&(re=33984+me-1),le!==re&&(i.activeTexture(re),le=re)}return{buffers:{color:r,depth:o,stencil:s},enable:ct,disable:he,bindFramebuffer:function(re,Te){return Te===null&&l!==null&&(Te=l),u[re]!==Te&&(i.bindFramebuffer(re,Te),u[re]=Te,n&&(re===36009&&(u[36160]=Te),re===36160&&(u[36009]=Te)),!0)},bindXRFramebuffer:function(re){re!==l&&(i.bindFramebuffer(36160,re),l=re)},useProgram:function(re){return h!==re&&(i.useProgram(re),h=re,!0)},setBlending:Ve,setMaterial:function(re,Te){re.side===ne?he(2884):ct(2884);let Ge=re.side===V;Te&&(Ge=!Ge),ze(Ge),re.blending===ae&&re.transparent===!1?Ve(Pe):Ve(re.blending,re.blendEquation,re.blendSrc,re.blendDst,re.blendEquationAlpha,re.blendSrcAlpha,re.blendDstAlpha,re.premultipliedAlpha),o.setFunc(re.depthFunc),o.setTest(re.depthTest),o.setMask(re.depthWrite),r.setMask(re.colorWrite);const He=re.stencilWrite;s.setTest(He),He&&(s.setMask(re.stencilWriteMask),s.setFunc(re.stencilFunc,re.stencilRef,re.stencilFuncMask),s.setOp(re.stencilFail,re.stencilZFail,re.stencilZPass)),pt(re.polygonOffset,re.polygonOffsetFactor,re.polygonOffsetUnits),re.alphaToCoverage===!0?ct(32926):he(32926)},setFlipSided:ze,setCullFace:dt,setLineWidth:function(re){re!==X&&(ue&&i.lineWidth(re),X=re)},setPolygonOffset:pt,setScissorTest:function(re){re?ct(3089):he(3089)},activeTexture:Ze,bindTexture:function(re,Te){le===null&&Ze();let Ge=_e[le];Ge===void 0&&(Ge={type:void 0,texture:void 0},_e[le]=Ge),Ge.type===re&&Ge.texture===Te||(i.bindTexture(re,Te||st[re]),Ge.type=re,Ge.texture=Te)},unbindTexture:function(){const re=_e[le];re!==void 0&&re.type!==void 0&&(i.bindTexture(re.type,null),re.type=void 0,re.texture=void 0)},compressedTexImage2D:function(){try{i.compressedTexImage2D.apply(i,arguments)}catch(re){console.error("THREE.WebGLState:",re)}},texImage2D:function(){try{i.texImage2D.apply(i,arguments)}catch(re){console.error("THREE.WebGLState:",re)}},texImage3D:function(){try{i.texImage3D.apply(i,arguments)}catch(re){console.error("THREE.WebGLState:",re)}},scissor:function(re){Ee.equals(re)===!1&&(i.scissor(re.x,re.y,re.z,re.w),Ee.copy(re))},viewport:function(re){Ae.equals(re)===!1&&(i.viewport(re.x,re.y,re.z,re.w),Ae.copy(re))},reset:function(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),n===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),a={},le=null,_e={},l=null,u={},h=null,d=!1,p=null,m=null,g=null,_=null,y=null,w=null,P=null,B=!1,G=null,U=null,X=null,H=null,q=null,Ee.set(0,0,i.canvas.width,i.canvas.height),Ae.set(0,0,i.canvas.width,i.canvas.height),r.reset(),o.reset(),s.reset()}}}function hv(i,e,t,n,r,o,s){const a=r.isWebGL2,l=r.maxTextures,u=r.maxCubemapSize,h=r.maxTextureSize,d=r.maxSamples,p=new WeakMap;let m,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(he,de){return g?new OffscreenCanvas(he,de):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(he,de,Ke,Ve){let ze=1;if((he.width>Ve||he.height>Ve)&&(ze=Ve/Math.max(he.width,he.height)),ze<1||de===!0){if(typeof HTMLImageElement!="undefined"&&he instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&he instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&he instanceof ImageBitmap){const dt=de?hh:Math.floor,pt=dt(ze*he.width),Ze=dt(ze*he.height);m===void 0&&(m=_(pt,Ze));const re=Ke?_(pt,Ze):m;return re.width=pt,re.height=Ze,re.getContext("2d").drawImage(he,0,0,pt,Ze),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+he.width+"x"+he.height+") to ("+pt+"x"+Ze+")."),re}return"data"in he&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+he.width+"x"+he.height+")."),he}return he}function w(he){return Fl(he.width)&&Fl(he.height)}function P(he,de){return he.generateMipmaps&&de&&he.minFilter!==Gt&&he.minFilter!==Gn}function B(he,de,Ke,Ve,ze=1){i.generateMipmap(he),n.get(de).__maxMipLevel=Math.log2(Math.max(Ke,Ve,ze))}function G(he,de,Ke){if(a===!1)return de;if(he!==null){if(i[he]!==void 0)return i[he];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+he+"'")}let Ve=de;return de===6403&&(Ke===5126&&(Ve=33326),Ke===5131&&(Ve=33325),Ke===5121&&(Ve=33321)),de===6407&&(Ke===5126&&(Ve=34837),Ke===5131&&(Ve=34843),Ke===5121&&(Ve=32849)),de===6408&&(Ke===5126&&(Ve=34836),Ke===5131&&(Ve=34842),Ke===5121&&(Ve=32856)),Ve!==33325&&Ve!==33326&&Ve!==34842&&Ve!==34836||e.get("EXT_color_buffer_float"),Ve}function U(he){return he===Gt||he===fi||he===Po?9728:9729}function X(he){const de=he.target;de.removeEventListener("dispose",X),function(Ke){const Ve=n.get(Ke);Ve.__webglInit!==void 0&&(i.deleteTexture(Ve.__webglTexture),n.remove(Ke))}(de),de.isVideoTexture&&p.delete(de),s.memory.textures--}function H(he){const de=he.target;de.removeEventListener("dispose",H),function(Ke){const Ve=Ke.texture,ze=n.get(Ke),dt=n.get(Ve);if(!!Ke){if(dt.__webglTexture!==void 0&&(i.deleteTexture(dt.__webglTexture),s.memory.textures--),Ke.depthTexture&&Ke.depthTexture.dispose(),Ke.isWebGLCubeRenderTarget)for(let pt=0;pt<6;pt++)i.deleteFramebuffer(ze.__webglFramebuffer[pt]),ze.__webglDepthbuffer&&i.deleteRenderbuffer(ze.__webglDepthbuffer[pt]);else i.deleteFramebuffer(ze.__webglFramebuffer),ze.__webglDepthbuffer&&i.deleteRenderbuffer(ze.__webglDepthbuffer),ze.__webglMultisampledFramebuffer&&i.deleteFramebuffer(ze.__webglMultisampledFramebuffer),ze.__webglColorRenderbuffer&&i.deleteRenderbuffer(ze.__webglColorRenderbuffer),ze.__webglDepthRenderbuffer&&i.deleteRenderbuffer(ze.__webglDepthRenderbuffer);if(Ke.isWebGLMultipleRenderTargets)for(let pt=0,Ze=Ve.length;pt<Ze;pt++){const re=n.get(Ve[pt]);re.__webglTexture&&(i.deleteTexture(re.__webglTexture),s.memory.textures--),n.remove(Ve[pt])}n.remove(Ve),n.remove(Ke)}}(de)}let q=0;function me(he,de){const Ke=n.get(he);if(he.isVideoTexture&&function(Ve){const ze=s.render.frame;p.get(Ve)!==ze&&(p.set(Ve,ze),Ve.update())}(he),he.version>0&&Ke.__version!==he.version){const Ve=he.image;if(Ve===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Ve.complete!==!1)return void je(Ke,he,de);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}t.activeTexture(33984+de),t.bindTexture(3553,Ke.__webglTexture)}function ue(he,de){const Ke=n.get(he);he.version>0&&Ke.__version!==he.version?function(Ve,ze,dt){if(ze.image.length!==6)return;_e(Ve,ze),t.activeTexture(33984+dt),t.bindTexture(34067,Ve.__webglTexture),i.pixelStorei(37440,ze.flipY),i.pixelStorei(37441,ze.premultiplyAlpha),i.pixelStorei(3317,ze.unpackAlignment),i.pixelStorei(37443,0);const pt=ze&&(ze.isCompressedTexture||ze.image[0].isCompressedTexture),Ze=ze.image[0]&&ze.image[0].isDataTexture,re=[];for(let It=0;It<6;It++)re[It]=pt||Ze?Ze?ze.image[It].image:ze.image[It]:y(ze.image[It],!1,!0,u);const Te=re[0],Ge=w(Te)||a,He=o.convert(ze.format),Oe=o.convert(ze.type),et=G(ze.internalFormat,He,Oe);let Ct;if(le(34067,ze,Ge),pt){for(let It=0;It<6;It++){Ct=re[It].mipmaps;for(let Pt=0;Pt<Ct.length;Pt++){const hn=Ct[Pt];ze.format!==Tr&&ze.format!==Oo?He!==null?t.compressedTexImage2D(34069+It,Pt,et,hn.width,hn.height,0,hn.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+It,Pt,et,hn.width,hn.height,0,He,Oe,hn.data)}}Ve.__maxMipLevel=Ct.length-1}else{Ct=ze.mipmaps;for(let It=0;It<6;It++)if(Ze){t.texImage2D(34069+It,0,et,re[It].width,re[It].height,0,He,Oe,re[It].data);for(let Pt=0;Pt<Ct.length;Pt++){const hn=Ct[Pt].image[It].image;t.texImage2D(34069+It,Pt+1,et,hn.width,hn.height,0,He,Oe,hn.data)}}else{t.texImage2D(34069+It,0,et,He,Oe,re[It]);for(let Pt=0;Pt<Ct.length;Pt++){const hn=Ct[Pt];t.texImage2D(34069+It,Pt+1,et,He,Oe,hn.image[It])}}Ve.__maxMipLevel=Ct.length}P(ze,Ge)&&B(34067,ze,Te.width,Te.height),Ve.__version=ze.version,ze.onUpdate&&ze.onUpdate(ze)}(Ke,he,de):(t.activeTexture(33984+de),t.bindTexture(34067,Ke.__webglTexture))}const oe={[ht]:10497,[xt]:33071,[Ot]:33648},ce={[Gt]:9728,[fi]:9984,[Po]:9986,[Gn]:9729,[os]:9985,[zs]:9987};function le(he,de,Ke){if(Ke?(i.texParameteri(he,10242,oe[de.wrapS]),i.texParameteri(he,10243,oe[de.wrapT]),he!==32879&&he!==35866||i.texParameteri(he,32882,oe[de.wrapR]),i.texParameteri(he,10240,ce[de.magFilter]),i.texParameteri(he,10241,ce[de.minFilter])):(i.texParameteri(he,10242,33071),i.texParameteri(he,10243,33071),he!==32879&&he!==35866||i.texParameteri(he,32882,33071),de.wrapS===xt&&de.wrapT===xt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(he,10240,U(de.magFilter)),i.texParameteri(he,10241,U(de.minFilter)),de.minFilter!==Gt&&de.minFilter!==Gn&&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 Ve=e.get("EXT_texture_filter_anisotropic");if(de.type===Io&&e.has("OES_texture_float_linear")===!1||a===!1&&de.type===Vs&&e.has("OES_texture_half_float_linear")===!1)return;(de.anisotropy>1||n.get(de).__currentAnisotropy)&&(i.texParameterf(he,Ve.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(de.anisotropy,r.getMaxAnisotropy())),n.get(de).__currentAnisotropy=de.anisotropy)}}function _e(he,de){he.__webglInit===void 0&&(he.__webglInit=!0,de.addEventListener("dispose",X),he.__webglTexture=i.createTexture(),s.memory.textures++)}function je(he,de,Ke){let Ve=3553;de.isDataTexture2DArray&&(Ve=35866),de.isDataTexture3D&&(Ve=32879),_e(he,de),t.activeTexture(33984+Ke),t.bindTexture(Ve,he.__webglTexture),i.pixelStorei(37440,de.flipY),i.pixelStorei(37441,de.premultiplyAlpha),i.pixelStorei(3317,de.unpackAlignment),i.pixelStorei(37443,0);const ze=function(Oe){return!a&&(Oe.wrapS!==xt||Oe.wrapT!==xt||Oe.minFilter!==Gt&&Oe.minFilter!==Gn)}(de)&&w(de.image)===!1,dt=y(de.image,ze,!1,h),pt=w(dt)||a,Ze=o.convert(de.format);let re,Te=o.convert(de.type),Ge=G(de.internalFormat,Ze,Te);le(Ve,de,pt);const He=de.mipmaps;if(de.isDepthTexture)Ge=6402,a?Ge=de.type===Io?36012:de.type===js?33190:de.type===Nn?35056:33189:de.type===Io&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),de.format===ti&&Ge===6402&&de.type!==Al&&de.type!==js&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),de.type=Al,Te=o.convert(de.type)),de.format===Ws&&Ge===6402&&(Ge=34041,de.type!==Nn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),de.type=Nn,Te=o.convert(de.type))),t.texImage2D(3553,0,Ge,dt.width,dt.height,0,Ze,Te,null);else if(de.isDataTexture)if(He.length>0&&pt){for(let Oe=0,et=He.length;Oe<et;Oe++)re=He[Oe],t.texImage2D(3553,Oe,Ge,re.width,re.height,0,Ze,Te,re.data);de.generateMipmaps=!1,he.__maxMipLevel=He.length-1}else t.texImage2D(3553,0,Ge,dt.width,dt.height,0,Ze,Te,dt.data),he.__maxMipLevel=0;else if(de.isCompressedTexture){for(let Oe=0,et=He.length;Oe<et;Oe++)re=He[Oe],de.format!==Tr&&de.format!==Oo?Ze!==null?t.compressedTexImage2D(3553,Oe,Ge,re.width,re.height,0,re.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,Oe,Ge,re.width,re.height,0,Ze,Te,re.data);he.__maxMipLevel=He.length-1}else if(de.isDataTexture2DArray)t.texImage3D(35866,0,Ge,dt.width,dt.height,dt.depth,0,Ze,Te,dt.data),he.__maxMipLevel=0;else if(de.isDataTexture3D)t.texImage3D(32879,0,Ge,dt.width,dt.height,dt.depth,0,Ze,Te,dt.data),he.__maxMipLevel=0;else if(He.length>0&&pt){for(let Oe=0,et=He.length;Oe<et;Oe++)re=He[Oe],t.texImage2D(3553,Oe,Ge,Ze,Te,re);de.generateMipmaps=!1,he.__maxMipLevel=He.length-1}else t.texImage2D(3553,0,Ge,Ze,Te,dt),he.__maxMipLevel=0;P(de,pt)&&B(Ve,de,dt.width,dt.height),he.__version=de.version,de.onUpdate&&de.onUpdate(de)}function ke(he,de,Ke,Ve,ze){const dt=o.convert(Ke.format),pt=o.convert(Ke.type),Ze=G(Ke.internalFormat,dt,pt);ze===32879||ze===35866?t.texImage3D(ze,0,Ze,de.width,de.height,de.depth,0,dt,pt,null):t.texImage2D(ze,0,Ze,de.width,de.height,0,dt,pt,null),t.bindFramebuffer(36160,he),i.framebufferTexture2D(36160,Ve,ze,n.get(Ke).__webglTexture,0),t.bindFramebuffer(36160,null)}function Ee(he,de,Ke){if(i.bindRenderbuffer(36161,he),de.depthBuffer&&!de.stencilBuffer){let Ve=33189;if(Ke){const ze=de.depthTexture;ze&&ze.isDepthTexture&&(ze.type===Io?Ve=36012:ze.type===js&&(Ve=33190));const dt=Je(de);i.renderbufferStorageMultisample(36161,dt,Ve,de.width,de.height)}else i.renderbufferStorage(36161,Ve,de.width,de.height);i.framebufferRenderbuffer(36160,36096,36161,he)}else if(de.depthBuffer&&de.stencilBuffer){if(Ke){const Ve=Je(de);i.renderbufferStorageMultisample(36161,Ve,35056,de.width,de.height)}else i.renderbufferStorage(36161,34041,de.width,de.height);i.framebufferRenderbuffer(36160,33306,36161,he)}else{const Ve=de.isWebGLMultipleRenderTargets===!0?de.texture[0]:de.texture,ze=o.convert(Ve.format),dt=o.convert(Ve.type),pt=G(Ve.internalFormat,ze,dt);if(Ke){const Ze=Je(de);i.renderbufferStorageMultisample(36161,Ze,pt,de.width,de.height)}else i.renderbufferStorage(36161,pt,de.width,de.height)}i.bindRenderbuffer(36161,null)}function Ae(he){const de=n.get(he),Ke=he.isWebGLCubeRenderTarget===!0;if(he.depthTexture){if(Ke)throw new Error("target.depthTexture not supported in Cube render targets");(function(Ve,ze){if(ze&&ze.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,Ve),!ze.depthTexture||!ze.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(ze.depthTexture).__webglTexture&&ze.depthTexture.image.width===ze.width&&ze.depthTexture.image.height===ze.height||(ze.depthTexture.image.width=ze.width,ze.depthTexture.image.height=ze.height,ze.depthTexture.needsUpdate=!0),me(ze.depthTexture,0);const dt=n.get(ze.depthTexture).__webglTexture;if(ze.depthTexture.format===ti)i.framebufferTexture2D(36160,36096,3553,dt,0);else{if(ze.depthTexture.format!==Ws)throw new Error("Unknown depthTexture format");i.framebufferTexture2D(36160,33306,3553,dt,0)}})(de.__webglFramebuffer,he)}else if(Ke){de.__webglDepthbuffer=[];for(let Ve=0;Ve<6;Ve++)t.bindFramebuffer(36160,de.__webglFramebuffer[Ve]),de.__webglDepthbuffer[Ve]=i.createRenderbuffer(),Ee(de.__webglDepthbuffer[Ve],he,!1)}else t.bindFramebuffer(36160,de.__webglFramebuffer),de.__webglDepthbuffer=i.createRenderbuffer(),Ee(de.__webglDepthbuffer,he,!1);t.bindFramebuffer(36160,null)}function Je(he){return a&&he.isWebGLMultisampleRenderTarget?Math.min(d,he.samples):0}let st=!1,ct=!1;this.allocateTextureUnit=function(){const he=q;return he>=l&&console.warn("THREE.WebGLTextures: Trying to use "+he+" texture units while this GPU supports only "+l),q+=1,he},this.resetTextureUnits=function(){q=0},this.setTexture2D=me,this.setTexture2DArray=function(he,de){const Ke=n.get(he);he.version>0&&Ke.__version!==he.version?je(Ke,he,de):(t.activeTexture(33984+de),t.bindTexture(35866,Ke.__webglTexture))},this.setTexture3D=function(he,de){const Ke=n.get(he);he.version>0&&Ke.__version!==he.version?je(Ke,he,de):(t.activeTexture(33984+de),t.bindTexture(32879,Ke.__webglTexture))},this.setTextureCube=ue,this.setupRenderTarget=function(he){const de=he.texture,Ke=n.get(he),Ve=n.get(de);he.addEventListener("dispose",H),he.isWebGLMultipleRenderTargets!==!0&&(Ve.__webglTexture=i.createTexture(),Ve.__version=de.version,s.memory.textures++);const ze=he.isWebGLCubeRenderTarget===!0,dt=he.isWebGLMultipleRenderTargets===!0,pt=he.isWebGLMultisampleRenderTarget===!0,Ze=de.isDataTexture3D||de.isDataTexture2DArray,re=w(he)||a;if(!a||de.format!==Oo||de.type!==Io&&de.type!==Vs||(de.format=Tr,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),ze){Ke.__webglFramebuffer=[];for(let Te=0;Te<6;Te++)Ke.__webglFramebuffer[Te]=i.createFramebuffer()}else if(Ke.__webglFramebuffer=i.createFramebuffer(),dt)if(r.drawBuffers){const Te=he.texture;for(let Ge=0,He=Te.length;Ge<He;Ge++){const Oe=n.get(Te[Ge]);Oe.__webglTexture===void 0&&(Oe.__webglTexture=i.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(pt)if(a){Ke.__webglMultisampledFramebuffer=i.createFramebuffer(),Ke.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,Ke.__webglColorRenderbuffer);const Te=o.convert(de.format),Ge=o.convert(de.type),He=G(de.internalFormat,Te,Ge),Oe=Je(he);i.renderbufferStorageMultisample(36161,Oe,He,he.width,he.height),t.bindFramebuffer(36160,Ke.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,Ke.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),he.depthBuffer&&(Ke.__webglDepthRenderbuffer=i.createRenderbuffer(),Ee(Ke.__webglDepthRenderbuffer,he,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ze){t.bindTexture(34067,Ve.__webglTexture),le(34067,de,re);for(let Te=0;Te<6;Te++)ke(Ke.__webglFramebuffer[Te],he,de,36064,34069+Te);P(de,re)&&B(34067,de,he.width,he.height),t.bindTexture(34067,null)}else if(dt){const Te=he.texture;for(let Ge=0,He=Te.length;Ge<He;Ge++){const Oe=Te[Ge],et=n.get(Oe);t.bindTexture(3553,et.__webglTexture),le(3553,Oe,re),ke(Ke.__webglFramebuffer,he,Oe,36064+Ge,3553),P(Oe,re)&&B(3553,Oe,he.width,he.height)}t.bindTexture(3553,null)}else{let Te=3553;Ze&&(a?Te=de.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(Te,Ve.__webglTexture),le(Te,de,re),ke(Ke.__webglFramebuffer,he,de,36064,Te),P(de,re)&&B(Te,de,he.width,he.height,he.depth),t.bindTexture(Te,null)}he.depthBuffer&&Ae(he)},this.updateRenderTargetMipmap=function(he){const de=w(he)||a,Ke=he.isWebGLMultipleRenderTargets===!0?he.texture:[he.texture];for(let Ve=0,ze=Ke.length;Ve<ze;Ve++){const dt=Ke[Ve];if(P(dt,de)){const pt=he.isWebGLCubeRenderTarget?34067:3553,Ze=n.get(dt).__webglTexture;t.bindTexture(pt,Ze),B(pt,dt,he.width,he.height),t.bindTexture(pt,null)}}},this.updateMultisampleRenderTarget=function(he){if(he.isWebGLMultisampleRenderTarget)if(a){const de=he.width,Ke=he.height;let Ve=16384;he.depthBuffer&&(Ve|=256),he.stencilBuffer&&(Ve|=1024);const ze=n.get(he);t.bindFramebuffer(36008,ze.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,ze.__webglFramebuffer),i.blitFramebuffer(0,0,de,Ke,0,0,de,Ke,Ve,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,ze.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(he,de){he&&he.isWebGLRenderTarget&&(st===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),st=!0),he=he.texture),me(he,de)},this.safeSetTextureCube=function(he,de){he&&he.isWebGLCubeRenderTarget&&(ct===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),ct=!0),he=he.texture),ue(he,de)}}function Hf(i,e,t){const n=t.isWebGL2;return{convert:function(r){let o;if(r===ss)return 5121;if(r===Hp)return 32819;if(r===zp)return 32820;if(r===jp)return 33635;if(r===Up)return 5120;if(r===kp)return 5122;if(r===Al)return 5123;if(r===Gp)return 5124;if(r===js)return 5125;if(r===Io)return 5126;if(r===Vs)return n?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(r===Hn)return 6406;if(r===Oo)return 6407;if(r===Tr)return 6408;if(r===Vp)return 6409;if(r===Pc)return 6410;if(r===ti)return 6402;if(r===Ws)return 34041;if(r===La)return 6403;if(r===Ic)return 36244;if(r===Gu)return 33319;if(r===Er)return 33320;if(r===Oc)return 36248;if(r===Lc)return 36249;if(r===Hu||r===zu||r===ju||r===Vu){if(o=e.get("WEBGL_compressed_texture_s3tc"),o===null)return null;if(r===Hu)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===zu)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===ju)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Vu)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===ir||r===Nc||r===hr||r===Dc){if(o=e.get("WEBGL_compressed_texture_pvrtc"),o===null)return null;if(r===ir)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Nc)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===hr)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Dc)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===Fc)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===co||r===Na)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(r===co)return o.COMPRESSED_RGB8_ETC2;if(r===Na)return o.COMPRESSED_RGBA8_ETC2_EAC}return r===Wu||r===Vn||r===Lo||r===Xu||r===Xp||r===qu||r===qp||r===Bc||r===Rl||r===Xs||r===Yp||r===Uc||r===kc||r===Yu||r===Gc||r===Ju||r===Zu||r===Hc||r===cr||r===Ku||r===Da||r===zc||r===jc||r===$p||r===Jp||r===Zp||r===Kp||r===qs?(o=e.get("WEBGL_compressed_texture_astc"),o!==null?r:null):r===$u?(o=e.get("EXT_texture_compression_bptc"),o!==null?r:null):r===Nn?n?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class Rd extends vi{constructor(e=[]){super(),this.cameras=e}}Rd.prototype.isArrayCamera=!0;class da extends pn{constructor(){super(),this.type="Group"}}da.prototype.isGroup=!0;const Cd={type:"move"};class Zl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new da,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 da,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new S,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new S),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new da,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new S,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new S),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 r=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&&(r=t.getPose(e.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Cd))),u&&e.hand){s=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,n);if(u.joints[_.jointName]===void 0){const P=new da;P.matrixAutoUpdate=!1,P.visible=!1,u.joints[_.jointName]=P,u.add(P)}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 h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,g=.005;u.inputState.pinching&&p>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=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=r!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}}class cv extends Fo{constructor(e,t){super();const n=this,r=e.state;let o=null,s=1,a=null,l="local-floor",u=null,h=null,d=null,p=null;const m=[],g=new Map,_=new vi;_.layers.enable(1),_.viewport=new Bn;const y=new vi;y.layers.enable(2),y.viewport=new Bn;const w=[_,y],P=new Rd;P.layers.enable(1),P.layers.enable(2);let B=null,G=null;function U(le){const _e=g.get(le.inputSource);_e&&_e.dispatchEvent({type:le.type,data:le.inputSource})}function X(){g.forEach(function(le,_e){le.disconnect(_e)}),g.clear(),B=null,G=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),ce.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function H(le){const _e=o.inputSources;for(let je=0;je<m.length;je++)g.set(_e[je],m[je]);for(let je=0;je<le.removed.length;je++){const ke=le.removed[je],Ee=g.get(ke);Ee&&(Ee.dispatchEvent({type:"disconnected",data:ke}),g.delete(ke))}for(let je=0;je<le.added.length;je++){const ke=le.added[je],Ee=g.get(ke);Ee&&Ee.dispatchEvent({type:"connected",data:ke})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let _e=m[le];return _e===void 0&&(_e=new Zl,m[le]=_e),_e.getTargetRaySpace()},this.getControllerGrip=function(le){let _e=m[le];return _e===void 0&&(_e=new Zl,m[le]=_e),_e.getGripSpace()},this.getHand=function(le){let _e=m[le];return _e===void 0&&(_e=new Zl,m[le]=_e),_e.getHandSpace()},this.setFramebufferScaleFactor=function(le){s=le,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(le){l=le,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(le){if(o=le,o!==null){o.addEventListener("select",U),o.addEventListener("selectstart",U),o.addEventListener("selectend",U),o.addEventListener("squeeze",U),o.addEventListener("squeezestart",U),o.addEventListener("squeezeend",U),o.addEventListener("end",X),o.addEventListener("inputsourceschange",H);const _e=t.getContextAttributes();if(_e.xrCompatible!==!0&&await t.makeXRCompatible(),o.renderState.layers===void 0){const je={antialias:_e.antialias,alpha:_e.alpha,depth:_e.depth,stencil:_e.stencil,framebufferScaleFactor:s},ke=new XRWebGLLayer(o,t,je);o.updateRenderState({baseLayer:ke})}else{let je=0;_e.depth&&(je=_e.stencil?34041:6402);const ke={colorFormat:_e.alpha?6408:6407,depthFormat:je,scaleFactor:s};h=new XRWebGLBinding(o,t),p=h.createProjectionLayer(ke),d=t.createFramebuffer(),o.updateRenderState({layers:[p]})}a=await o.requestReferenceSpace(l),ce.setContext(o),ce.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const q=new S,me=new S;function ue(le,_e){_e===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(_e.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(o===null)return;P.near=y.near=_.near=le.near,P.far=y.far=_.far=le.far,B===P.near&&G===P.far||(o.updateRenderState({depthNear:P.near,depthFar:P.far}),B=P.near,G=P.far);const _e=le.parent,je=P.cameras;ue(P,_e);for(let Ee=0;Ee<je.length;Ee++)ue(je[Ee],_e);P.matrixWorld.decompose(P.position,P.quaternion,P.scale),le.position.copy(P.position),le.quaternion.copy(P.quaternion),le.scale.copy(P.scale),le.matrix.copy(P.matrix),le.matrixWorld.copy(P.matrixWorld);const ke=le.children;for(let Ee=0,Ae=ke.length;Ee<Ae;Ee++)ke[Ee].updateMatrixWorld(!0);je.length===2?function(Ee,Ae,Je){q.setFromMatrixPosition(Ae.matrixWorld),me.setFromMatrixPosition(Je.matrixWorld);const st=q.distanceTo(me),ct=Ae.projectionMatrix.elements,he=Je.projectionMatrix.elements,de=ct[14]/(ct[10]-1),Ke=ct[14]/(ct[10]+1),Ve=(ct[9]+1)/ct[5],ze=(ct[9]-1)/ct[5],dt=(ct[8]-1)/ct[0],pt=(he[8]+1)/he[0],Ze=de*dt,re=de*pt,Te=st/(-dt+pt),Ge=Te*-dt;Ae.matrixWorld.decompose(Ee.position,Ee.quaternion,Ee.scale),Ee.translateX(Ge),Ee.translateZ(Te),Ee.matrixWorld.compose(Ee.position,Ee.quaternion,Ee.scale),Ee.matrixWorldInverse.copy(Ee.matrixWorld).invert();const He=de+Te,Oe=Ke+Te,et=Ze-Ge,Ct=re+(st-Ge),It=Ve*Ke/Oe*He,Pt=ze*Ke/Oe*He;Ee.projectionMatrix.makePerspective(et,Ct,It,Pt,He,Oe)}(P,_,y):P.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return P};let oe=null;const ce=new pd;ce.setAnimationLoop(function(le,_e){if(u=_e.getViewerPose(a),u!==null){const ke=u.views,Ee=o.renderState.baseLayer;o.renderState.layers===void 0&&r.bindXRFramebuffer(Ee.framebuffer);let Ae=!1;ke.length!==P.cameras.length&&(P.cameras.length=0,Ae=!0);for(let Je=0;Je<ke.length;Je++){const st=ke[Je];let ct=null;if(o.renderState.layers===void 0)ct=Ee.getViewport(st);else{const de=h.getViewSubImage(p,st);r.bindXRFramebuffer(d),t.framebufferTexture2D(36160,36064,3553,de.colorTexture,0),de.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,de.depthStencilTexture,0),ct=de.viewport}const he=w[Je];he.matrix.fromArray(st.transform.matrix),he.projectionMatrix.fromArray(st.projectionMatrix),he.viewport.set(ct.x,ct.y,ct.width,ct.height),Je===0&&P.matrix.copy(he.matrix),Ae===!0&&P.cameras.push(he)}}const je=o.inputSources;for(let ke=0;ke<m.length;ke++){const Ee=m[ke],Ae=je[ke];Ee.update(Ae,_e,a)}oe&&oe(le,_e)}),this.setAnimationLoop=function(le){oe=le},this.dispose=function(){}}}function dv(i){function e(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.specularMap&&(n.specularMap.value=r.specularMap);const o=i.get(r).envMap;if(o){n.envMap.value=o,n.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,n.reflectivity.value=r.reflectivity,n.refractionRatio.value=r.refractionRatio;const l=i.get(o).__maxMipLevel;l!==void 0&&(n.maxMipLevel.value=l)}let s,a;r.lightMap&&(n.lightMap.value=r.lightMap,n.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?s=r.map:r.specularMap?s=r.specularMap:r.displacementMap?s=r.displacementMap:r.normalMap?s=r.normalMap:r.bumpMap?s=r.bumpMap:r.roughnessMap?s=r.roughnessMap:r.metalnessMap?s=r.metalnessMap:r.alphaMap?s=r.alphaMap:r.emissiveMap?s=r.emissiveMap:r.clearcoatMap?s=r.clearcoatMap:r.clearcoatNormalMap?s=r.clearcoatNormalMap:r.clearcoatRoughnessMap&&(s=r.clearcoatRoughnessMap),s!==void 0&&(s.isWebGLRenderTarget&&(s=s.texture),s.matrixAutoUpdate===!0&&s.updateMatrix(),n.uvTransform.value.copy(s.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function t(n,r){n.roughness.value=r.roughness,n.metalness.value=r.metalness,r.roughnessMap&&(n.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(n.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,r.side===V&&(n.bumpScale.value*=-1)),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),r.side===V&&n.normalScale.value.negate()),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),i.get(r).envMap&&(n.envMapIntensity.value=r.envMapIntensity)}return{refreshFogUniforms:function(n,r){n.fogColor.value.copy(r.color),r.isFog?(n.fogNear.value=r.near,n.fogFar.value=r.far):r.isFogExp2&&(n.fogDensity.value=r.density)},refreshMaterialUniforms:function(n,r,o,s,a){r.isMeshBasicMaterial?e(n,r):r.isMeshLambertMaterial?(e(n,r),function(l,u){u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap)}(n,r)):r.isMeshToonMaterial?(e(n,r),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===V&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===V&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isMeshPhongMaterial?(e(n,r),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===V&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===V&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isMeshStandardMaterial?(e(n,r),r.isMeshPhysicalMaterial?function(l,u,h){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===V&&l.clearcoatNormalScale.value.negate()),l.transmission.value=u.transmission,u.transmissionMap&&(l.transmissionMap.value=u.transmissionMap),u.transmission>0&&(l.transmissionSamplerMap.value=h.texture,l.transmissionSamplerSize.value.set(h.width,h.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,r,a):t(n,r)):r.isMeshMatcapMaterial?(e(n,r),function(l,u){u.matcap&&(l.matcap.value=u.matcap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===V&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===V&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isMeshDepthMaterial?(e(n,r),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isMeshDistanceMaterial?(e(n,r),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,r)):r.isMeshNormalMaterial?(e(n,r),function(l,u){u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===V&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===V&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isLineBasicMaterial?(function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity}(n,r),r.isLineDashedMaterial&&function(l,u){l.dashSize.value=u.dashSize,l.totalSize.value=u.dashSize+u.gapSize,l.scale.value=u.scale}(n,r)):r.isPointsMaterial?function(l,u,h,d){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.size.value=u.size*h,l.scale.value=.5*d,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let p;u.map?p=u.map:u.alphaMap&&(p=u.alphaMap),p!==void 0&&(p.matrixAutoUpdate===!0&&p.updateMatrix(),l.uvTransform.value.copy(p.matrix))}(n,r,o,s):r.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 h;u.map?h=u.map:u.alphaMap&&(h=u.alphaMap),h!==void 0&&(h.matrixAutoUpdate===!0&&h.updateMatrix(),l.uvTransform.value.copy(h.matrix))}(n,r):r.isShadowMaterial?(n.color.value.copy(r.color),n.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Un(i={}){const e=i.canvas!==void 0?i.canvas:function(){const ve=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return ve.style.display="block",ve}(),t=i.context!==void 0?i.context:null,n=i.alpha!==void 0&&i.alpha,r=i.depth===void 0||i.depth,o=i.stencil===void 0||i.stencil,s=i.antialias!==void 0&&i.antialias,a=i.premultipliedAlpha===void 0||i.premultipliedAlpha,l=i.preserveDrawingBuffer!==void 0&&i.preserveDrawingBuffer,u=i.powerPreference!==void 0?i.powerPreference:"default",h=i.failIfMajorPerformanceCaveat!==void 0&&i.failIfMajorPerformanceCaveat;let d=null,p=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=Ht,this.physicallyCorrectLights=!1,this.toneMapping=Sr,this.toneMappingExposure=1;const _=this;let y=!1,w=0,P=0,B=null,G=-1,U=null;const X=new Bn,H=new Bn;let q=null,me=e.width,ue=e.height,oe=1,ce=null,le=null;const _e=new Bn(0,0,me,ue),je=new Bn(0,0,me,ue);let ke=!1;const Ee=[],Ae=new Za;let Je=!1,st=!1,ct=null;const he=new Rt,de=new S,Ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ve(){return B===null?oe:1}let ze,dt,pt,Ze,re,Te,Ge,He,Oe,et,Ct,It,Pt,hn,Ei,kn,qr,Ep,Mp,Ap,Fr,Yr,yt=t;function XS(ve,it){for(let Xe=0;Xe<ve.length;Xe++){const ot=ve[Xe],St=e.getContext(ot,it);if(St!==null)return St}return null}try{const ve={alpha:n,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h};if(e.addEventListener("webglcontextlost",YS,!1),e.addEventListener("webglcontextrestored",$S,!1),yt===null){const it=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&it.shift(),yt=XS(it,ve),yt===null)throw XS(it)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}yt.getShaderPrecisionFormat===void 0&&(yt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ve){throw console.error("THREE.WebGLRenderer: "+ve.message),ve}function qS(){ze=new Bg(yt),dt=new pf(yt,ze,i),ze.init(dt),Fr=new Hf(yt,ze,dt),pt=new Lh(yt,ze,dt),Ee[0]=1029,Ze=new Yl(yt),re=new Ih,Te=new hv(yt,ze,pt,re,dt,Fr,Ze),Ge=new mf(_),He=new Dg(yt,dt),Yr=new ql(yt,ze,He,dt),Oe=new fd(yt,He,Ze,Yr),et=new Th(yt,Oe,He,Ze),Ep=new _f(yt),Ei=new ff(re),Ct=new Ff(_,Ge,ze,dt,Yr,Ei),It=new dv(re),Pt=new uv(re),hn=new Gf(ze,dt),qr=new Fg(_,Ge,pt,et,a),kn=new Ad(_,et,dt),Mp=new df(yt,ze,Ze,dt),Ap=new gf(yt,ze,Ze,dt),Ze.programs=Ct.programs,_.capabilities=dt,_.extensions=ze,_.properties=re,_.renderLists=Pt,_.shadowMap=kn,_.state=pt,_.info=Ze}qS();const oo=new cv(_,yt);function YS(ve){ve.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function $S(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const ve=Ze.autoReset,it=kn.enabled,Xe=kn.autoUpdate,ot=kn.needsUpdate,St=kn.type;qS(),Ze.autoReset=ve,kn.enabled=it,kn.autoUpdate=Xe,kn.needsUpdate=ot,kn.type=St}function JS(ve){const it=ve.target;it.removeEventListener("dispose",JS),function(Xe){(function(ot){const St=re.get(ot).programs;St!==void 0&&St.forEach(function(Pn){Ct.releaseProgram(Pn)})})(Xe),re.remove(Xe)}(it)}this.xr=oo,this.getContext=function(){return yt},this.getContextAttributes=function(){return yt.getContextAttributes()},this.forceContextLoss=function(){const ve=ze.get("WEBGL_lose_context");ve&&ve.loseContext()},this.forceContextRestore=function(){const ve=ze.get("WEBGL_lose_context");ve&&ve.restoreContext()},this.getPixelRatio=function(){return oe},this.setPixelRatio=function(ve){ve!==void 0&&(oe=ve,this.setSize(me,ue,!1))},this.getSize=function(ve){return ve.set(me,ue)},this.setSize=function(ve,it,Xe){oo.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(me=ve,ue=it,e.width=Math.floor(ve*oe),e.height=Math.floor(it*oe),Xe!==!1&&(e.style.width=ve+"px",e.style.height=it+"px"),this.setViewport(0,0,ve,it))},this.getDrawingBufferSize=function(ve){return ve.set(me*oe,ue*oe).floor()},this.setDrawingBufferSize=function(ve,it,Xe){me=ve,ue=it,oe=Xe,e.width=Math.floor(ve*Xe),e.height=Math.floor(it*Xe),this.setViewport(0,0,ve,it)},this.getCurrentViewport=function(ve){return ve.copy(X)},this.getViewport=function(ve){return ve.copy(_e)},this.setViewport=function(ve,it,Xe,ot){ve.isVector4?_e.set(ve.x,ve.y,ve.z,ve.w):_e.set(ve,it,Xe,ot),pt.viewport(X.copy(_e).multiplyScalar(oe).floor())},this.getScissor=function(ve){return ve.copy(je)},this.setScissor=function(ve,it,Xe,ot){ve.isVector4?je.set(ve.x,ve.y,ve.z,ve.w):je.set(ve,it,Xe,ot),pt.scissor(H.copy(je).multiplyScalar(oe).floor())},this.getScissorTest=function(){return ke},this.setScissorTest=function(ve){pt.setScissorTest(ke=ve)},this.setOpaqueSort=function(ve){ce=ve},this.setTransparentSort=function(ve){le=ve},this.getClearColor=function(ve){return ve.copy(qr.getClearColor())},this.setClearColor=function(){qr.setClearColor.apply(qr,arguments)},this.getClearAlpha=function(){return qr.getClearAlpha()},this.setClearAlpha=function(){qr.setClearAlpha.apply(qr,arguments)},this.clear=function(ve,it,Xe){let ot=0;(ve===void 0||ve)&&(ot|=16384),(it===void 0||it)&&(ot|=256),(Xe===void 0||Xe)&&(ot|=1024),yt.clear(ot)},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",YS,!1),e.removeEventListener("webglcontextrestored",$S,!1),Pt.dispose(),hn.dispose(),re.dispose(),Ge.dispose(),et.dispose(),Yr.dispose(),oo.dispose(),oo.removeEventListener("sessionstart",ZS),oo.removeEventListener("sessionend",KS),ct&&(ct.dispose(),ct=null),Bu.stop()},this.renderBufferImmediate=function(ve,it){Yr.initAttributes();const Xe=re.get(ve);ve.hasPositions&&!Xe.position&&(Xe.position=yt.createBuffer()),ve.hasNormals&&!Xe.normal&&(Xe.normal=yt.createBuffer()),ve.hasUvs&&!Xe.uv&&(Xe.uv=yt.createBuffer()),ve.hasColors&&!Xe.color&&(Xe.color=yt.createBuffer());const ot=it.getAttributes();ve.hasPositions&&(yt.bindBuffer(34962,Xe.position),yt.bufferData(34962,ve.positionArray,35048),Yr.enableAttribute(ot.position),yt.vertexAttribPointer(ot.position,3,5126,!1,0,0)),ve.hasNormals&&(yt.bindBuffer(34962,Xe.normal),yt.bufferData(34962,ve.normalArray,35048),Yr.enableAttribute(ot.normal),yt.vertexAttribPointer(ot.normal,3,5126,!1,0,0)),ve.hasUvs&&(yt.bindBuffer(34962,Xe.uv),yt.bufferData(34962,ve.uvArray,35048),Yr.enableAttribute(ot.uv),yt.vertexAttribPointer(ot.uv,2,5126,!1,0,0)),ve.hasColors&&(yt.bindBuffer(34962,Xe.color),yt.bufferData(34962,ve.colorArray,35048),Yr.enableAttribute(ot.color),yt.vertexAttribPointer(ot.color,3,5126,!1,0,0)),Yr.disableUnusedAttributes(),yt.drawArrays(4,0,ve.count),ve.count=0},this.renderBufferDirect=function(ve,it,Xe,ot,St,Pn){it===null&&(it=Ke);const cn=St.isMesh&&St.matrixWorld.determinant()<0,Et=tT(ve,it,ot,St);pt.setMaterial(ot,cn);let yn=Xe.index;const Zt=Xe.attributes.position;if(yn===null){if(Zt===void 0||Zt.count===0)return}else if(yn.count===0)return;let Sn,an=1;ot.wireframe===!0&&(yn=Oe.getWireframeAttribute(Xe),an=2),(ot.morphTargets||ot.morphNormals)&&Ep.update(St,Xe,ot,Et),Yr.setup(St,ot,Et,Xe,yn);let xn=Mp;yn!==null&&(Sn=He.get(yn),xn=Ap,xn.setIndex(Sn));const Hi=yn!==null?yn.count:Zt.count,ei=Xe.drawRange.start*an,rs=Xe.drawRange.count*an,Jn=Pn!==null?Pn.start*an:0,Us=Pn!==null?Pn.count*an:1/0,Yi=Math.max(ei,Jn),so=Math.min(Hi,ei+rs,Jn+Us)-1,wr=Math.max(0,so-Yi+1);if(wr!==0){if(St.isMesh)ot.wireframe===!0?(pt.setLineWidth(ot.wireframeLinewidth*Ve()),xn.setMode(1)):xn.setMode(4);else if(St.isLine){let Rp=ot.linewidth;Rp===void 0&&(Rp=1),pt.setLineWidth(Rp*Ve()),St.isLineSegments?xn.setMode(1):St.isLineLoop?xn.setMode(2):xn.setMode(3)}else St.isPoints?xn.setMode(0):St.isSprite&&xn.setMode(4);if(St.isInstancedMesh)xn.renderInstances(Yi,wr,St.count);else if(Xe.isInstancedBufferGeometry){const Rp=Math.min(Xe.instanceCount,Xe._maxInstanceCount);xn.renderInstances(Yi,wr,Rp)}else xn.render(Yi,wr)}},this.compile=function(ve,it){p=hn.get(ve),p.init(),ve.traverseVisible(function(Xe){Xe.isLight&&Xe.layers.test(it.layers)&&(p.pushLight(Xe),Xe.castShadow&&p.pushShadow(Xe))}),p.setupLights(),ve.traverse(function(Xe){const ot=Xe.material;if(ot)if(Array.isArray(ot))for(let St=0;St<ot.length;St++)B_(ot[St],ve,Xe);else B_(ot,ve,Xe)})};let F_=null;function ZS(){Bu.stop()}function KS(){Bu.start()}const Bu=new pd;function vg(ve,it,Xe){const ot=it.isScene===!0?it.overrideMaterial:null;for(let St=0,Pn=ve.length;St<Pn;St++){const cn=ve[St],Et=cn.object,yn=cn.geometry,Zt=ot===null?cn.material:ot,Sn=cn.group;if(Xe.isArrayCamera){const an=Xe.cameras;for(let xn=0,Hi=an.length;xn<Hi;xn++){const ei=an[xn];Et.layers.test(ei.layers)&&(pt.viewport(X.copy(ei.viewport)),p.setupLightsView(ei),QS(Et,it,ei,yn,Zt,Sn))}}else QS(Et,it,Xe,yn,Zt,Sn)}}function QS(ve,it,Xe,ot,St,Pn){if(ve.onBeforeRender(_,it,Xe,ot,St,Pn),ve.modelViewMatrix.multiplyMatrices(Xe.matrixWorldInverse,ve.matrixWorld),ve.normalMatrix.getNormalMatrix(ve.modelViewMatrix),ve.isImmediateRenderObject){const cn=tT(Xe,it,St,ve);pt.setMaterial(St),Yr.reset(),function(Et,yn){Et.render(function(Zt){_.renderBufferImmediate(Zt,yn)})}(ve,cn)}else St.transparent===!0&&St.side===ne?(St.side=V,St.needsUpdate=!0,_.renderBufferDirect(Xe,it,ot,St,ve,Pn),St.side=z,St.needsUpdate=!0,_.renderBufferDirect(Xe,it,ot,St,ve,Pn),St.side=ne):_.renderBufferDirect(Xe,it,ot,St,ve,Pn);ve.onAfterRender(_,it,Xe,ot,St,Pn)}function B_(ve,it,Xe){it.isScene!==!0&&(it=Ke);const ot=re.get(ve),St=p.state.lights,Pn=p.state.shadowsArray,cn=St.state.version,Et=Ct.getParameters(ve,St.state,Pn,it,Xe),yn=Ct.getProgramCacheKey(Et);let Zt=ot.programs;ot.environment=ve.isMeshStandardMaterial?it.environment:null,ot.fog=it.fog,ot.envMap=Ge.get(ve.envMap||ot.environment),Zt===void 0&&(ve.addEventListener("dispose",JS),Zt=new Map,ot.programs=Zt);let Sn=Zt.get(yn);if(Sn!==void 0){if(ot.currentProgram===Sn&&ot.lightsStateVersion===cn)return eT(ve,Et),Sn}else Et.uniforms=Ct.getUniforms(ve),ve.onBuild(Et,_),ve.onBeforeCompile(Et,_),Sn=Ct.acquireProgram(Et,yn),Zt.set(yn,Sn),ot.uniforms=Et.uniforms;const an=ot.uniforms;(ve.isShaderMaterial||ve.isRawShaderMaterial)&&ve.clipping!==!0||(an.clippingPlanes=Ei.uniform),eT(ve,Et),ot.needsLights=function(ei){return ei.isMeshLambertMaterial||ei.isMeshToonMaterial||ei.isMeshPhongMaterial||ei.isMeshStandardMaterial||ei.isShadowMaterial||ei.isShaderMaterial&&ei.lights===!0}(ve),ot.lightsStateVersion=cn,ot.needsLights&&(an.ambientLightColor.value=St.state.ambient,an.lightProbe.value=St.state.probe,an.directionalLights.value=St.state.directional,an.directionalLightShadows.value=St.state.directionalShadow,an.spotLights.value=St.state.spot,an.spotLightShadows.value=St.state.spotShadow,an.rectAreaLights.value=St.state.rectArea,an.ltc_1.value=St.state.rectAreaLTC1,an.ltc_2.value=St.state.rectAreaLTC2,an.pointLights.value=St.state.point,an.pointLightShadows.value=St.state.pointShadow,an.hemisphereLights.value=St.state.hemi,an.directionalShadowMap.value=St.state.directionalShadowMap,an.directionalShadowMatrix.value=St.state.directionalShadowMatrix,an.spotShadowMap.value=St.state.spotShadowMap,an.spotShadowMatrix.value=St.state.spotShadowMatrix,an.pointShadowMap.value=St.state.pointShadowMap,an.pointShadowMatrix.value=St.state.pointShadowMatrix);const xn=Sn.getUniforms(),Hi=_s.seqWithValue(xn.seq,an);return ot.currentProgram=Sn,ot.uniformsList=Hi,Sn}function eT(ve,it){const Xe=re.get(ve);Xe.outputEncoding=it.outputEncoding,Xe.instancing=it.instancing,Xe.skinning=it.skinning,Xe.numClippingPlanes=it.numClippingPlanes,Xe.numIntersection=it.numClipIntersection,Xe.vertexAlphas=it.vertexAlphas}function tT(ve,it,Xe,ot){it.isScene!==!0&&(it=Ke),Te.resetTextureUnits();const St=it.fog,Pn=Xe.isMeshStandardMaterial?it.environment:null,cn=B===null?_.outputEncoding:B.texture.encoding,Et=Ge.get(Xe.envMap||Pn),yn=Xe.vertexColors===!0&&ot.geometry&&ot.geometry.attributes.color&&ot.geometry.attributes.color.itemSize===4,Zt=re.get(Xe),Sn=p.state.lights;if(Je===!0&&(st===!0||ve!==U)){const wr=ve===U&&Xe.id===G;Ei.setState(Xe,ve,wr)}let an=!1;Xe.version===Zt.__version?Zt.needsLights&&Zt.lightsStateVersion!==Sn.state.version||Zt.outputEncoding!==cn||ot.isInstancedMesh&&Zt.instancing===!1?an=!0:ot.isInstancedMesh||Zt.instancing!==!0?ot.isSkinnedMesh&&Zt.skinning===!1?an=!0:ot.isSkinnedMesh||Zt.skinning!==!0?Zt.envMap!==Et||Xe.fog&&Zt.fog!==St?an=!0:Zt.numClippingPlanes===void 0||Zt.numClippingPlanes===Ei.numPlanes&&Zt.numIntersection===Ei.numIntersection?Zt.vertexAlphas!==yn&&(an=!0):an=!0:an=!0:an=!0:(an=!0,Zt.__version=Xe.version);let xn=Zt.currentProgram;an===!0&&(xn=B_(Xe,it,ot));let Hi=!1,ei=!1,rs=!1;const Jn=xn.getUniforms(),Us=Zt.uniforms;if(pt.useProgram(xn.program)&&(Hi=!0,ei=!0,rs=!0),Xe.id!==G&&(G=Xe.id,ei=!0),Hi||U!==ve){if(Jn.setValue(yt,"projectionMatrix",ve.projectionMatrix),dt.logarithmicDepthBuffer&&Jn.setValue(yt,"logDepthBufFC",2/(Math.log(ve.far+1)/Math.LN2)),U!==ve&&(U=ve,ei=!0,rs=!0),Xe.isShaderMaterial||Xe.isMeshPhongMaterial||Xe.isMeshToonMaterial||Xe.isMeshStandardMaterial||Xe.envMap){const wr=Jn.map.cameraPosition;wr!==void 0&&wr.setValue(yt,de.setFromMatrixPosition(ve.matrixWorld))}(Xe.isMeshPhongMaterial||Xe.isMeshToonMaterial||Xe.isMeshLambertMaterial||Xe.isMeshBasicMaterial||Xe.isMeshStandardMaterial||Xe.isShaderMaterial)&&Jn.setValue(yt,"isOrthographic",ve.isOrthographicCamera===!0),(Xe.isMeshPhongMaterial||Xe.isMeshToonMaterial||Xe.isMeshLambertMaterial||Xe.isMeshBasicMaterial||Xe.isMeshStandardMaterial||Xe.isShaderMaterial||Xe.isShadowMaterial||ot.isSkinnedMesh)&&Jn.setValue(yt,"viewMatrix",ve.matrixWorldInverse)}if(ot.isSkinnedMesh){Jn.setOptional(yt,ot,"bindMatrix"),Jn.setOptional(yt,ot,"bindMatrixInverse");const wr=ot.skeleton;wr&&(dt.floatVertexTextures?(wr.boneTexture===null&&wr.computeBoneTexture(),Jn.setValue(yt,"boneTexture",wr.boneTexture,Te),Jn.setValue(yt,"boneTextureSize",wr.boneTextureSize)):Jn.setOptional(yt,wr,"boneMatrices"))}var Yi,so;return(ei||Zt.receiveShadow!==ot.receiveShadow)&&(Zt.receiveShadow=ot.receiveShadow,Jn.setValue(yt,"receiveShadow",ot.receiveShadow)),ei&&(Jn.setValue(yt,"toneMappingExposure",_.toneMappingExposure),Zt.needsLights&&(so=rs,(Yi=Us).ambientLightColor.needsUpdate=so,Yi.lightProbe.needsUpdate=so,Yi.directionalLights.needsUpdate=so,Yi.directionalLightShadows.needsUpdate=so,Yi.pointLights.needsUpdate=so,Yi.pointLightShadows.needsUpdate=so,Yi.spotLights.needsUpdate=so,Yi.spotLightShadows.needsUpdate=so,Yi.rectAreaLights.needsUpdate=so,Yi.hemisphereLights.needsUpdate=so),St&&Xe.fog&&It.refreshFogUniforms(Us,St),It.refreshMaterialUniforms(Us,Xe,oe,ue,ct),_s.upload(yt,Zt.uniformsList,Us,Te)),Xe.isShaderMaterial&&Xe.uniformsNeedUpdate===!0&&(_s.upload(yt,Zt.uniformsList,Us,Te),Xe.uniformsNeedUpdate=!1),Xe.isSpriteMaterial&&Jn.setValue(yt,"center",ot.center),Jn.setValue(yt,"modelViewMatrix",ot.modelViewMatrix),Jn.setValue(yt,"normalMatrix",ot.normalMatrix),Jn.setValue(yt,"modelMatrix",ot.matrixWorld),xn}Bu.setAnimationLoop(function(ve){F_&&F_(ve)}),typeof window!="undefined"&&Bu.setContext(window),this.setAnimationLoop=function(ve){F_=ve,oo.setAnimationLoop(ve),ve===null?Bu.stop():Bu.start()},oo.addEventListener("sessionstart",ZS),oo.addEventListener("sessionend",KS),this.render=function(ve,it){if(it!==void 0&&it.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(y===!0)return;ve.autoUpdate===!0&&ve.updateMatrixWorld(),it.parent===null&&it.updateMatrixWorld(),oo.enabled===!0&&oo.isPresenting===!0&&(oo.cameraAutoUpdate===!0&&oo.updateCamera(it),it=oo.getCamera()),ve.isScene===!0&&ve.onBeforeRender(_,ve,it,B),p=hn.get(ve,g.length),p.init(),g.push(p),he.multiplyMatrices(it.projectionMatrix,it.matrixWorldInverse),Ae.setFromProjectionMatrix(he),st=this.localClippingEnabled,Je=Ei.init(this.clippingPlanes,st,it),d=Pt.get(ve,m.length),d.init(),m.push(d),function cn(Et,yn,Zt,Sn){if(Et.visible===!1)return;if(Et.layers.test(yn.layers)){if(Et.isGroup)Zt=Et.renderOrder;else if(Et.isLOD)Et.autoUpdate===!0&&Et.update(yn);else if(Et.isLight)p.pushLight(Et),Et.castShadow&&p.pushShadow(Et);else if(Et.isSprite){if(!Et.frustumCulled||Ae.intersectsSprite(Et)){Sn&&de.setFromMatrixPosition(Et.matrixWorld).applyMatrix4(he);const xn=et.update(Et),Hi=Et.material;Hi.visible&&d.push(Et,xn,Hi,Zt,de.z,null)}}else if(Et.isImmediateRenderObject)Sn&&de.setFromMatrixPosition(Et.matrixWorld).applyMatrix4(he),d.push(Et,null,Et.material,Zt,de.z,null);else if((Et.isMesh||Et.isLine||Et.isPoints)&&(Et.isSkinnedMesh&&Et.skeleton.frame!==Ze.render.frame&&(Et.skeleton.update(),Et.skeleton.frame=Ze.render.frame),!Et.frustumCulled||Ae.intersectsObject(Et))){Sn&&de.setFromMatrixPosition(Et.matrixWorld).applyMatrix4(he);const xn=et.update(Et),Hi=Et.material;if(Array.isArray(Hi)){const ei=xn.groups;for(let rs=0,Jn=ei.length;rs<Jn;rs++){const Us=ei[rs],Yi=Hi[Us.materialIndex];Yi&&Yi.visible&&d.push(Et,xn,Yi,Zt,de.z,Us)}}else Hi.visible&&d.push(Et,xn,Hi,Zt,de.z,null)}}const an=Et.children;for(let xn=0,Hi=an.length;xn<Hi;xn++)cn(an[xn],yn,Zt,Sn)}(ve,it,0,_.sortObjects),d.finish(),_.sortObjects===!0&&d.sort(ce,le),Je===!0&&Ei.beginShadows();const Xe=p.state.shadowsArray;kn.render(Xe,ve,it),p.setupLights(),p.setupLightsView(it),Je===!0&&Ei.endShadows(),this.info.autoReset===!0&&this.info.reset(),qr.render(d,ve);const ot=d.opaque,St=d.transmissive,Pn=d.transparent;ot.length>0&&vg(ot,ve,it),St.length>0&&function(cn,Et,yn,Zt){if(ct===null){const xn=s===!0&&dt.isWebGL2===!0;ct=new(xn?Ks:$r)(1024,1024,{generateMipmaps:!0,type:Fr.convert(Vs)!==null?Vs:ss,minFilter:zs,magFilter:Gt,wrapS:xt,wrapT:xt})}const Sn=_.getRenderTarget();_.setRenderTarget(ct),_.clear();const an=_.toneMapping;_.toneMapping=Sr,vg(cn,yn,Zt),_.toneMapping=an,Te.updateMultisampleRenderTarget(ct),Te.updateRenderTargetMipmap(ct),_.setRenderTarget(Sn),vg(Et,yn,Zt)}(ot,St,ve,it),Pn.length>0&&vg(Pn,ve,it),B!==null&&(Te.updateMultisampleRenderTarget(B),Te.updateRenderTargetMipmap(B)),ve.isScene===!0&&ve.onAfterRender(_,ve,it),pt.buffers.depth.setTest(!0),pt.buffers.depth.setMask(!0),pt.buffers.color.setMask(!0),pt.setPolygonOffset(!1),Yr.resetDefaultState(),G=-1,U=null,g.pop(),p=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 P},this.getRenderTarget=function(){return B},this.setRenderTarget=function(ve,it=0,Xe=0){B=ve,w=it,P=Xe,ve&&re.get(ve).__webglFramebuffer===void 0&&Te.setupRenderTarget(ve);let ot=null,St=!1,Pn=!1;if(ve){const cn=ve.texture;(cn.isDataTexture3D||cn.isDataTexture2DArray)&&(Pn=!0);const Et=re.get(ve).__webglFramebuffer;ve.isWebGLCubeRenderTarget?(ot=Et[it],St=!0):ot=ve.isWebGLMultisampleRenderTarget?re.get(ve).__webglMultisampledFramebuffer:Et,X.copy(ve.viewport),H.copy(ve.scissor),q=ve.scissorTest}else X.copy(_e).multiplyScalar(oe).floor(),H.copy(je).multiplyScalar(oe).floor(),q=ke;if(pt.bindFramebuffer(36160,ot)&&dt.drawBuffers){let cn=!1;if(ve)if(ve.isWebGLMultipleRenderTargets){const Et=ve.texture;if(Ee.length!==Et.length||Ee[0]!==36064){for(let yn=0,Zt=Et.length;yn<Zt;yn++)Ee[yn]=36064+yn;Ee.length=Et.length,cn=!0}}else Ee.length===1&&Ee[0]===36064||(Ee[0]=36064,Ee.length=1,cn=!0);else Ee.length===1&&Ee[0]===1029||(Ee[0]=1029,Ee.length=1,cn=!0);cn&&(dt.isWebGL2?yt.drawBuffers(Ee):ze.get("WEBGL_draw_buffers").drawBuffersWEBGL(Ee))}if(pt.viewport(X),pt.scissor(H),pt.setScissorTest(q),St){const cn=re.get(ve.texture);yt.framebufferTexture2D(36160,36064,34069+it,cn.__webglTexture,Xe)}else if(Pn){const cn=re.get(ve.texture),Et=it||0;yt.framebufferTextureLayer(36160,36064,cn.__webglTexture,Xe||0,Et)}},this.readRenderTargetPixels=function(ve,it,Xe,ot,St,Pn,cn){if(!ve||!ve.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Et=re.get(ve).__webglFramebuffer;if(ve.isWebGLCubeRenderTarget&&cn!==void 0&&(Et=Et[cn]),Et){pt.bindFramebuffer(36160,Et);try{const yn=ve.texture,Zt=yn.format,Sn=yn.type;if(Zt!==Tr&&Fr.convert(Zt)!==yt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const an=Sn===Vs&&(ze.has("EXT_color_buffer_half_float")||dt.isWebGL2&&ze.has("EXT_color_buffer_float"));if(!(Sn===ss||Fr.convert(Sn)===yt.getParameter(35738)||Sn===Io&&(dt.isWebGL2||ze.has("OES_texture_float")||ze.has("WEBGL_color_buffer_float"))||an))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");yt.checkFramebufferStatus(36160)===36053?it>=0&&it<=ve.width-ot&&Xe>=0&&Xe<=ve.height-St&&yt.readPixels(it,Xe,ot,St,Fr.convert(Zt),Fr.convert(Sn),Pn):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const yn=B!==null?re.get(B).__webglFramebuffer:null;pt.bindFramebuffer(36160,yn)}}},this.copyFramebufferToTexture=function(ve,it,Xe=0){const ot=Math.pow(2,-Xe),St=Math.floor(it.image.width*ot),Pn=Math.floor(it.image.height*ot);let cn=Fr.convert(it.format);dt.isWebGL2&&(cn===6407&&(cn=32849),cn===6408&&(cn=32856)),Te.setTexture2D(it,0),yt.copyTexImage2D(3553,Xe,cn,ve.x,ve.y,St,Pn,0),pt.unbindTexture()},this.copyTextureToTexture=function(ve,it,Xe,ot=0){const St=it.image.width,Pn=it.image.height,cn=Fr.convert(Xe.format),Et=Fr.convert(Xe.type);Te.setTexture2D(Xe,0),yt.pixelStorei(37440,Xe.flipY),yt.pixelStorei(37441,Xe.premultiplyAlpha),yt.pixelStorei(3317,Xe.unpackAlignment),it.isDataTexture?yt.texSubImage2D(3553,ot,ve.x,ve.y,St,Pn,cn,Et,it.image.data):it.isCompressedTexture?yt.compressedTexSubImage2D(3553,ot,ve.x,ve.y,it.mipmaps[0].width,it.mipmaps[0].height,cn,it.mipmaps[0].data):yt.texSubImage2D(3553,ot,ve.x,ve.y,cn,Et,it.image),ot===0&&Xe.generateMipmaps&&yt.generateMipmap(3553),pt.unbindTexture()},this.copyTextureToTexture3D=function(ve,it,Xe,ot,St=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const Pn=ve.max.x-ve.min.x+1,cn=ve.max.y-ve.min.y+1,Et=ve.max.z-ve.min.z+1,yn=Fr.convert(ot.format),Zt=Fr.convert(ot.type);let Sn;if(ot.isDataTexture3D)Te.setTexture3D(ot,0),Sn=32879;else{if(!ot.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Te.setTexture2DArray(ot,0),Sn=35866}yt.pixelStorei(37440,ot.flipY),yt.pixelStorei(37441,ot.premultiplyAlpha),yt.pixelStorei(3317,ot.unpackAlignment);const an=yt.getParameter(3314),xn=yt.getParameter(32878),Hi=yt.getParameter(3316),ei=yt.getParameter(3315),rs=yt.getParameter(32877),Jn=Xe.isCompressedTexture?Xe.mipmaps[0]:Xe.image;yt.pixelStorei(3314,Jn.width),yt.pixelStorei(32878,Jn.height),yt.pixelStorei(3316,ve.min.x),yt.pixelStorei(3315,ve.min.y),yt.pixelStorei(32877,ve.min.z),Xe.isDataTexture||Xe.isDataTexture3D?yt.texSubImage3D(Sn,St,it.x,it.y,it.z,Pn,cn,Et,yn,Zt,Jn.data):Xe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),yt.compressedTexSubImage3D(Sn,St,it.x,it.y,it.z,Pn,cn,Et,yn,Jn.data)):yt.texSubImage3D(Sn,St,it.x,it.y,it.z,Pn,cn,Et,yn,Zt,Jn),yt.pixelStorei(3314,an),yt.pixelStorei(32878,xn),yt.pixelStorei(3316,Hi),yt.pixelStorei(3315,ei),yt.pixelStorei(32877,rs),St===0&&ot.generateMipmaps&&yt.generateMipmap(Sn),pt.unbindTexture()},this.initTexture=function(ve){Te.setTexture2D(ve,0),pt.unbindTexture()},this.resetState=function(){w=0,P=0,B=null,pt.reset(),Yr.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Ci extends Un{}Ci.prototype.isWebGL1Renderer=!0;class Ui{constructor(e,t=25e-5){this.name="",this.color=new Dt(e),this.density=t}clone(){return new Ui(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Ui.prototype.isFogExp2=!0;class Kl{constructor(e,t=1,n=1e3){this.name="",this.color=new Dt(e),this.near=t,this.far=n}clone(){return new Kl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Kl.prototype.isFog=!0;class el extends pn{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}}el.prototype.isScene=!0;class pa{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=$s,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ar()}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 r=0,o=this.stride;r<o;r++)this.array[e+r]=t.array[n+r];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=Ar()),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=Ar()),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}}}pa.prototype.isInterleavedBuffer=!0;const _i=new S;class Xo{constructor(e,t,n,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r===!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++)_i.x=this.getX(t),_i.y=this.getY(t),_i.z=this.getZ(t),_i.applyMatrix4(e),this.setXYZ(t,_i.x,_i.y,_i.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)_i.x=this.getX(t),_i.y=this.getY(t),_i.z=this.getZ(t),_i.applyNormalMatrix(e),this.setXYZ(t,_i.x,_i.y,_i.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)_i.x=this.getX(t),_i.y=this.getY(t),_i.z=this.getZ(t),_i.transformDirection(e),this.setXYZ(t,_i.x,_i.y,_i.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,r){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]=r,this}setXYZW(e,t,n,r,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]=r,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 r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[r+o])}return new gn(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 Xo(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 r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[r+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}}}Xo.prototype.isInterleavedBufferAttribute=!0;class Ql extends Bi{constructor(e){super(),this.type="SpriteMaterial",this.color=new Dt(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 fa;Ql.prototype.isSpriteMaterial=!0;const wo=new S,tl=new S,ma=new S,ga=new mt,eu=new mt,zf=new Rt,Nh=new S,tu=new S,Dh=new S,jf=new mt,nu=new mt,Pd=new mt;class iu extends pn{constructor(e){if(super(),this.type="Sprite",fa===void 0){fa=new Xt;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 pa(t,5);fa.setIndex([0,1,2,0,2,3]),fa.setAttribute("position",new Xo(n,3,0,!1)),fa.setAttribute("uv",new Xo(n,2,3,!1))}this.geometry=fa,this.material=e!==void 0?e:new Ql,this.center=new mt(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),tl.setFromMatrixScale(this.matrixWorld),zf.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ma.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&tl.multiplyScalar(-ma.z);const n=this.material.rotation;let r,o;n!==0&&(o=Math.cos(n),r=Math.sin(n));const s=this.center;Fh(Nh.set(-.5,-.5,0),ma,s,tl,r,o),Fh(tu.set(.5,-.5,0),ma,s,tl,r,o),Fh(Dh.set(.5,.5,0),ma,s,tl,r,o),jf.set(0,0),nu.set(1,0),Pd.set(1,1);let a=e.ray.intersectTriangle(Nh,tu,Dh,!1,wo);if(a===null&&(Fh(tu.set(-.5,.5,0),ma,s,tl,r,o),nu.set(0,1),a=e.ray.intersectTriangle(Nh,Dh,tu,!1,wo),a===null))return;const l=e.ray.origin.distanceTo(wo);l<e.near||l>e.far||t.push({distance:l,point:wo.clone(),uv:qn.getUV(wo,Nh,tu,Dh,jf,nu,Pd,new mt),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 Fh(i,e,t,n,r,o){ga.subVectors(i,t).addScalar(.5).multiply(n),r!==void 0?(eu.x=o*ga.x-r*ga.y,eu.y=r*ga.x+o*ga.y):eu.copy(ga),i.copy(e),i.x+=eu.x,i.y+=eu.y,i.applyMatrix4(zf)}iu.prototype.isSprite=!0;const nl=new S,Vf=new S;class Wf extends pn{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,r=t.length;n<r;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 r;for(r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,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,r;for(n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){nl.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(nl);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){nl.setFromMatrixPosition(e.matrixWorld),Vf.setFromMatrixPosition(this.matrixWorld);const n=nl.distanceTo(Vf)/e.zoom;let r,o;for(t[0].object.visible=!0,r=1,o=t.length;r<o&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<o;r++)t[r].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 r=0,o=n.length;r<o;r++){const s=n[r];t.object.levels.push({object:s.object.uuid,distance:s.distance})}return t}}const ar=new S,Bh=new Bn,Xf=new Bn,pv=new S,Uh=new Rt;class il extends En{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Rt,this.bindMatrixInverse=new Rt}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 Bn,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;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,r=this.geometry;Bh.fromBufferAttribute(r.attributes.skinIndex,e),Xf.fromBufferAttribute(r.attributes.skinWeight,e),ar.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let o=0;o<4;o++){const s=Xf.getComponent(o);if(s!==0){const a=Bh.getComponent(o);Uh.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(pv.copy(ar).applyMatrix4(Uh),s)}}return t.applyMatrix4(this.bindMatrixInverse)}}il.prototype.isSkinnedMesh=!0;class kh extends pn{constructor(){super(),this.type="Bone"}}kh.prototype.isBone=!0;class xs extends mi{constructor(e=null,t=1,n=1,r,o,s,a,l,u=Gt,h=Gt,d,p){super(null,s,a,l,u,h,r,o,d,p),this.image={data:e,width:t,height:n},this.magFilter=u,this.minFilter=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}xs.prototype.isDataTexture=!0;const qf=new Rt,Yf=new Rt;class Gh{constructor(e=[],t=[]){this.uuid=Ar(),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,r=this.bones.length;n<r;n++)this.boneInverses.push(new Rt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new Rt;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,r=this.boneTexture;for(let o=0,s=e.length;o<s;o++){const a=e[o]?e[o].matrixWorld:Yf;qf.multiplyMatrices(a,t[o]),qf.toArray(n,16*o)}r!==null&&(r.needsUpdate=!0)}clone(){return new Gh(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=Fa(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new xs(t,e,e,Tr,Io);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 r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;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 kh),this.bones.push(s),this.boneInverses.push(new Rt().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 r=0,o=t.length;r<o;r++){const s=t[r];e.bones.push(s.uuid);const a=n[r];e.boneInverses.push(a.toArray())}return e}}const $f=new Rt,Hh=new Rt,rl=[],ru=new En;class Id extends En{constructor(e,t,n){super(e,t),this.instanceMatrix=new gn(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,r=this.count;if(ru.geometry=this.geometry,ru.material=this.material,ru.material!==void 0)for(let o=0;o<r;o++){this.getMatrixAt(o,$f),Hh.multiplyMatrices(n,$f),ru.matrixWorld=Hh,ru.raycast(e,rl);for(let s=0,a=rl.length;s<a;s++){const l=rl[s];l.instanceId=o,l.object=this,t.push(l)}rl.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new gn(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"})}}Id.prototype.isInstancedMesh=!0;class ki extends Bi{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Dt(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}}ki.prototype.isLineBasicMaterial=!0;const Jf=new S,zh=new S,Zf=new Rt,Od=new Ho,jh=new Mi;class c extends pn{constructor(e=new Xt,t=new ki){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 r=1,o=t.count;r<o;r++)Jf.fromBufferAttribute(t,r-1),zh.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Jf.distanceTo(zh);e.setAttribute("lineDistance",new Tt(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,r=this.matrixWorld,o=e.params.Line.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),jh.copy(n.boundingSphere),jh.applyMatrix4(r),jh.radius+=o,e.ray.intersectsSphere(jh)===!1)return;Zf.copy(r).invert(),Od.copy(e.ray).applyMatrix4(Zf);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,u=new S,h=new S,d=new S,p=new S,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 P=g.getX(y),B=g.getX(y+1);if(u.fromBufferAttribute(_,P),h.fromBufferAttribute(_,B),Od.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const G=e.ray.origin.distanceTo(p);G<e.near||G>e.far||t.push({distance:G,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),h.fromBufferAttribute(_,y+1),Od.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);P<e.near||P>e.far||t.push({distance:P,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 r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[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.")}}}c.prototype.isLine=!0;const f=new S,x=new S;class A extends c{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 r=0,o=t.count;r<o;r+=2)f.fromBufferAttribute(t,r),x.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+f.distanceTo(x);e.setAttribute("lineDistance",new Tt(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}}A.prototype.isLineSegments=!0;class k extends c{constructor(e,t){super(e,t),this.type="LineLoop"}}k.prototype.isLineLoop=!0;class ie extends Bi{constructor(e){super(),this.type="PointsMaterial",this.color=new Dt(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}}ie.prototype.isPointsMaterial=!0;const pe=new Rt,Se=new Ho,Be=new Mi,tt=new S;class nt extends pn{constructor(e=new Xt,t=new ie){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,r=this.matrixWorld,o=e.params.Points.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Be.copy(n.boundingSphere),Be.applyMatrix4(r),Be.radius+=o,e.ray.intersectsSphere(Be)===!1)return;pe.copy(r).invert(),Se.copy(e.ray).applyMatrix4(pe);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const u=n.index,h=n.attributes.position;if(u!==null)for(let d=Math.max(0,s.start),p=Math.min(u.count,s.start+s.count);d<p;d++){const m=u.getX(d);tt.fromBufferAttribute(h,m),gt(tt,m,l,r,e,t,this)}else for(let d=Math.max(0,s.start),p=Math.min(h.count,s.start+s.count);d<p;d++)tt.fromBufferAttribute(h,d),gt(tt,d,l,r,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 r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[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 gt(i,e,t,n,r,o,s){const a=Se.distanceSqToPoint(i);if(a<t){const l=new S;Se.closestPointToPoint(i,l),l.applyMatrix4(n);const u=r.ray.origin.distanceTo(l);if(u<r.near||u>r.far)return;o.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:s})}}nt.prototype.isPoints=!0;class Ft extends mi{constructor(e,t,n,r,o,s,a,l,u){super(e,t,n,r,o,s,a,l,u),this.format=a!==void 0?a:Oo,this.minFilter=s!==void 0?s:Gn,this.magFilter=o!==void 0?o:Gn,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(function d(){h.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)}}Ft.prototype.isVideoTexture=!0;class kt extends mi{constructor(e,t,n,r,o,s,a,l,u,h,d,p){super(null,s,a,l,u,h,r,o,d,p),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}kt.prototype.isCompressedTexture=!0;class $t extends mi{constructor(e,t,n,r,o,s,a,l,u){super(e,t,n,r,o,s,a,l,u),this.needsUpdate=!0}}$t.prototype.isCanvasTexture=!0;class lt extends mi{constructor(e,t,n,r,o,s,a,l,u,h){if((h=h!==void 0?h:ti)!==ti&&h!==Ws)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===ti&&(n=Al),n===void 0&&h===Ws&&(n=Nn),super(null,r,o,s,a,l,h,n,u),this.image={width:e,height:t},this.magFilter=a!==void 0?a:Gt,this.minFilter=l!==void 0?l:Gt,this.flipY=!1,this.generateMipmaps=!1}}lt.prototype.isDepthTexture=!0;class _t extends Xt{constructor(e=1,t=8,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const o=[],s=[],a=[],l=[],u=new S,h=new mt;s.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const m=n+d/t*r;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),h.x=(s[p]/e+1)/2,h.y=(s[p+1]/e+1)/2,l.push(h.x,h.y)}for(let d=1;d<=t;d++)o.push(d,d+1,0);this.setIndex(o),this.setAttribute("position",new Tt(s,3)),this.setAttribute("normal",new Tt(a,3)),this.setAttribute("uv",new Tt(l,2))}static fromJSON(e){return new _t(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Vt extends Xt{constructor(e=1,t=1,n=1,r=8,o=1,s=!1,a=0,l=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:o,openEnded:s,thetaStart:a,thetaLength:l};const u=this;r=Math.floor(r),o=Math.floor(o);const h=[],d=[],p=[],m=[];let g=0;const _=[],y=n/2;let w=0;function P(B){const G=g,U=new mt,X=new S;let H=0;const q=B===!0?e:t,me=B===!0?1:-1;for(let oe=1;oe<=r;oe++)d.push(0,y*me,0),p.push(0,me,0),m.push(.5,.5),g++;const ue=g;for(let oe=0;oe<=r;oe++){const ce=oe/r*l+a,le=Math.cos(ce),_e=Math.sin(ce);X.x=q*_e,X.y=y*me,X.z=q*le,d.push(X.x,X.y,X.z),p.push(0,me,0),U.x=.5*le+.5,U.y=.5*_e*me+.5,m.push(U.x,U.y),g++}for(let oe=0;oe<r;oe++){const ce=G+oe,le=ue+oe;B===!0?h.push(le,le+1,ce):h.push(le+1,le,ce),H+=3}u.addGroup(w,H,B===!0?1:2),w+=H}(function(){const B=new S,G=new S;let U=0;const X=(t-e)/n;for(let H=0;H<=o;H++){const q=[],me=H/o,ue=me*(t-e)+e;for(let oe=0;oe<=r;oe++){const ce=oe/r,le=ce*l+a,_e=Math.sin(le),je=Math.cos(le);G.x=ue*_e,G.y=-me*n+y,G.z=ue*je,d.push(G.x,G.y,G.z),B.set(_e,X,je).normalize(),p.push(B.x,B.y,B.z),m.push(ce,1-me),q.push(g++)}_.push(q)}for(let H=0;H<r;H++)for(let q=0;q<o;q++){const me=_[q][H],ue=_[q+1][H],oe=_[q+1][H+1],ce=_[q][H+1];h.push(me,ue,ce),h.push(ue,oe,ce),U+=6}u.addGroup(w,U,0),w+=U})(),s===!1&&(e>0&&P(!0),t>0&&P(!1)),this.setIndex(h),this.setAttribute("position",new Tt(d,3)),this.setAttribute("normal",new Tt(p,3)),this.setAttribute("uv",new Tt(m,2))}static fromJSON(e){return new Vt(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Lt extends Vt{constructor(e=1,t=1,n=8,r=1,o=!1,s=0,a=2*Math.PI){super(0,e,t,n,r,o,s,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a}}static fromJSON(e){return new Lt(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class jt extends Xt{constructor(e,t,n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const o=[],s=[];function a(p,m,g,_){const y=_+1,w=[];for(let P=0;P<=y;P++){w[P]=[];const B=p.clone().lerp(g,P/y),G=m.clone().lerp(g,P/y),U=y-P;for(let X=0;X<=U;X++)w[P][X]=X===0&&P===y?B:B.clone().lerp(G,X/U)}for(let P=0;P<y;P++)for(let B=0;B<2*(y-P)-1;B++){const G=Math.floor(B/2);B%2==0?(l(w[P][G+1]),l(w[P+1][G]),l(w[P][G])):(l(w[P][G+1]),l(w[P+1][G+1]),l(w[P+1][G]))}}function l(p){o.push(p.x,p.y,p.z)}function u(p,m){const g=3*p;m.x=e[g+0],m.y=e[g+1],m.z=e[g+2]}function h(p,m,g,_){_<0&&p.x===1&&(s[m]=p.x-1),g.x===0&&g.z===0&&(s[m]=_/2/Math.PI+.5)}function d(p){return Math.atan2(p.z,-p.x)}(function(p){const m=new S,g=new S,_=new S;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,_,p)})(r),function(p){const m=new S;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(p),o[g+0]=m.x,o[g+1]=m.y,o[g+2]=m.z}(n),function(){const p=new S;for(let g=0;g<o.length;g+=3){p.x=o[g+0],p.y=o[g+1],p.z=o[g+2];const _=d(p)/2/Math.PI+.5,y=(m=p,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 S,_=new S,y=new S,w=new S,P=new mt,B=new mt,G=new mt;for(let U=0,X=0;U<o.length;U+=9,X+=6){g.set(o[U+0],o[U+1],o[U+2]),_.set(o[U+3],o[U+4],o[U+5]),y.set(o[U+6],o[U+7],o[U+8]),P.set(s[X+0],s[X+1]),B.set(s[X+2],s[X+3]),G.set(s[X+4],s[X+5]),w.copy(g).add(_).add(y).divideScalar(3);const H=d(w);h(P,X+0,g,H),h(B,X+2,_,H),h(G,X+4,y,H)}})(),function(){for(let g=0;g<s.length;g+=6){const _=s[g+0],y=s[g+2],w=s[g+4],P=Math.max(_,y,w),B=Math.min(_,y,w);P>.9&&B<.1&&(_<.2&&(s[g+0]+=1),y<.2&&(s[g+2]+=1),w<.2&&(s[g+4]+=1))}}()}(),this.setAttribute("position",new Tt(o,3)),this.setAttribute("normal",new Tt(o.slice(),3)),this.setAttribute("uv",new Tt(s,2)),r===0?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new jt(e.vertices,e.indices,e.radius,e.details)}}class Kt extends jt{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=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,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[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 Kt(e.radius,e.detail)}}const dn=new S,zt=new S,en=new S,hi=new qn;class Xi extends Xt{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),r=Math.cos(Wn*t),o=e.getIndex(),s=e.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],u=["a","b","c"],h=new Array(3),d={},p=[];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}=hi;if(g.fromBufferAttribute(s,l[0]),_.fromBufferAttribute(s,l[1]),y.fromBufferAttribute(s,l[2]),hi.getNormal(en),h[0]=`${Math.round(g.x*n)},${Math.round(g.y*n)},${Math.round(g.z*n)}`,h[1]=`${Math.round(_.x*n)},${Math.round(_.y*n)},${Math.round(_.z*n)}`,h[2]=`${Math.round(y.x*n)},${Math.round(y.y*n)},${Math.round(y.z*n)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let w=0;w<3;w++){const P=(w+1)%3,B=h[w],G=h[P],U=hi[u[w]],X=hi[u[P]],H=`${B}_${G}`,q=`${G}_${B}`;q in d&&d[q]?(en.dot(d[q].normal)<=r&&(p.push(U.x,U.y,U.z),p.push(X.x,X.y,X.z)),d[q]=null):H in d||(d[H]={index0:l[w],index1:l[P],normal:en.clone()})}}for(const m in d)if(d[m]){const{index0:g,index1:_}=d[m];dn.fromBufferAttribute(s,g),zt.fromBufferAttribute(s,_),p.push(dn.x,dn.y,dn.z),p.push(zt.x,zt.y,zt.z)}this.setAttribute("position",new Tt(p,3))}}class ci{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,r=this.getPoint(0),o=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),o+=n.distanceTo(r),t.push(o),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const o=n.length;let s;s=t||e*n[o-1];let a,l=0,u=o-1;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),a=n[r]-s,a<0)l=r+1;else{if(!(a>0)){u=r;break}u=r-1}if(r=u,n[r]===s)return r/(o-1);const h=n[r];return(r+(s-h)/(n[r+1]-h))/(o-1)}getTangent(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);const o=this.getPoint(n),s=this.getPoint(r),a=t||(o.isVector2?new mt:new S);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 S,r=[],o=[],s=[],a=new S,l=new Rt;for(let m=0;m<=e;m++){const g=m/e;r[m]=this.getTangentAt(g,new S),r[m].normalize()}o[0]=new S,s[0]=new S;let u=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=u&&(u=h,n.set(1,0,0)),d<=u&&(u=d,n.set(0,1,0)),p<=u&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[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(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(Vi(r[m-1].dot(r[m]),-1,1));o[m].applyMatrix4(l.makeRotationAxis(a,g))}s[m].crossVectors(r[m],o[m])}if(t===!0){let m=Math.acos(Vi(o[0].dot(o[e]),-1,1));m/=e,r[0].dot(a.crossVectors(o[0],o[e]))>0&&(m=-m);for(let g=1;g<=e;g++)o[g].applyMatrix4(l.makeRotationAxis(r[g],m*g)),s[g].crossVectors(r[g],o[g])}return{tangents:r,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 oi extends ci{constructor(e=0,t=0,n=1,r=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=r,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new mt,r=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=r;for(;o>r;)o-=r;o<Number.EPSILON&&(o=s?0:r),this.aClockwise!==!0||s||(o===r?o=-r:o-=r);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 h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=l-this.aX,m=u-this.aY;l=p*h-m*d+this.aX,u=p*d+m*h+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}}oi.prototype.isEllipseCurve=!0;class io extends oi{constructor(e,t,n,r,o,s){super(e,t,n,n,r,o,s),this.type="ArcCurve"}}function So(){let i=0,e=0,t=0,n=0;function r(o,s,a,l){i=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){r(s,a,u*(a-o),u*(l-s))},initNonuniformCatmullRom:function(o,s,a,l,u,h,d){let p=(s-o)/u-(a-o)/(u+h)+(a-s)/h,m=(a-s)/h-(l-s)/(h+d)+(l-a)/d;p*=h,m*=h,r(s,a,p,m)},calc:function(o){const s=o*o;return i+e*o+t*s+n*(s*o)}}}io.prototype.isArcCurve=!0;const bs=new S,ol=new So,ws=new So,To=new So;class Vh extends ci{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new S){const n=t,r=this.points,o=r.length,s=(o-(this.closed?0:1))*e;let a,l,u=Math.floor(s),h=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/o)+1)*o:h===0&&u===o-1&&(u=o-2,h=1),this.closed||u>0?a=r[(u-1)%o]:(bs.subVectors(r[0],r[1]).add(r[0]),a=bs);const d=r[u%o],p=r[(u+1)%o];if(this.closed||u+2<o?l=r[(u+2)%o]:(bs.subVectors(r[o-1],r[o-2]).add(r[o-1]),l=bs),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(p),m),y=Math.pow(p.distanceToSquared(l),m);_<1e-4&&(_=1),g<1e-4&&(g=_),y<1e-4&&(y=_),ol.initNonuniformCatmullRom(a.x,d.x,p.x,l.x,g,_,y),ws.initNonuniformCatmullRom(a.y,d.y,p.y,l.y,g,_,y),To.initNonuniformCatmullRom(a.z,d.z,p.z,l.z,g,_,y)}else this.curveType==="catmullrom"&&(ol.initCatmullRom(a.x,d.x,p.x,l.x,this.tension),ws.initCatmullRom(a.y,d.y,p.y,l.y,this.tension),To.initCatmullRom(a.z,d.z,p.z,l.z,this.tension));return n.set(ol.calc(h),ws.calc(h),To.calc(h)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.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 r=this.points[t];e.points.push(r.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 r=e.points[t];this.points.push(new S().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Ld(i,e,t,n,r){const o=.5*(n-e),s=.5*(r-t),a=i*i;return(2*t-2*n+o+s)*(i*a)+(-3*t+3*n-2*o-s)*a+o*i+t}function Ss(i,e,t,n){return function(r,o){const s=1-r;return s*s*o}(i,e)+function(r,o){return 2*(1-r)*r*o}(i,t)+function(r,o){return r*r*o}(i,n)}function va(i,e,t,n,r){return function(o,s){const a=1-o;return a*a*a*s}(i,e)+function(o,s){const a=1-o;return 3*a*a*o*s}(i,t)+function(o,s){return 3*(1-o)*o*o*s}(i,n)+function(o,s){return o*o*o*s}(i,r)}Vh.prototype.isCatmullRomCurve3=!0;class _a extends ci{constructor(e=new mt,t=new mt,n=new mt,r=new mt){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new mt){const n=t,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(va(e,r.x,o.x,s.x,a.x),va(e,r.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}}_a.prototype.isCubicBezierCurve=!0;class sl extends ci{constructor(e=new S,t=new S,n=new S,r=new S){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new S){const n=t,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(va(e,r.x,o.x,s.x,a.x),va(e,r.y,o.y,s.y,a.y),va(e,r.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}}sl.prototype.isCubicBezierCurve3=!0;class al extends ci{constructor(e=new mt,t=new mt){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new mt){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 mt;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}}al.prototype.isLineCurve=!0;class ou extends ci{constructor(e=new S,t=new S){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new S){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 ya extends ci{constructor(e=new mt,t=new mt,n=new mt){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new mt){const n=t,r=this.v0,o=this.v1,s=this.v2;return n.set(Ss(e,r.x,o.x,s.x),Ss(e,r.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}}ya.prototype.isQuadraticBezierCurve=!0;class fv extends ci{constructor(e=new S,t=new S,n=new S){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new S){const n=t,r=this.v0,o=this.v1,s=this.v2;return n.set(Ss(e,r.x,o.x,s.x),Ss(e,r.y,o.y,s.y),Ss(e,r.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}}fv.prototype.isQuadraticBezierCurve3=!0;class Kf extends ci{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new mt){const n=t,r=this.points,o=(r.length-1)*e,s=Math.floor(o),a=o-s,l=r[s===0?s:s-1],u=r[s],h=r[s>r.length-2?r.length-1:s+1],d=r[s>r.length-3?r.length-1:s+2];return n.set(Ld(a,l.x,u.x,h.x,d.x),Ld(a,l.y,u.y,h.y,d.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new mt().fromArray(r))}return this}}Kf.prototype.isSplineCurve=!0;var mv=Object.freeze({__proto__:null,ArcCurve:io,CatmullRomCurve3:Vh,CubicBezierCurve:_a,CubicBezierCurve3:sl,EllipseCurve:oi,LineCurve:al,LineCurve3:ou,QuadraticBezierCurve:ya,QuadraticBezierCurve3:fv,SplineCurve:Kf});const QT=function(i,e,t=2){const n=e&&e.length,r=n?e[0]*t:i.length;let o=ny(i,0,r,t,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u,h,d,p,m;if(n&&(o=function(g,_,y,w){const P=[];let B,G,U,X,H;for(B=0,G=_.length;B<G;B++)U=_[B]*w,X=B<G-1?_[B+1]*w:g.length,H=ny(g,U,X,w,!1),H===H.next&&(H.steiner=!0),P.push(aE(H));for(P.sort(rE),B=0;B<P.length;B++)oE(P[B],y),y=ll(y,y.next);return y}(i,e,o,t)),i.length>80*t){a=u=i[0],l=h=i[1];for(let g=t;g<r;g+=t)d=i[g],p=i[g+1],d<a&&(a=d),p<l&&(l=p),d>u&&(u=d),p>h&&(h=p);m=Math.max(u-a,h-l),m=m!==0?1/m:0}return Nd(o,s,t,a,l,m),s};function ny(i,e,t,n,r){let o,s;if(r===function(a,l,u,h){let d=0;for(let p=l,m=u-h;p<u;p+=h)d+=(a[m]-a[p])*(a[p+1]+a[m+1]),m=p;return d}(i,e,t,n)>0)for(o=e;o<t;o+=n)s=oy(o,i[o],i[o+1],s);else for(o=t-n;o>=e;o-=n)s=oy(o,i[o],i[o+1],s);return s&&Qf(s,s.next)&&(Fd(s),s=s.next),s}function ll(i,e){if(!i)return i;e||(e=i);let t,n=i;do if(t=!1,n.steiner||!Qf(n,n.next)&&yi(n.prev,n,n.next)!==0)n=n.next;else{if(Fd(n),n=e=n.prev,n===n.next)break;t=!0}while(t||n!==e);return e}function Nd(i,e,t,n,r,o,s){if(!i)return;!s&&o&&function(h,d,p,m){let g=h;do g.z===null&&(g.z=gv(g.x,g.y,d,p,m)),g.prevZ=g.prev,g.nextZ=g.next,g=g.next;while(g!==h);g.prevZ.nextZ=null,g.prevZ=null,function(_){let y,w,P,B,G,U,X,H,q=1;do{for(w=_,_=null,G=null,U=0;w;){for(U++,P=w,X=0,y=0;y<q&&(X++,P=P.nextZ,P);y++);for(H=q;X>0||H>0&&P;)X!==0&&(H===0||!P||w.z<=P.z)?(B=w,w=w.nextZ,X--):(B=P,P=P.nextZ,H--),G?G.nextZ=B:_=B,B.prevZ=G,G=B;w=P}G.nextZ=null,q*=2}while(U>1)}(g)}(i,n,r,o);let a,l,u=i;for(;i.prev!==i.next;)if(a=i.prev,l=i.next,o?tE(i,n,r,o):eE(i))e.push(a.i/t),e.push(i.i/t),e.push(l.i/t),Fd(i),i=l.next,u=l.next;else if((i=l)===u){s?s===1?Nd(i=nE(ll(i),e,t),e,t,n,r,o,2):s===2&&iE(i,e,t,n,r,o):Nd(ll(i),e,t,n,r,o,1);break}}function eE(i){const e=i.prev,t=i,n=i.next;if(yi(e,t,n)>=0)return!1;let r=i.next.next;for(;r!==i.prev;){if(Wh(e.x,e.y,t.x,t.y,n.x,n.y,r.x,r.y)&&yi(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function tE(i,e,t,n){const r=i.prev,o=i,s=i.next;if(yi(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,u=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,h=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,d=gv(a,l,e,t,n),p=gv(u,h,e,t,n);let m=i.prevZ,g=i.nextZ;for(;m&&m.z>=d&&g&&g.z<=p;){if(m!==i.prev&&m!==i.next&&Wh(r.x,r.y,o.x,o.y,s.x,s.y,m.x,m.y)&&yi(m.prev,m,m.next)>=0||(m=m.prevZ,g!==i.prev&&g!==i.next&&Wh(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&yi(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;m&&m.z>=d;){if(m!==i.prev&&m!==i.next&&Wh(r.x,r.y,o.x,o.y,s.x,s.y,m.x,m.y)&&yi(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;g&&g.z<=p;){if(g!==i.prev&&g!==i.next&&Wh(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&yi(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function nE(i,e,t){let n=i;do{const r=n.prev,o=n.next.next;!Qf(r,o)&&iy(r,n,n.next,o)&&Dd(r,o)&&Dd(o,r)&&(e.push(r.i/t),e.push(n.i/t),e.push(o.i/t),Fd(n),Fd(n.next),n=i=o),n=n.next}while(n!==i);return ll(n)}function iE(i,e,t,n,r,o){let s=i;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&lE(s,a)){let l=ry(s,a);return s=ll(s,s.next),l=ll(l,l.next),Nd(s,e,t,n,r,o),void Nd(l,e,t,n,r,o)}a=a.next}s=s.next}while(s!==i)}function rE(i,e){return i.x-e.x}function oE(i,e){if(e=function(t,n){let r=n;const o=t.x,s=t.y;let a,l=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){const g=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(g<=o&&g>l){if(l=g,g===o){if(s===r.y)return r;if(s===r.next.y)return r.next}a=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!a)return null;if(o===l)return a;const u=a,h=a.x,d=a.y;let p,m=1/0;r=a;do o>=r.x&&r.x>=h&&o!==r.x&&Wh(s<d?o:l,s,h,d,s<d?l:o,s,r.x,r.y)&&(p=Math.abs(s-r.y)/(o-r.x),Dd(r,t)&&(p<m||p===m&&(r.x>a.x||r.x===a.x&&sE(a,r)))&&(a=r,m=p)),r=r.next;while(r!==u);return a}(i,e)){const t=ry(e,i);ll(e,e.next),ll(t,t.next)}}function sE(i,e){return yi(i.prev,i,e.prev)<0&&yi(e.next,i,i.next)<0}function gv(i,e,t,n,r){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-t)*r)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function aE(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function Wh(i,e,t,n,r,o,s,a){return(r-s)*(e-a)-(i-s)*(o-a)>=0&&(i-s)*(n-a)-(t-s)*(e-a)>=0&&(t-s)*(o-a)-(r-s)*(n-a)>=0}function lE(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(t,n){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==n.i&&r.next.i!==n.i&&iy(r,r.next,t,n))return!0;r=r.next}while(r!==t);return!1}(i,e)&&(Dd(i,e)&&Dd(e,i)&&function(t,n){let r=t,o=!1;const s=(t.x+n.x)/2,a=(t.y+n.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&s<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(o=!o),r=r.next;while(r!==t);return o}(i,e)&&(yi(i.prev,i,e.prev)||yi(i,e.prev,e))||Qf(i,e)&&yi(i.prev,i,i.next)>0&&yi(e.prev,e,e.next)>0)}function yi(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function Qf(i,e){return i.x===e.x&&i.y===e.y}function iy(i,e,t,n){const r=tm(yi(i,e,t)),o=tm(yi(i,e,n)),s=tm(yi(t,n,i)),a=tm(yi(t,n,e));return r!==o&&s!==a||!(r!==0||!em(i,t,e))||!(o!==0||!em(i,n,e))||!(s!==0||!em(t,i,n))||!(a!==0||!em(t,e,n))}function em(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function tm(i){return i>0?1:i<0?-1:0}function Dd(i,e){return yi(i.prev,i,i.next)<0?yi(i,e,i.next)>=0&&yi(i,i.prev,e)>=0:yi(i,e,i.prev)<0||yi(i,i.next,e)<0}function ry(i,e){const t=new vv(i.i,i.x,i.y),n=new vv(e.i,e.x,e.y),r=i.next,o=e.prev;return i.next=e,e.prev=i,t.next=r,r.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}function oy(i,e,t,n){const r=new vv(i,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Fd(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function vv(i,e,t){this.i=i,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 Ts{static area(e){const t=e.length;let n=0;for(let r=t-1,o=0;o<t;r=o++)n+=e[r].x*e[o].y-e[o].x*e[r].y;return .5*n}static isClockWise(e){return Ts.area(e)<0}static triangulateShape(e,t){const n=[],r=[],o=[];sy(e),ay(n,e);let s=e.length;t.forEach(sy);for(let l=0;l<t.length;l++)r.push(s),s+=t[l].length,ay(n,t[l]);const a=QT(n,r);for(let l=0;l<a.length;l+=3)o.push(a.slice(l,l+3));return o}}function sy(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function ay(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class qo extends Xt{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],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,h=t.steps!==void 0?t.steps:1;let d=t.depth!==void 0?t.depth:100,p=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,P=t.UVGenerator!==void 0?t.UVGenerator:uE;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=t.amount);let B,G,U,X,H,q=!1;w&&(B=w.getSpacedPoints(h),q=!0,p=!1,G=w.computeFrenetFrames(h,!1),U=new S,X=new S,H=new S),p||(y=0,m=0,g=0,_=0);const me=a.extractPoints(u);let ue=me.shape;const oe=me.holes;if(!Ts.isClockWise(ue)){ue=ue.reverse();for(let Ze=0,re=oe.length;Ze<re;Ze++){const Te=oe[Ze];Ts.isClockWise(Te)&&(oe[Ze]=Te.reverse())}}const ce=Ts.triangulateShape(ue,oe),le=ue;for(let Ze=0,re=oe.length;Ze<re;Ze++){const Te=oe[Ze];ue=ue.concat(Te)}function _e(Ze,re,Te){return re||console.error("THREE.ExtrudeGeometry: vec does not exist"),re.clone().multiplyScalar(Te).add(Ze)}const je=ue.length,ke=ce.length;function Ee(Ze,re,Te){let Ge,He,Oe;const et=Ze.x-re.x,Ct=Ze.y-re.y,It=Te.x-Ze.x,Pt=Te.y-Ze.y,hn=et*et+Ct*Ct,Ei=et*Pt-Ct*It;if(Math.abs(Ei)>Number.EPSILON){const kn=Math.sqrt(hn),qr=Math.sqrt(It*It+Pt*Pt),Ep=re.x-Ct/kn,Mp=re.y+et/kn,Ap=((Te.x-Pt/qr-Ep)*Pt-(Te.y+It/qr-Mp)*It)/(et*Pt-Ct*It);Ge=Ep+et*Ap-Ze.x,He=Mp+Ct*Ap-Ze.y;const Fr=Ge*Ge+He*He;if(Fr<=2)return new mt(Ge,He);Oe=Math.sqrt(Fr/2)}else{let kn=!1;et>Number.EPSILON?It>Number.EPSILON&&(kn=!0):et<-Number.EPSILON?It<-Number.EPSILON&&(kn=!0):Math.sign(Ct)===Math.sign(Pt)&&(kn=!0),kn?(Ge=-Ct,He=et,Oe=Math.sqrt(hn)):(Ge=et,He=Ct,Oe=Math.sqrt(hn/2))}return new mt(Ge/Oe,He/Oe)}const Ae=[];for(let Ze=0,re=le.length,Te=re-1,Ge=Ze+1;Ze<re;Ze++,Te++,Ge++)Te===re&&(Te=0),Ge===re&&(Ge=0),Ae[Ze]=Ee(le[Ze],le[Te],le[Ge]);const Je=[];let st,ct=Ae.concat();for(let Ze=0,re=oe.length;Ze<re;Ze++){const Te=oe[Ze];st=[];for(let Ge=0,He=Te.length,Oe=He-1,et=Ge+1;Ge<He;Ge++,Oe++,et++)Oe===He&&(Oe=0),et===He&&(et=0),st[Ge]=Ee(Te[Ge],Te[Oe],Te[et]);Je.push(st),ct=ct.concat(st)}for(let Ze=0;Ze<y;Ze++){const re=Ze/y,Te=m*Math.cos(re*Math.PI/2),Ge=g*Math.sin(re*Math.PI/2)+_;for(let He=0,Oe=le.length;He<Oe;He++){const et=_e(le[He],Ae[He],Ge);Ke(et.x,et.y,-Te)}for(let He=0,Oe=oe.length;He<Oe;He++){const et=oe[He];st=Je[He];for(let Ct=0,It=et.length;Ct<It;Ct++){const Pt=_e(et[Ct],st[Ct],Ge);Ke(Pt.x,Pt.y,-Te)}}}const he=g+_;for(let Ze=0;Ze<je;Ze++){const re=p?_e(ue[Ze],ct[Ze],he):ue[Ze];q?(X.copy(G.normals[0]).multiplyScalar(re.x),U.copy(G.binormals[0]).multiplyScalar(re.y),H.copy(B[0]).add(X).add(U),Ke(H.x,H.y,H.z)):Ke(re.x,re.y,0)}for(let Ze=1;Ze<=h;Ze++)for(let re=0;re<je;re++){const Te=p?_e(ue[re],ct[re],he):ue[re];q?(X.copy(G.normals[Ze]).multiplyScalar(Te.x),U.copy(G.binormals[Ze]).multiplyScalar(Te.y),H.copy(B[Ze]).add(X).add(U),Ke(H.x,H.y,H.z)):Ke(Te.x,Te.y,d/h*Ze)}for(let Ze=y-1;Ze>=0;Ze--){const re=Ze/y,Te=m*Math.cos(re*Math.PI/2),Ge=g*Math.sin(re*Math.PI/2)+_;for(let He=0,Oe=le.length;He<Oe;He++){const et=_e(le[He],Ae[He],Ge);Ke(et.x,et.y,d+Te)}for(let He=0,Oe=oe.length;He<Oe;He++){const et=oe[He];st=Je[He];for(let Ct=0,It=et.length;Ct<It;Ct++){const Pt=_e(et[Ct],st[Ct],Ge);q?Ke(Pt.x,Pt.y+B[h-1].y,B[h-1].x+Te):Ke(Pt.x,Pt.y,d+Te)}}}function de(Ze,re){let Te=Ze.length;for(;--Te>=0;){const Ge=Te;let He=Te-1;He<0&&(He=Ze.length-1);for(let Oe=0,et=h+2*y;Oe<et;Oe++){const Ct=je*Oe,It=je*(Oe+1);ze(re+Ge+Ct,re+He+Ct,re+He+It,re+Ge+It)}}}function Ke(Ze,re,Te){l.push(Ze),l.push(re),l.push(Te)}function Ve(Ze,re,Te){dt(Ze),dt(re),dt(Te);const Ge=r.length/3,He=P.generateTopUV(n,r,Ge-3,Ge-2,Ge-1);pt(He[0]),pt(He[1]),pt(He[2])}function ze(Ze,re,Te,Ge){dt(Ze),dt(re),dt(Ge),dt(re),dt(Te),dt(Ge);const He=r.length/3,Oe=P.generateSideWallUV(n,r,He-6,He-3,He-2,He-1);pt(Oe[0]),pt(Oe[1]),pt(Oe[3]),pt(Oe[1]),pt(Oe[2]),pt(Oe[3])}function dt(Ze){r.push(l[3*Ze+0]),r.push(l[3*Ze+1]),r.push(l[3*Ze+2])}function pt(Ze){o.push(Ze.x),o.push(Ze.y)}(function(){const Ze=r.length/3;if(p){let re=0,Te=je*re;for(let Ge=0;Ge<ke;Ge++){const He=ce[Ge];Ve(He[2]+Te,He[1]+Te,He[0]+Te)}re=h+2*y,Te=je*re;for(let Ge=0;Ge<ke;Ge++){const He=ce[Ge];Ve(He[0]+Te,He[1]+Te,He[2]+Te)}}else{for(let re=0;re<ke;re++){const Te=ce[re];Ve(Te[2],Te[1],Te[0])}for(let re=0;re<ke;re++){const Te=ce[re];Ve(Te[0]+je*h,Te[1]+je*h,Te[2]+je*h)}}n.addGroup(Ze,r.length/3-Ze,0)})(),function(){const Ze=r.length/3;let re=0;de(le,re),re+=le.length;for(let Te=0,Ge=oe.length;Te<Ge;Te++){const He=oe[Te];de(He,re),re+=He.length}n.addGroup(Ze,r.length/3-Ze,1)}()}this.setAttribute("position",new Tt(r,3)),this.setAttribute("uv",new Tt(o,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(t,n,r){if(r.shapes=[],Array.isArray(t))for(let o=0,s=t.length;o<s;o++){const a=t[o];r.shapes.push(a.uuid)}else r.shapes.push(t.uuid);return n.extrudePath!==void 0&&(r.options.extrudePath=n.extrudePath.toJSON()),r}(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 r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new mv[r.type]().fromJSON(r)),new qo(n,e.options)}}const uE={generateTopUV:function(i,e,t,n,r){const o=e[3*t],s=e[3*t+1],a=e[3*n],l=e[3*n+1],u=e[3*r],h=e[3*r+1];return[new mt(o,s),new mt(a,l),new mt(u,h)]},generateSideWallUV:function(i,e,t,n,r,o){const s=e[3*t],a=e[3*t+1],l=e[3*t+2],u=e[3*n],h=e[3*n+1],d=e[3*n+2],p=e[3*r],m=e[3*r+1],g=e[3*r+2],_=e[3*o],y=e[3*o+1],w=e[3*o+2];return Math.abs(a-h)<Math.abs(s-u)?[new mt(s,1-l),new mt(u,1-d),new mt(p,1-g),new mt(_,1-w)]:[new mt(a,1-l),new mt(h,1-d),new mt(m,1-g),new mt(y,1-w)]}};class Xh extends jt{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 Xh(e.radius,e.detail)}}class qh extends Xt{constructor(e,t=12,n=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Vi(r,0,2*Math.PI);const o=[],s=[],a=[],l=1/t,u=new S,h=new mt;for(let d=0;d<=t;d++){const p=n+d*l*r,m=Math.sin(p),g=Math.cos(p);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),h.x=d/t,h.y=_/(e.length-1),a.push(h.x,h.y)}for(let d=0;d<t;d++)for(let p=0;p<e.length-1;p++){const m=p+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 Tt(s,3)),this.setAttribute("uv",new Tt(a,2)),this.computeVertexNormals(),r===2*Math.PI){const d=this.attributes.normal.array,p=new S,m=new S,g=new S,_=t*e.length*3;for(let y=0,w=0;y<e.length;y++,w+=3)p.x=d[w+0],p.y=d[w+1],p.z=d[w+2],m.x=d[_+w+0],m.y=d[_+w+1],m.z=d[_+w+2],g.addVectors(p,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 qh(e.points,e.segments,e.phiStart,e.phiLength)}}class su extends jt{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 su(e.radius,e.detail)}}class Bd extends Xt{constructor(e,t,n){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};const r=[],o=[],s=[],a=[],l=1e-5,u=new S,h=new S,d=new S,p=new S,m=new S;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 P=w/t;e(P,y,h),o.push(h.x,h.y,h.z),P-l>=0?(e(P-l,y,d),p.subVectors(h,d)):(e(P+l,y,d),p.subVectors(d,h)),y-l>=0?(e(P,y-l,d),m.subVectors(h,d)):(e(P,y+l,d),m.subVectors(d,h)),u.crossVectors(p,m).normalize(),s.push(u.x,u.y,u.z),a.push(P,y)}}for(let _=0;_<n;_++)for(let y=0;y<t;y++){const w=_*g+y,P=_*g+y+1,B=(_+1)*g+y+1,G=(_+1)*g+y;r.push(w,P,G),r.push(P,B,G)}this.setIndex(r),this.setAttribute("position",new Tt(o,3)),this.setAttribute("normal",new Tt(s,3)),this.setAttribute("uv",new Tt(a,2))}}class Yh extends Xt{constructor(e=.5,t=1,n=8,r=1,o=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:o,thetaLength:s},n=Math.max(3,n);const a=[],l=[],u=[],h=[];let d=e;const p=(t-e)/(r=Math.max(1,r)),m=new S,g=new mt;for(let _=0;_<=r;_++){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,h.push(g.x,g.y)}d+=p}for(let _=0;_<r;_++){const y=_*(n+1);for(let w=0;w<n;w++){const P=w+y,B=P,G=P+n+1,U=P+n+2,X=P+1;a.push(B,G,X),a.push(G,U,X)}}this.setIndex(a),this.setAttribute("position",new Tt(l,3)),this.setAttribute("normal",new Tt(u,3)),this.setAttribute("uv",new Tt(h,2))}static fromJSON(e){return new Yh(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class au extends Xt{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],o=[],s=[];let a=0,l=0;if(Array.isArray(e)===!1)u(e);else for(let h=0;h<e.length;h++)u(e[h]),this.addGroup(a,l,h),a+=l,l=0;function u(h){const d=r.length/3,p=h.extractPoints(t);let m=p.shape;const g=p.holes;Ts.isClockWise(m)===!1&&(m=m.reverse());for(let y=0,w=g.length;y<w;y++){const P=g[y];Ts.isClockWise(P)===!0&&(g[y]=P.reverse())}const _=Ts.triangulateShape(m,g);for(let y=0,w=g.length;y<w;y++){const P=g[y];m=m.concat(P)}for(let y=0,w=m.length;y<w;y++){const P=m[y];r.push(P.x,P.y,0),o.push(0,0,1),s.push(P.x,P.y)}for(let y=0,w=_.length;y<w;y++){const P=_[y],B=P[0]+d,G=P[1]+d,U=P[2]+d;n.push(B,G,U),l+=3}}this.setIndex(n),this.setAttribute("position",new Tt(r,3)),this.setAttribute("normal",new Tt(o,3)),this.setAttribute("uv",new Tt(s,2))}toJSON(){const e=super.toJSON();return function(t,n){if(n.shapes=[],Array.isArray(t))for(let r=0,o=t.length;r<o;r++){const s=t[r];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 r=0,o=e.shapes.length;r<o;r++){const s=t[e.shapes[r]];n.push(s)}return new au(n,e.curveSegments)}}class lu extends Xt{constructor(e=1,t=8,n=6,r=0,o=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,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 h=[],d=new S,p=new S,m=[],g=[],_=[],y=[];for(let w=0;w<=n;w++){const P=[],B=w/n;let G=0;w==0&&s==0?G=.5/t:w==n&&l==Math.PI&&(G=-.5/t);for(let U=0;U<=t;U++){const X=U/t;d.x=-e*Math.cos(r+X*o)*Math.sin(s+B*a),d.y=e*Math.cos(s+B*a),d.z=e*Math.sin(r+X*o)*Math.sin(s+B*a),g.push(d.x,d.y,d.z),p.copy(d).normalize(),_.push(p.x,p.y,p.z),y.push(X+G,1-B),P.push(u++)}h.push(P)}for(let w=0;w<n;w++)for(let P=0;P<t;P++){const B=h[w][P+1],G=h[w][P],U=h[w+1][P],X=h[w+1][P+1];(w!==0||s>0)&&m.push(B,G,X),(w!==n-1||l<Math.PI)&&m.push(G,U,X)}this.setIndex(m),this.setAttribute("position",new Tt(g,3)),this.setAttribute("normal",new Tt(_,3)),this.setAttribute("uv",new Tt(y,2))}static fromJSON(e){return new lu(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class $h extends jt{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 $h(e.radius,e.detail)}}class nm extends qo{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 Xt;const r=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(r,t),this.type="TextGeometry"}}class Jh extends Xt{constructor(e=1,t=.4,n=8,r=6,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:o},n=Math.floor(n),r=Math.floor(r);const s=[],a=[],l=[],u=[],h=new S,d=new S,p=new S;for(let m=0;m<=n;m++)for(let g=0;g<=r;g++){const _=g/r*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),h.x=e*Math.cos(_),h.y=e*Math.sin(_),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(g/r),u.push(m/n)}for(let m=1;m<=n;m++)for(let g=1;g<=r;g++){const _=(r+1)*m+g-1,y=(r+1)*(m-1)+g-1,w=(r+1)*(m-1)+g,P=(r+1)*m+g;s.push(_,y,P),s.push(y,w,P)}this.setIndex(s),this.setAttribute("position",new Tt(a,3)),this.setAttribute("normal",new Tt(l,3)),this.setAttribute("uv",new Tt(u,2))}static fromJSON(e){return new Jh(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Zh extends Xt{constructor(e=1,t=.4,n=64,r=8,o=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:o,q:s},n=Math.floor(n),r=Math.floor(r);const a=[],l=[],u=[],h=[],d=new S,p=new S,m=new S,g=new S,_=new S,y=new S,w=new S;for(let B=0;B<=n;++B){const G=B/n*o*Math.PI*2;P(G,o,s,e,m),P(G+.01,o,s,e,g),y.subVectors(g,m),w.addVectors(g,m),_.crossVectors(y,w),w.crossVectors(_,y),_.normalize(),w.normalize();for(let U=0;U<=r;++U){const X=U/r*Math.PI*2,H=-t*Math.cos(X),q=t*Math.sin(X);d.x=m.x+(H*w.x+q*_.x),d.y=m.y+(H*w.y+q*_.y),d.z=m.z+(H*w.z+q*_.z),l.push(d.x,d.y,d.z),p.subVectors(d,m).normalize(),u.push(p.x,p.y,p.z),h.push(B/n),h.push(U/r)}}for(let B=1;B<=n;B++)for(let G=1;G<=r;G++){const U=(r+1)*(B-1)+(G-1),X=(r+1)*B+(G-1),H=(r+1)*B+G,q=(r+1)*(B-1)+G;a.push(U,X,q),a.push(X,H,q)}function P(B,G,U,X,H){const q=Math.cos(B),me=Math.sin(B),ue=U/G*B,oe=Math.cos(ue);H.x=X*(2+oe)*.5*q,H.y=X*(2+oe)*me*.5,H.z=X*Math.sin(ue)*.5}this.setIndex(a),this.setAttribute("position",new Tt(l,3)),this.setAttribute("normal",new Tt(u,3)),this.setAttribute("uv",new Tt(h,2))}static fromJSON(e){return new Zh(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Kh extends Xt{constructor(e,t=64,n=1,r=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:o};const s=e.computeFrenetFrames(t,o);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new S,l=new S,u=new mt;let h=new S;const d=[],p=[],m=[],g=[];function _(y){h=e.getPointAt(y/t,h);const w=s.normals[y],P=s.binormals[y];for(let B=0;B<=r;B++){const G=B/r*Math.PI*2,U=Math.sin(G),X=-Math.cos(G);l.x=X*w.x+U*P.x,l.y=X*w.y+U*P.y,l.z=X*w.z+U*P.z,l.normalize(),p.push(l.x,l.y,l.z),a.x=h.x+n*l.x,a.y=h.y+n*l.y,a.z=h.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<=r;w++)u.x=y/t,u.y=w/r,m.push(u.x,u.y)}(),function(){for(let y=1;y<=t;y++)for(let w=1;w<=r;w++){const P=(r+1)*(y-1)+(w-1),B=(r+1)*y+(w-1),G=(r+1)*y+w,U=(r+1)*(y-1)+w;g.push(P,B,U),g.push(B,G,U)}}()})(),this.setIndex(g),this.setAttribute("position",new Tt(d,3)),this.setAttribute("normal",new Tt(p,3)),this.setAttribute("uv",new Tt(m,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Kh(new mv[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class _v extends Xt{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],r={},o=new S;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,h=l.length;u<h;++u){const d=l[u],p=d.start;for(let m=p,g=p+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 P=n[0]+","+n[1];r[P]===void 0&&(r[P]={index1:n[0],index2:n[1]})}}for(const u in r){const h=r[u];o.fromBufferAttribute(s,h.index1),t.push(o.x,o.y,o.z),o.fromBufferAttribute(s,h.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 h=3*a+u;o.fromBufferAttribute(s,h),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 Tt(t,3))}}var ly=Object.freeze({__proto__:null,BoxGeometry:xo,BoxBufferGeometry:xo,CircleGeometry:_t,CircleBufferGeometry:_t,ConeGeometry:Lt,ConeBufferGeometry:Lt,CylinderGeometry:Vt,CylinderBufferGeometry:Vt,DodecahedronGeometry:Kt,DodecahedronBufferGeometry:Kt,EdgesGeometry:Xi,ExtrudeGeometry:qo,ExtrudeBufferGeometry:qo,IcosahedronGeometry:Xh,IcosahedronBufferGeometry:Xh,LatheGeometry:qh,LatheBufferGeometry:qh,OctahedronGeometry:su,OctahedronBufferGeometry:su,ParametricGeometry:Bd,ParametricBufferGeometry:Bd,PlaneGeometry:Ki,PlaneBufferGeometry:Ki,PolyhedronGeometry:jt,PolyhedronBufferGeometry:jt,RingGeometry:Yh,RingBufferGeometry:Yh,ShapeGeometry:au,ShapeBufferGeometry:au,SphereGeometry:lu,SphereBufferGeometry:lu,TetrahedronGeometry:$h,TetrahedronBufferGeometry:$h,TextGeometry:nm,TextBufferGeometry:nm,TorusGeometry:Jh,TorusBufferGeometry:Jh,TorusKnotGeometry:Zh,TorusKnotBufferGeometry:Zh,TubeGeometry:Kh,TubeBufferGeometry:Kh,WireframeGeometry:_v});class yv extends Bi{constructor(e){super(),this.type="ShadowMaterial",this.color=new Dt(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}yv.prototype.isShadowMaterial=!0;class Qh extends or{constructor(e){super(e),this.type="RawShaderMaterial"}}Qh.prototype.isRawShaderMaterial=!0;class im extends Bi{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Dt(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 Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(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}}im.prototype.isMeshStandardMaterial=!0;class xv extends im{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 mt(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=Vi(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 Dt(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 Dt).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}}xv.prototype.isMeshPhysicalMaterial=!0;class rm extends Bi{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Dt(16777215),this.specular=new Dt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Co,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}}rm.prototype.isMeshPhongMaterial=!0;class bv extends Bi{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Dt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(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}}bv.prototype.isMeshToonMaterial=!0;class wv extends Bi{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(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}}wv.prototype.isMeshNormalMaterial=!0;class om extends Bi{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Dt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Co,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}}om.prototype.isMeshLambertMaterial=!0;class Sv extends Bi{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Dt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(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}}Sv.prototype.isMeshMatcapMaterial=!0;class Tv extends ki{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}}Tv.prototype.isLineDashedMaterial=!0;var hE=Object.freeze({__proto__:null,ShadowMaterial:yv,SpriteMaterial:Ql,RawShaderMaterial:Qh,ShaderMaterial:or,PointsMaterial:ie,MeshPhysicalMaterial:xv,MeshStandardMaterial:im,MeshPhongMaterial:rm,MeshToonMaterial:bv,MeshNormalMaterial:wv,MeshLambertMaterial:om,MeshDepthMaterial:bn,MeshDistanceMaterial:Oh,MeshBasicMaterial:gi,MeshMatcapMaterial:Sv,LineDashedMaterial:Tv,LineBasicMaterial:ki,Material:Bi});const si={arraySlice:function(i,e,t){return si.isTypedArray(i)?new i.constructor(i.subarray(e,t!==void 0?t:i.length)):i.slice(e,t)},convertArray:function(i,e,t){return!i||!t&&i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){const e=i.length,t=new Array(e);for(let n=0;n!==e;++n)t[n]=n;return t.sort(function(n,r){return i[n]-i[r]}),t},sortedArray:function(i,e,t){const n=i.length,r=new i.constructor(n);for(let o=0,s=0;s!==n;++o){const a=t[o]*e;for(let l=0;l!==e;++l)r[s++]=i[a+l]}return r},flattenJSON:function(i,e,t,n){let r=1,o=i[0];for(;o!==void 0&&o[n]===void 0;)o=i[r++];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=i[r++];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=i[r++];while(o!==void 0);else do s=o[n],s!==void 0&&(e.push(o.time),t.push(s)),o=i[r++];while(o!==void 0)},subclip:function(i,e,t,n,r=30){const o=i.clone();o.name=e;const s=[];for(let l=0;l<o.tracks.length;++l){const u=o.tracks[l],h=u.getValueSize(),d=[],p=[];for(let m=0;m<u.times.length;++m){const g=u.times[m]*r;if(!(g<t||g>=n)){d.push(u.times[m]);for(let _=0;_<h;++_)p.push(u.values[m*h+_])}}d.length!==0&&(u.times=si.convertArray(d,u.times.constructor),u.values=si.convertArray(p,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(i,e=0,t=i,n=30){n<=0&&(n=30);const r=t.tracks.length,o=e/n;for(let s=0;s<r;++s){const a=t.tracks[s],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const u=i.tracks.find(function(w){return w.name===a.name&&w.ValueTypeName===l});if(u===void 0)continue;let h=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);let p=0;const m=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const g=a.times.length-1;let _;if(o<=a.times[0]){const w=h,P=d-h;_=si.arraySlice(a.values,w,P)}else if(o>=a.times[g]){const w=g*d+h,P=w+d-h;_=si.arraySlice(a.values,w,P)}else{const w=a.createInterpolant(),P=h,B=d-h;w.evaluate(o),_=si.arraySlice(w.resultBuffer,P,B)}l==="quaternion"&&new Fi().fromArray(_).normalize().conjugate().toArray(_);const y=u.times.length;for(let w=0;w<y;++w){const P=w*m+p;if(l==="quaternion")Fi.multiplyQuaternionsFlat(u.values,P,_,0,u.values,P);else{const B=m-2*p;for(let G=0;G<B;++G)u.values[P+G]-=_[G]}}}return i.blendMode=Ue,i}};class xa{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r: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,r=t[n],o=t[n-1];e:{t:{let s;n:{i:if(!(e<r)){for(let a=n+2;;){if(r===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=r,r=t[++n],e<r)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,r);if(n===l)break;if(r=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(r=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,o,e)}this._cachedIndex=n,this.intervalChanged_(n,o,r)}return this.interpolate_(n,o,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r;for(let s=0;s!==r;++s)t[s]=n[o+s];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}xa.prototype.beforeStart_=xa.prototype.copySampleValue_,xa.prototype.afterEnd_=xa.prototype.copySampleValue_;class uy extends xa{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:zi,endingEnd:zi}}intervalChanged_(e,t,n){const r=this.parameterPositions;let o=e-2,s=e+1,a=r[o],l=r[s];if(a===void 0)switch(this.getSettings_().endingStart){case ls:o=e,a=2*t-n;break;case Pl:o=r.length-2,a=t+r[o]-r[o+1];break;default:o=e,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case ls:s=e,l=2*n-t;break;case Pl:s=1,l=n+r[1]-r[0];break;default:s=e-1,l=t}const u=.5*(n-t),h=this.valueSize;this._weightPrev=u/(t-a),this._weightNext=u/(l-n),this._offsetPrev=o*h,this._offsetNext=s*h}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,m=this._weightNext,g=(n-t)/(r-t),_=g*g,y=_*g,w=-p*y+2*p*_-p*g,P=(1+p)*y+(-1.5-2*p)*_+(-.5+p)*g+1,B=(-1-m)*y+(1.5+m)*_+.5*g,G=m*y-m*_;for(let U=0;U!==a;++U)o[U]=w*s[h+U]+P*s[u+U]+B*s[l+U]+G*s[d+U];return o}}class Ev extends xa{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,h=(n-t)/(r-t),d=1-h;for(let p=0;p!==a;++p)o[p]=s[u+p]*d+s[l+p]*h;return o}}class hy extends xa{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Yo{constructor(e,t,n,r){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=si.convertArray(t,this.TimeBufferType),this.values=si.convertArray(n,this.ValueBufferType),this.setInterpolation(r||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:si.convertArray(e.times,Array),values:si.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new hy(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Ev(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new uy(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case as:t=this.InterpolantFactoryMethodDiscrete;break;case Cl:t=this.InterpolantFactoryMethodLinear;break;case Do: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 as;case this.InterpolantFactoryMethodLinear:return Cl;case this.InterpolantFactoryMethodSmooth:return Do}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let o=0,s=r-1;for(;o!==r&&n[o]<e;)++o;for(;s!==-1&&n[s]>t;)--s;if(++s,o!==0||s!==r){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=si.arraySlice(n,o,s),this.values=si.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,r=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(r!==void 0&&si.isTypedArray(r))for(let a=0,l=r.length;a!==l;++a){const u=r[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=si.arraySlice(this.times),t=si.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Do,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(r)l=!0;else{const h=a*n,d=h-n,p=h+n;for(let m=0;m!==n;++m){const g=t[h+m];if(g!==t[d+m]||g!==t[p+m]){l=!0;break}}}if(l){if(a!==s){e[s]=e[a];const h=a*n,d=s*n;for(let p=0;p!==n;++p)t[d+p]=t[h+p]}++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=si.arraySlice(e,0,s),this.values=si.arraySlice(t,0,s*n)):(this.times=e,this.values=t),this}clone(){const e=si.arraySlice(this.times,0),t=si.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Yo.prototype.TimeBufferType=Float32Array,Yo.prototype.ValueBufferType=Float32Array,Yo.prototype.DefaultInterpolation=Cl;class uu extends Yo{}uu.prototype.ValueTypeName="bool",uu.prototype.ValueBufferType=Array,uu.prototype.DefaultInterpolation=as,uu.prototype.InterpolantFactoryMethodLinear=void 0,uu.prototype.InterpolantFactoryMethodSmooth=void 0;class Mv extends Yo{}Mv.prototype.ValueTypeName="color";class Ud extends Yo{}Ud.prototype.ValueTypeName="number";class cy extends xa{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(n-t)/(r-t);let u=e*a;for(let h=u+a;u!==h;u+=4)Fi.slerpFlat(o,0,s,u-a,s,u,l);return o}}class ec extends Yo{InterpolantFactoryMethodLinear(e){return new cy(this.times,this.values,this.getValueSize(),e)}}ec.prototype.ValueTypeName="quaternion",ec.prototype.DefaultInterpolation=Cl,ec.prototype.InterpolantFactoryMethodSmooth=void 0;class hu extends Yo{}hu.prototype.ValueTypeName="string",hu.prototype.ValueBufferType=Array,hu.prototype.DefaultInterpolation=as,hu.prototype.InterpolantFactoryMethodLinear=void 0,hu.prototype.InterpolantFactoryMethodSmooth=void 0;class kd extends Yo{}kd.prototype.ValueTypeName="vector";class Gd{constructor(e,t=-1,n,r=Ys){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Ar(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let s=0,a=n.length;s!==a;++s)t.push(cE(n[s]).scale(r));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,r={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(Yo.toJSON(n[o]));return r}static CreateFromMorphTargetSequence(e,t,n,r){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 h=si.getKeyframeOrder(l);l=si.sortedArray(l,1,h),u=si.sortedArray(u,1,h),r||l[0]!==0||(l.push(o),u.push(u[0])),s.push(new Ud(".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 r=e;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},o=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const u=e[a],h=u.name.match(o);if(h&&h.length>1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(u)}}const s=[];for(const a in r)s.push(this.CreateFromMorphTargetSequence(a,r[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(h,d,p,m,g){if(p.length!==0){const _=[],y=[];si.flattenJSON(p,_,y,m),_.length!==0&&g.push(new h(d,_,y))}},r=[],o=e.name||"default",s=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h<u.length;h++){const d=u[h].keys;if(d&&d.length!==0)if(d[0].morphTargets){const p={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let g=0;g<d[m].morphTargets.length;g++)p[d[m].morphTargets[g]]=-1;for(const g in p){const _=[],y=[];for(let w=0;w!==d[m].morphTargets.length;++w){const P=d[m];_.push(P.time),y.push(P.morphTarget===g?1:0)}r.push(new Ud(".morphTargetInfluence["+g+"]",_,y))}l=p.length*(s||1)}else{const p=".bones["+t[h].name+"]";n(kd,p+".position",d,"pos",r),n(ec,p+".quaternion",d,"rot",r),n(kd,p+".scale",d,"scl",r)}}return r.length===0?null:new this(o,l,r,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const r=this.tracks[t];e=Math.max(e,r.times[r.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 cE(i){if(i.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 Ud;case"vector":case"vector2":case"vector3":case"vector4":return kd;case"color":return Mv;case"quaternion":return ec;case"bool":case"boolean":return uu;case"string":return hu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(i.type);if(i.times===void 0){const t=[],n=[];si.flattenJSON(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const cu={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class Av{constructor(e,t,n){const r=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(h){a++,o===!1&&r.onStart!==void 0&&r.onStart(h,s,a),o=!0},this.itemEnd=function(h){s++,r.onProgress!==void 0&&r.onProgress(h,s,a),s===a&&(o=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(h){r.onError!==void 0&&r.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return u.push(h,d),this},this.removeHandler=function(h){const d=u.indexOf(h);return d!==-1&&u.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=u.length;d<p;d+=2){const m=u[d],g=u[d+1];if(m.global&&(m.lastIndex=0),m.test(h))return g}return null}}}const dy=new Av;class gr{constructor(e){this.manager=e!==void 0?e:dy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,o){n.load(e,r,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 $o={};class Jo extends gr{constructor(e){super(e)}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=cu.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;if($o[e]!==void 0)return void $o[e].push({onLoad:t,onProgress:n,onError:r});const a=e.match(/^data:(.*?)(;base64)?,(.*)$/);let l;if(a){const u=a[1],h=!!a[2];let d=a[3];d=decodeURIComponent(d),h&&(d=atob(d));try{let p;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);p=m==="blob"?new Blob([g.buffer],{type:u}):g.buffer;break;case"document":p=new DOMParser().parseFromString(d,u);break;case"json":p=JSON.parse(d);break;default:p=d}setTimeout(function(){t&&t(p),o.manager.itemEnd(e)},0)}catch(p){setTimeout(function(){r&&r(p),o.manager.itemError(e),o.manager.itemEnd(e)},0)}}else{$o[e]=[],$o[e].push({onLoad:t,onProgress:n,onError:r}),l=new XMLHttpRequest,l.open("GET",e,!0),l.addEventListener("load",function(u){const h=this.response,d=$o[e];if(delete $o[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),cu.add(e,h);for(let p=0,m=d.length;p<m;p++){const g=d[p];g.onLoad&&g.onLoad(h)}o.manager.itemEnd(e)}else{for(let p=0,m=d.length;p<m;p++){const g=d[p];g.onError&&g.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)}},!1),l.addEventListener("progress",function(u){const h=$o[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onProgress&&m.onProgress(u)}},!1),l.addEventListener("error",function(u){const h=$o[e];delete $o[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)},!1),l.addEventListener("abort",function(u){const h=$o[e];delete $o[e];for(let d=0,p=h.length;d<p;d++){const m=h[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 dE extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new Jo(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){r?r(l):console.error(l),o.manager.itemError(e)}},n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=Gd.parse(e[n]);t.push(r)}return t}}class pE extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=[],a=new kt,l=new Jo(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(o.withCredentials);let u=0;function h(d){l.load(e[d],function(p){const m=o.parse(p,!0);s[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},u+=1,u===6&&(m.mipmapCount===1&&(a.minFilter=Gn),a.image=s,a.format=m.format,a.needsUpdate=!0,t&&t(a))},n,r)}if(Array.isArray(e))for(let d=0,p=e.length;d<p;++d)h(d);else l.load(e,function(d){const p=o.parse(d,!0);if(p.isCubemap){const m=p.mipmaps.length/p.mipmapCount;for(let g=0;g<m;g++){s[g]={mipmaps:[]};for(let _=0;_<p.mipmapCount;_++)s[g].mipmaps.push(p.mipmaps[g*p.mipmapCount+_]),s[g].format=p.format,s[g].width=p.width,s[g].height=p.height}a.image=s}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=Gn),a.format=p.format,a.needsUpdate=!0,t&&t(a)},n,r);return a}}class Hd extends gr{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=cu.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),cu.add(e,this),t&&t(this),o.manager.itemEnd(e)}function u(h){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),r&&r(h),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 py extends gr{constructor(e){super(e)}load(e,t,n,r){const o=new to,s=new Hd(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function l(u){s.load(e[u],function(h){o.images[u]=h,a++,a===6&&(o.needsUpdate=!0,t&&t(o))},void 0,r)}for(let u=0;u<e.length;++u)l(u);return o}}class fy extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new xs,a=new Jo(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:xt,s.wrapT=u.wrapT!==void 0?u.wrapT:xt,s.magFilter=u.magFilter!==void 0?u.magFilter:Gn,s.minFilter=u.minFilter!==void 0?u.minFilter:Gn,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=zs),u.mipmapCount===1&&(s.minFilter=Gn),u.generateMipmaps!==void 0&&(s.generateMipmaps=u.generateMipmaps),s.needsUpdate=!0,t&&t(s,u))},n,r),s}}class Rv extends gr{constructor(e){super(e)}load(e,t,n,r){const o=new mi,s=new Hd(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?Oo:Tr,o.needsUpdate=!0,t!==void 0&&t(o)},n,r),o}}class my extends ci{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 al(t,e))}getPoint(e){const t=e*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=t){const o=n[r]-t,s=this.curves[r],a=s.getLength(),l=a===0?0:1-o/a;return s.getPointAt(l)}r++}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,r=this.curves.length;n<r;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 r=0,o=this.curves;r<o.length;r++){const s=o[r],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 h=l[u];n&&n.equals(h)||(t.push(h),n=h)}}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 r=e.curves[t];this.curves.push(r.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 r=this.curves[t];e.curves.push(r.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 r=e.curves[t];this.curves.push(new mv[r.type]().fromJSON(r))}return this}}class du extends my{constructor(e){super(),this.type="Path",this.currentPoint=new mt,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 al(this.currentPoint.clone(),new mt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const o=new ya(this.currentPoint.clone(),new mt(e,t),new mt(n,r));return this.curves.push(o),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,o,s){const a=new _a(this.currentPoint.clone(),new mt(e,t),new mt(n,r),new mt(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Kf(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,o,s){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,r,o,s),this}absarc(e,t,n,r,o,s){return this.absellipse(e,t,n,n,r,o,s),this}ellipse(e,t,n,r,o,s,a,l){const u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+u,t+h,n,r,o,s,a,l),this}absellipse(e,t,n,r,o,s,a,l){const u=new oi(e,t,n,r,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 h=u.getPoint(1);return this.currentPoint.copy(h),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 ul extends du{constructor(e){super(e),this.uuid=Ar(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;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 r=e.holes[t];this.holes.push(r.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 r=this.holes[t];e.holes.push(r.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 r=e.holes[t];this.holes.push(new du().fromJSON(r))}return this}}class Zo extends pn{constructor(e,t=1){super(),this.type="Light",this.color=new Dt(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}}Zo.prototype.isLight=!0;class Cv extends Zo{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(pn.DefaultUp),this.updateMatrix(),this.groundColor=new Dt(t)}copy(e){return Zo.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Cv.prototype.isHemisphereLight=!0;const gy=new Rt,vy=new S,_y=new S;class Pv{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new mt(512,512),this.map=null,this.mapPass=null,this.matrix=new Rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Za,this._frameExtents=new mt(1,1),this._viewportCount=1,this._viewports=[new Bn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;vy.setFromMatrixPosition(e.matrixWorld),t.position.copy(vy),_y.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(_y),t.updateMatrixWorld(),gy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gy),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 yy extends Pv{constructor(){super(new vi(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=2*wi*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;n===t.fov&&r===t.aspect&&o===t.far||(t.fov=n,t.aspect=r,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}yy.prototype.isSpotLightShadow=!0;class Iv extends Zo{constructor(e,t,n=0,r=Math.PI/3,o=0,s=1){super(e,t),this.type="SpotLight",this.position.copy(pn.DefaultUp),this.updateMatrix(),this.target=new pn,this.distance=n,this.angle=r,this.penumbra=o,this.decay=s,this.shadow=new yy}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}}Iv.prototype.isSpotLight=!0;const xy=new Rt,zd=new S,Ov=new S;class by extends Pv{constructor(){super(new vi(90,1,.5,500)),this._frameExtents=new mt(4,2),this._viewportCount=6,this._viewports=[new Bn(2,1,1,1),new Bn(0,1,1,1),new Bn(3,1,1,1),new Bn(1,1,1,1),new Bn(3,0,1,1),new Bn(1,0,1,1)],this._cubeDirections=[new S(1,0,0),new S(-1,0,0),new S(0,0,1),new S(0,0,-1),new S(0,1,0),new S(0,-1,0)],this._cubeUps=[new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,0,1),new S(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,o=e.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),zd.setFromMatrixPosition(e.matrixWorld),n.position.copy(zd),Ov.copy(n.position),Ov.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Ov),n.updateMatrixWorld(),r.makeTranslation(-zd.x,-zd.y,-zd.z),xy.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(xy)}}by.prototype.isPointLightShadow=!0;class Lv extends Zo{constructor(e,t,n=0,r=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new by}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}}Lv.prototype.isPointLight=!0;class tc extends aa{constructor(e=-1,t=1,n=1,r=-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=r,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,r,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=r,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,r=(this.top+this.bottom)/2;let o=n-e,s=n+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=h*this.view.offsetY,l=a-h*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}}tc.prototype.isOrthographicCamera=!0;class wy extends Pv{constructor(){super(new tc(-5,5,5,-5,.5,500))}}wy.prototype.isDirectionalLightShadow=!0;class sm extends Zo{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(pn.DefaultUp),this.updateMatrix(),this.target=new pn,this.shadow=new wy}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}sm.prototype.isDirectionalLight=!0;class am extends Zo{constructor(e,t){super(e,t),this.type="AmbientLight"}}am.prototype.isAmbientLight=!0;class Nv extends Zo{constructor(e,t,n=10,r=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=r}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}}Nv.prototype.isRectAreaLight=!0;class Dv{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new S)}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,r=e.y,o=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*r),t.addScaledVector(s[2],.488603*o),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*r*1.092548),t.addScaledVector(s[5],r*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-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,o=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*r),t.addScaledVector(s[2],1.023328*o),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*r),t.addScaledVector(s[5],.858086*r*o),t.addScaledVector(s[6],.743125*o*o-.247708),t.addScaledVector(s[7],.858086*n*o),t.addScaledVector(s[8],.429043*(n*n-r*r)),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 r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,o=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*o,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*o,t[6]=.315392*(3*o*o-1),t[7]=1.092548*n*o,t[8]=.546274*(n*n-r*r)}}Dv.prototype.isSphericalHarmonics3=!0;class jd extends Zo{constructor(e=new Dv,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}}jd.prototype.isLightProbe=!0;class Sy extends gr{constructor(e){super(e),this.textures={}}load(e,t,n,r){const o=this,s=new Jo(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){r?r(l):console.error(l),o.manager.itemError(e)}},n,r)}parse(e){const t=this.textures;function n(o){return t[o]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",o),t[o]}const r=new hE[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Dt().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const s=e.uniforms[o];switch(r.uniforms[o]={},s.type){case"t":r.uniforms[o].value=n(s.value);break;case"c":r.uniforms[o].value=new Dt().setHex(s.value);break;case"v2":r.uniforms[o].value=new mt().fromArray(s.value);break;case"v3":r.uniforms[o].value=new S().fromArray(s.value);break;case"v4":r.uniforms[o].value=new Bn().fromArray(s.value);break;case"m3":r.uniforms[o].value=new Xn().fromArray(s.value);break;case"m4":r.uniforms[o].value=new Rt().fromArray(s.value);break;default:r.uniforms[o].value=s.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const o in e.extensions)r.extensions[o]=e.extensions[o];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),r.normalScale=new mt().fromArray(o)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new mt().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=n(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class lm{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,r=e.length;n<r;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 Fv extends Xt{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}}Fv.prototype.isInstancedBufferGeometry=!0;class Bv extends gn{constructor(e,t,n,r=1){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=r}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}}Bv.prototype.isInstancedBufferAttribute=!0;class Ty extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new Jo(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){r?r(l):console.error(l),o.manager.itemError(e)}},n,r)}parse(e){const t={},n={};function r(d,p){if(t[p]!==void 0)return t[p];const m=d.interleavedBuffers[p],g=function(w,P){if(n[P]!==void 0)return n[P];const B=w.arrayBuffers[P],G=new Uint32Array(B).buffer;return n[P]=G,G}(d,m.buffer),_=ia(m.type,g),y=new pa(_,m.stride);return y.uuid=m.uuid,t[p]=y,y}const o=e.isInstancedBufferGeometry?new Fv:new Xt,s=e.data.index;if(s!==void 0){const d=ia(s.type,s.array);o.setIndex(new gn(d,1))}const a=e.data.attributes;for(const d in a){const p=a[d];let m;if(p.isInterleavedBufferAttribute){const g=r(e.data,p.data);m=new Xo(g,p.itemSize,p.offset,p.normalized)}else{const g=ia(p.type,p.array);m=new(p.isInstancedBufferAttribute?Bv:gn)(g,p.itemSize,p.normalized)}p.name!==void 0&&(m.name=p.name),p.usage!==void 0&&m.setUsage(p.usage),p.updateRange!==void 0&&(m.updateRange.offset=p.updateRange.offset,m.updateRange.count=p.updateRange.count),o.setAttribute(d,m)}const l=e.data.morphAttributes;if(l)for(const d in l){const p=l[d],m=[];for(let g=0,_=p.length;g<_;g++){const y=p[g];let w;if(y.isInterleavedBufferAttribute){const P=r(e.data,y.data);w=new Xo(P,y.itemSize,y.offset,y.normalized)}else{const P=ia(y.type,y.array);w=new gn(P,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,p=u.length;d!==p;++d){const m=u[d];o.addGroup(m.start,m.count,m.materialIndex)}const h=e.data.boundingSphere;if(h!==void 0){const d=new S;h.center!==void 0&&d.fromArray(h.center),o.boundingSphere=new Mi(d,h.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class fE extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=this.path===""?lm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const a=new Jo(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 r!==void 0&&r(d),void console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message)}const h=u.metadata;h!==void 0&&h.type!==void 0&&h.type.toLowerCase()!=="geometry"?o.parse(u,t):console.error("THREE.ObjectLoader: Can't load "+e)},n,r)}async loadAsync(e,t){const n=this.path===""?lm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const r=new Jo(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const o=await r.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),r=this.parseShapes(e.shapes),o=this.parseGeometries(e.geometries,r),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),h=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,h),t!==void 0){let d=!1;for(const p in s)if(s[p]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),r=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,r,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,r=e.length;n<r;n++){const o=new ul().fromJSON(e[n]);t[o.uuid]=o}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse(function(o){o.isBone&&(r[o.uuid]=o)}),e!==void 0)for(let o=0,s=e.length;o<s;o++){const a=new Gh().fromJSON(e[o],r);n[a.uuid]=a}return n}parseGeometries(e,t){const n={};if(e!==void 0){const r=new Ty;for(let o=0,s=e.length;o<s;o++){let a;const l=e[o];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(l);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:l.type in ly?a=ly[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={},r={};if(e!==void 0){const o=new Sy;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 h=0;h<l.materials.length;h++){const d=l.materials[h];n[d.uuid]===void 0&&(n[d.uuid]=o.parse(d)),u.push(n[d.uuid])}r[l.uuid]=u}else n[l.uuid]===void 0&&(n[l.uuid]=o.parse(l)),r[l.uuid]=n[l.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const r=e[n],o=Gd.parse(r);t[o.uuid]=o}return t}parseImages(e,t){const n=this,r={};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:ia(a.type,a.data),width:a.width,height:a.height}:null}if(e!==void 0&&e.length>0){const a=new Av(t);o=new Hd(a),o.setCrossOrigin(this.crossOrigin);for(let l=0,u=e.length;l<u;l++){const h=e[l],d=h.url;if(Array.isArray(d)){r[h.uuid]=[];for(let p=0,m=d.length;p<m;p++){const g=s(d[p]);g!==null&&(g instanceof HTMLImageElement?r[h.uuid].push(g):r[h.uuid].push(new xs(g.data,g.width,g.height)))}}else{const p=s(h.url);p!==null&&(r[h.uuid]=p)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function o(s){if(typeof s=="string"){const a=s,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await r.loadAsync(l)}return s.data?{data:ia(s.type,s.data),width:s.width,height:s.height}:null}if(e!==void 0&&e.length>0){r=new Hd(this.manager),r.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 h=0,d=u.length;h<d;h++){const p=u[h],m=await o(p);m!==null&&(m instanceof HTMLImageElement?n[l.uuid].push(m):n[l.uuid].push(new xs(m.data,m.width,m.height)))}}else{const h=await o(l.url);h!==null&&(n[l.uuid]=h)}}}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 r={};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 to(u),u.length===6&&(l.needsUpdate=!0)):(l=u&&u.data?new xs(u.data,u.width,u.height):new mi(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,mE)),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],Ey),l.wrapT=n(a.wrap[1],Ey)),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,My)),a.magFilter!==void 0&&(l.magFilter=n(a.magFilter,My)),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),r[a.uuid]=l}return r}parseObject(e,t,n,r,o){let s,a,l;function u(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function h(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let g=0,_=p.length;g<_;g++){const y=p[g];n[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),m.push(n[y])}return m}return n[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),n[p]}}function d(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}switch(e.type){case"Scene":s=new el,e.background!==void 0&&(Number.isInteger(e.background)?s.background=new Dt(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 Kl(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(s.fog=new Ui(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":s=new vi(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 tc(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 am(e.color,e.intensity);break;case"DirectionalLight":s=new sm(e.color,e.intensity);break;case"PointLight":s=new Lv(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new Nv(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new Iv(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new Cv(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=new jd().fromJSON(e);break;case"SkinnedMesh":a=u(e.geometry),l=h(e.material),s=new il(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=h(e.material),s=new En(a,l);break;case"InstancedMesh":a=u(e.geometry),l=h(e.material);const p=e.count,m=e.instanceMatrix,g=e.instanceColor;s=new Id(a,l,p),s.instanceMatrix=new gn(new Float32Array(m.array),16),g!==void 0&&(s.instanceColor=new gn(new Float32Array(g.array),g.itemSize));break;case"LOD":s=new Wf;break;case"Line":s=new c(u(e.geometry),h(e.material));break;case"LineLoop":s=new k(u(e.geometry),h(e.material));break;case"LineSegments":s=new A(u(e.geometry),h(e.material));break;case"PointCloud":case"Points":s=new nt(u(e.geometry),h(e.material));break;case"Sprite":s=new iu(h(e.material));break;case"Group":s=new da;break;case"Bone":s=new kh;break;default:s=new pn}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 p=e.children;for(let m=0;m<p.length;m++)s.add(this.parseObject(p[m],t,n,r,o))}if(e.animations!==void 0){const p=e.animations;for(let m=0;m<p.length;m++){const g=p[m];s.animations.push(o[g])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(s.autoUpdate=e.autoUpdate);const p=e.levels;for(let m=0;m<p.length;m++){const g=p[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 r=t[n.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(r,n.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const mE={UVMapping:Z,CubeReflectionMapping:se,CubeRefractionMapping:ge,EquirectangularReflectionMapping:be,EquirectangularRefractionMapping:we,CubeUVReflectionMapping:Fe,CubeUVRefractionMapping:Ye},Ey={RepeatWrapping:ht,ClampToEdgeWrapping:xt,MirroredRepeatWrapping:Ot},My={NearestFilter:Gt,NearestMipmapNearestFilter:fi,NearestMipmapLinearFilter:Po,LinearFilter:Gn,LinearMipmapNearestFilter:os,LinearMipmapLinearFilter:zs};class Ay extends gr{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,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=cu.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){cu.add(e,l),t&&t(l),o.manager.itemEnd(e)}).catch(function(l){r&&r(l),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}Ay.prototype.isImageBitmapLoader=!0;class Ry{constructor(){this.type="ShapePath",this.color=new Dt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new du,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,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,o,s){return this.currentPath.bezierCurveTo(e,t,n,r,o,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(P){const B=[];for(let G=0,U=P.length;G<U;G++){const X=P[G],H=new ul;H.curves=X.curves,B.push(H)}return B}function r(P,B){const G=B.length;let U=!1;for(let X=G-1,H=0;H<G;X=H++){let q=B[X],me=B[H],ue=me.x-q.x,oe=me.y-q.y;if(Math.abs(oe)>Number.EPSILON){if(oe<0&&(q=B[H],ue=-ue,me=B[X],oe=-oe),P.y<q.y||P.y>me.y)continue;if(P.y===q.y){if(P.x===q.x)return!0}else{const ce=oe*(P.x-q.x)-ue*(P.y-q.y);if(ce===0)return!0;if(ce<0)continue;U=!U}}else{if(P.y!==q.y)continue;if(me.x<=P.x&&P.x<=q.x||q.x<=P.x&&P.x<=me.x)return!0}}return U}const o=Ts.isClockWise,s=this.subPaths;if(s.length===0)return[];if(t===!0)return n(s);let a,l,u;const h=[];if(s.length===1)return l=s[0],u=new ul,u.curves=l.curves,h.push(u),h;let d=!o(s[0].getPoints());d=e?!d:d;const p=[],m=[];let g,_,y=[],w=0;m[w]=void 0,y[w]=[];for(let P=0,B=s.length;P<B;P++)l=s[P],g=l.getPoints(),a=o(g),a=e?!a:a,a?(!d&&m[w]&&w++,m[w]={s:new ul,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 P=!1;const B=[];for(let G=0,U=m.length;G<U;G++)p[G]=[];for(let G=0,U=m.length;G<U;G++){const X=y[G];for(let H=0;H<X.length;H++){const q=X[H];let me=!0;for(let ue=0;ue<m.length;ue++)r(q.p,m[ue].p)&&(G!==ue&&B.push({froms:G,tos:ue,hole:H}),me?(me=!1,p[ue].push(q)):P=!0);me&&p[G].push(q)}}B.length>0&&(P||(y=p))}for(let P=0,B=m.length;P<B;P++){u=m[P].s,h.push(u),_=y[P];for(let G=0,U=_.length;G<U;G++)u.holes.push(_[G].h)}return h}}class Uv{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=function(o,s,a){const l=Array.from(o),u=s/a.resolution,h=(a.boundingBox.yMax-a.boundingBox.yMin+a.underlineThickness)*u,d=[];let p=0,m=0;for(let g=0;g<l.length;g++){const _=l[g];if(_===`
4723
- `)p=0,m-=h;else{const y=gE(_,u,p,m,a);p+=y.offsetX,d.push(y.path)}}return d}(e,t,this.data);for(let o=0,s=r.length;o<s;o++)Array.prototype.push.apply(n,r[o].toShapes());return n}}function gE(i,e,t,n,r){const o=r.glyphs[i]||r.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");const s=new Ry;let a,l,u,h,d,p,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,h=_[y++]*e+n,d=_[y++]*e+t,p=_[y++]*e+n,s.quadraticCurveTo(d,p,u,h);break;case"b":u=_[y++]*e+t,h=_[y++]*e+n,d=_[y++]*e+t,p=_[y++]*e+n,m=_[y++]*e+t,g=_[y++]*e+n,s.bezierCurveTo(d,p,m,g,u,h)}}return{offsetX:o.ha*e,path:s}}Uv.prototype.isFont=!0;class vE extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new Jo(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,r)}parse(e){return new Uv(e)}}let um;const kv={getContext:function(){return um===void 0&&(um=new(window.AudioContext||window.webkitAudioContext)),um},setContext:function(i){um=i}};class Cy extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new Jo(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);kv.getContext().decodeAudioData(l,function(u){t(u)})}catch(l){r?r(l):console.error(l),o.manager.itemError(e)}},n,r)}}class Py extends jd{constructor(e,t,n=1){super(void 0,n);const r=new Dt().set(e),o=new Dt().set(t),s=new S(r.r,r.g,r.b),a=new S(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 Iy extends jd{constructor(e,t=1){super(void 0,t);const n=new Dt().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Iy.prototype.isAmbientLightProbe=!0;const Oy=new Rt,Ly=new Rt;class _E{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new vi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new vi,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(),r=t.eyeSep/2,o=r*t.near/t.focus,s=t.near*Math.tan(Wn*t.fov*.5)/t.zoom;let a,l;Ly.elements[12]=-r,Oy.elements[12]=r,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(Ly),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Oy)}}class Ny{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Dy(),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=Dy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Dy(){return(typeof performance=="undefined"?Date:performance).now()}const pu=new S,Fy=new Fi,yE=new S,fu=new S;class xE extends pn{constructor(){super(),this.type="AudioListener",this.context=kv.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ny}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(pu,Fy,yE),fu.set(0,0,-1).applyQuaternion(Fy),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(pu.x,r),t.positionY.linearRampToValueAtTime(pu.y,r),t.positionZ.linearRampToValueAtTime(pu.z,r),t.forwardX.linearRampToValueAtTime(fu.x,r),t.forwardY.linearRampToValueAtTime(fu.y,r),t.forwardZ.linearRampToValueAtTime(fu.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(pu.x,pu.y,pu.z),t.setOrientation(fu.x,fu.y,fu.z,n.x,n.y,n.z)}}class Gv extends pn{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 mu=new S,By=new Fi,bE=new S,gu=new S;class wE extends Gv{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(mu,By,bE),gu.set(0,0,1).applyQuaternion(By);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(mu.x,n),t.positionY.linearRampToValueAtTime(mu.y,n),t.positionZ.linearRampToValueAtTime(mu.z,n),t.orientationX.linearRampToValueAtTime(gu.x,n),t.orientationY.linearRampToValueAtTime(gu.y,n),t.orientationZ.linearRampToValueAtTime(gu.z,n)}else t.setPosition(mu.x,mu.y,mu.z),t.setOrientation(gu.x,gu.y,gu.z)}}class Uy{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 ky{constructor(e,t,n){let r,o,s;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,o=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,o=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,o=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,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,r=this.valueSize,o=e*r+r;let s=this.cumulativeWeight;if(s===0){for(let a=0;a!==r;++a)n[o+a]=n[a];s=t}else{s+=t;const a=t/s;this._mixBufferRegion(n,o,0,a,r)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=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,r,l,1-o,t)}s>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(n[l]!==n[l+t]){a.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let o=n,s=r;o!==s;++o)t[o]=t[r+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,r,o){if(r>=.5)for(let s=0;s!==o;++s)e[t+s]=e[n+s]}_slerp(e,t,n,r){Fi.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,o){const s=this._workIndex*o;Fi.multiplyQuaternionsFlat(e,s,e,t,e,n),Fi.slerpFlat(e,t,e,t,e,s,r)}_lerp(e,t,n,r,o){const s=1-r;for(let a=0;a!==o;++a){const l=t+a;e[l]=e[l]*s+e[n+a]*r}}_lerpAdditive(e,t,n,r,o){for(let s=0;s!==o;++s){const a=t+s;e[a]=e[a]+e[n+s]*r}}}const SE=new RegExp("[\\[\\]\\.:\\/]","g"),TE="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",EE=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),ME=/(WCOD+)?/.source.replace("WCOD",TE),AE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),RE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),CE=new RegExp("^"+EE+ME+AE+RE+"$"),PE=["material","materials","bones"];class On{constructor(e,t,n){this.path=t,this.parsedPath=n||On.parseTrackName(t),this.node=On.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 On.Composite(e,t,n):new On(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(SE,"")}static parseTrackName(e){const t=CE.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]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const o=n.nodeName.substring(r+1);PE.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,r),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},r=n(e.children);if(r)return r}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 r=0,o=n.length;r!==o;++r)e[t++]=n[r]}_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 r=0,o=n.length;r!==o;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=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,r=t.propertyName;let o=t.propertyIndex;if(e||(e=On.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 h=0;h<e.length;h++)if(e[h].name===u){u=h;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[r];if(s===void 0){const u=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" 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(r==="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=r;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}}On.Composite=class{constructor(i,e,t){const n=t||On.parseTrackName(e);this._targetGroup=i,this._bindings=i.subscribe_(e,n)}getValue(i,e){this.bind();const t=this._targetGroup.nCachedObjects_,n=this._bindings[t];n!==void 0&&n.getValue(i,e)}setValue(i,e){const t=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=t.length;n!==r;++n)t[n].setValue(i,e)}bind(){const i=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=i.length;e!==t;++e)i[e].bind()}unbind(){const i=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=i.length;e!==t;++e)i[e].unbind()}},On.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},On.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},On.prototype.GetterByBindingType=[On.prototype._getValue_direct,On.prototype._getValue_array,On.prototype._getValue_arrayElement,On.prototype._getValue_toArray],On.prototype.SetterByBindingTypeAndVersioning=[[On.prototype._setValue_direct,On.prototype._setValue_direct_setNeedsUpdate,On.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[On.prototype._setValue_array,On.prototype._setValue_array_setNeedsUpdate,On.prototype._setValue_array_setMatrixWorldNeedsUpdate],[On.prototype._setValue_arrayElement,On.prototype._setValue_arrayElement_setNeedsUpdate,On.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[On.prototype._setValue_fromArray,On.prototype._setValue_fromArray_setNeedsUpdate,On.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Gy{constructor(){this.uuid=Ar(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,r=arguments.length;n!==r;++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,r=this._parsedPaths,o=this._bindings,s=o.length;let a,l=e.length,u=this.nCachedObjects_;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],m=p.uuid;let g=t[m];if(g===void 0){g=l++,t[m]=g,e.push(p);for(let _=0,y=s;_!==y;++_)o[_].push(new On(p,n[_],r[_]))}else if(g<u){a=e[g];const _=--u,y=e[_];t[y.uuid]=g,e[g]=y,t[m]=_,e[_]=p;for(let w=0,P=s;w!==P;++w){const B=o[w],G=B[_];let U=B[g];B[g]=G,U===void 0&&(U=new On(p,n[w],r[w])),B[_]=U}}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,r=n.length;let o=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){const l=arguments[s],u=l.uuid,h=t[u];if(h!==void 0&&h>=o){const d=o++,p=e[d];t[p.uuid]=h,e[h]=p,t[u]=d,e[d]=l;for(let m=0,g=r;m!==g;++m){const _=n[m],y=_[d],w=_[h];_[h]=y,_[d]=w}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let o=this.nCachedObjects_,s=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a].uuid,h=t[u];if(h!==void 0)if(delete t[u],h<o){const d=--o,p=e[d],m=--s,g=e[m];t[p.uuid]=h,e[h]=p,t[g.uuid]=d,e[d]=g,e.pop();for(let _=0,y=r;_!==y;++_){const w=n[_],P=w[d],B=w[m];w[h]=P,w[d]=B,w.pop()}}else{const d=--s,p=e[d];d>0&&(t[p.uuid]=h),e[h]=p,e.pop();for(let m=0,g=r;m!==g;++m){const _=n[m];_[h]=_[d],_.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const o=this._bindings;if(r!==void 0)return o[r];const s=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,h=this.nCachedObjects_,d=new Array(u);r=o.length,n[e]=r,s.push(e),a.push(t),o.push(d);for(let p=h,m=l.length;p!==m;++p){const g=l[p];d[p]=new On(g,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const r=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(),r[n]=r[a],r.pop()}}}Gy.prototype.isAnimationObjectGroup=!0;class IE{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const o=t.tracks,s=o.length,a=new Array(s),l={endingStart:zi,endingEnd:zi};for(let u=0;u!==s;++u){const h=o[u].createInterpolant(null);a[u]=h,h.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=Vc,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 r=this._clip.duration,o=e._clip.duration,s=o/r,a=r/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 r=this._mixer,o=r.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._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,r){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 Ue:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(s),u[h].accumulateAdditive(a);break;case Ys:default:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(s),u[h].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===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 r=this.time+e,o=this._loopCount;const s=n===No;if(e===0)return o===-1?r:s&&(1&o)==1?t-r:r;if(n===Qu){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,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)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,o+=Math.abs(a);const l=this.repetitions-o;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,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=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(s&&(1&o)==1)return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=ls,r.endingEnd=ls):(r.endingStart=e?this.zeroSlopeAtStart?ls:zi:Pl,r.endingEnd=t?this.zeroSlopeAtEnd?ls:zi:Pl)}_scheduleFading(e,t,n){const r=this._mixer,o=r.time;let s=this._weightInterpolant;s===null&&(s=r._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 Hy extends Fo{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,r=e._clip.tracks,o=r.length,s=e._propertyBindings,a=e._interpolants,l=n.uuid,u=this._bindingsByRootAndName;let h=u[l];h===void 0&&(h={},u[l]=h);for(let d=0;d!==o;++d){const p=r[d],m=p.name;let g=h[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 ky(On.create(n,m,_),p.ValueTypeName,p.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,r=e._clip.uuid,o=this._actionsByClip[r];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,r,n)}const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++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,r=t.length;n!==r;++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 r=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=r.length,r.push(e),s.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=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],h=e._byClipCacheIndex;u._byClipCacheIndex=h,l[h]=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,r=t.length;n!==r;++n){const o=t[n];--o.referenceCount==0&&this._removeInactiveBinding(o)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,o=t[r];e._cacheIndex=r,t[r]=e,o._cacheIndex=n,t[n]=o}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,o=t[r];e._cacheIndex=r,t[r]=e,o._cacheIndex=n,t[n]=o}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,o=this._bindings;let s=r[t];s===void 0&&(s={},r[t]=s),s[n]=e,e._cacheIndex=o.length,o.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,o=n.path,s=this._bindingsByRootAndName,a=s[r],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[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,o=t[r];e._cacheIndex=r,t[r]=e,o._cacheIndex=n,t[n]=o}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,o=t[r];e._cacheIndex=r,t[r]=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 Ev(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,r=--this._nActiveControlInterpolants,o=t[r];e.__cacheIndex=r,t[r]=e,o.__cacheIndex=n,t[n]=o}clipAction(e,t,n){const r=t||this._root,o=r.uuid;let s=typeof e=="string"?Gd.findByName(r,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:Ys),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 h=new IE(this,s,t,n);return this._bindAction(h,u),this._addInactiveAction(h,a,o),h}existingAction(e,t){const n=t||this._root,r=n.uuid,o=typeof e=="string"?Gd.findByName(n,e):e,s=o?o.uuid:e,a=this._actionsByClip[s];return a!==void 0&&a.actionByRoot[r]||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,r=this.time+=e,o=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==n;++u)t[u]._update(r,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,r=this._actionsByClip,o=r[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 h=u._cacheIndex,d=t[t.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,d._cacheIndex=h,t[h]=d,t.pop(),this._removeInactiveBindingsForAction(u)}delete r[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 r=this._bindingsByRootAndName[t];if(r!==void 0)for(const o in r){const s=r[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}Hy.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class hm{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new hm(this.value.clone===void 0?this.value:this.value.clone())}}class zy extends pa{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}}zy.prototype.isInstancedInterleavedBuffer=!0;class jy{constructor(e,t,n,r,o){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,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}}jy.prototype.isGLBufferAttribute=!0;class OE{constructor(e,t,n=0,r=1/0){this.ray=new Ho(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new Kc,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 Hv(e,this,n,t),n.sort(Vy),n}intersectObjects(e,t=!1,n=[]){for(let r=0,o=e.length;r<o;r++)Hv(e[r],this,n,t);return n.sort(Vy),n}}function Vy(i,e){return i.distance-e.distance}function Hv(i,e,t,n){if(i.layers.test(e.layers)&&i.raycast(e,t),n===!0){const r=i.children;for(let o=0,s=r.length;o<s;o++)Hv(r[o],e,t,!0)}}class LE{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(Vi(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class NE{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 Wy=new mt;class nc{constructor(e=new mt(1/0,1/0),t=new mt(-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=Wy.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 Wy.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)}}nc.prototype.isBox2=!0;const Xy=new S,cm=new S;class qy{constructor(e=new S,t=new S){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){Xy.subVectors(e,this.start),cm.subVectors(this.end,this.start);const n=cm.dot(cm);let r=cm.dot(Xy)/n;return t&&(r=Vi(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).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 Yy extends pn{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}}Yy.prototype.isImmediateRenderObject=!0;const $y=new S;class DE extends pn{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Xt,r=[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,h=a/l*Math.PI*2;r.push(Math.cos(u),Math.sin(u),1,Math.cos(h),Math.sin(h),1)}n.setAttribute("position",new Tt(r,3));const o=new ki({fog:!1,toneMapped:!1});this.cone=new A(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),$y.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt($y),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const hl=new S,dm=new Rt,zv=new Rt;class Jy extends A{constructor(e){const t=function l(u){const h=[];u&&u.isBone&&h.push(u);for(let d=0;d<u.children.length;d++)h.push.apply(h,l(u.children[d]));return h}(e),n=new Xt,r=[],o=[],s=new Dt(0,0,1),a=new Dt(0,1,0);for(let l=0;l<t.length;l++){const u=t[l];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),o.push(s.r,s.g,s.b),o.push(a.r,a.g,a.b))}n.setAttribute("position",new Tt(r,3)),n.setAttribute("color",new Tt(o,3)),super(n,new ki({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,r=n.getAttribute("position");zv.copy(this.root.matrixWorld).invert();for(let o=0,s=0;o<t.length;o++){const a=t[o];a.parent&&a.parent.isBone&&(dm.multiplyMatrices(zv,a.matrixWorld),hl.setFromMatrixPosition(dm),r.setXYZ(s,hl.x,hl.y,hl.z),dm.multiplyMatrices(zv,a.parent.matrixWorld),hl.setFromMatrixPosition(dm),r.setXYZ(s+1,hl.x,hl.y,hl.z),s+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}class FE extends En{constructor(e,t,n){super(new lu(t,4,2),new gi({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 BE=new S,Zy=new Dt,Ky=new Dt;class UE extends pn{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const r=new su(t);r.rotateY(.5*Math.PI),this.material=new gi({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const o=r.getAttribute("position"),s=new Float32Array(3*o.count);r.setAttribute("color",new gn(s,3)),this.add(new En(r,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),Ky.copy(this.light.groundColor);for(let n=0,r=t.count;n<r;n++){const o=n<r/2?Zy:Ky;t.setXYZ(n,o.r,o.g,o.b)}t.needsUpdate=!0}e.lookAt(BE.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Qy extends A{constructor(e=10,t=10,n=4473924,r=8947848){n=new Dt(n),r=new Dt(r);const o=t/2,s=e/t,a=e/2,l=[],u=[];for(let d=0,p=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:r;g.toArray(u,p),p+=3,g.toArray(u,p),p+=3,g.toArray(u,p),p+=3,g.toArray(u,p),p+=3}const h=new Xt;h.setAttribute("position",new Tt(l,3)),h.setAttribute("color",new Tt(u,3)),super(h,new ki({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class kE extends A{constructor(e=10,t=16,n=8,r=64,o=4473924,s=8947848){o=new Dt(o),s=new Dt(s);const a=[],l=[];for(let h=0;h<=t;h++){const d=h/t*(2*Math.PI),p=Math.sin(d)*e,m=Math.cos(d)*e;a.push(0,0,0),a.push(p,0,m);const g=1&h?o:s;l.push(g.r,g.g,g.b),l.push(g.r,g.g,g.b)}for(let h=0;h<=n;h++){const d=1&h?o:s,p=e-e/n*h;for(let m=0;m<r;m++){let g=m/r*(2*Math.PI),_=Math.sin(g)*p,y=Math.cos(g)*p;a.push(_,0,y),l.push(d.r,d.g,d.b),g=(m+1)/r*(2*Math.PI),_=Math.sin(g)*p,y=Math.cos(g)*p,a.push(_,0,y),l.push(d.r,d.g,d.b)}}const u=new Xt;u.setAttribute("position",new Tt(a,3)),u.setAttribute("color",new Tt(l,3)),super(u,new ki({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const ex=new S,pm=new S,tx=new S;class GE extends pn{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 r=new Xt;r.setAttribute("position",new Tt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const o=new ki({fog:!1,toneMapped:!1});this.lightPlane=new c(r,o),this.add(this.lightPlane),r=new Xt,r.setAttribute("position",new Tt([0,0,0,0,0,1],3)),this.targetLine=new c(r,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(){ex.setFromMatrixPosition(this.light.matrixWorld),pm.setFromMatrixPosition(this.light.target.matrixWorld),tx.subVectors(pm,ex),this.lightPlane.lookAt(pm),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(pm),this.targetLine.scale.z=tx.length()}}const fm=new S,Si=new aa;class HE extends A{constructor(e){const t=new Xt,n=new ki({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],o=[],s={},a=new Dt(16755200),l=new Dt(16711680),u=new Dt(43775),h=new Dt(16777215),d=new Dt(3355443);function p(g,_,y){m(g,y),m(_,y)}function m(g,_){r.push(0,0,0),o.push(_.r,_.g,_.b),s[g]===void 0&&(s[g]=[]),s[g].push(r.length/3-1)}p("n1","n2",a),p("n2","n4",a),p("n4","n3",a),p("n3","n1",a),p("f1","f2",a),p("f2","f4",a),p("f4","f3",a),p("f3","f1",a),p("n1","f1",a),p("n2","f2",a),p("n3","f3",a),p("n4","f4",a),p("p","n1",l),p("p","n2",l),p("p","n3",l),p("p","n4",l),p("u1","u2",u),p("u2","u3",u),p("u3","u1",u),p("c","t",h),p("p","c",d),p("cn1","cn2",d),p("cn3","cn4",d),p("cf1","cf2",d),p("cf3","cf4",d),t.setAttribute("position",new Tt(r,3)),t.setAttribute("color",new Tt(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;Si.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Pi("c",t,e,Si,0,0,-1),Pi("t",t,e,Si,0,0,1),Pi("n1",t,e,Si,-1,-1,-1),Pi("n2",t,e,Si,1,-1,-1),Pi("n3",t,e,Si,-1,1,-1),Pi("n4",t,e,Si,1,1,-1),Pi("f1",t,e,Si,-1,-1,1),Pi("f2",t,e,Si,1,-1,1),Pi("f3",t,e,Si,-1,1,1),Pi("f4",t,e,Si,1,1,1),Pi("u1",t,e,Si,.7,1.1,-1),Pi("u2",t,e,Si,-.7,1.1,-1),Pi("u3",t,e,Si,0,2,-1),Pi("cf1",t,e,Si,-1,0,1),Pi("cf2",t,e,Si,1,0,1),Pi("cf3",t,e,Si,0,-1,1),Pi("cf4",t,e,Si,0,1,1),Pi("cn1",t,e,Si,-1,0,-1),Pi("cn2",t,e,Si,1,0,-1),Pi("cn3",t,e,Si,0,-1,-1),Pi("cn4",t,e,Si,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Pi(i,e,t,n,r,o,s){fm.set(r,o,s).unproject(n);const a=e[i];if(a!==void 0){const l=t.getAttribute("position");for(let u=0,h=a.length;u<h;u++)l.setXYZ(a[u],fm.x,fm.y,fm.z)}}const mm=new Zn;class nx extends A{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]),r=new Float32Array(24),o=new Xt;o.setIndex(new gn(n,1)),o.setAttribute("position",new gn(r,3)),super(o,new ki({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&&mm.setFromObject(this.object),mm.isEmpty())return;const t=mm.min,n=mm.max,r=this.geometry.attributes.position,o=r.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,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return A.prototype.copy.call(this,e),this.object=e.object,this}}class zE extends A{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]),r=new Xt;r.setIndex(new gn(n,1)),r.setAttribute("position",new Tt([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(r,new ki({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 jE extends c{constructor(e,t=1,n=16776960){const r=n,o=new Xt;o.setAttribute("position",new Tt([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 ki({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new Xt;s.setAttribute("position",new Tt([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new En(s,new gi({color:r,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?V:z,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const ix=new S;let gm,jv;class VE extends pn{constructor(e=new S(0,0,1),t=new S(0,0,0),n=1,r=16776960,o=.2*n,s=.2*o){super(),this.type="ArrowHelper",gm===void 0&&(gm=new Xt,gm.setAttribute("position",new Tt([0,0,0,0,1,0],3)),jv=new Vt(0,.5,1,5,1),jv.translate(0,-.5,0)),this.position.copy(t),this.line=new c(gm,new ki({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new En(jv,new gi({color:r,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{ix.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(ix,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 rx extends A{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 Xt;n.setAttribute("position",new Tt(t,3)),n.setAttribute("color",new Tt([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(n,new ki({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new Dt,o=this.geometry.attributes.color.array;return r.set(e),r.toArray(o,0),r.toArray(o,3),r.set(t),r.toArray(o,6),r.toArray(o,9),r.set(n),r.toArray(o,12),r.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const ox=new Float32Array(1),WE=new Int32Array(ox.buffer);class XE{static toHalfFloat(e){ox[0]=e;const t=WE[0];let n=t>>16&32768,r=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?(r|=2048,n|=(r>>114-o)+(r>>113-o&1),n):(n|=o-112<<10|r>>1,n+=1&r,n)}}const Es=Math.pow(2,8),sx=[.125,.215,.35,.446,.526,.582],ax=5+sx.length,Ms={[Ht]:0,[vn]:1,[Mr]:2,[Il]:3,[Wc]:4,[dr]:5,[ai]:6},vu=new gi({side:V,depthWrite:!1,depthTest:!1}),qE=new En(new xo,vu),Vv=new tc,{_lodPlanes:Vd,_sizeLods:lx,_sigmas:vm}=JE(),ux=new Dt;let Wv=null;const _u=(1+Math.sqrt(5))/2,ic=1/_u,hx=[new S(1,1,1),new S(-1,1,1),new S(1,1,-1),new S(-1,1,-1),new S(0,_u,ic),new S(0,_u,-ic),new S(ic,0,_u),new S(-ic,0,_u),new S(_u,ic,0),new S(-_u,ic,0)];function cx(i){const e=Math.max(i.r,i.g,i.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return i.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class YE{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const n=new Float32Array(t),r=new S(0,1,0);return new Qh({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:r},inputEncoding:{value:Ms[Ht]},outputEncoding:{value:Ms[Ht]}},vertexShader:Xv(),fragmentShader:`
4722
+ }`}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new Xt;g.setAttribute("position",new gn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new En(g,p),y=this;function w(X,H){const q=e.update(_);p.uniforms.shadow_pass.value=X.map.texture,p.uniforms.resolution.value=X.mapSize,p.uniforms.radius.value=X.radius,i.setRenderTarget(X.mapPass),i.clear(),i.renderBufferDirect(H,null,q,p,_,null),m.uniforms.shadow_pass.value=X.mapPass.texture,m.uniforms.resolution.value=X.mapSize,m.uniforms.radius.value=X.radius,i.setRenderTarget(X.map),i.clear(),i.renderBufferDirect(H,null,q,m,_,null)}function P(X){const H=X<<0;let q=a[H];return q===void 0&&(q=new bn({depthPacking:Xc,morphTargets:X}),a[H]=q),q}function B(X){const H=X<<0;let q=l[H];return q===void 0&&(q=new Oh({morphTargets:X}),l[H]=q),q}function G(X,H,q,me,ue,oe,ce){let le=null,_e=P,je=X.customDepthMaterial;if(me.isPointLight===!0&&(_e=B,je=X.customDistanceMaterial),je===void 0){let ke=!1;q.morphTargets===!0&&(ke=H.morphAttributes&&H.morphAttributes.position&&H.morphAttributes.position.length>0),le=_e(ke)}else le=je;if(i.localClippingEnabled&&q.clipShadows===!0&&q.clippingPlanes.length!==0){const ke=le.uuid,Ee=q.uuid;let Ae=u[ke];Ae===void 0&&(Ae={},u[ke]=Ae);let Je=Ae[Ee];Je===void 0&&(Je=le.clone(),Ae[Ee]=Je),le=Je}return le.visible=q.visible,le.wireframe=q.wireframe,le.side=ce===C?q.shadowSide!==null?q.shadowSide:q.side:q.shadowSide!==null?q.shadowSide:d[q.side],le.clipShadows=q.clipShadows,le.clippingPlanes=q.clippingPlanes,le.clipIntersection=q.clipIntersection,le.wireframeLinewidth=q.wireframeLinewidth,le.linewidth=q.linewidth,me.isPointLight===!0&&le.isMeshDistanceMaterial===!0&&(le.referencePosition.setFromMatrixPosition(me.matrixWorld),le.nearDistance=ue,le.farDistance=oe),le}function U(X,H,q,me,ue){if(X.visible===!1)return;if(X.layers.test(H.layers)&&(X.isMesh||X.isLine||X.isPoints)&&(X.castShadow||X.receiveShadow&&ue===C)&&(!X.frustumCulled||n.intersectsObject(X))){X.modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,X.matrixWorld);const ce=e.update(X),le=X.material;if(Array.isArray(le)){const _e=ce.groups;for(let je=0,ke=_e.length;je<ke;je++){const Ee=_e[je],Ae=le[Ee.materialIndex];if(Ae&&Ae.visible){const Je=G(X,ce,Ae,me,q.near,q.far,ue);i.renderBufferDirect(q,null,ce,Je,X,Ee)}}}else if(le.visible){const _e=G(X,ce,le,me,q.near,q.far,ue);i.renderBufferDirect(q,null,ce,_e,X,null)}}const oe=X.children;for(let ce=0,le=oe.length;ce<le;ce++)U(oe[ce],H,q,me,ue)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=D,this.render=function(X,H,q){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||X.length===0)return;const me=i.getRenderTarget(),ue=i.getActiveCubeFace(),oe=i.getActiveMipmapLevel(),ce=i.state;ce.setBlending(Pe),ce.buffers.color.setClear(1,1,1,1),ce.buffers.depth.setTest(!0),ce.setScissorTest(!1);for(let le=0,_e=X.length;le<_e;le++){const je=X[le],ke=je.shadow;if(ke===void 0){console.warn("THREE.WebGLShadowMap:",je,"has no shadow.");continue}if(ke.autoUpdate===!1&&ke.needsUpdate===!1)continue;r.copy(ke.mapSize);const Ee=ke.getFrameExtents();if(r.multiply(Ee),o.copy(ke.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(o.x=Math.floor(h/Ee.x),r.x=o.x*Ee.x,ke.mapSize.x=o.x),r.y>h&&(o.y=Math.floor(h/Ee.y),r.y=o.y*Ee.y,ke.mapSize.y=o.y)),ke.map===null&&!ke.isPointLightShadow&&this.type===C){const Je={minFilter:Gn,magFilter:Gn,format:Tr};ke.map=new $r(r.x,r.y,Je),ke.map.texture.name=je.name+".shadowMap",ke.mapPass=new $r(r.x,r.y,Je),ke.camera.updateProjectionMatrix()}if(ke.map===null){const Je={minFilter:Gt,magFilter:Gt,format:Tr};ke.map=new $r(r.x,r.y,Je),ke.map.texture.name=je.name+".shadowMap",ke.camera.updateProjectionMatrix()}i.setRenderTarget(ke.map),i.clear();const Ae=ke.getViewportCount();for(let Je=0;Je<Ae;Je++){const st=ke.getViewport(Je);s.set(o.x*st.x,o.y*st.y,o.x*st.z,o.y*st.w),ce.viewport(s),ke.updateMatrices(je,Je),n=ke.getFrustum(),U(H,q,ke.camera,je,this.type)}ke.isPointLightShadow||this.type!==C||w(ke,q),ke.needsUpdate=!1}y.needsUpdate=!1,i.setRenderTarget(me,ue,oe)}}function Lh(i,e,t){const n=t.isWebGL2,r=new function(){let re=!1;const Te=new Bn;let Ge=null;const He=new Bn(0,0,0,0);return{setMask:function(Oe){Ge===Oe||re||(i.colorMask(Oe,Oe,Oe,Oe),Ge=Oe)},setLocked:function(Oe){re=Oe},setClear:function(Oe,et,Ct,It,Pt){Pt===!0&&(Oe*=It,et*=It,Ct*=It),Te.set(Oe,et,Ct,It),He.equals(Te)===!1&&(i.clearColor(Oe,et,Ct,It),He.copy(Te))},reset:function(){re=!1,Ge=null,He.set(-1,0,0,0)}}},o=new function(){let re=!1,Te=null,Ge=null,He=null;return{setTest:function(Oe){Oe?ct(2929):he(2929)},setMask:function(Oe){Te===Oe||re||(i.depthMask(Oe),Te=Oe)},setFunc:function(Oe){if(Ge!==Oe){if(Oe)switch(Oe){case jn:i.depthFunc(512);break;case An:i.depthFunc(519);break;case In:i.depthFunc(513);break;case di:i.depthFunc(515);break;case Ln:i.depthFunc(514);break;case Fi:i.depthFunc(518);break;case pi:i.depthFunc(516);break;case uo:i.depthFunc(517);break;default:i.depthFunc(515)}else i.depthFunc(515);Ge=Oe}},setLocked:function(Oe){re=Oe},setClear:function(Oe){He!==Oe&&(i.clearDepth(Oe),He=Oe)},reset:function(){re=!1,Te=null,Ge=null,He=null}}},s=new function(){let re=!1,Te=null,Ge=null,He=null,Oe=null,et=null,Ct=null,It=null,Pt=null;return{setTest:function(hn){re||(hn?ct(2960):he(2960))},setMask:function(hn){Te===hn||re||(i.stencilMask(hn),Te=hn)},setFunc:function(hn,Ei,kn){Ge===hn&&He===Ei&&Oe===kn||(i.stencilFunc(hn,Ei,kn),Ge=hn,He=Ei,Oe=kn)},setOp:function(hn,Ei,kn){et===hn&&Ct===Ei&&It===kn||(i.stencilOp(hn,Ei,kn),et=hn,Ct=Ei,It=kn)},setLocked:function(hn){re=hn},setClear:function(hn){Pt!==hn&&(i.clearStencil(hn),Pt=hn)},reset:function(){re=!1,Te=null,Ge=null,He=null,Oe=null,et=null,Ct=null,It=null,Pt=null}}};let a={},l=null,u={},h=null,d=!1,p=null,m=null,g=null,_=null,y=null,w=null,P=null,B=!1,G=null,U=null,X=null,H=null,q=null;const me=i.getParameter(35661);let ue=!1,oe=0;const ce=i.getParameter(7938);ce.indexOf("WebGL")!==-1?(oe=parseFloat(/^WebGL (\d)/.exec(ce)[1]),ue=oe>=1):ce.indexOf("OpenGL ES")!==-1&&(oe=parseFloat(/^OpenGL ES (\d)/.exec(ce)[1]),ue=oe>=2);let le=null,_e={};const je=i.getParameter(3088),ke=i.getParameter(2978),Ee=new Bn().fromArray(je),Ae=new Bn().fromArray(ke);function Je(re,Te,Ge){const He=new Uint8Array(4),Oe=i.createTexture();i.bindTexture(re,Oe),i.texParameteri(re,10241,9728),i.texParameteri(re,10240,9728);for(let et=0;et<Ge;et++)i.texImage2D(Te+et,0,6408,1,1,0,6408,5121,He);return Oe}const st={};function ct(re){a[re]!==!0&&(i.enable(re),a[re]=!0)}function he(re){a[re]!==!1&&(i.disable(re),a[re]=!1)}st[3553]=Je(3553,3553,1),st[34067]=Je(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),ct(2929),o.setFunc(di),ze(!1),dt(Re),ct(2884),Ve(Pe);const de={[Ce]:32774,[Le]:32778,[Ne]:32779};if(n)de[$e]=32775,de[Qe]=32776;else{const re=e.get("EXT_blend_minmax");re!==null&&(de[$e]=re.MIN_EXT,de[Qe]=re.MAX_EXT)}const Ke={[bt]:0,[vt]:1,[ln]:768,[Wt]:770,[Mn]:776,[Dn]:774,[rn]:772,[wt]:769,[qt]:771,[Fn]:775,[Bt]:773};function Ve(re,Te,Ge,He,Oe,et,Ct,It){if(re!==Pe){if(d===!1&&(ct(3042),d=!0),re===ye)Oe=Oe||Te,et=et||Ge,Ct=Ct||He,Te===m&&Oe===y||(i.blendEquationSeparate(de[Te],de[Oe]),m=Te,y=Oe),Ge===g&&He===_&&et===w&&Ct===P||(i.blendFuncSeparate(Ke[Ge],Ke[He],Ke[et],Ke[Ct]),g=Ge,_=He,w=et,P=Ct),p=re,B=null;else if(re!==p||It!==B){if(m===Ce&&y===Ce||(i.blendEquation(32774),m=Ce,y=Ce),It)switch(re){case ae:i.blendFuncSeparate(1,771,1,771);break;case Me:i.blendFunc(1,1);break;case De:i.blendFuncSeparate(0,0,769,771);break;case W:i.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",re)}else switch(re){case ae:i.blendFuncSeparate(770,771,1,771);break;case Me:i.blendFunc(770,1);break;case De:i.blendFunc(0,769);break;case W:i.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",re)}g=null,_=null,w=null,P=null,p=re,B=It}}else d===!0&&(he(3042),d=!1)}function ze(re){G!==re&&(re?i.frontFace(2304):i.frontFace(2305),G=re)}function dt(re){re!==xe?(ct(2884),re!==U&&(re===Re?i.cullFace(1029):re===Ie?i.cullFace(1028):i.cullFace(1032))):he(2884),U=re}function pt(re,Te,Ge){re?(ct(32823),H===Te&&q===Ge||(i.polygonOffset(Te,Ge),H=Te,q=Ge)):he(32823)}function Ze(re){re===void 0&&(re=33984+me-1),le!==re&&(i.activeTexture(re),le=re)}return{buffers:{color:r,depth:o,stencil:s},enable:ct,disable:he,bindFramebuffer:function(re,Te){return Te===null&&l!==null&&(Te=l),u[re]!==Te&&(i.bindFramebuffer(re,Te),u[re]=Te,n&&(re===36009&&(u[36160]=Te),re===36160&&(u[36009]=Te)),!0)},bindXRFramebuffer:function(re){re!==l&&(i.bindFramebuffer(36160,re),l=re)},useProgram:function(re){return h!==re&&(i.useProgram(re),h=re,!0)},setBlending:Ve,setMaterial:function(re,Te){re.side===ne?he(2884):ct(2884);let Ge=re.side===V;Te&&(Ge=!Ge),ze(Ge),re.blending===ae&&re.transparent===!1?Ve(Pe):Ve(re.blending,re.blendEquation,re.blendSrc,re.blendDst,re.blendEquationAlpha,re.blendSrcAlpha,re.blendDstAlpha,re.premultipliedAlpha),o.setFunc(re.depthFunc),o.setTest(re.depthTest),o.setMask(re.depthWrite),r.setMask(re.colorWrite);const He=re.stencilWrite;s.setTest(He),He&&(s.setMask(re.stencilWriteMask),s.setFunc(re.stencilFunc,re.stencilRef,re.stencilFuncMask),s.setOp(re.stencilFail,re.stencilZFail,re.stencilZPass)),pt(re.polygonOffset,re.polygonOffsetFactor,re.polygonOffsetUnits),re.alphaToCoverage===!0?ct(32926):he(32926)},setFlipSided:ze,setCullFace:dt,setLineWidth:function(re){re!==X&&(ue&&i.lineWidth(re),X=re)},setPolygonOffset:pt,setScissorTest:function(re){re?ct(3089):he(3089)},activeTexture:Ze,bindTexture:function(re,Te){le===null&&Ze();let Ge=_e[le];Ge===void 0&&(Ge={type:void 0,texture:void 0},_e[le]=Ge),Ge.type===re&&Ge.texture===Te||(i.bindTexture(re,Te||st[re]),Ge.type=re,Ge.texture=Te)},unbindTexture:function(){const re=_e[le];re!==void 0&&re.type!==void 0&&(i.bindTexture(re.type,null),re.type=void 0,re.texture=void 0)},compressedTexImage2D:function(){try{i.compressedTexImage2D.apply(i,arguments)}catch(re){console.error("THREE.WebGLState:",re)}},texImage2D:function(){try{i.texImage2D.apply(i,arguments)}catch(re){console.error("THREE.WebGLState:",re)}},texImage3D:function(){try{i.texImage3D.apply(i,arguments)}catch(re){console.error("THREE.WebGLState:",re)}},scissor:function(re){Ee.equals(re)===!1&&(i.scissor(re.x,re.y,re.z,re.w),Ee.copy(re))},viewport:function(re){Ae.equals(re)===!1&&(i.viewport(re.x,re.y,re.z,re.w),Ae.copy(re))},reset:function(){i.disable(3042),i.disable(2884),i.disable(2929),i.disable(32823),i.disable(3089),i.disable(2960),i.disable(32926),i.blendEquation(32774),i.blendFunc(1,0),i.blendFuncSeparate(1,0,1,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(513),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(519,0,4294967295),i.stencilOp(7680,7680,7680),i.clearStencil(0),i.cullFace(1029),i.frontFace(2305),i.polygonOffset(0,0),i.activeTexture(33984),i.bindFramebuffer(36160,null),n===!0&&(i.bindFramebuffer(36009,null),i.bindFramebuffer(36008,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),a={},le=null,_e={},l=null,u={},h=null,d=!1,p=null,m=null,g=null,_=null,y=null,w=null,P=null,B=!1,G=null,U=null,X=null,H=null,q=null,Ee.set(0,0,i.canvas.width,i.canvas.height),Ae.set(0,0,i.canvas.width,i.canvas.height),r.reset(),o.reset(),s.reset()}}}function hv(i,e,t,n,r,o,s){const a=r.isWebGL2,l=r.maxTextures,u=r.maxCubemapSize,h=r.maxTextureSize,d=r.maxSamples,p=new WeakMap;let m,g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(he,de){return g?new OffscreenCanvas(he,de):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(he,de,Ke,Ve){let ze=1;if((he.width>Ve||he.height>Ve)&&(ze=Ve/Math.max(he.width,he.height)),ze<1||de===!0){if(typeof HTMLImageElement!="undefined"&&he instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&he instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&he instanceof ImageBitmap){const dt=de?hh:Math.floor,pt=dt(ze*he.width),Ze=dt(ze*he.height);m===void 0&&(m=_(pt,Ze));const re=Ke?_(pt,Ze):m;return re.width=pt,re.height=Ze,re.getContext("2d").drawImage(he,0,0,pt,Ze),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+he.width+"x"+he.height+") to ("+pt+"x"+Ze+")."),re}return"data"in he&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+he.width+"x"+he.height+")."),he}return he}function w(he){return Fl(he.width)&&Fl(he.height)}function P(he,de){return he.generateMipmaps&&de&&he.minFilter!==Gt&&he.minFilter!==Gn}function B(he,de,Ke,Ve,ze=1){i.generateMipmap(he),n.get(de).__maxMipLevel=Math.log2(Math.max(Ke,Ve,ze))}function G(he,de,Ke){if(a===!1)return de;if(he!==null){if(i[he]!==void 0)return i[he];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+he+"'")}let Ve=de;return de===6403&&(Ke===5126&&(Ve=33326),Ke===5131&&(Ve=33325),Ke===5121&&(Ve=33321)),de===6407&&(Ke===5126&&(Ve=34837),Ke===5131&&(Ve=34843),Ke===5121&&(Ve=32849)),de===6408&&(Ke===5126&&(Ve=34836),Ke===5131&&(Ve=34842),Ke===5121&&(Ve=32856)),Ve!==33325&&Ve!==33326&&Ve!==34842&&Ve!==34836||e.get("EXT_color_buffer_float"),Ve}function U(he){return he===Gt||he===fi||he===Po?9728:9729}function X(he){const de=he.target;de.removeEventListener("dispose",X),function(Ke){const Ve=n.get(Ke);Ve.__webglInit!==void 0&&(i.deleteTexture(Ve.__webglTexture),n.remove(Ke))}(de),de.isVideoTexture&&p.delete(de),s.memory.textures--}function H(he){const de=he.target;de.removeEventListener("dispose",H),function(Ke){const Ve=Ke.texture,ze=n.get(Ke),dt=n.get(Ve);if(!!Ke){if(dt.__webglTexture!==void 0&&(i.deleteTexture(dt.__webglTexture),s.memory.textures--),Ke.depthTexture&&Ke.depthTexture.dispose(),Ke.isWebGLCubeRenderTarget)for(let pt=0;pt<6;pt++)i.deleteFramebuffer(ze.__webglFramebuffer[pt]),ze.__webglDepthbuffer&&i.deleteRenderbuffer(ze.__webglDepthbuffer[pt]);else i.deleteFramebuffer(ze.__webglFramebuffer),ze.__webglDepthbuffer&&i.deleteRenderbuffer(ze.__webglDepthbuffer),ze.__webglMultisampledFramebuffer&&i.deleteFramebuffer(ze.__webglMultisampledFramebuffer),ze.__webglColorRenderbuffer&&i.deleteRenderbuffer(ze.__webglColorRenderbuffer),ze.__webglDepthRenderbuffer&&i.deleteRenderbuffer(ze.__webglDepthRenderbuffer);if(Ke.isWebGLMultipleRenderTargets)for(let pt=0,Ze=Ve.length;pt<Ze;pt++){const re=n.get(Ve[pt]);re.__webglTexture&&(i.deleteTexture(re.__webglTexture),s.memory.textures--),n.remove(Ve[pt])}n.remove(Ve),n.remove(Ke)}}(de)}let q=0;function me(he,de){const Ke=n.get(he);if(he.isVideoTexture&&function(Ve){const ze=s.render.frame;p.get(Ve)!==ze&&(p.set(Ve,ze),Ve.update())}(he),he.version>0&&Ke.__version!==he.version){const Ve=he.image;if(Ve===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Ve.complete!==!1)return void je(Ke,he,de);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}t.activeTexture(33984+de),t.bindTexture(3553,Ke.__webglTexture)}function ue(he,de){const Ke=n.get(he);he.version>0&&Ke.__version!==he.version?function(Ve,ze,dt){if(ze.image.length!==6)return;_e(Ve,ze),t.activeTexture(33984+dt),t.bindTexture(34067,Ve.__webglTexture),i.pixelStorei(37440,ze.flipY),i.pixelStorei(37441,ze.premultiplyAlpha),i.pixelStorei(3317,ze.unpackAlignment),i.pixelStorei(37443,0);const pt=ze&&(ze.isCompressedTexture||ze.image[0].isCompressedTexture),Ze=ze.image[0]&&ze.image[0].isDataTexture,re=[];for(let It=0;It<6;It++)re[It]=pt||Ze?Ze?ze.image[It].image:ze.image[It]:y(ze.image[It],!1,!0,u);const Te=re[0],Ge=w(Te)||a,He=o.convert(ze.format),Oe=o.convert(ze.type),et=G(ze.internalFormat,He,Oe);let Ct;if(le(34067,ze,Ge),pt){for(let It=0;It<6;It++){Ct=re[It].mipmaps;for(let Pt=0;Pt<Ct.length;Pt++){const hn=Ct[Pt];ze.format!==Tr&&ze.format!==Oo?He!==null?t.compressedTexImage2D(34069+It,Pt,et,hn.width,hn.height,0,hn.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+It,Pt,et,hn.width,hn.height,0,He,Oe,hn.data)}}Ve.__maxMipLevel=Ct.length-1}else{Ct=ze.mipmaps;for(let It=0;It<6;It++)if(Ze){t.texImage2D(34069+It,0,et,re[It].width,re[It].height,0,He,Oe,re[It].data);for(let Pt=0;Pt<Ct.length;Pt++){const hn=Ct[Pt].image[It].image;t.texImage2D(34069+It,Pt+1,et,hn.width,hn.height,0,He,Oe,hn.data)}}else{t.texImage2D(34069+It,0,et,He,Oe,re[It]);for(let Pt=0;Pt<Ct.length;Pt++){const hn=Ct[Pt];t.texImage2D(34069+It,Pt+1,et,He,Oe,hn.image[It])}}Ve.__maxMipLevel=Ct.length}P(ze,Ge)&&B(34067,ze,Te.width,Te.height),Ve.__version=ze.version,ze.onUpdate&&ze.onUpdate(ze)}(Ke,he,de):(t.activeTexture(33984+de),t.bindTexture(34067,Ke.__webglTexture))}const oe={[ht]:10497,[xt]:33071,[Ot]:33648},ce={[Gt]:9728,[fi]:9984,[Po]:9986,[Gn]:9729,[os]:9985,[zs]:9987};function le(he,de,Ke){if(Ke?(i.texParameteri(he,10242,oe[de.wrapS]),i.texParameteri(he,10243,oe[de.wrapT]),he!==32879&&he!==35866||i.texParameteri(he,32882,oe[de.wrapR]),i.texParameteri(he,10240,ce[de.magFilter]),i.texParameteri(he,10241,ce[de.minFilter])):(i.texParameteri(he,10242,33071),i.texParameteri(he,10243,33071),he!==32879&&he!==35866||i.texParameteri(he,32882,33071),de.wrapS===xt&&de.wrapT===xt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(he,10240,U(de.magFilter)),i.texParameteri(he,10241,U(de.minFilter)),de.minFilter!==Gt&&de.minFilter!==Gn&&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 Ve=e.get("EXT_texture_filter_anisotropic");if(de.type===Io&&e.has("OES_texture_float_linear")===!1||a===!1&&de.type===Vs&&e.has("OES_texture_half_float_linear")===!1)return;(de.anisotropy>1||n.get(de).__currentAnisotropy)&&(i.texParameterf(he,Ve.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(de.anisotropy,r.getMaxAnisotropy())),n.get(de).__currentAnisotropy=de.anisotropy)}}function _e(he,de){he.__webglInit===void 0&&(he.__webglInit=!0,de.addEventListener("dispose",X),he.__webglTexture=i.createTexture(),s.memory.textures++)}function je(he,de,Ke){let Ve=3553;de.isDataTexture2DArray&&(Ve=35866),de.isDataTexture3D&&(Ve=32879),_e(he,de),t.activeTexture(33984+Ke),t.bindTexture(Ve,he.__webglTexture),i.pixelStorei(37440,de.flipY),i.pixelStorei(37441,de.premultiplyAlpha),i.pixelStorei(3317,de.unpackAlignment),i.pixelStorei(37443,0);const ze=function(Oe){return!a&&(Oe.wrapS!==xt||Oe.wrapT!==xt||Oe.minFilter!==Gt&&Oe.minFilter!==Gn)}(de)&&w(de.image)===!1,dt=y(de.image,ze,!1,h),pt=w(dt)||a,Ze=o.convert(de.format);let re,Te=o.convert(de.type),Ge=G(de.internalFormat,Ze,Te);le(Ve,de,pt);const He=de.mipmaps;if(de.isDepthTexture)Ge=6402,a?Ge=de.type===Io?36012:de.type===js?33190:de.type===Nn?35056:33189:de.type===Io&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),de.format===ti&&Ge===6402&&de.type!==Al&&de.type!==js&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),de.type=Al,Te=o.convert(de.type)),de.format===Ws&&Ge===6402&&(Ge=34041,de.type!==Nn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),de.type=Nn,Te=o.convert(de.type))),t.texImage2D(3553,0,Ge,dt.width,dt.height,0,Ze,Te,null);else if(de.isDataTexture)if(He.length>0&&pt){for(let Oe=0,et=He.length;Oe<et;Oe++)re=He[Oe],t.texImage2D(3553,Oe,Ge,re.width,re.height,0,Ze,Te,re.data);de.generateMipmaps=!1,he.__maxMipLevel=He.length-1}else t.texImage2D(3553,0,Ge,dt.width,dt.height,0,Ze,Te,dt.data),he.__maxMipLevel=0;else if(de.isCompressedTexture){for(let Oe=0,et=He.length;Oe<et;Oe++)re=He[Oe],de.format!==Tr&&de.format!==Oo?Ze!==null?t.compressedTexImage2D(3553,Oe,Ge,re.width,re.height,0,re.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,Oe,Ge,re.width,re.height,0,Ze,Te,re.data);he.__maxMipLevel=He.length-1}else if(de.isDataTexture2DArray)t.texImage3D(35866,0,Ge,dt.width,dt.height,dt.depth,0,Ze,Te,dt.data),he.__maxMipLevel=0;else if(de.isDataTexture3D)t.texImage3D(32879,0,Ge,dt.width,dt.height,dt.depth,0,Ze,Te,dt.data),he.__maxMipLevel=0;else if(He.length>0&&pt){for(let Oe=0,et=He.length;Oe<et;Oe++)re=He[Oe],t.texImage2D(3553,Oe,Ge,Ze,Te,re);de.generateMipmaps=!1,he.__maxMipLevel=He.length-1}else t.texImage2D(3553,0,Ge,Ze,Te,dt),he.__maxMipLevel=0;P(de,pt)&&B(Ve,de,dt.width,dt.height),he.__version=de.version,de.onUpdate&&de.onUpdate(de)}function ke(he,de,Ke,Ve,ze){const dt=o.convert(Ke.format),pt=o.convert(Ke.type),Ze=G(Ke.internalFormat,dt,pt);ze===32879||ze===35866?t.texImage3D(ze,0,Ze,de.width,de.height,de.depth,0,dt,pt,null):t.texImage2D(ze,0,Ze,de.width,de.height,0,dt,pt,null),t.bindFramebuffer(36160,he),i.framebufferTexture2D(36160,Ve,ze,n.get(Ke).__webglTexture,0),t.bindFramebuffer(36160,null)}function Ee(he,de,Ke){if(i.bindRenderbuffer(36161,he),de.depthBuffer&&!de.stencilBuffer){let Ve=33189;if(Ke){const ze=de.depthTexture;ze&&ze.isDepthTexture&&(ze.type===Io?Ve=36012:ze.type===js&&(Ve=33190));const dt=Je(de);i.renderbufferStorageMultisample(36161,dt,Ve,de.width,de.height)}else i.renderbufferStorage(36161,Ve,de.width,de.height);i.framebufferRenderbuffer(36160,36096,36161,he)}else if(de.depthBuffer&&de.stencilBuffer){if(Ke){const Ve=Je(de);i.renderbufferStorageMultisample(36161,Ve,35056,de.width,de.height)}else i.renderbufferStorage(36161,34041,de.width,de.height);i.framebufferRenderbuffer(36160,33306,36161,he)}else{const Ve=de.isWebGLMultipleRenderTargets===!0?de.texture[0]:de.texture,ze=o.convert(Ve.format),dt=o.convert(Ve.type),pt=G(Ve.internalFormat,ze,dt);if(Ke){const Ze=Je(de);i.renderbufferStorageMultisample(36161,Ze,pt,de.width,de.height)}else i.renderbufferStorage(36161,pt,de.width,de.height)}i.bindRenderbuffer(36161,null)}function Ae(he){const de=n.get(he),Ke=he.isWebGLCubeRenderTarget===!0;if(he.depthTexture){if(Ke)throw new Error("target.depthTexture not supported in Cube render targets");(function(Ve,ze){if(ze&&ze.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,Ve),!ze.depthTexture||!ze.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(ze.depthTexture).__webglTexture&&ze.depthTexture.image.width===ze.width&&ze.depthTexture.image.height===ze.height||(ze.depthTexture.image.width=ze.width,ze.depthTexture.image.height=ze.height,ze.depthTexture.needsUpdate=!0),me(ze.depthTexture,0);const dt=n.get(ze.depthTexture).__webglTexture;if(ze.depthTexture.format===ti)i.framebufferTexture2D(36160,36096,3553,dt,0);else{if(ze.depthTexture.format!==Ws)throw new Error("Unknown depthTexture format");i.framebufferTexture2D(36160,33306,3553,dt,0)}})(de.__webglFramebuffer,he)}else if(Ke){de.__webglDepthbuffer=[];for(let Ve=0;Ve<6;Ve++)t.bindFramebuffer(36160,de.__webglFramebuffer[Ve]),de.__webglDepthbuffer[Ve]=i.createRenderbuffer(),Ee(de.__webglDepthbuffer[Ve],he,!1)}else t.bindFramebuffer(36160,de.__webglFramebuffer),de.__webglDepthbuffer=i.createRenderbuffer(),Ee(de.__webglDepthbuffer,he,!1);t.bindFramebuffer(36160,null)}function Je(he){return a&&he.isWebGLMultisampleRenderTarget?Math.min(d,he.samples):0}let st=!1,ct=!1;this.allocateTextureUnit=function(){const he=q;return he>=l&&console.warn("THREE.WebGLTextures: Trying to use "+he+" texture units while this GPU supports only "+l),q+=1,he},this.resetTextureUnits=function(){q=0},this.setTexture2D=me,this.setTexture2DArray=function(he,de){const Ke=n.get(he);he.version>0&&Ke.__version!==he.version?je(Ke,he,de):(t.activeTexture(33984+de),t.bindTexture(35866,Ke.__webglTexture))},this.setTexture3D=function(he,de){const Ke=n.get(he);he.version>0&&Ke.__version!==he.version?je(Ke,he,de):(t.activeTexture(33984+de),t.bindTexture(32879,Ke.__webglTexture))},this.setTextureCube=ue,this.setupRenderTarget=function(he){const de=he.texture,Ke=n.get(he),Ve=n.get(de);he.addEventListener("dispose",H),he.isWebGLMultipleRenderTargets!==!0&&(Ve.__webglTexture=i.createTexture(),Ve.__version=de.version,s.memory.textures++);const ze=he.isWebGLCubeRenderTarget===!0,dt=he.isWebGLMultipleRenderTargets===!0,pt=he.isWebGLMultisampleRenderTarget===!0,Ze=de.isDataTexture3D||de.isDataTexture2DArray,re=w(he)||a;if(!a||de.format!==Oo||de.type!==Io&&de.type!==Vs||(de.format=Tr,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),ze){Ke.__webglFramebuffer=[];for(let Te=0;Te<6;Te++)Ke.__webglFramebuffer[Te]=i.createFramebuffer()}else if(Ke.__webglFramebuffer=i.createFramebuffer(),dt)if(r.drawBuffers){const Te=he.texture;for(let Ge=0,He=Te.length;Ge<He;Ge++){const Oe=n.get(Te[Ge]);Oe.__webglTexture===void 0&&(Oe.__webglTexture=i.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(pt)if(a){Ke.__webglMultisampledFramebuffer=i.createFramebuffer(),Ke.__webglColorRenderbuffer=i.createRenderbuffer(),i.bindRenderbuffer(36161,Ke.__webglColorRenderbuffer);const Te=o.convert(de.format),Ge=o.convert(de.type),He=G(de.internalFormat,Te,Ge),Oe=Je(he);i.renderbufferStorageMultisample(36161,Oe,He,he.width,he.height),t.bindFramebuffer(36160,Ke.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(36160,36064,36161,Ke.__webglColorRenderbuffer),i.bindRenderbuffer(36161,null),he.depthBuffer&&(Ke.__webglDepthRenderbuffer=i.createRenderbuffer(),Ee(Ke.__webglDepthRenderbuffer,he,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ze){t.bindTexture(34067,Ve.__webglTexture),le(34067,de,re);for(let Te=0;Te<6;Te++)ke(Ke.__webglFramebuffer[Te],he,de,36064,34069+Te);P(de,re)&&B(34067,de,he.width,he.height),t.bindTexture(34067,null)}else if(dt){const Te=he.texture;for(let Ge=0,He=Te.length;Ge<He;Ge++){const Oe=Te[Ge],et=n.get(Oe);t.bindTexture(3553,et.__webglTexture),le(3553,Oe,re),ke(Ke.__webglFramebuffer,he,Oe,36064+Ge,3553),P(Oe,re)&&B(3553,Oe,he.width,he.height)}t.bindTexture(3553,null)}else{let Te=3553;Ze&&(a?Te=de.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(Te,Ve.__webglTexture),le(Te,de,re),ke(Ke.__webglFramebuffer,he,de,36064,Te),P(de,re)&&B(Te,de,he.width,he.height,he.depth),t.bindTexture(Te,null)}he.depthBuffer&&Ae(he)},this.updateRenderTargetMipmap=function(he){const de=w(he)||a,Ke=he.isWebGLMultipleRenderTargets===!0?he.texture:[he.texture];for(let Ve=0,ze=Ke.length;Ve<ze;Ve++){const dt=Ke[Ve];if(P(dt,de)){const pt=he.isWebGLCubeRenderTarget?34067:3553,Ze=n.get(dt).__webglTexture;t.bindTexture(pt,Ze),B(pt,dt,he.width,he.height),t.bindTexture(pt,null)}}},this.updateMultisampleRenderTarget=function(he){if(he.isWebGLMultisampleRenderTarget)if(a){const de=he.width,Ke=he.height;let Ve=16384;he.depthBuffer&&(Ve|=256),he.stencilBuffer&&(Ve|=1024);const ze=n.get(he);t.bindFramebuffer(36008,ze.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,ze.__webglFramebuffer),i.blitFramebuffer(0,0,de,Ke,0,0,de,Ke,Ve,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,ze.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(he,de){he&&he.isWebGLRenderTarget&&(st===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),st=!0),he=he.texture),me(he,de)},this.safeSetTextureCube=function(he,de){he&&he.isWebGLCubeRenderTarget&&(ct===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),ct=!0),he=he.texture),ue(he,de)}}function Hf(i,e,t){const n=t.isWebGL2;return{convert:function(r){let o;if(r===ss)return 5121;if(r===Hp)return 32819;if(r===zp)return 32820;if(r===jp)return 33635;if(r===Up)return 5120;if(r===kp)return 5122;if(r===Al)return 5123;if(r===Gp)return 5124;if(r===js)return 5125;if(r===Io)return 5126;if(r===Vs)return n?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(r===Hn)return 6406;if(r===Oo)return 6407;if(r===Tr)return 6408;if(r===Vp)return 6409;if(r===Pc)return 6410;if(r===ti)return 6402;if(r===Ws)return 34041;if(r===La)return 6403;if(r===Ic)return 36244;if(r===Gu)return 33319;if(r===Er)return 33320;if(r===Oc)return 36248;if(r===Lc)return 36249;if(r===Hu||r===zu||r===ju||r===Vu){if(o=e.get("WEBGL_compressed_texture_s3tc"),o===null)return null;if(r===Hu)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===zu)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===ju)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Vu)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===ir||r===Nc||r===hr||r===Dc){if(o=e.get("WEBGL_compressed_texture_pvrtc"),o===null)return null;if(r===ir)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Nc)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===hr)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Dc)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===Fc)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===co||r===Na)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(r===co)return o.COMPRESSED_RGB8_ETC2;if(r===Na)return o.COMPRESSED_RGBA8_ETC2_EAC}return r===Wu||r===Vn||r===Lo||r===Xu||r===Xp||r===qu||r===qp||r===Bc||r===Rl||r===Xs||r===Yp||r===Uc||r===kc||r===Yu||r===Gc||r===Ju||r===Zu||r===Hc||r===cr||r===Ku||r===Da||r===zc||r===jc||r===$p||r===Jp||r===Zp||r===Kp||r===qs?(o=e.get("WEBGL_compressed_texture_astc"),o!==null?r:null):r===$u?(o=e.get("EXT_texture_compression_bptc"),o!==null?r:null):r===Nn?n?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class Rd extends vi{constructor(e=[]){super(),this.cameras=e}}Rd.prototype.isArrayCamera=!0;class da extends pn{constructor(){super(),this.type="Group"}}da.prototype.isGroup=!0;const Cd={type:"move"};class Zl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new da,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 da,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new S,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new S),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new da,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new S,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new S),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 r=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&&(r=t.getPose(e.targetRaySpace,n),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Cd))),u&&e.hand){s=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,n);if(u.joints[_.jointName]===void 0){const P=new da;P.matrixAutoUpdate=!1,P.visible=!1,u.joints[_.jointName]=P,u.add(P)}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 h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,g=.005;u.inputState.pinching&&p>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=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=r!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}}class cv extends Fo{constructor(e,t){super();const n=this,r=e.state;let o=null,s=1,a=null,l="local-floor",u=null,h=null,d=null,p=null;const m=[],g=new Map,_=new vi;_.layers.enable(1),_.viewport=new Bn;const y=new vi;y.layers.enable(2),y.viewport=new Bn;const w=[_,y],P=new Rd;P.layers.enable(1),P.layers.enable(2);let B=null,G=null;function U(le){const _e=g.get(le.inputSource);_e&&_e.dispatchEvent({type:le.type,data:le.inputSource})}function X(){g.forEach(function(le,_e){le.disconnect(_e)}),g.clear(),B=null,G=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),ce.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function H(le){const _e=o.inputSources;for(let je=0;je<m.length;je++)g.set(_e[je],m[je]);for(let je=0;je<le.removed.length;je++){const ke=le.removed[je],Ee=g.get(ke);Ee&&(Ee.dispatchEvent({type:"disconnected",data:ke}),g.delete(ke))}for(let je=0;je<le.added.length;je++){const ke=le.added[je],Ee=g.get(ke);Ee&&Ee.dispatchEvent({type:"connected",data:ke})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let _e=m[le];return _e===void 0&&(_e=new Zl,m[le]=_e),_e.getTargetRaySpace()},this.getControllerGrip=function(le){let _e=m[le];return _e===void 0&&(_e=new Zl,m[le]=_e),_e.getGripSpace()},this.getHand=function(le){let _e=m[le];return _e===void 0&&(_e=new Zl,m[le]=_e),_e.getHandSpace()},this.setFramebufferScaleFactor=function(le){s=le,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(le){l=le,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(le){if(o=le,o!==null){o.addEventListener("select",U),o.addEventListener("selectstart",U),o.addEventListener("selectend",U),o.addEventListener("squeeze",U),o.addEventListener("squeezestart",U),o.addEventListener("squeezeend",U),o.addEventListener("end",X),o.addEventListener("inputsourceschange",H);const _e=t.getContextAttributes();if(_e.xrCompatible!==!0&&await t.makeXRCompatible(),o.renderState.layers===void 0){const je={antialias:_e.antialias,alpha:_e.alpha,depth:_e.depth,stencil:_e.stencil,framebufferScaleFactor:s},ke=new XRWebGLLayer(o,t,je);o.updateRenderState({baseLayer:ke})}else{let je=0;_e.depth&&(je=_e.stencil?34041:6402);const ke={colorFormat:_e.alpha?6408:6407,depthFormat:je,scaleFactor:s};h=new XRWebGLBinding(o,t),p=h.createProjectionLayer(ke),d=t.createFramebuffer(),o.updateRenderState({layers:[p]})}a=await o.requestReferenceSpace(l),ce.setContext(o),ce.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const q=new S,me=new S;function ue(le,_e){_e===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(_e.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(o===null)return;P.near=y.near=_.near=le.near,P.far=y.far=_.far=le.far,B===P.near&&G===P.far||(o.updateRenderState({depthNear:P.near,depthFar:P.far}),B=P.near,G=P.far);const _e=le.parent,je=P.cameras;ue(P,_e);for(let Ee=0;Ee<je.length;Ee++)ue(je[Ee],_e);P.matrixWorld.decompose(P.position,P.quaternion,P.scale),le.position.copy(P.position),le.quaternion.copy(P.quaternion),le.scale.copy(P.scale),le.matrix.copy(P.matrix),le.matrixWorld.copy(P.matrixWorld);const ke=le.children;for(let Ee=0,Ae=ke.length;Ee<Ae;Ee++)ke[Ee].updateMatrixWorld(!0);je.length===2?function(Ee,Ae,Je){q.setFromMatrixPosition(Ae.matrixWorld),me.setFromMatrixPosition(Je.matrixWorld);const st=q.distanceTo(me),ct=Ae.projectionMatrix.elements,he=Je.projectionMatrix.elements,de=ct[14]/(ct[10]-1),Ke=ct[14]/(ct[10]+1),Ve=(ct[9]+1)/ct[5],ze=(ct[9]-1)/ct[5],dt=(ct[8]-1)/ct[0],pt=(he[8]+1)/he[0],Ze=de*dt,re=de*pt,Te=st/(-dt+pt),Ge=Te*-dt;Ae.matrixWorld.decompose(Ee.position,Ee.quaternion,Ee.scale),Ee.translateX(Ge),Ee.translateZ(Te),Ee.matrixWorld.compose(Ee.position,Ee.quaternion,Ee.scale),Ee.matrixWorldInverse.copy(Ee.matrixWorld).invert();const He=de+Te,Oe=Ke+Te,et=Ze-Ge,Ct=re+(st-Ge),It=Ve*Ke/Oe*He,Pt=ze*Ke/Oe*He;Ee.projectionMatrix.makePerspective(et,Ct,It,Pt,He,Oe)}(P,_,y):P.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return P};let oe=null;const ce=new pd;ce.setAnimationLoop(function(le,_e){if(u=_e.getViewerPose(a),u!==null){const ke=u.views,Ee=o.renderState.baseLayer;o.renderState.layers===void 0&&r.bindXRFramebuffer(Ee.framebuffer);let Ae=!1;ke.length!==P.cameras.length&&(P.cameras.length=0,Ae=!0);for(let Je=0;Je<ke.length;Je++){const st=ke[Je];let ct=null;if(o.renderState.layers===void 0)ct=Ee.getViewport(st);else{const de=h.getViewSubImage(p,st);r.bindXRFramebuffer(d),t.framebufferTexture2D(36160,36064,3553,de.colorTexture,0),de.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,de.depthStencilTexture,0),ct=de.viewport}const he=w[Je];he.matrix.fromArray(st.transform.matrix),he.projectionMatrix.fromArray(st.projectionMatrix),he.viewport.set(ct.x,ct.y,ct.width,ct.height),Je===0&&P.matrix.copy(he.matrix),Ae===!0&&P.cameras.push(he)}}const je=o.inputSources;for(let ke=0;ke<m.length;ke++){const Ee=m[ke],Ae=je[ke];Ee.update(Ae,_e,a)}oe&&oe(le,_e)}),this.setAnimationLoop=function(le){oe=le},this.dispose=function(){}}}function dv(i){function e(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.specularMap&&(n.specularMap.value=r.specularMap);const o=i.get(r).envMap;if(o){n.envMap.value=o,n.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,n.reflectivity.value=r.reflectivity,n.refractionRatio.value=r.refractionRatio;const l=i.get(o).__maxMipLevel;l!==void 0&&(n.maxMipLevel.value=l)}let s,a;r.lightMap&&(n.lightMap.value=r.lightMap,n.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?s=r.map:r.specularMap?s=r.specularMap:r.displacementMap?s=r.displacementMap:r.normalMap?s=r.normalMap:r.bumpMap?s=r.bumpMap:r.roughnessMap?s=r.roughnessMap:r.metalnessMap?s=r.metalnessMap:r.alphaMap?s=r.alphaMap:r.emissiveMap?s=r.emissiveMap:r.clearcoatMap?s=r.clearcoatMap:r.clearcoatNormalMap?s=r.clearcoatNormalMap:r.clearcoatRoughnessMap&&(s=r.clearcoatRoughnessMap),s!==void 0&&(s.isWebGLRenderTarget&&(s=s.texture),s.matrixAutoUpdate===!0&&s.updateMatrix(),n.uvTransform.value.copy(s.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),a!==void 0&&(a.isWebGLRenderTarget&&(a=a.texture),a.matrixAutoUpdate===!0&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}function t(n,r){n.roughness.value=r.roughness,n.metalness.value=r.metalness,r.roughnessMap&&(n.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(n.metalnessMap.value=r.metalnessMap),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,r.side===V&&(n.bumpScale.value*=-1)),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),r.side===V&&n.normalScale.value.negate()),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),i.get(r).envMap&&(n.envMapIntensity.value=r.envMapIntensity)}return{refreshFogUniforms:function(n,r){n.fogColor.value.copy(r.color),r.isFog?(n.fogNear.value=r.near,n.fogFar.value=r.far):r.isFogExp2&&(n.fogDensity.value=r.density)},refreshMaterialUniforms:function(n,r,o,s,a){r.isMeshBasicMaterial?e(n,r):r.isMeshLambertMaterial?(e(n,r),function(l,u){u.emissiveMap&&(l.emissiveMap.value=u.emissiveMap)}(n,r)):r.isMeshToonMaterial?(e(n,r),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===V&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===V&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isMeshPhongMaterial?(e(n,r),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===V&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===V&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isMeshStandardMaterial?(e(n,r),r.isMeshPhysicalMaterial?function(l,u,h){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===V&&l.clearcoatNormalScale.value.negate()),l.transmission.value=u.transmission,u.transmissionMap&&(l.transmissionMap.value=u.transmissionMap),u.transmission>0&&(l.transmissionSamplerMap.value=h.texture,l.transmissionSamplerSize.value.set(h.width,h.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,r,a):t(n,r)):r.isMeshMatcapMaterial?(e(n,r),function(l,u){u.matcap&&(l.matcap.value=u.matcap),u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===V&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===V&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isMeshDepthMaterial?(e(n,r),function(l,u){u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isMeshDistanceMaterial?(e(n,r),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,r)):r.isMeshNormalMaterial?(e(n,r),function(l,u){u.bumpMap&&(l.bumpMap.value=u.bumpMap,l.bumpScale.value=u.bumpScale,u.side===V&&(l.bumpScale.value*=-1)),u.normalMap&&(l.normalMap.value=u.normalMap,l.normalScale.value.copy(u.normalScale),u.side===V&&l.normalScale.value.negate()),u.displacementMap&&(l.displacementMap.value=u.displacementMap,l.displacementScale.value=u.displacementScale,l.displacementBias.value=u.displacementBias)}(n,r)):r.isLineBasicMaterial?(function(l,u){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity}(n,r),r.isLineDashedMaterial&&function(l,u){l.dashSize.value=u.dashSize,l.totalSize.value=u.dashSize+u.gapSize,l.scale.value=u.scale}(n,r)):r.isPointsMaterial?function(l,u,h,d){l.diffuse.value.copy(u.color),l.opacity.value=u.opacity,l.size.value=u.size*h,l.scale.value=.5*d,u.map&&(l.map.value=u.map),u.alphaMap&&(l.alphaMap.value=u.alphaMap);let p;u.map?p=u.map:u.alphaMap&&(p=u.alphaMap),p!==void 0&&(p.matrixAutoUpdate===!0&&p.updateMatrix(),l.uvTransform.value.copy(p.matrix))}(n,r,o,s):r.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 h;u.map?h=u.map:u.alphaMap&&(h=u.alphaMap),h!==void 0&&(h.matrixAutoUpdate===!0&&h.updateMatrix(),l.uvTransform.value.copy(h.matrix))}(n,r):r.isShadowMaterial?(n.color.value.copy(r.color),n.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Un(i={}){const e=i.canvas!==void 0?i.canvas:function(){const ve=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return ve.style.display="block",ve}(),t=i.context!==void 0?i.context:null,n=i.alpha!==void 0&&i.alpha,r=i.depth===void 0||i.depth,o=i.stencil===void 0||i.stencil,s=i.antialias!==void 0&&i.antialias,a=i.premultipliedAlpha===void 0||i.premultipliedAlpha,l=i.preserveDrawingBuffer!==void 0&&i.preserveDrawingBuffer,u=i.powerPreference!==void 0?i.powerPreference:"default",h=i.failIfMajorPerformanceCaveat!==void 0&&i.failIfMajorPerformanceCaveat;let d=null,p=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=Ht,this.physicallyCorrectLights=!1,this.toneMapping=Sr,this.toneMappingExposure=1;const _=this;let y=!1,w=0,P=0,B=null,G=-1,U=null;const X=new Bn,H=new Bn;let q=null,me=e.width,ue=e.height,oe=1,ce=null,le=null;const _e=new Bn(0,0,me,ue),je=new Bn(0,0,me,ue);let ke=!1;const Ee=[],Ae=new Za;let Je=!1,st=!1,ct=null;const he=new Rt,de=new S,Ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ve(){return B===null?oe:1}let ze,dt,pt,Ze,re,Te,Ge,He,Oe,et,Ct,It,Pt,hn,Ei,kn,qr,Ep,Mp,Ap,Fr,Yr,yt=t;function XS(ve,it){for(let Xe=0;Xe<ve.length;Xe++){const ot=ve[Xe],St=e.getContext(ot,it);if(St!==null)return St}return null}try{const ve={alpha:n,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h};if(e.addEventListener("webglcontextlost",YS,!1),e.addEventListener("webglcontextrestored",$S,!1),yt===null){const it=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&it.shift(),yt=XS(it,ve),yt===null)throw XS(it)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}yt.getShaderPrecisionFormat===void 0&&(yt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ve){throw console.error("THREE.WebGLRenderer: "+ve.message),ve}function qS(){ze=new Bg(yt),dt=new pf(yt,ze,i),ze.init(dt),Fr=new Hf(yt,ze,dt),pt=new Lh(yt,ze,dt),Ee[0]=1029,Ze=new Yl(yt),re=new Ih,Te=new hv(yt,ze,pt,re,dt,Fr,Ze),Ge=new mf(_),He=new Dg(yt,dt),Yr=new ql(yt,ze,He,dt),Oe=new fd(yt,He,Ze,Yr),et=new Th(yt,Oe,He,Ze),Ep=new _f(yt),Ei=new ff(re),Ct=new Ff(_,Ge,ze,dt,Yr,Ei),It=new dv(re),Pt=new uv(re),hn=new Gf(ze,dt),qr=new Fg(_,Ge,pt,et,a),kn=new Ad(_,et,dt),Mp=new df(yt,ze,Ze,dt),Ap=new gf(yt,ze,Ze,dt),Ze.programs=Ct.programs,_.capabilities=dt,_.extensions=ze,_.properties=re,_.renderLists=Pt,_.shadowMap=kn,_.state=pt,_.info=Ze}qS();const oo=new cv(_,yt);function YS(ve){ve.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function $S(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const ve=Ze.autoReset,it=kn.enabled,Xe=kn.autoUpdate,ot=kn.needsUpdate,St=kn.type;qS(),Ze.autoReset=ve,kn.enabled=it,kn.autoUpdate=Xe,kn.needsUpdate=ot,kn.type=St}function JS(ve){const it=ve.target;it.removeEventListener("dispose",JS),function(Xe){(function(ot){const St=re.get(ot).programs;St!==void 0&&St.forEach(function(Pn){Ct.releaseProgram(Pn)})})(Xe),re.remove(Xe)}(it)}this.xr=oo,this.getContext=function(){return yt},this.getContextAttributes=function(){return yt.getContextAttributes()},this.forceContextLoss=function(){const ve=ze.get("WEBGL_lose_context");ve&&ve.loseContext()},this.forceContextRestore=function(){const ve=ze.get("WEBGL_lose_context");ve&&ve.restoreContext()},this.getPixelRatio=function(){return oe},this.setPixelRatio=function(ve){ve!==void 0&&(oe=ve,this.setSize(me,ue,!1))},this.getSize=function(ve){return ve.set(me,ue)},this.setSize=function(ve,it,Xe){oo.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(me=ve,ue=it,e.width=Math.floor(ve*oe),e.height=Math.floor(it*oe),Xe!==!1&&(e.style.width=ve+"px",e.style.height=it+"px"),this.setViewport(0,0,ve,it))},this.getDrawingBufferSize=function(ve){return ve.set(me*oe,ue*oe).floor()},this.setDrawingBufferSize=function(ve,it,Xe){me=ve,ue=it,oe=Xe,e.width=Math.floor(ve*Xe),e.height=Math.floor(it*Xe),this.setViewport(0,0,ve,it)},this.getCurrentViewport=function(ve){return ve.copy(X)},this.getViewport=function(ve){return ve.copy(_e)},this.setViewport=function(ve,it,Xe,ot){ve.isVector4?_e.set(ve.x,ve.y,ve.z,ve.w):_e.set(ve,it,Xe,ot),pt.viewport(X.copy(_e).multiplyScalar(oe).floor())},this.getScissor=function(ve){return ve.copy(je)},this.setScissor=function(ve,it,Xe,ot){ve.isVector4?je.set(ve.x,ve.y,ve.z,ve.w):je.set(ve,it,Xe,ot),pt.scissor(H.copy(je).multiplyScalar(oe).floor())},this.getScissorTest=function(){return ke},this.setScissorTest=function(ve){pt.setScissorTest(ke=ve)},this.setOpaqueSort=function(ve){ce=ve},this.setTransparentSort=function(ve){le=ve},this.getClearColor=function(ve){return ve.copy(qr.getClearColor())},this.setClearColor=function(){qr.setClearColor.apply(qr,arguments)},this.getClearAlpha=function(){return qr.getClearAlpha()},this.setClearAlpha=function(){qr.setClearAlpha.apply(qr,arguments)},this.clear=function(ve,it,Xe){let ot=0;(ve===void 0||ve)&&(ot|=16384),(it===void 0||it)&&(ot|=256),(Xe===void 0||Xe)&&(ot|=1024),yt.clear(ot)},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",YS,!1),e.removeEventListener("webglcontextrestored",$S,!1),Pt.dispose(),hn.dispose(),re.dispose(),Ge.dispose(),et.dispose(),Yr.dispose(),oo.dispose(),oo.removeEventListener("sessionstart",ZS),oo.removeEventListener("sessionend",KS),ct&&(ct.dispose(),ct=null),Bu.stop()},this.renderBufferImmediate=function(ve,it){Yr.initAttributes();const Xe=re.get(ve);ve.hasPositions&&!Xe.position&&(Xe.position=yt.createBuffer()),ve.hasNormals&&!Xe.normal&&(Xe.normal=yt.createBuffer()),ve.hasUvs&&!Xe.uv&&(Xe.uv=yt.createBuffer()),ve.hasColors&&!Xe.color&&(Xe.color=yt.createBuffer());const ot=it.getAttributes();ve.hasPositions&&(yt.bindBuffer(34962,Xe.position),yt.bufferData(34962,ve.positionArray,35048),Yr.enableAttribute(ot.position),yt.vertexAttribPointer(ot.position,3,5126,!1,0,0)),ve.hasNormals&&(yt.bindBuffer(34962,Xe.normal),yt.bufferData(34962,ve.normalArray,35048),Yr.enableAttribute(ot.normal),yt.vertexAttribPointer(ot.normal,3,5126,!1,0,0)),ve.hasUvs&&(yt.bindBuffer(34962,Xe.uv),yt.bufferData(34962,ve.uvArray,35048),Yr.enableAttribute(ot.uv),yt.vertexAttribPointer(ot.uv,2,5126,!1,0,0)),ve.hasColors&&(yt.bindBuffer(34962,Xe.color),yt.bufferData(34962,ve.colorArray,35048),Yr.enableAttribute(ot.color),yt.vertexAttribPointer(ot.color,3,5126,!1,0,0)),Yr.disableUnusedAttributes(),yt.drawArrays(4,0,ve.count),ve.count=0},this.renderBufferDirect=function(ve,it,Xe,ot,St,Pn){it===null&&(it=Ke);const cn=St.isMesh&&St.matrixWorld.determinant()<0,Et=tT(ve,it,ot,St);pt.setMaterial(ot,cn);let yn=Xe.index;const Zt=Xe.attributes.position;if(yn===null){if(Zt===void 0||Zt.count===0)return}else if(yn.count===0)return;let Sn,an=1;ot.wireframe===!0&&(yn=Oe.getWireframeAttribute(Xe),an=2),(ot.morphTargets||ot.morphNormals)&&Ep.update(St,Xe,ot,Et),Yr.setup(St,ot,Et,Xe,yn);let xn=Mp;yn!==null&&(Sn=He.get(yn),xn=Ap,xn.setIndex(Sn));const zi=yn!==null?yn.count:Zt.count,ei=Xe.drawRange.start*an,rs=Xe.drawRange.count*an,Jn=Pn!==null?Pn.start*an:0,Us=Pn!==null?Pn.count*an:1/0,$i=Math.max(ei,Jn),so=Math.min(zi,ei+rs,Jn+Us)-1,wr=Math.max(0,so-$i+1);if(wr!==0){if(St.isMesh)ot.wireframe===!0?(pt.setLineWidth(ot.wireframeLinewidth*Ve()),xn.setMode(1)):xn.setMode(4);else if(St.isLine){let Rp=ot.linewidth;Rp===void 0&&(Rp=1),pt.setLineWidth(Rp*Ve()),St.isLineSegments?xn.setMode(1):St.isLineLoop?xn.setMode(2):xn.setMode(3)}else St.isPoints?xn.setMode(0):St.isSprite&&xn.setMode(4);if(St.isInstancedMesh)xn.renderInstances($i,wr,St.count);else if(Xe.isInstancedBufferGeometry){const Rp=Math.min(Xe.instanceCount,Xe._maxInstanceCount);xn.renderInstances($i,wr,Rp)}else xn.render($i,wr)}},this.compile=function(ve,it){p=hn.get(ve),p.init(),ve.traverseVisible(function(Xe){Xe.isLight&&Xe.layers.test(it.layers)&&(p.pushLight(Xe),Xe.castShadow&&p.pushShadow(Xe))}),p.setupLights(),ve.traverse(function(Xe){const ot=Xe.material;if(ot)if(Array.isArray(ot))for(let St=0;St<ot.length;St++)B_(ot[St],ve,Xe);else B_(ot,ve,Xe)})};let F_=null;function ZS(){Bu.stop()}function KS(){Bu.start()}const Bu=new pd;function vg(ve,it,Xe){const ot=it.isScene===!0?it.overrideMaterial:null;for(let St=0,Pn=ve.length;St<Pn;St++){const cn=ve[St],Et=cn.object,yn=cn.geometry,Zt=ot===null?cn.material:ot,Sn=cn.group;if(Xe.isArrayCamera){const an=Xe.cameras;for(let xn=0,zi=an.length;xn<zi;xn++){const ei=an[xn];Et.layers.test(ei.layers)&&(pt.viewport(X.copy(ei.viewport)),p.setupLightsView(ei),QS(Et,it,ei,yn,Zt,Sn))}}else QS(Et,it,Xe,yn,Zt,Sn)}}function QS(ve,it,Xe,ot,St,Pn){if(ve.onBeforeRender(_,it,Xe,ot,St,Pn),ve.modelViewMatrix.multiplyMatrices(Xe.matrixWorldInverse,ve.matrixWorld),ve.normalMatrix.getNormalMatrix(ve.modelViewMatrix),ve.isImmediateRenderObject){const cn=tT(Xe,it,St,ve);pt.setMaterial(St),Yr.reset(),function(Et,yn){Et.render(function(Zt){_.renderBufferImmediate(Zt,yn)})}(ve,cn)}else St.transparent===!0&&St.side===ne?(St.side=V,St.needsUpdate=!0,_.renderBufferDirect(Xe,it,ot,St,ve,Pn),St.side=z,St.needsUpdate=!0,_.renderBufferDirect(Xe,it,ot,St,ve,Pn),St.side=ne):_.renderBufferDirect(Xe,it,ot,St,ve,Pn);ve.onAfterRender(_,it,Xe,ot,St,Pn)}function B_(ve,it,Xe){it.isScene!==!0&&(it=Ke);const ot=re.get(ve),St=p.state.lights,Pn=p.state.shadowsArray,cn=St.state.version,Et=Ct.getParameters(ve,St.state,Pn,it,Xe),yn=Ct.getProgramCacheKey(Et);let Zt=ot.programs;ot.environment=ve.isMeshStandardMaterial?it.environment:null,ot.fog=it.fog,ot.envMap=Ge.get(ve.envMap||ot.environment),Zt===void 0&&(ve.addEventListener("dispose",JS),Zt=new Map,ot.programs=Zt);let Sn=Zt.get(yn);if(Sn!==void 0){if(ot.currentProgram===Sn&&ot.lightsStateVersion===cn)return eT(ve,Et),Sn}else Et.uniforms=Ct.getUniforms(ve),ve.onBuild(Et,_),ve.onBeforeCompile(Et,_),Sn=Ct.acquireProgram(Et,yn),Zt.set(yn,Sn),ot.uniforms=Et.uniforms;const an=ot.uniforms;(ve.isShaderMaterial||ve.isRawShaderMaterial)&&ve.clipping!==!0||(an.clippingPlanes=Ei.uniform),eT(ve,Et),ot.needsLights=function(ei){return ei.isMeshLambertMaterial||ei.isMeshToonMaterial||ei.isMeshPhongMaterial||ei.isMeshStandardMaterial||ei.isShadowMaterial||ei.isShaderMaterial&&ei.lights===!0}(ve),ot.lightsStateVersion=cn,ot.needsLights&&(an.ambientLightColor.value=St.state.ambient,an.lightProbe.value=St.state.probe,an.directionalLights.value=St.state.directional,an.directionalLightShadows.value=St.state.directionalShadow,an.spotLights.value=St.state.spot,an.spotLightShadows.value=St.state.spotShadow,an.rectAreaLights.value=St.state.rectArea,an.ltc_1.value=St.state.rectAreaLTC1,an.ltc_2.value=St.state.rectAreaLTC2,an.pointLights.value=St.state.point,an.pointLightShadows.value=St.state.pointShadow,an.hemisphereLights.value=St.state.hemi,an.directionalShadowMap.value=St.state.directionalShadowMap,an.directionalShadowMatrix.value=St.state.directionalShadowMatrix,an.spotShadowMap.value=St.state.spotShadowMap,an.spotShadowMatrix.value=St.state.spotShadowMatrix,an.pointShadowMap.value=St.state.pointShadowMap,an.pointShadowMatrix.value=St.state.pointShadowMatrix);const xn=Sn.getUniforms(),zi=_s.seqWithValue(xn.seq,an);return ot.currentProgram=Sn,ot.uniformsList=zi,Sn}function eT(ve,it){const Xe=re.get(ve);Xe.outputEncoding=it.outputEncoding,Xe.instancing=it.instancing,Xe.skinning=it.skinning,Xe.numClippingPlanes=it.numClippingPlanes,Xe.numIntersection=it.numClipIntersection,Xe.vertexAlphas=it.vertexAlphas}function tT(ve,it,Xe,ot){it.isScene!==!0&&(it=Ke),Te.resetTextureUnits();const St=it.fog,Pn=Xe.isMeshStandardMaterial?it.environment:null,cn=B===null?_.outputEncoding:B.texture.encoding,Et=Ge.get(Xe.envMap||Pn),yn=Xe.vertexColors===!0&&ot.geometry&&ot.geometry.attributes.color&&ot.geometry.attributes.color.itemSize===4,Zt=re.get(Xe),Sn=p.state.lights;if(Je===!0&&(st===!0||ve!==U)){const wr=ve===U&&Xe.id===G;Ei.setState(Xe,ve,wr)}let an=!1;Xe.version===Zt.__version?Zt.needsLights&&Zt.lightsStateVersion!==Sn.state.version||Zt.outputEncoding!==cn||ot.isInstancedMesh&&Zt.instancing===!1?an=!0:ot.isInstancedMesh||Zt.instancing!==!0?ot.isSkinnedMesh&&Zt.skinning===!1?an=!0:ot.isSkinnedMesh||Zt.skinning!==!0?Zt.envMap!==Et||Xe.fog&&Zt.fog!==St?an=!0:Zt.numClippingPlanes===void 0||Zt.numClippingPlanes===Ei.numPlanes&&Zt.numIntersection===Ei.numIntersection?Zt.vertexAlphas!==yn&&(an=!0):an=!0:an=!0:an=!0:(an=!0,Zt.__version=Xe.version);let xn=Zt.currentProgram;an===!0&&(xn=B_(Xe,it,ot));let zi=!1,ei=!1,rs=!1;const Jn=xn.getUniforms(),Us=Zt.uniforms;if(pt.useProgram(xn.program)&&(zi=!0,ei=!0,rs=!0),Xe.id!==G&&(G=Xe.id,ei=!0),zi||U!==ve){if(Jn.setValue(yt,"projectionMatrix",ve.projectionMatrix),dt.logarithmicDepthBuffer&&Jn.setValue(yt,"logDepthBufFC",2/(Math.log(ve.far+1)/Math.LN2)),U!==ve&&(U=ve,ei=!0,rs=!0),Xe.isShaderMaterial||Xe.isMeshPhongMaterial||Xe.isMeshToonMaterial||Xe.isMeshStandardMaterial||Xe.envMap){const wr=Jn.map.cameraPosition;wr!==void 0&&wr.setValue(yt,de.setFromMatrixPosition(ve.matrixWorld))}(Xe.isMeshPhongMaterial||Xe.isMeshToonMaterial||Xe.isMeshLambertMaterial||Xe.isMeshBasicMaterial||Xe.isMeshStandardMaterial||Xe.isShaderMaterial)&&Jn.setValue(yt,"isOrthographic",ve.isOrthographicCamera===!0),(Xe.isMeshPhongMaterial||Xe.isMeshToonMaterial||Xe.isMeshLambertMaterial||Xe.isMeshBasicMaterial||Xe.isMeshStandardMaterial||Xe.isShaderMaterial||Xe.isShadowMaterial||ot.isSkinnedMesh)&&Jn.setValue(yt,"viewMatrix",ve.matrixWorldInverse)}if(ot.isSkinnedMesh){Jn.setOptional(yt,ot,"bindMatrix"),Jn.setOptional(yt,ot,"bindMatrixInverse");const wr=ot.skeleton;wr&&(dt.floatVertexTextures?(wr.boneTexture===null&&wr.computeBoneTexture(),Jn.setValue(yt,"boneTexture",wr.boneTexture,Te),Jn.setValue(yt,"boneTextureSize",wr.boneTextureSize)):Jn.setOptional(yt,wr,"boneMatrices"))}var $i,so;return(ei||Zt.receiveShadow!==ot.receiveShadow)&&(Zt.receiveShadow=ot.receiveShadow,Jn.setValue(yt,"receiveShadow",ot.receiveShadow)),ei&&(Jn.setValue(yt,"toneMappingExposure",_.toneMappingExposure),Zt.needsLights&&(so=rs,($i=Us).ambientLightColor.needsUpdate=so,$i.lightProbe.needsUpdate=so,$i.directionalLights.needsUpdate=so,$i.directionalLightShadows.needsUpdate=so,$i.pointLights.needsUpdate=so,$i.pointLightShadows.needsUpdate=so,$i.spotLights.needsUpdate=so,$i.spotLightShadows.needsUpdate=so,$i.rectAreaLights.needsUpdate=so,$i.hemisphereLights.needsUpdate=so),St&&Xe.fog&&It.refreshFogUniforms(Us,St),It.refreshMaterialUniforms(Us,Xe,oe,ue,ct),_s.upload(yt,Zt.uniformsList,Us,Te)),Xe.isShaderMaterial&&Xe.uniformsNeedUpdate===!0&&(_s.upload(yt,Zt.uniformsList,Us,Te),Xe.uniformsNeedUpdate=!1),Xe.isSpriteMaterial&&Jn.setValue(yt,"center",ot.center),Jn.setValue(yt,"modelViewMatrix",ot.modelViewMatrix),Jn.setValue(yt,"normalMatrix",ot.normalMatrix),Jn.setValue(yt,"modelMatrix",ot.matrixWorld),xn}Bu.setAnimationLoop(function(ve){F_&&F_(ve)}),typeof window!="undefined"&&Bu.setContext(window),this.setAnimationLoop=function(ve){F_=ve,oo.setAnimationLoop(ve),ve===null?Bu.stop():Bu.start()},oo.addEventListener("sessionstart",ZS),oo.addEventListener("sessionend",KS),this.render=function(ve,it){if(it!==void 0&&it.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(y===!0)return;ve.autoUpdate===!0&&ve.updateMatrixWorld(),it.parent===null&&it.updateMatrixWorld(),oo.enabled===!0&&oo.isPresenting===!0&&(oo.cameraAutoUpdate===!0&&oo.updateCamera(it),it=oo.getCamera()),ve.isScene===!0&&ve.onBeforeRender(_,ve,it,B),p=hn.get(ve,g.length),p.init(),g.push(p),he.multiplyMatrices(it.projectionMatrix,it.matrixWorldInverse),Ae.setFromProjectionMatrix(he),st=this.localClippingEnabled,Je=Ei.init(this.clippingPlanes,st,it),d=Pt.get(ve,m.length),d.init(),m.push(d),function cn(Et,yn,Zt,Sn){if(Et.visible===!1)return;if(Et.layers.test(yn.layers)){if(Et.isGroup)Zt=Et.renderOrder;else if(Et.isLOD)Et.autoUpdate===!0&&Et.update(yn);else if(Et.isLight)p.pushLight(Et),Et.castShadow&&p.pushShadow(Et);else if(Et.isSprite){if(!Et.frustumCulled||Ae.intersectsSprite(Et)){Sn&&de.setFromMatrixPosition(Et.matrixWorld).applyMatrix4(he);const xn=et.update(Et),zi=Et.material;zi.visible&&d.push(Et,xn,zi,Zt,de.z,null)}}else if(Et.isImmediateRenderObject)Sn&&de.setFromMatrixPosition(Et.matrixWorld).applyMatrix4(he),d.push(Et,null,Et.material,Zt,de.z,null);else if((Et.isMesh||Et.isLine||Et.isPoints)&&(Et.isSkinnedMesh&&Et.skeleton.frame!==Ze.render.frame&&(Et.skeleton.update(),Et.skeleton.frame=Ze.render.frame),!Et.frustumCulled||Ae.intersectsObject(Et))){Sn&&de.setFromMatrixPosition(Et.matrixWorld).applyMatrix4(he);const xn=et.update(Et),zi=Et.material;if(Array.isArray(zi)){const ei=xn.groups;for(let rs=0,Jn=ei.length;rs<Jn;rs++){const Us=ei[rs],$i=zi[Us.materialIndex];$i&&$i.visible&&d.push(Et,xn,$i,Zt,de.z,Us)}}else zi.visible&&d.push(Et,xn,zi,Zt,de.z,null)}}const an=Et.children;for(let xn=0,zi=an.length;xn<zi;xn++)cn(an[xn],yn,Zt,Sn)}(ve,it,0,_.sortObjects),d.finish(),_.sortObjects===!0&&d.sort(ce,le),Je===!0&&Ei.beginShadows();const Xe=p.state.shadowsArray;kn.render(Xe,ve,it),p.setupLights(),p.setupLightsView(it),Je===!0&&Ei.endShadows(),this.info.autoReset===!0&&this.info.reset(),qr.render(d,ve);const ot=d.opaque,St=d.transmissive,Pn=d.transparent;ot.length>0&&vg(ot,ve,it),St.length>0&&function(cn,Et,yn,Zt){if(ct===null){const xn=s===!0&&dt.isWebGL2===!0;ct=new(xn?Ks:$r)(1024,1024,{generateMipmaps:!0,type:Fr.convert(Vs)!==null?Vs:ss,minFilter:zs,magFilter:Gt,wrapS:xt,wrapT:xt})}const Sn=_.getRenderTarget();_.setRenderTarget(ct),_.clear();const an=_.toneMapping;_.toneMapping=Sr,vg(cn,yn,Zt),_.toneMapping=an,Te.updateMultisampleRenderTarget(ct),Te.updateRenderTargetMipmap(ct),_.setRenderTarget(Sn),vg(Et,yn,Zt)}(ot,St,ve,it),Pn.length>0&&vg(Pn,ve,it),B!==null&&(Te.updateMultisampleRenderTarget(B),Te.updateRenderTargetMipmap(B)),ve.isScene===!0&&ve.onAfterRender(_,ve,it),pt.buffers.depth.setTest(!0),pt.buffers.depth.setMask(!0),pt.buffers.color.setMask(!0),pt.setPolygonOffset(!1),Yr.resetDefaultState(),G=-1,U=null,g.pop(),p=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 P},this.getRenderTarget=function(){return B},this.setRenderTarget=function(ve,it=0,Xe=0){B=ve,w=it,P=Xe,ve&&re.get(ve).__webglFramebuffer===void 0&&Te.setupRenderTarget(ve);let ot=null,St=!1,Pn=!1;if(ve){const cn=ve.texture;(cn.isDataTexture3D||cn.isDataTexture2DArray)&&(Pn=!0);const Et=re.get(ve).__webglFramebuffer;ve.isWebGLCubeRenderTarget?(ot=Et[it],St=!0):ot=ve.isWebGLMultisampleRenderTarget?re.get(ve).__webglMultisampledFramebuffer:Et,X.copy(ve.viewport),H.copy(ve.scissor),q=ve.scissorTest}else X.copy(_e).multiplyScalar(oe).floor(),H.copy(je).multiplyScalar(oe).floor(),q=ke;if(pt.bindFramebuffer(36160,ot)&&dt.drawBuffers){let cn=!1;if(ve)if(ve.isWebGLMultipleRenderTargets){const Et=ve.texture;if(Ee.length!==Et.length||Ee[0]!==36064){for(let yn=0,Zt=Et.length;yn<Zt;yn++)Ee[yn]=36064+yn;Ee.length=Et.length,cn=!0}}else Ee.length===1&&Ee[0]===36064||(Ee[0]=36064,Ee.length=1,cn=!0);else Ee.length===1&&Ee[0]===1029||(Ee[0]=1029,Ee.length=1,cn=!0);cn&&(dt.isWebGL2?yt.drawBuffers(Ee):ze.get("WEBGL_draw_buffers").drawBuffersWEBGL(Ee))}if(pt.viewport(X),pt.scissor(H),pt.setScissorTest(q),St){const cn=re.get(ve.texture);yt.framebufferTexture2D(36160,36064,34069+it,cn.__webglTexture,Xe)}else if(Pn){const cn=re.get(ve.texture),Et=it||0;yt.framebufferTextureLayer(36160,36064,cn.__webglTexture,Xe||0,Et)}},this.readRenderTargetPixels=function(ve,it,Xe,ot,St,Pn,cn){if(!ve||!ve.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Et=re.get(ve).__webglFramebuffer;if(ve.isWebGLCubeRenderTarget&&cn!==void 0&&(Et=Et[cn]),Et){pt.bindFramebuffer(36160,Et);try{const yn=ve.texture,Zt=yn.format,Sn=yn.type;if(Zt!==Tr&&Fr.convert(Zt)!==yt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const an=Sn===Vs&&(ze.has("EXT_color_buffer_half_float")||dt.isWebGL2&&ze.has("EXT_color_buffer_float"));if(!(Sn===ss||Fr.convert(Sn)===yt.getParameter(35738)||Sn===Io&&(dt.isWebGL2||ze.has("OES_texture_float")||ze.has("WEBGL_color_buffer_float"))||an))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");yt.checkFramebufferStatus(36160)===36053?it>=0&&it<=ve.width-ot&&Xe>=0&&Xe<=ve.height-St&&yt.readPixels(it,Xe,ot,St,Fr.convert(Zt),Fr.convert(Sn),Pn):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const yn=B!==null?re.get(B).__webglFramebuffer:null;pt.bindFramebuffer(36160,yn)}}},this.copyFramebufferToTexture=function(ve,it,Xe=0){const ot=Math.pow(2,-Xe),St=Math.floor(it.image.width*ot),Pn=Math.floor(it.image.height*ot);let cn=Fr.convert(it.format);dt.isWebGL2&&(cn===6407&&(cn=32849),cn===6408&&(cn=32856)),Te.setTexture2D(it,0),yt.copyTexImage2D(3553,Xe,cn,ve.x,ve.y,St,Pn,0),pt.unbindTexture()},this.copyTextureToTexture=function(ve,it,Xe,ot=0){const St=it.image.width,Pn=it.image.height,cn=Fr.convert(Xe.format),Et=Fr.convert(Xe.type);Te.setTexture2D(Xe,0),yt.pixelStorei(37440,Xe.flipY),yt.pixelStorei(37441,Xe.premultiplyAlpha),yt.pixelStorei(3317,Xe.unpackAlignment),it.isDataTexture?yt.texSubImage2D(3553,ot,ve.x,ve.y,St,Pn,cn,Et,it.image.data):it.isCompressedTexture?yt.compressedTexSubImage2D(3553,ot,ve.x,ve.y,it.mipmaps[0].width,it.mipmaps[0].height,cn,it.mipmaps[0].data):yt.texSubImage2D(3553,ot,ve.x,ve.y,cn,Et,it.image),ot===0&&Xe.generateMipmaps&&yt.generateMipmap(3553),pt.unbindTexture()},this.copyTextureToTexture3D=function(ve,it,Xe,ot,St=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const Pn=ve.max.x-ve.min.x+1,cn=ve.max.y-ve.min.y+1,Et=ve.max.z-ve.min.z+1,yn=Fr.convert(ot.format),Zt=Fr.convert(ot.type);let Sn;if(ot.isDataTexture3D)Te.setTexture3D(ot,0),Sn=32879;else{if(!ot.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Te.setTexture2DArray(ot,0),Sn=35866}yt.pixelStorei(37440,ot.flipY),yt.pixelStorei(37441,ot.premultiplyAlpha),yt.pixelStorei(3317,ot.unpackAlignment);const an=yt.getParameter(3314),xn=yt.getParameter(32878),zi=yt.getParameter(3316),ei=yt.getParameter(3315),rs=yt.getParameter(32877),Jn=Xe.isCompressedTexture?Xe.mipmaps[0]:Xe.image;yt.pixelStorei(3314,Jn.width),yt.pixelStorei(32878,Jn.height),yt.pixelStorei(3316,ve.min.x),yt.pixelStorei(3315,ve.min.y),yt.pixelStorei(32877,ve.min.z),Xe.isDataTexture||Xe.isDataTexture3D?yt.texSubImage3D(Sn,St,it.x,it.y,it.z,Pn,cn,Et,yn,Zt,Jn.data):Xe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),yt.compressedTexSubImage3D(Sn,St,it.x,it.y,it.z,Pn,cn,Et,yn,Jn.data)):yt.texSubImage3D(Sn,St,it.x,it.y,it.z,Pn,cn,Et,yn,Zt,Jn),yt.pixelStorei(3314,an),yt.pixelStorei(32878,xn),yt.pixelStorei(3316,zi),yt.pixelStorei(3315,ei),yt.pixelStorei(32877,rs),St===0&&ot.generateMipmaps&&yt.generateMipmap(Sn),pt.unbindTexture()},this.initTexture=function(ve){Te.setTexture2D(ve,0),pt.unbindTexture()},this.resetState=function(){w=0,P=0,B=null,pt.reset(),Yr.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Ci extends Un{}Ci.prototype.isWebGL1Renderer=!0;class ki{constructor(e,t=25e-5){this.name="",this.color=new Dt(e),this.density=t}clone(){return new ki(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ki.prototype.isFogExp2=!0;class Kl{constructor(e,t=1,n=1e3){this.name="",this.color=new Dt(e),this.near=t,this.far=n}clone(){return new Kl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Kl.prototype.isFog=!0;class el extends pn{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}}el.prototype.isScene=!0;class pa{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=$s,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ar()}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 r=0,o=this.stride;r<o;r++)this.array[e+r]=t.array[n+r];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=Ar()),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=Ar()),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}}}pa.prototype.isInterleavedBuffer=!0;const _i=new S;class Xo{constructor(e,t,n,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r===!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++)_i.x=this.getX(t),_i.y=this.getY(t),_i.z=this.getZ(t),_i.applyMatrix4(e),this.setXYZ(t,_i.x,_i.y,_i.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)_i.x=this.getX(t),_i.y=this.getY(t),_i.z=this.getZ(t),_i.applyNormalMatrix(e),this.setXYZ(t,_i.x,_i.y,_i.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)_i.x=this.getX(t),_i.y=this.getY(t),_i.z=this.getZ(t),_i.transformDirection(e),this.setXYZ(t,_i.x,_i.y,_i.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,r){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]=r,this}setXYZW(e,t,n,r,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]=r,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 r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[r+o])}return new gn(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 Xo(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 r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[r+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}}}Xo.prototype.isInterleavedBufferAttribute=!0;class Ql extends Ui{constructor(e){super(),this.type="SpriteMaterial",this.color=new Dt(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 fa;Ql.prototype.isSpriteMaterial=!0;const wo=new S,tl=new S,ma=new S,ga=new mt,eu=new mt,zf=new Rt,Nh=new S,tu=new S,Dh=new S,jf=new mt,nu=new mt,Pd=new mt;class iu extends pn{constructor(e){if(super(),this.type="Sprite",fa===void 0){fa=new Xt;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 pa(t,5);fa.setIndex([0,1,2,0,2,3]),fa.setAttribute("position",new Xo(n,3,0,!1)),fa.setAttribute("uv",new Xo(n,2,3,!1))}this.geometry=fa,this.material=e!==void 0?e:new Ql,this.center=new mt(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),tl.setFromMatrixScale(this.matrixWorld),zf.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ma.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&tl.multiplyScalar(-ma.z);const n=this.material.rotation;let r,o;n!==0&&(o=Math.cos(n),r=Math.sin(n));const s=this.center;Fh(Nh.set(-.5,-.5,0),ma,s,tl,r,o),Fh(tu.set(.5,-.5,0),ma,s,tl,r,o),Fh(Dh.set(.5,.5,0),ma,s,tl,r,o),jf.set(0,0),nu.set(1,0),Pd.set(1,1);let a=e.ray.intersectTriangle(Nh,tu,Dh,!1,wo);if(a===null&&(Fh(tu.set(-.5,.5,0),ma,s,tl,r,o),nu.set(0,1),a=e.ray.intersectTriangle(Nh,Dh,tu,!1,wo),a===null))return;const l=e.ray.origin.distanceTo(wo);l<e.near||l>e.far||t.push({distance:l,point:wo.clone(),uv:qn.getUV(wo,Nh,tu,Dh,jf,nu,Pd,new mt),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 Fh(i,e,t,n,r,o){ga.subVectors(i,t).addScalar(.5).multiply(n),r!==void 0?(eu.x=o*ga.x-r*ga.y,eu.y=r*ga.x+o*ga.y):eu.copy(ga),i.copy(e),i.x+=eu.x,i.y+=eu.y,i.applyMatrix4(zf)}iu.prototype.isSprite=!0;const nl=new S,Vf=new S;class Wf extends pn{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,r=t.length;n<r;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 r;for(r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,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,r;for(n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){nl.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(nl);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){nl.setFromMatrixPosition(e.matrixWorld),Vf.setFromMatrixPosition(this.matrixWorld);const n=nl.distanceTo(Vf)/e.zoom;let r,o;for(t[0].object.visible=!0,r=1,o=t.length;r<o&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<o;r++)t[r].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 r=0,o=n.length;r<o;r++){const s=n[r];t.object.levels.push({object:s.object.uuid,distance:s.distance})}return t}}const ar=new S,Bh=new Bn,Xf=new Bn,pv=new S,Uh=new Rt;class il extends En{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Rt,this.bindMatrixInverse=new Rt}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 Bn,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;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,r=this.geometry;Bh.fromBufferAttribute(r.attributes.skinIndex,e),Xf.fromBufferAttribute(r.attributes.skinWeight,e),ar.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let o=0;o<4;o++){const s=Xf.getComponent(o);if(s!==0){const a=Bh.getComponent(o);Uh.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(pv.copy(ar).applyMatrix4(Uh),s)}}return t.applyMatrix4(this.bindMatrixInverse)}}il.prototype.isSkinnedMesh=!0;class kh extends pn{constructor(){super(),this.type="Bone"}}kh.prototype.isBone=!0;class xs extends mi{constructor(e=null,t=1,n=1,r,o,s,a,l,u=Gt,h=Gt,d,p){super(null,s,a,l,u,h,r,o,d,p),this.image={data:e,width:t,height:n},this.magFilter=u,this.minFilter=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}xs.prototype.isDataTexture=!0;const qf=new Rt,Yf=new Rt;class Gh{constructor(e=[],t=[]){this.uuid=Ar(),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,r=this.bones.length;n<r;n++)this.boneInverses.push(new Rt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new Rt;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,r=this.boneTexture;for(let o=0,s=e.length;o<s;o++){const a=e[o]?e[o].matrixWorld:Yf;qf.multiplyMatrices(a,t[o]),qf.toArray(n,16*o)}r!==null&&(r.needsUpdate=!0)}clone(){return new Gh(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=Fa(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new xs(t,e,e,Tr,Io);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 r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;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 kh),this.bones.push(s),this.boneInverses.push(new Rt().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 r=0,o=t.length;r<o;r++){const s=t[r];e.bones.push(s.uuid);const a=n[r];e.boneInverses.push(a.toArray())}return e}}const $f=new Rt,Hh=new Rt,rl=[],ru=new En;class Id extends En{constructor(e,t,n){super(e,t),this.instanceMatrix=new gn(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,r=this.count;if(ru.geometry=this.geometry,ru.material=this.material,ru.material!==void 0)for(let o=0;o<r;o++){this.getMatrixAt(o,$f),Hh.multiplyMatrices(n,$f),ru.matrixWorld=Hh,ru.raycast(e,rl);for(let s=0,a=rl.length;s<a;s++){const l=rl[s];l.instanceId=o,l.object=this,t.push(l)}rl.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new gn(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"})}}Id.prototype.isInstancedMesh=!0;class Gi extends Ui{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Dt(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}}Gi.prototype.isLineBasicMaterial=!0;const Jf=new S,zh=new S,Zf=new Rt,Od=new Ho,jh=new Mi;class c extends pn{constructor(e=new Xt,t=new Gi){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 r=1,o=t.count;r<o;r++)Jf.fromBufferAttribute(t,r-1),zh.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Jf.distanceTo(zh);e.setAttribute("lineDistance",new Tt(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,r=this.matrixWorld,o=e.params.Line.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),jh.copy(n.boundingSphere),jh.applyMatrix4(r),jh.radius+=o,e.ray.intersectsSphere(jh)===!1)return;Zf.copy(r).invert(),Od.copy(e.ray).applyMatrix4(Zf);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,u=new S,h=new S,d=new S,p=new S,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 P=g.getX(y),B=g.getX(y+1);if(u.fromBufferAttribute(_,P),h.fromBufferAttribute(_,B),Od.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const G=e.ray.origin.distanceTo(p);G<e.near||G>e.far||t.push({distance:G,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),h.fromBufferAttribute(_,y+1),Od.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);P<e.near||P>e.far||t.push({distance:P,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 r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[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.")}}}c.prototype.isLine=!0;const f=new S,x=new S;class A extends c{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 r=0,o=t.count;r<o;r+=2)f.fromBufferAttribute(t,r),x.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+f.distanceTo(x);e.setAttribute("lineDistance",new Tt(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}}A.prototype.isLineSegments=!0;class k extends c{constructor(e,t){super(e,t),this.type="LineLoop"}}k.prototype.isLineLoop=!0;class ie extends Ui{constructor(e){super(),this.type="PointsMaterial",this.color=new Dt(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}}ie.prototype.isPointsMaterial=!0;const pe=new Rt,Se=new Ho,Be=new Mi,tt=new S;class nt extends pn{constructor(e=new Xt,t=new ie){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,r=this.matrixWorld,o=e.params.Points.threshold,s=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Be.copy(n.boundingSphere),Be.applyMatrix4(r),Be.radius+=o,e.ray.intersectsSphere(Be)===!1)return;pe.copy(r).invert(),Se.copy(e.ray).applyMatrix4(pe);const a=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const u=n.index,h=n.attributes.position;if(u!==null)for(let d=Math.max(0,s.start),p=Math.min(u.count,s.start+s.count);d<p;d++){const m=u.getX(d);tt.fromBufferAttribute(h,m),gt(tt,m,l,r,e,t,this)}else for(let d=Math.max(0,s.start),p=Math.min(h.count,s.start+s.count);d<p;d++)tt.fromBufferAttribute(h,d),gt(tt,d,l,r,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 r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o<s;o++){const a=r[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 gt(i,e,t,n,r,o,s){const a=Se.distanceSqToPoint(i);if(a<t){const l=new S;Se.closestPointToPoint(i,l),l.applyMatrix4(n);const u=r.ray.origin.distanceTo(l);if(u<r.near||u>r.far)return;o.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:s})}}nt.prototype.isPoints=!0;class Ft extends mi{constructor(e,t,n,r,o,s,a,l,u){super(e,t,n,r,o,s,a,l,u),this.format=a!==void 0?a:Oo,this.minFilter=s!==void 0?s:Gn,this.magFilter=o!==void 0?o:Gn,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(function d(){h.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)}}Ft.prototype.isVideoTexture=!0;class kt extends mi{constructor(e,t,n,r,o,s,a,l,u,h,d,p){super(null,s,a,l,u,h,r,o,d,p),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}kt.prototype.isCompressedTexture=!0;class $t extends mi{constructor(e,t,n,r,o,s,a,l,u){super(e,t,n,r,o,s,a,l,u),this.needsUpdate=!0}}$t.prototype.isCanvasTexture=!0;class lt extends mi{constructor(e,t,n,r,o,s,a,l,u,h){if((h=h!==void 0?h:ti)!==ti&&h!==Ws)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===ti&&(n=Al),n===void 0&&h===Ws&&(n=Nn),super(null,r,o,s,a,l,h,n,u),this.image={width:e,height:t},this.magFilter=a!==void 0?a:Gt,this.minFilter=l!==void 0?l:Gt,this.flipY=!1,this.generateMipmaps=!1}}lt.prototype.isDepthTexture=!0;class _t extends Xt{constructor(e=1,t=8,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const o=[],s=[],a=[],l=[],u=new S,h=new mt;s.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const m=n+d/t*r;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),h.x=(s[p]/e+1)/2,h.y=(s[p+1]/e+1)/2,l.push(h.x,h.y)}for(let d=1;d<=t;d++)o.push(d,d+1,0);this.setIndex(o),this.setAttribute("position",new Tt(s,3)),this.setAttribute("normal",new Tt(a,3)),this.setAttribute("uv",new Tt(l,2))}static fromJSON(e){return new _t(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Vt extends Xt{constructor(e=1,t=1,n=1,r=8,o=1,s=!1,a=0,l=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:o,openEnded:s,thetaStart:a,thetaLength:l};const u=this;r=Math.floor(r),o=Math.floor(o);const h=[],d=[],p=[],m=[];let g=0;const _=[],y=n/2;let w=0;function P(B){const G=g,U=new mt,X=new S;let H=0;const q=B===!0?e:t,me=B===!0?1:-1;for(let oe=1;oe<=r;oe++)d.push(0,y*me,0),p.push(0,me,0),m.push(.5,.5),g++;const ue=g;for(let oe=0;oe<=r;oe++){const ce=oe/r*l+a,le=Math.cos(ce),_e=Math.sin(ce);X.x=q*_e,X.y=y*me,X.z=q*le,d.push(X.x,X.y,X.z),p.push(0,me,0),U.x=.5*le+.5,U.y=.5*_e*me+.5,m.push(U.x,U.y),g++}for(let oe=0;oe<r;oe++){const ce=G+oe,le=ue+oe;B===!0?h.push(le,le+1,ce):h.push(le+1,le,ce),H+=3}u.addGroup(w,H,B===!0?1:2),w+=H}(function(){const B=new S,G=new S;let U=0;const X=(t-e)/n;for(let H=0;H<=o;H++){const q=[],me=H/o,ue=me*(t-e)+e;for(let oe=0;oe<=r;oe++){const ce=oe/r,le=ce*l+a,_e=Math.sin(le),je=Math.cos(le);G.x=ue*_e,G.y=-me*n+y,G.z=ue*je,d.push(G.x,G.y,G.z),B.set(_e,X,je).normalize(),p.push(B.x,B.y,B.z),m.push(ce,1-me),q.push(g++)}_.push(q)}for(let H=0;H<r;H++)for(let q=0;q<o;q++){const me=_[q][H],ue=_[q+1][H],oe=_[q+1][H+1],ce=_[q][H+1];h.push(me,ue,ce),h.push(ue,oe,ce),U+=6}u.addGroup(w,U,0),w+=U})(),s===!1&&(e>0&&P(!0),t>0&&P(!1)),this.setIndex(h),this.setAttribute("position",new Tt(d,3)),this.setAttribute("normal",new Tt(p,3)),this.setAttribute("uv",new Tt(m,2))}static fromJSON(e){return new Vt(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Lt extends Vt{constructor(e=1,t=1,n=8,r=1,o=!1,s=0,a=2*Math.PI){super(0,e,t,n,r,o,s,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a}}static fromJSON(e){return new Lt(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class jt extends Xt{constructor(e,t,n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const o=[],s=[];function a(p,m,g,_){const y=_+1,w=[];for(let P=0;P<=y;P++){w[P]=[];const B=p.clone().lerp(g,P/y),G=m.clone().lerp(g,P/y),U=y-P;for(let X=0;X<=U;X++)w[P][X]=X===0&&P===y?B:B.clone().lerp(G,X/U)}for(let P=0;P<y;P++)for(let B=0;B<2*(y-P)-1;B++){const G=Math.floor(B/2);B%2==0?(l(w[P][G+1]),l(w[P+1][G]),l(w[P][G])):(l(w[P][G+1]),l(w[P+1][G+1]),l(w[P+1][G]))}}function l(p){o.push(p.x,p.y,p.z)}function u(p,m){const g=3*p;m.x=e[g+0],m.y=e[g+1],m.z=e[g+2]}function h(p,m,g,_){_<0&&p.x===1&&(s[m]=p.x-1),g.x===0&&g.z===0&&(s[m]=_/2/Math.PI+.5)}function d(p){return Math.atan2(p.z,-p.x)}(function(p){const m=new S,g=new S,_=new S;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,_,p)})(r),function(p){const m=new S;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(p),o[g+0]=m.x,o[g+1]=m.y,o[g+2]=m.z}(n),function(){const p=new S;for(let g=0;g<o.length;g+=3){p.x=o[g+0],p.y=o[g+1],p.z=o[g+2];const _=d(p)/2/Math.PI+.5,y=(m=p,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 S,_=new S,y=new S,w=new S,P=new mt,B=new mt,G=new mt;for(let U=0,X=0;U<o.length;U+=9,X+=6){g.set(o[U+0],o[U+1],o[U+2]),_.set(o[U+3],o[U+4],o[U+5]),y.set(o[U+6],o[U+7],o[U+8]),P.set(s[X+0],s[X+1]),B.set(s[X+2],s[X+3]),G.set(s[X+4],s[X+5]),w.copy(g).add(_).add(y).divideScalar(3);const H=d(w);h(P,X+0,g,H),h(B,X+2,_,H),h(G,X+4,y,H)}})(),function(){for(let g=0;g<s.length;g+=6){const _=s[g+0],y=s[g+2],w=s[g+4],P=Math.max(_,y,w),B=Math.min(_,y,w);P>.9&&B<.1&&(_<.2&&(s[g+0]+=1),y<.2&&(s[g+2]+=1),w<.2&&(s[g+4]+=1))}}()}(),this.setAttribute("position",new Tt(o,3)),this.setAttribute("normal",new Tt(o.slice(),3)),this.setAttribute("uv",new Tt(s,2)),r===0?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new jt(e.vertices,e.indices,e.radius,e.details)}}class Kt extends jt{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=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,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[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 Kt(e.radius,e.detail)}}const dn=new S,zt=new S,en=new S,hi=new qn;class qi extends Xt{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),r=Math.cos(Wn*t),o=e.getIndex(),s=e.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],u=["a","b","c"],h=new Array(3),d={},p=[];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}=hi;if(g.fromBufferAttribute(s,l[0]),_.fromBufferAttribute(s,l[1]),y.fromBufferAttribute(s,l[2]),hi.getNormal(en),h[0]=`${Math.round(g.x*n)},${Math.round(g.y*n)},${Math.round(g.z*n)}`,h[1]=`${Math.round(_.x*n)},${Math.round(_.y*n)},${Math.round(_.z*n)}`,h[2]=`${Math.round(y.x*n)},${Math.round(y.y*n)},${Math.round(y.z*n)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let w=0;w<3;w++){const P=(w+1)%3,B=h[w],G=h[P],U=hi[u[w]],X=hi[u[P]],H=`${B}_${G}`,q=`${G}_${B}`;q in d&&d[q]?(en.dot(d[q].normal)<=r&&(p.push(U.x,U.y,U.z),p.push(X.x,X.y,X.z)),d[q]=null):H in d||(d[H]={index0:l[w],index1:l[P],normal:en.clone()})}}for(const m in d)if(d[m]){const{index0:g,index1:_}=d[m];dn.fromBufferAttribute(s,g),zt.fromBufferAttribute(s,_),p.push(dn.x,dn.y,dn.z),p.push(zt.x,zt.y,zt.z)}this.setAttribute("position",new Tt(p,3))}}class ci{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,r=this.getPoint(0),o=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),o+=n.distanceTo(r),t.push(o),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const o=n.length;let s;s=t||e*n[o-1];let a,l=0,u=o-1;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),a=n[r]-s,a<0)l=r+1;else{if(!(a>0)){u=r;break}u=r-1}if(r=u,n[r]===s)return r/(o-1);const h=n[r];return(r+(s-h)/(n[r+1]-h))/(o-1)}getTangent(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);const o=this.getPoint(n),s=this.getPoint(r),a=t||(o.isVector2?new mt:new S);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 S,r=[],o=[],s=[],a=new S,l=new Rt;for(let m=0;m<=e;m++){const g=m/e;r[m]=this.getTangentAt(g,new S),r[m].normalize()}o[0]=new S,s[0]=new S;let u=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=u&&(u=h,n.set(1,0,0)),d<=u&&(u=d,n.set(0,1,0)),p<=u&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[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(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(Wi(r[m-1].dot(r[m]),-1,1));o[m].applyMatrix4(l.makeRotationAxis(a,g))}s[m].crossVectors(r[m],o[m])}if(t===!0){let m=Math.acos(Wi(o[0].dot(o[e]),-1,1));m/=e,r[0].dot(a.crossVectors(o[0],o[e]))>0&&(m=-m);for(let g=1;g<=e;g++)o[g].applyMatrix4(l.makeRotationAxis(r[g],m*g)),s[g].crossVectors(r[g],o[g])}return{tangents:r,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 oi extends ci{constructor(e=0,t=0,n=1,r=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=r,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new mt,r=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=r;for(;o>r;)o-=r;o<Number.EPSILON&&(o=s?0:r),this.aClockwise!==!0||s||(o===r?o=-r:o-=r);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 h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=l-this.aX,m=u-this.aY;l=p*h-m*d+this.aX,u=p*d+m*h+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}}oi.prototype.isEllipseCurve=!0;class io extends oi{constructor(e,t,n,r,o,s){super(e,t,n,n,r,o,s),this.type="ArcCurve"}}function So(){let i=0,e=0,t=0,n=0;function r(o,s,a,l){i=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){r(s,a,u*(a-o),u*(l-s))},initNonuniformCatmullRom:function(o,s,a,l,u,h,d){let p=(s-o)/u-(a-o)/(u+h)+(a-s)/h,m=(a-s)/h-(l-s)/(h+d)+(l-a)/d;p*=h,m*=h,r(s,a,p,m)},calc:function(o){const s=o*o;return i+e*o+t*s+n*(s*o)}}}io.prototype.isArcCurve=!0;const bs=new S,ol=new So,ws=new So,To=new So;class Vh extends ci{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new S){const n=t,r=this.points,o=r.length,s=(o-(this.closed?0:1))*e;let a,l,u=Math.floor(s),h=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/o)+1)*o:h===0&&u===o-1&&(u=o-2,h=1),this.closed||u>0?a=r[(u-1)%o]:(bs.subVectors(r[0],r[1]).add(r[0]),a=bs);const d=r[u%o],p=r[(u+1)%o];if(this.closed||u+2<o?l=r[(u+2)%o]:(bs.subVectors(r[o-1],r[o-2]).add(r[o-1]),l=bs),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(p),m),y=Math.pow(p.distanceToSquared(l),m);_<1e-4&&(_=1),g<1e-4&&(g=_),y<1e-4&&(y=_),ol.initNonuniformCatmullRom(a.x,d.x,p.x,l.x,g,_,y),ws.initNonuniformCatmullRom(a.y,d.y,p.y,l.y,g,_,y),To.initNonuniformCatmullRom(a.z,d.z,p.z,l.z,g,_,y)}else this.curveType==="catmullrom"&&(ol.initCatmullRom(a.x,d.x,p.x,l.x,this.tension),ws.initCatmullRom(a.y,d.y,p.y,l.y,this.tension),To.initCatmullRom(a.z,d.z,p.z,l.z,this.tension));return n.set(ol.calc(h),ws.calc(h),To.calc(h)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.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 r=this.points[t];e.points.push(r.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 r=e.points[t];this.points.push(new S().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Ld(i,e,t,n,r){const o=.5*(n-e),s=.5*(r-t),a=i*i;return(2*t-2*n+o+s)*(i*a)+(-3*t+3*n-2*o-s)*a+o*i+t}function Ss(i,e,t,n){return function(r,o){const s=1-r;return s*s*o}(i,e)+function(r,o){return 2*(1-r)*r*o}(i,t)+function(r,o){return r*r*o}(i,n)}function va(i,e,t,n,r){return function(o,s){const a=1-o;return a*a*a*s}(i,e)+function(o,s){const a=1-o;return 3*a*a*o*s}(i,t)+function(o,s){return 3*(1-o)*o*o*s}(i,n)+function(o,s){return o*o*o*s}(i,r)}Vh.prototype.isCatmullRomCurve3=!0;class _a extends ci{constructor(e=new mt,t=new mt,n=new mt,r=new mt){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new mt){const n=t,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(va(e,r.x,o.x,s.x,a.x),va(e,r.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}}_a.prototype.isCubicBezierCurve=!0;class sl extends ci{constructor(e=new S,t=new S,n=new S,r=new S){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new S){const n=t,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(va(e,r.x,o.x,s.x,a.x),va(e,r.y,o.y,s.y,a.y),va(e,r.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}}sl.prototype.isCubicBezierCurve3=!0;class al extends ci{constructor(e=new mt,t=new mt){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new mt){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 mt;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}}al.prototype.isLineCurve=!0;class ou extends ci{constructor(e=new S,t=new S){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new S){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 ya extends ci{constructor(e=new mt,t=new mt,n=new mt){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new mt){const n=t,r=this.v0,o=this.v1,s=this.v2;return n.set(Ss(e,r.x,o.x,s.x),Ss(e,r.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}}ya.prototype.isQuadraticBezierCurve=!0;class fv extends ci{constructor(e=new S,t=new S,n=new S){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new S){const n=t,r=this.v0,o=this.v1,s=this.v2;return n.set(Ss(e,r.x,o.x,s.x),Ss(e,r.y,o.y,s.y),Ss(e,r.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}}fv.prototype.isQuadraticBezierCurve3=!0;class Kf extends ci{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new mt){const n=t,r=this.points,o=(r.length-1)*e,s=Math.floor(o),a=o-s,l=r[s===0?s:s-1],u=r[s],h=r[s>r.length-2?r.length-1:s+1],d=r[s>r.length-3?r.length-1:s+2];return n.set(Ld(a,l.x,u.x,h.x,d.x),Ld(a,l.y,u.y,h.y,d.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new mt().fromArray(r))}return this}}Kf.prototype.isSplineCurve=!0;var mv=Object.freeze({__proto__:null,ArcCurve:io,CatmullRomCurve3:Vh,CubicBezierCurve:_a,CubicBezierCurve3:sl,EllipseCurve:oi,LineCurve:al,LineCurve3:ou,QuadraticBezierCurve:ya,QuadraticBezierCurve3:fv,SplineCurve:Kf});const QT=function(i,e,t=2){const n=e&&e.length,r=n?e[0]*t:i.length;let o=ny(i,0,r,t,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u,h,d,p,m;if(n&&(o=function(g,_,y,w){const P=[];let B,G,U,X,H;for(B=0,G=_.length;B<G;B++)U=_[B]*w,X=B<G-1?_[B+1]*w:g.length,H=ny(g,U,X,w,!1),H===H.next&&(H.steiner=!0),P.push(aE(H));for(P.sort(rE),B=0;B<P.length;B++)oE(P[B],y),y=ll(y,y.next);return y}(i,e,o,t)),i.length>80*t){a=u=i[0],l=h=i[1];for(let g=t;g<r;g+=t)d=i[g],p=i[g+1],d<a&&(a=d),p<l&&(l=p),d>u&&(u=d),p>h&&(h=p);m=Math.max(u-a,h-l),m=m!==0?1/m:0}return Nd(o,s,t,a,l,m),s};function ny(i,e,t,n,r){let o,s;if(r===function(a,l,u,h){let d=0;for(let p=l,m=u-h;p<u;p+=h)d+=(a[m]-a[p])*(a[p+1]+a[m+1]),m=p;return d}(i,e,t,n)>0)for(o=e;o<t;o+=n)s=oy(o,i[o],i[o+1],s);else for(o=t-n;o>=e;o-=n)s=oy(o,i[o],i[o+1],s);return s&&Qf(s,s.next)&&(Fd(s),s=s.next),s}function ll(i,e){if(!i)return i;e||(e=i);let t,n=i;do if(t=!1,n.steiner||!Qf(n,n.next)&&yi(n.prev,n,n.next)!==0)n=n.next;else{if(Fd(n),n=e=n.prev,n===n.next)break;t=!0}while(t||n!==e);return e}function Nd(i,e,t,n,r,o,s){if(!i)return;!s&&o&&function(h,d,p,m){let g=h;do g.z===null&&(g.z=gv(g.x,g.y,d,p,m)),g.prevZ=g.prev,g.nextZ=g.next,g=g.next;while(g!==h);g.prevZ.nextZ=null,g.prevZ=null,function(_){let y,w,P,B,G,U,X,H,q=1;do{for(w=_,_=null,G=null,U=0;w;){for(U++,P=w,X=0,y=0;y<q&&(X++,P=P.nextZ,P);y++);for(H=q;X>0||H>0&&P;)X!==0&&(H===0||!P||w.z<=P.z)?(B=w,w=w.nextZ,X--):(B=P,P=P.nextZ,H--),G?G.nextZ=B:_=B,B.prevZ=G,G=B;w=P}G.nextZ=null,q*=2}while(U>1)}(g)}(i,n,r,o);let a,l,u=i;for(;i.prev!==i.next;)if(a=i.prev,l=i.next,o?tE(i,n,r,o):eE(i))e.push(a.i/t),e.push(i.i/t),e.push(l.i/t),Fd(i),i=l.next,u=l.next;else if((i=l)===u){s?s===1?Nd(i=nE(ll(i),e,t),e,t,n,r,o,2):s===2&&iE(i,e,t,n,r,o):Nd(ll(i),e,t,n,r,o,1);break}}function eE(i){const e=i.prev,t=i,n=i.next;if(yi(e,t,n)>=0)return!1;let r=i.next.next;for(;r!==i.prev;){if(Wh(e.x,e.y,t.x,t.y,n.x,n.y,r.x,r.y)&&yi(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function tE(i,e,t,n){const r=i.prev,o=i,s=i.next;if(yi(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,u=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,h=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,d=gv(a,l,e,t,n),p=gv(u,h,e,t,n);let m=i.prevZ,g=i.nextZ;for(;m&&m.z>=d&&g&&g.z<=p;){if(m!==i.prev&&m!==i.next&&Wh(r.x,r.y,o.x,o.y,s.x,s.y,m.x,m.y)&&yi(m.prev,m,m.next)>=0||(m=m.prevZ,g!==i.prev&&g!==i.next&&Wh(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&yi(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;m&&m.z>=d;){if(m!==i.prev&&m!==i.next&&Wh(r.x,r.y,o.x,o.y,s.x,s.y,m.x,m.y)&&yi(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;g&&g.z<=p;){if(g!==i.prev&&g!==i.next&&Wh(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&yi(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function nE(i,e,t){let n=i;do{const r=n.prev,o=n.next.next;!Qf(r,o)&&iy(r,n,n.next,o)&&Dd(r,o)&&Dd(o,r)&&(e.push(r.i/t),e.push(n.i/t),e.push(o.i/t),Fd(n),Fd(n.next),n=i=o),n=n.next}while(n!==i);return ll(n)}function iE(i,e,t,n,r,o){let s=i;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&lE(s,a)){let l=ry(s,a);return s=ll(s,s.next),l=ll(l,l.next),Nd(s,e,t,n,r,o),void Nd(l,e,t,n,r,o)}a=a.next}s=s.next}while(s!==i)}function rE(i,e){return i.x-e.x}function oE(i,e){if(e=function(t,n){let r=n;const o=t.x,s=t.y;let a,l=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){const g=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(g<=o&&g>l){if(l=g,g===o){if(s===r.y)return r;if(s===r.next.y)return r.next}a=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!a)return null;if(o===l)return a;const u=a,h=a.x,d=a.y;let p,m=1/0;r=a;do o>=r.x&&r.x>=h&&o!==r.x&&Wh(s<d?o:l,s,h,d,s<d?l:o,s,r.x,r.y)&&(p=Math.abs(s-r.y)/(o-r.x),Dd(r,t)&&(p<m||p===m&&(r.x>a.x||r.x===a.x&&sE(a,r)))&&(a=r,m=p)),r=r.next;while(r!==u);return a}(i,e)){const t=ry(e,i);ll(e,e.next),ll(t,t.next)}}function sE(i,e){return yi(i.prev,i,e.prev)<0&&yi(e.next,i,i.next)<0}function gv(i,e,t,n,r){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-t)*r)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function aE(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function Wh(i,e,t,n,r,o,s,a){return(r-s)*(e-a)-(i-s)*(o-a)>=0&&(i-s)*(n-a)-(t-s)*(e-a)>=0&&(t-s)*(o-a)-(r-s)*(n-a)>=0}function lE(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(t,n){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==n.i&&r.next.i!==n.i&&iy(r,r.next,t,n))return!0;r=r.next}while(r!==t);return!1}(i,e)&&(Dd(i,e)&&Dd(e,i)&&function(t,n){let r=t,o=!1;const s=(t.x+n.x)/2,a=(t.y+n.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&s<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(o=!o),r=r.next;while(r!==t);return o}(i,e)&&(yi(i.prev,i,e.prev)||yi(i,e.prev,e))||Qf(i,e)&&yi(i.prev,i,i.next)>0&&yi(e.prev,e,e.next)>0)}function yi(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function Qf(i,e){return i.x===e.x&&i.y===e.y}function iy(i,e,t,n){const r=tm(yi(i,e,t)),o=tm(yi(i,e,n)),s=tm(yi(t,n,i)),a=tm(yi(t,n,e));return r!==o&&s!==a||!(r!==0||!em(i,t,e))||!(o!==0||!em(i,n,e))||!(s!==0||!em(t,i,n))||!(a!==0||!em(t,e,n))}function em(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function tm(i){return i>0?1:i<0?-1:0}function Dd(i,e){return yi(i.prev,i,i.next)<0?yi(i,e,i.next)>=0&&yi(i,i.prev,e)>=0:yi(i,e,i.prev)<0||yi(i,i.next,e)<0}function ry(i,e){const t=new vv(i.i,i.x,i.y),n=new vv(e.i,e.x,e.y),r=i.next,o=e.prev;return i.next=e,e.prev=i,t.next=r,r.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}function oy(i,e,t,n){const r=new vv(i,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Fd(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function vv(i,e,t){this.i=i,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 Ts{static area(e){const t=e.length;let n=0;for(let r=t-1,o=0;o<t;r=o++)n+=e[r].x*e[o].y-e[o].x*e[r].y;return .5*n}static isClockWise(e){return Ts.area(e)<0}static triangulateShape(e,t){const n=[],r=[],o=[];sy(e),ay(n,e);let s=e.length;t.forEach(sy);for(let l=0;l<t.length;l++)r.push(s),s+=t[l].length,ay(n,t[l]);const a=QT(n,r);for(let l=0;l<a.length;l+=3)o.push(a.slice(l,l+3));return o}}function sy(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function ay(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class qo extends Xt{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],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,h=t.steps!==void 0?t.steps:1;let d=t.depth!==void 0?t.depth:100,p=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,P=t.UVGenerator!==void 0?t.UVGenerator:uE;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),d=t.amount);let B,G,U,X,H,q=!1;w&&(B=w.getSpacedPoints(h),q=!0,p=!1,G=w.computeFrenetFrames(h,!1),U=new S,X=new S,H=new S),p||(y=0,m=0,g=0,_=0);const me=a.extractPoints(u);let ue=me.shape;const oe=me.holes;if(!Ts.isClockWise(ue)){ue=ue.reverse();for(let Ze=0,re=oe.length;Ze<re;Ze++){const Te=oe[Ze];Ts.isClockWise(Te)&&(oe[Ze]=Te.reverse())}}const ce=Ts.triangulateShape(ue,oe),le=ue;for(let Ze=0,re=oe.length;Ze<re;Ze++){const Te=oe[Ze];ue=ue.concat(Te)}function _e(Ze,re,Te){return re||console.error("THREE.ExtrudeGeometry: vec does not exist"),re.clone().multiplyScalar(Te).add(Ze)}const je=ue.length,ke=ce.length;function Ee(Ze,re,Te){let Ge,He,Oe;const et=Ze.x-re.x,Ct=Ze.y-re.y,It=Te.x-Ze.x,Pt=Te.y-Ze.y,hn=et*et+Ct*Ct,Ei=et*Pt-Ct*It;if(Math.abs(Ei)>Number.EPSILON){const kn=Math.sqrt(hn),qr=Math.sqrt(It*It+Pt*Pt),Ep=re.x-Ct/kn,Mp=re.y+et/kn,Ap=((Te.x-Pt/qr-Ep)*Pt-(Te.y+It/qr-Mp)*It)/(et*Pt-Ct*It);Ge=Ep+et*Ap-Ze.x,He=Mp+Ct*Ap-Ze.y;const Fr=Ge*Ge+He*He;if(Fr<=2)return new mt(Ge,He);Oe=Math.sqrt(Fr/2)}else{let kn=!1;et>Number.EPSILON?It>Number.EPSILON&&(kn=!0):et<-Number.EPSILON?It<-Number.EPSILON&&(kn=!0):Math.sign(Ct)===Math.sign(Pt)&&(kn=!0),kn?(Ge=-Ct,He=et,Oe=Math.sqrt(hn)):(Ge=et,He=Ct,Oe=Math.sqrt(hn/2))}return new mt(Ge/Oe,He/Oe)}const Ae=[];for(let Ze=0,re=le.length,Te=re-1,Ge=Ze+1;Ze<re;Ze++,Te++,Ge++)Te===re&&(Te=0),Ge===re&&(Ge=0),Ae[Ze]=Ee(le[Ze],le[Te],le[Ge]);const Je=[];let st,ct=Ae.concat();for(let Ze=0,re=oe.length;Ze<re;Ze++){const Te=oe[Ze];st=[];for(let Ge=0,He=Te.length,Oe=He-1,et=Ge+1;Ge<He;Ge++,Oe++,et++)Oe===He&&(Oe=0),et===He&&(et=0),st[Ge]=Ee(Te[Ge],Te[Oe],Te[et]);Je.push(st),ct=ct.concat(st)}for(let Ze=0;Ze<y;Ze++){const re=Ze/y,Te=m*Math.cos(re*Math.PI/2),Ge=g*Math.sin(re*Math.PI/2)+_;for(let He=0,Oe=le.length;He<Oe;He++){const et=_e(le[He],Ae[He],Ge);Ke(et.x,et.y,-Te)}for(let He=0,Oe=oe.length;He<Oe;He++){const et=oe[He];st=Je[He];for(let Ct=0,It=et.length;Ct<It;Ct++){const Pt=_e(et[Ct],st[Ct],Ge);Ke(Pt.x,Pt.y,-Te)}}}const he=g+_;for(let Ze=0;Ze<je;Ze++){const re=p?_e(ue[Ze],ct[Ze],he):ue[Ze];q?(X.copy(G.normals[0]).multiplyScalar(re.x),U.copy(G.binormals[0]).multiplyScalar(re.y),H.copy(B[0]).add(X).add(U),Ke(H.x,H.y,H.z)):Ke(re.x,re.y,0)}for(let Ze=1;Ze<=h;Ze++)for(let re=0;re<je;re++){const Te=p?_e(ue[re],ct[re],he):ue[re];q?(X.copy(G.normals[Ze]).multiplyScalar(Te.x),U.copy(G.binormals[Ze]).multiplyScalar(Te.y),H.copy(B[Ze]).add(X).add(U),Ke(H.x,H.y,H.z)):Ke(Te.x,Te.y,d/h*Ze)}for(let Ze=y-1;Ze>=0;Ze--){const re=Ze/y,Te=m*Math.cos(re*Math.PI/2),Ge=g*Math.sin(re*Math.PI/2)+_;for(let He=0,Oe=le.length;He<Oe;He++){const et=_e(le[He],Ae[He],Ge);Ke(et.x,et.y,d+Te)}for(let He=0,Oe=oe.length;He<Oe;He++){const et=oe[He];st=Je[He];for(let Ct=0,It=et.length;Ct<It;Ct++){const Pt=_e(et[Ct],st[Ct],Ge);q?Ke(Pt.x,Pt.y+B[h-1].y,B[h-1].x+Te):Ke(Pt.x,Pt.y,d+Te)}}}function de(Ze,re){let Te=Ze.length;for(;--Te>=0;){const Ge=Te;let He=Te-1;He<0&&(He=Ze.length-1);for(let Oe=0,et=h+2*y;Oe<et;Oe++){const Ct=je*Oe,It=je*(Oe+1);ze(re+Ge+Ct,re+He+Ct,re+He+It,re+Ge+It)}}}function Ke(Ze,re,Te){l.push(Ze),l.push(re),l.push(Te)}function Ve(Ze,re,Te){dt(Ze),dt(re),dt(Te);const Ge=r.length/3,He=P.generateTopUV(n,r,Ge-3,Ge-2,Ge-1);pt(He[0]),pt(He[1]),pt(He[2])}function ze(Ze,re,Te,Ge){dt(Ze),dt(re),dt(Ge),dt(re),dt(Te),dt(Ge);const He=r.length/3,Oe=P.generateSideWallUV(n,r,He-6,He-3,He-2,He-1);pt(Oe[0]),pt(Oe[1]),pt(Oe[3]),pt(Oe[1]),pt(Oe[2]),pt(Oe[3])}function dt(Ze){r.push(l[3*Ze+0]),r.push(l[3*Ze+1]),r.push(l[3*Ze+2])}function pt(Ze){o.push(Ze.x),o.push(Ze.y)}(function(){const Ze=r.length/3;if(p){let re=0,Te=je*re;for(let Ge=0;Ge<ke;Ge++){const He=ce[Ge];Ve(He[2]+Te,He[1]+Te,He[0]+Te)}re=h+2*y,Te=je*re;for(let Ge=0;Ge<ke;Ge++){const He=ce[Ge];Ve(He[0]+Te,He[1]+Te,He[2]+Te)}}else{for(let re=0;re<ke;re++){const Te=ce[re];Ve(Te[2],Te[1],Te[0])}for(let re=0;re<ke;re++){const Te=ce[re];Ve(Te[0]+je*h,Te[1]+je*h,Te[2]+je*h)}}n.addGroup(Ze,r.length/3-Ze,0)})(),function(){const Ze=r.length/3;let re=0;de(le,re),re+=le.length;for(let Te=0,Ge=oe.length;Te<Ge;Te++){const He=oe[Te];de(He,re),re+=He.length}n.addGroup(Ze,r.length/3-Ze,1)}()}this.setAttribute("position",new Tt(r,3)),this.setAttribute("uv",new Tt(o,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(t,n,r){if(r.shapes=[],Array.isArray(t))for(let o=0,s=t.length;o<s;o++){const a=t[o];r.shapes.push(a.uuid)}else r.shapes.push(t.uuid);return n.extrudePath!==void 0&&(r.options.extrudePath=n.extrudePath.toJSON()),r}(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 r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new mv[r.type]().fromJSON(r)),new qo(n,e.options)}}const uE={generateTopUV:function(i,e,t,n,r){const o=e[3*t],s=e[3*t+1],a=e[3*n],l=e[3*n+1],u=e[3*r],h=e[3*r+1];return[new mt(o,s),new mt(a,l),new mt(u,h)]},generateSideWallUV:function(i,e,t,n,r,o){const s=e[3*t],a=e[3*t+1],l=e[3*t+2],u=e[3*n],h=e[3*n+1],d=e[3*n+2],p=e[3*r],m=e[3*r+1],g=e[3*r+2],_=e[3*o],y=e[3*o+1],w=e[3*o+2];return Math.abs(a-h)<Math.abs(s-u)?[new mt(s,1-l),new mt(u,1-d),new mt(p,1-g),new mt(_,1-w)]:[new mt(a,1-l),new mt(h,1-d),new mt(m,1-g),new mt(y,1-w)]}};class Xh extends jt{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 Xh(e.radius,e.detail)}}class qh extends Xt{constructor(e,t=12,n=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Wi(r,0,2*Math.PI);const o=[],s=[],a=[],l=1/t,u=new S,h=new mt;for(let d=0;d<=t;d++){const p=n+d*l*r,m=Math.sin(p),g=Math.cos(p);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),h.x=d/t,h.y=_/(e.length-1),a.push(h.x,h.y)}for(let d=0;d<t;d++)for(let p=0;p<e.length-1;p++){const m=p+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 Tt(s,3)),this.setAttribute("uv",new Tt(a,2)),this.computeVertexNormals(),r===2*Math.PI){const d=this.attributes.normal.array,p=new S,m=new S,g=new S,_=t*e.length*3;for(let y=0,w=0;y<e.length;y++,w+=3)p.x=d[w+0],p.y=d[w+1],p.z=d[w+2],m.x=d[_+w+0],m.y=d[_+w+1],m.z=d[_+w+2],g.addVectors(p,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 qh(e.points,e.segments,e.phiStart,e.phiLength)}}class su extends jt{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 su(e.radius,e.detail)}}class Bd extends Xt{constructor(e,t,n){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};const r=[],o=[],s=[],a=[],l=1e-5,u=new S,h=new S,d=new S,p=new S,m=new S;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 P=w/t;e(P,y,h),o.push(h.x,h.y,h.z),P-l>=0?(e(P-l,y,d),p.subVectors(h,d)):(e(P+l,y,d),p.subVectors(d,h)),y-l>=0?(e(P,y-l,d),m.subVectors(h,d)):(e(P,y+l,d),m.subVectors(d,h)),u.crossVectors(p,m).normalize(),s.push(u.x,u.y,u.z),a.push(P,y)}}for(let _=0;_<n;_++)for(let y=0;y<t;y++){const w=_*g+y,P=_*g+y+1,B=(_+1)*g+y+1,G=(_+1)*g+y;r.push(w,P,G),r.push(P,B,G)}this.setIndex(r),this.setAttribute("position",new Tt(o,3)),this.setAttribute("normal",new Tt(s,3)),this.setAttribute("uv",new Tt(a,2))}}class Yh extends Xt{constructor(e=.5,t=1,n=8,r=1,o=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:o,thetaLength:s},n=Math.max(3,n);const a=[],l=[],u=[],h=[];let d=e;const p=(t-e)/(r=Math.max(1,r)),m=new S,g=new mt;for(let _=0;_<=r;_++){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,h.push(g.x,g.y)}d+=p}for(let _=0;_<r;_++){const y=_*(n+1);for(let w=0;w<n;w++){const P=w+y,B=P,G=P+n+1,U=P+n+2,X=P+1;a.push(B,G,X),a.push(G,U,X)}}this.setIndex(a),this.setAttribute("position",new Tt(l,3)),this.setAttribute("normal",new Tt(u,3)),this.setAttribute("uv",new Tt(h,2))}static fromJSON(e){return new Yh(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class au extends Xt{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],o=[],s=[];let a=0,l=0;if(Array.isArray(e)===!1)u(e);else for(let h=0;h<e.length;h++)u(e[h]),this.addGroup(a,l,h),a+=l,l=0;function u(h){const d=r.length/3,p=h.extractPoints(t);let m=p.shape;const g=p.holes;Ts.isClockWise(m)===!1&&(m=m.reverse());for(let y=0,w=g.length;y<w;y++){const P=g[y];Ts.isClockWise(P)===!0&&(g[y]=P.reverse())}const _=Ts.triangulateShape(m,g);for(let y=0,w=g.length;y<w;y++){const P=g[y];m=m.concat(P)}for(let y=0,w=m.length;y<w;y++){const P=m[y];r.push(P.x,P.y,0),o.push(0,0,1),s.push(P.x,P.y)}for(let y=0,w=_.length;y<w;y++){const P=_[y],B=P[0]+d,G=P[1]+d,U=P[2]+d;n.push(B,G,U),l+=3}}this.setIndex(n),this.setAttribute("position",new Tt(r,3)),this.setAttribute("normal",new Tt(o,3)),this.setAttribute("uv",new Tt(s,2))}toJSON(){const e=super.toJSON();return function(t,n){if(n.shapes=[],Array.isArray(t))for(let r=0,o=t.length;r<o;r++){const s=t[r];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 r=0,o=e.shapes.length;r<o;r++){const s=t[e.shapes[r]];n.push(s)}return new au(n,e.curveSegments)}}class lu extends Xt{constructor(e=1,t=8,n=6,r=0,o=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,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 h=[],d=new S,p=new S,m=[],g=[],_=[],y=[];for(let w=0;w<=n;w++){const P=[],B=w/n;let G=0;w==0&&s==0?G=.5/t:w==n&&l==Math.PI&&(G=-.5/t);for(let U=0;U<=t;U++){const X=U/t;d.x=-e*Math.cos(r+X*o)*Math.sin(s+B*a),d.y=e*Math.cos(s+B*a),d.z=e*Math.sin(r+X*o)*Math.sin(s+B*a),g.push(d.x,d.y,d.z),p.copy(d).normalize(),_.push(p.x,p.y,p.z),y.push(X+G,1-B),P.push(u++)}h.push(P)}for(let w=0;w<n;w++)for(let P=0;P<t;P++){const B=h[w][P+1],G=h[w][P],U=h[w+1][P],X=h[w+1][P+1];(w!==0||s>0)&&m.push(B,G,X),(w!==n-1||l<Math.PI)&&m.push(G,U,X)}this.setIndex(m),this.setAttribute("position",new Tt(g,3)),this.setAttribute("normal",new Tt(_,3)),this.setAttribute("uv",new Tt(y,2))}static fromJSON(e){return new lu(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class $h extends jt{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 $h(e.radius,e.detail)}}class nm extends qo{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 Xt;const r=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(r,t),this.type="TextGeometry"}}class Jh extends Xt{constructor(e=1,t=.4,n=8,r=6,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:o},n=Math.floor(n),r=Math.floor(r);const s=[],a=[],l=[],u=[],h=new S,d=new S,p=new S;for(let m=0;m<=n;m++)for(let g=0;g<=r;g++){const _=g/r*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),h.x=e*Math.cos(_),h.y=e*Math.sin(_),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(g/r),u.push(m/n)}for(let m=1;m<=n;m++)for(let g=1;g<=r;g++){const _=(r+1)*m+g-1,y=(r+1)*(m-1)+g-1,w=(r+1)*(m-1)+g,P=(r+1)*m+g;s.push(_,y,P),s.push(y,w,P)}this.setIndex(s),this.setAttribute("position",new Tt(a,3)),this.setAttribute("normal",new Tt(l,3)),this.setAttribute("uv",new Tt(u,2))}static fromJSON(e){return new Jh(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Zh extends Xt{constructor(e=1,t=.4,n=64,r=8,o=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:o,q:s},n=Math.floor(n),r=Math.floor(r);const a=[],l=[],u=[],h=[],d=new S,p=new S,m=new S,g=new S,_=new S,y=new S,w=new S;for(let B=0;B<=n;++B){const G=B/n*o*Math.PI*2;P(G,o,s,e,m),P(G+.01,o,s,e,g),y.subVectors(g,m),w.addVectors(g,m),_.crossVectors(y,w),w.crossVectors(_,y),_.normalize(),w.normalize();for(let U=0;U<=r;++U){const X=U/r*Math.PI*2,H=-t*Math.cos(X),q=t*Math.sin(X);d.x=m.x+(H*w.x+q*_.x),d.y=m.y+(H*w.y+q*_.y),d.z=m.z+(H*w.z+q*_.z),l.push(d.x,d.y,d.z),p.subVectors(d,m).normalize(),u.push(p.x,p.y,p.z),h.push(B/n),h.push(U/r)}}for(let B=1;B<=n;B++)for(let G=1;G<=r;G++){const U=(r+1)*(B-1)+(G-1),X=(r+1)*B+(G-1),H=(r+1)*B+G,q=(r+1)*(B-1)+G;a.push(U,X,q),a.push(X,H,q)}function P(B,G,U,X,H){const q=Math.cos(B),me=Math.sin(B),ue=U/G*B,oe=Math.cos(ue);H.x=X*(2+oe)*.5*q,H.y=X*(2+oe)*me*.5,H.z=X*Math.sin(ue)*.5}this.setIndex(a),this.setAttribute("position",new Tt(l,3)),this.setAttribute("normal",new Tt(u,3)),this.setAttribute("uv",new Tt(h,2))}static fromJSON(e){return new Zh(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Kh extends Xt{constructor(e,t=64,n=1,r=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:o};const s=e.computeFrenetFrames(t,o);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new S,l=new S,u=new mt;let h=new S;const d=[],p=[],m=[],g=[];function _(y){h=e.getPointAt(y/t,h);const w=s.normals[y],P=s.binormals[y];for(let B=0;B<=r;B++){const G=B/r*Math.PI*2,U=Math.sin(G),X=-Math.cos(G);l.x=X*w.x+U*P.x,l.y=X*w.y+U*P.y,l.z=X*w.z+U*P.z,l.normalize(),p.push(l.x,l.y,l.z),a.x=h.x+n*l.x,a.y=h.y+n*l.y,a.z=h.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<=r;w++)u.x=y/t,u.y=w/r,m.push(u.x,u.y)}(),function(){for(let y=1;y<=t;y++)for(let w=1;w<=r;w++){const P=(r+1)*(y-1)+(w-1),B=(r+1)*y+(w-1),G=(r+1)*y+w,U=(r+1)*(y-1)+w;g.push(P,B,U),g.push(B,G,U)}}()})(),this.setIndex(g),this.setAttribute("position",new Tt(d,3)),this.setAttribute("normal",new Tt(p,3)),this.setAttribute("uv",new Tt(m,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Kh(new mv[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class _v extends Xt{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],r={},o=new S;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,h=l.length;u<h;++u){const d=l[u],p=d.start;for(let m=p,g=p+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 P=n[0]+","+n[1];r[P]===void 0&&(r[P]={index1:n[0],index2:n[1]})}}for(const u in r){const h=r[u];o.fromBufferAttribute(s,h.index1),t.push(o.x,o.y,o.z),o.fromBufferAttribute(s,h.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 h=3*a+u;o.fromBufferAttribute(s,h),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 Tt(t,3))}}var ly=Object.freeze({__proto__:null,BoxGeometry:xo,BoxBufferGeometry:xo,CircleGeometry:_t,CircleBufferGeometry:_t,ConeGeometry:Lt,ConeBufferGeometry:Lt,CylinderGeometry:Vt,CylinderBufferGeometry:Vt,DodecahedronGeometry:Kt,DodecahedronBufferGeometry:Kt,EdgesGeometry:qi,ExtrudeGeometry:qo,ExtrudeBufferGeometry:qo,IcosahedronGeometry:Xh,IcosahedronBufferGeometry:Xh,LatheGeometry:qh,LatheBufferGeometry:qh,OctahedronGeometry:su,OctahedronBufferGeometry:su,ParametricGeometry:Bd,ParametricBufferGeometry:Bd,PlaneGeometry:Ki,PlaneBufferGeometry:Ki,PolyhedronGeometry:jt,PolyhedronBufferGeometry:jt,RingGeometry:Yh,RingBufferGeometry:Yh,ShapeGeometry:au,ShapeBufferGeometry:au,SphereGeometry:lu,SphereBufferGeometry:lu,TetrahedronGeometry:$h,TetrahedronBufferGeometry:$h,TextGeometry:nm,TextBufferGeometry:nm,TorusGeometry:Jh,TorusBufferGeometry:Jh,TorusKnotGeometry:Zh,TorusKnotBufferGeometry:Zh,TubeGeometry:Kh,TubeBufferGeometry:Kh,WireframeGeometry:_v});class yv extends Ui{constructor(e){super(),this.type="ShadowMaterial",this.color=new Dt(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}yv.prototype.isShadowMaterial=!0;class Qh extends or{constructor(e){super(e),this.type="RawShaderMaterial"}}Qh.prototype.isRawShaderMaterial=!0;class im extends Ui{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Dt(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 Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(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}}im.prototype.isMeshStandardMaterial=!0;class xv extends im{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 mt(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=Wi(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 Dt(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 Dt).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}}xv.prototype.isMeshPhysicalMaterial=!0;class rm extends Ui{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Dt(16777215),this.specular=new Dt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Co,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}}rm.prototype.isMeshPhongMaterial=!0;class bv extends Ui{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Dt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(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}}bv.prototype.isMeshToonMaterial=!0;class wv extends Ui{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(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}}wv.prototype.isMeshNormalMaterial=!0;class om extends Ui{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Dt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Co,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}}om.prototype.isMeshLambertMaterial=!0;class Sv extends Ui{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Dt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new mt(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}}Sv.prototype.isMeshMatcapMaterial=!0;class Tv extends Gi{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}}Tv.prototype.isLineDashedMaterial=!0;var hE=Object.freeze({__proto__:null,ShadowMaterial:yv,SpriteMaterial:Ql,RawShaderMaterial:Qh,ShaderMaterial:or,PointsMaterial:ie,MeshPhysicalMaterial:xv,MeshStandardMaterial:im,MeshPhongMaterial:rm,MeshToonMaterial:bv,MeshNormalMaterial:wv,MeshLambertMaterial:om,MeshDepthMaterial:bn,MeshDistanceMaterial:Oh,MeshBasicMaterial:gi,MeshMatcapMaterial:Sv,LineDashedMaterial:Tv,LineBasicMaterial:Gi,Material:Ui});const si={arraySlice:function(i,e,t){return si.isTypedArray(i)?new i.constructor(i.subarray(e,t!==void 0?t:i.length)):i.slice(e,t)},convertArray:function(i,e,t){return!i||!t&&i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)},isTypedArray:function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},getKeyframeOrder:function(i){const e=i.length,t=new Array(e);for(let n=0;n!==e;++n)t[n]=n;return t.sort(function(n,r){return i[n]-i[r]}),t},sortedArray:function(i,e,t){const n=i.length,r=new i.constructor(n);for(let o=0,s=0;s!==n;++o){const a=t[o]*e;for(let l=0;l!==e;++l)r[s++]=i[a+l]}return r},flattenJSON:function(i,e,t,n){let r=1,o=i[0];for(;o!==void 0&&o[n]===void 0;)o=i[r++];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=i[r++];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=i[r++];while(o!==void 0);else do s=o[n],s!==void 0&&(e.push(o.time),t.push(s)),o=i[r++];while(o!==void 0)},subclip:function(i,e,t,n,r=30){const o=i.clone();o.name=e;const s=[];for(let l=0;l<o.tracks.length;++l){const u=o.tracks[l],h=u.getValueSize(),d=[],p=[];for(let m=0;m<u.times.length;++m){const g=u.times[m]*r;if(!(g<t||g>=n)){d.push(u.times[m]);for(let _=0;_<h;++_)p.push(u.values[m*h+_])}}d.length!==0&&(u.times=si.convertArray(d,u.times.constructor),u.values=si.convertArray(p,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(i,e=0,t=i,n=30){n<=0&&(n=30);const r=t.tracks.length,o=e/n;for(let s=0;s<r;++s){const a=t.tracks[s],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const u=i.tracks.find(function(w){return w.name===a.name&&w.ValueTypeName===l});if(u===void 0)continue;let h=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);let p=0;const m=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const g=a.times.length-1;let _;if(o<=a.times[0]){const w=h,P=d-h;_=si.arraySlice(a.values,w,P)}else if(o>=a.times[g]){const w=g*d+h,P=w+d-h;_=si.arraySlice(a.values,w,P)}else{const w=a.createInterpolant(),P=h,B=d-h;w.evaluate(o),_=si.arraySlice(w.resultBuffer,P,B)}l==="quaternion"&&new Bi().fromArray(_).normalize().conjugate().toArray(_);const y=u.times.length;for(let w=0;w<y;++w){const P=w*m+p;if(l==="quaternion")Bi.multiplyQuaternionsFlat(u.values,P,_,0,u.values,P);else{const B=m-2*p;for(let G=0;G<B;++G)u.values[P+G]-=_[G]}}}return i.blendMode=Ue,i}};class xa{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r: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,r=t[n],o=t[n-1];e:{t:{let s;n:{i:if(!(e<r)){for(let a=n+2;;){if(r===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=r,r=t[++n],e<r)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,r);if(n===l)break;if(r=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(r=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,o,e)}this._cachedIndex=n,this.intervalChanged_(n,o,r)}return this.interpolate_(n,o,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r;for(let s=0;s!==r;++s)t[s]=n[o+s];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}xa.prototype.beforeStart_=xa.prototype.copySampleValue_,xa.prototype.afterEnd_=xa.prototype.copySampleValue_;class uy extends xa{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ji,endingEnd:ji}}intervalChanged_(e,t,n){const r=this.parameterPositions;let o=e-2,s=e+1,a=r[o],l=r[s];if(a===void 0)switch(this.getSettings_().endingStart){case ls:o=e,a=2*t-n;break;case Pl:o=r.length-2,a=t+r[o]-r[o+1];break;default:o=e,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case ls:s=e,l=2*n-t;break;case Pl:s=1,l=n+r[1]-r[0];break;default:s=e-1,l=t}const u=.5*(n-t),h=this.valueSize;this._weightPrev=u/(t-a),this._weightNext=u/(l-n),this._offsetPrev=o*h,this._offsetNext=s*h}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,m=this._weightNext,g=(n-t)/(r-t),_=g*g,y=_*g,w=-p*y+2*p*_-p*g,P=(1+p)*y+(-1.5-2*p)*_+(-.5+p)*g+1,B=(-1-m)*y+(1.5+m)*_+.5*g,G=m*y-m*_;for(let U=0;U!==a;++U)o[U]=w*s[h+U]+P*s[u+U]+B*s[l+U]+G*s[d+U];return o}}class Ev extends xa{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,h=(n-t)/(r-t),d=1-h;for(let p=0;p!==a;++p)o[p]=s[u+p]*d+s[l+p]*h;return o}}class hy extends xa{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Yo{constructor(e,t,n,r){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=si.convertArray(t,this.TimeBufferType),this.values=si.convertArray(n,this.ValueBufferType),this.setInterpolation(r||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:si.convertArray(e.times,Array),values:si.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new hy(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Ev(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new uy(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case as:t=this.InterpolantFactoryMethodDiscrete;break;case Cl:t=this.InterpolantFactoryMethodLinear;break;case Do: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 as;case this.InterpolantFactoryMethodLinear:return Cl;case this.InterpolantFactoryMethodSmooth:return Do}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let o=0,s=r-1;for(;o!==r&&n[o]<e;)++o;for(;s!==-1&&n[s]>t;)--s;if(++s,o!==0||s!==r){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=si.arraySlice(n,o,s),this.values=si.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,r=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(r!==void 0&&si.isTypedArray(r))for(let a=0,l=r.length;a!==l;++a){const u=r[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=si.arraySlice(this.times),t=si.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Do,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(r)l=!0;else{const h=a*n,d=h-n,p=h+n;for(let m=0;m!==n;++m){const g=t[h+m];if(g!==t[d+m]||g!==t[p+m]){l=!0;break}}}if(l){if(a!==s){e[s]=e[a];const h=a*n,d=s*n;for(let p=0;p!==n;++p)t[d+p]=t[h+p]}++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=si.arraySlice(e,0,s),this.values=si.arraySlice(t,0,s*n)):(this.times=e,this.values=t),this}clone(){const e=si.arraySlice(this.times,0),t=si.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Yo.prototype.TimeBufferType=Float32Array,Yo.prototype.ValueBufferType=Float32Array,Yo.prototype.DefaultInterpolation=Cl;class uu extends Yo{}uu.prototype.ValueTypeName="bool",uu.prototype.ValueBufferType=Array,uu.prototype.DefaultInterpolation=as,uu.prototype.InterpolantFactoryMethodLinear=void 0,uu.prototype.InterpolantFactoryMethodSmooth=void 0;class Mv extends Yo{}Mv.prototype.ValueTypeName="color";class Ud extends Yo{}Ud.prototype.ValueTypeName="number";class cy extends xa{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(n-t)/(r-t);let u=e*a;for(let h=u+a;u!==h;u+=4)Bi.slerpFlat(o,0,s,u-a,s,u,l);return o}}class ec extends Yo{InterpolantFactoryMethodLinear(e){return new cy(this.times,this.values,this.getValueSize(),e)}}ec.prototype.ValueTypeName="quaternion",ec.prototype.DefaultInterpolation=Cl,ec.prototype.InterpolantFactoryMethodSmooth=void 0;class hu extends Yo{}hu.prototype.ValueTypeName="string",hu.prototype.ValueBufferType=Array,hu.prototype.DefaultInterpolation=as,hu.prototype.InterpolantFactoryMethodLinear=void 0,hu.prototype.InterpolantFactoryMethodSmooth=void 0;class kd extends Yo{}kd.prototype.ValueTypeName="vector";class Gd{constructor(e,t=-1,n,r=Ys){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Ar(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let s=0,a=n.length;s!==a;++s)t.push(cE(n[s]).scale(r));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,r={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(Yo.toJSON(n[o]));return r}static CreateFromMorphTargetSequence(e,t,n,r){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 h=si.getKeyframeOrder(l);l=si.sortedArray(l,1,h),u=si.sortedArray(u,1,h),r||l[0]!==0||(l.push(o),u.push(u[0])),s.push(new Ud(".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 r=e;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},o=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const u=e[a],h=u.name.match(o);if(h&&h.length>1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(u)}}const s=[];for(const a in r)s.push(this.CreateFromMorphTargetSequence(a,r[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(h,d,p,m,g){if(p.length!==0){const _=[],y=[];si.flattenJSON(p,_,y,m),_.length!==0&&g.push(new h(d,_,y))}},r=[],o=e.name||"default",s=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h<u.length;h++){const d=u[h].keys;if(d&&d.length!==0)if(d[0].morphTargets){const p={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let g=0;g<d[m].morphTargets.length;g++)p[d[m].morphTargets[g]]=-1;for(const g in p){const _=[],y=[];for(let w=0;w!==d[m].morphTargets.length;++w){const P=d[m];_.push(P.time),y.push(P.morphTarget===g?1:0)}r.push(new Ud(".morphTargetInfluence["+g+"]",_,y))}l=p.length*(s||1)}else{const p=".bones["+t[h].name+"]";n(kd,p+".position",d,"pos",r),n(ec,p+".quaternion",d,"rot",r),n(kd,p+".scale",d,"scl",r)}}return r.length===0?null:new this(o,l,r,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const r=this.tracks[t];e=Math.max(e,r.times[r.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 cE(i){if(i.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 Ud;case"vector":case"vector2":case"vector3":case"vector4":return kd;case"color":return Mv;case"quaternion":return ec;case"bool":case"boolean":return uu;case"string":return hu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(i.type);if(i.times===void 0){const t=[],n=[];si.flattenJSON(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const cu={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class Av{constructor(e,t,n){const r=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(h){a++,o===!1&&r.onStart!==void 0&&r.onStart(h,s,a),o=!0},this.itemEnd=function(h){s++,r.onProgress!==void 0&&r.onProgress(h,s,a),s===a&&(o=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(h){r.onError!==void 0&&r.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return u.push(h,d),this},this.removeHandler=function(h){const d=u.indexOf(h);return d!==-1&&u.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=u.length;d<p;d+=2){const m=u[d],g=u[d+1];if(m.global&&(m.lastIndex=0),m.test(h))return g}return null}}}const dy=new Av;class gr{constructor(e){this.manager=e!==void 0?e:dy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,o){n.load(e,r,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 $o={};class Jo extends gr{constructor(e){super(e)}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=cu.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(s),o.manager.itemEnd(e)},0),s;if($o[e]!==void 0)return void $o[e].push({onLoad:t,onProgress:n,onError:r});const a=e.match(/^data:(.*?)(;base64)?,(.*)$/);let l;if(a){const u=a[1],h=!!a[2];let d=a[3];d=decodeURIComponent(d),h&&(d=atob(d));try{let p;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);p=m==="blob"?new Blob([g.buffer],{type:u}):g.buffer;break;case"document":p=new DOMParser().parseFromString(d,u);break;case"json":p=JSON.parse(d);break;default:p=d}setTimeout(function(){t&&t(p),o.manager.itemEnd(e)},0)}catch(p){setTimeout(function(){r&&r(p),o.manager.itemError(e),o.manager.itemEnd(e)},0)}}else{$o[e]=[],$o[e].push({onLoad:t,onProgress:n,onError:r}),l=new XMLHttpRequest,l.open("GET",e,!0),l.addEventListener("load",function(u){const h=this.response,d=$o[e];if(delete $o[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),cu.add(e,h);for(let p=0,m=d.length;p<m;p++){const g=d[p];g.onLoad&&g.onLoad(h)}o.manager.itemEnd(e)}else{for(let p=0,m=d.length;p<m;p++){const g=d[p];g.onError&&g.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)}},!1),l.addEventListener("progress",function(u){const h=$o[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onProgress&&m.onProgress(u)}},!1),l.addEventListener("error",function(u){const h=$o[e];delete $o[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(u)}o.manager.itemError(e),o.manager.itemEnd(e)},!1),l.addEventListener("abort",function(u){const h=$o[e];delete $o[e];for(let d=0,p=h.length;d<p;d++){const m=h[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 dE extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new Jo(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){r?r(l):console.error(l),o.manager.itemError(e)}},n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=Gd.parse(e[n]);t.push(r)}return t}}class pE extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=[],a=new kt,l=new Jo(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(o.withCredentials);let u=0;function h(d){l.load(e[d],function(p){const m=o.parse(p,!0);s[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},u+=1,u===6&&(m.mipmapCount===1&&(a.minFilter=Gn),a.image=s,a.format=m.format,a.needsUpdate=!0,t&&t(a))},n,r)}if(Array.isArray(e))for(let d=0,p=e.length;d<p;++d)h(d);else l.load(e,function(d){const p=o.parse(d,!0);if(p.isCubemap){const m=p.mipmaps.length/p.mipmapCount;for(let g=0;g<m;g++){s[g]={mipmaps:[]};for(let _=0;_<p.mipmapCount;_++)s[g].mipmaps.push(p.mipmaps[g*p.mipmapCount+_]),s[g].format=p.format,s[g].width=p.width,s[g].height=p.height}a.image=s}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=Gn),a.format=p.format,a.needsUpdate=!0,t&&t(a)},n,r);return a}}class Hd extends gr{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=cu.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),cu.add(e,this),t&&t(this),o.manager.itemEnd(e)}function u(h){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1),r&&r(h),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 py extends gr{constructor(e){super(e)}load(e,t,n,r){const o=new to,s=new Hd(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function l(u){s.load(e[u],function(h){o.images[u]=h,a++,a===6&&(o.needsUpdate=!0,t&&t(o))},void 0,r)}for(let u=0;u<e.length;++u)l(u);return o}}class fy extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new xs,a=new Jo(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:xt,s.wrapT=u.wrapT!==void 0?u.wrapT:xt,s.magFilter=u.magFilter!==void 0?u.magFilter:Gn,s.minFilter=u.minFilter!==void 0?u.minFilter:Gn,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=zs),u.mipmapCount===1&&(s.minFilter=Gn),u.generateMipmaps!==void 0&&(s.generateMipmaps=u.generateMipmaps),s.needsUpdate=!0,t&&t(s,u))},n,r),s}}class Rv extends gr{constructor(e){super(e)}load(e,t,n,r){const o=new mi,s=new Hd(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?Oo:Tr,o.needsUpdate=!0,t!==void 0&&t(o)},n,r),o}}class my extends ci{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 al(t,e))}getPoint(e){const t=e*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=t){const o=n[r]-t,s=this.curves[r],a=s.getLength(),l=a===0?0:1-o/a;return s.getPointAt(l)}r++}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,r=this.curves.length;n<r;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 r=0,o=this.curves;r<o.length;r++){const s=o[r],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 h=l[u];n&&n.equals(h)||(t.push(h),n=h)}}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 r=e.curves[t];this.curves.push(r.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 r=this.curves[t];e.curves.push(r.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 r=e.curves[t];this.curves.push(new mv[r.type]().fromJSON(r))}return this}}class du extends my{constructor(e){super(),this.type="Path",this.currentPoint=new mt,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 al(this.currentPoint.clone(),new mt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const o=new ya(this.currentPoint.clone(),new mt(e,t),new mt(n,r));return this.curves.push(o),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,o,s){const a=new _a(this.currentPoint.clone(),new mt(e,t),new mt(n,r),new mt(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Kf(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,o,s){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,r,o,s),this}absarc(e,t,n,r,o,s){return this.absellipse(e,t,n,n,r,o,s),this}ellipse(e,t,n,r,o,s,a,l){const u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+u,t+h,n,r,o,s,a,l),this}absellipse(e,t,n,r,o,s,a,l){const u=new oi(e,t,n,r,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 h=u.getPoint(1);return this.currentPoint.copy(h),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 ul extends du{constructor(e){super(e),this.uuid=Ar(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;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 r=e.holes[t];this.holes.push(r.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 r=this.holes[t];e.holes.push(r.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 r=e.holes[t];this.holes.push(new du().fromJSON(r))}return this}}class Zo extends pn{constructor(e,t=1){super(),this.type="Light",this.color=new Dt(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}}Zo.prototype.isLight=!0;class Cv extends Zo{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(pn.DefaultUp),this.updateMatrix(),this.groundColor=new Dt(t)}copy(e){return Zo.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Cv.prototype.isHemisphereLight=!0;const gy=new Rt,vy=new S,_y=new S;class Pv{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new mt(512,512),this.map=null,this.mapPass=null,this.matrix=new Rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Za,this._frameExtents=new mt(1,1),this._viewportCount=1,this._viewports=[new Bn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;vy.setFromMatrixPosition(e.matrixWorld),t.position.copy(vy),_y.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(_y),t.updateMatrixWorld(),gy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gy),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 yy extends Pv{constructor(){super(new vi(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=2*wi*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;n===t.fov&&r===t.aspect&&o===t.far||(t.fov=n,t.aspect=r,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}yy.prototype.isSpotLightShadow=!0;class Iv extends Zo{constructor(e,t,n=0,r=Math.PI/3,o=0,s=1){super(e,t),this.type="SpotLight",this.position.copy(pn.DefaultUp),this.updateMatrix(),this.target=new pn,this.distance=n,this.angle=r,this.penumbra=o,this.decay=s,this.shadow=new yy}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}}Iv.prototype.isSpotLight=!0;const xy=new Rt,zd=new S,Ov=new S;class by extends Pv{constructor(){super(new vi(90,1,.5,500)),this._frameExtents=new mt(4,2),this._viewportCount=6,this._viewports=[new Bn(2,1,1,1),new Bn(0,1,1,1),new Bn(3,1,1,1),new Bn(1,1,1,1),new Bn(3,0,1,1),new Bn(1,0,1,1)],this._cubeDirections=[new S(1,0,0),new S(-1,0,0),new S(0,0,1),new S(0,0,-1),new S(0,1,0),new S(0,-1,0)],this._cubeUps=[new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,0,1),new S(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,o=e.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),zd.setFromMatrixPosition(e.matrixWorld),n.position.copy(zd),Ov.copy(n.position),Ov.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Ov),n.updateMatrixWorld(),r.makeTranslation(-zd.x,-zd.y,-zd.z),xy.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(xy)}}by.prototype.isPointLightShadow=!0;class Lv extends Zo{constructor(e,t,n=0,r=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new by}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}}Lv.prototype.isPointLight=!0;class tc extends aa{constructor(e=-1,t=1,n=1,r=-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=r,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,r,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=r,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,r=(this.top+this.bottom)/2;let o=n-e,s=n+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=h*this.view.offsetY,l=a-h*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}}tc.prototype.isOrthographicCamera=!0;class wy extends Pv{constructor(){super(new tc(-5,5,5,-5,.5,500))}}wy.prototype.isDirectionalLightShadow=!0;class sm extends Zo{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(pn.DefaultUp),this.updateMatrix(),this.target=new pn,this.shadow=new wy}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}sm.prototype.isDirectionalLight=!0;class am extends Zo{constructor(e,t){super(e,t),this.type="AmbientLight"}}am.prototype.isAmbientLight=!0;class Nv extends Zo{constructor(e,t,n=10,r=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=r}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}}Nv.prototype.isRectAreaLight=!0;class Dv{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new S)}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,r=e.y,o=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*r),t.addScaledVector(s[2],.488603*o),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*r*1.092548),t.addScaledVector(s[5],r*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-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,o=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*r),t.addScaledVector(s[2],1.023328*o),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*r),t.addScaledVector(s[5],.858086*r*o),t.addScaledVector(s[6],.743125*o*o-.247708),t.addScaledVector(s[7],.858086*n*o),t.addScaledVector(s[8],.429043*(n*n-r*r)),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 r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,o=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*o,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*o,t[6]=.315392*(3*o*o-1),t[7]=1.092548*n*o,t[8]=.546274*(n*n-r*r)}}Dv.prototype.isSphericalHarmonics3=!0;class jd extends Zo{constructor(e=new Dv,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}}jd.prototype.isLightProbe=!0;class Sy extends gr{constructor(e){super(e),this.textures={}}load(e,t,n,r){const o=this,s=new Jo(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){r?r(l):console.error(l),o.manager.itemError(e)}},n,r)}parse(e){const t=this.textures;function n(o){return t[o]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",o),t[o]}const r=new hE[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Dt().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const s=e.uniforms[o];switch(r.uniforms[o]={},s.type){case"t":r.uniforms[o].value=n(s.value);break;case"c":r.uniforms[o].value=new Dt().setHex(s.value);break;case"v2":r.uniforms[o].value=new mt().fromArray(s.value);break;case"v3":r.uniforms[o].value=new S().fromArray(s.value);break;case"v4":r.uniforms[o].value=new Bn().fromArray(s.value);break;case"m3":r.uniforms[o].value=new Xn().fromArray(s.value);break;case"m4":r.uniforms[o].value=new Rt().fromArray(s.value);break;default:r.uniforms[o].value=s.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const o in e.extensions)r.extensions[o]=e.extensions[o];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),r.normalScale=new mt().fromArray(o)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new mt().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=n(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class lm{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,r=e.length;n<r;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 Fv extends Xt{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}}Fv.prototype.isInstancedBufferGeometry=!0;class Bv extends gn{constructor(e,t,n,r=1){typeof n=="number"&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=r}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}}Bv.prototype.isInstancedBufferAttribute=!0;class Ty extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new Jo(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){r?r(l):console.error(l),o.manager.itemError(e)}},n,r)}parse(e){const t={},n={};function r(d,p){if(t[p]!==void 0)return t[p];const m=d.interleavedBuffers[p],g=function(w,P){if(n[P]!==void 0)return n[P];const B=w.arrayBuffers[P],G=new Uint32Array(B).buffer;return n[P]=G,G}(d,m.buffer),_=ia(m.type,g),y=new pa(_,m.stride);return y.uuid=m.uuid,t[p]=y,y}const o=e.isInstancedBufferGeometry?new Fv:new Xt,s=e.data.index;if(s!==void 0){const d=ia(s.type,s.array);o.setIndex(new gn(d,1))}const a=e.data.attributes;for(const d in a){const p=a[d];let m;if(p.isInterleavedBufferAttribute){const g=r(e.data,p.data);m=new Xo(g,p.itemSize,p.offset,p.normalized)}else{const g=ia(p.type,p.array);m=new(p.isInstancedBufferAttribute?Bv:gn)(g,p.itemSize,p.normalized)}p.name!==void 0&&(m.name=p.name),p.usage!==void 0&&m.setUsage(p.usage),p.updateRange!==void 0&&(m.updateRange.offset=p.updateRange.offset,m.updateRange.count=p.updateRange.count),o.setAttribute(d,m)}const l=e.data.morphAttributes;if(l)for(const d in l){const p=l[d],m=[];for(let g=0,_=p.length;g<_;g++){const y=p[g];let w;if(y.isInterleavedBufferAttribute){const P=r(e.data,y.data);w=new Xo(P,y.itemSize,y.offset,y.normalized)}else{const P=ia(y.type,y.array);w=new gn(P,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,p=u.length;d!==p;++d){const m=u[d];o.addGroup(m.start,m.count,m.materialIndex)}const h=e.data.boundingSphere;if(h!==void 0){const d=new S;h.center!==void 0&&d.fromArray(h.center),o.boundingSphere=new Mi(d,h.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class fE extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=this.path===""?lm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const a=new Jo(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 r!==void 0&&r(d),void console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message)}const h=u.metadata;h!==void 0&&h.type!==void 0&&h.type.toLowerCase()!=="geometry"?o.parse(u,t):console.error("THREE.ObjectLoader: Can't load "+e)},n,r)}async loadAsync(e,t){const n=this.path===""?lm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const r=new Jo(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const o=await r.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),r=this.parseShapes(e.shapes),o=this.parseGeometries(e.geometries,r),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),h=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,h),t!==void 0){let d=!1;for(const p in s)if(s[p]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),r=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,r,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,r=e.length;n<r;n++){const o=new ul().fromJSON(e[n]);t[o.uuid]=o}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse(function(o){o.isBone&&(r[o.uuid]=o)}),e!==void 0)for(let o=0,s=e.length;o<s;o++){const a=new Gh().fromJSON(e[o],r);n[a.uuid]=a}return n}parseGeometries(e,t){const n={};if(e!==void 0){const r=new Ty;for(let o=0,s=e.length;o<s;o++){let a;const l=e[o];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(l);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:l.type in ly?a=ly[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={},r={};if(e!==void 0){const o=new Sy;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 h=0;h<l.materials.length;h++){const d=l.materials[h];n[d.uuid]===void 0&&(n[d.uuid]=o.parse(d)),u.push(n[d.uuid])}r[l.uuid]=u}else n[l.uuid]===void 0&&(n[l.uuid]=o.parse(l)),r[l.uuid]=n[l.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const r=e[n],o=Gd.parse(r);t[o.uuid]=o}return t}parseImages(e,t){const n=this,r={};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:ia(a.type,a.data),width:a.width,height:a.height}:null}if(e!==void 0&&e.length>0){const a=new Av(t);o=new Hd(a),o.setCrossOrigin(this.crossOrigin);for(let l=0,u=e.length;l<u;l++){const h=e[l],d=h.url;if(Array.isArray(d)){r[h.uuid]=[];for(let p=0,m=d.length;p<m;p++){const g=s(d[p]);g!==null&&(g instanceof HTMLImageElement?r[h.uuid].push(g):r[h.uuid].push(new xs(g.data,g.width,g.height)))}}else{const p=s(h.url);p!==null&&(r[h.uuid]=p)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function o(s){if(typeof s=="string"){const a=s,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await r.loadAsync(l)}return s.data?{data:ia(s.type,s.data),width:s.width,height:s.height}:null}if(e!==void 0&&e.length>0){r=new Hd(this.manager),r.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 h=0,d=u.length;h<d;h++){const p=u[h],m=await o(p);m!==null&&(m instanceof HTMLImageElement?n[l.uuid].push(m):n[l.uuid].push(new xs(m.data,m.width,m.height)))}}else{const h=await o(l.url);h!==null&&(n[l.uuid]=h)}}}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 r={};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 to(u),u.length===6&&(l.needsUpdate=!0)):(l=u&&u.data?new xs(u.data,u.width,u.height):new mi(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,mE)),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],Ey),l.wrapT=n(a.wrap[1],Ey)),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,My)),a.magFilter!==void 0&&(l.magFilter=n(a.magFilter,My)),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),r[a.uuid]=l}return r}parseObject(e,t,n,r,o){let s,a,l;function u(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function h(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let g=0,_=p.length;g<_;g++){const y=p[g];n[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),m.push(n[y])}return m}return n[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),n[p]}}function d(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}switch(e.type){case"Scene":s=new el,e.background!==void 0&&(Number.isInteger(e.background)?s.background=new Dt(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 Kl(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(s.fog=new ki(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":s=new vi(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 tc(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 am(e.color,e.intensity);break;case"DirectionalLight":s=new sm(e.color,e.intensity);break;case"PointLight":s=new Lv(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new Nv(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new Iv(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new Cv(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=new jd().fromJSON(e);break;case"SkinnedMesh":a=u(e.geometry),l=h(e.material),s=new il(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=h(e.material),s=new En(a,l);break;case"InstancedMesh":a=u(e.geometry),l=h(e.material);const p=e.count,m=e.instanceMatrix,g=e.instanceColor;s=new Id(a,l,p),s.instanceMatrix=new gn(new Float32Array(m.array),16),g!==void 0&&(s.instanceColor=new gn(new Float32Array(g.array),g.itemSize));break;case"LOD":s=new Wf;break;case"Line":s=new c(u(e.geometry),h(e.material));break;case"LineLoop":s=new k(u(e.geometry),h(e.material));break;case"LineSegments":s=new A(u(e.geometry),h(e.material));break;case"PointCloud":case"Points":s=new nt(u(e.geometry),h(e.material));break;case"Sprite":s=new iu(h(e.material));break;case"Group":s=new da;break;case"Bone":s=new kh;break;default:s=new pn}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 p=e.children;for(let m=0;m<p.length;m++)s.add(this.parseObject(p[m],t,n,r,o))}if(e.animations!==void 0){const p=e.animations;for(let m=0;m<p.length;m++){const g=p[m];s.animations.push(o[g])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(s.autoUpdate=e.autoUpdate);const p=e.levels;for(let m=0;m<p.length;m++){const g=p[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 r=t[n.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(r,n.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const mE={UVMapping:Z,CubeReflectionMapping:se,CubeRefractionMapping:ge,EquirectangularReflectionMapping:be,EquirectangularRefractionMapping:we,CubeUVReflectionMapping:Fe,CubeUVRefractionMapping:Ye},Ey={RepeatWrapping:ht,ClampToEdgeWrapping:xt,MirroredRepeatWrapping:Ot},My={NearestFilter:Gt,NearestMipmapNearestFilter:fi,NearestMipmapLinearFilter:Po,LinearFilter:Gn,LinearMipmapNearestFilter:os,LinearMipmapLinearFilter:zs};class Ay extends gr{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,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=cu.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){cu.add(e,l),t&&t(l),o.manager.itemEnd(e)}).catch(function(l){r&&r(l),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}Ay.prototype.isImageBitmapLoader=!0;class Ry{constructor(){this.type="ShapePath",this.color=new Dt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new du,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,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,o,s){return this.currentPath.bezierCurveTo(e,t,n,r,o,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(P){const B=[];for(let G=0,U=P.length;G<U;G++){const X=P[G],H=new ul;H.curves=X.curves,B.push(H)}return B}function r(P,B){const G=B.length;let U=!1;for(let X=G-1,H=0;H<G;X=H++){let q=B[X],me=B[H],ue=me.x-q.x,oe=me.y-q.y;if(Math.abs(oe)>Number.EPSILON){if(oe<0&&(q=B[H],ue=-ue,me=B[X],oe=-oe),P.y<q.y||P.y>me.y)continue;if(P.y===q.y){if(P.x===q.x)return!0}else{const ce=oe*(P.x-q.x)-ue*(P.y-q.y);if(ce===0)return!0;if(ce<0)continue;U=!U}}else{if(P.y!==q.y)continue;if(me.x<=P.x&&P.x<=q.x||q.x<=P.x&&P.x<=me.x)return!0}}return U}const o=Ts.isClockWise,s=this.subPaths;if(s.length===0)return[];if(t===!0)return n(s);let a,l,u;const h=[];if(s.length===1)return l=s[0],u=new ul,u.curves=l.curves,h.push(u),h;let d=!o(s[0].getPoints());d=e?!d:d;const p=[],m=[];let g,_,y=[],w=0;m[w]=void 0,y[w]=[];for(let P=0,B=s.length;P<B;P++)l=s[P],g=l.getPoints(),a=o(g),a=e?!a:a,a?(!d&&m[w]&&w++,m[w]={s:new ul,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 P=!1;const B=[];for(let G=0,U=m.length;G<U;G++)p[G]=[];for(let G=0,U=m.length;G<U;G++){const X=y[G];for(let H=0;H<X.length;H++){const q=X[H];let me=!0;for(let ue=0;ue<m.length;ue++)r(q.p,m[ue].p)&&(G!==ue&&B.push({froms:G,tos:ue,hole:H}),me?(me=!1,p[ue].push(q)):P=!0);me&&p[G].push(q)}}B.length>0&&(P||(y=p))}for(let P=0,B=m.length;P<B;P++){u=m[P].s,h.push(u),_=y[P];for(let G=0,U=_.length;G<U;G++)u.holes.push(_[G].h)}return h}}class Uv{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=function(o,s,a){const l=Array.from(o),u=s/a.resolution,h=(a.boundingBox.yMax-a.boundingBox.yMin+a.underlineThickness)*u,d=[];let p=0,m=0;for(let g=0;g<l.length;g++){const _=l[g];if(_===`
4723
+ `)p=0,m-=h;else{const y=gE(_,u,p,m,a);p+=y.offsetX,d.push(y.path)}}return d}(e,t,this.data);for(let o=0,s=r.length;o<s;o++)Array.prototype.push.apply(n,r[o].toShapes());return n}}function gE(i,e,t,n,r){const o=r.glyphs[i]||r.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");const s=new Ry;let a,l,u,h,d,p,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,h=_[y++]*e+n,d=_[y++]*e+t,p=_[y++]*e+n,s.quadraticCurveTo(d,p,u,h);break;case"b":u=_[y++]*e+t,h=_[y++]*e+n,d=_[y++]*e+t,p=_[y++]*e+n,m=_[y++]*e+t,g=_[y++]*e+n,s.bezierCurveTo(d,p,m,g,u,h)}}return{offsetX:o.ha*e,path:s}}Uv.prototype.isFont=!0;class vE extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new Jo(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,r)}parse(e){return new Uv(e)}}let um;const kv={getContext:function(){return um===void 0&&(um=new(window.AudioContext||window.webkitAudioContext)),um},setContext:function(i){um=i}};class Cy extends gr{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new Jo(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);kv.getContext().decodeAudioData(l,function(u){t(u)})}catch(l){r?r(l):console.error(l),o.manager.itemError(e)}},n,r)}}class Py extends jd{constructor(e,t,n=1){super(void 0,n);const r=new Dt().set(e),o=new Dt().set(t),s=new S(r.r,r.g,r.b),a=new S(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 Iy extends jd{constructor(e,t=1){super(void 0,t);const n=new Dt().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Iy.prototype.isAmbientLightProbe=!0;const Oy=new Rt,Ly=new Rt;class _E{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new vi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new vi,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(),r=t.eyeSep/2,o=r*t.near/t.focus,s=t.near*Math.tan(Wn*t.fov*.5)/t.zoom;let a,l;Ly.elements[12]=-r,Oy.elements[12]=r,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(Ly),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Oy)}}class Ny{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Dy(),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=Dy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Dy(){return(typeof performance=="undefined"?Date:performance).now()}const pu=new S,Fy=new Bi,yE=new S,fu=new S;class xE extends pn{constructor(){super(),this.type="AudioListener",this.context=kv.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ny}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(pu,Fy,yE),fu.set(0,0,-1).applyQuaternion(Fy),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(pu.x,r),t.positionY.linearRampToValueAtTime(pu.y,r),t.positionZ.linearRampToValueAtTime(pu.z,r),t.forwardX.linearRampToValueAtTime(fu.x,r),t.forwardY.linearRampToValueAtTime(fu.y,r),t.forwardZ.linearRampToValueAtTime(fu.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(pu.x,pu.y,pu.z),t.setOrientation(fu.x,fu.y,fu.z,n.x,n.y,n.z)}}class Gv extends pn{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 mu=new S,By=new Bi,bE=new S,gu=new S;class wE extends Gv{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(mu,By,bE),gu.set(0,0,1).applyQuaternion(By);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(mu.x,n),t.positionY.linearRampToValueAtTime(mu.y,n),t.positionZ.linearRampToValueAtTime(mu.z,n),t.orientationX.linearRampToValueAtTime(gu.x,n),t.orientationY.linearRampToValueAtTime(gu.y,n),t.orientationZ.linearRampToValueAtTime(gu.z,n)}else t.setPosition(mu.x,mu.y,mu.z),t.setOrientation(gu.x,gu.y,gu.z)}}class Uy{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 ky{constructor(e,t,n){let r,o,s;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,o=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,o=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,o=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,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,r=this.valueSize,o=e*r+r;let s=this.cumulativeWeight;if(s===0){for(let a=0;a!==r;++a)n[o+a]=n[a];s=t}else{s+=t;const a=t/s;this._mixBufferRegion(n,o,0,a,r)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=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,r,l,1-o,t)}s>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(n[l]!==n[l+t]){a.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let o=n,s=r;o!==s;++o)t[o]=t[r+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,r,o){if(r>=.5)for(let s=0;s!==o;++s)e[t+s]=e[n+s]}_slerp(e,t,n,r){Bi.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,o){const s=this._workIndex*o;Bi.multiplyQuaternionsFlat(e,s,e,t,e,n),Bi.slerpFlat(e,t,e,t,e,s,r)}_lerp(e,t,n,r,o){const s=1-r;for(let a=0;a!==o;++a){const l=t+a;e[l]=e[l]*s+e[n+a]*r}}_lerpAdditive(e,t,n,r,o){for(let s=0;s!==o;++s){const a=t+s;e[a]=e[a]+e[n+s]*r}}}const SE=new RegExp("[\\[\\]\\.:\\/]","g"),TE="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",EE=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),ME=/(WCOD+)?/.source.replace("WCOD",TE),AE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),RE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),CE=new RegExp("^"+EE+ME+AE+RE+"$"),PE=["material","materials","bones"];class On{constructor(e,t,n){this.path=t,this.parsedPath=n||On.parseTrackName(t),this.node=On.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 On.Composite(e,t,n):new On(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(SE,"")}static parseTrackName(e){const t=CE.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]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const o=n.nodeName.substring(r+1);PE.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,r),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},r=n(e.children);if(r)return r}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 r=0,o=n.length;r!==o;++r)e[t++]=n[r]}_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 r=0,o=n.length;r!==o;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=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,r=t.propertyName;let o=t.propertyIndex;if(e||(e=On.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 h=0;h<e.length;h++)if(e[h].name===u){u=h;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[r];if(s===void 0){const u=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" 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(r==="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=r;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}}On.Composite=class{constructor(i,e,t){const n=t||On.parseTrackName(e);this._targetGroup=i,this._bindings=i.subscribe_(e,n)}getValue(i,e){this.bind();const t=this._targetGroup.nCachedObjects_,n=this._bindings[t];n!==void 0&&n.getValue(i,e)}setValue(i,e){const t=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=t.length;n!==r;++n)t[n].setValue(i,e)}bind(){const i=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=i.length;e!==t;++e)i[e].bind()}unbind(){const i=this._bindings;for(let e=this._targetGroup.nCachedObjects_,t=i.length;e!==t;++e)i[e].unbind()}},On.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},On.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},On.prototype.GetterByBindingType=[On.prototype._getValue_direct,On.prototype._getValue_array,On.prototype._getValue_arrayElement,On.prototype._getValue_toArray],On.prototype.SetterByBindingTypeAndVersioning=[[On.prototype._setValue_direct,On.prototype._setValue_direct_setNeedsUpdate,On.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[On.prototype._setValue_array,On.prototype._setValue_array_setNeedsUpdate,On.prototype._setValue_array_setMatrixWorldNeedsUpdate],[On.prototype._setValue_arrayElement,On.prototype._setValue_arrayElement_setNeedsUpdate,On.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[On.prototype._setValue_fromArray,On.prototype._setValue_fromArray_setNeedsUpdate,On.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Gy{constructor(){this.uuid=Ar(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,r=arguments.length;n!==r;++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,r=this._parsedPaths,o=this._bindings,s=o.length;let a,l=e.length,u=this.nCachedObjects_;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],m=p.uuid;let g=t[m];if(g===void 0){g=l++,t[m]=g,e.push(p);for(let _=0,y=s;_!==y;++_)o[_].push(new On(p,n[_],r[_]))}else if(g<u){a=e[g];const _=--u,y=e[_];t[y.uuid]=g,e[g]=y,t[m]=_,e[_]=p;for(let w=0,P=s;w!==P;++w){const B=o[w],G=B[_];let U=B[g];B[g]=G,U===void 0&&(U=new On(p,n[w],r[w])),B[_]=U}}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,r=n.length;let o=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){const l=arguments[s],u=l.uuid,h=t[u];if(h!==void 0&&h>=o){const d=o++,p=e[d];t[p.uuid]=h,e[h]=p,t[u]=d,e[d]=l;for(let m=0,g=r;m!==g;++m){const _=n[m],y=_[d],w=_[h];_[h]=y,_[d]=w}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let o=this.nCachedObjects_,s=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a].uuid,h=t[u];if(h!==void 0)if(delete t[u],h<o){const d=--o,p=e[d],m=--s,g=e[m];t[p.uuid]=h,e[h]=p,t[g.uuid]=d,e[d]=g,e.pop();for(let _=0,y=r;_!==y;++_){const w=n[_],P=w[d],B=w[m];w[h]=P,w[d]=B,w.pop()}}else{const d=--s,p=e[d];d>0&&(t[p.uuid]=h),e[h]=p,e.pop();for(let m=0,g=r;m!==g;++m){const _=n[m];_[h]=_[d],_.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const o=this._bindings;if(r!==void 0)return o[r];const s=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,h=this.nCachedObjects_,d=new Array(u);r=o.length,n[e]=r,s.push(e),a.push(t),o.push(d);for(let p=h,m=l.length;p!==m;++p){const g=l[p];d[p]=new On(g,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const r=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(),r[n]=r[a],r.pop()}}}Gy.prototype.isAnimationObjectGroup=!0;class IE{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const o=t.tracks,s=o.length,a=new Array(s),l={endingStart:ji,endingEnd:ji};for(let u=0;u!==s;++u){const h=o[u].createInterpolant(null);a[u]=h,h.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=Vc,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 r=this._clip.duration,o=e._clip.duration,s=o/r,a=r/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 r=this._mixer,o=r.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._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,r){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 Ue:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(s),u[h].accumulateAdditive(a);break;case Ys:default:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(s),u[h].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===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 r=this.time+e,o=this._loopCount;const s=n===No;if(e===0)return o===-1?r:s&&(1&o)==1?t-r:r;if(n===Qu){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,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)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,o+=Math.abs(a);const l=this.repetitions-o;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,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=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(s&&(1&o)==1)return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=ls,r.endingEnd=ls):(r.endingStart=e?this.zeroSlopeAtStart?ls:ji:Pl,r.endingEnd=t?this.zeroSlopeAtEnd?ls:ji:Pl)}_scheduleFading(e,t,n){const r=this._mixer,o=r.time;let s=this._weightInterpolant;s===null&&(s=r._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 Hy extends Fo{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,r=e._clip.tracks,o=r.length,s=e._propertyBindings,a=e._interpolants,l=n.uuid,u=this._bindingsByRootAndName;let h=u[l];h===void 0&&(h={},u[l]=h);for(let d=0;d!==o;++d){const p=r[d],m=p.name;let g=h[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 ky(On.create(n,m,_),p.ValueTypeName,p.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,r=e._clip.uuid,o=this._actionsByClip[r];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,r,n)}const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++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,r=t.length;n!==r;++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 r=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=r.length,r.push(e),s.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=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],h=e._byClipCacheIndex;u._byClipCacheIndex=h,l[h]=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,r=t.length;n!==r;++n){const o=t[n];--o.referenceCount==0&&this._removeInactiveBinding(o)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,o=t[r];e._cacheIndex=r,t[r]=e,o._cacheIndex=n,t[n]=o}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,o=t[r];e._cacheIndex=r,t[r]=e,o._cacheIndex=n,t[n]=o}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,o=this._bindings;let s=r[t];s===void 0&&(s={},r[t]=s),s[n]=e,e._cacheIndex=o.length,o.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,o=n.path,s=this._bindingsByRootAndName,a=s[r],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[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,o=t[r];e._cacheIndex=r,t[r]=e,o._cacheIndex=n,t[n]=o}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,o=t[r];e._cacheIndex=r,t[r]=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 Ev(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,r=--this._nActiveControlInterpolants,o=t[r];e.__cacheIndex=r,t[r]=e,o.__cacheIndex=n,t[n]=o}clipAction(e,t,n){const r=t||this._root,o=r.uuid;let s=typeof e=="string"?Gd.findByName(r,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:Ys),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 h=new IE(this,s,t,n);return this._bindAction(h,u),this._addInactiveAction(h,a,o),h}existingAction(e,t){const n=t||this._root,r=n.uuid,o=typeof e=="string"?Gd.findByName(n,e):e,s=o?o.uuid:e,a=this._actionsByClip[s];return a!==void 0&&a.actionByRoot[r]||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,r=this.time+=e,o=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==n;++u)t[u]._update(r,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,r=this._actionsByClip,o=r[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 h=u._cacheIndex,d=t[t.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,d._cacheIndex=h,t[h]=d,t.pop(),this._removeInactiveBindingsForAction(u)}delete r[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 r=this._bindingsByRootAndName[t];if(r!==void 0)for(const o in r){const s=r[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}Hy.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class hm{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new hm(this.value.clone===void 0?this.value:this.value.clone())}}class zy extends pa{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}}zy.prototype.isInstancedInterleavedBuffer=!0;class jy{constructor(e,t,n,r,o){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,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}}jy.prototype.isGLBufferAttribute=!0;class OE{constructor(e,t,n=0,r=1/0){this.ray=new Ho(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new Kc,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 Hv(e,this,n,t),n.sort(Vy),n}intersectObjects(e,t=!1,n=[]){for(let r=0,o=e.length;r<o;r++)Hv(e[r],this,n,t);return n.sort(Vy),n}}function Vy(i,e){return i.distance-e.distance}function Hv(i,e,t,n){if(i.layers.test(e.layers)&&i.raycast(e,t),n===!0){const r=i.children;for(let o=0,s=r.length;o<s;o++)Hv(r[o],e,t,!0)}}class LE{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(Wi(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class NE{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 Wy=new mt;class nc{constructor(e=new mt(1/0,1/0),t=new mt(-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=Wy.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 Wy.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)}}nc.prototype.isBox2=!0;const Xy=new S,cm=new S;class qy{constructor(e=new S,t=new S){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){Xy.subVectors(e,this.start),cm.subVectors(this.end,this.start);const n=cm.dot(cm);let r=cm.dot(Xy)/n;return t&&(r=Wi(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).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 Yy extends pn{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}}Yy.prototype.isImmediateRenderObject=!0;const $y=new S;class DE extends pn{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Xt,r=[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,h=a/l*Math.PI*2;r.push(Math.cos(u),Math.sin(u),1,Math.cos(h),Math.sin(h),1)}n.setAttribute("position",new Tt(r,3));const o=new Gi({fog:!1,toneMapped:!1});this.cone=new A(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),$y.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt($y),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const hl=new S,dm=new Rt,zv=new Rt;class Jy extends A{constructor(e){const t=function l(u){const h=[];u&&u.isBone&&h.push(u);for(let d=0;d<u.children.length;d++)h.push.apply(h,l(u.children[d]));return h}(e),n=new Xt,r=[],o=[],s=new Dt(0,0,1),a=new Dt(0,1,0);for(let l=0;l<t.length;l++){const u=t[l];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),o.push(s.r,s.g,s.b),o.push(a.r,a.g,a.b))}n.setAttribute("position",new Tt(r,3)),n.setAttribute("color",new Tt(o,3)),super(n,new Gi({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,r=n.getAttribute("position");zv.copy(this.root.matrixWorld).invert();for(let o=0,s=0;o<t.length;o++){const a=t[o];a.parent&&a.parent.isBone&&(dm.multiplyMatrices(zv,a.matrixWorld),hl.setFromMatrixPosition(dm),r.setXYZ(s,hl.x,hl.y,hl.z),dm.multiplyMatrices(zv,a.parent.matrixWorld),hl.setFromMatrixPosition(dm),r.setXYZ(s+1,hl.x,hl.y,hl.z),s+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}class FE extends En{constructor(e,t,n){super(new lu(t,4,2),new gi({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 BE=new S,Zy=new Dt,Ky=new Dt;class UE extends pn{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const r=new su(t);r.rotateY(.5*Math.PI),this.material=new gi({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const o=r.getAttribute("position"),s=new Float32Array(3*o.count);r.setAttribute("color",new gn(s,3)),this.add(new En(r,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),Ky.copy(this.light.groundColor);for(let n=0,r=t.count;n<r;n++){const o=n<r/2?Zy:Ky;t.setXYZ(n,o.r,o.g,o.b)}t.needsUpdate=!0}e.lookAt(BE.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Qy extends A{constructor(e=10,t=10,n=4473924,r=8947848){n=new Dt(n),r=new Dt(r);const o=t/2,s=e/t,a=e/2,l=[],u=[];for(let d=0,p=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:r;g.toArray(u,p),p+=3,g.toArray(u,p),p+=3,g.toArray(u,p),p+=3,g.toArray(u,p),p+=3}const h=new Xt;h.setAttribute("position",new Tt(l,3)),h.setAttribute("color",new Tt(u,3)),super(h,new Gi({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class kE extends A{constructor(e=10,t=16,n=8,r=64,o=4473924,s=8947848){o=new Dt(o),s=new Dt(s);const a=[],l=[];for(let h=0;h<=t;h++){const d=h/t*(2*Math.PI),p=Math.sin(d)*e,m=Math.cos(d)*e;a.push(0,0,0),a.push(p,0,m);const g=1&h?o:s;l.push(g.r,g.g,g.b),l.push(g.r,g.g,g.b)}for(let h=0;h<=n;h++){const d=1&h?o:s,p=e-e/n*h;for(let m=0;m<r;m++){let g=m/r*(2*Math.PI),_=Math.sin(g)*p,y=Math.cos(g)*p;a.push(_,0,y),l.push(d.r,d.g,d.b),g=(m+1)/r*(2*Math.PI),_=Math.sin(g)*p,y=Math.cos(g)*p,a.push(_,0,y),l.push(d.r,d.g,d.b)}}const u=new Xt;u.setAttribute("position",new Tt(a,3)),u.setAttribute("color",new Tt(l,3)),super(u,new Gi({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const ex=new S,pm=new S,tx=new S;class GE extends pn{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 r=new Xt;r.setAttribute("position",new Tt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const o=new Gi({fog:!1,toneMapped:!1});this.lightPlane=new c(r,o),this.add(this.lightPlane),r=new Xt,r.setAttribute("position",new Tt([0,0,0,0,0,1],3)),this.targetLine=new c(r,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(){ex.setFromMatrixPosition(this.light.matrixWorld),pm.setFromMatrixPosition(this.light.target.matrixWorld),tx.subVectors(pm,ex),this.lightPlane.lookAt(pm),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(pm),this.targetLine.scale.z=tx.length()}}const fm=new S,Si=new aa;class HE extends A{constructor(e){const t=new Xt,n=new Gi({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],o=[],s={},a=new Dt(16755200),l=new Dt(16711680),u=new Dt(43775),h=new Dt(16777215),d=new Dt(3355443);function p(g,_,y){m(g,y),m(_,y)}function m(g,_){r.push(0,0,0),o.push(_.r,_.g,_.b),s[g]===void 0&&(s[g]=[]),s[g].push(r.length/3-1)}p("n1","n2",a),p("n2","n4",a),p("n4","n3",a),p("n3","n1",a),p("f1","f2",a),p("f2","f4",a),p("f4","f3",a),p("f3","f1",a),p("n1","f1",a),p("n2","f2",a),p("n3","f3",a),p("n4","f4",a),p("p","n1",l),p("p","n2",l),p("p","n3",l),p("p","n4",l),p("u1","u2",u),p("u2","u3",u),p("u3","u1",u),p("c","t",h),p("p","c",d),p("cn1","cn2",d),p("cn3","cn4",d),p("cf1","cf2",d),p("cf3","cf4",d),t.setAttribute("position",new Tt(r,3)),t.setAttribute("color",new Tt(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;Si.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Pi("c",t,e,Si,0,0,-1),Pi("t",t,e,Si,0,0,1),Pi("n1",t,e,Si,-1,-1,-1),Pi("n2",t,e,Si,1,-1,-1),Pi("n3",t,e,Si,-1,1,-1),Pi("n4",t,e,Si,1,1,-1),Pi("f1",t,e,Si,-1,-1,1),Pi("f2",t,e,Si,1,-1,1),Pi("f3",t,e,Si,-1,1,1),Pi("f4",t,e,Si,1,1,1),Pi("u1",t,e,Si,.7,1.1,-1),Pi("u2",t,e,Si,-.7,1.1,-1),Pi("u3",t,e,Si,0,2,-1),Pi("cf1",t,e,Si,-1,0,1),Pi("cf2",t,e,Si,1,0,1),Pi("cf3",t,e,Si,0,-1,1),Pi("cf4",t,e,Si,0,1,1),Pi("cn1",t,e,Si,-1,0,-1),Pi("cn2",t,e,Si,1,0,-1),Pi("cn3",t,e,Si,0,-1,-1),Pi("cn4",t,e,Si,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Pi(i,e,t,n,r,o,s){fm.set(r,o,s).unproject(n);const a=e[i];if(a!==void 0){const l=t.getAttribute("position");for(let u=0,h=a.length;u<h;u++)l.setXYZ(a[u],fm.x,fm.y,fm.z)}}const mm=new Zn;class nx extends A{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]),r=new Float32Array(24),o=new Xt;o.setIndex(new gn(n,1)),o.setAttribute("position",new gn(r,3)),super(o,new Gi({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&&mm.setFromObject(this.object),mm.isEmpty())return;const t=mm.min,n=mm.max,r=this.geometry.attributes.position,o=r.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,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return A.prototype.copy.call(this,e),this.object=e.object,this}}class zE extends A{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]),r=new Xt;r.setIndex(new gn(n,1)),r.setAttribute("position",new Tt([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(r,new Gi({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 jE extends c{constructor(e,t=1,n=16776960){const r=n,o=new Xt;o.setAttribute("position",new Tt([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 Gi({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new Xt;s.setAttribute("position",new Tt([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new En(s,new gi({color:r,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?V:z,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const ix=new S;let gm,jv;class VE extends pn{constructor(e=new S(0,0,1),t=new S(0,0,0),n=1,r=16776960,o=.2*n,s=.2*o){super(),this.type="ArrowHelper",gm===void 0&&(gm=new Xt,gm.setAttribute("position",new Tt([0,0,0,0,1,0],3)),jv=new Vt(0,.5,1,5,1),jv.translate(0,-.5,0)),this.position.copy(t),this.line=new c(gm,new Gi({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new En(jv,new gi({color:r,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{ix.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(ix,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 rx extends A{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 Xt;n.setAttribute("position",new Tt(t,3)),n.setAttribute("color",new Tt([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(n,new Gi({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new Dt,o=this.geometry.attributes.color.array;return r.set(e),r.toArray(o,0),r.toArray(o,3),r.set(t),r.toArray(o,6),r.toArray(o,9),r.set(n),r.toArray(o,12),r.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const ox=new Float32Array(1),WE=new Int32Array(ox.buffer);class XE{static toHalfFloat(e){ox[0]=e;const t=WE[0];let n=t>>16&32768,r=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?(r|=2048,n|=(r>>114-o)+(r>>113-o&1),n):(n|=o-112<<10|r>>1,n+=1&r,n)}}const Es=Math.pow(2,8),sx=[.125,.215,.35,.446,.526,.582],ax=5+sx.length,Ms={[Ht]:0,[vn]:1,[Mr]:2,[Il]:3,[Wc]:4,[dr]:5,[ai]:6},vu=new gi({side:V,depthWrite:!1,depthTest:!1}),qE=new En(new xo,vu),Vv=new tc,{_lodPlanes:Vd,_sizeLods:lx,_sigmas:vm}=JE(),ux=new Dt;let Wv=null;const _u=(1+Math.sqrt(5))/2,ic=1/_u,hx=[new S(1,1,1),new S(-1,1,1),new S(1,1,-1),new S(-1,1,-1),new S(0,_u,ic),new S(0,_u,-ic),new S(ic,0,_u),new S(-ic,0,_u),new S(_u,ic,0),new S(-_u,ic,0)];function cx(i){const e=Math.max(i.r,i.g,i.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return i.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class YE{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const n=new Float32Array(t),r=new S(0,1,0);return new Qh({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:r},inputEncoding:{value:Ms[Ht]},outputEncoding:{value:Ms[Ht]}},vertexShader:Xv(),fragmentShader:`
4724
4724
 
4725
4725
  precision mediump float;
4726
4726
  precision mediump int;
@@ -4977,7 +4977,7 @@ void main() {
4977
4977
  return inputTexelToLinear( color );
4978
4978
 
4979
4979
  }
4980
- `}const ZE=0,KE=1,QE=0,eM=1,tM=2;function nM(i){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),i}function iM(i=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),i.isMultiMaterial=!0,i.materials=i,i.clone=function(){return i.slice()},i}function rM(i,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new nt(i,e)}function oM(i){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new iu(i)}function sM(i,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new nt(i,e)}function aM(i){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new ie(i)}function lM(i){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new ie(i)}function uM(i){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new ie(i)}function hM(i,e,t){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new S(i,e,t)}function cM(i,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new gn(i,e).setUsage(po)}function dM(i,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new zl(i,e)}function pM(i,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new od(i,e)}function fM(i,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new xh(i,e)}function mM(i,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new sd(i,e)}function gM(i,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Va(i,e)}function vM(i,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new bh(i,e)}function _M(i,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new eo(i,e)}function yM(i,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Tt(i,e)}function xM(i,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new ad(i,e)}function bM(i){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new rx(i)}function wM(i,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new nx(i,e)}function SM(i,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new A(new Xi(i.geometry),new ki({color:e!==void 0?e:16777215}))}function TM(i,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new A(new _v(i.geometry),new ki({color:e!==void 0?e:16777215}))}function EM(i){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Jo(i)}function MM(i){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new fy(i)}function AM(i,e,t){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Yt(i,t)}function RM(){console.error("THREE.CanvasRenderer has been removed")}function CM(){console.error("THREE.JSONLoader has been removed.")}ci.create=function(i,e){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create(ci.prototype),i.prototype.constructor=i,i.prototype.getPoint=e,i},du.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)},Qy.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Jy.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},gr.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),lm.extractUrlBase(i)},gr.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.")}},nc.prototype.center=function(i){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(i)},nc.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},nc.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},nc.prototype.size=function(i){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(i)},Zn.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)},Zn.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Zn.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},Zn.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},Zn.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)},Mi.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Za.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)},qy.prototype.center=function(i){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(i)},Xn.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)},Xn.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},Xn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},Xn.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},Xn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},Xn.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},Rt.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)},Rt.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)},Rt.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new S().setFromMatrixColumn(this,3)},Rt.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)},Rt.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Rt.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},Rt.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},Rt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Rt.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)},Rt.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},Rt.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Rt.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Rt.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Rt.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Rt.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Rt.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},Rt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Rt.prototype.makeFrustum=function(i,e,t,n,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,e,n,t,r,o)},Rt.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},jr.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)},Fi.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)},Fi.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},Ho.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},Ho.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)},Ho.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},qn.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},qn.prototype.barycoordFromPoint=function(i,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,e)},qn.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)},qn.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)},qn.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)},qn.barycoordFromPoint=function(i,e,t,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),qn.getBarycoord(i,e,t,n,r)},qn.normal=function(i,e,t,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),qn.getNormal(i,e,t,n)},ul.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)},ul.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new qo(this,i)},ul.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new au(this,i)},mt.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)},mt.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},mt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},S.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},S.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},S.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)},S.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)},S.prototype.getColumnFromMatrix=function(i,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,i)},S.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)},S.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)},S.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},S.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Bn.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)},Bn.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},pn.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)},pn.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},pn.prototype.translate=function(i,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,i)},pn.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},pn.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(pn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},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.")}}}),En.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(En.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),rt},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.")}}}),il.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},vi.prototype.setLens=function(i,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(i)},Object.defineProperties(Zo.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}}),Object.defineProperties(gn.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===po},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(po)}}}),gn.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?po:$s),this},gn.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},gn.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Xt.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)},Xt.prototype.addAttribute=function(i,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(i,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new gn(arguments[1],arguments[2])))},Xt.prototype.addDrawCall=function(i,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,e)},Xt.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Xt.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Xt.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)},Xt.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(Xt.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}}}),pa.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?po:$s),this},pa.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},qo.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},qo.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},qo.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},el.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},hm.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Bi.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 Dt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===qe}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}}}),Object.defineProperties(or.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}}),Un.prototype.clearTarget=function(i,e,t,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(e,t,n)},Un.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)},Un.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},Un.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},Un.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},Un.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},Un.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},Un.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},Un.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},Un.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},Un.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},Un.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},Un.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},Un.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},Un.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)},Un.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},Un.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},Un.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},Un.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},Un.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},Un.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},Un.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},Un.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},Un.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},Un.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(Un.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},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(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?vn:Ht}},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(Ad.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($r.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}}),Gv.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new Cy().load(i,function(t){e.setBuffer(t)}),this},Uy.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},la.prototype.updateCubeMap=function(i,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(i,e)},la.prototype.clear=function(i,e,t,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,e,t,n)},Ur.crossOrigin=void 0,Ur.loadTexture=function(i,e,t,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new Rv;r.setCrossOrigin(this.crossOrigin);const o=r.load(i,t,void 0,n);return e&&(o.mapping=e),o},Ur.loadTextureCube=function(i,e,t,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new py;r.setCrossOrigin(this.crossOrigin);const o=r.load(i,t,void 0,n);return e&&(o.mapping=e),o},Ur.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Ur.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const PM={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 IM(){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:j}})),typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=j);class OM{constructor(){this.camera=new tc(10,10,10,10),this.camera.position.z=100,this.camera.position.x=0,this.camera.position.y=0}focus(e,t){e.position.z=50}updateAspect(e,t){this.camera.left=-1*e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-1*t/2,this.camera.updateProjectionMatrix()}}class vr{constructor(){this.camera=new OM,this.mesh=new En,this.material=null,this.geometry=null}addObjects(e){this.mesh.position.z=50,e.add(this.mesh)}setTexture(e,t,n,r){this.camera.updateAspect(n,r),this.geometry=new Ki(n,r,1,1),this.material=new or({fragmentShader:this.fragmentShader,vertexShader:`
4980
+ `}const ZE=0,KE=1,QE=0,eM=1,tM=2;function nM(i){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),i}function iM(i=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),i.isMultiMaterial=!0,i.materials=i,i.clone=function(){return i.slice()},i}function rM(i,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new nt(i,e)}function oM(i){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new iu(i)}function sM(i,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new nt(i,e)}function aM(i){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new ie(i)}function lM(i){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new ie(i)}function uM(i){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new ie(i)}function hM(i,e,t){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new S(i,e,t)}function cM(i,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new gn(i,e).setUsage(po)}function dM(i,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new zl(i,e)}function pM(i,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new od(i,e)}function fM(i,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new xh(i,e)}function mM(i,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new sd(i,e)}function gM(i,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Va(i,e)}function vM(i,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new bh(i,e)}function _M(i,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new eo(i,e)}function yM(i,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Tt(i,e)}function xM(i,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new ad(i,e)}function bM(i){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new rx(i)}function wM(i,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new nx(i,e)}function SM(i,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new A(new qi(i.geometry),new Gi({color:e!==void 0?e:16777215}))}function TM(i,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new A(new _v(i.geometry),new Gi({color:e!==void 0?e:16777215}))}function EM(i){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Jo(i)}function MM(i){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new fy(i)}function AM(i,e,t){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Yt(i,t)}function RM(){console.error("THREE.CanvasRenderer has been removed")}function CM(){console.error("THREE.JSONLoader has been removed.")}ci.create=function(i,e){return console.log("THREE.Curve.create() has been deprecated"),i.prototype=Object.create(ci.prototype),i.prototype.constructor=i,i.prototype.getPoint=e,i},du.prototype.fromPoints=function(i){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(i)},Qy.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Jy.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},gr.prototype.extractUrlBase=function(i){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),lm.extractUrlBase(i)},gr.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.")}},nc.prototype.center=function(i){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(i)},nc.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},nc.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},nc.prototype.size=function(i){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(i)},Zn.prototype.center=function(i){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(i)},Zn.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Zn.prototype.isIntersectionBox=function(i){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},Zn.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},Zn.prototype.size=function(i){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(i)},Mi.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Za.prototype.setFromMatrix=function(i){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(i)},qy.prototype.center=function(i){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(i)},Xn.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)},Xn.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},Xn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},Xn.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),i.applyMatrix3(this)},Xn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},Xn.prototype.getInverse=function(i){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},Rt.prototype.extractPosition=function(i){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(i)},Rt.prototype.flattenToArrayOffset=function(i,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(i,e)},Rt.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new S().setFromMatrixColumn(this,3)},Rt.prototype.setRotationFromQuaternion=function(i){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(i)},Rt.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Rt.prototype.multiplyVector3=function(i){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},Rt.prototype.multiplyVector4=function(i){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},Rt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Rt.prototype.rotateAxis=function(i){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),i.transformDirection(this)},Rt.prototype.crossVector=function(i){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},Rt.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Rt.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Rt.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Rt.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Rt.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Rt.prototype.applyToBufferAttribute=function(i){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),i.applyMatrix4(this)},Rt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Rt.prototype.makeFrustum=function(i,e,t,n,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(i,e,n,t,r,o)},Rt.prototype.getInverse=function(i){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(i).invert()},jr.prototype.isIntersectionLine=function(i){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(i)},Bi.prototype.multiplyVector3=function(i){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),i.applyQuaternion(this)},Bi.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},Ho.prototype.isIntersectionBox=function(i){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(i)},Ho.prototype.isIntersectionPlane=function(i){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(i)},Ho.prototype.isIntersectionSphere=function(i){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(i)},qn.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},qn.prototype.barycoordFromPoint=function(i,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(i,e)},qn.prototype.midpoint=function(i){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(i)},qn.prototypenormal=function(i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(i)},qn.prototype.plane=function(i){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(i)},qn.barycoordFromPoint=function(i,e,t,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),qn.getBarycoord(i,e,t,n,r)},qn.normal=function(i,e,t,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),qn.getNormal(i,e,t,n)},ul.prototype.extractAllPoints=function(i){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(i)},ul.prototype.extrude=function(i){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new qo(this,i)},ul.prototype.makeGeometry=function(i){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new au(this,i)},mt.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)},mt.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},mt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},S.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},S.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},S.prototype.getPositionFromMatrix=function(i){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(i)},S.prototype.getScaleFromMatrix=function(i){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(i)},S.prototype.getColumnFromMatrix=function(i,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,i)},S.prototype.applyProjection=function(i){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(i)},S.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)},S.prototype.distanceToManhattan=function(i){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(i)},S.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Bn.prototype.fromAttribute=function(i,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(i,e,t)},Bn.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},pn.prototype.getChildByName=function(i){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(i)},pn.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},pn.prototype.translate=function(i,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,i)},pn.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},pn.prototype.applyMatrix=function(i){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(pn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(i){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=i}},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.")}}}),En.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(En.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),rt},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.")}}}),il.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},vi.prototype.setLens=function(i,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(i)},Object.defineProperties(Zo.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(i){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=i}},shadowCameraLeft:{set:function(i){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=i}},shadowCameraRight:{set:function(i){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=i}},shadowCameraTop:{set:function(i){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=i}},shadowCameraBottom:{set:function(i){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=i}},shadowCameraNear:{set:function(i){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=i}},shadowCameraFar:{set:function(i){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=i}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(i){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=i}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(i){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=i}},shadowMapHeight:{set:function(i){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=i}}}),Object.defineProperties(gn.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===po},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(po)}}}),gn.prototype.setDynamic=function(i){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?po:$s),this},gn.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},gn.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Xt.prototype.addIndex=function(i){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(i)},Xt.prototype.addAttribute=function(i,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?i==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(i,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(i,new gn(arguments[1],arguments[2])))},Xt.prototype.addDrawCall=function(i,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(i,e)},Xt.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Xt.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Xt.prototype.removeAttribute=function(i){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(i)},Xt.prototype.applyMatrix=function(i){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(i)},Object.defineProperties(Xt.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}}}),pa.prototype.setDynamic=function(i){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(i===!0?po:$s),this},pa.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},qo.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},qo.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},qo.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},el.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},hm.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Ui.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 Dt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(i){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===qe}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(i){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=i}}}),Object.defineProperties(or.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(i){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=i}}}),Un.prototype.clearTarget=function(i,e,t,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(i),this.clear(e,t,n)},Un.prototype.animate=function(i){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(i)},Un.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},Un.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},Un.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},Un.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},Un.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},Un.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},Un.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},Un.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},Un.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},Un.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},Un.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},Un.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},Un.prototype.enableScissorTest=function(i){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(i)},Un.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},Un.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},Un.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},Un.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},Un.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},Un.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},Un.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},Un.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},Un.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},Un.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(Un.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=i}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(i){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=i}},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(i){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=i===!0?vn:Ht}},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(Ad.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($r.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=i}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(i){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=i}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=i}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(i){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=i}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(i){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=i}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(i){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=i}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(i){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=i}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(i){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=i}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(i){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=i}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(i){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=i}}}),Gv.prototype.load=function(i){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new Cy().load(i,function(t){e.setBuffer(t)}),this},Uy.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},la.prototype.updateCubeMap=function(i,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(i,e)},la.prototype.clear=function(i,e,t,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(i,e,t,n)},Ur.crossOrigin=void 0,Ur.loadTexture=function(i,e,t,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new Rv;r.setCrossOrigin(this.crossOrigin);const o=r.load(i,t,void 0,n);return e&&(o.mapping=e),o},Ur.loadTextureCube=function(i,e,t,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new py;r.setCrossOrigin(this.crossOrigin);const o=r.load(i,t,void 0,n);return e&&(o.mapping=e),o},Ur.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Ur.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const PM={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 IM(){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:j}})),typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=j);class OM{constructor(){this.camera=new tc(10,10,10,10),this.camera.position.z=100,this.camera.position.x=0,this.camera.position.y=0}focus(e,t){e.position.z=50}updateAspect(e,t){this.camera.left=-1*e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-1*t/2,this.camera.updateProjectionMatrix()}}class vr{constructor(){this.camera=new OM,this.mesh=new En,this.material=null,this.geometry=null}addObjects(e){this.mesh.position.z=50,e.add(this.mesh)}setTexture(e,t,n,r){this.camera.updateAspect(n,r),this.geometry=new Ki(n,r,1,1),this.material=new or({fragmentShader:this.fragmentShader,vertexShader:`
4981
4981
  varying vec2 vUv;
4982
4982
  void main(){
4983
4983
  vUv = uv;
@@ -4995,7 +4995,7 @@ void main(){
4995
4995
  *
4996
4996
  * @pixi/settings is licensed under the MIT License.
4997
4997
  * http://www.opensource.org/licenses/mit-license
4998
- */var Cx,Px,Ix,Ox,Lx,Nx,Dx,Fx,Bx,Qv,e0,t0,Ux,kx,n0,Xd,Gx,i0,Hx,Ko=function(i){var e={userAgent:"",platform:"",maxTouchPoints:0};i||typeof navigator=="undefined"?typeof i=="string"?e.userAgent=i:i&&i.userAgent&&(e={userAgent:i.userAgent,platform:i.platform,maxTouchPoints:i.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var t=e.userAgent,n=t.split("[FBAN");n[1]!==void 0&&(t=n[0]),(n=t.split("Twitter"))[1]!==void 0&&(t=n[0]);var r=function(s){return function(a){return a.test(s)}}(t),o={apple:{phone:r(Zv)&&!r(ba),ipod:r(_x),tablet:!r(Zv)&&(r(yx)||Rx(e))&&!r(ba),universal:r(xx),device:(r(Zv)||r(_x)||r(yx)||r(xx)||Rx(e))&&!r(ba)},amazon:{phone:r(rc),tablet:!r(rc)&&r(xm),device:r(rc)||r(xm)},android:{phone:!r(ba)&&r(rc)||!r(ba)&&r(Kv),tablet:!r(ba)&&!r(rc)&&!r(Kv)&&(r(xm)||r(bx)),device:!r(ba)&&(r(rc)||r(xm)||r(Kv)||r(bx))||r(/\bokhttp\b/i)},windows:{phone:r(ba),tablet:r(wx),device:r(ba)||r(wx)},other:{blackberry:r(Sx),blackberry10:r(Tx),opera:r(Ex),firefox:r(Ax),chrome:r(Mx),device:r(Sx)||r(Tx)||r(Ex)||r(Ax)||r(Mx)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(self.navigator);(function(i){i[i.WEBGL_LEGACY=0]="WEBGL_LEGACY",i[i.WEBGL=1]="WEBGL",i[i.WEBGL2=2]="WEBGL2"})(Cx||(Cx={})),function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.WEBGL=1]="WEBGL",i[i.CANVAS=2]="CANVAS"}(Px||(Px={})),function(i){i[i.COLOR=16384]="COLOR",i[i.DEPTH=256]="DEPTH",i[i.STENCIL=1024]="STENCIL"}(Ix||(Ix={})),function(i){i[i.NORMAL=0]="NORMAL",i[i.ADD=1]="ADD",i[i.MULTIPLY=2]="MULTIPLY",i[i.SCREEN=3]="SCREEN",i[i.OVERLAY=4]="OVERLAY",i[i.DARKEN=5]="DARKEN",i[i.LIGHTEN=6]="LIGHTEN",i[i.COLOR_DODGE=7]="COLOR_DODGE",i[i.COLOR_BURN=8]="COLOR_BURN",i[i.HARD_LIGHT=9]="HARD_LIGHT",i[i.SOFT_LIGHT=10]="SOFT_LIGHT",i[i.DIFFERENCE=11]="DIFFERENCE",i[i.EXCLUSION=12]="EXCLUSION",i[i.HUE=13]="HUE",i[i.SATURATION=14]="SATURATION",i[i.COLOR=15]="COLOR",i[i.LUMINOSITY=16]="LUMINOSITY",i[i.NORMAL_NPM=17]="NORMAL_NPM",i[i.ADD_NPM=18]="ADD_NPM",i[i.SCREEN_NPM=19]="SCREEN_NPM",i[i.NONE=20]="NONE",i[i.SRC_OVER=0]="SRC_OVER",i[i.SRC_IN=21]="SRC_IN",i[i.SRC_OUT=22]="SRC_OUT",i[i.SRC_ATOP=23]="SRC_ATOP",i[i.DST_OVER=24]="DST_OVER",i[i.DST_IN=25]="DST_IN",i[i.DST_OUT=26]="DST_OUT",i[i.DST_ATOP=27]="DST_ATOP",i[i.ERASE=26]="ERASE",i[i.SUBTRACT=28]="SUBTRACT",i[i.XOR=29]="XOR"}(Ox||(Ox={})),function(i){i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Lx||(Lx={})),function(i){i[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(Nx||(Nx={})),function(i){i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(Dx||(Dx={})),function(i){i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.BYTE=5120]="BYTE",i[i.SHORT=5122]="SHORT",i[i.INT=5124]="INT",i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.HALF_FLOAT=36193]="HALF_FLOAT"}(Fx||(Fx={})),function(i){i[i.FLOAT=0]="FLOAT",i[i.INT=1]="INT",i[i.UINT=2]="UINT"}(Bx||(Bx={})),function(i){i[i.NEAREST=0]="NEAREST",i[i.LINEAR=1]="LINEAR"}(Qv||(Qv={})),function(i){i[i.CLAMP=33071]="CLAMP",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(e0||(e0={})),function(i){i[i.OFF=0]="OFF",i[i.POW2=1]="POW2",i[i.ON=2]="ON",i[i.ON_MANUAL=3]="ON_MANUAL"}(t0||(t0={})),function(i){i[i.NPM=0]="NPM",i[i.UNPACK=1]="UNPACK",i[i.PMA=2]="PMA",i[i.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",i[i.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",i[i.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",i[i.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(Ux||(Ux={})),function(i){i[i.NO=0]="NO",i[i.YES=1]="YES",i[i.AUTO=2]="AUTO",i[i.BLEND=0]="BLEND",i[i.CLEAR=1]="CLEAR",i[i.BLIT=2]="BLIT"}(kx||(kx={})),function(i){i[i.AUTO=0]="AUTO",i[i.MANUAL=1]="MANUAL"}(n0||(n0={})),function(i){i.LOW="lowp",i.MEDIUM="mediump",i.HIGH="highp"}(Xd||(Xd={})),function(i){i[i.NONE=0]="NONE",i[i.SCISSOR=1]="SCISSOR",i[i.STENCIL=2]="STENCIL",i[i.SPRITE=3]="SPRITE"}(Gx||(Gx={})),function(i){i[i.NONE=0]="NONE",i[i.LOW=2]="LOW",i[i.MEDIUM=4]="MEDIUM",i[i.HIGH=8]="HIGH"}(i0||(i0={})),function(i){i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(Hx||(Hx={}));var wa,qd,bm,tn,Qo,Nt,yu,sn,wm,Sa,Ta,cl,As,dl,r0,Rs,_r,Gi,Cs,Jt={MIPMAP_TEXTURES:t0.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:i0.NONE,SPRITE_MAX_TEXTURES:function(i){var e=!0;if(Ko.tablet||Ko.phone){var t;Ko.apple.device&&(t=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(t[1],10)<11&&(e=!1),Ko.android.device&&(t=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(t[1],10)<7&&(e=!1)}return e?i:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:n0.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:e0.CLAMP,SCALE_MODE:Qv.LINEAR,PRECISION_VERTEX:Xd.HIGH,PRECISION_FRAGMENT:Ko.apple.device?Xd.HIGH:Xd.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!Ko.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},e2=v(9),oc=v.n(e2),t2=v(10),o0=v.n(t2),s0=v(5);(function(i){i[i.WEBGL_LEGACY=0]="WEBGL_LEGACY",i[i.WEBGL=1]="WEBGL",i[i.WEBGL2=2]="WEBGL2"})(wa||(wa={})),function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.WEBGL=1]="WEBGL",i[i.CANVAS=2]="CANVAS"}(qd||(qd={})),function(i){i[i.COLOR=16384]="COLOR",i[i.DEPTH=256]="DEPTH",i[i.STENCIL=1024]="STENCIL"}(bm||(bm={})),function(i){i[i.NORMAL=0]="NORMAL",i[i.ADD=1]="ADD",i[i.MULTIPLY=2]="MULTIPLY",i[i.SCREEN=3]="SCREEN",i[i.OVERLAY=4]="OVERLAY",i[i.DARKEN=5]="DARKEN",i[i.LIGHTEN=6]="LIGHTEN",i[i.COLOR_DODGE=7]="COLOR_DODGE",i[i.COLOR_BURN=8]="COLOR_BURN",i[i.HARD_LIGHT=9]="HARD_LIGHT",i[i.SOFT_LIGHT=10]="SOFT_LIGHT",i[i.DIFFERENCE=11]="DIFFERENCE",i[i.EXCLUSION=12]="EXCLUSION",i[i.HUE=13]="HUE",i[i.SATURATION=14]="SATURATION",i[i.COLOR=15]="COLOR",i[i.LUMINOSITY=16]="LUMINOSITY",i[i.NORMAL_NPM=17]="NORMAL_NPM",i[i.ADD_NPM=18]="ADD_NPM",i[i.SCREEN_NPM=19]="SCREEN_NPM",i[i.NONE=20]="NONE",i[i.SRC_OVER=0]="SRC_OVER",i[i.SRC_IN=21]="SRC_IN",i[i.SRC_OUT=22]="SRC_OUT",i[i.SRC_ATOP=23]="SRC_ATOP",i[i.DST_OVER=24]="DST_OVER",i[i.DST_IN=25]="DST_IN",i[i.DST_OUT=26]="DST_OUT",i[i.DST_ATOP=27]="DST_ATOP",i[i.ERASE=26]="ERASE",i[i.SUBTRACT=28]="SUBTRACT",i[i.XOR=29]="XOR"}(tn||(tn={})),function(i){i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Qo||(Qo={})),function(i){i[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(Nt||(Nt={})),function(i){i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(yu||(yu={})),function(i){i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.BYTE=5120]="BYTE",i[i.SHORT=5122]="SHORT",i[i.INT=5124]="INT",i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.HALF_FLOAT=36193]="HALF_FLOAT"}(sn||(sn={})),function(i){i[i.FLOAT=0]="FLOAT",i[i.INT=1]="INT",i[i.UINT=2]="UINT"}(wm||(wm={})),function(i){i[i.NEAREST=0]="NEAREST",i[i.LINEAR=1]="LINEAR"}(Sa||(Sa={})),function(i){i[i.CLAMP=33071]="CLAMP",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Ta||(Ta={})),function(i){i[i.OFF=0]="OFF",i[i.POW2=1]="POW2",i[i.ON=2]="ON",i[i.ON_MANUAL=3]="ON_MANUAL"}(cl||(cl={})),function(i){i[i.NPM=0]="NPM",i[i.UNPACK=1]="UNPACK",i[i.PMA=2]="PMA",i[i.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",i[i.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",i[i.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",i[i.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(As||(As={})),function(i){i[i.NO=0]="NO",i[i.YES=1]="YES",i[i.AUTO=2]="AUTO",i[i.BLEND=0]="BLEND",i[i.CLEAR=1]="CLEAR",i[i.BLIT=2]="BLIT"}(dl||(dl={})),function(i){i[i.AUTO=0]="AUTO",i[i.MANUAL=1]="MANUAL"}(r0||(r0={})),function(i){i.LOW="lowp",i.MEDIUM="mediump",i.HIGH="highp"}(Rs||(Rs={})),function(i){i[i.NONE=0]="NONE",i[i.SCISSOR=1]="SCISSOR",i[i.STENCIL=2]="STENCIL",i[i.SPRITE=3]="SPRITE"}(_r||(_r={})),function(i){i[i.NONE=0]="NONE",i[i.LOW=2]="LOW",i[i.MEDIUM=4]="MEDIUM",i[i.HIGH=8]="HIGH"}(Gi||(Gi={})),function(i){i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(Cs||(Cs={}));/*!
4998
+ */var Cx,Px,Ix,Ox,Lx,Nx,Dx,Fx,Bx,Qv,e0,t0,Ux,kx,n0,Xd,Gx,i0,Hx,Ko=function(i){var e={userAgent:"",platform:"",maxTouchPoints:0};i||typeof navigator=="undefined"?typeof i=="string"?e.userAgent=i:i&&i.userAgent&&(e={userAgent:i.userAgent,platform:i.platform,maxTouchPoints:i.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var t=e.userAgent,n=t.split("[FBAN");n[1]!==void 0&&(t=n[0]),(n=t.split("Twitter"))[1]!==void 0&&(t=n[0]);var r=function(s){return function(a){return a.test(s)}}(t),o={apple:{phone:r(Zv)&&!r(ba),ipod:r(_x),tablet:!r(Zv)&&(r(yx)||Rx(e))&&!r(ba),universal:r(xx),device:(r(Zv)||r(_x)||r(yx)||r(xx)||Rx(e))&&!r(ba)},amazon:{phone:r(rc),tablet:!r(rc)&&r(xm),device:r(rc)||r(xm)},android:{phone:!r(ba)&&r(rc)||!r(ba)&&r(Kv),tablet:!r(ba)&&!r(rc)&&!r(Kv)&&(r(xm)||r(bx)),device:!r(ba)&&(r(rc)||r(xm)||r(Kv)||r(bx))||r(/\bokhttp\b/i)},windows:{phone:r(ba),tablet:r(wx),device:r(ba)||r(wx)},other:{blackberry:r(Sx),blackberry10:r(Tx),opera:r(Ex),firefox:r(Ax),chrome:r(Mx),device:r(Sx)||r(Tx)||r(Ex)||r(Ax)||r(Mx)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(self.navigator);(function(i){i[i.WEBGL_LEGACY=0]="WEBGL_LEGACY",i[i.WEBGL=1]="WEBGL",i[i.WEBGL2=2]="WEBGL2"})(Cx||(Cx={})),function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.WEBGL=1]="WEBGL",i[i.CANVAS=2]="CANVAS"}(Px||(Px={})),function(i){i[i.COLOR=16384]="COLOR",i[i.DEPTH=256]="DEPTH",i[i.STENCIL=1024]="STENCIL"}(Ix||(Ix={})),function(i){i[i.NORMAL=0]="NORMAL",i[i.ADD=1]="ADD",i[i.MULTIPLY=2]="MULTIPLY",i[i.SCREEN=3]="SCREEN",i[i.OVERLAY=4]="OVERLAY",i[i.DARKEN=5]="DARKEN",i[i.LIGHTEN=6]="LIGHTEN",i[i.COLOR_DODGE=7]="COLOR_DODGE",i[i.COLOR_BURN=8]="COLOR_BURN",i[i.HARD_LIGHT=9]="HARD_LIGHT",i[i.SOFT_LIGHT=10]="SOFT_LIGHT",i[i.DIFFERENCE=11]="DIFFERENCE",i[i.EXCLUSION=12]="EXCLUSION",i[i.HUE=13]="HUE",i[i.SATURATION=14]="SATURATION",i[i.COLOR=15]="COLOR",i[i.LUMINOSITY=16]="LUMINOSITY",i[i.NORMAL_NPM=17]="NORMAL_NPM",i[i.ADD_NPM=18]="ADD_NPM",i[i.SCREEN_NPM=19]="SCREEN_NPM",i[i.NONE=20]="NONE",i[i.SRC_OVER=0]="SRC_OVER",i[i.SRC_IN=21]="SRC_IN",i[i.SRC_OUT=22]="SRC_OUT",i[i.SRC_ATOP=23]="SRC_ATOP",i[i.DST_OVER=24]="DST_OVER",i[i.DST_IN=25]="DST_IN",i[i.DST_OUT=26]="DST_OUT",i[i.DST_ATOP=27]="DST_ATOP",i[i.ERASE=26]="ERASE",i[i.SUBTRACT=28]="SUBTRACT",i[i.XOR=29]="XOR"}(Ox||(Ox={})),function(i){i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Lx||(Lx={})),function(i){i[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(Nx||(Nx={})),function(i){i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(Dx||(Dx={})),function(i){i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.BYTE=5120]="BYTE",i[i.SHORT=5122]="SHORT",i[i.INT=5124]="INT",i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.HALF_FLOAT=36193]="HALF_FLOAT"}(Fx||(Fx={})),function(i){i[i.FLOAT=0]="FLOAT",i[i.INT=1]="INT",i[i.UINT=2]="UINT"}(Bx||(Bx={})),function(i){i[i.NEAREST=0]="NEAREST",i[i.LINEAR=1]="LINEAR"}(Qv||(Qv={})),function(i){i[i.CLAMP=33071]="CLAMP",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(e0||(e0={})),function(i){i[i.OFF=0]="OFF",i[i.POW2=1]="POW2",i[i.ON=2]="ON",i[i.ON_MANUAL=3]="ON_MANUAL"}(t0||(t0={})),function(i){i[i.NPM=0]="NPM",i[i.UNPACK=1]="UNPACK",i[i.PMA=2]="PMA",i[i.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",i[i.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",i[i.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",i[i.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(Ux||(Ux={})),function(i){i[i.NO=0]="NO",i[i.YES=1]="YES",i[i.AUTO=2]="AUTO",i[i.BLEND=0]="BLEND",i[i.CLEAR=1]="CLEAR",i[i.BLIT=2]="BLIT"}(kx||(kx={})),function(i){i[i.AUTO=0]="AUTO",i[i.MANUAL=1]="MANUAL"}(n0||(n0={})),function(i){i.LOW="lowp",i.MEDIUM="mediump",i.HIGH="highp"}(Xd||(Xd={})),function(i){i[i.NONE=0]="NONE",i[i.SCISSOR=1]="SCISSOR",i[i.STENCIL=2]="STENCIL",i[i.SPRITE=3]="SPRITE"}(Gx||(Gx={})),function(i){i[i.NONE=0]="NONE",i[i.LOW=2]="LOW",i[i.MEDIUM=4]="MEDIUM",i[i.HIGH=8]="HIGH"}(i0||(i0={})),function(i){i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(Hx||(Hx={}));var wa,qd,bm,tn,Qo,Nt,yu,sn,wm,Sa,Ta,cl,As,dl,r0,Rs,_r,Hi,Cs,Jt={MIPMAP_TEXTURES:t0.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:i0.NONE,SPRITE_MAX_TEXTURES:function(i){var e=!0;if(Ko.tablet||Ko.phone){var t;Ko.apple.device&&(t=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(t[1],10)<11&&(e=!1),Ko.android.device&&(t=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(t[1],10)<7&&(e=!1)}return e?i:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:n0.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:e0.CLAMP,SCALE_MODE:Qv.LINEAR,PRECISION_VERTEX:Xd.HIGH,PRECISION_FRAGMENT:Ko.apple.device?Xd.HIGH:Xd.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!Ko.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},e2=v(9),oc=v.n(e2),t2=v(10),o0=v.n(t2),s0=v(5);(function(i){i[i.WEBGL_LEGACY=0]="WEBGL_LEGACY",i[i.WEBGL=1]="WEBGL",i[i.WEBGL2=2]="WEBGL2"})(wa||(wa={})),function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.WEBGL=1]="WEBGL",i[i.CANVAS=2]="CANVAS"}(qd||(qd={})),function(i){i[i.COLOR=16384]="COLOR",i[i.DEPTH=256]="DEPTH",i[i.STENCIL=1024]="STENCIL"}(bm||(bm={})),function(i){i[i.NORMAL=0]="NORMAL",i[i.ADD=1]="ADD",i[i.MULTIPLY=2]="MULTIPLY",i[i.SCREEN=3]="SCREEN",i[i.OVERLAY=4]="OVERLAY",i[i.DARKEN=5]="DARKEN",i[i.LIGHTEN=6]="LIGHTEN",i[i.COLOR_DODGE=7]="COLOR_DODGE",i[i.COLOR_BURN=8]="COLOR_BURN",i[i.HARD_LIGHT=9]="HARD_LIGHT",i[i.SOFT_LIGHT=10]="SOFT_LIGHT",i[i.DIFFERENCE=11]="DIFFERENCE",i[i.EXCLUSION=12]="EXCLUSION",i[i.HUE=13]="HUE",i[i.SATURATION=14]="SATURATION",i[i.COLOR=15]="COLOR",i[i.LUMINOSITY=16]="LUMINOSITY",i[i.NORMAL_NPM=17]="NORMAL_NPM",i[i.ADD_NPM=18]="ADD_NPM",i[i.SCREEN_NPM=19]="SCREEN_NPM",i[i.NONE=20]="NONE",i[i.SRC_OVER=0]="SRC_OVER",i[i.SRC_IN=21]="SRC_IN",i[i.SRC_OUT=22]="SRC_OUT",i[i.SRC_ATOP=23]="SRC_ATOP",i[i.DST_OVER=24]="DST_OVER",i[i.DST_IN=25]="DST_IN",i[i.DST_OUT=26]="DST_OUT",i[i.DST_ATOP=27]="DST_ATOP",i[i.ERASE=26]="ERASE",i[i.SUBTRACT=28]="SUBTRACT",i[i.XOR=29]="XOR"}(tn||(tn={})),function(i){i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Qo||(Qo={})),function(i){i[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(Nt||(Nt={})),function(i){i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(yu||(yu={})),function(i){i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.BYTE=5120]="BYTE",i[i.SHORT=5122]="SHORT",i[i.INT=5124]="INT",i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.HALF_FLOAT=36193]="HALF_FLOAT"}(sn||(sn={})),function(i){i[i.FLOAT=0]="FLOAT",i[i.INT=1]="INT",i[i.UINT=2]="UINT"}(wm||(wm={})),function(i){i[i.NEAREST=0]="NEAREST",i[i.LINEAR=1]="LINEAR"}(Sa||(Sa={})),function(i){i[i.CLAMP=33071]="CLAMP",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Ta||(Ta={})),function(i){i[i.OFF=0]="OFF",i[i.POW2=1]="POW2",i[i.ON=2]="ON",i[i.ON_MANUAL=3]="ON_MANUAL"}(cl||(cl={})),function(i){i[i.NPM=0]="NPM",i[i.UNPACK=1]="UNPACK",i[i.PMA=2]="PMA",i[i.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",i[i.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",i[i.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",i[i.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(As||(As={})),function(i){i[i.NO=0]="NO",i[i.YES=1]="YES",i[i.AUTO=2]="AUTO",i[i.BLEND=0]="BLEND",i[i.CLEAR=1]="CLEAR",i[i.BLIT=2]="BLIT"}(dl||(dl={})),function(i){i[i.AUTO=0]="AUTO",i[i.MANUAL=1]="MANUAL"}(r0||(r0={})),function(i){i.LOW="lowp",i.MEDIUM="mediump",i.HIGH="highp"}(Rs||(Rs={})),function(i){i[i.NONE=0]="NONE",i[i.SCISSOR=1]="SCISSOR",i[i.STENCIL=2]="STENCIL",i[i.SPRITE=3]="SPRITE"}(_r||(_r={})),function(i){i[i.NONE=0]="NONE",i[i.LOW=2]="LOW",i[i.MEDIUM=4]="MEDIUM",i[i.HIGH=8]="HIGH"}(Hi||(Hi={})),function(i){i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(Cs||(Cs={}));/*!
4999
4999
  * @pixi/utils - v6.2.0
5000
5000
  * Compiled Mon, 01 Nov 2021 16:52:10 UTC
5001
5001
  *
@@ -5053,7 +5053,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
5053
5053
 
5054
5054
  See the Apache Version 2.0 License for specific language governing permissions
5055
5055
  and limitations under the License.
5056
- ***************************************************************************** */var xb=function(i,e){return(xb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(i,e)};function Kn(i,e){function t(){this.constructor=i}xb(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var bb=function(){return(bb=Object.assign||function(i){for(var e,t=arguments,n=1,r=arguments.length;n<r;n++)for(var o in e=t[n])Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}).apply(this,arguments)},ac=function(){function i(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new yr("setRealSize"),this.onUpdate=new yr("update"),this.onError=new yr("onError")}return i.prototype.bind=function(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},i.prototype.unbind=function(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)},i.prototype.resize=function(e,t){e===this._width&&t===this._height||(this._width=e,this._height=t,this.onResize.emit(e,t))},Object.defineProperty(i.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),i.prototype.update=function(){this.destroyed||this.onUpdate.emit()},i.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),i.prototype.style=function(e,t,n){return!1},i.prototype.dispose=function(){},i.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},i.test=function(e,t){return!1},i}(),Jd=function(i){function e(t,n){var r=this,o=n||{},s=o.width,a=o.height;if(!s||!a)throw new Error("BufferResource width or height invalid");return(r=i.call(this,s,a)||this).data=t,r}return Kn(e,i),e.prototype.upload=function(t,n,r){var o=t.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===As.UNPACK);var s=n.realWidth,a=n.realHeight;return r.width===s&&r.height===a?o.texSubImage2D(n.target,0,0,0,s,a,n.format,r.type,this.data):(r.width=s,r.height=a,o.texImage2D(n.target,0,r.internalFormat,s,a,0,n.format,r.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(ac),w2={scaleMode:Sa.NEAREST,format:Nt.RGBA,alphaMode:As.NPM},Cn=function(i){function e(t,n){t===void 0&&(t=null),n===void 0&&(n=null);var r=i.call(this)||this,o=(n=n||{}).alphaMode,s=n.mipmap,a=n.anisotropicLevel,l=n.scaleMode,u=n.width,h=n.height,d=n.wrapMode,p=n.format,m=n.type,g=n.target,_=n.resolution,y=n.resourceOptions;return!t||t instanceof ac||((t=T0(t,y)).internal=!0),r.resolution=_||Jt.RESOLUTION,r.width=Math.round((u||0)*r.resolution)/r.resolution,r.height=Math.round((h||0)*r.resolution)/r.resolution,r._mipmap=s!==void 0?s:Jt.MIPMAP_TEXTURES,r.anisotropicLevel=a!==void 0?a:Jt.ANISOTROPIC_LEVEL,r._wrapMode=d||Jt.WRAP_MODE,r._scaleMode=l!==void 0?l:Jt.SCALE_MODE,r.format=p||Nt.RGBA,r.type=m||sn.UNSIGNED_BYTE,r.target=g||yu.TEXTURE_2D,r.alphaMode=o!==void 0?o:As.UNPACK,r.uid=pl(),r.touched=0,r.isPowerOfTwo=!1,r._refreshPOT(),r._glTextures={},r.dirtyId=0,r.dirtyStyleId=0,r.cacheId=null,r.valid=u>0&&h>0,r.textureCacheIds=[],r.destroyed=!1,r.resource=null,r._batchEnabled=0,r._batchLocation=0,r.parentTextureArray=null,r.setResource(t),r}return Kn(e,i),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,n){var r;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),n!==void 0&&n!==this.mipmap&&(this.mipmap=n,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,n,r){return r=r||this.resolution,this.setRealSize(t*r,n*r,r)},e.prototype.setRealSize=function(t,n,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(n)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=f0(this.realWidth)&&f0(this.realHeight)},e.prototype.setResolution=function(t){var n=this.resolution;return n===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*n)/t,this.height=Math.round(this.height*n)/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Eo[this.cacheId],delete Xr[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,n,r){r===void 0&&(r=Jt.STRICT_TEXTURE_CACHE);var o=typeof t=="string",s=null;if(o)s=t;else{if(!t._pixiId){var a=n&&n.pixiIdPrefix||"pixiid";t._pixiId=a+"_"+pl()}s=t._pixiId}var l=Eo[s];if(o&&r&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||((l=new e(t,n)).cacheId=s,e.addToCache(l,s)),l},e.fromBuffer=function(t,n,r,o){t=t||new Float32Array(n*r*4);var s=new Jd(t,{width:n,height:r}),a=t instanceof Float32Array?sn.FLOAT:sn.UNSIGNED_BYTE;return new e(s,Object.assign(w2,o||{width:n,height:r,type:a}))},e.addToCache=function(t,n){n&&(t.textureCacheIds.indexOf(n)===-1&&t.textureCacheIds.push(n),Eo[n]&&console.warn("BaseTexture added to the cache with an id ["+n+"] that already had an entry"),Eo[n]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var n=Eo[t];if(n){var r=n.textureCacheIds.indexOf(t);return r>-1&&n.textureCacheIds.splice(r,1),delete Eo[t],n}}else if(t&&t.textureCacheIds){for(var o=0;o<t.textureCacheIds.length;++o)delete Eo[t.textureCacheIds[o]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(oc.a),E0=function(i){function e(t,n){var r=this,o=n||{},s=o.width,a=o.height;(r=i.call(this,s,a)||this).items=[],r.itemDirtyIds=[];for(var l=0;l<t;l++){var u=new Cn;r.items.push(u),r.itemDirtyIds.push(-2)}return r.length=t,r._load=null,r.baseTexture=null,r}return Kn(e,i),e.prototype.initFromArray=function(t,n){for(var r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof ac?this.addResourceAt(t[r],r):this.addResourceAt(T0(t[r],n),r))},e.prototype.dispose=function(){for(var t=0,n=this.length;t<n;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,n){if(!this.items[n])throw new Error("Index "+n+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[n].setResource(t),this},e.prototype.bind=function(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");i.prototype.bind.call(this,t);for(var n=0;n<this.length;n++)this.items[n].parentTextureArray=t,this.items[n].on("update",t.update,t)},e.prototype.unbind=function(t){i.prototype.unbind.call(this,t);for(var n=0;n<this.length;n++)this.items[n].parentTextureArray=null,this.items[n].off("update",t.update,t)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var n=this.items.map(function(r){return r.resource}).filter(function(r){return r}).map(function(r){return r.load()});return this._load=Promise.all(n).then(function(){var r=t.items[0],o=r.realWidth,s=r.realHeight;return t.resize(o,s),Promise.resolve(t)}),this._load},e}(ac),wb=function(i){function e(t,n){var r,o,s=this,a=n||{},l=a.width,u=a.height;return Array.isArray(t)?(r=t,o=t.length):o=t,s=i.call(this,o,{width:l,height:u})||this,r&&s.initFromArray(r,n),s}return Kn(e,i),e.prototype.addBaseTextureAt=function(t,n){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,n),this},e.prototype.bind=function(t){i.prototype.bind.call(this,t),t.target=yu.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,n,r){var o=this.length,s=this.itemDirtyIds,a=this.items,l=t.gl;r.dirtyId<0&&l.texImage3D(l.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,o,0,n.format,r.type,null);for(var u=0;u<o;u++){var h=a[u];s[u]<h.dirtyId&&(s[u]=h.dirtyId,h.valid&&l.texSubImage3D(l.TEXTURE_2D_ARRAY,0,0,0,u,h.resource.width,h.resource.height,1,n.format,r.type,h.resource.source))}return!0},e}(E0),Ea=function(i){function e(t){var n=this,r=t,o=r.naturalWidth||r.videoWidth||r.width,s=r.naturalHeight||r.videoHeight||r.height;return(n=i.call(this,o,s)||this).source=t,n.noSubImage=!1,n}return Kn(e,i),e.crossOrigin=function(t,n,r){r===void 0&&n.indexOf("data:")!==0?t.crossOrigin=$x(n):r!==!1&&(t.crossOrigin=typeof r=="string"?r:"anonymous")},e.prototype.upload=function(t,n,r,o){var s=t.gl,a=n.realWidth,l=n.realHeight;return o=o||this.source,s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===As.UNPACK),this.noSubImage||n.target!==s.TEXTURE_2D||r.width!==a||r.height!==l?(r.width=a,r.height=l,s.texImage2D(n.target,0,r.internalFormat,n.format,r.type,o)):s.texSubImage2D(s.TEXTURE_2D,0,0,0,n.format,r.type,o),!0},e.prototype.update=function(){if(!this.destroyed){var t=this.source,n=t.naturalWidth||t.videoWidth||t.width,r=t.naturalHeight||t.videoHeight||t.height;this.resize(n,r),i.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(ac),M0=function(i){function e(t){return i.call(this,t)||this}return Kn(e,i),e.test=function(t){var n=self.OffscreenCanvas;return!!(n&&t instanceof n)||self.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(Ea),Sb=function(i){function e(t,n){var r=this,o=n||{},s=o.width,a=o.height,l=o.autoLoad,u=o.linkBaseTexture;if(t&&t.length!==e.SIDES)throw new Error("Invalid length. Got "+t.length+", expected 6");r=i.call(this,6,{width:s,height:a})||this;for(var h=0;h<e.SIDES;h++)r.items[h].target=yu.TEXTURE_CUBE_MAP_POSITIVE_X+h;return r.linkBaseTexture=u!==!1,t&&r.initFromArray(t,n),l!==!1&&r.load(),r}return Kn(e,i),e.prototype.bind=function(t){i.prototype.bind.call(this,t),t.target=yu.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,n,r){if(!this.items[n])throw new Error("Index "+n+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,n)}else t.target=yu.TEXTURE_CUBE_MAP_POSITIVE_X+n,t.parentTextureArray=this.baseTexture,this.items[n]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[n]=t,this},e.prototype.upload=function(t,n,r){for(var o=this.itemDirtyIds,s=0;s<e.SIDES;s++){var a=this.items[s];o[s]<a.dirtyId&&(a.valid&&a.resource?(a.resource.upload(t,a,r),o[s]=a.dirtyId):o[s]<-1&&(t.gl.texImage2D(a.target,0,r.internalFormat,n.realWidth,n.realHeight,0,n.format,r.type,null),o[s]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(E0),A0=function(i){function e(t,n){var r=this;if(n=n||{},!(t instanceof HTMLImageElement)){var o=new Image;Ea.crossOrigin(o,t,n.crossorigin),o.src=t,t=o}return r=i.call(this,t)||this,!t.complete&&r._width&&r._height&&(r._width=0,r._height=0),r.url=t.src,r._process=null,r.preserveBitmap=!1,r.createBitmap=(n.createBitmap!==void 0?n.createBitmap:Jt.CREATE_IMAGE_BITMAP)&&!!self.createImageBitmap,r.alphaMode=typeof n.alphaMode=="number"?n.alphaMode:null,r.bitmap=null,r._load=null,n.autoLoad!==!1&&r.load(),r}return Kn(e,i),e.prototype.load=function(t){var n=this;return this._load||(t!==void 0&&(this.createBitmap=t),this._load=new Promise(function(r,o){var s=n.source;n.url=s.src;var a=function(){n.destroyed||(s.onload=null,s.onerror=null,n.resize(s.width,s.height),n._load=null,n.createBitmap?r(n.process()):r(n))};s.complete&&s.src?a():(s.onload=a,s.onerror=function(l){o(l),n.onError.emit(l)})})),this._load},e.prototype.process=function(){var t=this,n=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!self.createImageBitmap)return Promise.resolve(this);var r=self.createImageBitmap,o=!n.crossOrigin||n.crossOrigin==="anonymous";return this._process=fetch(n.src,{mode:o?"cors":"no-cors"}).then(function(s){return s.blob()}).then(function(s){return r(s,0,0,n.width,n.height,{premultiplyAlpha:t.alphaMode===As.UNPACK?"premultiply":"none"})}).then(function(s){return t.destroyed?Promise.reject():(t.bitmap=s,t.update(),t._process=null,Promise.resolve(t))}),this._process},e.prototype.upload=function(t,n,r){if(typeof this.alphaMode=="number"&&(n.alphaMode=this.alphaMode),!this.createBitmap)return i.prototype.upload.call(this,t,n,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(i.prototype.upload.call(this,t,n,r,this.bitmap),!this.preserveBitmap){var o=!0,s=n._glTextures;for(var a in s){var l=s[a];if(l!==r&&l.dirtyId!==n.dirtyId){o=!1;break}}o&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,i.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return typeof t=="string"||t instanceof HTMLImageElement},e}(Ea),Tb=function(i){function e(t,n){var r=this;return n=n||{},(r=i.call(this,document.createElement("canvas"))||this)._width=0,r._height=0,r.svg=t,r.scale=n.scale||1,r._overrideWidth=n.width,r._overrideHeight=n.height,r._resolve=null,r._crossorigin=n.crossorigin,r._load=null,n.autoLoad!==!1&&r.load(),r}return Kn(e,i),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise(function(n){if(t._resolve=function(){t.resize(t.source.width,t.source.height),n(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()})),this._load},e.prototype._loadSvg=function(){var t=this,n=new Image;Ea.crossOrigin(n,this.svg,this._crossorigin),n.src=this.svg,n.onerror=function(r){t._resolve&&(n.onerror=null,t.onError.emit(r))},n.onload=function(){if(t._resolve){var r=n.width,o=n.height;if(!r||!o)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var s=r*t.scale,a=o*t.scale;(t._overrideWidth||t._overrideHeight)&&(s=t._overrideWidth||t._overrideHeight/o*r,a=t._overrideHeight||t._overrideWidth/r*o),s=Math.round(s),a=Math.round(a);var l=t.source;l.width=s,l.height=a,l._pixiId="canvas_"+pl(),l.getContext("2d").drawImage(n,0,0,r,o,0,0,s,a),t._resolve(),t._resolve=null}}},e.getSize=function(t){var n=e.SVG_SIZE.exec(t),r={};return n&&(r[n[1]]=Math.round(parseFloat(n[3])),r[n[5]]=Math.round(parseFloat(n[7]))),r},e.prototype.dispose=function(){i.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,n){return n==="svg"||typeof t=="string"&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(t)||typeof t=="string"&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(Ea),R0=function(i){function e(t,n){var r=this;if(n=n||{},!(t instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);var s=t[0].src||t[0];Ea.crossOrigin(o,s,n.crossorigin);for(var a=0;a<t.length;++a){var l=document.createElement("source"),u=t[a],h=u.src,d=u.mime,p=(h=h||t[a]).split("?").shift().toLowerCase(),m=p.substr(p.lastIndexOf(".")+1);d=d||e.MIME_TYPES[m]||"video/"+m,l.src=h,l.type=d,o.appendChild(l)}t=o}return(r=i.call(this,t)||this).noSubImage=!0,r._autoUpdate=!0,r._isConnectedToTicker=!1,r._updateFPS=n.updateFPS||0,r._msToNextUpdate=0,r.autoPlay=n.autoPlay!==!1,r._load=null,r._resolve=null,r._onCanPlay=r._onCanPlay.bind(r),r._onError=r._onError.bind(r),n.autoLoad!==!1&&r.load(),r}return Kn(e,i),e.prototype.update=function(t){if(!this.destroyed){var n=lr.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-n),(!this._updateFPS||this._msToNextUpdate<=0)&&(i.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var n=this.source;return(n.readyState===n.HAVE_ENOUGH_DATA||n.readyState===n.HAVE_FUTURE_DATA)&&n.width&&n.height&&(n.complete=!0),n.addEventListener("play",this._onPlayStart.bind(this)),n.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(n.addEventListener("canplay",this._onCanPlay),n.addEventListener("canplaythrough",this._onCanPlay),n.addEventListener("error",this._onError,!0)),this._load=new Promise(function(r){t.valid?r(t):(t._resolve=r,n.load())}),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&t.paused===!1&&t.ended===!1&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return t.readyState===3||t.readyState===4},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(lr.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(lr.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var n=this.valid;this.resize(t.videoWidth,t.videoHeight),!n&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(lr.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),i.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(lr.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(lr.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,n){return self.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(n)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(Ea),Eb=function(i){function e(t){return i.call(this,t)||this}return Kn(e,i),e.test=function(t){return!!self.createImageBitmap&&t instanceof ImageBitmap},e}(Ea);Im.push(A0,Eb,M0,R0,Tb,Jd,Sb,wb);var Mb={__proto__:null,Resource:ac,BaseImageResource:Ea,INSTALLED:Im,autoDetectResource:T0,AbstractMultiResource:E0,ArrayResource:wb,BufferResource:Jd,CanvasResource:M0,CubeResource:Sb,ImageResource:A0,SVGResource:Tb,VideoResource:R0,ImageBitmapResource:Eb},S2=function(i){function e(){return i!==null&&i.apply(this,arguments)||this}return Kn(e,i),e.prototype.upload=function(t,n,r){var o=t.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===As.UNPACK);var s=n.realWidth,a=n.realHeight;return r.width===s&&r.height===a?o.texSubImage2D(n.target,0,0,0,s,a,n.format,r.type,this.data):(r.width=s,r.height=a,o.texImage2D(n.target,0,r.internalFormat,s,a,0,n.format,r.type,this.data)),!0},e}(Jd),C0=function(){function i(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new yr("disposeFramebuffer"),this.multisample=Gi.NONE}return Object.defineProperty(i.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),i.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new Cn(null,{scaleMode:Sa.NEAREST,resolution:1,mipmap:cl.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},i.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Cn(new S2(null,{width:this.width,height:this.height}),{scaleMode:Sa.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:cl.OFF,format:Nt.DEPTH_COMPONENT,type:sn.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},i.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},i.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},i.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n<this.colorTextures.length;n++){var r=this.colorTextures[n],o=r.resolution;r.setSize(e/o,t/o)}this.depthTexture&&(o=this.depthTexture.resolution,this.depthTexture.setSize(e/o,t/o))}},i.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},i.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},i}(),Ab=function(i){function e(t){var n=this;if(typeof t=="number"){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];t={width:r,height:o,scaleMode:s,resolution:a}}return t.width=t.width||100,t.height=t.height||100,t.multisample=t.multisample!==void 0?t.multisample:Gi.NONE,(n=i.call(this,null,t)||this).mipmap=cl.OFF,n.valid=!0,n.clearColor=[0,0,0,0],n.framebuffer=new C0(n.realWidth,n.realHeight).addColorTexture(0,n),n.framebuffer.multisample=t.multisample,n.maskStack=[],n.filterStack=[{}],n}return Kn(e,i),e.prototype.resize=function(t,n){this.framebuffer.resize(t*this.resolution,n*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),i.prototype.dispose.call(this)},e.prototype.destroy=function(){i.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(Cn),Rb=function(){function i(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return i.prototype.set=function(e,t,n){var r=t.width,o=t.height;if(n){var s=e.width/2/r,a=e.height/2/o,l=e.x/r+s,u=e.y/o+a;n=xi.add(n,xi.NW),this.x0=l+s*xi.uX(n),this.y0=u+a*xi.uY(n),n=xi.add(n,2),this.x1=l+s*xi.uX(n),this.y1=u+a*xi.uY(n),n=xi.add(n,2),this.x2=l+s*xi.uX(n),this.y2=u+a*xi.uY(n),n=xi.add(n,2),this.x3=l+s*xi.uX(n),this.y3=u+a*xi.uY(n)}else this.x0=e.x/r,this.y0=e.y/o,this.x1=(e.x+e.width)/r,this.y1=e.y/o,this.x2=(e.x+e.width)/r,this.y2=(e.y+e.height)/o,this.x3=e.x/r,this.y3=(e.y+e.height)/o;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},i.prototype.toString=function(){return"[@pixi/core:TextureUvs x0="+this.x0+" y0="+this.y0+" x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+" x3="+this.x3+" y3="+this.y3+"]"},i}(),Cb=new Rb,nn=function(i){function e(t,n,r,o,s,a){var l=i.call(this)||this;if(l.noFrame=!1,n||(l.noFrame=!0,n=new wn(0,0,1,1)),t instanceof e&&(t=t.baseTexture),l.baseTexture=t,l._frame=n,l.trim=o,l.valid=!1,l._uvs=Cb,l.uvMatrix=null,l.orig=r||n,l._rotate=Number(s||0),s===!0)l._rotate=2;else if(l._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return l.defaultAnchor=a?new Oi(a.x,a.y):new Oi(0,0),l._updateID=0,l.textureCacheIds=[],t.valid?l.noFrame?t.valid&&l.onBaseTextureUpdated(t):l.frame=n:t.once("loaded",l.onBaseTextureUpdated,l),l.noFrame&&t.on("update",l.onBaseTextureUpdated,l),l}return Kn(e,i),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var n=this.baseTexture.resource;n&&n.url&&Xr[n.url]&&e.removeFromCache(n.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),n=this._frame===this.orig?t:this.orig.clone(),r=new e(this.baseTexture,!this.noFrame&&t,n,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(r._frame=t),r},e.prototype.updateUvs=function(){this._uvs===Cb&&(this._uvs=new Rb),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,n,r){n===void 0&&(n={}),r===void 0&&(r=Jt.STRICT_TEXTURE_CACHE);var o=typeof t=="string",s=null;if(o)s=t;else if(t instanceof Cn){if(!t.cacheId){var a=n&&n.pixiIdPrefix||"pixiid";t.cacheId=a+"-"+pl(),Cn.addToCache(t,t.cacheId)}s=t.cacheId}else t._pixiId||(a=n&&n.pixiIdPrefix||"pixiid",t._pixiId=a+"_"+pl()),s=t._pixiId;var l=Xr[s];if(o&&r&&!l)throw new Error('The cacheId "'+s+'" does not exist in TextureCache.');return l||t instanceof Cn?!l&&t instanceof Cn&&(l=new e(t),e.addToCache(l,s)):(n.resolution||(n.resolution=$d(t)),(l=new e(new Cn(t,n))).baseTexture.cacheId=s,Cn.addToCache(l.baseTexture,s),e.addToCache(l,s)),l},e.fromURL=function(t,n){var r=Object.assign({autoLoad:!1},n==null?void 0:n.resourceOptions),o=e.from(t,Object.assign({resourceOptions:r},n),!1),s=o.baseTexture.resource;return o.baseTexture.valid?Promise.resolve(o):s.load().then(function(){return Promise.resolve(o)})},e.fromBuffer=function(t,n,r,o){return new e(Cn.fromBuffer(t,n,r,o))},e.fromLoader=function(t,n,r,o){var s=new Cn(t,Object.assign({scaleMode:Jt.SCALE_MODE,resolution:$d(n)},o)),a=s.resource;a instanceof A0&&(a.url=n);var l=new e(s);return r||(r=n),Cn.addToCache(l.baseTexture,r),e.addToCache(l,r),r!==n&&(Cn.addToCache(l.baseTexture,n),e.addToCache(l,n)),l.baseTexture.valid?Promise.resolve(l):new Promise(function(u){l.baseTexture.once("loaded",function(){return u(l)})})},e.addToCache=function(t,n){n&&(t.textureCacheIds.indexOf(n)===-1&&t.textureCacheIds.push(n),Xr[n]&&console.warn("Texture added to the cache with an id ["+n+"] that already had an entry"),Xr[n]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var n=Xr[t];if(n){var r=n.textureCacheIds.indexOf(t);return r>-1&&n.textureCacheIds.splice(r,1),delete Xr[t],n}}else if(t&&t.textureCacheIds){for(var o=0;o<t.textureCacheIds.length;++o)Xr[t.textureCacheIds[o]]===t&&delete Xr[t.textureCacheIds[o]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var n=t.x,r=t.y,o=t.width,s=t.height,a=n+o>this.baseTexture.width,l=r+s>this.baseTexture.height;if(a||l){var u=a&&l?"and":"or",h="X: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.width,d="Y: "+r+" + "+s+" = "+(r+s)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+u+" "+d)}this.valid=o&&s&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},e}(oc.a);function Om(i){i.destroy=function(){},i.on=function(){},i.once=function(){},i.emit=function(){}}nn.EMPTY=new nn(new Cn),Om(nn.EMPTY),Om(nn.EMPTY.baseTexture),nn.WHITE=function(){var i=document.createElement("canvas");i.width=16,i.height=16;var e=i.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new nn(new Cn(new M0(i)))}(),Om(nn.WHITE),Om(nn.WHITE.baseTexture);var Mo=function(i){function e(t,n){var r=i.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return Kn(e,i),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n,r){r===void 0&&(r=!0);var o=this.baseTexture.resolution,s=Math.round(t*o)/o,a=Math.round(n*o)/o;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,r&&this.baseTexture.resize(s,a),this.updateUvs()},e.prototype.setResolution=function(t){var n=this.baseTexture;n.resolution!==t&&(n.setResolution(t),this.resize(n.width,n.height,!1))},e.create=function(t){for(var n=arguments,r=[],o=1;o<arguments.length;o++)r[o-1]=n[o];return typeof t=="number"&&(fl("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:r[0],scaleMode:r[1],resolution:r[2]}),new e(new Ab(t))},e}(nn),T2=function(){function i(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return i.prototype.createTexture=function(e,t,n){n===void 0&&(n=Gi.NONE);var r=new Ab(Object.assign({width:e,height:t,resolution:1,multisample:n},this.textureOptions));return new Mo(r)},i.prototype.getOptimalTexture=function(e,t,n,r){var o;n===void 0&&(n=1),r===void 0&&(r=Gi.NONE),e=Math.ceil(e*n),t=Math.ceil(t*n),this.enableFullScreen&&e===this._pixelsWidth&&t===this._pixelsHeight?o=r>1?-r:-1:(o=((65535&(e=Yd(e)))<<16|65535&(t=Yd(t)))>>>0,r>1&&(o+=4294967296*r)),this.texturePool[o]||(this.texturePool[o]=[]);var s=this.texturePool[o].pop();return s||(s=this.createTexture(e,t,r)),s.filterPoolKey=o,s.setResolution(n),s},i.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||Gi.NONE);return r.filterFrame=e.filterFrame,r},i.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},i.prototype.returnFilterTexture=function(e){this.returnTexture(e)},i.prototype.clear=function(e){if(e=e!==!1)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r<n.length;r++)n[r].destroy(!0)}this.texturePool={}},i.prototype.setScreenSize=function(e){if(e.width!==this._pixelsWidth||e.height!==this._pixelsHeight){for(var t in this.enableFullScreen=e.width>0&&e.height>0,this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var r=0;r<n.length;r++)n[r].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}},i.SCREEN_KEY=-1,i}(),Pb=function(){function i(e,t,n,r,o,s,a){t===void 0&&(t=0),n===void 0&&(n=!1),r===void 0&&(r=sn.FLOAT),this.buffer=e,this.size=t,this.normalized=n,this.type=r,this.stride=o,this.start=s,this.instance=a}return i.prototype.destroy=function(){this.buffer=null},i.from=function(e,t,n,r,o){return new i(e,t,n,r,o)},i}(),E2=0,qi=function(){function i(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=!1),this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=t,this.id=E2++,this.disposeRunner=new yr("disposeBuffer")}return i.prototype.update=function(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++},i.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},i.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(i.prototype,"index",{get:function(){return this.type===Cs.ELEMENT_ARRAY_BUFFER},set:function(e){this.type=e?Cs.ELEMENT_ARRAY_BUFFER:Cs.ARRAY_BUFFER},enumerable:!1,configurable:!0}),i.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new i(e)},i}(),M2={Float32Array,Uint32Array,Int32Array,Uint8Array},Ib={5126:4,5123:2,5121:1},A2=0,R2={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},lc=function(){function i(e,t){e===void 0&&(e=[]),t===void 0&&(t={}),this.buffers=e,this.indexBuffer=null,this.attributes=t,this.glVertexArrayObjects={},this.id=A2++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new yr("disposeGeometry"),this.refCount=0}return i.prototype.addAttribute=function(e,t,n,r,o,s,a,l){if(n===void 0&&(n=0),r===void 0&&(r=!1),l===void 0&&(l=!1),!t)throw new Error("You must pass a buffer when creating an attribute");t instanceof qi||(t instanceof Array&&(t=new Float32Array(t)),t=new qi(t));var u=e.split("|");if(u.length>1){for(var h=0;h<u.length;h++)this.addAttribute(u[h],t,n,r,o);return this}var d=this.buffers.indexOf(t);return d===-1&&(this.buffers.push(t),d=this.buffers.length-1),this.attributes[e]=new Pb(d,n,r,o,s,a,l),this.instanced=this.instanced||l,this},i.prototype.getAttribute=function(e){return this.attributes[e]},i.prototype.getBuffer=function(e){return this.buffers[this.getAttribute(e).buffer]},i.prototype.addIndex=function(e){return e instanceof qi||(e instanceof Array&&(e=new Uint16Array(e)),e=new qi(e)),e.type=Cs.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.indexOf(e)===-1&&this.buffers.push(e),this},i.prototype.getIndex=function(){return this.indexBuffer},i.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var e,t=[],n=[],r=new qi;for(e in this.attributes){var o=this.attributes[e],s=this.buffers[o.buffer];t.push(s.data),n.push(o.size*Ib[o.type]/4),o.buffer=0}for(r.data=function(a,l){for(var u=0,h=0,d={},p=0;p<a.length;p++)h+=l[p],u+=a[p].length;var m=new ArrayBuffer(4*u),g=null,_=0;for(p=0;p<a.length;p++){var y=l[p],w=a[p],P=Tm(w);d[P]||(d[P]=new M2[P](m)),g=d[P];for(var B=0;B<w.length;B++)g[(B/y|0)*h+_+B%y]=w[B];_+=y}return new Float32Array(m)}(t,n),e=0;e<this.buffers.length;e++)this.buffers[e]!==this.indexBuffer&&this.buffers[e].destroy();return this.buffers=[r],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},i.prototype.getSize=function(){for(var e in this.attributes){var t=this.attributes[e];return this.buffers[t.buffer].data.length/(t.stride/4||t.size)}return 0},i.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},i.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},i.prototype.clone=function(){for(var e=new i,t=0;t<this.buffers.length;t++)e.buffers[t]=new qi(this.buffers[t].data.slice(0));for(var t in this.attributes){var n=this.attributes[t];e.attributes[t]=new Pb(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=Cs.ELEMENT_ARRAY_BUFFER),e},i.merge=function(e){for(var t,n=new i,r=[],o=[],s=[],a=0;a<e.length;a++){t=e[a];for(var l=0;l<t.buffers.length;l++)o[l]=o[l]||0,o[l]+=t.buffers[l].data.length,s[l]=0}for(a=0;a<t.buffers.length;a++)r[a]=new R2[Tm(t.buffers[a].data)](o[a]),n.buffers[a]=new qi(r[a]);for(a=0;a<e.length;a++)for(t=e[a],l=0;l<t.buffers.length;l++)r[l].set(t.buffers[l].data,s[l]),s[l]+=t.buffers[l].data.length;if(n.attributes=t.attributes,t.indexBuffer){n.indexBuffer=n.buffers[t.buffers.indexOf(t.indexBuffer)],n.indexBuffer.type=Cs.ELEMENT_ARRAY_BUFFER;var u=0,h=0,d=0,p=0;for(a=0;a<t.buffers.length;a++)if(t.buffers[a]!==t.indexBuffer){p=a;break}for(var a in t.attributes){var m=t.attributes[a];(0|m.buffer)===p&&(h+=m.size*Ib[m.type]/4)}for(a=0;a<e.length;a++){var g=e[a].indexBuffer.data;for(l=0;l<g.length;l++)n.indexBuffer.data[l+d]+=u;u+=e[a].buffers[p].data.length/h,d+=g.length}}return n},i}(),C2=function(i){function e(){var t=i.call(this)||this;return t.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),t}return Kn(e,i),e}(lc),Ob=function(i){function e(){var t=i.call(this)||this;return t.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.vertexBuffer=new qi(t.vertices),t.uvBuffer=new qi(t.uvs),t.addAttribute("aVertexPosition",t.vertexBuffer).addAttribute("aTextureCoord",t.uvBuffer).addIndex([0,1,2,0,2,3]),t}return Kn(e,i),e.prototype.map=function(t,n){var r=0,o=0;return this.uvs[0]=r,this.uvs[1]=o,this.uvs[2]=r+n.width/t.width,this.uvs[3]=o,this.uvs[4]=r+n.width/t.width,this.uvs[5]=o+n.height/t.height,this.uvs[6]=r,this.uvs[7]=o+n.height/t.height,r=n.x,o=n.y,this.vertices[0]=r,this.vertices[1]=o,this.vertices[2]=r+n.width,this.vertices[3]=o,this.vertices[4]=r+n.width,this.vertices[5]=o+n.height,this.vertices[6]=r,this.vertices[7]=o+n.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(lc),P2=0,Ru=function(){function i(e,t,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=P2++,this.static=!!t,this.ubo=!!n,e instanceof qi?(this.buffer=e,this.buffer.type=Cs.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new qi(new Float32Array(1)),this.buffer.type=Cs.UNIFORM_BUFFER,this.autoManage=!0))}return i.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},i.prototype.add=function(e,t,n){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new i(t,n)},i.from=function(e,t,n){return new i(e,t,n)},i.uboFrom=function(e,t){return new i(e,t==null||t,!0)},i}(),I2=function(){function i(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Gi.NONE,this.sourceFrame=new wn,this.destinationFrame=new wn,this.bindingSourceFrame=new wn,this.bindingDestinationFrame=new wn,this.filters=[],this.transform=null}return i.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},i}(),Lm=[new Oi,new Oi,new Oi,new Oi],P0=new Li,Lb=function(){function i(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new T2,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new C2,this.quadUv=new Ob,this.tempRect=new wn,this.activeState={},this.globalUniforms=new Ru({outputFrame:new wn,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return i.prototype.push=function(e,t){for(var n=this.renderer,r=this.defaultFilterStack,o=this.statePool.pop()||new I2,s=this.renderer.renderTexture,a=t[0].resolution,l=t[0].multisample,u=t[0].padding,h=t[0].autoFit,d=t[0].legacy,p=1;p<t.length;p++){var m=t[p];a=Math.min(a,m.resolution),l=Math.min(l,m.multisample),u=this.useMaxPadding?Math.max(u,m.padding):u+m.padding,h=h&&m.autoFit,d=d||m.legacy}if(r.length===1&&(this.defaultFilterStack[0].renderTexture=s.current),r.push(o),o.resolution=a,o.multisample=l,o.legacy=d,o.target=e,o.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),o.sourceFrame.pad(u),h){var g=this.tempRect.copyFrom(s.sourceFrame);n.projection.transform&&this.transformAABB(P0.copyFrom(n.projection.transform).invert(),g),o.sourceFrame.fit(g)}this.roundFrame(o.sourceFrame,s.current?s.current.resolution:n.resolution,s.sourceFrame,s.destinationFrame,n.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,a,l),o.filters=t,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var _=this.tempRect;_.x=0,_.y=0,_.width=o.sourceFrame.width,_.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(s.sourceFrame),o.bindingDestinationFrame.copyFrom(s.destinationFrame),o.transform=n.projection.transform,n.projection.transform=null,s.bind(o.renderTexture,o.sourceFrame,_),n.framebuffer.clear(0,0,0,0)},i.prototype.pop=function(){var e=this.defaultFilterStack,t=e.pop(),n=t.filters;this.activeState=t;var r=this.globalUniforms.uniforms;r.outputFrame=t.sourceFrame,r.resolution=t.resolution;var o=r.inputSize,s=r.inputPixel,a=r.inputClamp;if(o[0]=t.destinationFrame.width,o[1]=t.destinationFrame.height,o[2]=1/o[0],o[3]=1/o[1],s[0]=Math.round(o[0]*t.resolution),s[1]=Math.round(o[1]*t.resolution),s[2]=1/s[0],s[3]=1/s[1],a[0]=.5*s[2],a[1]=.5*s[3],a[2]=t.sourceFrame.width*o[2]-.5*s[2],a[3]=t.sourceFrame.height*o[3]-.5*s[3],t.legacy){var l=r.filterArea;l[0]=t.destinationFrame.width,l[1]=t.destinationFrame.height,l[2]=t.sourceFrame.x,l[3]=t.sourceFrame.y,r.filterClamp=r.inputClamp}this.globalUniforms.update();var u=e[e.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,t.renderTexture,u.renderTexture,dl.BLEND,t),this.returnFilterTexture(t.renderTexture);else{var h=t.renderTexture,d=this.getOptimalFilterTexture(h.width,h.height,t.resolution);d.filterFrame=h.filterFrame;var p=0;for(p=0;p<n.length-1;++p){p===1&&t.multisample>1&&((d=this.getOptimalFilterTexture(h.width,h.height,t.resolution)).filterFrame=h.filterFrame),n[p].apply(this,h,d,dl.CLEAR,t);var m=h;h=d,d=m}n[p].apply(this,h,u.renderTexture,dl.BLEND,t),p>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(d)}t.clear(),this.statePool.push(t)},i.prototype.bindAndClear=function(e,t){t===void 0&&(t=dl.CLEAR);var n=this.renderer,r=n.renderTexture,o=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,r.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=1&o.stateId||this.forceClear;(t===dl.CLEAR||t===dl.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},i.prototype.applyFilter=function(e,t,n,r){var o=this.renderer;o.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(Qo.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(Qo.TRIANGLE_STRIP))},i.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,o=n.destinationFrame,s=t._texture.orig,a=e.set(o.width,0,0,o.height,r.x,r.y),l=t.worldTransform.copyTo(Li.TEMP_MATRIX);return l.invert(),a.prepend(l),a.scale(1/s.width,1/s.height),a.translate(t.anchor.x,t.anchor.y),a},i.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},i.prototype.getOptimalFilterTexture=function(e,t,n,r){return n===void 0&&(n=1),r===void 0&&(r=Gi.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},i.prototype.getFilterTexture=function(e,t,n){if(typeof e=="number"){var r=e;e=t,t=r}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||Gi.NONE);return o.filterFrame=e.filterFrame,o},i.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},i.prototype.emptyPool=function(){this.texturePool.clear(!0)},i.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},i.prototype.transformAABB=function(e,t){var n=Lm[0],r=Lm[1],o=Lm[2],s=Lm[3];n.set(t.left,t.top),r.set(t.left,t.bottom),o.set(t.right,t.top),s.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(o,o),e.apply(s,s);var a=Math.min(n.x,r.x,o.x,s.x),l=Math.min(n.y,r.y,o.y,s.y),u=Math.max(n.x,r.x,o.x,s.x),h=Math.max(n.y,r.y,o.y,s.y);t.x=a,t.y=l,t.width=u-a,t.height=h-l},i.prototype.roundFrame=function(e,t,n,r,o){if(o){var s=o.a,a=o.b,l=o.c,u=o.d;if((Math.abs(a)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(u)>1e-4))return}(o=o?P0.copyFrom(o):P0.identity()).translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(o,e),e.ceil(t),this.transformAABB(o.invert(),e)},i}(),Nm=function(){function i(e){this.renderer=e}return i.prototype.flush=function(){},i.prototype.destroy=function(){this.renderer=null},i.prototype.start=function(){},i.prototype.stop=function(){this.flush()},i.prototype.render=function(e){},i}(),Nb=function(){function i(e){this.renderer=e,this.emptyRenderer=new Nm(e),this.currentRenderer=this.emptyRenderer}return i.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},i.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},i.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},i.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},i.prototype.boundArray=function(e,t,n,r){for(var o=e.elements,s=e.ids,a=e.count,l=0,u=0;u<a;u++){var h=o[u],d=h._batchLocation;if(d>=0&&d<r&&t[d]===h)s[u]=d;else for(;l<r;){var p=t[l];if(!p||p._batchEnabled!==n||p._batchLocation!==l){s[u]=l,h._batchLocation=l,t[l]=h;break}l++}}},i.prototype.destroy=function(){this.renderer=null},i}(),Db=0,Fb=function(){function i(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(i.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),i.prototype.contextChange=function(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=Db++,e.isContextLost()&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").restoreContext()},i.prototype.initFromContext=function(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Db++,this.renderer.runners.contextChange.emit(e)},i.prototype.initFromOptions=function(e){var t=this.createContext(this.renderer.view,e);this.initFromContext(t)},i.prototype.createContext=function(e,t){var n;if(Jt.PREFER_ENV>=wa.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},i.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),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")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},i.prototype.handleContextLost=function(e){e.preventDefault()},i.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},i.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},i.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},i.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in self&&e instanceof self.WebGL2RenderingContext;n&&(this.webGLVersion=2),t.stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var r=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},i}(),O2=function(i){this.framebuffer=i,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Gi.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},L2=new wn,Bb=function(){function i(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new C0(10,10),this.msaaSamples=null}return i.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new wn,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;Jt.PREFER_ENV===wa.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(r){return t.drawBuffersWEBGL(r)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},i.prototype.bind=function(e,t,n){n===void 0&&(n=0);var r=this.gl;if(e){var o=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,o.framebuffer)),o.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,o.mipLevel=n),o.dirtyId!==e.dirtyId&&(o.dirtyId=e.dirtyId,o.dirtyFormat!==e.dirtyFormat?(o.dirtyFormat=e.dirtyFormat,o.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):o.dirtySize!==e.dirtySize&&(o.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var s=0;s<e.colorTextures.length;s++){var a=e.colorTextures[s];this.renderer.texture.unbind(a.parentTextureArray||a)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),t){var l=t.width>>n,u=t.height>>n,h=l/t.width;this.setViewport(t.x*h,t.y*h,l,u)}else l=e.width>>n,u=e.height>>n,this.setViewport(0,0,l,u)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},i.prototype.setViewport=function(e,t,n,r){var o=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),o.width===n&&o.height===r&&o.x===e&&o.y===t||(o.x=e,o.y=t,o.width=n,o.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(i.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),i.prototype.clear=function(e,t,n,r,o){o===void 0&&(o=bm.COLOR|bm.DEPTH);var s=this.gl;s.clearColor(e,t,n,r),s.clear(o)},i.prototype.initFramebuffer=function(e){var t=this.gl,n=new O2(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},i.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,o=r.length;t.drawBuffers||(o=Math.min(o,1));for(var s=0;s<o;s++){var a=r[s],l=a.parentTextureArray||a;this.renderer.texture.bind(l,0)}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)},i.prototype.updateFramebuffer=function(e,t){var n=this.gl,r=e.glFramebuffers[this.CONTEXT_UID],o=e.colorTextures,s=o.length;n.drawBuffers||(s=Math.min(s,1)),r.multisample>1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var a=[],l=0;l<s;l++){var u=o[l],h=u.parentTextureArray||u;this.renderer.texture.bind(h,0),l===0&&r.msaaBuffer||(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+l,u.target,h._glTextures[this.CONTEXT_UID].texture,t),a.push(n.COLOR_ATTACHMENT0+l))}if(a.length>1&&n.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var d=e.depthTexture;this.renderer.texture.bind(d,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,d._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null):(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil))},i.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},i.prototype.detectSamples=function(e){var t=this.msaaSamples,n=Gi.NONE;if(e<=1||t===null)return n;for(var r=0;r<t.length;r++)if(t[r]<=e){n=t[r];break}return n===1&&(n=Gi.NONE),n},i.prototype.blit=function(e,t,n){var r=this.current,o=this.renderer,s=this.gl,a=this.CONTEXT_UID;if(o.context.webGLVersion===2&&r){var l=r.glFramebuffers[a];if(l){if(!e){if(!l.msaaBuffer)return;var u=r.colorTextures[0];if(!u)return;l.blitFramebuffer||(l.blitFramebuffer=new C0(r.width,r.height),l.blitFramebuffer.addColorTexture(0,u)),(e=l.blitFramebuffer).colorTextures[0]!==u&&(e.colorTextures[0]=u,e.dirtyId++,e.dirtyFormat++),e.width===r.width&&e.height===r.height||(e.width=r.width,e.height=r.height,e.dirtyId++,e.dirtySize++)}t||((t=L2).width=r.width,t.height=r.height),n||(n=t);var h=t.width===n.width&&t.height===n.height;this.bind(e),s.bindFramebuffer(s.READ_FRAMEBUFFER,l.framebuffer),s.blitFramebuffer(t.x,t.y,t.width,t.height,n.x,n.y,n.width,n.height,s.COLOR_BUFFER_BIT,h?s.NEAREST:s.LINEAR)}}},i.prototype.disposeFramebuffer=function(e,t){var n=e.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(n){delete e.glFramebuffers[this.CONTEXT_UID];var o=this.managedFramebuffers.indexOf(e);o>=0&&this.managedFramebuffers.splice(o,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},i.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n<t.length;n++)this.disposeFramebuffer(t[n],e)},i.prototype.forceStencil=function(){var e=this.current;if(e){var t=e.glFramebuffers[this.CONTEXT_UID];if(t&&!t.stencil){e.stencil=!0;var n=e.width,r=e.height,o=this.gl,s=o.createRenderbuffer();o.bindRenderbuffer(o.RENDERBUFFER,s),t.msaaBuffer?o.renderbufferStorageMultisample(o.RENDERBUFFER,t.multisample,o.DEPTH24_STENCIL8,n,r):o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,n,r),t.stencil=s,o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,s)}}},i.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new wn},i.prototype.destroy=function(){this.renderer=null},i}(),I0={5126:4,5123:2,5121:1},Ub=function(){function i(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return i.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl,t=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,t.webGLVersion!==2){var n=this.renderer.context.extensions.vertexArrayObject;Jt.PREFER_ENV===wa.WEBGL_LEGACY&&(n=null),n?(e.createVertexArray=function(){return n.createVertexArrayOES()},e.bindVertexArray=function(o){return n.bindVertexArrayOES(o)},e.deleteVertexArray=function(o){return n.deleteVertexArrayOES(o)}):(this.hasVao=!1,e.createVertexArray=function(){return null},e.bindVertexArray=function(){return null},e.deleteVertexArray=function(){return null})}if(t.webGLVersion!==2){var r=e.getExtension("ANGLE_instanced_arrays");r?(e.vertexAttribDivisor=function(o,s){return r.vertexAttribDivisorANGLE(o,s)},e.drawElementsInstanced=function(o,s,a,l,u){return r.drawElementsInstancedANGLE(o,s,a,l,u)},e.drawArraysInstanced=function(o,s,a,l){return r.drawArraysInstancedANGLE(o,s,a,l)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex},i.prototype.bind=function(e,t){t=t||this.renderer.shader.shader;var n=this.gl,r=e.glVertexArrayObjects[this.CONTEXT_UID],o=!1;r||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=r={},o=!0);var s=r[t.program.id]||this.initGeometryVao(e,t,o);this._activeGeometry=e,this._activeVao!==s&&(this._activeVao=s,this.hasVao?n.bindVertexArray(s):this.activateVao(e,t.program)),this.updateBuffers()},i.prototype.reset=function(){this.unbind()},i.prototype.updateBuffers=function(){for(var e=this._activeGeometry,t=this.renderer.buffer,n=0;n<e.buffers.length;n++){var r=e.buffers[n];t.update(r)}},i.prototype.checkCompatibility=function(e,t){var n=e.attributes,r=t.attributeData;for(var o in r)if(!n[o])throw new Error('shader and geometry incompatible, geometry missing the "'+o+'" attribute')},i.prototype.getSignature=function(e,t){var n=e.attributes,r=t.attributeData,o=["g",e.id];for(var s in n)r[s]&&o.push(s);return o.join("-")},i.prototype.initGeometryVao=function(e,t,n){n===void 0&&(n=!0);var r=this.gl,o=this.CONTEXT_UID,s=this.renderer.buffer,a=t.program;a.glPrograms[o]||this.renderer.shader.generateProgram(t),this.checkCompatibility(e,a);var l=this.getSignature(e,a),u=e.glVertexArrayObjects[this.CONTEXT_UID],h=u[l];if(h)return u[a.id]=h,h;var d=e.buffers,p=e.attributes,m={},g={};for(var _ in d)m[_]=0,g[_]=0;for(var _ in p)!p[_].size&&a.attributeData[_]?p[_].size=a.attributeData[_].size:p[_].size||console.warn("PIXI Geometry attribute '"+_+"' size cannot be determined (likely the bound shader does not have the attribute)"),m[p[_].buffer]+=p[_].size*I0[p[_].type];for(var _ in p){var y=p[_],w=y.size;y.stride===void 0&&(m[y.buffer]===w*I0[y.type]?y.stride=0:y.stride=m[y.buffer]),y.start===void 0&&(y.start=g[y.buffer],g[y.buffer]+=w*I0[y.type])}h=r.createVertexArray(),r.bindVertexArray(h);for(var P=0;P<d.length;P++){var B=d[P];s.bind(B),n&&B._glBuffers[o].refCount++}return this.activateVao(e,a),this._activeVao=h,u[a.id]=h,u[l]=h,h},i.prototype.disposeGeometry=function(e,t){var n;if(this.managedGeometries[e.id]){delete this.managedGeometries[e.id];var r=e.glVertexArrayObjects[this.CONTEXT_UID],o=this.gl,s=e.buffers,a=(n=this.renderer)===null||n===void 0?void 0:n.buffer;if(e.disposeRunner.remove(this),r){if(a)for(var l=0;l<s.length;l++){var u=s[l]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount!==0||t||a.dispose(s[l],t))}if(!t){for(var h in r)if(h[0]==="g"){var d=r[h];this._activeVao===d&&this.unbind(),o.deleteVertexArray(d)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}},i.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedGeometries),n=0;n<t.length;n++)this.disposeGeometry(this.managedGeometries[t[n]],e)},i.prototype.activateVao=function(e,t){var n=this.gl,r=this.CONTEXT_UID,o=this.renderer.buffer,s=e.buffers,a=e.attributes;e.indexBuffer&&o.bind(e.indexBuffer);var l=null;for(var u in a){var h=a[u],d=s[h.buffer],p=d._glBuffers[r];if(t.attributeData[u]){l!==p&&(o.bind(d),l=p);var m=t.attributeData[u].location;if(n.enableVertexAttribArray(m),n.vertexAttribPointer(m,h.size,h.type||n.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");n.vertexAttribDivisor(m,1)}}}},i.prototype.draw=function(e,t,n,r){var o=this.gl,s=this._activeGeometry;if(s.indexBuffer){var a=s.indexBuffer.data.BYTES_PER_ELEMENT,l=a===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;a===2||a===4&&this.canUseUInt32ElementIndex?s.instanced?o.drawElementsInstanced(e,t||s.indexBuffer.data.length,l,(n||0)*a,r||1):o.drawElements(e,t||s.indexBuffer.data.length,l,(n||0)*a):console.warn("unsupported index buffer type: uint32")}else s.instanced?o.drawArraysInstanced(e,n,t||s.getSize(),r||1):o.drawArrays(e,n,t||s.getSize());return this},i.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},i.prototype.destroy=function(){this.renderer=null},i}(),N2=function(){function i(e){e===void 0&&(e=null),this.type=_r.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Jt.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(i.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null},enumerable:!1,configurable:!0}),i.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=_r.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},i.prototype.copyCountersOrReset=function(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},i}();function kb(i,e,t){var n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}function Gb(i,e){var t=i.getShaderSource(e).split(`
5056
+ ***************************************************************************** */var xb=function(i,e){return(xb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(i,e)};function Kn(i,e){function t(){this.constructor=i}xb(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var bb=function(){return(bb=Object.assign||function(i){for(var e,t=arguments,n=1,r=arguments.length;n<r;n++)for(var o in e=t[n])Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}).apply(this,arguments)},ac=function(){function i(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new yr("setRealSize"),this.onUpdate=new yr("update"),this.onError=new yr("onError")}return i.prototype.bind=function(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},i.prototype.unbind=function(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)},i.prototype.resize=function(e,t){e===this._width&&t===this._height||(this._width=e,this._height=t,this.onResize.emit(e,t))},Object.defineProperty(i.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),i.prototype.update=function(){this.destroyed||this.onUpdate.emit()},i.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),i.prototype.style=function(e,t,n){return!1},i.prototype.dispose=function(){},i.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},i.test=function(e,t){return!1},i}(),Jd=function(i){function e(t,n){var r=this,o=n||{},s=o.width,a=o.height;if(!s||!a)throw new Error("BufferResource width or height invalid");return(r=i.call(this,s,a)||this).data=t,r}return Kn(e,i),e.prototype.upload=function(t,n,r){var o=t.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===As.UNPACK);var s=n.realWidth,a=n.realHeight;return r.width===s&&r.height===a?o.texSubImage2D(n.target,0,0,0,s,a,n.format,r.type,this.data):(r.width=s,r.height=a,o.texImage2D(n.target,0,r.internalFormat,s,a,0,n.format,r.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(ac),w2={scaleMode:Sa.NEAREST,format:Nt.RGBA,alphaMode:As.NPM},Cn=function(i){function e(t,n){t===void 0&&(t=null),n===void 0&&(n=null);var r=i.call(this)||this,o=(n=n||{}).alphaMode,s=n.mipmap,a=n.anisotropicLevel,l=n.scaleMode,u=n.width,h=n.height,d=n.wrapMode,p=n.format,m=n.type,g=n.target,_=n.resolution,y=n.resourceOptions;return!t||t instanceof ac||((t=T0(t,y)).internal=!0),r.resolution=_||Jt.RESOLUTION,r.width=Math.round((u||0)*r.resolution)/r.resolution,r.height=Math.round((h||0)*r.resolution)/r.resolution,r._mipmap=s!==void 0?s:Jt.MIPMAP_TEXTURES,r.anisotropicLevel=a!==void 0?a:Jt.ANISOTROPIC_LEVEL,r._wrapMode=d||Jt.WRAP_MODE,r._scaleMode=l!==void 0?l:Jt.SCALE_MODE,r.format=p||Nt.RGBA,r.type=m||sn.UNSIGNED_BYTE,r.target=g||yu.TEXTURE_2D,r.alphaMode=o!==void 0?o:As.UNPACK,r.uid=pl(),r.touched=0,r.isPowerOfTwo=!1,r._refreshPOT(),r._glTextures={},r.dirtyId=0,r.dirtyStyleId=0,r.cacheId=null,r.valid=u>0&&h>0,r.textureCacheIds=[],r.destroyed=!1,r.resource=null,r._batchEnabled=0,r._batchLocation=0,r.parentTextureArray=null,r.setResource(t),r}return Kn(e,i),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,n){var r;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),n!==void 0&&n!==this.mipmap&&(this.mipmap=n,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,n,r){return r=r||this.resolution,this.setRealSize(t*r,n*r,r)},e.prototype.setRealSize=function(t,n,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(n)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=f0(this.realWidth)&&f0(this.realHeight)},e.prototype.setResolution=function(t){var n=this.resolution;return n===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*n)/t,this.height=Math.round(this.height*n)/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Eo[this.cacheId],delete Xr[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,n,r){r===void 0&&(r=Jt.STRICT_TEXTURE_CACHE);var o=typeof t=="string",s=null;if(o)s=t;else{if(!t._pixiId){var a=n&&n.pixiIdPrefix||"pixiid";t._pixiId=a+"_"+pl()}s=t._pixiId}var l=Eo[s];if(o&&r&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||((l=new e(t,n)).cacheId=s,e.addToCache(l,s)),l},e.fromBuffer=function(t,n,r,o){t=t||new Float32Array(n*r*4);var s=new Jd(t,{width:n,height:r}),a=t instanceof Float32Array?sn.FLOAT:sn.UNSIGNED_BYTE;return new e(s,Object.assign(w2,o||{width:n,height:r,type:a}))},e.addToCache=function(t,n){n&&(t.textureCacheIds.indexOf(n)===-1&&t.textureCacheIds.push(n),Eo[n]&&console.warn("BaseTexture added to the cache with an id ["+n+"] that already had an entry"),Eo[n]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var n=Eo[t];if(n){var r=n.textureCacheIds.indexOf(t);return r>-1&&n.textureCacheIds.splice(r,1),delete Eo[t],n}}else if(t&&t.textureCacheIds){for(var o=0;o<t.textureCacheIds.length;++o)delete Eo[t.textureCacheIds[o]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(oc.a),E0=function(i){function e(t,n){var r=this,o=n||{},s=o.width,a=o.height;(r=i.call(this,s,a)||this).items=[],r.itemDirtyIds=[];for(var l=0;l<t;l++){var u=new Cn;r.items.push(u),r.itemDirtyIds.push(-2)}return r.length=t,r._load=null,r.baseTexture=null,r}return Kn(e,i),e.prototype.initFromArray=function(t,n){for(var r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof ac?this.addResourceAt(t[r],r):this.addResourceAt(T0(t[r],n),r))},e.prototype.dispose=function(){for(var t=0,n=this.length;t<n;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,n){if(!this.items[n])throw new Error("Index "+n+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[n].setResource(t),this},e.prototype.bind=function(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");i.prototype.bind.call(this,t);for(var n=0;n<this.length;n++)this.items[n].parentTextureArray=t,this.items[n].on("update",t.update,t)},e.prototype.unbind=function(t){i.prototype.unbind.call(this,t);for(var n=0;n<this.length;n++)this.items[n].parentTextureArray=null,this.items[n].off("update",t.update,t)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var n=this.items.map(function(r){return r.resource}).filter(function(r){return r}).map(function(r){return r.load()});return this._load=Promise.all(n).then(function(){var r=t.items[0],o=r.realWidth,s=r.realHeight;return t.resize(o,s),Promise.resolve(t)}),this._load},e}(ac),wb=function(i){function e(t,n){var r,o,s=this,a=n||{},l=a.width,u=a.height;return Array.isArray(t)?(r=t,o=t.length):o=t,s=i.call(this,o,{width:l,height:u})||this,r&&s.initFromArray(r,n),s}return Kn(e,i),e.prototype.addBaseTextureAt=function(t,n){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,n),this},e.prototype.bind=function(t){i.prototype.bind.call(this,t),t.target=yu.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,n,r){var o=this.length,s=this.itemDirtyIds,a=this.items,l=t.gl;r.dirtyId<0&&l.texImage3D(l.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,o,0,n.format,r.type,null);for(var u=0;u<o;u++){var h=a[u];s[u]<h.dirtyId&&(s[u]=h.dirtyId,h.valid&&l.texSubImage3D(l.TEXTURE_2D_ARRAY,0,0,0,u,h.resource.width,h.resource.height,1,n.format,r.type,h.resource.source))}return!0},e}(E0),Ea=function(i){function e(t){var n=this,r=t,o=r.naturalWidth||r.videoWidth||r.width,s=r.naturalHeight||r.videoHeight||r.height;return(n=i.call(this,o,s)||this).source=t,n.noSubImage=!1,n}return Kn(e,i),e.crossOrigin=function(t,n,r){r===void 0&&n.indexOf("data:")!==0?t.crossOrigin=$x(n):r!==!1&&(t.crossOrigin=typeof r=="string"?r:"anonymous")},e.prototype.upload=function(t,n,r,o){var s=t.gl,a=n.realWidth,l=n.realHeight;return o=o||this.source,s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===As.UNPACK),this.noSubImage||n.target!==s.TEXTURE_2D||r.width!==a||r.height!==l?(r.width=a,r.height=l,s.texImage2D(n.target,0,r.internalFormat,n.format,r.type,o)):s.texSubImage2D(s.TEXTURE_2D,0,0,0,n.format,r.type,o),!0},e.prototype.update=function(){if(!this.destroyed){var t=this.source,n=t.naturalWidth||t.videoWidth||t.width,r=t.naturalHeight||t.videoHeight||t.height;this.resize(n,r),i.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(ac),M0=function(i){function e(t){return i.call(this,t)||this}return Kn(e,i),e.test=function(t){var n=self.OffscreenCanvas;return!!(n&&t instanceof n)||self.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(Ea),Sb=function(i){function e(t,n){var r=this,o=n||{},s=o.width,a=o.height,l=o.autoLoad,u=o.linkBaseTexture;if(t&&t.length!==e.SIDES)throw new Error("Invalid length. Got "+t.length+", expected 6");r=i.call(this,6,{width:s,height:a})||this;for(var h=0;h<e.SIDES;h++)r.items[h].target=yu.TEXTURE_CUBE_MAP_POSITIVE_X+h;return r.linkBaseTexture=u!==!1,t&&r.initFromArray(t,n),l!==!1&&r.load(),r}return Kn(e,i),e.prototype.bind=function(t){i.prototype.bind.call(this,t),t.target=yu.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,n,r){if(!this.items[n])throw new Error("Index "+n+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,n)}else t.target=yu.TEXTURE_CUBE_MAP_POSITIVE_X+n,t.parentTextureArray=this.baseTexture,this.items[n]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[n]=t,this},e.prototype.upload=function(t,n,r){for(var o=this.itemDirtyIds,s=0;s<e.SIDES;s++){var a=this.items[s];o[s]<a.dirtyId&&(a.valid&&a.resource?(a.resource.upload(t,a,r),o[s]=a.dirtyId):o[s]<-1&&(t.gl.texImage2D(a.target,0,r.internalFormat,n.realWidth,n.realHeight,0,n.format,r.type,null),o[s]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(E0),A0=function(i){function e(t,n){var r=this;if(n=n||{},!(t instanceof HTMLImageElement)){var o=new Image;Ea.crossOrigin(o,t,n.crossorigin),o.src=t,t=o}return r=i.call(this,t)||this,!t.complete&&r._width&&r._height&&(r._width=0,r._height=0),r.url=t.src,r._process=null,r.preserveBitmap=!1,r.createBitmap=(n.createBitmap!==void 0?n.createBitmap:Jt.CREATE_IMAGE_BITMAP)&&!!self.createImageBitmap,r.alphaMode=typeof n.alphaMode=="number"?n.alphaMode:null,r.bitmap=null,r._load=null,n.autoLoad!==!1&&r.load(),r}return Kn(e,i),e.prototype.load=function(t){var n=this;return this._load||(t!==void 0&&(this.createBitmap=t),this._load=new Promise(function(r,o){var s=n.source;n.url=s.src;var a=function(){n.destroyed||(s.onload=null,s.onerror=null,n.resize(s.width,s.height),n._load=null,n.createBitmap?r(n.process()):r(n))};s.complete&&s.src?a():(s.onload=a,s.onerror=function(l){o(l),n.onError.emit(l)})})),this._load},e.prototype.process=function(){var t=this,n=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!self.createImageBitmap)return Promise.resolve(this);var r=self.createImageBitmap,o=!n.crossOrigin||n.crossOrigin==="anonymous";return this._process=fetch(n.src,{mode:o?"cors":"no-cors"}).then(function(s){return s.blob()}).then(function(s){return r(s,0,0,n.width,n.height,{premultiplyAlpha:t.alphaMode===As.UNPACK?"premultiply":"none"})}).then(function(s){return t.destroyed?Promise.reject():(t.bitmap=s,t.update(),t._process=null,Promise.resolve(t))}),this._process},e.prototype.upload=function(t,n,r){if(typeof this.alphaMode=="number"&&(n.alphaMode=this.alphaMode),!this.createBitmap)return i.prototype.upload.call(this,t,n,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(i.prototype.upload.call(this,t,n,r,this.bitmap),!this.preserveBitmap){var o=!0,s=n._glTextures;for(var a in s){var l=s[a];if(l!==r&&l.dirtyId!==n.dirtyId){o=!1;break}}o&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,i.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return typeof t=="string"||t instanceof HTMLImageElement},e}(Ea),Tb=function(i){function e(t,n){var r=this;return n=n||{},(r=i.call(this,document.createElement("canvas"))||this)._width=0,r._height=0,r.svg=t,r.scale=n.scale||1,r._overrideWidth=n.width,r._overrideHeight=n.height,r._resolve=null,r._crossorigin=n.crossorigin,r._load=null,n.autoLoad!==!1&&r.load(),r}return Kn(e,i),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise(function(n){if(t._resolve=function(){t.resize(t.source.width,t.source.height),n(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()})),this._load},e.prototype._loadSvg=function(){var t=this,n=new Image;Ea.crossOrigin(n,this.svg,this._crossorigin),n.src=this.svg,n.onerror=function(r){t._resolve&&(n.onerror=null,t.onError.emit(r))},n.onload=function(){if(t._resolve){var r=n.width,o=n.height;if(!r||!o)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var s=r*t.scale,a=o*t.scale;(t._overrideWidth||t._overrideHeight)&&(s=t._overrideWidth||t._overrideHeight/o*r,a=t._overrideHeight||t._overrideWidth/r*o),s=Math.round(s),a=Math.round(a);var l=t.source;l.width=s,l.height=a,l._pixiId="canvas_"+pl(),l.getContext("2d").drawImage(n,0,0,r,o,0,0,s,a),t._resolve(),t._resolve=null}}},e.getSize=function(t){var n=e.SVG_SIZE.exec(t),r={};return n&&(r[n[1]]=Math.round(parseFloat(n[3])),r[n[5]]=Math.round(parseFloat(n[7]))),r},e.prototype.dispose=function(){i.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,n){return n==="svg"||typeof t=="string"&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(t)||typeof t=="string"&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(Ea),R0=function(i){function e(t,n){var r=this;if(n=n||{},!(t instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);var s=t[0].src||t[0];Ea.crossOrigin(o,s,n.crossorigin);for(var a=0;a<t.length;++a){var l=document.createElement("source"),u=t[a],h=u.src,d=u.mime,p=(h=h||t[a]).split("?").shift().toLowerCase(),m=p.substr(p.lastIndexOf(".")+1);d=d||e.MIME_TYPES[m]||"video/"+m,l.src=h,l.type=d,o.appendChild(l)}t=o}return(r=i.call(this,t)||this).noSubImage=!0,r._autoUpdate=!0,r._isConnectedToTicker=!1,r._updateFPS=n.updateFPS||0,r._msToNextUpdate=0,r.autoPlay=n.autoPlay!==!1,r._load=null,r._resolve=null,r._onCanPlay=r._onCanPlay.bind(r),r._onError=r._onError.bind(r),n.autoLoad!==!1&&r.load(),r}return Kn(e,i),e.prototype.update=function(t){if(!this.destroyed){var n=lr.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-n),(!this._updateFPS||this._msToNextUpdate<=0)&&(i.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var n=this.source;return(n.readyState===n.HAVE_ENOUGH_DATA||n.readyState===n.HAVE_FUTURE_DATA)&&n.width&&n.height&&(n.complete=!0),n.addEventListener("play",this._onPlayStart.bind(this)),n.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(n.addEventListener("canplay",this._onCanPlay),n.addEventListener("canplaythrough",this._onCanPlay),n.addEventListener("error",this._onError,!0)),this._load=new Promise(function(r){t.valid?r(t):(t._resolve=r,n.load())}),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&t.paused===!1&&t.ended===!1&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return t.readyState===3||t.readyState===4},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(lr.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(lr.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var n=this.valid;this.resize(t.videoWidth,t.videoHeight),!n&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(lr.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),i.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(lr.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(lr.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,n){return self.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(n)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(Ea),Eb=function(i){function e(t){return i.call(this,t)||this}return Kn(e,i),e.test=function(t){return!!self.createImageBitmap&&t instanceof ImageBitmap},e}(Ea);Im.push(A0,Eb,M0,R0,Tb,Jd,Sb,wb);var Mb={__proto__:null,Resource:ac,BaseImageResource:Ea,INSTALLED:Im,autoDetectResource:T0,AbstractMultiResource:E0,ArrayResource:wb,BufferResource:Jd,CanvasResource:M0,CubeResource:Sb,ImageResource:A0,SVGResource:Tb,VideoResource:R0,ImageBitmapResource:Eb},S2=function(i){function e(){return i!==null&&i.apply(this,arguments)||this}return Kn(e,i),e.prototype.upload=function(t,n,r){var o=t.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===As.UNPACK);var s=n.realWidth,a=n.realHeight;return r.width===s&&r.height===a?o.texSubImage2D(n.target,0,0,0,s,a,n.format,r.type,this.data):(r.width=s,r.height=a,o.texImage2D(n.target,0,r.internalFormat,s,a,0,n.format,r.type,this.data)),!0},e}(Jd),C0=function(){function i(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new yr("disposeFramebuffer"),this.multisample=Hi.NONE}return Object.defineProperty(i.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),i.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new Cn(null,{scaleMode:Sa.NEAREST,resolution:1,mipmap:cl.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},i.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Cn(new S2(null,{width:this.width,height:this.height}),{scaleMode:Sa.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:cl.OFF,format:Nt.DEPTH_COMPONENT,type:sn.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},i.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},i.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},i.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n<this.colorTextures.length;n++){var r=this.colorTextures[n],o=r.resolution;r.setSize(e/o,t/o)}this.depthTexture&&(o=this.depthTexture.resolution,this.depthTexture.setSize(e/o,t/o))}},i.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},i.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},i}(),Ab=function(i){function e(t){var n=this;if(typeof t=="number"){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];t={width:r,height:o,scaleMode:s,resolution:a}}return t.width=t.width||100,t.height=t.height||100,t.multisample=t.multisample!==void 0?t.multisample:Hi.NONE,(n=i.call(this,null,t)||this).mipmap=cl.OFF,n.valid=!0,n.clearColor=[0,0,0,0],n.framebuffer=new C0(n.realWidth,n.realHeight).addColorTexture(0,n),n.framebuffer.multisample=t.multisample,n.maskStack=[],n.filterStack=[{}],n}return Kn(e,i),e.prototype.resize=function(t,n){this.framebuffer.resize(t*this.resolution,n*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),i.prototype.dispose.call(this)},e.prototype.destroy=function(){i.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(Cn),Rb=function(){function i(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return i.prototype.set=function(e,t,n){var r=t.width,o=t.height;if(n){var s=e.width/2/r,a=e.height/2/o,l=e.x/r+s,u=e.y/o+a;n=xi.add(n,xi.NW),this.x0=l+s*xi.uX(n),this.y0=u+a*xi.uY(n),n=xi.add(n,2),this.x1=l+s*xi.uX(n),this.y1=u+a*xi.uY(n),n=xi.add(n,2),this.x2=l+s*xi.uX(n),this.y2=u+a*xi.uY(n),n=xi.add(n,2),this.x3=l+s*xi.uX(n),this.y3=u+a*xi.uY(n)}else this.x0=e.x/r,this.y0=e.y/o,this.x1=(e.x+e.width)/r,this.y1=e.y/o,this.x2=(e.x+e.width)/r,this.y2=(e.y+e.height)/o,this.x3=e.x/r,this.y3=(e.y+e.height)/o;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},i.prototype.toString=function(){return"[@pixi/core:TextureUvs x0="+this.x0+" y0="+this.y0+" x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+" x3="+this.x3+" y3="+this.y3+"]"},i}(),Cb=new Rb,nn=function(i){function e(t,n,r,o,s,a){var l=i.call(this)||this;if(l.noFrame=!1,n||(l.noFrame=!0,n=new wn(0,0,1,1)),t instanceof e&&(t=t.baseTexture),l.baseTexture=t,l._frame=n,l.trim=o,l.valid=!1,l._uvs=Cb,l.uvMatrix=null,l.orig=r||n,l._rotate=Number(s||0),s===!0)l._rotate=2;else if(l._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return l.defaultAnchor=a?new Oi(a.x,a.y):new Oi(0,0),l._updateID=0,l.textureCacheIds=[],t.valid?l.noFrame?t.valid&&l.onBaseTextureUpdated(t):l.frame=n:t.once("loaded",l.onBaseTextureUpdated,l),l.noFrame&&t.on("update",l.onBaseTextureUpdated,l),l}return Kn(e,i),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var n=this.baseTexture.resource;n&&n.url&&Xr[n.url]&&e.removeFromCache(n.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),n=this._frame===this.orig?t:this.orig.clone(),r=new e(this.baseTexture,!this.noFrame&&t,n,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(r._frame=t),r},e.prototype.updateUvs=function(){this._uvs===Cb&&(this._uvs=new Rb),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,n,r){n===void 0&&(n={}),r===void 0&&(r=Jt.STRICT_TEXTURE_CACHE);var o=typeof t=="string",s=null;if(o)s=t;else if(t instanceof Cn){if(!t.cacheId){var a=n&&n.pixiIdPrefix||"pixiid";t.cacheId=a+"-"+pl(),Cn.addToCache(t,t.cacheId)}s=t.cacheId}else t._pixiId||(a=n&&n.pixiIdPrefix||"pixiid",t._pixiId=a+"_"+pl()),s=t._pixiId;var l=Xr[s];if(o&&r&&!l)throw new Error('The cacheId "'+s+'" does not exist in TextureCache.');return l||t instanceof Cn?!l&&t instanceof Cn&&(l=new e(t),e.addToCache(l,s)):(n.resolution||(n.resolution=$d(t)),(l=new e(new Cn(t,n))).baseTexture.cacheId=s,Cn.addToCache(l.baseTexture,s),e.addToCache(l,s)),l},e.fromURL=function(t,n){var r=Object.assign({autoLoad:!1},n==null?void 0:n.resourceOptions),o=e.from(t,Object.assign({resourceOptions:r},n),!1),s=o.baseTexture.resource;return o.baseTexture.valid?Promise.resolve(o):s.load().then(function(){return Promise.resolve(o)})},e.fromBuffer=function(t,n,r,o){return new e(Cn.fromBuffer(t,n,r,o))},e.fromLoader=function(t,n,r,o){var s=new Cn(t,Object.assign({scaleMode:Jt.SCALE_MODE,resolution:$d(n)},o)),a=s.resource;a instanceof A0&&(a.url=n);var l=new e(s);return r||(r=n),Cn.addToCache(l.baseTexture,r),e.addToCache(l,r),r!==n&&(Cn.addToCache(l.baseTexture,n),e.addToCache(l,n)),l.baseTexture.valid?Promise.resolve(l):new Promise(function(u){l.baseTexture.once("loaded",function(){return u(l)})})},e.addToCache=function(t,n){n&&(t.textureCacheIds.indexOf(n)===-1&&t.textureCacheIds.push(n),Xr[n]&&console.warn("Texture added to the cache with an id ["+n+"] that already had an entry"),Xr[n]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var n=Xr[t];if(n){var r=n.textureCacheIds.indexOf(t);return r>-1&&n.textureCacheIds.splice(r,1),delete Xr[t],n}}else if(t&&t.textureCacheIds){for(var o=0;o<t.textureCacheIds.length;++o)Xr[t.textureCacheIds[o]]===t&&delete Xr[t.textureCacheIds[o]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var n=t.x,r=t.y,o=t.width,s=t.height,a=n+o>this.baseTexture.width,l=r+s>this.baseTexture.height;if(a||l){var u=a&&l?"and":"or",h="X: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.width,d="Y: "+r+" + "+s+" = "+(r+s)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+u+" "+d)}this.valid=o&&s&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},e}(oc.a);function Om(i){i.destroy=function(){},i.on=function(){},i.once=function(){},i.emit=function(){}}nn.EMPTY=new nn(new Cn),Om(nn.EMPTY),Om(nn.EMPTY.baseTexture),nn.WHITE=function(){var i=document.createElement("canvas");i.width=16,i.height=16;var e=i.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new nn(new Cn(new M0(i)))}(),Om(nn.WHITE),Om(nn.WHITE.baseTexture);var Mo=function(i){function e(t,n){var r=i.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return Kn(e,i),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n,r){r===void 0&&(r=!0);var o=this.baseTexture.resolution,s=Math.round(t*o)/o,a=Math.round(n*o)/o;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,r&&this.baseTexture.resize(s,a),this.updateUvs()},e.prototype.setResolution=function(t){var n=this.baseTexture;n.resolution!==t&&(n.setResolution(t),this.resize(n.width,n.height,!1))},e.create=function(t){for(var n=arguments,r=[],o=1;o<arguments.length;o++)r[o-1]=n[o];return typeof t=="number"&&(fl("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:r[0],scaleMode:r[1],resolution:r[2]}),new e(new Ab(t))},e}(nn),T2=function(){function i(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return i.prototype.createTexture=function(e,t,n){n===void 0&&(n=Hi.NONE);var r=new Ab(Object.assign({width:e,height:t,resolution:1,multisample:n},this.textureOptions));return new Mo(r)},i.prototype.getOptimalTexture=function(e,t,n,r){var o;n===void 0&&(n=1),r===void 0&&(r=Hi.NONE),e=Math.ceil(e*n),t=Math.ceil(t*n),this.enableFullScreen&&e===this._pixelsWidth&&t===this._pixelsHeight?o=r>1?-r:-1:(o=((65535&(e=Yd(e)))<<16|65535&(t=Yd(t)))>>>0,r>1&&(o+=4294967296*r)),this.texturePool[o]||(this.texturePool[o]=[]);var s=this.texturePool[o].pop();return s||(s=this.createTexture(e,t,r)),s.filterPoolKey=o,s.setResolution(n),s},i.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||Hi.NONE);return r.filterFrame=e.filterFrame,r},i.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},i.prototype.returnFilterTexture=function(e){this.returnTexture(e)},i.prototype.clear=function(e){if(e=e!==!1)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r<n.length;r++)n[r].destroy(!0)}this.texturePool={}},i.prototype.setScreenSize=function(e){if(e.width!==this._pixelsWidth||e.height!==this._pixelsHeight){for(var t in this.enableFullScreen=e.width>0&&e.height>0,this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var r=0;r<n.length;r++)n[r].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}},i.SCREEN_KEY=-1,i}(),Pb=function(){function i(e,t,n,r,o,s,a){t===void 0&&(t=0),n===void 0&&(n=!1),r===void 0&&(r=sn.FLOAT),this.buffer=e,this.size=t,this.normalized=n,this.type=r,this.stride=o,this.start=s,this.instance=a}return i.prototype.destroy=function(){this.buffer=null},i.from=function(e,t,n,r,o){return new i(e,t,n,r,o)},i}(),E2=0,Yi=function(){function i(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=!1),this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=t,this.id=E2++,this.disposeRunner=new yr("disposeBuffer")}return i.prototype.update=function(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++},i.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},i.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(i.prototype,"index",{get:function(){return this.type===Cs.ELEMENT_ARRAY_BUFFER},set:function(e){this.type=e?Cs.ELEMENT_ARRAY_BUFFER:Cs.ARRAY_BUFFER},enumerable:!1,configurable:!0}),i.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new i(e)},i}(),M2={Float32Array,Uint32Array,Int32Array,Uint8Array},Ib={5126:4,5123:2,5121:1},A2=0,R2={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},lc=function(){function i(e,t){e===void 0&&(e=[]),t===void 0&&(t={}),this.buffers=e,this.indexBuffer=null,this.attributes=t,this.glVertexArrayObjects={},this.id=A2++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new yr("disposeGeometry"),this.refCount=0}return i.prototype.addAttribute=function(e,t,n,r,o,s,a,l){if(n===void 0&&(n=0),r===void 0&&(r=!1),l===void 0&&(l=!1),!t)throw new Error("You must pass a buffer when creating an attribute");t instanceof Yi||(t instanceof Array&&(t=new Float32Array(t)),t=new Yi(t));var u=e.split("|");if(u.length>1){for(var h=0;h<u.length;h++)this.addAttribute(u[h],t,n,r,o);return this}var d=this.buffers.indexOf(t);return d===-1&&(this.buffers.push(t),d=this.buffers.length-1),this.attributes[e]=new Pb(d,n,r,o,s,a,l),this.instanced=this.instanced||l,this},i.prototype.getAttribute=function(e){return this.attributes[e]},i.prototype.getBuffer=function(e){return this.buffers[this.getAttribute(e).buffer]},i.prototype.addIndex=function(e){return e instanceof Yi||(e instanceof Array&&(e=new Uint16Array(e)),e=new Yi(e)),e.type=Cs.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.indexOf(e)===-1&&this.buffers.push(e),this},i.prototype.getIndex=function(){return this.indexBuffer},i.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var e,t=[],n=[],r=new Yi;for(e in this.attributes){var o=this.attributes[e],s=this.buffers[o.buffer];t.push(s.data),n.push(o.size*Ib[o.type]/4),o.buffer=0}for(r.data=function(a,l){for(var u=0,h=0,d={},p=0;p<a.length;p++)h+=l[p],u+=a[p].length;var m=new ArrayBuffer(4*u),g=null,_=0;for(p=0;p<a.length;p++){var y=l[p],w=a[p],P=Tm(w);d[P]||(d[P]=new M2[P](m)),g=d[P];for(var B=0;B<w.length;B++)g[(B/y|0)*h+_+B%y]=w[B];_+=y}return new Float32Array(m)}(t,n),e=0;e<this.buffers.length;e++)this.buffers[e]!==this.indexBuffer&&this.buffers[e].destroy();return this.buffers=[r],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},i.prototype.getSize=function(){for(var e in this.attributes){var t=this.attributes[e];return this.buffers[t.buffer].data.length/(t.stride/4||t.size)}return 0},i.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},i.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},i.prototype.clone=function(){for(var e=new i,t=0;t<this.buffers.length;t++)e.buffers[t]=new Yi(this.buffers[t].data.slice(0));for(var t in this.attributes){var n=this.attributes[t];e.attributes[t]=new Pb(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=Cs.ELEMENT_ARRAY_BUFFER),e},i.merge=function(e){for(var t,n=new i,r=[],o=[],s=[],a=0;a<e.length;a++){t=e[a];for(var l=0;l<t.buffers.length;l++)o[l]=o[l]||0,o[l]+=t.buffers[l].data.length,s[l]=0}for(a=0;a<t.buffers.length;a++)r[a]=new R2[Tm(t.buffers[a].data)](o[a]),n.buffers[a]=new Yi(r[a]);for(a=0;a<e.length;a++)for(t=e[a],l=0;l<t.buffers.length;l++)r[l].set(t.buffers[l].data,s[l]),s[l]+=t.buffers[l].data.length;if(n.attributes=t.attributes,t.indexBuffer){n.indexBuffer=n.buffers[t.buffers.indexOf(t.indexBuffer)],n.indexBuffer.type=Cs.ELEMENT_ARRAY_BUFFER;var u=0,h=0,d=0,p=0;for(a=0;a<t.buffers.length;a++)if(t.buffers[a]!==t.indexBuffer){p=a;break}for(var a in t.attributes){var m=t.attributes[a];(0|m.buffer)===p&&(h+=m.size*Ib[m.type]/4)}for(a=0;a<e.length;a++){var g=e[a].indexBuffer.data;for(l=0;l<g.length;l++)n.indexBuffer.data[l+d]+=u;u+=e[a].buffers[p].data.length/h,d+=g.length}}return n},i}(),C2=function(i){function e(){var t=i.call(this)||this;return t.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),t}return Kn(e,i),e}(lc),Ob=function(i){function e(){var t=i.call(this)||this;return t.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.vertexBuffer=new Yi(t.vertices),t.uvBuffer=new Yi(t.uvs),t.addAttribute("aVertexPosition",t.vertexBuffer).addAttribute("aTextureCoord",t.uvBuffer).addIndex([0,1,2,0,2,3]),t}return Kn(e,i),e.prototype.map=function(t,n){var r=0,o=0;return this.uvs[0]=r,this.uvs[1]=o,this.uvs[2]=r+n.width/t.width,this.uvs[3]=o,this.uvs[4]=r+n.width/t.width,this.uvs[5]=o+n.height/t.height,this.uvs[6]=r,this.uvs[7]=o+n.height/t.height,r=n.x,o=n.y,this.vertices[0]=r,this.vertices[1]=o,this.vertices[2]=r+n.width,this.vertices[3]=o,this.vertices[4]=r+n.width,this.vertices[5]=o+n.height,this.vertices[6]=r,this.vertices[7]=o+n.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(lc),P2=0,Ru=function(){function i(e,t,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=P2++,this.static=!!t,this.ubo=!!n,e instanceof Yi?(this.buffer=e,this.buffer.type=Cs.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new Yi(new Float32Array(1)),this.buffer.type=Cs.UNIFORM_BUFFER,this.autoManage=!0))}return i.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},i.prototype.add=function(e,t,n){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new i(t,n)},i.from=function(e,t,n){return new i(e,t,n)},i.uboFrom=function(e,t){return new i(e,t==null||t,!0)},i}(),I2=function(){function i(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Hi.NONE,this.sourceFrame=new wn,this.destinationFrame=new wn,this.bindingSourceFrame=new wn,this.bindingDestinationFrame=new wn,this.filters=[],this.transform=null}return i.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},i}(),Lm=[new Oi,new Oi,new Oi,new Oi],P0=new Li,Lb=function(){function i(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new T2,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new C2,this.quadUv=new Ob,this.tempRect=new wn,this.activeState={},this.globalUniforms=new Ru({outputFrame:new wn,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return i.prototype.push=function(e,t){for(var n=this.renderer,r=this.defaultFilterStack,o=this.statePool.pop()||new I2,s=this.renderer.renderTexture,a=t[0].resolution,l=t[0].multisample,u=t[0].padding,h=t[0].autoFit,d=t[0].legacy,p=1;p<t.length;p++){var m=t[p];a=Math.min(a,m.resolution),l=Math.min(l,m.multisample),u=this.useMaxPadding?Math.max(u,m.padding):u+m.padding,h=h&&m.autoFit,d=d||m.legacy}if(r.length===1&&(this.defaultFilterStack[0].renderTexture=s.current),r.push(o),o.resolution=a,o.multisample=l,o.legacy=d,o.target=e,o.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),o.sourceFrame.pad(u),h){var g=this.tempRect.copyFrom(s.sourceFrame);n.projection.transform&&this.transformAABB(P0.copyFrom(n.projection.transform).invert(),g),o.sourceFrame.fit(g)}this.roundFrame(o.sourceFrame,s.current?s.current.resolution:n.resolution,s.sourceFrame,s.destinationFrame,n.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,a,l),o.filters=t,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var _=this.tempRect;_.x=0,_.y=0,_.width=o.sourceFrame.width,_.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(s.sourceFrame),o.bindingDestinationFrame.copyFrom(s.destinationFrame),o.transform=n.projection.transform,n.projection.transform=null,s.bind(o.renderTexture,o.sourceFrame,_),n.framebuffer.clear(0,0,0,0)},i.prototype.pop=function(){var e=this.defaultFilterStack,t=e.pop(),n=t.filters;this.activeState=t;var r=this.globalUniforms.uniforms;r.outputFrame=t.sourceFrame,r.resolution=t.resolution;var o=r.inputSize,s=r.inputPixel,a=r.inputClamp;if(o[0]=t.destinationFrame.width,o[1]=t.destinationFrame.height,o[2]=1/o[0],o[3]=1/o[1],s[0]=Math.round(o[0]*t.resolution),s[1]=Math.round(o[1]*t.resolution),s[2]=1/s[0],s[3]=1/s[1],a[0]=.5*s[2],a[1]=.5*s[3],a[2]=t.sourceFrame.width*o[2]-.5*s[2],a[3]=t.sourceFrame.height*o[3]-.5*s[3],t.legacy){var l=r.filterArea;l[0]=t.destinationFrame.width,l[1]=t.destinationFrame.height,l[2]=t.sourceFrame.x,l[3]=t.sourceFrame.y,r.filterClamp=r.inputClamp}this.globalUniforms.update();var u=e[e.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,t.renderTexture,u.renderTexture,dl.BLEND,t),this.returnFilterTexture(t.renderTexture);else{var h=t.renderTexture,d=this.getOptimalFilterTexture(h.width,h.height,t.resolution);d.filterFrame=h.filterFrame;var p=0;for(p=0;p<n.length-1;++p){p===1&&t.multisample>1&&((d=this.getOptimalFilterTexture(h.width,h.height,t.resolution)).filterFrame=h.filterFrame),n[p].apply(this,h,d,dl.CLEAR,t);var m=h;h=d,d=m}n[p].apply(this,h,u.renderTexture,dl.BLEND,t),p>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(d)}t.clear(),this.statePool.push(t)},i.prototype.bindAndClear=function(e,t){t===void 0&&(t=dl.CLEAR);var n=this.renderer,r=n.renderTexture,o=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,r.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=1&o.stateId||this.forceClear;(t===dl.CLEAR||t===dl.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},i.prototype.applyFilter=function(e,t,n,r){var o=this.renderer;o.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(Qo.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(Qo.TRIANGLE_STRIP))},i.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,o=n.destinationFrame,s=t._texture.orig,a=e.set(o.width,0,0,o.height,r.x,r.y),l=t.worldTransform.copyTo(Li.TEMP_MATRIX);return l.invert(),a.prepend(l),a.scale(1/s.width,1/s.height),a.translate(t.anchor.x,t.anchor.y),a},i.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},i.prototype.getOptimalFilterTexture=function(e,t,n,r){return n===void 0&&(n=1),r===void 0&&(r=Hi.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},i.prototype.getFilterTexture=function(e,t,n){if(typeof e=="number"){var r=e;e=t,t=r}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||Hi.NONE);return o.filterFrame=e.filterFrame,o},i.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},i.prototype.emptyPool=function(){this.texturePool.clear(!0)},i.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},i.prototype.transformAABB=function(e,t){var n=Lm[0],r=Lm[1],o=Lm[2],s=Lm[3];n.set(t.left,t.top),r.set(t.left,t.bottom),o.set(t.right,t.top),s.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(o,o),e.apply(s,s);var a=Math.min(n.x,r.x,o.x,s.x),l=Math.min(n.y,r.y,o.y,s.y),u=Math.max(n.x,r.x,o.x,s.x),h=Math.max(n.y,r.y,o.y,s.y);t.x=a,t.y=l,t.width=u-a,t.height=h-l},i.prototype.roundFrame=function(e,t,n,r,o){if(o){var s=o.a,a=o.b,l=o.c,u=o.d;if((Math.abs(a)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(u)>1e-4))return}(o=o?P0.copyFrom(o):P0.identity()).translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(o,e),e.ceil(t),this.transformAABB(o.invert(),e)},i}(),Nm=function(){function i(e){this.renderer=e}return i.prototype.flush=function(){},i.prototype.destroy=function(){this.renderer=null},i.prototype.start=function(){},i.prototype.stop=function(){this.flush()},i.prototype.render=function(e){},i}(),Nb=function(){function i(e){this.renderer=e,this.emptyRenderer=new Nm(e),this.currentRenderer=this.emptyRenderer}return i.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},i.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},i.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},i.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},i.prototype.boundArray=function(e,t,n,r){for(var o=e.elements,s=e.ids,a=e.count,l=0,u=0;u<a;u++){var h=o[u],d=h._batchLocation;if(d>=0&&d<r&&t[d]===h)s[u]=d;else for(;l<r;){var p=t[l];if(!p||p._batchEnabled!==n||p._batchLocation!==l){s[u]=l,h._batchLocation=l,t[l]=h;break}l++}}},i.prototype.destroy=function(){this.renderer=null},i}(),Db=0,Fb=function(){function i(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(i.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),i.prototype.contextChange=function(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=Db++,e.isContextLost()&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").restoreContext()},i.prototype.initFromContext=function(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Db++,this.renderer.runners.contextChange.emit(e)},i.prototype.initFromOptions=function(e){var t=this.createContext(this.renderer.view,e);this.initFromContext(t)},i.prototype.createContext=function(e,t){var n;if(Jt.PREFER_ENV>=wa.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},i.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),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")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},i.prototype.handleContextLost=function(e){e.preventDefault()},i.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},i.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},i.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},i.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in self&&e instanceof self.WebGL2RenderingContext;n&&(this.webGLVersion=2),t.stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var r=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},i}(),O2=function(i){this.framebuffer=i,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Hi.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},L2=new wn,Bb=function(){function i(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new C0(10,10),this.msaaSamples=null}return i.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new wn,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;Jt.PREFER_ENV===wa.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(r){return t.drawBuffersWEBGL(r)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},i.prototype.bind=function(e,t,n){n===void 0&&(n=0);var r=this.gl;if(e){var o=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,o.framebuffer)),o.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,o.mipLevel=n),o.dirtyId!==e.dirtyId&&(o.dirtyId=e.dirtyId,o.dirtyFormat!==e.dirtyFormat?(o.dirtyFormat=e.dirtyFormat,o.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):o.dirtySize!==e.dirtySize&&(o.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var s=0;s<e.colorTextures.length;s++){var a=e.colorTextures[s];this.renderer.texture.unbind(a.parentTextureArray||a)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),t){var l=t.width>>n,u=t.height>>n,h=l/t.width;this.setViewport(t.x*h,t.y*h,l,u)}else l=e.width>>n,u=e.height>>n,this.setViewport(0,0,l,u)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},i.prototype.setViewport=function(e,t,n,r){var o=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),o.width===n&&o.height===r&&o.x===e&&o.y===t||(o.x=e,o.y=t,o.width=n,o.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(i.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),i.prototype.clear=function(e,t,n,r,o){o===void 0&&(o=bm.COLOR|bm.DEPTH);var s=this.gl;s.clearColor(e,t,n,r),s.clear(o)},i.prototype.initFramebuffer=function(e){var t=this.gl,n=new O2(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},i.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,o=r.length;t.drawBuffers||(o=Math.min(o,1));for(var s=0;s<o;s++){var a=r[s],l=a.parentTextureArray||a;this.renderer.texture.bind(l,0)}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)},i.prototype.updateFramebuffer=function(e,t){var n=this.gl,r=e.glFramebuffers[this.CONTEXT_UID],o=e.colorTextures,s=o.length;n.drawBuffers||(s=Math.min(s,1)),r.multisample>1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var a=[],l=0;l<s;l++){var u=o[l],h=u.parentTextureArray||u;this.renderer.texture.bind(h,0),l===0&&r.msaaBuffer||(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+l,u.target,h._glTextures[this.CONTEXT_UID].texture,t),a.push(n.COLOR_ATTACHMENT0+l))}if(a.length>1&&n.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var d=e.depthTexture;this.renderer.texture.bind(d,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,d._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null):(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil))},i.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},i.prototype.detectSamples=function(e){var t=this.msaaSamples,n=Hi.NONE;if(e<=1||t===null)return n;for(var r=0;r<t.length;r++)if(t[r]<=e){n=t[r];break}return n===1&&(n=Hi.NONE),n},i.prototype.blit=function(e,t,n){var r=this.current,o=this.renderer,s=this.gl,a=this.CONTEXT_UID;if(o.context.webGLVersion===2&&r){var l=r.glFramebuffers[a];if(l){if(!e){if(!l.msaaBuffer)return;var u=r.colorTextures[0];if(!u)return;l.blitFramebuffer||(l.blitFramebuffer=new C0(r.width,r.height),l.blitFramebuffer.addColorTexture(0,u)),(e=l.blitFramebuffer).colorTextures[0]!==u&&(e.colorTextures[0]=u,e.dirtyId++,e.dirtyFormat++),e.width===r.width&&e.height===r.height||(e.width=r.width,e.height=r.height,e.dirtyId++,e.dirtySize++)}t||((t=L2).width=r.width,t.height=r.height),n||(n=t);var h=t.width===n.width&&t.height===n.height;this.bind(e),s.bindFramebuffer(s.READ_FRAMEBUFFER,l.framebuffer),s.blitFramebuffer(t.x,t.y,t.width,t.height,n.x,n.y,n.width,n.height,s.COLOR_BUFFER_BIT,h?s.NEAREST:s.LINEAR)}}},i.prototype.disposeFramebuffer=function(e,t){var n=e.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(n){delete e.glFramebuffers[this.CONTEXT_UID];var o=this.managedFramebuffers.indexOf(e);o>=0&&this.managedFramebuffers.splice(o,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},i.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n<t.length;n++)this.disposeFramebuffer(t[n],e)},i.prototype.forceStencil=function(){var e=this.current;if(e){var t=e.glFramebuffers[this.CONTEXT_UID];if(t&&!t.stencil){e.stencil=!0;var n=e.width,r=e.height,o=this.gl,s=o.createRenderbuffer();o.bindRenderbuffer(o.RENDERBUFFER,s),t.msaaBuffer?o.renderbufferStorageMultisample(o.RENDERBUFFER,t.multisample,o.DEPTH24_STENCIL8,n,r):o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,n,r),t.stencil=s,o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,s)}}},i.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new wn},i.prototype.destroy=function(){this.renderer=null},i}(),I0={5126:4,5123:2,5121:1},Ub=function(){function i(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return i.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl,t=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,t.webGLVersion!==2){var n=this.renderer.context.extensions.vertexArrayObject;Jt.PREFER_ENV===wa.WEBGL_LEGACY&&(n=null),n?(e.createVertexArray=function(){return n.createVertexArrayOES()},e.bindVertexArray=function(o){return n.bindVertexArrayOES(o)},e.deleteVertexArray=function(o){return n.deleteVertexArrayOES(o)}):(this.hasVao=!1,e.createVertexArray=function(){return null},e.bindVertexArray=function(){return null},e.deleteVertexArray=function(){return null})}if(t.webGLVersion!==2){var r=e.getExtension("ANGLE_instanced_arrays");r?(e.vertexAttribDivisor=function(o,s){return r.vertexAttribDivisorANGLE(o,s)},e.drawElementsInstanced=function(o,s,a,l,u){return r.drawElementsInstancedANGLE(o,s,a,l,u)},e.drawArraysInstanced=function(o,s,a,l){return r.drawArraysInstancedANGLE(o,s,a,l)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex},i.prototype.bind=function(e,t){t=t||this.renderer.shader.shader;var n=this.gl,r=e.glVertexArrayObjects[this.CONTEXT_UID],o=!1;r||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=r={},o=!0);var s=r[t.program.id]||this.initGeometryVao(e,t,o);this._activeGeometry=e,this._activeVao!==s&&(this._activeVao=s,this.hasVao?n.bindVertexArray(s):this.activateVao(e,t.program)),this.updateBuffers()},i.prototype.reset=function(){this.unbind()},i.prototype.updateBuffers=function(){for(var e=this._activeGeometry,t=this.renderer.buffer,n=0;n<e.buffers.length;n++){var r=e.buffers[n];t.update(r)}},i.prototype.checkCompatibility=function(e,t){var n=e.attributes,r=t.attributeData;for(var o in r)if(!n[o])throw new Error('shader and geometry incompatible, geometry missing the "'+o+'" attribute')},i.prototype.getSignature=function(e,t){var n=e.attributes,r=t.attributeData,o=["g",e.id];for(var s in n)r[s]&&o.push(s);return o.join("-")},i.prototype.initGeometryVao=function(e,t,n){n===void 0&&(n=!0);var r=this.gl,o=this.CONTEXT_UID,s=this.renderer.buffer,a=t.program;a.glPrograms[o]||this.renderer.shader.generateProgram(t),this.checkCompatibility(e,a);var l=this.getSignature(e,a),u=e.glVertexArrayObjects[this.CONTEXT_UID],h=u[l];if(h)return u[a.id]=h,h;var d=e.buffers,p=e.attributes,m={},g={};for(var _ in d)m[_]=0,g[_]=0;for(var _ in p)!p[_].size&&a.attributeData[_]?p[_].size=a.attributeData[_].size:p[_].size||console.warn("PIXI Geometry attribute '"+_+"' size cannot be determined (likely the bound shader does not have the attribute)"),m[p[_].buffer]+=p[_].size*I0[p[_].type];for(var _ in p){var y=p[_],w=y.size;y.stride===void 0&&(m[y.buffer]===w*I0[y.type]?y.stride=0:y.stride=m[y.buffer]),y.start===void 0&&(y.start=g[y.buffer],g[y.buffer]+=w*I0[y.type])}h=r.createVertexArray(),r.bindVertexArray(h);for(var P=0;P<d.length;P++){var B=d[P];s.bind(B),n&&B._glBuffers[o].refCount++}return this.activateVao(e,a),this._activeVao=h,u[a.id]=h,u[l]=h,h},i.prototype.disposeGeometry=function(e,t){var n;if(this.managedGeometries[e.id]){delete this.managedGeometries[e.id];var r=e.glVertexArrayObjects[this.CONTEXT_UID],o=this.gl,s=e.buffers,a=(n=this.renderer)===null||n===void 0?void 0:n.buffer;if(e.disposeRunner.remove(this),r){if(a)for(var l=0;l<s.length;l++){var u=s[l]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount!==0||t||a.dispose(s[l],t))}if(!t){for(var h in r)if(h[0]==="g"){var d=r[h];this._activeVao===d&&this.unbind(),o.deleteVertexArray(d)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}},i.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedGeometries),n=0;n<t.length;n++)this.disposeGeometry(this.managedGeometries[t[n]],e)},i.prototype.activateVao=function(e,t){var n=this.gl,r=this.CONTEXT_UID,o=this.renderer.buffer,s=e.buffers,a=e.attributes;e.indexBuffer&&o.bind(e.indexBuffer);var l=null;for(var u in a){var h=a[u],d=s[h.buffer],p=d._glBuffers[r];if(t.attributeData[u]){l!==p&&(o.bind(d),l=p);var m=t.attributeData[u].location;if(n.enableVertexAttribArray(m),n.vertexAttribPointer(m,h.size,h.type||n.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");n.vertexAttribDivisor(m,1)}}}},i.prototype.draw=function(e,t,n,r){var o=this.gl,s=this._activeGeometry;if(s.indexBuffer){var a=s.indexBuffer.data.BYTES_PER_ELEMENT,l=a===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;a===2||a===4&&this.canUseUInt32ElementIndex?s.instanced?o.drawElementsInstanced(e,t||s.indexBuffer.data.length,l,(n||0)*a,r||1):o.drawElements(e,t||s.indexBuffer.data.length,l,(n||0)*a):console.warn("unsupported index buffer type: uint32")}else s.instanced?o.drawArraysInstanced(e,n,t||s.getSize(),r||1):o.drawArrays(e,n,t||s.getSize());return this},i.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},i.prototype.destroy=function(){this.renderer=null},i}(),N2=function(){function i(e){e===void 0&&(e=null),this.type=_r.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Jt.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(i.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null},enumerable:!1,configurable:!0}),i.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=_r.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},i.prototype.copyCountersOrReset=function(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},i}();function kb(i,e,t){var n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}function Gb(i,e){var t=i.getShaderSource(e).split(`
5057
5057
  `).map(function(u,h){return h+": "+u}),n=i.getShaderInfoLog(e),r=n.split(`
5058
5058
  `),o={},s=r.map(function(u){return parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(u){return!(!u||o[u])&&(o[u]=!0,!0)}),a=[""];s.forEach(function(u){t[u-1]="%c"+t[u-1]+"%c",a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var l=t.join(`
5059
5059
  `);a[0]=l,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function O0(i){for(var e=new Array(i),t=0;t<e.length;t++)e[t]=!1;return e}function Hb(i,e){switch(i){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return O0(2*e);case"bvec3":return O0(3*e);case"bvec4":return O0(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Dm,zb={},Zd=zb;function D2(){if(!Dm){Dm=Rs.MEDIUM;var i=function(){if(Zd===zb||Zd&&Zd.isContextLost()){var t=document.createElement("canvas"),n=void 0;Jt.PREFER_ENV>=wa.WEBGL2&&(n=t.getContext("webgl2",{})),n||((n=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?n.getExtension("WEBGL_draw_buffers"):n=null),Zd=n}return Zd}();if(i&&i.getShaderPrecisionFormat){var e=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);Dm=e.precision?Rs.HIGH:Rs.MEDIUM}}return Dm}function jb(i,e,t){if(i.substring(0,9)!=="precision"){var n=e;return e===Rs.HIGH&&t!==Rs.HIGH&&(n=Rs.MEDIUM),"precision "+n+` float;
@@ -5440,7 +5440,7 @@ void main(void)
5440
5440
  `):s.push(`
5441
5441
  renderer.shader.syncUniformGroup(uv.`+a+`, syncData);
5442
5442
  `))}return new Function("ud","uv","renderer","syncData",s.join(`
5443
- `))}(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]},i.prototype.syncUniformBufferGroup=function(e,t){var n=this.getGlProgram();if(!e.static||e.dirtyId!==0||!n.uniformGroups[e.id]){e.dirtyId=0;var r=n.uniformGroups[e.id]||this.createSyncBufferGroup(e,n,t);e.buffer.update(),r(n.uniformData,e.uniforms,this.renderer,Um,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,n.uniformBufferBindings[t])},i.prototype.createSyncBufferGroup=function(e,t,n){var r=this.renderer.gl;this.renderer.buffer.bind(e.buffer);var o=this.gl.getUniformBlockIndex(t.program,n);t.uniformBufferBindings[n]=this.shader.uniformBindCount,r.uniformBlockBinding(t.program,o,this.shader.uniformBindCount),this.shader.uniformBindCount++;var s=this.getSignature(e,this.shader.program.uniformData,"ubo"),a=this._uboCache[s];if(a||(a=this._uboCache[s]=W2(e,this.shader.program.uniformData)),e.autoManage){var l=new Float32Array(a.size/4);e.buffer.update(l)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},i.prototype.getSignature=function(e,t,n){var r=e.uniforms,o=[n+"-"];for(var s in r)o.push(s),t[s]&&o.push(t[s].type);return o.join("-")},i.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},i.prototype.generateProgram=function(e){var t=this.gl,n=e.program,r=q2(t,n);return n.glPrograms[this.renderer.CONTEXT_UID]=r,r},i.prototype.reset=function(){this.program=null,this.shader=null},i.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},i}(),i1=function(){function i(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=tn.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new Cu,this.defaultState.blend=!0}return i.prototype.contextChange=function(e){this.gl=e,this.blendModes=function(t,n){return n===void 0&&(n=[]),n[tn.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.ADD]=[t.ONE,t.ONE],n[tn.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.NONE]=[0,0],n[tn.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],n[tn.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.SRC_IN]=[t.DST_ALPHA,t.ZERO],n[tn.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],n[tn.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],n[tn.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],n[tn.DST_IN]=[t.ZERO,t.SRC_ALPHA],n[tn.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],n[tn.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],n[tn.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],n[tn.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],n}(e),this.set(this.defaultState),this.reset()},i.prototype.set=function(e){if(e=e||this.defaultState,this.stateId!==e.data){for(var t=this.stateId^e.data,n=0;t;)1&t&&this.map[n].call(this,!!(e.data&1<<n)),t>>=1,n++;this.stateId=e.data}for(n=0;n<this.checks.length;n++)this.checks[n](this,e)},i.prototype.forceState=function(e){e=e||this.defaultState;for(var t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data},i.prototype.setBlend=function(e){this.updateCheck(i.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},i.prototype.setOffset=function(e){this.updateCheck(i.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},i.prototype.setDepthTest=function(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)},i.prototype.setDepthMask=function(e){this.gl.depthMask(e)},i.prototype.setCullFace=function(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)},i.prototype.setFrontFace=function(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])},i.prototype.setBlendMode=function(e){if(e!==this.blendMode){this.blendMode=e;var t=this.blendModes[e],n=this.gl;t.length===2?n.blendFunc(t[0],t[1]):n.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,n.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD))}},i.prototype.setPolygonOffset=function(e,t){this.gl.polygonOffset(e,t)},i.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},i.prototype.updateCheck=function(e,t){var n=this.checks.indexOf(e);t&&n===-1?this.checks.push(e):t||n===-1||this.checks.splice(n,1)},i.checkBlendMode=function(e,t){e.setBlendMode(t.blendMode)},i.checkPolygonOffset=function(e,t){e.setPolygonOffset(1,t.polygonOffset)},i.prototype.destroy=function(){this.gl=null},i}(),r1=function(){function i(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Jt.GC_MAX_IDLE,this.checkCountMax=Jt.GC_MAX_CHECK_COUNT,this.mode=Jt.GC_MODE}return i.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==r0.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},i.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;r<t.length;r++){var o=t[r];!o.framebuffer&&this.count-o.touched>this.maxIdle&&(e.destroyTexture(o,!0),t[r]=null,n=!0)}if(n){var s=0;for(r=0;r<t.length;r++)t[r]!==null&&(t[s++]=t[r]);t.length=s}},i.prototype.unload=function(e){var t=this.renderer.texture,n=e._texture;n&&!n.framebuffer&&t.destroyTexture(n);for(var r=e.children.length-1;r>=0;r--)this.unload(e.children[r])},i.prototype.destroy=function(){this.renderer=null},i}(),N0=function(i){this.texture=i,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=sn.UNSIGNED_BYTE,this.internalFormat=Nt.RGBA,this.samplerType=0},o1=function(){function i(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Cn,this.hasIntegerTextures=!1}return i.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(o){var s,a,l,u,h,d,p,m,g,_,y,w,P,B,G,U,X,H,q,me,ue,oe,ce;return"WebGL2RenderingContext"in self&&o instanceof self.WebGL2RenderingContext?((s={})[sn.UNSIGNED_BYTE]=((a={})[Nt.RGBA]=o.RGBA8,a[Nt.RGB]=o.RGB8,a[Nt.RG]=o.RG8,a[Nt.RED]=o.R8,a[Nt.RGBA_INTEGER]=o.RGBA8UI,a[Nt.RGB_INTEGER]=o.RGB8UI,a[Nt.RG_INTEGER]=o.RG8UI,a[Nt.RED_INTEGER]=o.R8UI,a[Nt.ALPHA]=o.ALPHA,a[Nt.LUMINANCE]=o.LUMINANCE,a[Nt.LUMINANCE_ALPHA]=o.LUMINANCE_ALPHA,a),s[sn.BYTE]=((l={})[Nt.RGBA]=o.RGBA8_SNORM,l[Nt.RGB]=o.RGB8_SNORM,l[Nt.RG]=o.RG8_SNORM,l[Nt.RED]=o.R8_SNORM,l[Nt.RGBA_INTEGER]=o.RGBA8I,l[Nt.RGB_INTEGER]=o.RGB8I,l[Nt.RG_INTEGER]=o.RG8I,l[Nt.RED_INTEGER]=o.R8I,l),s[sn.UNSIGNED_SHORT]=((u={})[Nt.RGBA_INTEGER]=o.RGBA16UI,u[Nt.RGB_INTEGER]=o.RGB16UI,u[Nt.RG_INTEGER]=o.RG16UI,u[Nt.RED_INTEGER]=o.R16UI,u[Nt.DEPTH_COMPONENT]=o.DEPTH_COMPONENT16,u),s[sn.SHORT]=((h={})[Nt.RGBA_INTEGER]=o.RGBA16I,h[Nt.RGB_INTEGER]=o.RGB16I,h[Nt.RG_INTEGER]=o.RG16I,h[Nt.RED_INTEGER]=o.R16I,h),s[sn.UNSIGNED_INT]=((d={})[Nt.RGBA_INTEGER]=o.RGBA32UI,d[Nt.RGB_INTEGER]=o.RGB32UI,d[Nt.RG_INTEGER]=o.RG32UI,d[Nt.RED_INTEGER]=o.R32UI,d[Nt.DEPTH_COMPONENT]=o.DEPTH_COMPONENT24,d),s[sn.INT]=((p={})[Nt.RGBA_INTEGER]=o.RGBA32I,p[Nt.RGB_INTEGER]=o.RGB32I,p[Nt.RG_INTEGER]=o.RG32I,p[Nt.RED_INTEGER]=o.R32I,p),s[sn.FLOAT]=((m={})[Nt.RGBA]=o.RGBA32F,m[Nt.RGB]=o.RGB32F,m[Nt.RG]=o.RG32F,m[Nt.RED]=o.R32F,m[Nt.DEPTH_COMPONENT]=o.DEPTH_COMPONENT32F,m),s[sn.HALF_FLOAT]=((g={})[Nt.RGBA]=o.RGBA16F,g[Nt.RGB]=o.RGB16F,g[Nt.RG]=o.RG16F,g[Nt.RED]=o.R16F,g),s[sn.UNSIGNED_SHORT_5_6_5]=((_={})[Nt.RGB]=o.RGB565,_),s[sn.UNSIGNED_SHORT_4_4_4_4]=((y={})[Nt.RGBA]=o.RGBA4,y),s[sn.UNSIGNED_SHORT_5_5_5_1]=((w={})[Nt.RGBA]=o.RGB5_A1,w),s[sn.UNSIGNED_INT_2_10_10_10_REV]=((P={})[Nt.RGBA]=o.RGB10_A2,P[Nt.RGBA_INTEGER]=o.RGB10_A2UI,P),s[sn.UNSIGNED_INT_10F_11F_11F_REV]=((B={})[Nt.RGB]=o.R11F_G11F_B10F,B),s[sn.UNSIGNED_INT_5_9_9_9_REV]=((G={})[Nt.RGB]=o.RGB9_E5,G),s[sn.UNSIGNED_INT_24_8]=((U={})[Nt.DEPTH_STENCIL]=o.DEPTH24_STENCIL8,U),s[sn.FLOAT_32_UNSIGNED_INT_24_8_REV]=((X={})[Nt.DEPTH_STENCIL]=o.DEPTH32F_STENCIL8,X),ce=s):((H={})[sn.UNSIGNED_BYTE]=((q={})[Nt.RGBA]=o.RGBA,q[Nt.RGB]=o.RGB,q[Nt.ALPHA]=o.ALPHA,q[Nt.LUMINANCE]=o.LUMINANCE,q[Nt.LUMINANCE_ALPHA]=o.LUMINANCE_ALPHA,q),H[sn.UNSIGNED_SHORT_5_6_5]=((me={})[Nt.RGB]=o.RGB,me),H[sn.UNSIGNED_SHORT_4_4_4_4]=((ue={})[Nt.RGBA]=o.RGBA,ue),H[sn.UNSIGNED_SHORT_5_5_5_1]=((oe={})[Nt.RGBA]=o.RGBA,oe),ce=H),ce}(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var n=0;n<t;n++)this.boundTextures[n]=null;this.emptyTextures={};var r=new N0(e.createTexture());for(e.bindTexture(e.TEXTURE_2D,r.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=r,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new N0(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture),n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);for(e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR),n=0;n<this.boundTextures.length;n++)this.bind(null,n)},i.prototype.bind=function(e,t){t===void 0&&(t=0);var n=this.gl;if((e=e==null?void 0:e.castToBaseTexture())&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;var r=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[t]!==e&&(this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),n.bindTexture(e.target,r.texture)),r.dirtyId!==e.dirtyId&&(this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),this.updateTexture(e)),this.boundTextures[t]=e}else this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[t]=null},i.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture},i.prototype.unbind=function(e){var t=this.gl,n=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var r=0;r<n.length;r++)n[r]===this.unknownTexture&&this.bind(null,r)}for(r=0;r<n.length;r++)n[r]===e&&(this.currentLocation!==r&&(t.activeTexture(t.TEXTURE0+r),this.currentLocation=r),t.bindTexture(e.target,this.emptyTextures[e.target].texture),n[r]=null)},i.prototype.ensureSamplerType=function(e){var t=this.boundTextures,n=this.hasIntegerTextures,r=this.CONTEXT_UID;if(n)for(var o=e-1;o>=0;--o){var s=t[o];s&&s._glTextures[r].samplerType!==wm.FLOAT&&this.renderer.texture.unbind(s)}},i.prototype.initTexture=function(e){var t=new N0(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},i.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=(r=(n=this.internalFormats[e.type])===null||n===void 0?void 0:n[e.format])!==null&&r!==void 0?r:e.format,this.webGLVersion===2&&e.type===sn.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},i.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==wm.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,o=e.realHeight,s=n.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,s.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},i.prototype.destroyTexture=function(e,t){var n=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);r!==-1&&wu(this.managedTextures,r,1)}},i.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&(e.mipmap!==cl.POW2&&this.webGLVersion===2||e.isPowerOfTwo?t.mipmap=e.mipmap>=1:t.mipmap=!1,this.webGLVersion===2||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=Ta.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},i.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==cl.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Sa.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===Sa.LINEAR){var o=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Sa.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===Sa.LINEAR?n.LINEAR:n.NEAREST)},i.prototype.destroy=function(){this.renderer=null},i}(),s1={__proto__:null,FilterSystem:Lb,BatchSystem:Nb,ContextSystem:Fb,FramebufferSystem:Bb,GeometrySystem:Ub,MaskSystem:Yb,ScissorSystem:Zb,StencilSystem:Kb,ProjectionSystem:Qb,RenderTextureSystem:e1,ShaderSystem:n1,StateSystem:i1,TextureGCSystem:r1,TextureSystem:o1},D0=new Li,$2=function(i){function e(t,n){t===void 0&&(t=qd.UNKNOWN);var r=i.call(this)||this;return n=Object.assign({},Jt.RENDER_OPTIONS,n),r.options=n,r.type=t,r.screen=new wn(0,0,n.width,n.height),r.view=n.view||document.createElement("canvas"),r.resolution=n.resolution||Jt.RESOLUTION,r.useContextAlpha=n.useContextAlpha,r.autoDensity=!!n.autoDensity,r.preserveDrawingBuffer=n.preserveDrawingBuffer,r.clearBeforeRender=n.clearBeforeRender,r._backgroundColor=0,r._backgroundColorRgba=[0,0,0,1],r._backgroundColorString="#000000",r.backgroundColor=n.backgroundColor||r._backgroundColor,r.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(fl("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),r.useContextAlpha=n.transparent,r.backgroundAlpha=n.transparent?0:1),r._lastObjectRendered=null,r.plugins={},r}return Kn(e,i),e.prototype.initPlugins=function(t){for(var n in t)this.plugins[n]=new t[n](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(n*this.resolution);var r=this.view.width/this.resolution,o=this.view.height/this.resolution;this.screen.width=r,this.screen.height=o,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=o+"px"),this.emit("resize",r,o)},e.prototype.generateTexture=function(t,n,r,o){n===void 0&&(n={}),typeof n=="number"&&(fl("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),n={scaleMode:n,resolution:r,region:o});var s=n.region,a=function(u,h){var d={};for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&h.indexOf(p)<0&&(d[p]=u[p]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function"){var m=0;for(p=Object.getOwnPropertySymbols(u);m<p.length;m++)h.indexOf(p[m])<0&&(d[p[m]]=u[p[m]])}return d}(n,["region"]);(o=s||t.getLocalBounds(null,!0)).width===0&&(o.width=1),o.height===0&&(o.height=1);var l=Mo.create(bb({width:o.width,height:o.height},a));return D0.tx=-o.x,D0.ty=-o.y,this.render(t,{renderTexture:l,clear:!1,transform:D0,skipUpdateTransform:!!t.parent}),l},e.prototype.destroy=function(t){for(var n in this.plugins)this.plugins[n].destroy(),this.plugins[n]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=qd.UNKNOWN,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=u0(t),bu(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(oc.a),J2=function(i){this.buffer=i||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},Z2=function(){function i(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return i.prototype.destroy=function(){this.renderer=null},i.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},i.prototype.bind=function(e){var t=this.gl,n=this.CONTEXT_UID,r=e._glBuffers[n]||this.createGLBuffer(e);t.bindBuffer(e.type,r.buffer)},i.prototype.bindBufferBase=function(e,t){var n=this.gl,r=this.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var o=e._glBuffers[r]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,o.buffer)}},i.prototype.bindBufferRange=function(e,t,n){var r=this.gl,o=this.CONTEXT_UID;n=n||0;var s=e._glBuffers[o]||this.createGLBuffer(e);r.bindBufferRange(r.UNIFORM_BUFFER,t||0,s.buffer,256*n,256)},i.prototype.update=function(e){var t=this.gl,n=this.CONTEXT_UID,r=e._glBuffers[n];if(e._updateID!==r.updateID)if(r.updateID=e._updateID,t.bindBuffer(e.type,r.buffer),r.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var o=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;r.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,o)}},i.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},i.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n<t.length;n++)this.dispose(this.managedBuffers[t[n]],e)},i.prototype.createGLBuffer=function(e){var t=this.CONTEXT_UID,n=this.gl;return e._glBuffers[t]=new J2(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[t]},i}(),ml=function(i){function e(t){var n=i.call(this,qd.WEBGL,t)||this;return t=n.options,n.gl=null,n.CONTEXT_UID=0,n.runners={destroy:new yr("destroy"),contextChange:new yr("contextChange"),reset:new yr("reset"),update:new yr("update"),postrender:new yr("postrender"),prerender:new yr("prerender"),resize:new yr("resize")},n.runners.contextChange.add(n),n.globalUniforms=new Ru({projectionMatrix:new Li},!0),n.addSystem(Yb,"mask").addSystem(Fb,"context").addSystem(i1,"state").addSystem(n1,"shader").addSystem(o1,"texture").addSystem(Z2,"buffer").addSystem(Ub,"geometry").addSystem(Bb,"framebuffer").addSystem(Zb,"scissor").addSystem(Kb,"stencil").addSystem(Qb,"projection").addSystem(r1,"textureGC").addSystem(Lb,"filter").addSystem(e1,"renderTexture").addSystem(Nb,"batch"),n.initPlugins(e.__plugins),n.multisample=void 0,t.context?n.context.initFromContext(t.context):n.context.initFromOptions({alpha:!!n.useContextAlpha,antialias:t.antialias,premultipliedAlpha:n.useContextAlpha&&n.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:n.options.powerPreference}),n.renderingToScreen=!0,zx(n.context.webGLVersion===2?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}return Kn(e,i),e.create=function(t){if(jx())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t,n=this.gl;if(this.context.webGLVersion===1){var r=n.getParameter(n.FRAMEBUFFER_BINDING);n.bindFramebuffer(n.FRAMEBUFFER,null),t=n.getParameter(n.SAMPLES),n.bindFramebuffer(n.FRAMEBUFFER,r)}else r=n.getParameter(n.DRAW_FRAMEBUFFER_BINDING),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),t=n.getParameter(n.SAMPLES),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,r);t>=Gi.HIGH?this.multisample=Gi.HIGH:t>=Gi.MEDIUM?this.multisample=Gi.MEDIUM:t>=Gi.LOW?this.multisample=Gi.LOW:this.multisample=Gi.NONE},e.prototype.addSystem=function(t,n){var r=new t(this);if(this[n])throw new Error('Whoops! The name "'+n+'" is already in use');for(var o in this[n]=r,this.runners)this.runners[o].add(r);return this},e.prototype.render=function(t,n){var r,o,s,a;if(n&&(n instanceof Mo?(fl("6.0.0","Renderer#render arguments changed, use options instead."),r=n,o=arguments[2],s=arguments[3],a=arguments[4]):(r=n.renderTexture,o=n.clear,s=n.transform,a=n.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=s,!this.context.isLost){if(r||(this._lastObjectRendered=t),!a){var l=t.enableTempParent();t.updateTransform(),t.disableTempParent(l)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(o!==void 0?o:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(t,n,r,o){n===void 0&&(n={});var s=i.prototype.generateTexture.call(this,t,n,r,o);return this.framebuffer.blit(),s},e.prototype.resize=function(t,n){i.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();i.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return fl("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,n){e.__plugins=e.__plugins||{},e.__plugins[t]=n},e}($2),a1=`attribute vec2 aVertexPosition;
5443
+ `))}(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]},i.prototype.syncUniformBufferGroup=function(e,t){var n=this.getGlProgram();if(!e.static||e.dirtyId!==0||!n.uniformGroups[e.id]){e.dirtyId=0;var r=n.uniformGroups[e.id]||this.createSyncBufferGroup(e,n,t);e.buffer.update(),r(n.uniformData,e.uniforms,this.renderer,Um,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,n.uniformBufferBindings[t])},i.prototype.createSyncBufferGroup=function(e,t,n){var r=this.renderer.gl;this.renderer.buffer.bind(e.buffer);var o=this.gl.getUniformBlockIndex(t.program,n);t.uniformBufferBindings[n]=this.shader.uniformBindCount,r.uniformBlockBinding(t.program,o,this.shader.uniformBindCount),this.shader.uniformBindCount++;var s=this.getSignature(e,this.shader.program.uniformData,"ubo"),a=this._uboCache[s];if(a||(a=this._uboCache[s]=W2(e,this.shader.program.uniformData)),e.autoManage){var l=new Float32Array(a.size/4);e.buffer.update(l)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},i.prototype.getSignature=function(e,t,n){var r=e.uniforms,o=[n+"-"];for(var s in r)o.push(s),t[s]&&o.push(t[s].type);return o.join("-")},i.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},i.prototype.generateProgram=function(e){var t=this.gl,n=e.program,r=q2(t,n);return n.glPrograms[this.renderer.CONTEXT_UID]=r,r},i.prototype.reset=function(){this.program=null,this.shader=null},i.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},i}(),i1=function(){function i(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=tn.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new Cu,this.defaultState.blend=!0}return i.prototype.contextChange=function(e){this.gl=e,this.blendModes=function(t,n){return n===void 0&&(n=[]),n[tn.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.ADD]=[t.ONE,t.ONE],n[tn.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.NONE]=[0,0],n[tn.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],n[tn.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],n[tn.SRC_IN]=[t.DST_ALPHA,t.ZERO],n[tn.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],n[tn.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],n[tn.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],n[tn.DST_IN]=[t.ZERO,t.SRC_ALPHA],n[tn.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],n[tn.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],n[tn.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],n[tn.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],n}(e),this.set(this.defaultState),this.reset()},i.prototype.set=function(e){if(e=e||this.defaultState,this.stateId!==e.data){for(var t=this.stateId^e.data,n=0;t;)1&t&&this.map[n].call(this,!!(e.data&1<<n)),t>>=1,n++;this.stateId=e.data}for(n=0;n<this.checks.length;n++)this.checks[n](this,e)},i.prototype.forceState=function(e){e=e||this.defaultState;for(var t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data},i.prototype.setBlend=function(e){this.updateCheck(i.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},i.prototype.setOffset=function(e){this.updateCheck(i.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},i.prototype.setDepthTest=function(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)},i.prototype.setDepthMask=function(e){this.gl.depthMask(e)},i.prototype.setCullFace=function(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)},i.prototype.setFrontFace=function(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])},i.prototype.setBlendMode=function(e){if(e!==this.blendMode){this.blendMode=e;var t=this.blendModes[e],n=this.gl;t.length===2?n.blendFunc(t[0],t[1]):n.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,n.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD))}},i.prototype.setPolygonOffset=function(e,t){this.gl.polygonOffset(e,t)},i.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},i.prototype.updateCheck=function(e,t){var n=this.checks.indexOf(e);t&&n===-1?this.checks.push(e):t||n===-1||this.checks.splice(n,1)},i.checkBlendMode=function(e,t){e.setBlendMode(t.blendMode)},i.checkPolygonOffset=function(e,t){e.setPolygonOffset(1,t.polygonOffset)},i.prototype.destroy=function(){this.gl=null},i}(),r1=function(){function i(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Jt.GC_MAX_IDLE,this.checkCountMax=Jt.GC_MAX_CHECK_COUNT,this.mode=Jt.GC_MODE}return i.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==r0.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},i.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;r<t.length;r++){var o=t[r];!o.framebuffer&&this.count-o.touched>this.maxIdle&&(e.destroyTexture(o,!0),t[r]=null,n=!0)}if(n){var s=0;for(r=0;r<t.length;r++)t[r]!==null&&(t[s++]=t[r]);t.length=s}},i.prototype.unload=function(e){var t=this.renderer.texture,n=e._texture;n&&!n.framebuffer&&t.destroyTexture(n);for(var r=e.children.length-1;r>=0;r--)this.unload(e.children[r])},i.prototype.destroy=function(){this.renderer=null},i}(),N0=function(i){this.texture=i,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=sn.UNSIGNED_BYTE,this.internalFormat=Nt.RGBA,this.samplerType=0},o1=function(){function i(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Cn,this.hasIntegerTextures=!1}return i.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(o){var s,a,l,u,h,d,p,m,g,_,y,w,P,B,G,U,X,H,q,me,ue,oe,ce;return"WebGL2RenderingContext"in self&&o instanceof self.WebGL2RenderingContext?((s={})[sn.UNSIGNED_BYTE]=((a={})[Nt.RGBA]=o.RGBA8,a[Nt.RGB]=o.RGB8,a[Nt.RG]=o.RG8,a[Nt.RED]=o.R8,a[Nt.RGBA_INTEGER]=o.RGBA8UI,a[Nt.RGB_INTEGER]=o.RGB8UI,a[Nt.RG_INTEGER]=o.RG8UI,a[Nt.RED_INTEGER]=o.R8UI,a[Nt.ALPHA]=o.ALPHA,a[Nt.LUMINANCE]=o.LUMINANCE,a[Nt.LUMINANCE_ALPHA]=o.LUMINANCE_ALPHA,a),s[sn.BYTE]=((l={})[Nt.RGBA]=o.RGBA8_SNORM,l[Nt.RGB]=o.RGB8_SNORM,l[Nt.RG]=o.RG8_SNORM,l[Nt.RED]=o.R8_SNORM,l[Nt.RGBA_INTEGER]=o.RGBA8I,l[Nt.RGB_INTEGER]=o.RGB8I,l[Nt.RG_INTEGER]=o.RG8I,l[Nt.RED_INTEGER]=o.R8I,l),s[sn.UNSIGNED_SHORT]=((u={})[Nt.RGBA_INTEGER]=o.RGBA16UI,u[Nt.RGB_INTEGER]=o.RGB16UI,u[Nt.RG_INTEGER]=o.RG16UI,u[Nt.RED_INTEGER]=o.R16UI,u[Nt.DEPTH_COMPONENT]=o.DEPTH_COMPONENT16,u),s[sn.SHORT]=((h={})[Nt.RGBA_INTEGER]=o.RGBA16I,h[Nt.RGB_INTEGER]=o.RGB16I,h[Nt.RG_INTEGER]=o.RG16I,h[Nt.RED_INTEGER]=o.R16I,h),s[sn.UNSIGNED_INT]=((d={})[Nt.RGBA_INTEGER]=o.RGBA32UI,d[Nt.RGB_INTEGER]=o.RGB32UI,d[Nt.RG_INTEGER]=o.RG32UI,d[Nt.RED_INTEGER]=o.R32UI,d[Nt.DEPTH_COMPONENT]=o.DEPTH_COMPONENT24,d),s[sn.INT]=((p={})[Nt.RGBA_INTEGER]=o.RGBA32I,p[Nt.RGB_INTEGER]=o.RGB32I,p[Nt.RG_INTEGER]=o.RG32I,p[Nt.RED_INTEGER]=o.R32I,p),s[sn.FLOAT]=((m={})[Nt.RGBA]=o.RGBA32F,m[Nt.RGB]=o.RGB32F,m[Nt.RG]=o.RG32F,m[Nt.RED]=o.R32F,m[Nt.DEPTH_COMPONENT]=o.DEPTH_COMPONENT32F,m),s[sn.HALF_FLOAT]=((g={})[Nt.RGBA]=o.RGBA16F,g[Nt.RGB]=o.RGB16F,g[Nt.RG]=o.RG16F,g[Nt.RED]=o.R16F,g),s[sn.UNSIGNED_SHORT_5_6_5]=((_={})[Nt.RGB]=o.RGB565,_),s[sn.UNSIGNED_SHORT_4_4_4_4]=((y={})[Nt.RGBA]=o.RGBA4,y),s[sn.UNSIGNED_SHORT_5_5_5_1]=((w={})[Nt.RGBA]=o.RGB5_A1,w),s[sn.UNSIGNED_INT_2_10_10_10_REV]=((P={})[Nt.RGBA]=o.RGB10_A2,P[Nt.RGBA_INTEGER]=o.RGB10_A2UI,P),s[sn.UNSIGNED_INT_10F_11F_11F_REV]=((B={})[Nt.RGB]=o.R11F_G11F_B10F,B),s[sn.UNSIGNED_INT_5_9_9_9_REV]=((G={})[Nt.RGB]=o.RGB9_E5,G),s[sn.UNSIGNED_INT_24_8]=((U={})[Nt.DEPTH_STENCIL]=o.DEPTH24_STENCIL8,U),s[sn.FLOAT_32_UNSIGNED_INT_24_8_REV]=((X={})[Nt.DEPTH_STENCIL]=o.DEPTH32F_STENCIL8,X),ce=s):((H={})[sn.UNSIGNED_BYTE]=((q={})[Nt.RGBA]=o.RGBA,q[Nt.RGB]=o.RGB,q[Nt.ALPHA]=o.ALPHA,q[Nt.LUMINANCE]=o.LUMINANCE,q[Nt.LUMINANCE_ALPHA]=o.LUMINANCE_ALPHA,q),H[sn.UNSIGNED_SHORT_5_6_5]=((me={})[Nt.RGB]=o.RGB,me),H[sn.UNSIGNED_SHORT_4_4_4_4]=((ue={})[Nt.RGBA]=o.RGBA,ue),H[sn.UNSIGNED_SHORT_5_5_5_1]=((oe={})[Nt.RGBA]=o.RGBA,oe),ce=H),ce}(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var n=0;n<t;n++)this.boundTextures[n]=null;this.emptyTextures={};var r=new N0(e.createTexture());for(e.bindTexture(e.TEXTURE_2D,r.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=r,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new N0(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture),n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);for(e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR),n=0;n<this.boundTextures.length;n++)this.bind(null,n)},i.prototype.bind=function(e,t){t===void 0&&(t=0);var n=this.gl;if((e=e==null?void 0:e.castToBaseTexture())&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;var r=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[t]!==e&&(this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),n.bindTexture(e.target,r.texture)),r.dirtyId!==e.dirtyId&&(this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),this.updateTexture(e)),this.boundTextures[t]=e}else this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[t]=null},i.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture},i.prototype.unbind=function(e){var t=this.gl,n=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var r=0;r<n.length;r++)n[r]===this.unknownTexture&&this.bind(null,r)}for(r=0;r<n.length;r++)n[r]===e&&(this.currentLocation!==r&&(t.activeTexture(t.TEXTURE0+r),this.currentLocation=r),t.bindTexture(e.target,this.emptyTextures[e.target].texture),n[r]=null)},i.prototype.ensureSamplerType=function(e){var t=this.boundTextures,n=this.hasIntegerTextures,r=this.CONTEXT_UID;if(n)for(var o=e-1;o>=0;--o){var s=t[o];s&&s._glTextures[r].samplerType!==wm.FLOAT&&this.renderer.texture.unbind(s)}},i.prototype.initTexture=function(e){var t=new N0(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},i.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=(r=(n=this.internalFormats[e.type])===null||n===void 0?void 0:n[e.format])!==null&&r!==void 0?r:e.format,this.webGLVersion===2&&e.type===sn.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},i.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==wm.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,o=e.realHeight,s=n.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,s.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},i.prototype.destroyTexture=function(e,t){var n=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);r!==-1&&wu(this.managedTextures,r,1)}},i.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&(e.mipmap!==cl.POW2&&this.webGLVersion===2||e.isPowerOfTwo?t.mipmap=e.mipmap>=1:t.mipmap=!1,this.webGLVersion===2||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=Ta.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},i.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==cl.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Sa.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===Sa.LINEAR){var o=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Sa.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===Sa.LINEAR?n.LINEAR:n.NEAREST)},i.prototype.destroy=function(){this.renderer=null},i}(),s1={__proto__:null,FilterSystem:Lb,BatchSystem:Nb,ContextSystem:Fb,FramebufferSystem:Bb,GeometrySystem:Ub,MaskSystem:Yb,ScissorSystem:Zb,StencilSystem:Kb,ProjectionSystem:Qb,RenderTextureSystem:e1,ShaderSystem:n1,StateSystem:i1,TextureGCSystem:r1,TextureSystem:o1},D0=new Li,$2=function(i){function e(t,n){t===void 0&&(t=qd.UNKNOWN);var r=i.call(this)||this;return n=Object.assign({},Jt.RENDER_OPTIONS,n),r.options=n,r.type=t,r.screen=new wn(0,0,n.width,n.height),r.view=n.view||document.createElement("canvas"),r.resolution=n.resolution||Jt.RESOLUTION,r.useContextAlpha=n.useContextAlpha,r.autoDensity=!!n.autoDensity,r.preserveDrawingBuffer=n.preserveDrawingBuffer,r.clearBeforeRender=n.clearBeforeRender,r._backgroundColor=0,r._backgroundColorRgba=[0,0,0,1],r._backgroundColorString="#000000",r.backgroundColor=n.backgroundColor||r._backgroundColor,r.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(fl("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),r.useContextAlpha=n.transparent,r.backgroundAlpha=n.transparent?0:1),r._lastObjectRendered=null,r.plugins={},r}return Kn(e,i),e.prototype.initPlugins=function(t){for(var n in t)this.plugins[n]=new t[n](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(n*this.resolution);var r=this.view.width/this.resolution,o=this.view.height/this.resolution;this.screen.width=r,this.screen.height=o,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=o+"px"),this.emit("resize",r,o)},e.prototype.generateTexture=function(t,n,r,o){n===void 0&&(n={}),typeof n=="number"&&(fl("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),n={scaleMode:n,resolution:r,region:o});var s=n.region,a=function(u,h){var d={};for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&h.indexOf(p)<0&&(d[p]=u[p]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function"){var m=0;for(p=Object.getOwnPropertySymbols(u);m<p.length;m++)h.indexOf(p[m])<0&&(d[p[m]]=u[p[m]])}return d}(n,["region"]);(o=s||t.getLocalBounds(null,!0)).width===0&&(o.width=1),o.height===0&&(o.height=1);var l=Mo.create(bb({width:o.width,height:o.height},a));return D0.tx=-o.x,D0.ty=-o.y,this.render(t,{renderTexture:l,clear:!1,transform:D0,skipUpdateTransform:!!t.parent}),l},e.prototype.destroy=function(t){for(var n in this.plugins)this.plugins[n].destroy(),this.plugins[n]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=qd.UNKNOWN,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=u0(t),bu(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(oc.a),J2=function(i){this.buffer=i||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},Z2=function(){function i(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return i.prototype.destroy=function(){this.renderer=null},i.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},i.prototype.bind=function(e){var t=this.gl,n=this.CONTEXT_UID,r=e._glBuffers[n]||this.createGLBuffer(e);t.bindBuffer(e.type,r.buffer)},i.prototype.bindBufferBase=function(e,t){var n=this.gl,r=this.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var o=e._glBuffers[r]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,o.buffer)}},i.prototype.bindBufferRange=function(e,t,n){var r=this.gl,o=this.CONTEXT_UID;n=n||0;var s=e._glBuffers[o]||this.createGLBuffer(e);r.bindBufferRange(r.UNIFORM_BUFFER,t||0,s.buffer,256*n,256)},i.prototype.update=function(e){var t=this.gl,n=this.CONTEXT_UID,r=e._glBuffers[n];if(e._updateID!==r.updateID)if(r.updateID=e._updateID,t.bindBuffer(e.type,r.buffer),r.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var o=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;r.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,o)}},i.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},i.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n<t.length;n++)this.dispose(this.managedBuffers[t[n]],e)},i.prototype.createGLBuffer=function(e){var t=this.CONTEXT_UID,n=this.gl;return e._glBuffers[t]=new J2(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[t]},i}(),ml=function(i){function e(t){var n=i.call(this,qd.WEBGL,t)||this;return t=n.options,n.gl=null,n.CONTEXT_UID=0,n.runners={destroy:new yr("destroy"),contextChange:new yr("contextChange"),reset:new yr("reset"),update:new yr("update"),postrender:new yr("postrender"),prerender:new yr("prerender"),resize:new yr("resize")},n.runners.contextChange.add(n),n.globalUniforms=new Ru({projectionMatrix:new Li},!0),n.addSystem(Yb,"mask").addSystem(Fb,"context").addSystem(i1,"state").addSystem(n1,"shader").addSystem(o1,"texture").addSystem(Z2,"buffer").addSystem(Ub,"geometry").addSystem(Bb,"framebuffer").addSystem(Zb,"scissor").addSystem(Kb,"stencil").addSystem(Qb,"projection").addSystem(r1,"textureGC").addSystem(Lb,"filter").addSystem(e1,"renderTexture").addSystem(Nb,"batch"),n.initPlugins(e.__plugins),n.multisample=void 0,t.context?n.context.initFromContext(t.context):n.context.initFromOptions({alpha:!!n.useContextAlpha,antialias:t.antialias,premultipliedAlpha:n.useContextAlpha&&n.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:n.options.powerPreference}),n.renderingToScreen=!0,zx(n.context.webGLVersion===2?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}return Kn(e,i),e.create=function(t){if(jx())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t,n=this.gl;if(this.context.webGLVersion===1){var r=n.getParameter(n.FRAMEBUFFER_BINDING);n.bindFramebuffer(n.FRAMEBUFFER,null),t=n.getParameter(n.SAMPLES),n.bindFramebuffer(n.FRAMEBUFFER,r)}else r=n.getParameter(n.DRAW_FRAMEBUFFER_BINDING),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),t=n.getParameter(n.SAMPLES),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,r);t>=Hi.HIGH?this.multisample=Hi.HIGH:t>=Hi.MEDIUM?this.multisample=Hi.MEDIUM:t>=Hi.LOW?this.multisample=Hi.LOW:this.multisample=Hi.NONE},e.prototype.addSystem=function(t,n){var r=new t(this);if(this[n])throw new Error('Whoops! The name "'+n+'" is already in use');for(var o in this[n]=r,this.runners)this.runners[o].add(r);return this},e.prototype.render=function(t,n){var r,o,s,a;if(n&&(n instanceof Mo?(fl("6.0.0","Renderer#render arguments changed, use options instead."),r=n,o=arguments[2],s=arguments[3],a=arguments[4]):(r=n.renderTexture,o=n.clear,s=n.transform,a=n.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=s,!this.context.isLost){if(r||(this._lastObjectRendered=t),!a){var l=t.enableTempParent();t.updateTransform(),t.disableTempParent(l)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(o!==void 0?o:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(t,n,r,o){n===void 0&&(n={});var s=i.prototype.generateTexture.call(this,t,n,r,o);return this.framebuffer.blit(),s},e.prototype.resize=function(t,n){i.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();i.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return fl("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,n){e.__plugins=e.__plugins||{},e.__plugins[t]=n},e}($2),a1=`attribute vec2 aVertexPosition;
5444
5444
 
5445
5445
  uniform mat3 projectionMatrix;
5446
5446
 
@@ -5474,7 +5474,7 @@ else `),n<e-1&&(t+="if(vTextureId < "+n+".5)"),t+=`
5474
5474
  color = texture2D(uSamplers[`+n+"], vTextureCoord);",t+=`
5475
5475
  }`;return t+=`
5476
5476
  `,t+=`
5477
- `},i}(),l1=function(i){function e(t){t===void 0&&(t=!1);var n=i.call(this)||this;return n._buffer=new qi(null,t,!1),n._indexBuffer=new qi(null,t,!0),n.addAttribute("aVertexPosition",n._buffer,2,!1,sn.FLOAT).addAttribute("aTextureCoord",n._buffer,2,!1,sn.FLOAT).addAttribute("aColor",n._buffer,4,!0,sn.UNSIGNED_BYTE).addAttribute("aTextureId",n._buffer,1,!0,sn.FLOAT).addIndex(n._indexBuffer),n}return Kn(e,i),e}(lc),u1=`precision highp float;
5477
+ `},i}(),l1=function(i){function e(t){t===void 0&&(t=!1);var n=i.call(this)||this;return n._buffer=new Yi(null,t,!1),n._indexBuffer=new Yi(null,t,!0),n.addAttribute("aVertexPosition",n._buffer,2,!1,sn.FLOAT).addAttribute("aTextureCoord",n._buffer,2,!1,sn.FLOAT).addAttribute("aColor",n._buffer,4,!0,sn.UNSIGNED_BYTE).addAttribute("aTextureId",n._buffer,1,!0,sn.FLOAT).addIndex(n._indexBuffer),n}return Kn(e,i),e}(lc),u1=`precision highp float;
5478
5478
  attribute vec2 aVertexPosition;
5479
5479
  attribute vec2 aTextureCoord;
5480
5480
  attribute vec4 aColor;
@@ -5530,7 +5530,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
5530
5530
 
5531
5531
  See the Apache Version 2.0 License for specific language governing permissions
5532
5532
  and limitations under the License.
5533
- ***************************************************************************** */function _1(i,e){function t(){this.constructor=i}v1(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function pR(i,e){var t,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(h){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(r=2&h[0]?n.return:h[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,h[1])).done)return r;switch(n=0,r&&(h=[2&h[0],r.value]),h[0]){case 0:case 1:r=h;break;case 4:return s.label++,{value:h[1],done:!1};case 5:s.label++,n=h[1],h=[0];continue;case 7:h=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||h[0]!==6&&h[0]!==2)){s=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){s.label=h[1];break}if(h[0]===6&&s.label<r[1]){s.label=r[1],r=h;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(h);break}r[2]&&s.ops.pop(),s.trys.pop();continue}h=e.call(i,s)}catch(d){h=[6,d],n=0}finally{t=r=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([l,u])}}}var jm,Is,z0=function(i){function e(t,n){var r=i.call(this,t,n)||this;return r.format=n.format,r.levels=n.levels||1,r._width=n.width,r._height=n.height,r._extension=e._formatToExtension(r.format),(n.levelBuffers||r.buffer)&&(r._levelBuffers=n.levelBuffers||e._createLevelBuffers(t instanceof Uint8Array?t:r.buffer.uint8View,r.format,r.levels,4,4,r.width,r.height)),r}return _1(e,i),e.prototype.upload=function(t,n,r){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,h=l.levelWidth,d=l.levelHeight,p=l.levelBuffer;o.compressedTexImage2D(o.TEXTURE_2D,u,this.format,h,d,0,p)}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,r,o,s,a,l){for(var u=new Array(r),h=t.byteOffset,d=a,p=l,m=d+o-1&~(o-1),g=p+s-1&~(s-1),_=m*g*zm[n],y=0;y<r;y++)u[y]={levelID:y,levelWidth:r>1?d:m,levelHeight:r>1?p:g,levelBuffer:new Uint8Array(t.buffer,h,_)},h+=_,_=(m=(d=d>>1||1)+o-1&~(o-1))*(g=(p=p>>1||1)+s-1&~(s-1))*zm[n];return u},e}(function(i){function e(t,n){n===void 0&&(n={width:1,height:1,autoLoad:!0});var r,o,s=this;return typeof t=="string"?(r=t,o=new Uint8Array):(r=null,o=t),(s=i.call(this,o,n)||this).origin=r,s.buffer=o?new U0(o):null,s.origin&&n.autoLoad!==!1&&s.load(),o&&o.length&&(s.loaded=!0,s.onBlobLoaded(s.buffer.rawBinaryData)),s}return _1(e,i),e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return t=this,n=void 0,o=function(){var s;return pR(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 U0(s),this.loaded=!0,this.onBlobLoaded(s),this.update(),[2,this]}})},new((r=Promise)||(r=Promise))(function(s,a){function l(d){try{h(o.next(d))}catch(p){a(p)}}function u(d){try{h(o.throw(d))}catch(p){a(p)}}function h(d){d.done?s(d.value):new r(function(p){p(d.value)}).then(l,u)}h((o=o.apply(t,n||[])).next())});var t,n,r,o},e}(Jd)),fR=function(){function i(){}return i.use=function(e,t){var n=e.data;if(e.type===Ti.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var r=n.textures,o=void 0,s=void 0,a=0,l=r.length;a<l;a++){var u=r[a],h=u.src,d=u.format;if(d||(s=h),i.textureFormats[d]){o=h;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 p={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},m=xu.resolve(e.url.replace(this.baseUrl,""),o),g=n.cacheID;this.add(g,m,p,function(_){if(_.error)t(_.error);else{var y=_.texture,w=y===void 0?null:y,P=_.textures,B=P===void 0?{}:P;Object.assign(e,{texture:w,textures:B}),t()}})}else t()},i.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 i.textureExtensions=t,i.textureFormats={},t){var r=t[n];r&&Object.assign(i.textureFormats,Object.getPrototypeOf(r))}}else console.warn("WebGL not available for compressed textures. Silently failing.")},i}();function y1(i,e,t){var n={textures:{},texture:null};return e&&e.map(function(r){return new nn(new Cn(r,Object.assign({mipmap:cl.OFF,alphaMode:As.NO_PREMULTIPLIED_ALPHA},t)))}).forEach(function(r,o){var s=r.baseTexture,a=i+"-"+(o+1);Cn.addToCache(s,a),nn.addToCache(r,a),o===0&&(Cn.addToCache(s,i),nn.addToCache(r,i),n.texture=r),n.textures[a]=r}),n}Ti.setExtensionXhrType("dds",Ti.XHR_RESPONSE_TYPE.BUFFER);var ts,j0,mR=3,gR=4,vR=7,_R=19,yR=2,xR=0,bR=1,wR=2,SR=3;(function(i){i[i.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",i[i.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",i[i.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",i[i.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",i[i.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",i[i.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",i[i.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",i[i.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",i[i.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",i[i.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",i[i.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",i[i.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",i[i.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",i[i.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",i[i.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",i[i.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",i[i.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",i[i.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",i[i.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",i[i.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",i[i.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",i[i.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",i[i.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",i[i.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",i[i.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",i[i.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",i[i.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",i[i.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",i[i.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",i[i.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",i[i.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",i[i.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",i[i.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",i[i.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",i[i.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",i[i.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",i[i.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",i[i.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",i[i.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",i[i.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",i[i.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",i[i.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",i[i.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",i[i.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",i[i.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",i[i.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",i[i.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",i[i.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",i[i.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",i[i.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",i[i.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",i[i.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",i[i.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",i[i.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",i[i.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",i[i.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",i[i.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",i[i.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",i[i.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",i[i.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",i[i.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",i[i.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",i[i.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",i[i.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",i[i.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",i[i.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",i[i.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",i[i.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",i[i.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",i[i.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",i[i.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",i[i.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",i[i.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",i[i.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",i[i.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",i[i.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",i[i.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",i[i.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",i[i.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",i[i.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",i[i.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",i[i.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",i[i.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",i[i.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",i[i.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",i[i.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",i[i.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",i[i.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",i[i.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",i[i.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",i[i.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",i[i.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",i[i.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",i[i.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",i[i.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",i[i.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",i[i.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",i[i.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",i[i.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",i[i.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",i[i.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",i[i.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",i[i.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",i[i.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",i[i.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",i[i.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",i[i.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",i[i.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",i[i.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",i[i.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",i[i.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",i[i.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",i[i.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",i[i.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",i[i.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",i[i.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",i[i.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",i[i.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",i[i.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",i[i.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",i[i.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",i[i.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(ts||(ts={})),function(i){i[i.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",i[i.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",i[i.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"}(j0||(j0={}));var tp,hc,Vm,TR=((jm={})[827611204]=_n.COMPRESSED_RGBA_S3TC_DXT1_EXT,jm[861165636]=_n.COMPRESSED_RGBA_S3TC_DXT3_EXT,jm[894720068]=_n.COMPRESSED_RGBA_S3TC_DXT5_EXT,jm),ER=((Is={})[ts.DXGI_FORMAT_BC1_TYPELESS]=_n.COMPRESSED_RGBA_S3TC_DXT1_EXT,Is[ts.DXGI_FORMAT_BC1_UNORM]=_n.COMPRESSED_RGBA_S3TC_DXT1_EXT,Is[ts.DXGI_FORMAT_BC2_TYPELESS]=_n.COMPRESSED_RGBA_S3TC_DXT3_EXT,Is[ts.DXGI_FORMAT_BC2_UNORM]=_n.COMPRESSED_RGBA_S3TC_DXT3_EXT,Is[ts.DXGI_FORMAT_BC3_TYPELESS]=_n.COMPRESSED_RGBA_S3TC_DXT5_EXT,Is[ts.DXGI_FORMAT_BC3_UNORM]=_n.COMPRESSED_RGBA_S3TC_DXT5_EXT,Is[ts.DXGI_FORMAT_BC1_UNORM_SRGB]=_n.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,Is[ts.DXGI_FORMAT_BC2_UNORM_SRGB]=_n.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,Is[ts.DXGI_FORMAT_BC3_UNORM_SRGB]=_n.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,Is),MR=function(){function i(){}return i.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,y1(e.name||e.url,i.parse(e.data),e.metadata))}catch(n){return void t(n)}t()},i.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),r=n[mR],o=n[gR],s=n[vR],a=new Uint32Array(e,_R*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),l=a[1];if(4&l){var u=a[yR];if(u!==808540228){var h=TR[u],d=new Uint8Array(e,128);return[new z0(d,{format:h,width:o,height:r,levels:s})]}var p=new Uint32Array(t.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),m=p[xR],g=p[bR],_=p[wR],y=p[SR],w=ER[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===j0.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSLoader does not supported 3D texture data");var P=new Array;if(y===1)P.push(new Uint8Array(e,148));else{for(var B=zm[w],G=0,U=o,X=r,H=0;H<s;H++)G+=Math.max(1,U+3&-4)*Math.max(1,X+3&-4)*B,U>>>=1,X>>>=1;var q=148;for(H=0;H<y;H++)P.push(new Uint8Array(e,q,G)),q+=G}return P.map(function(me){return new z0(me,{format:w,width:o,height:r,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!")},i}();Ti.setExtensionXhrType("ktx",Ti.XHR_RESPONSE_TYPE.BUFFER);var x1=[171,75,84,88,32,49,49,187,13,10,26,10],AR=12,RR=16,CR=24,PR=28,IR=36,OR=40,LR=44,NR=48,DR=52,FR=56,BR=60,b1=((tp={})[sn.UNSIGNED_BYTE]=1,tp[sn.UNSIGNED_SHORT]=2,tp[sn.FLOAT]=4,tp[sn.HALF_FLOAT]=8,tp),UR=((hc={})[Nt.RGBA]=4,hc[Nt.RGB]=3,hc[Nt.LUMINANCE]=1,hc[Nt.LUMINANCE_ALPHA]=2,hc[Nt.ALPHA]=1,hc),kR=((Vm={})[sn.UNSIGNED_SHORT_4_4_4_4]=2,Vm[sn.UNSIGNED_SHORT_5_5_5_1]=2,Vm[sn.UNSIGNED_SHORT_5_6_5]=2,Vm),GR=function(){function i(){}return i.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var n=e.name||e.url;Object.assign(e,y1(n,i.parse(n,e.data),e.metadata))}catch(r){return void t(r)}t()},i.parse=function(e,t){var n=new DataView(t);if(!i.validate(e,n))return null;var r=n.getUint32(AR,!0)===67305985,o=n.getUint32(RR,r),s=n.getUint32(CR,r),a=n.getUint32(PR,r),l=n.getUint32(IR,r),u=n.getUint32(OR,r)||1,h=n.getUint32(LR,r)||1,d=n.getUint32(NR,r)||1,p=n.getUint32(DR,r),m=n.getUint32(FR,r),g=n.getUint32(BR,r);if(u===0||h!==1)throw new Error("Only 2D textures are supported");if(p!==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,P=new Array(d),B=l*u;if(o===0&&(B=y*w),(_=o!==0?b1[o]?b1[o]*UR[s]:kR[o]:zm[a])===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var G=B*_,U=l,X=u,H=y,q=w,me=64+g,ue=0;ue<m;ue++){for(var oe=n.getUint32(me,r),ce=me+4,le=0;le<d;le++){var _e=P[le];_e||(_e=P[le]=new Array(m)),_e[ue]={levelID:ue,levelWidth:m>1?U:H,levelHeight:m>1?X:q,levelBuffer:new Uint8Array(t,ce,G)},ce+=G}me=(me+=oe+4)%4!=0?me+4-me%4:me,G=(H=(U=U>>1||1)+4-1&-4)*(q=(X=X>>1||1)+4-1&-4)*_}if(o!==0)throw new Error("TODO: Uncompressed");return P.map(function(je){return new z0(null,{format:a,width:l,height:u,levels:m,levelBuffers:je})})},i.validate=function(e,t){for(var n=0;n<x1.length;n++)if(t.getUint8(n)!==x1[n])return console.error(e+" is not a valid *.ktx file!"),!1;return!0},i}(),w1=function(i,e){return(w1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(i,e)};function S1(i,e){function t(){this.constructor=i}w1(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(i){function e(t,n,r,o){t===void 0&&(t=1500),r===void 0&&(r=16384),o===void 0&&(o=!1);var s=i.call(this)||this;return r>16384&&(r=16384),s._properties=[!1,!0,!1,!1,!1],s._maxSize=t,s._batchSize=r,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=tn.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}S1(e,i),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,bu(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){i.prototype.destroy.call(this,t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}})(er);var gl,vl,T1=function(){function i(e,t,n){this.geometry=new lc,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(var r=0;r<e.length;++r){var o=e[r];o={attributeName:o.attributeName,size:o.size,uploadFunction:o.uploadFunction,type:o.type||sn.FLOAT,offset:o.offset},t[r]?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 i.prototype.initBuffers=function(){var e=this.geometry,t=0;this.indexBuffer=new qi(Wx(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 r=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(r),this.dynamicDataUint32=new Uint32Array(r),this.dynamicBuffer=new qi(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 qi(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===sn.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===sn.UNSIGNED_BYTE,a.type,4*this.staticStride,4*a.offset)},i.prototype.uploadDynamic=function(e,t,n){for(var r=0;r<this.dynamicProperties.length;r++){var o=this.dynamicProperties[r];o.uploadFunction(e,t,n,o.type===sn.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},i.prototype.uploadStatic=function(e,t,n){for(var r=0;r<this.staticProperties.length;r++){var o=this.staticProperties[r];o.uploadFunction(e,t,n,o.type===sn.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},i.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()},i}(),HR=function(i){function e(t){var n=i.call(this,t)||this;return n.shader=null,n.properties=null,n.tempMatrix=new Li,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:sn.UNSIGNED_BYTE,uploadFunction:n.uploadTint,offset:0}],n.shader=Ma.from(`attribute vec2 aVertexPosition;
5533
+ ***************************************************************************** */function _1(i,e){function t(){this.constructor=i}v1(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function pR(i,e){var t,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(h){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(r=2&h[0]?n.return:h[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,h[1])).done)return r;switch(n=0,r&&(h=[2&h[0],r.value]),h[0]){case 0:case 1:r=h;break;case 4:return s.label++,{value:h[1],done:!1};case 5:s.label++,n=h[1],h=[0];continue;case 7:h=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||h[0]!==6&&h[0]!==2)){s=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){s.label=h[1];break}if(h[0]===6&&s.label<r[1]){s.label=r[1],r=h;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(h);break}r[2]&&s.ops.pop(),s.trys.pop();continue}h=e.call(i,s)}catch(d){h=[6,d],n=0}finally{t=r=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([l,u])}}}var jm,Is,z0=function(i){function e(t,n){var r=i.call(this,t,n)||this;return r.format=n.format,r.levels=n.levels||1,r._width=n.width,r._height=n.height,r._extension=e._formatToExtension(r.format),(n.levelBuffers||r.buffer)&&(r._levelBuffers=n.levelBuffers||e._createLevelBuffers(t instanceof Uint8Array?t:r.buffer.uint8View,r.format,r.levels,4,4,r.width,r.height)),r}return _1(e,i),e.prototype.upload=function(t,n,r){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,h=l.levelWidth,d=l.levelHeight,p=l.levelBuffer;o.compressedTexImage2D(o.TEXTURE_2D,u,this.format,h,d,0,p)}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,r,o,s,a,l){for(var u=new Array(r),h=t.byteOffset,d=a,p=l,m=d+o-1&~(o-1),g=p+s-1&~(s-1),_=m*g*zm[n],y=0;y<r;y++)u[y]={levelID:y,levelWidth:r>1?d:m,levelHeight:r>1?p:g,levelBuffer:new Uint8Array(t.buffer,h,_)},h+=_,_=(m=(d=d>>1||1)+o-1&~(o-1))*(g=(p=p>>1||1)+s-1&~(s-1))*zm[n];return u},e}(function(i){function e(t,n){n===void 0&&(n={width:1,height:1,autoLoad:!0});var r,o,s=this;return typeof t=="string"?(r=t,o=new Uint8Array):(r=null,o=t),(s=i.call(this,o,n)||this).origin=r,s.buffer=o?new U0(o):null,s.origin&&n.autoLoad!==!1&&s.load(),o&&o.length&&(s.loaded=!0,s.onBlobLoaded(s.buffer.rawBinaryData)),s}return _1(e,i),e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return t=this,n=void 0,o=function(){var s;return pR(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 U0(s),this.loaded=!0,this.onBlobLoaded(s),this.update(),[2,this]}})},new((r=Promise)||(r=Promise))(function(s,a){function l(d){try{h(o.next(d))}catch(p){a(p)}}function u(d){try{h(o.throw(d))}catch(p){a(p)}}function h(d){d.done?s(d.value):new r(function(p){p(d.value)}).then(l,u)}h((o=o.apply(t,n||[])).next())});var t,n,r,o},e}(Jd)),fR=function(){function i(){}return i.use=function(e,t){var n=e.data;if(e.type===Ti.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var r=n.textures,o=void 0,s=void 0,a=0,l=r.length;a<l;a++){var u=r[a],h=u.src,d=u.format;if(d||(s=h),i.textureFormats[d]){o=h;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 p={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},m=xu.resolve(e.url.replace(this.baseUrl,""),o),g=n.cacheID;this.add(g,m,p,function(_){if(_.error)t(_.error);else{var y=_.texture,w=y===void 0?null:y,P=_.textures,B=P===void 0?{}:P;Object.assign(e,{texture:w,textures:B}),t()}})}else t()},i.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 i.textureExtensions=t,i.textureFormats={},t){var r=t[n];r&&Object.assign(i.textureFormats,Object.getPrototypeOf(r))}}else console.warn("WebGL not available for compressed textures. Silently failing.")},i}();function y1(i,e,t){var n={textures:{},texture:null};return e&&e.map(function(r){return new nn(new Cn(r,Object.assign({mipmap:cl.OFF,alphaMode:As.NO_PREMULTIPLIED_ALPHA},t)))}).forEach(function(r,o){var s=r.baseTexture,a=i+"-"+(o+1);Cn.addToCache(s,a),nn.addToCache(r,a),o===0&&(Cn.addToCache(s,i),nn.addToCache(r,i),n.texture=r),n.textures[a]=r}),n}Ti.setExtensionXhrType("dds",Ti.XHR_RESPONSE_TYPE.BUFFER);var ts,j0,mR=3,gR=4,vR=7,_R=19,yR=2,xR=0,bR=1,wR=2,SR=3;(function(i){i[i.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",i[i.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",i[i.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",i[i.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",i[i.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",i[i.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",i[i.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",i[i.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",i[i.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",i[i.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",i[i.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",i[i.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",i[i.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",i[i.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",i[i.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",i[i.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",i[i.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",i[i.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",i[i.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",i[i.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",i[i.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",i[i.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",i[i.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",i[i.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",i[i.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",i[i.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",i[i.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",i[i.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",i[i.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",i[i.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",i[i.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",i[i.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",i[i.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",i[i.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",i[i.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",i[i.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",i[i.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",i[i.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",i[i.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",i[i.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",i[i.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",i[i.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",i[i.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",i[i.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",i[i.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",i[i.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",i[i.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",i[i.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",i[i.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",i[i.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",i[i.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",i[i.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",i[i.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",i[i.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",i[i.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",i[i.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",i[i.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",i[i.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",i[i.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",i[i.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",i[i.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",i[i.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",i[i.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",i[i.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",i[i.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",i[i.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",i[i.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",i[i.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",i[i.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",i[i.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",i[i.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",i[i.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",i[i.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",i[i.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",i[i.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",i[i.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",i[i.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",i[i.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",i[i.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",i[i.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",i[i.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",i[i.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",i[i.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",i[i.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",i[i.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",i[i.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",i[i.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",i[i.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",i[i.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",i[i.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",i[i.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",i[i.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",i[i.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",i[i.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",i[i.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",i[i.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",i[i.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",i[i.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",i[i.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",i[i.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",i[i.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",i[i.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",i[i.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",i[i.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",i[i.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",i[i.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",i[i.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",i[i.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",i[i.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",i[i.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",i[i.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",i[i.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",i[i.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",i[i.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",i[i.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",i[i.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",i[i.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",i[i.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",i[i.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",i[i.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",i[i.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",i[i.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(ts||(ts={})),function(i){i[i.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",i[i.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",i[i.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"}(j0||(j0={}));var tp,hc,Vm,TR=((jm={})[827611204]=_n.COMPRESSED_RGBA_S3TC_DXT1_EXT,jm[861165636]=_n.COMPRESSED_RGBA_S3TC_DXT3_EXT,jm[894720068]=_n.COMPRESSED_RGBA_S3TC_DXT5_EXT,jm),ER=((Is={})[ts.DXGI_FORMAT_BC1_TYPELESS]=_n.COMPRESSED_RGBA_S3TC_DXT1_EXT,Is[ts.DXGI_FORMAT_BC1_UNORM]=_n.COMPRESSED_RGBA_S3TC_DXT1_EXT,Is[ts.DXGI_FORMAT_BC2_TYPELESS]=_n.COMPRESSED_RGBA_S3TC_DXT3_EXT,Is[ts.DXGI_FORMAT_BC2_UNORM]=_n.COMPRESSED_RGBA_S3TC_DXT3_EXT,Is[ts.DXGI_FORMAT_BC3_TYPELESS]=_n.COMPRESSED_RGBA_S3TC_DXT5_EXT,Is[ts.DXGI_FORMAT_BC3_UNORM]=_n.COMPRESSED_RGBA_S3TC_DXT5_EXT,Is[ts.DXGI_FORMAT_BC1_UNORM_SRGB]=_n.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,Is[ts.DXGI_FORMAT_BC2_UNORM_SRGB]=_n.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,Is[ts.DXGI_FORMAT_BC3_UNORM_SRGB]=_n.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,Is),MR=function(){function i(){}return i.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,y1(e.name||e.url,i.parse(e.data),e.metadata))}catch(n){return void t(n)}t()},i.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),r=n[mR],o=n[gR],s=n[vR],a=new Uint32Array(e,_R*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),l=a[1];if(4&l){var u=a[yR];if(u!==808540228){var h=TR[u],d=new Uint8Array(e,128);return[new z0(d,{format:h,width:o,height:r,levels:s})]}var p=new Uint32Array(t.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),m=p[xR],g=p[bR],_=p[wR],y=p[SR],w=ER[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===j0.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSLoader does not supported 3D texture data");var P=new Array;if(y===1)P.push(new Uint8Array(e,148));else{for(var B=zm[w],G=0,U=o,X=r,H=0;H<s;H++)G+=Math.max(1,U+3&-4)*Math.max(1,X+3&-4)*B,U>>>=1,X>>>=1;var q=148;for(H=0;H<y;H++)P.push(new Uint8Array(e,q,G)),q+=G}return P.map(function(me){return new z0(me,{format:w,width:o,height:r,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!")},i}();Ti.setExtensionXhrType("ktx",Ti.XHR_RESPONSE_TYPE.BUFFER);var x1=[171,75,84,88,32,49,49,187,13,10,26,10],AR=12,RR=16,CR=24,PR=28,IR=36,OR=40,LR=44,NR=48,DR=52,FR=56,BR=60,b1=((tp={})[sn.UNSIGNED_BYTE]=1,tp[sn.UNSIGNED_SHORT]=2,tp[sn.FLOAT]=4,tp[sn.HALF_FLOAT]=8,tp),UR=((hc={})[Nt.RGBA]=4,hc[Nt.RGB]=3,hc[Nt.LUMINANCE]=1,hc[Nt.LUMINANCE_ALPHA]=2,hc[Nt.ALPHA]=1,hc),kR=((Vm={})[sn.UNSIGNED_SHORT_4_4_4_4]=2,Vm[sn.UNSIGNED_SHORT_5_5_5_1]=2,Vm[sn.UNSIGNED_SHORT_5_6_5]=2,Vm),GR=function(){function i(){}return i.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var n=e.name||e.url;Object.assign(e,y1(n,i.parse(n,e.data),e.metadata))}catch(r){return void t(r)}t()},i.parse=function(e,t){var n=new DataView(t);if(!i.validate(e,n))return null;var r=n.getUint32(AR,!0)===67305985,o=n.getUint32(RR,r),s=n.getUint32(CR,r),a=n.getUint32(PR,r),l=n.getUint32(IR,r),u=n.getUint32(OR,r)||1,h=n.getUint32(LR,r)||1,d=n.getUint32(NR,r)||1,p=n.getUint32(DR,r),m=n.getUint32(FR,r),g=n.getUint32(BR,r);if(u===0||h!==1)throw new Error("Only 2D textures are supported");if(p!==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,P=new Array(d),B=l*u;if(o===0&&(B=y*w),(_=o!==0?b1[o]?b1[o]*UR[s]:kR[o]:zm[a])===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var G=B*_,U=l,X=u,H=y,q=w,me=64+g,ue=0;ue<m;ue++){for(var oe=n.getUint32(me,r),ce=me+4,le=0;le<d;le++){var _e=P[le];_e||(_e=P[le]=new Array(m)),_e[ue]={levelID:ue,levelWidth:m>1?U:H,levelHeight:m>1?X:q,levelBuffer:new Uint8Array(t,ce,G)},ce+=G}me=(me+=oe+4)%4!=0?me+4-me%4:me,G=(H=(U=U>>1||1)+4-1&-4)*(q=(X=X>>1||1)+4-1&-4)*_}if(o!==0)throw new Error("TODO: Uncompressed");return P.map(function(je){return new z0(null,{format:a,width:l,height:u,levels:m,levelBuffers:je})})},i.validate=function(e,t){for(var n=0;n<x1.length;n++)if(t.getUint8(n)!==x1[n])return console.error(e+" is not a valid *.ktx file!"),!1;return!0},i}(),w1=function(i,e){return(w1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(i,e)};function S1(i,e){function t(){this.constructor=i}w1(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(i){function e(t,n,r,o){t===void 0&&(t=1500),r===void 0&&(r=16384),o===void 0&&(o=!1);var s=i.call(this)||this;return r>16384&&(r=16384),s._properties=[!1,!0,!1,!1,!1],s._maxSize=t,s._batchSize=r,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=tn.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}S1(e,i),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,bu(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){i.prototype.destroy.call(this,t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}})(er);var gl,vl,T1=function(){function i(e,t,n){this.geometry=new lc,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(var r=0;r<e.length;++r){var o=e[r];o={attributeName:o.attributeName,size:o.size,uploadFunction:o.uploadFunction,type:o.type||sn.FLOAT,offset:o.offset},t[r]?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 i.prototype.initBuffers=function(){var e=this.geometry,t=0;this.indexBuffer=new Yi(Wx(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 r=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(r),this.dynamicDataUint32=new Uint32Array(r),this.dynamicBuffer=new Yi(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 Yi(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===sn.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===sn.UNSIGNED_BYTE,a.type,4*this.staticStride,4*a.offset)},i.prototype.uploadDynamic=function(e,t,n){for(var r=0;r<this.dynamicProperties.length;r++){var o=this.dynamicProperties[r];o.uploadFunction(e,t,n,o.type===sn.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},i.prototype.uploadStatic=function(e,t,n){for(var r=0;r<this.staticProperties.length;r++){var o=this.staticProperties[r];o.uploadFunction(e,t,n,o.type===sn.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},i.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()},i}(),HR=function(i){function e(t){var n=i.call(this,t)||this;return n.shader=null,n.properties=null,n.tempMatrix=new Li,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:sn.UNSIGNED_BYTE,uploadFunction:n.uploadTint,offset:0}],n.shader=Ma.from(`attribute vec2 aVertexPosition;
5534
5534
  attribute vec2 aTextureCoord;
5535
5535
  attribute vec4 aColor;
5536
5536
 
@@ -5721,7 +5721,7 @@ void main(void)
5721
5721
  {
5722
5722
  gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
5723
5723
  }
5724
- `),o)||this)._colorDirty=!1,r.uvMatrix=new L0(t),r.batchable=n.program===void 0,r.pluginName=n.pluginName,r.tint=n.tint,r.alpha=n.alpha,r}return J0(e,i),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;p0(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(Ma),$m=function(i){function e(t,n,r){var o=i.call(this)||this,s=new qi(t),a=new qi(n,!0),l=new qi(r,!0,!0);return o.addAttribute("aVertexPosition",s,2,!1,sn.FLOAT).addAttribute("aTextureCoord",a,2,!1,sn.FLOAT).addIndex(l),o._updateId=-1,o}return J0(e,i),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(lc),q1=function(i,e){return(q1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(i,e)},Jm=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},mC=function(){function i(){}return i.test=function(e){return typeof e=="string"&&e.indexOf("info face=")===0},i.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var r in t){var o=t[r].match(/^[a-z]+/gm)[0],s=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var l in s){var u=s[l].split("="),h=u[0],d=u[1].replace(/"/gm,""),p=parseFloat(d),m=isNaN(p)?d:p;a[h]=m}n[o].push(a)}var g=new Jm;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)})}),n.distanceField.forEach(function(_){return g.distanceField.push({distanceRange:parseInt(_.distanceRange,10),fieldType:_.fieldType})}),g},i}(),K0=function(){function i(){}return i.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},i.parse=function(e){for(var t=new Jm,n=e.getElementsByTagName("info"),r=e.getElementsByTagName("common"),o=e.getElementsByTagName("page"),s=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),l=e.getElementsByTagName("distanceField"),u=0;u<n.length;u++)t.info.push({face:n[u].getAttribute("face"),size:parseInt(n[u].getAttribute("size"),10)});for(u=0;u<r.length;u++)t.common.push({lineHeight:parseInt(r[u].getAttribute("lineHeight"),10)});for(u=0;u<o.length;u++)t.page.push({id:parseInt(o[u].getAttribute("id"),10)||0,file:o[u].getAttribute("file")});for(u=0;u<s.length;u++){var h=s[u];t.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(u=0;u<a.length;u++)t.kerning.push({first:parseInt(a[u].getAttribute("first"),10),second:parseInt(a[u].getAttribute("second"),10),amount:parseInt(a[u].getAttribute("amount"),10)});for(u=0;u<l.length;u++)t.distanceField.push({fieldType:l[u].getAttribute("fieldType"),distanceRange:parseInt(l[u].getAttribute("distanceRange"),10)});return t},i}(),gC=function(){function i(){}return i.test=function(e){if(typeof e=="string"&&e.indexOf("<font>")>-1){var t=new self.DOMParser().parseFromString(e,"text/xml");return K0.test(t)}return!1},i.parse=function(e){var t=new self.DOMParser().parseFromString(e,"text/xml");return K0.parse(t)},i}(),Q0=[mC,K0,gC];function Y1(i){for(var e=0;e<Q0.length;e++)if(Q0[e].test(i))return Q0[e];return null}function vC(i,e,t,n,r,o,s){var a=t.text,l=t.fontProperties;e.translate(n,r),e.scale(o,o);var u=s.strokeThickness/2,h=-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=function(m,g,_,y,w,P){var B,G=_.fill;if(!Array.isArray(G))return G;if(G.length===1)return G[0];var U=_.dropShadow?_.dropShadowDistance:0,X=_.padding||0,H=m.width/y-U-2*X,q=m.height/y-U-2*X,me=G.slice(),ue=_.fillGradientStops.slice();if(!ue.length)for(var oe=me.length+1,ce=1;ce<oe;++ce)ue.push(ce/oe);if(me.unshift(G[0]),ue.unshift(0),me.push(G[G.length-1]),ue.push(1),_.fillGradientType===ip.LINEAR_VERTICAL){B=g.createLinearGradient(H/2,X,H/2,q+X);var le=0,_e=(P.fontProperties.fontSize+_.strokeThickness)/q;for(ce=0;ce<w.length;ce++)for(var je=P.lineHeight*ce,ke=0;ke<me.length;ke++){var Ee=je/q+(typeof ue[ke]=="number"?ue[ke]:ke/me.length)*_e,Ae=Math.max(le,Ee);Ae=Math.min(Ae,1),B.addColorStop(Ae,me[ke]),le=Ae}}else{B=g.createLinearGradient(X,q/2,H+X,q/2);var Je=me.length+1,st=1;for(ce=0;ce<me.length;ce++){var ct=void 0;ct=typeof ue[ce]=="number"?ue[ce]:st/Je,B.addColorStop(ct,me[ce]),st++}}return B}(i,e,s,o,[a],t),e.strokeStyle=s.stroke;var d=s.dropShadowColor,p=bu(typeof d=="number"?d:h0(d));s.dropShadow?(e.shadowColor="rgba("+255*p[0]+","+255*p[1]+","+255*p[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,h+t.lineHeight-l.descent),s.fill&&e.fillText(a,u,h+t.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function $1(i){return Array.from?Array.from(i):i.split("")}function Zm(i){return i.codePointAt?i.codePointAt(0):i.charCodeAt(0)}var vc=function(){function i(e,t,n){var r,o,s=e.info[0],a=e.common[0],l=e.page[0],u=e.distanceField[0],h=$d(l.file),d={};this._ownsTextures=n,this.font=s.face,this.size=s.size,this.lineHeight=a.lineHeight/h,this.chars={},this.pageTextures=d;for(var p=0;p<e.page.length;p++){var m=e.page[p],g=m.id,_=m.file;d[g]=t instanceof Array?t[p]:t[_],(u==null?void 0:u.fieldType)&&u.fieldType!=="none"&&(d[g].baseTexture.alphaMode=As.NO_PREMULTIPLIED_ALPHA)}for(p=0;p<e.char.length;p++){var y=e.char[p],w=(g=y.id,y.page),P=e.char[p],B=P.x,G=P.y,U=P.width,X=P.height,H=P.xoffset,q=P.yoffset,me=P.xadvance;G/=h,U/=h,X/=h,H/=h,q/=h,me/=h;var ue=new wn((B/=h)+d[w].frame.x/h,G+d[w].frame.y/h,U,X);this.chars[g]={xOffset:H,yOffset:q,xAdvance:me,kerning:{},texture:new nn(d[w].baseTexture,ue),page:w}}for(p=0;p<e.kerning.length;p++){var oe=e.kerning[p],ce=oe.first,le=oe.second,_e=oe.amount;ce/=h,le/=h,_e/=h,this.chars[le]&&(this.chars[le].kerning[ce]=_e)}this.distanceFieldRange=u==null?void 0:u.distanceRange,this.distanceFieldType=(o=(r=u==null?void 0:u.fieldType)===null||r===void 0?void 0:r.toLowerCase())!==null&&o!==void 0?o:"none"}return i.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},i.install=function(e,t,n){var r;if(e instanceof Jm)r=e;else{var o=Y1(e);if(!o)throw new Error("Unrecognized data format for font.");r=o.parse(e)}t instanceof nn&&(t=[t]);var s=new i(r,t,n);return i.available[s.font]=s,s},i.uninstall=function(e){var t=i.available[e];if(!t)throw new Error("No font found named '"+e+"'");t.destroy(),delete i.available[e]},i.from=function(e,t,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var r=Object.assign({},i.defaultOptions,n),o=r.chars,s=r.padding,a=r.resolution,l=r.textureWidth,u=r.textureHeight,h=function(Je){typeof Je=="string"&&(Je=[Je]);for(var st=[],ct=0,he=Je.length;ct<he;ct++){var de=Je[ct];if(Array.isArray(de)){if(de.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+de.length+".");var Ke=de[0].charCodeAt(0),Ve=de[1].charCodeAt(0);if(Ve<Ke)throw new Error("[BitmapFont]: Invalid character range.");for(var ze=Ke,dt=Ve;ze<=dt;ze++)st.push(String.fromCharCode(ze))}else st.push.apply(st,$1(de))}if(st.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return st}(o),d=t instanceof mc?t:new mc(t),p=l,m=new Jm;m.info[0]={face:d.fontFamily,size:d.fontSize},m.common[0]={lineHeight:d.fontSize};for(var g,_,y,w=0,P=0,B=0,G=[],U=0;U<h.length;U++){g||((g=document.createElement("canvas")).width=l,g.height=u,_=g.getContext("2d"),y=new Cn(g,{resolution:a}),G.push(new nn(y)),m.page.push({id:G.length-1,file:""}));var X=Ao.measureText(h[U],d,!1,g),H=X.width,q=Math.ceil(X.height),me=Math.ceil((d.fontStyle==="italic"?2:1)*H);if(P>=u-q*a){if(P===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+d.fontSize+"px fonts");--U,g=null,_=null,y=null,P=0,w=0,B=0}else if(B=Math.max(q+X.fontProperties.descent,B),me*a+w>=p)--U,P+=B*a,P=Math.ceil(P),w=0,B=0;else{vC(g,_,X,w,P,a,d);var ue=Zm(X.text);m.char.push({id:ue,page:G.length-1,x:w/a,y:P/a,width:me,height:q,xoffset:0,yoffset:0,xadvance:Math.ceil(H-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0))}),w+=(me+2*s)*a,w=Math.ceil(w)}}U=0;for(var oe=h.length;U<oe;U++)for(var ce=h[U],le=0;le<oe;le++){var _e=h[le],je=_.measureText(ce).width,ke=_.measureText(_e).width,Ee=_.measureText(ce+_e).width-(je+ke);Ee&&m.kerning.push({first:Zm(ce),second:Zm(_e),amount:Ee})}var Ae=new i(m,G,!0);return i.available[e]!==void 0&&i.uninstall(e),i.available[e]=Ae,Ae},i.ALPHA=[["a","z"],["A","Z"]," "],i.NUMERIC=[["0","9"]],i.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],i.ASCII=[[" ","~"]],i.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:i.ALPHANUMERIC},i.available={},i}(),_C=[],yC=[],J1=[],xC=(function(i){function e(t,n){n===void 0&&(n={});var r=i.call(this)||this;r._tint=16777215;var o=Object.assign({},e.styleDefaults,n),s=o.align,a=o.tint,l=o.maxWidth,u=o.letterSpacing,h=o.fontName,d=o.fontSize;if(!vc.available[h])throw new Error('Missing BitmapFont "'+h+'"');return r._activePagesMeshData=[],r._textWidth=0,r._textHeight=0,r._align=s,r._tint=a,r._fontName=h,r._fontSize=d||vc.available[h].size,r._text=t,r._maxWidth=l,r._maxLineHeight=0,r._letterSpacing=u,r._anchor=new sc(function(){r.dirty=!0},r,0,0),r._roundPixels=Jt.ROUND_PIXELS,r.dirty=!0,r._textureCache={},r}(function(t,n){function r(){this.constructor=t}q1(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)})(e,i),e.prototype.updateText=function(){for(var t,n=vc.available[this._fontName],r=this._fontSize/n.size,o=new Oi,s=[],a=[],l=[],u=$1(this._text.replace(/(?:\r\n|\r)/g,`
5724
+ `),o)||this)._colorDirty=!1,r.uvMatrix=new L0(t),r.batchable=n.program===void 0,r.pluginName=n.pluginName,r.tint=n.tint,r.alpha=n.alpha,r}return J0(e,i),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;p0(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(Ma),$m=function(i){function e(t,n,r){var o=i.call(this)||this,s=new Yi(t),a=new Yi(n,!0),l=new Yi(r,!0,!0);return o.addAttribute("aVertexPosition",s,2,!1,sn.FLOAT).addAttribute("aTextureCoord",a,2,!1,sn.FLOAT).addIndex(l),o._updateId=-1,o}return J0(e,i),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(lc),q1=function(i,e){return(q1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(i,e)},Jm=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},mC=function(){function i(){}return i.test=function(e){return typeof e=="string"&&e.indexOf("info face=")===0},i.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var r in t){var o=t[r].match(/^[a-z]+/gm)[0],s=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var l in s){var u=s[l].split("="),h=u[0],d=u[1].replace(/"/gm,""),p=parseFloat(d),m=isNaN(p)?d:p;a[h]=m}n[o].push(a)}var g=new Jm;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)})}),n.distanceField.forEach(function(_){return g.distanceField.push({distanceRange:parseInt(_.distanceRange,10),fieldType:_.fieldType})}),g},i}(),K0=function(){function i(){}return i.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},i.parse=function(e){for(var t=new Jm,n=e.getElementsByTagName("info"),r=e.getElementsByTagName("common"),o=e.getElementsByTagName("page"),s=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),l=e.getElementsByTagName("distanceField"),u=0;u<n.length;u++)t.info.push({face:n[u].getAttribute("face"),size:parseInt(n[u].getAttribute("size"),10)});for(u=0;u<r.length;u++)t.common.push({lineHeight:parseInt(r[u].getAttribute("lineHeight"),10)});for(u=0;u<o.length;u++)t.page.push({id:parseInt(o[u].getAttribute("id"),10)||0,file:o[u].getAttribute("file")});for(u=0;u<s.length;u++){var h=s[u];t.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(u=0;u<a.length;u++)t.kerning.push({first:parseInt(a[u].getAttribute("first"),10),second:parseInt(a[u].getAttribute("second"),10),amount:parseInt(a[u].getAttribute("amount"),10)});for(u=0;u<l.length;u++)t.distanceField.push({fieldType:l[u].getAttribute("fieldType"),distanceRange:parseInt(l[u].getAttribute("distanceRange"),10)});return t},i}(),gC=function(){function i(){}return i.test=function(e){if(typeof e=="string"&&e.indexOf("<font>")>-1){var t=new self.DOMParser().parseFromString(e,"text/xml");return K0.test(t)}return!1},i.parse=function(e){var t=new self.DOMParser().parseFromString(e,"text/xml");return K0.parse(t)},i}(),Q0=[mC,K0,gC];function Y1(i){for(var e=0;e<Q0.length;e++)if(Q0[e].test(i))return Q0[e];return null}function vC(i,e,t,n,r,o,s){var a=t.text,l=t.fontProperties;e.translate(n,r),e.scale(o,o);var u=s.strokeThickness/2,h=-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=function(m,g,_,y,w,P){var B,G=_.fill;if(!Array.isArray(G))return G;if(G.length===1)return G[0];var U=_.dropShadow?_.dropShadowDistance:0,X=_.padding||0,H=m.width/y-U-2*X,q=m.height/y-U-2*X,me=G.slice(),ue=_.fillGradientStops.slice();if(!ue.length)for(var oe=me.length+1,ce=1;ce<oe;++ce)ue.push(ce/oe);if(me.unshift(G[0]),ue.unshift(0),me.push(G[G.length-1]),ue.push(1),_.fillGradientType===ip.LINEAR_VERTICAL){B=g.createLinearGradient(H/2,X,H/2,q+X);var le=0,_e=(P.fontProperties.fontSize+_.strokeThickness)/q;for(ce=0;ce<w.length;ce++)for(var je=P.lineHeight*ce,ke=0;ke<me.length;ke++){var Ee=je/q+(typeof ue[ke]=="number"?ue[ke]:ke/me.length)*_e,Ae=Math.max(le,Ee);Ae=Math.min(Ae,1),B.addColorStop(Ae,me[ke]),le=Ae}}else{B=g.createLinearGradient(X,q/2,H+X,q/2);var Je=me.length+1,st=1;for(ce=0;ce<me.length;ce++){var ct=void 0;ct=typeof ue[ce]=="number"?ue[ce]:st/Je,B.addColorStop(ct,me[ce]),st++}}return B}(i,e,s,o,[a],t),e.strokeStyle=s.stroke;var d=s.dropShadowColor,p=bu(typeof d=="number"?d:h0(d));s.dropShadow?(e.shadowColor="rgba("+255*p[0]+","+255*p[1]+","+255*p[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,h+t.lineHeight-l.descent),s.fill&&e.fillText(a,u,h+t.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function $1(i){return Array.from?Array.from(i):i.split("")}function Zm(i){return i.codePointAt?i.codePointAt(0):i.charCodeAt(0)}var vc=function(){function i(e,t,n){var r,o,s=e.info[0],a=e.common[0],l=e.page[0],u=e.distanceField[0],h=$d(l.file),d={};this._ownsTextures=n,this.font=s.face,this.size=s.size,this.lineHeight=a.lineHeight/h,this.chars={},this.pageTextures=d;for(var p=0;p<e.page.length;p++){var m=e.page[p],g=m.id,_=m.file;d[g]=t instanceof Array?t[p]:t[_],(u==null?void 0:u.fieldType)&&u.fieldType!=="none"&&(d[g].baseTexture.alphaMode=As.NO_PREMULTIPLIED_ALPHA)}for(p=0;p<e.char.length;p++){var y=e.char[p],w=(g=y.id,y.page),P=e.char[p],B=P.x,G=P.y,U=P.width,X=P.height,H=P.xoffset,q=P.yoffset,me=P.xadvance;G/=h,U/=h,X/=h,H/=h,q/=h,me/=h;var ue=new wn((B/=h)+d[w].frame.x/h,G+d[w].frame.y/h,U,X);this.chars[g]={xOffset:H,yOffset:q,xAdvance:me,kerning:{},texture:new nn(d[w].baseTexture,ue),page:w}}for(p=0;p<e.kerning.length;p++){var oe=e.kerning[p],ce=oe.first,le=oe.second,_e=oe.amount;ce/=h,le/=h,_e/=h,this.chars[le]&&(this.chars[le].kerning[ce]=_e)}this.distanceFieldRange=u==null?void 0:u.distanceRange,this.distanceFieldType=(o=(r=u==null?void 0:u.fieldType)===null||r===void 0?void 0:r.toLowerCase())!==null&&o!==void 0?o:"none"}return i.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},i.install=function(e,t,n){var r;if(e instanceof Jm)r=e;else{var o=Y1(e);if(!o)throw new Error("Unrecognized data format for font.");r=o.parse(e)}t instanceof nn&&(t=[t]);var s=new i(r,t,n);return i.available[s.font]=s,s},i.uninstall=function(e){var t=i.available[e];if(!t)throw new Error("No font found named '"+e+"'");t.destroy(),delete i.available[e]},i.from=function(e,t,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var r=Object.assign({},i.defaultOptions,n),o=r.chars,s=r.padding,a=r.resolution,l=r.textureWidth,u=r.textureHeight,h=function(Je){typeof Je=="string"&&(Je=[Je]);for(var st=[],ct=0,he=Je.length;ct<he;ct++){var de=Je[ct];if(Array.isArray(de)){if(de.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+de.length+".");var Ke=de[0].charCodeAt(0),Ve=de[1].charCodeAt(0);if(Ve<Ke)throw new Error("[BitmapFont]: Invalid character range.");for(var ze=Ke,dt=Ve;ze<=dt;ze++)st.push(String.fromCharCode(ze))}else st.push.apply(st,$1(de))}if(st.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return st}(o),d=t instanceof mc?t:new mc(t),p=l,m=new Jm;m.info[0]={face:d.fontFamily,size:d.fontSize},m.common[0]={lineHeight:d.fontSize};for(var g,_,y,w=0,P=0,B=0,G=[],U=0;U<h.length;U++){g||((g=document.createElement("canvas")).width=l,g.height=u,_=g.getContext("2d"),y=new Cn(g,{resolution:a}),G.push(new nn(y)),m.page.push({id:G.length-1,file:""}));var X=Ao.measureText(h[U],d,!1,g),H=X.width,q=Math.ceil(X.height),me=Math.ceil((d.fontStyle==="italic"?2:1)*H);if(P>=u-q*a){if(P===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+d.fontSize+"px fonts");--U,g=null,_=null,y=null,P=0,w=0,B=0}else if(B=Math.max(q+X.fontProperties.descent,B),me*a+w>=p)--U,P+=B*a,P=Math.ceil(P),w=0,B=0;else{vC(g,_,X,w,P,a,d);var ue=Zm(X.text);m.char.push({id:ue,page:G.length-1,x:w/a,y:P/a,width:me,height:q,xoffset:0,yoffset:0,xadvance:Math.ceil(H-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0))}),w+=(me+2*s)*a,w=Math.ceil(w)}}U=0;for(var oe=h.length;U<oe;U++)for(var ce=h[U],le=0;le<oe;le++){var _e=h[le],je=_.measureText(ce).width,ke=_.measureText(_e).width,Ee=_.measureText(ce+_e).width-(je+ke);Ee&&m.kerning.push({first:Zm(ce),second:Zm(_e),amount:Ee})}var Ae=new i(m,G,!0);return i.available[e]!==void 0&&i.uninstall(e),i.available[e]=Ae,Ae},i.ALPHA=[["a","z"],["A","Z"]," "],i.NUMERIC=[["0","9"]],i.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],i.ASCII=[[" ","~"]],i.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:i.ALPHANUMERIC},i.available={},i}(),_C=[],yC=[],J1=[],xC=(function(i){function e(t,n){n===void 0&&(n={});var r=i.call(this)||this;r._tint=16777215;var o=Object.assign({},e.styleDefaults,n),s=o.align,a=o.tint,l=o.maxWidth,u=o.letterSpacing,h=o.fontName,d=o.fontSize;if(!vc.available[h])throw new Error('Missing BitmapFont "'+h+'"');return r._activePagesMeshData=[],r._textWidth=0,r._textHeight=0,r._align=s,r._tint=a,r._fontName=h,r._fontSize=d||vc.available[h].size,r._text=t,r._maxWidth=l,r._maxLineHeight=0,r._letterSpacing=u,r._anchor=new sc(function(){r.dirty=!0},r,0,0),r._roundPixels=Jt.ROUND_PIXELS,r.dirty=!0,r._textureCache={},r}(function(t,n){function r(){this.constructor=t}q1(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)})(e,i),e.prototype.updateText=function(){for(var t,n=vc.available[this._fontName],r=this._fontSize/n.size,o=new Oi,s=[],a=[],l=[],u=$1(this._text.replace(/(?:\r\n|\r)/g,`
5725
5725
  `)||" "),h=this._maxWidth*n.size/this._fontSize,d=n.distanceFieldType==="none"?_C:yC,p=null,m=0,g=0,_=0,y=-1,w=0,P=0,B=0,G=0,U=0;U<u.length;U++){var X=Zm(ze=u[U]);if(/(?:\s)/.test(ze)&&(y=U,w=m,G++),ze!=="\r"&&ze!==`
5726
5726
  `){var H=n.chars[X];if(H){p&&H.kerning[p]&&(o.x+=H.kerning[p]);var q=J1.pop()||{texture:nn.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Oi};q.texture=H.texture,q.line=_,q.charCode=X,q.position.x=o.x+H.xOffset+this._letterSpacing/2,q.position.y=o.y+H.yOffset,q.prevSpaces=G,s.push(q),m=q.position.x+H.texture.orig.width,o.x+=H.xAdvance+this._letterSpacing,B=Math.max(B,H.yOffset+H.texture.height),p=X,y!==-1&&h>0&&o.x>h&&(wu(s,1+y-++P,1+U-y),U=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,p=null,G=0)}}else a.push(m),l.push(-1),g=Math.max(g,m),++_,++P,o.x=0,o.y+=n.lineHeight,p=null,G=0}var me=u[u.length-1];me!=="\r"&&me!==`
5727
5727
  `&&(/(?:\s)/.test(me)&&(m=w),a.push(m),g=Math.max(g,m),l.push(-1));var ue=[];for(U=0;U<=_;U++){var oe=0;this._align==="right"?oe=g-a[U]:this._align==="center"?oe=(g-a[U])/2:this._align==="justify"&&(oe=l[U]<0?0:(g-a[U])/l[U]),ue.push(oe)}var ce=s.length,le={},_e=[],je=this._activePagesMeshData;for(U=0;U<je.length;U++)d.push(je[U]);for(U=0;U<ce;U++){var ke=(pt=s[U].texture).baseTexture.uid;if(!le[ke]){if(!(et=d.pop())){var Ee=new $m,Ae=void 0,Je=void 0;n.distanceFieldType==="none"?(Ae=new sp(nn.EMPTY),Je=tn.NORMAL):(Ae=new sp(nn.EMPTY,{program:Qd.from(`// Mesh material default fragment\r
@@ -6364,6 +6364,6 @@ void main(void){
6364
6364
  `)}},e.prototype.emitSyncDispatch=function(t){if(!this.lock.isLocked(t.type)){var n=Math.random().toString(32).substr(2);this.lock.addLock(t.type,n),this.emit(Ro.syncDispatch,Tp(Tp({},t),{uuid:n})),this.log+="=== sync dispatch ["+new Date().toISOString()+`] ===
6365
6365
  `,this.log+=JSON.stringify(t,null,2),this.log+=`
6366
6366
 
6367
- `}},e.prototype.setMainSeqStep=function(t,n){var r;(r=this.player)===null||r===void 0||r.setMainSeqStep(t,n)},e.prototype.setInteractive=function(t){var n;this.interactive=t,(n=this.player)===null||n===void 0||n.setInteractive(t)},e.prototype.pause=function(){var t;(t=this.player)===null||t===void 0||t.pause()},e.prototype.resume=function(){var t;(t=this.player)===null||t===void 0||t.resume()},e.prototype.frozen=function(){var t;return Fs(this,void 0,void 0,function(){var n,r,o,s=this;return Bs(this,function(a){switch(a.label){case 0:return this.isFrowning?[2,N_(function(){return!s.isFrowning},6e4)]:this.view&&this.player?(this.isFrowning=!0,[4,this.player.clock.waitUntil(function(){return!s.isLoading},6e4)]):[3,2];case 1:for(r in a.sent(),n=this.player.getSnapshot()||"",this.cacheImage.src=n,this.frame.appendChild(this.cacheImage),this.player.destroy(),(t=this.playerController)===null||t===void 0||t.destroy(),this.player=void 0,this.__slideState.mediaState)o=this.__slideState.mediaState[r],this.__slideState.mediaState[r]=Tp(Tp({},o),{frozenTime:this.timestamp()});this.isFrowning=!1,a.label=2;case 2:return[2]}})})},e.prototype.release=function(){var t,n;return Fs(this,void 0,void 0,function(){var r,o,s,a,l=this;return Bs(this,function(u){switch(u.label){case 0:if(this.isReleasing)return[2,N_(function(){return!l.isReleasing},6e4)];for(o in this.isReleasing=!0,this.player=this.initPlayer(this.config),!((t=this.config)===null||t===void 0)&&t.controller&&this.createController(),this.player.view&&(this.frame.appendChild(this.player.view),this.player.view.style.visibility="hidden"),r=this.__slideState,this.__slideState=Object(Y.cloneDeep)(WS),r.mediaState)(s=r.mediaState[o]).type==="play"&&(a=Math.max((n=s.frozenTime)!==null&&n!==void 0?n:0,s.time),s.time=this.timestamp()-(a-s.time),s.frozenTime=void 0);return[4,this.setSlideState(r)];case 1:return u.sent(),[4,this.player.clock.delay(333)];case 2:u.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch{}return this.isReleasing=!1,[2]}})})},e.prototype.destroy=function(){var t,n,r,o;this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),(t=this.player)===null||t===void 0||t.removeAllListeners(),(n=this.player)===null||n===void 0||n.destroy(),(r=this.player)===null||r===void 0||r.removeAllListeners(),window.removeEventListener("__slide_log__",this.handleLogDownload),window.removeEventListener("__slide_state__",this.handleSlideStateLog),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.clearInterval(this.persistLogId),Fu&&Fu.removeItem(this.logId).catch(function(){});try{!((o=this.player)===null||o===void 0)&&o.view&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch{}},e.disposeLocalCache=function(){br.storeManager.dispose()},e}(L.a)}]);function fT(T,R,v){return Math.min(Math.max(T,R),v)}function YI(T){return typeof T=="object"&&T!==null}var mT={exports:{}},$I={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},gT={exports:{}},JI=function(R){return!R||typeof R=="string"?!1:R instanceof Array||Array.isArray(R)||R.length>=0&&(R.splice instanceof Function||Object.getOwnPropertyDescriptor(R,R.length-1)&&R.constructor.name!=="String")},ZI=JI,KI=Array.prototype.concat,QI=Array.prototype.slice,sT=gT.exports=function(R){for(var v=[],b=0,te=R.length;b<te;b++){var fe=R[b];ZI(fe)?v=KI.call(v,QI.call(fe)):v.push(fe)}return v};sT.wrap=function(T){return function(){return T(sT(arguments))}};var Pp=$I,Op=gT.exports,vT=Object.hasOwnProperty,_T={};for(var k_ in Pp)vT.call(Pp,k_)&&(_T[Pp[k_]]=k_);var ao=mT.exports={to:{},get:{}};ao.get=function(T){var R=T.substring(0,3).toLowerCase(),v,b;switch(R){case"hsl":v=ao.get.hsl(T),b="hsl";break;case"hwb":v=ao.get.hwb(T),b="hwb";break;default:v=ao.get.rgb(T),b="rgb";break}return v?{model:b,value:v}:null};ao.get.rgb=function(T){if(!T)return null;var R=/^#([a-f0-9]{3,4})$/i,v=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,b=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,te=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,fe=/^(\w+)$/,$=[0,0,0,1],L,Y,j;if(L=T.match(v)){for(j=L[2],L=L[1],Y=0;Y<3;Y++){var F=Y*2;$[Y]=parseInt(L.slice(F,F+2),16)}j&&($[3]=parseInt(j,16)/255)}else if(L=T.match(R)){for(L=L[1],j=L[3],Y=0;Y<3;Y++)$[Y]=parseInt(L[Y]+L[Y],16);j&&($[3]=parseInt(j+j,16)/255)}else if(L=T.match(b)){for(Y=0;Y<3;Y++)$[Y]=parseInt(L[Y+1],0);L[4]&&(L[5]?$[3]=parseFloat(L[4])*.01:$[3]=parseFloat(L[4]))}else if(L=T.match(te)){for(Y=0;Y<3;Y++)$[Y]=Math.round(parseFloat(L[Y+1])*2.55);L[4]&&(L[5]?$[3]=parseFloat(L[4])*.01:$[3]=parseFloat(L[4]))}else return(L=T.match(fe))?L[1]==="transparent"?[0,0,0,0]:vT.call(Pp,L[1])?($=Pp[L[1]],$[3]=1,$):null:null;for(Y=0;Y<3;Y++)$[Y]=Tl($[Y],0,255);return $[3]=Tl($[3],0,1),$};ao.get.hsl=function(T){if(!T)return null;var R=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=T.match(R);if(v){var b=parseFloat(v[4]),te=(parseFloat(v[1])%360+360)%360,fe=Tl(parseFloat(v[2]),0,100),$=Tl(parseFloat(v[3]),0,100),L=Tl(isNaN(b)?1:b,0,1);return[te,fe,$,L]}return null};ao.get.hwb=function(T){if(!T)return null;var R=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=T.match(R);if(v){var b=parseFloat(v[4]),te=(parseFloat(v[1])%360+360)%360,fe=Tl(parseFloat(v[2]),0,100),$=Tl(parseFloat(v[3]),0,100),L=Tl(isNaN(b)?1:b,0,1);return[te,fe,$,L]}return null};ao.to.hex=function(){var T=Op(arguments);return"#"+_g(T[0])+_g(T[1])+_g(T[2])+(T[3]<1?_g(Math.round(T[3]*255)):"")};ao.to.rgb=function(){var T=Op(arguments);return T.length<4||T[3]===1?"rgb("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+")":"rgba("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+", "+T[3]+")"};ao.to.rgb.percent=function(){var T=Op(arguments),R=Math.round(T[0]/255*100),v=Math.round(T[1]/255*100),b=Math.round(T[2]/255*100);return T.length<4||T[3]===1?"rgb("+R+"%, "+v+"%, "+b+"%)":"rgba("+R+"%, "+v+"%, "+b+"%, "+T[3]+")"};ao.to.hsl=function(){var T=Op(arguments);return T.length<4||T[3]===1?"hsl("+T[0]+", "+T[1]+"%, "+T[2]+"%)":"hsla("+T[0]+", "+T[1]+"%, "+T[2]+"%, "+T[3]+")"};ao.to.hwb=function(){var T=Op(arguments),R="";return T.length>=4&&T[3]!==1&&(R=", "+T[3]),"hwb("+T[0]+", "+T[1]+"%, "+T[2]+"%"+R+")"};ao.to.keyword=function(T){return _T[T.slice(0,3)]};function Tl(T,R,v){return Math.min(Math.max(R,T),v)}function _g(T){var R=Math.round(T).toString(16).toUpperCase();return R.length<2?"0"+R:R}var eO=mT.exports;class tO{constructor(R){this.enable=R,this.apps={},this.level="debug",this._onMessage=v=>{YI(v.data)&&(typeof v.data.slide=="boolean"?this.enable=v.data.slide:v.data.slide==="__instance"&&console.log(this))},window.addEventListener("message",this._onMessage)}log(...R){this.enable&&console.log(...R)}verbose(...R){this.enable&&this.level==="verbose"&&console.log(...R)}dispose(R){this.enable=!1,delete this.apps[R],window.removeEventListener("message",this._onMessage)}}const Gs=new tO(!1),$i=Gs.log.bind(Gs),nO=Gs.verbose.bind(Gs);function yT(T){try{const R=window.getComputedStyle(T).backgroundColor;if(R!=="rgba(0, 0, 0, 0)"&&R!=="transparent")return R;if(T.parentElement)return yT(T.parentElement)}catch{}return"#ffffff"}function iO(T){const R=eO.get(T);if(R&&R.model==="rgb"){const v=R.value,te=(((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255)).toString(16);return"#"+"000000".substring(te.length)+te}else return T}let yg="";function xT(T){return yg||(yg=iO(yT(T)),$i("[Slide] guess bg color",yg)),yg}function bT(T){const{width:R,height:v,slideCount:b,slideState:te}=T,{taskId:fe,url:$}=te,L=[];for(let Y=1;Y<=b;++Y)L.push({width:R,height:v,thumbnail:`${$}/${fe}/preview/${Y}.png`,src:"ppt"});return L}function aT(T,R,v,b){var L;const te=v.slideState.currentSlideIndex;if(!(te>0)||!R.getIsWritable())return;const fe=[b,te].join("/");if(T.scenePathType(fe)!=="page"){T.removeScenes(b);const Y=v.slideCount,j=[];for(let F=1;F<=Y;++F)j.push({name:`${F}`});T.putScenes(b,j)}let $;R.getBox().focus?$=T.state.sceneState.scenePath:$=((L=R.getView())==null?void 0:L.focusScenePath)||"",$!==fe&&R.setScenePath(fe)}const V_="https://convertcdn.netless.link/dynamicConvert",rO=40,G_={taskId:"",url:"",state:null};class oO{constructor({context:R,anchor:v,onPageChanged:b,onTransitionStart:te,onTransitionEnd:fe,onError:$}){this.sideEffect=new Ip,this.ready=!1,this.readyPromise=new Promise(L=>{this.resolveReady=()=>setTimeout(()=>{this.ready=!0,L()},1e3)}),this.onSyncDispatch=L=>{if(this.context.getIsWritable()&&this.room){const Y={type:bi.SLIDE_EVENTS.syncDispatch,payload:L};$i("[Slide] dispatch",L),this.context.dispatchMagixEvent(bi.SLIDE_EVENTS.syncDispatch,Y)}},this.magixEventListener=L=>{const{type:Y,payload:j}=L.payload;Y===bi.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),$i("[Slide] receive",j),this.slide.emit(bi.SLIDE_EVENTS.syncReceive,j))},this.onStateChange=L=>{this.context.getIsWritable()&&(nO("[Slide] state change",JSON.stringify(L,null,2)),this.context.storage.setState({state:L}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<rO?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,$i("[Slide] renderSlide (retry after timeout)",1),this.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=()=>this.room&&this.room.calibrationTimestamp?this.room.calibrationTimestamp:this.player?this.player.beginTimestamp+this.player.progressTime:Date.now(),this.isFrozen=!1,this._toFreeze=0,this.freezePromise=null,this.freeze=()=>{this.ready?($i("[Slide] freeze",this.context.appId),this.freezePromise?this._toFreeze=1:this.isFrozen||(this._toFreeze=0,this.freezePromise=this.slide.frozen().then(this.afterFreeze.bind(this,1)))):this._toFreeze=1},this.unfreeze=async()=>{this.ready?($i("[Slide] unfreeze",this.context.appId),this.freezePromise?this._toFreeze=-1:this.isFrozen&&(this._toFreeze=0,this.freezePromise=this.slide.release().then(this.afterFreeze.bind(this,-1)))):this._toFreeze=-1},this.onPageChanged=b,this.onTransitionStart=te,this.onTransitionEnd=fe,this.onError=$,this.context=R,this.room=R.getRoom(),this.player=this.room?void 0:R.getDisplayer(),this.slide=this.createSlide(v),this.syncStateOnceFlag=!this.context.isAddApp,this.initialize()}jumpToPage(R){this.ready&&(R=fT(R,1,this.pageCount),this.slide.renderSlide(R))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:R,slide:v}=this;R.getIsWritable()&&R.storage.ensureState(G_);const{taskId:b,url:te,state:fe}=R.storage.state;v.setResource(b,te||V_),fe?($i("[Slide] init with state",fe),this.syncStateOnceFlag=!1,v.setSlideState(fe)):R.isAddApp&&($i("[Slide] init by renderSlide",1),v.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:R,slide:v}=this,b=this.sideEffect.addDisposer(R.storage.addStateChangedListener(()=>{R.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(b))}));this.sideEffect.add(()=>R.addMagixEventListener(bi.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),v.on(bi.SLIDE_EVENTS.slideChange,this.onPageChanged),v.on(bi.SLIDE_EVENTS.renderStart,this.onTransitionStart),v.on(bi.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),v.on(bi.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),v.on(bi.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),v.on(bi.SLIDE_EVENTS.renderError,this.onError),v.on(bi.SLIDE_EVENTS.stateChange,this.onStateChange),v.on(bi.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),v.on(bi.SLIDE_EVENTS.renderEnd,this.resolveReady)}syncStateOnce(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(G_);const{state:R}=this.context.storage.state;R&&($i("[Slide] sync with state (once)",R),this.slide.setSlideState(R),this.syncStateOnceFlag=!1)}}get pageCount(){return this._pageCount>0?this._pageCount:(this._pageCount=this.slide.slideCount,this._pageCount)}get page(){return this.slide.slideState.currentSlideIndex}createSlide(R){var b,te;return new bi.Slide({anchor:R,interactive:!0,mode:"interactive",resize:!0,controller:Gs.enable,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,resolution:(b=this.context.getAppOptions())==null?void 0:b.resolution,transactionBgColor:((te=this.context.getAppOptions())==null?void 0:te.bgColor)||xT(R)},timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||($i("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}afterFreeze(R){R===1?(this.isFrozen=!0,this.freezePromise=null,this._toFreeze===-1&&this.unfreeze()):R===-1&&(this.isFrozen=!1,this.freezePromise=null,this._toFreeze===1&&this.freeze())}}function sO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const b=document.createElementNS(R,"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 aO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(R,"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 lO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(R,"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 uO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(R,"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 hO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(R,"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 Uu=typeof window!="undefined",wT=Uu&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),ST=Uu&&"IntersectionObserver"in window,TT=Uu&&"classList"in document.createElement("p"),ET=Uu&&window.devicePixelRatio>1,cO={elements_selector:".lazy",container:wT||Uu?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},MT=T=>Object.assign({},cO,T),lT=function(T,R){let v;const b="LazyLoad::Initialized",te=new T(R);try{v=new CustomEvent(b,{detail:{instance:te}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(b,!1,!1,{instance:te})}window.dispatchEvent(v)},dO=(T,R)=>{if(!!R)if(!R.length)lT(T,R);else for(let v=0,b;b=R[v];v+=1)lT(T,b)},Ia="src",W_="srcset",X_="sizes",AT="poster",Lp="llOriginalAttrs",RT="data",q_="loading",CT="loaded",PT="applied",pO="entered",Y_="error",IT="native",OT="data-",LT="ll-status",lo=(T,R)=>T.getAttribute(OT+R),fO=(T,R,v)=>{var b=OT+R;if(v===null){T.removeAttribute(b);return}T.setAttribute(b,v)},Np=T=>lo(T,LT),ku=(T,R)=>fO(T,LT,R),Sg=T=>ku(T,null),$_=T=>Np(T)===null,mO=T=>Np(T)===q_,gO=T=>Np(T)===Y_,J_=T=>Np(T)===IT,vO=[q_,CT,PT,Y_],_O=T=>vO.indexOf(Np(T))>=0,Ml=(T,R,v,b)=>{if(!!T){if(b!==void 0){T(R,v,b);return}if(v!==void 0){T(R,v);return}T(R)}},Cc=(T,R)=>{if(TT){T.classList.add(R);return}T.className+=(T.className?" ":"")+R},ks=(T,R)=>{if(TT){T.classList.remove(R);return}T.className=T.className.replace(new RegExp("(^|\\s+)"+R+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},yO=T=>{T.llTempImage=document.createElement("IMG")},xO=T=>{delete T.llTempImage},NT=T=>T.llTempImage,Tg=(T,R)=>{if(!R)return;const v=R._observer;!v||v.unobserve(T)},bO=T=>{T.disconnect()},wO=(T,R,v)=>{R.unobserve_entered&&Tg(T,v)},Z_=(T,R)=>{!T||(T.loadingCount+=R)},SO=T=>{!T||(T.toLoadCount-=1)},DT=(T,R)=>{!T||(T.toLoadCount=R)},TO=T=>T.loadingCount>0,EO=T=>T.toLoadCount>0,FT=T=>{let R=[];for(let v=0,b;b=T.children[v];v+=1)b.tagName==="SOURCE"&&R.push(b);return R},K_=(T,R)=>{const v=T.parentNode;if(!v||v.tagName!=="PICTURE")return;FT(v).forEach(R)},BT=(T,R)=>{FT(T).forEach(R)},Eg=[Ia],UT=[Ia,AT],xg=[Ia,W_,X_],kT=[RT],Mg=T=>!!T[Lp],GT=T=>T[Lp],HT=T=>delete T[Lp],Ac=(T,R)=>{if(Mg(T))return;const v={};R.forEach(b=>{v[b]=T.getAttribute(b)}),T[Lp]=v},MO=T=>{Mg(T)||(T[Lp]={backgroundImage:T.style.backgroundImage})},AO=(T,R,v)=>{if(!v){T.removeAttribute(R);return}T.setAttribute(R,v)},Rc=(T,R)=>{if(!Mg(T))return;const v=GT(T);R.forEach(b=>{AO(T,b,v[b])})},RO=T=>{if(!Mg(T))return;const R=GT(T);T.style.backgroundImage=R.backgroundImage},CO=(T,R,v)=>{Cc(T,R.class_applied),ku(T,PT),v&&(R.unobserve_completed&&Tg(T,R),Ml(R.callback_applied,T,v))},zT=(T,R,v)=>{Cc(T,R.class_loading),ku(T,q_),v&&(Z_(v,1),Ml(R.callback_loading,T,v))},El=(T,R,v)=>{!v||T.setAttribute(R,v)},uT=(T,R)=>{El(T,X_,lo(T,R.data_sizes)),El(T,W_,lo(T,R.data_srcset)),El(T,Ia,lo(T,R.data_src))},PO=(T,R)=>{K_(T,v=>{Ac(v,xg),uT(v,R)}),Ac(T,xg),uT(T,R)},IO=(T,R)=>{Ac(T,Eg),El(T,Ia,lo(T,R.data_src))},OO=(T,R)=>{BT(T,v=>{Ac(v,Eg),El(v,Ia,lo(v,R.data_src))}),Ac(T,UT),El(T,AT,lo(T,R.data_poster)),El(T,Ia,lo(T,R.data_src)),T.load()},LO=(T,R)=>{Ac(T,kT),El(T,RT,lo(T,R.data_src))},NO=(T,R,v)=>{const b=lo(T,R.data_bg),te=lo(T,R.data_bg_hidpi),fe=ET&&te?te:b;!fe||(T.style.backgroundImage=`url("${fe}")`,NT(T).setAttribute(Ia,fe),zT(T,R,v))},DO=(T,R,v)=>{const b=lo(T,R.data_bg_multi),te=lo(T,R.data_bg_multi_hidpi),fe=ET&&te?te:b;!fe||(T.style.backgroundImage=fe,CO(T,R,v))},jT={IMG:PO,IFRAME:IO,VIDEO:OO,OBJECT:LO},FO=(T,R)=>{const v=jT[T.tagName];!v||v(T,R)},BO=(T,R,v)=>{const b=jT[T.tagName];!b||(b(T,R),zT(T,R,v))},UO=["IMG","IFRAME","VIDEO","OBJECT"],kO=T=>UO.indexOf(T.tagName)>-1,VT=(T,R)=>{R&&!TO(R)&&!EO(R)&&Ml(T.callback_finish,R)},hT=(T,R,v)=>{T.addEventListener(R,v),T.llEvLisnrs[R]=v},GO=(T,R,v)=>{T.removeEventListener(R,v)},Q_=T=>!!T.llEvLisnrs,HO=(T,R,v)=>{Q_(T)||(T.llEvLisnrs={});const b=T.tagName==="VIDEO"?"loadeddata":"load";hT(T,b,R),hT(T,"error",v)},H_=T=>{if(!Q_(T))return;const R=T.llEvLisnrs;for(let v in R){const b=R[v];GO(T,v,b)}delete T.llEvLisnrs},WT=(T,R,v)=>{xO(T),Z_(v,-1),SO(v),ks(T,R.class_loading),R.unobserve_completed&&Tg(T,v)},zO=(T,R,v,b)=>{const te=J_(R);WT(R,v,b),Cc(R,v.class_loaded),ku(R,CT),Ml(v.callback_loaded,R,b),te||VT(v,b)},jO=(T,R,v,b)=>{const te=J_(R);WT(R,v,b),Cc(R,v.class_error),ku(R,Y_),Ml(v.callback_error,R,b),te||VT(v,b)},ey=(T,R,v)=>{const b=NT(T)||T;if(Q_(b))return;HO(b,$=>{zO($,T,R,v),H_(b)},$=>{jO($,T,R,v),H_(b)})},VO=(T,R,v)=>{yO(T),ey(T,R,v),MO(T),NO(T,R,v),DO(T,R,v)},WO=(T,R,v)=>{ey(T,R,v),BO(T,R,v)},ty=(T,R,v)=>{kO(T)?WO(T,R,v):VO(T,R,v)},XO=(T,R,v)=>{T.setAttribute("loading","lazy"),ey(T,R,v),FO(T,R),ku(T,IT)},cT=T=>{T.removeAttribute(Ia),T.removeAttribute(W_),T.removeAttribute(X_)},qO=T=>{K_(T,R=>{cT(R)}),cT(T)},XT=T=>{K_(T,R=>{Rc(R,xg)}),Rc(T,xg)},YO=T=>{BT(T,R=>{Rc(R,Eg)}),Rc(T,UT),T.load()},$O=T=>{Rc(T,Eg)},JO=T=>{Rc(T,kT)},ZO={IMG:XT,IFRAME:$O,VIDEO:YO,OBJECT:JO},KO=T=>{const R=ZO[T.tagName];if(!R){RO(T);return}R(T)},QO=(T,R)=>{$_(T)||J_(T)||(ks(T,R.class_entered),ks(T,R.class_exited),ks(T,R.class_applied),ks(T,R.class_loading),ks(T,R.class_loaded),ks(T,R.class_error))},eL=(T,R)=>{KO(T),QO(T,R),Sg(T),HT(T)},tL=(T,R,v,b)=>{!v.cancel_on_exit||!mO(T)||T.tagName==="IMG"&&(H_(T),qO(T),XT(T),ks(T,v.class_loading),Z_(b,-1),Sg(T),Ml(v.callback_cancel,T,R,b))},nL=(T,R,v,b)=>{const te=_O(T);ku(T,pO),Cc(T,v.class_entered),ks(T,v.class_exited),wO(T,v,b),Ml(v.callback_enter,T,R,b),!te&&ty(T,v,b)},iL=(T,R,v,b)=>{$_(T)||(Cc(T,v.class_exited),tL(T,R,v,b),Ml(v.callback_exit,T,R,b))},rL=["IMG","IFRAME","VIDEO"],qT=T=>T.use_native&&"loading"in HTMLImageElement.prototype,oL=(T,R,v)=>{T.forEach(b=>{rL.indexOf(b.tagName)!==-1&&XO(b,R,v)}),DT(v,0)},sL=T=>T.isIntersecting||T.intersectionRatio>0,aL=T=>({root:T.container===document?null:T.container,rootMargin:T.thresholds||T.threshold+"px"}),lL=(T,R,v)=>{T.forEach(b=>sL(b)?nL(b.target,b,R,v):iL(b.target,b,R,v))},uL=(T,R)=>{R.forEach(v=>{T.observe(v)})},hL=(T,R)=>{bO(T),uL(T,R)},cL=(T,R)=>{!ST||qT(T)||(R._observer=new IntersectionObserver(v=>{lL(v,T,R)},aL(T)))},YT=T=>Array.prototype.slice.call(T),bg=T=>T.container.querySelectorAll(T.elements_selector),dL=T=>YT(T).filter($_),pL=T=>gO(T),fL=T=>YT(T).filter(pL),dT=(T,R)=>dL(T||bg(R)),mL=(T,R)=>{fL(bg(T)).forEach(b=>{ks(b,T.class_error),Sg(b)}),R.update()},gL=(T,R)=>{!Uu||window.addEventListener("online",()=>{mL(T,R)})},Dp=function(T,R){const v=MT(T);this._settings=v,this.loadingCount=0,cL(v,this),gL(v,this),this.update(R)};Dp.prototype={update:function(T){const R=this._settings,v=dT(T,R);if(DT(this,v.length),wT||!ST){this.loadAll(v);return}if(qT(R)){oL(v,R,this);return}hL(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),bg(this._settings).forEach(T=>{HT(T)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(T){const R=this._settings;dT(T,R).forEach(b=>{Tg(b,this),ty(b,R,this)})},restoreAll:function(){const T=this._settings;bg(T).forEach(R=>{eL(R,T)})}};Dp.load=(T,R)=>{const v=MT(R);ty(T,v)};Dp.resetStatus=T=>{Sg(T)};Uu&&dO(Dp,window.lazyLoadOptions);class $T{constructor({readonly:R,onNewPageIndex:v,onPlay:b}){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 Ip,this.readonly=R,this.onNewPageIndex=v,this.onPlay=b,this.render()}set pages(R){this._pages=R,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(R){this.readonly=R,this.$content.classList.toggle(this.wrapClassName("readonly"),R),this.$footer.classList.toggle(this.wrapClassName("readonly"),R),this.$pageNumberInput.disabled=R}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(R){Number.isNaN(R)||(this.pageIndex=R,this.$pageNumberInput.value=String(R+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(R){this.isSmallBox!==R&&(this.isSmallBox=R,this.$footer.classList.toggle(this.wrapClassName("float-footer"),R))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const R=document.createElement("div");R.className=this.wrapClassName("content"),this.$content=R,this.readonly&&R.classList.add(this.wrapClassName("readonly")),R.appendChild(this.renderPreviewMask()),R.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const R=document.createElement("div");R.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=R,this.sideEffect.add(()=>(this.previewLazyLoad=new Dp({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`}),()=>{var v;return(v=this.previewLazyLoad)==null?void 0:v.destroy()})),this.refreshPreview(),this.sideEffect.addEventListener(R,"click",v=>{var te;if(this.readonly)return;const b=(te=v.target.dataset)==null?void 0:te.pageIndex;b&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(b)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){var te;const{$preview:R}=this,v=this.wrapClassName("preview-page"),b=this.wrapClassName("preview-page-name");for(;R.firstChild;)R.firstChild.remove();this.pages.forEach((fe,$)=>{var xe;const L=(xe=fe.thumbnail)!=null?xe:fe.src.startsWith("ppt")?void 0:fe.src;if(!L)return;const Y=String($),j=document.createElement("a");j.className=v+" "+this.wrapClassName(`preview-page-${$}`),j.setAttribute("href","#"),j.dataset.pageIndex=Y;const F=document.createElement("span");F.className=b,F.textContent=String($+1),F.dataset.pageIndex=Y;const K=document.createElement("img");K.width=fe.width,K.height=fe.height,K.dataset.src=L,K.dataset.pageIndex=Y,j.appendChild(K),j.appendChild(F),R.appendChild(j)}),(te=this.previewLazyLoad)==null||te.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",R=>{this.readonly||R.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const R=document.createElement("div");R.className=this.wrapClassName("footer"),this.$footer=R,this.readonly&&R.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&R.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",sO(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 te=this.renderFooterBtn("btn-page-back",aO(this.namespace));if(this.sideEffect.addEventListener(te,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),b.appendChild(te),this.onPlay){const j=this.renderFooterBtn("btn-page-play",uO(this.namespace),hO(this.namespace));this.$btnPlay=j,this.sideEffect.addEventListener(j,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),b.appendChild(j)}const fe=this.renderFooterBtn("btn-page-next",lO(this.namespace));this.sideEffect.addEventListener(fe,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),b.appendChild(fe);const $=document.createElement("div");$.className=this.wrapClassName("page-number");const L=document.createElement("input");L.className=this.wrapClassName("page-number-input"),L.value=String(this.pageIndex+1),this.readonly&&(L.disabled=!0),this.$pageNumberInput=L,this.sideEffect.addEventListener(L,"focus",()=>{L.select()}),this.sideEffect.addEventListener(L,"change",()=>{this.readonly||L.value&&this.onNewPageIndex(Number(L.value)-1)});const Y=document.createElement("span");this.$totalPage=Y,$.appendChild(L),$.appendChild(Y),this.$footer.appendChild(b),this.$footer.appendChild($)}return this.$footer}renderFooterBtn(R,v,b){const te=document.createElement("button");return te.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(R),te.appendChild(v),b&&te.appendChild(b),te}togglePreview(R){if(this.isShowPreview=R!=null?R:!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(R){return`${this.namespace}-${R}`}}const vL=new Set(["clicker"]);class _L{constructor({box:R,view:v,mountSlideController:b,mountWhiteboard:te}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:fe})=>{this.viewer.setPaused(),console.warn("[Slide] render error",fe)},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=bT(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:fe,height:$}=this.slideController.slide;fe&&$&&(this.whiteboardView.moveCameraToContain({originX:-fe/2,originY:-$/2,width:fe,height:$,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:fe,height:$}),this.isViewMounted||(this.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),this.mountWhiteboard(this.$whiteboardView)))}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=fe=>{this.slideController&&this.slideController.jumpToPage(fe+1)},this.sideEffect=new Ip,this.namespace="netless-app-slide",this.box=R,this.whiteboardView=v,this.mountSlideController=b,this.mountWhiteboard=te,this.viewer=new $T({readonly:R.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.sideEffect.add(()=>{const fe=$=>{this.setReadonly($)};return R.events.on("readonly",fe),()=>R.events.off("readonly",fe)}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",R=>{if(this.box.focus&&this.slideController)switch(R.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderSlideContainer(){if(!this.$slide){const R=document.createElement("div");R.className=this.wrapClassName("slide"),R.dataset.appKind="Slide",this.$slide=R}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}mount(){return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(R){return(R>0?R:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(R){this.viewer.setReadonly(R)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(R){this.$whiteboardView.style.pointerEvents=!R||vL.has(R)?"none":"auto"}wrapClassName(R){return`${this.namespace}-${R}`}}let z_=!1;const JT=2,wg={map:new Map,queue:[],validateQueue(){for($i("[Slide] freezer: validate",this.queue);this.queue.length>JT;){const T=this.queue.pop(),R=this.map.get(T);R&&($i("[Slide] freezer: validate-freeze",T,this.queue),R.freeze())}},set(T,R){$i("[Slide] freezer: add",T,this.queue),this.map.set(T,R),this.queue.includes(T)||this.queue.unshift(T),this.validateQueue()},delete(T){$i("[Slide] freezer: delete",T,this.queue),this.map.delete(T),this.queue=this.queue.filter(R=>R!==T)},focus(T){const R=this.map.get(T),v=this.queue.indexOf(T);v>-1&&this.queue.splice(v,1),this.queue.unshift(T),this.validateQueue(),$i("[Slide] freezer: focus",T,this.queue),R&&R.unfreeze()}},yL=T=>{z_=!0,T.on("focus",({appId:R})=>{wg.focus(R)})};var ZT=`.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;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.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:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.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{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.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))}
6368
- `;function xL({container:T,taskId:R,url:v=V_,debug:b=!1}){if(!R)throw new Error("[Slide] taskId is required");T.style.cssText+="display:flex;flex-direction:column";const te=new KT({target:T});return te.debug=!!b,te.mount(R,v),te}class KT{constructor(R){this.slide=null,this.debug=!1,this.sideEffect=new Ip,this.ready=!1,this.readyPromise=new Promise(v=>{this.resolveReady=()=>{this.ready=!0,v()}}),this.hotkeyListener=v=>{if(this.slide)switch(v.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=v=>{this.viewer.setPageIndex(v-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:v})=>{this.viewer.setPaused(),console.warn("[Slide] render error",v)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=bT(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=v=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(fT(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=R.target,this.bgColor=xT(this.target),this.viewer=new $T({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(R){this.sideEffect.addEventListener(R,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(R,v){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new bi.Slide({anchor:this.$slide,interactive:!1,mode:"local",resize:!0,controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(R,v),this.slide.renderSlide(1)}renderStyle(){const R=document.createElement("style");return R.appendChild(document.createTextNode(ZT)),R}registerEventListeners(){if(!this.slide)return;const{slide:R}=this;R.on(bi.SLIDE_EVENTS.slideChange,this.onPageChanged),R.on(bi.SLIDE_EVENTS.renderStart,this.onTransitionStart),R.on(bi.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),R.on(bi.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),R.on(bi.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),R.on(bi.SLIDE_EVENTS.renderError,this.onError),R.on(bi.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}destroy(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&($i("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}getPageIndex(R){return(R>0?R:1)-1}renderSlideContainer(){if(!this.$slide){const R=document.createElement("div");R.className=this.wrapClassName("slide"),R.dataset.appKind="Slide",this.$slide=R}return this.$slide}wrapClassName(R){return`${this.namespace}-${R}`}}const j_="0.1.1",bL={kind:"Slide",setup(T){if(console.log("[Slide] setup @ "+j_),T.getIsWritable()&&T.storage.ensureState(G_),!T.storage.state.taskId)throw new Error("[Slide] no taskId");const R=T.getView();if(!R)throw new Error("[Slide] no view, please set scenePath on addApp()");R.disableCameraTransform=!0;const v=T.getBox();v.mountStyles(ZT);try{v.$content.dataset.appSlideVersion=j_}catch{}const b=T.getInitScenePath();let te=null;const fe=j=>{const F=T.getRoom();if(te&&te.slideController){let K=!1;F&&T.getIsWritable()&&(aT(F,T,te.slideController.slide,b),K=!0),$i("[Slide] page to",j,K),te.viewer.setPageIndex(j-1)}},$=j=>{var K,xe;const F=new oO(rT(U_({context:T},j),{onPageChanged:fe}));return z_&&wg.set(T.appId,F),((K=Gs.apps)[xe=T.appId]||(K[xe]={})).controller=F,F.readyPromise.then(j.onReady).then(()=>{const Re=T.getRoom();let Ie=!1;Re&&T.getIsWritable()&&(aT(Re,T,F.slide,b),Ie=!0),$i("[Slide] page to",F.slide.slideState.currentSlideIndex,Ie)}),F};te=new _L({box:v,view:R,mountSlideController:$,mountWhiteboard:T.mountView.bind(T)});const L=T.getRoom(),Y=new Ip;return Y.add(()=>{var j,F,K;return((j=Gs.apps)[F=T.appId]||(j[F]={})).context=T,Gs.enable=((K=T.getAppOptions())==null?void 0:K.debug)||!1,Gs.level="debug",()=>Gs.dispose(T.appId)}),L&&(te.toggleClickThrough(L.state.memberState.currentApplianceName),Y.add(()=>{const j=F=>{F.memberState&&te&&te.toggleClickThrough(F.memberState.currentApplianceName)};return L.callbacks.on("onRoomStateChanged",j),()=>L.callbacks.off("onRoomStateChanged",j)})),T.emitter.on("destroy",()=>{$i("[Slide]: destroy"),z_&&wg.delete(T.appId),Y.flushAll(),te&&(te.destroy(),te=null)}),te.mount(),{slide:()=>{var j;return(j=te==null?void 0:te.slideController)==null?void 0:j.slide},nextStep:()=>{var j;return te&&te.slideController?((j=te==null?void 0:te.slideController)==null||j.slide.nextStep(),!0):!1},prevStep:()=>{var j;return te&&te.slideController?((j=te==null?void 0:te.slideController)==null||j.slide.prevStep(),!0):!1},position:()=>{const j=te==null?void 0:te.slideController;if(j)return[j.page,j.pageCount]},nextPage:()=>{const j=te==null?void 0:te.slideController;if(j){const{page:F,pageCount:K}=j;if(K>0&&F<K)return j.jumpToPage(F+1),!0}return!1},prevPage:()=>{const j=te==null?void 0:te.slideController;if(j){const{page:F,pageCount:K}=j;if(K>0&&F>1)return j.jumpToPage(F-1),!0}return!1}}}};exports.DefaultUrl=V_;exports.FreezerLength=JT;exports.SlidePreviewer=KT;exports.addHooks=yL;exports.apps=wg;exports.default=bL;exports.previewSlide=xL;exports.version=j_;
6367
+ `}},e.prototype.setMainSeqStep=function(t,n){var r;(r=this.player)===null||r===void 0||r.setMainSeqStep(t,n)},e.prototype.setInteractive=function(t){var n;this.interactive=t,(n=this.player)===null||n===void 0||n.setInteractive(t)},e.prototype.pause=function(){var t;(t=this.player)===null||t===void 0||t.pause()},e.prototype.resume=function(){var t;(t=this.player)===null||t===void 0||t.resume()},e.prototype.frozen=function(){var t;return Fs(this,void 0,void 0,function(){var n,r,o,s=this;return Bs(this,function(a){switch(a.label){case 0:return this.isFrowning?[2,N_(function(){return!s.isFrowning},6e4)]:this.view&&this.player?(this.isFrowning=!0,[4,this.player.clock.waitUntil(function(){return!s.isLoading},6e4)]):[3,2];case 1:for(r in a.sent(),n=this.player.getSnapshot()||"",this.cacheImage.src=n,this.frame.appendChild(this.cacheImage),this.player.destroy(),(t=this.playerController)===null||t===void 0||t.destroy(),this.player=void 0,this.__slideState.mediaState)o=this.__slideState.mediaState[r],this.__slideState.mediaState[r]=Tp(Tp({},o),{frozenTime:this.timestamp()});this.isFrowning=!1,a.label=2;case 2:return[2]}})})},e.prototype.release=function(){var t,n;return Fs(this,void 0,void 0,function(){var r,o,s,a,l=this;return Bs(this,function(u){switch(u.label){case 0:if(this.isReleasing)return[2,N_(function(){return!l.isReleasing},6e4)];for(o in this.isReleasing=!0,this.player=this.initPlayer(this.config),!((t=this.config)===null||t===void 0)&&t.controller&&this.createController(),this.player.view&&(this.frame.appendChild(this.player.view),this.player.view.style.visibility="hidden"),r=this.__slideState,this.__slideState=Object(Y.cloneDeep)(WS),r.mediaState)(s=r.mediaState[o]).type==="play"&&(a=Math.max((n=s.frozenTime)!==null&&n!==void 0?n:0,s.time),s.time=this.timestamp()-(a-s.time),s.frozenTime=void 0);return[4,this.setSlideState(r)];case 1:return u.sent(),[4,this.player.clock.delay(333)];case 2:u.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch{}return this.isReleasing=!1,[2]}})})},e.prototype.destroy=function(){var t,n,r,o;this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),(t=this.player)===null||t===void 0||t.removeAllListeners(),(n=this.player)===null||n===void 0||n.destroy(),(r=this.player)===null||r===void 0||r.removeAllListeners(),window.removeEventListener("__slide_log__",this.handleLogDownload),window.removeEventListener("__slide_state__",this.handleSlideStateLog),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.clearInterval(this.persistLogId),Fu&&Fu.removeItem(this.logId).catch(function(){});try{!((o=this.player)===null||o===void 0)&&o.view&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch{}},e.disposeLocalCache=function(){br.storeManager.dispose()},e}(L.a)}]);function fT(T,R,v){return Math.min(Math.max(T,R),v)}function YI(T){return typeof T=="object"&&T!==null}var mT={exports:{}},$I={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},gT={exports:{}},JI=function(R){return!R||typeof R=="string"?!1:R instanceof Array||Array.isArray(R)||R.length>=0&&(R.splice instanceof Function||Object.getOwnPropertyDescriptor(R,R.length-1)&&R.constructor.name!=="String")},ZI=JI,KI=Array.prototype.concat,QI=Array.prototype.slice,sT=gT.exports=function(R){for(var v=[],b=0,te=R.length;b<te;b++){var fe=R[b];ZI(fe)?v=KI.call(v,QI.call(fe)):v.push(fe)}return v};sT.wrap=function(T){return function(){return T(sT(arguments))}};var Pp=$I,Op=gT.exports,vT=Object.hasOwnProperty,_T={};for(var k_ in Pp)vT.call(Pp,k_)&&(_T[Pp[k_]]=k_);var ao=mT.exports={to:{},get:{}};ao.get=function(T){var R=T.substring(0,3).toLowerCase(),v,b;switch(R){case"hsl":v=ao.get.hsl(T),b="hsl";break;case"hwb":v=ao.get.hwb(T),b="hwb";break;default:v=ao.get.rgb(T),b="rgb";break}return v?{model:b,value:v}:null};ao.get.rgb=function(T){if(!T)return null;var R=/^#([a-f0-9]{3,4})$/i,v=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,b=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,te=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,fe=/^(\w+)$/,$=[0,0,0,1],L,Y,j;if(L=T.match(v)){for(j=L[2],L=L[1],Y=0;Y<3;Y++){var F=Y*2;$[Y]=parseInt(L.slice(F,F+2),16)}j&&($[3]=parseInt(j,16)/255)}else if(L=T.match(R)){for(L=L[1],j=L[3],Y=0;Y<3;Y++)$[Y]=parseInt(L[Y]+L[Y],16);j&&($[3]=parseInt(j+j,16)/255)}else if(L=T.match(b)){for(Y=0;Y<3;Y++)$[Y]=parseInt(L[Y+1],0);L[4]&&(L[5]?$[3]=parseFloat(L[4])*.01:$[3]=parseFloat(L[4]))}else if(L=T.match(te)){for(Y=0;Y<3;Y++)$[Y]=Math.round(parseFloat(L[Y+1])*2.55);L[4]&&(L[5]?$[3]=parseFloat(L[4])*.01:$[3]=parseFloat(L[4]))}else return(L=T.match(fe))?L[1]==="transparent"?[0,0,0,0]:vT.call(Pp,L[1])?($=Pp[L[1]],$[3]=1,$):null:null;for(Y=0;Y<3;Y++)$[Y]=Tl($[Y],0,255);return $[3]=Tl($[3],0,1),$};ao.get.hsl=function(T){if(!T)return null;var R=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=T.match(R);if(v){var b=parseFloat(v[4]),te=(parseFloat(v[1])%360+360)%360,fe=Tl(parseFloat(v[2]),0,100),$=Tl(parseFloat(v[3]),0,100),L=Tl(isNaN(b)?1:b,0,1);return[te,fe,$,L]}return null};ao.get.hwb=function(T){if(!T)return null;var R=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=T.match(R);if(v){var b=parseFloat(v[4]),te=(parseFloat(v[1])%360+360)%360,fe=Tl(parseFloat(v[2]),0,100),$=Tl(parseFloat(v[3]),0,100),L=Tl(isNaN(b)?1:b,0,1);return[te,fe,$,L]}return null};ao.to.hex=function(){var T=Op(arguments);return"#"+_g(T[0])+_g(T[1])+_g(T[2])+(T[3]<1?_g(Math.round(T[3]*255)):"")};ao.to.rgb=function(){var T=Op(arguments);return T.length<4||T[3]===1?"rgb("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+")":"rgba("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+", "+T[3]+")"};ao.to.rgb.percent=function(){var T=Op(arguments),R=Math.round(T[0]/255*100),v=Math.round(T[1]/255*100),b=Math.round(T[2]/255*100);return T.length<4||T[3]===1?"rgb("+R+"%, "+v+"%, "+b+"%)":"rgba("+R+"%, "+v+"%, "+b+"%, "+T[3]+")"};ao.to.hsl=function(){var T=Op(arguments);return T.length<4||T[3]===1?"hsl("+T[0]+", "+T[1]+"%, "+T[2]+"%)":"hsla("+T[0]+", "+T[1]+"%, "+T[2]+"%, "+T[3]+")"};ao.to.hwb=function(){var T=Op(arguments),R="";return T.length>=4&&T[3]!==1&&(R=", "+T[3]),"hwb("+T[0]+", "+T[1]+"%, "+T[2]+"%"+R+")"};ao.to.keyword=function(T){return _T[T.slice(0,3)]};function Tl(T,R,v){return Math.min(Math.max(R,T),v)}function _g(T){var R=Math.round(T).toString(16).toUpperCase();return R.length<2?"0"+R:R}var eO=mT.exports;class tO{constructor(R){this.enable=R,this.apps={},this.level="debug",this._onMessage=v=>{YI(v.data)&&(typeof v.data.slide=="boolean"?this.enable=v.data.slide:v.data.slide==="__instance"&&console.log(this))},window.addEventListener("message",this._onMessage)}log(...R){this.enable&&console.log(...R)}verbose(...R){this.enable&&this.level==="verbose"&&console.log(...R)}dispose(R){this.enable=!1,delete this.apps[R],window.removeEventListener("message",this._onMessage)}}const Gs=new tO(!1),Di=Gs.log.bind(Gs),nO=Gs.verbose.bind(Gs);function yT(T){try{const R=window.getComputedStyle(T).backgroundColor;if(R!=="rgba(0, 0, 0, 0)"&&R!=="transparent")return R;if(T.parentElement)return yT(T.parentElement)}catch{}return"#ffffff"}function iO(T){const R=eO.get(T);if(R&&R.model==="rgb"){const v=R.value,te=(((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255)).toString(16);return"#"+"000000".substring(te.length)+te}else return T}let yg="";function xT(T){return yg||(yg=iO(yT(T)),Di("[Slide] guess bg color",yg)),yg}function bT(T){const{width:R,height:v,slideCount:b,slideState:te}=T,{taskId:fe,url:$}=te,L=[];for(let Y=1;Y<=b;++Y)L.push({width:R,height:v,thumbnail:`${$}/${fe}/preview/${Y}.png`,src:"ppt"});return L}function aT(T,R,v,b){var L;const te=v.slideState.currentSlideIndex;if(!(te>0)||!R.getIsWritable())return;const fe=[b,te].join("/");if(T.scenePathType(fe)!=="page"){T.removeScenes(b);const Y=v.slideCount,j=[];for(let F=1;F<=Y;++F)j.push({name:`${F}`});T.putScenes(b,j)}let $;R.getBox().focus?$=T.state.sceneState.scenePath:$=((L=R.getView())==null?void 0:L.focusScenePath)||"",$!==fe&&R.setScenePath(fe)}const V_="https://convertcdn.netless.link/dynamicConvert",rO=40,G_={taskId:"",url:"",state:null};class oO{constructor({context:R,anchor:v,onPageChanged:b,onTransitionStart:te,onTransitionEnd:fe,onError:$}){this.sideEffect=new Ip,this.ready=!1,this.readyPromise=new Promise(L=>{this.resolveReady=()=>setTimeout(()=>{this.ready=!0,L()},1e3)}),this.onSyncDispatch=L=>{if(this.context.getIsWritable()&&this.room){const Y={type:bi.SLIDE_EVENTS.syncDispatch,payload:L};Di("[Slide] dispatch",L),this.context.dispatchMagixEvent(bi.SLIDE_EVENTS.syncDispatch,Y)}},this.magixEventListener=L=>{const{type:Y,payload:j}=L.payload;Y===bi.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),Di("[Slide] receive",j),this.slide.emit(bi.SLIDE_EVENTS.syncReceive,j))},this.onStateChange=L=>{this.context.getIsWritable()&&(nO("[Slide] state change",JSON.stringify(L,null,2)),this.context.storage.setState({state:L}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<rO?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,Di("[Slide] renderSlide (retry after timeout)",1),this.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=()=>this.room&&this.room.calibrationTimestamp?this.room.calibrationTimestamp:this.player?this.player.beginTimestamp+this.player.progressTime:Date.now(),this.isFrozen=!1,this._toFreeze=0,this.freezePromise=null,this.freeze=()=>{this.ready?(Di("[Slide] freeze",this.context.appId),this.freezePromise?this._toFreeze=1:this.isFrozen||(this._toFreeze=0,this.freezePromise=this.slide.frozen().then(this.afterFreeze.bind(this,1)))):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.ready?(Di("[Slide] unfreeze",this.context.appId),this.freezePromise?this._toFreeze=-1:this.isFrozen&&(this._toFreeze=0,this.freezePromise=this.slide.release().then(this.afterFreeze.bind(this,-1)))):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(Di("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.freezePromise?this._toFreeze===1:this.isFrozen,Di("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onPageChanged=b,this.onTransitionStart=te,this.onTransitionEnd=fe,this.onError=$,this.context=R,this.room=R.getRoom(),this.player=this.room?void 0:R.getDisplayer(),this.slide=this.createSlide(v),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(R){this.ready&&(R=fT(R,1,this.pageCount),this.slide.renderSlide(R))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:R,slide:v}=this;R.getIsWritable()&&R.storage.ensureState(G_);const{taskId:b,url:te,state:fe}=R.storage.state;v.setResource(b,te||V_),fe?(Di("[Slide] init with state",fe),this.syncStateOnceFlag=!1,v.setSlideState(fe)):R.isAddApp&&(Di("[Slide] init by renderSlide",1),v.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:R,slide:v}=this,b=this.sideEffect.addDisposer(R.storage.addStateChangedListener(()=>{R.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(b))}));this.sideEffect.add(()=>R.addMagixEventListener(bi.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),v.on(bi.SLIDE_EVENTS.slideChange,this.onPageChanged),v.on(bi.SLIDE_EVENTS.renderStart,this.onTransitionStart),v.on(bi.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),v.on(bi.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),v.on(bi.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),v.on(bi.SLIDE_EVENTS.renderError,this.onError),v.on(bi.SLIDE_EVENTS.stateChange,this.onStateChange),v.on(bi.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),v.on(bi.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add(()=>(document.addEventListener("visibilitychange",this.onVisibilityChange),()=>document.removeEventListener("visibilitychange",this.onVisibilityChange)))}syncStateOnce(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(G_);const{state:R}=this.context.storage.state;R&&(Di("[Slide] sync with state (once)",R),this.slide.setSlideState(R),this.syncStateOnceFlag=!1)}}get pageCount(){return this._pageCount>0?this._pageCount:(this._pageCount=this.slide.slideCount,this._pageCount)}get page(){return this.slide.slideState.currentSlideIndex}createSlide(R){var b,te;return new bi.Slide({anchor:R,interactive:!0,mode:"interactive",resize:!0,controller:Gs.enable,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,resolution:(b=this.context.getAppOptions())==null?void 0:b.resolution,transactionBgColor:((te=this.context.getAppOptions())==null?void 0:te.bgColor)||xT(R)},timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(Di("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}afterFreeze(R){R===1?(this.isFrozen=!0,this.freezePromise=null,this._toFreeze===-1&&this.unfreeze()):R===-1&&(this.isFrozen=!1,this.freezePromise=null,this._toFreeze===1&&this.freeze())}}function sO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const b=document.createElementNS(R,"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 aO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(R,"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 lO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(R,"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 uO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(R,"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 hO(T){const R="http://www.w3.org/2000/svg",v=document.createElementNS(R,"svg");v.setAttribute("class",`${T}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const b=document.createElementNS(R,"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 Uu=typeof window!="undefined",wT=Uu&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),ST=Uu&&"IntersectionObserver"in window,TT=Uu&&"classList"in document.createElement("p"),ET=Uu&&window.devicePixelRatio>1,cO={elements_selector:".lazy",container:wT||Uu?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},MT=T=>Object.assign({},cO,T),lT=function(T,R){let v;const b="LazyLoad::Initialized",te=new T(R);try{v=new CustomEvent(b,{detail:{instance:te}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(b,!1,!1,{instance:te})}window.dispatchEvent(v)},dO=(T,R)=>{if(!!R)if(!R.length)lT(T,R);else for(let v=0,b;b=R[v];v+=1)lT(T,b)},Ia="src",W_="srcset",X_="sizes",AT="poster",Lp="llOriginalAttrs",RT="data",q_="loading",CT="loaded",PT="applied",pO="entered",Y_="error",IT="native",OT="data-",LT="ll-status",lo=(T,R)=>T.getAttribute(OT+R),fO=(T,R,v)=>{var b=OT+R;if(v===null){T.removeAttribute(b);return}T.setAttribute(b,v)},Np=T=>lo(T,LT),ku=(T,R)=>fO(T,LT,R),Sg=T=>ku(T,null),$_=T=>Np(T)===null,mO=T=>Np(T)===q_,gO=T=>Np(T)===Y_,J_=T=>Np(T)===IT,vO=[q_,CT,PT,Y_],_O=T=>vO.indexOf(Np(T))>=0,Ml=(T,R,v,b)=>{if(!!T){if(b!==void 0){T(R,v,b);return}if(v!==void 0){T(R,v);return}T(R)}},Cc=(T,R)=>{if(TT){T.classList.add(R);return}T.className+=(T.className?" ":"")+R},ks=(T,R)=>{if(TT){T.classList.remove(R);return}T.className=T.className.replace(new RegExp("(^|\\s+)"+R+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},yO=T=>{T.llTempImage=document.createElement("IMG")},xO=T=>{delete T.llTempImage},NT=T=>T.llTempImage,Tg=(T,R)=>{if(!R)return;const v=R._observer;!v||v.unobserve(T)},bO=T=>{T.disconnect()},wO=(T,R,v)=>{R.unobserve_entered&&Tg(T,v)},Z_=(T,R)=>{!T||(T.loadingCount+=R)},SO=T=>{!T||(T.toLoadCount-=1)},DT=(T,R)=>{!T||(T.toLoadCount=R)},TO=T=>T.loadingCount>0,EO=T=>T.toLoadCount>0,FT=T=>{let R=[];for(let v=0,b;b=T.children[v];v+=1)b.tagName==="SOURCE"&&R.push(b);return R},K_=(T,R)=>{const v=T.parentNode;if(!v||v.tagName!=="PICTURE")return;FT(v).forEach(R)},BT=(T,R)=>{FT(T).forEach(R)},Eg=[Ia],UT=[Ia,AT],xg=[Ia,W_,X_],kT=[RT],Mg=T=>!!T[Lp],GT=T=>T[Lp],HT=T=>delete T[Lp],Ac=(T,R)=>{if(Mg(T))return;const v={};R.forEach(b=>{v[b]=T.getAttribute(b)}),T[Lp]=v},MO=T=>{Mg(T)||(T[Lp]={backgroundImage:T.style.backgroundImage})},AO=(T,R,v)=>{if(!v){T.removeAttribute(R);return}T.setAttribute(R,v)},Rc=(T,R)=>{if(!Mg(T))return;const v=GT(T);R.forEach(b=>{AO(T,b,v[b])})},RO=T=>{if(!Mg(T))return;const R=GT(T);T.style.backgroundImage=R.backgroundImage},CO=(T,R,v)=>{Cc(T,R.class_applied),ku(T,PT),v&&(R.unobserve_completed&&Tg(T,R),Ml(R.callback_applied,T,v))},zT=(T,R,v)=>{Cc(T,R.class_loading),ku(T,q_),v&&(Z_(v,1),Ml(R.callback_loading,T,v))},El=(T,R,v)=>{!v||T.setAttribute(R,v)},uT=(T,R)=>{El(T,X_,lo(T,R.data_sizes)),El(T,W_,lo(T,R.data_srcset)),El(T,Ia,lo(T,R.data_src))},PO=(T,R)=>{K_(T,v=>{Ac(v,xg),uT(v,R)}),Ac(T,xg),uT(T,R)},IO=(T,R)=>{Ac(T,Eg),El(T,Ia,lo(T,R.data_src))},OO=(T,R)=>{BT(T,v=>{Ac(v,Eg),El(v,Ia,lo(v,R.data_src))}),Ac(T,UT),El(T,AT,lo(T,R.data_poster)),El(T,Ia,lo(T,R.data_src)),T.load()},LO=(T,R)=>{Ac(T,kT),El(T,RT,lo(T,R.data_src))},NO=(T,R,v)=>{const b=lo(T,R.data_bg),te=lo(T,R.data_bg_hidpi),fe=ET&&te?te:b;!fe||(T.style.backgroundImage=`url("${fe}")`,NT(T).setAttribute(Ia,fe),zT(T,R,v))},DO=(T,R,v)=>{const b=lo(T,R.data_bg_multi),te=lo(T,R.data_bg_multi_hidpi),fe=ET&&te?te:b;!fe||(T.style.backgroundImage=fe,CO(T,R,v))},jT={IMG:PO,IFRAME:IO,VIDEO:OO,OBJECT:LO},FO=(T,R)=>{const v=jT[T.tagName];!v||v(T,R)},BO=(T,R,v)=>{const b=jT[T.tagName];!b||(b(T,R),zT(T,R,v))},UO=["IMG","IFRAME","VIDEO","OBJECT"],kO=T=>UO.indexOf(T.tagName)>-1,VT=(T,R)=>{R&&!TO(R)&&!EO(R)&&Ml(T.callback_finish,R)},hT=(T,R,v)=>{T.addEventListener(R,v),T.llEvLisnrs[R]=v},GO=(T,R,v)=>{T.removeEventListener(R,v)},Q_=T=>!!T.llEvLisnrs,HO=(T,R,v)=>{Q_(T)||(T.llEvLisnrs={});const b=T.tagName==="VIDEO"?"loadeddata":"load";hT(T,b,R),hT(T,"error",v)},H_=T=>{if(!Q_(T))return;const R=T.llEvLisnrs;for(let v in R){const b=R[v];GO(T,v,b)}delete T.llEvLisnrs},WT=(T,R,v)=>{xO(T),Z_(v,-1),SO(v),ks(T,R.class_loading),R.unobserve_completed&&Tg(T,v)},zO=(T,R,v,b)=>{const te=J_(R);WT(R,v,b),Cc(R,v.class_loaded),ku(R,CT),Ml(v.callback_loaded,R,b),te||VT(v,b)},jO=(T,R,v,b)=>{const te=J_(R);WT(R,v,b),Cc(R,v.class_error),ku(R,Y_),Ml(v.callback_error,R,b),te||VT(v,b)},ey=(T,R,v)=>{const b=NT(T)||T;if(Q_(b))return;HO(b,$=>{zO($,T,R,v),H_(b)},$=>{jO($,T,R,v),H_(b)})},VO=(T,R,v)=>{yO(T),ey(T,R,v),MO(T),NO(T,R,v),DO(T,R,v)},WO=(T,R,v)=>{ey(T,R,v),BO(T,R,v)},ty=(T,R,v)=>{kO(T)?WO(T,R,v):VO(T,R,v)},XO=(T,R,v)=>{T.setAttribute("loading","lazy"),ey(T,R,v),FO(T,R),ku(T,IT)},cT=T=>{T.removeAttribute(Ia),T.removeAttribute(W_),T.removeAttribute(X_)},qO=T=>{K_(T,R=>{cT(R)}),cT(T)},XT=T=>{K_(T,R=>{Rc(R,xg)}),Rc(T,xg)},YO=T=>{BT(T,R=>{Rc(R,Eg)}),Rc(T,UT),T.load()},$O=T=>{Rc(T,Eg)},JO=T=>{Rc(T,kT)},ZO={IMG:XT,IFRAME:$O,VIDEO:YO,OBJECT:JO},KO=T=>{const R=ZO[T.tagName];if(!R){RO(T);return}R(T)},QO=(T,R)=>{$_(T)||J_(T)||(ks(T,R.class_entered),ks(T,R.class_exited),ks(T,R.class_applied),ks(T,R.class_loading),ks(T,R.class_loaded),ks(T,R.class_error))},eL=(T,R)=>{KO(T),QO(T,R),Sg(T),HT(T)},tL=(T,R,v,b)=>{!v.cancel_on_exit||!mO(T)||T.tagName==="IMG"&&(H_(T),qO(T),XT(T),ks(T,v.class_loading),Z_(b,-1),Sg(T),Ml(v.callback_cancel,T,R,b))},nL=(T,R,v,b)=>{const te=_O(T);ku(T,pO),Cc(T,v.class_entered),ks(T,v.class_exited),wO(T,v,b),Ml(v.callback_enter,T,R,b),!te&&ty(T,v,b)},iL=(T,R,v,b)=>{$_(T)||(Cc(T,v.class_exited),tL(T,R,v,b),Ml(v.callback_exit,T,R,b))},rL=["IMG","IFRAME","VIDEO"],qT=T=>T.use_native&&"loading"in HTMLImageElement.prototype,oL=(T,R,v)=>{T.forEach(b=>{rL.indexOf(b.tagName)!==-1&&XO(b,R,v)}),DT(v,0)},sL=T=>T.isIntersecting||T.intersectionRatio>0,aL=T=>({root:T.container===document?null:T.container,rootMargin:T.thresholds||T.threshold+"px"}),lL=(T,R,v)=>{T.forEach(b=>sL(b)?nL(b.target,b,R,v):iL(b.target,b,R,v))},uL=(T,R)=>{R.forEach(v=>{T.observe(v)})},hL=(T,R)=>{bO(T),uL(T,R)},cL=(T,R)=>{!ST||qT(T)||(R._observer=new IntersectionObserver(v=>{lL(v,T,R)},aL(T)))},YT=T=>Array.prototype.slice.call(T),bg=T=>T.container.querySelectorAll(T.elements_selector),dL=T=>YT(T).filter($_),pL=T=>gO(T),fL=T=>YT(T).filter(pL),dT=(T,R)=>dL(T||bg(R)),mL=(T,R)=>{fL(bg(T)).forEach(b=>{ks(b,T.class_error),Sg(b)}),R.update()},gL=(T,R)=>{!Uu||window.addEventListener("online",()=>{mL(T,R)})},Dp=function(T,R){const v=MT(T);this._settings=v,this.loadingCount=0,cL(v,this),gL(v,this),this.update(R)};Dp.prototype={update:function(T){const R=this._settings,v=dT(T,R);if(DT(this,v.length),wT||!ST){this.loadAll(v);return}if(qT(R)){oL(v,R,this);return}hL(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),bg(this._settings).forEach(T=>{HT(T)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(T){const R=this._settings;dT(T,R).forEach(b=>{Tg(b,this),ty(b,R,this)})},restoreAll:function(){const T=this._settings;bg(T).forEach(R=>{eL(R,T)})}};Dp.load=(T,R)=>{const v=MT(R);ty(T,v)};Dp.resetStatus=T=>{Sg(T)};Uu&&dO(Dp,window.lazyLoadOptions);class $T{constructor({readonly:R,onNewPageIndex:v,onPlay:b}){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 Ip,this.readonly=R,this.onNewPageIndex=v,this.onPlay=b,this.render()}set pages(R){this._pages=R,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(R){this.readonly=R,this.$content.classList.toggle(this.wrapClassName("readonly"),R),this.$footer.classList.toggle(this.wrapClassName("readonly"),R),this.$pageNumberInput.disabled=R}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(R){Number.isNaN(R)||(this.pageIndex=R,this.$pageNumberInput.value=String(R+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(R){this.isSmallBox!==R&&(this.isSmallBox=R,this.$footer.classList.toggle(this.wrapClassName("float-footer"),R))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const R=document.createElement("div");R.className=this.wrapClassName("content"),this.$content=R,this.readonly&&R.classList.add(this.wrapClassName("readonly")),R.appendChild(this.renderPreviewMask()),R.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const R=document.createElement("div");R.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=R,this.sideEffect.add(()=>(this.previewLazyLoad=new Dp({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`}),()=>{var v;return(v=this.previewLazyLoad)==null?void 0:v.destroy()})),this.refreshPreview(),this.sideEffect.addEventListener(R,"click",v=>{var te;if(this.readonly)return;const b=(te=v.target.dataset)==null?void 0:te.pageIndex;b&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(b)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){var te;const{$preview:R}=this,v=this.wrapClassName("preview-page"),b=this.wrapClassName("preview-page-name");for(;R.firstChild;)R.firstChild.remove();this.pages.forEach((fe,$)=>{var xe;const L=(xe=fe.thumbnail)!=null?xe:fe.src.startsWith("ppt")?void 0:fe.src;if(!L)return;const Y=String($),j=document.createElement("a");j.className=v+" "+this.wrapClassName(`preview-page-${$}`),j.setAttribute("href","#"),j.dataset.pageIndex=Y;const F=document.createElement("span");F.className=b,F.textContent=String($+1),F.dataset.pageIndex=Y;const K=document.createElement("img");K.width=fe.width,K.height=fe.height,K.dataset.src=L,K.dataset.pageIndex=Y,j.appendChild(K),j.appendChild(F),R.appendChild(j)}),(te=this.previewLazyLoad)==null||te.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",R=>{this.readonly||R.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const R=document.createElement("div");R.className=this.wrapClassName("footer"),this.$footer=R,this.readonly&&R.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&R.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",sO(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 te=this.renderFooterBtn("btn-page-back",aO(this.namespace));if(this.sideEffect.addEventListener(te,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),b.appendChild(te),this.onPlay){const j=this.renderFooterBtn("btn-page-play",uO(this.namespace),hO(this.namespace));this.$btnPlay=j,this.sideEffect.addEventListener(j,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),b.appendChild(j)}const fe=this.renderFooterBtn("btn-page-next",lO(this.namespace));this.sideEffect.addEventListener(fe,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),b.appendChild(fe);const $=document.createElement("div");$.className=this.wrapClassName("page-number");const L=document.createElement("input");L.className=this.wrapClassName("page-number-input"),L.value=String(this.pageIndex+1),this.readonly&&(L.disabled=!0),this.$pageNumberInput=L,this.sideEffect.addEventListener(L,"focus",()=>{L.select()}),this.sideEffect.addEventListener(L,"change",()=>{this.readonly||L.value&&this.onNewPageIndex(Number(L.value)-1)});const Y=document.createElement("span");this.$totalPage=Y,$.appendChild(L),$.appendChild(Y),this.$footer.appendChild(b),this.$footer.appendChild($)}return this.$footer}renderFooterBtn(R,v,b){const te=document.createElement("button");return te.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(R),te.appendChild(v),b&&te.appendChild(b),te}togglePreview(R){if(this.isShowPreview=R!=null?R:!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(R){return`${this.namespace}-${R}`}}const vL=new Set(["clicker"]);class _L{constructor({box:R,view:v,mountSlideController:b,mountWhiteboard:te}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:fe})=>{this.viewer.setPaused(),console.warn("[Slide] render error",fe)},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=bT(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:fe,height:$}=this.slideController.slide;fe&&$&&(this.whiteboardView.moveCameraToContain({originX:-fe/2,originY:-$/2,width:fe,height:$,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:fe,height:$}),this.isViewMounted||(this.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),this.mountWhiteboard(this.$whiteboardView)))}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=fe=>{this.slideController&&this.slideController.jumpToPage(fe+1)},this.sideEffect=new Ip,this.namespace="netless-app-slide",this.box=R,this.whiteboardView=v,this.mountSlideController=b,this.mountWhiteboard=te,this.viewer=new $T({readonly:R.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.sideEffect.add(()=>{const fe=$=>{this.setReadonly($)};return R.events.on("readonly",fe),()=>R.events.off("readonly",fe)}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",R=>{if(this.box.focus&&this.slideController)switch(R.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderSlideContainer(){if(!this.$slide){const R=document.createElement("div");R.className=this.wrapClassName("slide"),R.dataset.appKind="Slide",this.$slide=R}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}mount(){return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(R){return(R>0?R:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(R){this.viewer.setReadonly(R)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(R){this.$whiteboardView.style.pointerEvents=!R||vL.has(R)?"none":"auto"}wrapClassName(R){return`${this.namespace}-${R}`}}let z_=!1;const JT=2,wg={map:new Map,queue:[],validateQueue(){for(Di("[Slide] freezer: validate",this.queue);this.queue.length>JT;){const T=this.queue.pop(),R=this.map.get(T);R&&(Di("[Slide] freezer: validate-freeze",T,this.queue),R.freeze())}},set(T,R){Di("[Slide] freezer: add",T,this.queue),this.map.set(T,R),this.queue.includes(T)||this.queue.unshift(T),this.validateQueue()},delete(T){Di("[Slide] freezer: delete",T,this.queue),this.map.delete(T),this.queue=this.queue.filter(R=>R!==T)},focus(T){const R=this.map.get(T),v=this.queue.indexOf(T);v>-1&&this.queue.splice(v,1),this.queue.unshift(T),this.validateQueue(),Di("[Slide] freezer: focus",T,this.queue),R&&R.unfreeze()}},yL=T=>{z_=!0,T.on("focus",({appId:R})=>{wg.focus(R)})};var ZT=`.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;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.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:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.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{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.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))}
6368
+ `;function xL({container:T,taskId:R,url:v=V_,debug:b=!1}){if(!R)throw new Error("[Slide] taskId is required");T.style.cssText+="display:flex;flex-direction:column";const te=new KT({target:T});return te.debug=!!b,te.mount(R,v),te}class KT{constructor(R){this.slide=null,this.debug=!1,this.sideEffect=new Ip,this.ready=!1,this.readyPromise=new Promise(v=>{this.resolveReady=()=>{this.ready=!0,v()}}),this.hotkeyListener=v=>{if(this.slide)switch(v.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=v=>{this.viewer.setPageIndex(v-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:v})=>{this.viewer.setPaused(),console.warn("[Slide] render error",v)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=bT(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=v=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(fT(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=R.target,this.bgColor=xT(this.target),this.viewer=new $T({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(R){this.sideEffect.addEventListener(R,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(R,v){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new bi.Slide({anchor:this.$slide,interactive:!1,mode:"local",resize:!0,controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(R,v),this.slide.renderSlide(1)}renderStyle(){const R=document.createElement("style");return R.appendChild(document.createTextNode(ZT)),R}registerEventListeners(){if(!this.slide)return;const{slide:R}=this;R.on(bi.SLIDE_EVENTS.slideChange,this.onPageChanged),R.on(bi.SLIDE_EVENTS.renderStart,this.onTransitionStart),R.on(bi.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),R.on(bi.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),R.on(bi.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),R.on(bi.SLIDE_EVENTS.renderError,this.onError),R.on(bi.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}destroy(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(Di("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}getPageIndex(R){return(R>0?R:1)-1}renderSlideContainer(){if(!this.$slide){const R=document.createElement("div");R.className=this.wrapClassName("slide"),R.dataset.appKind="Slide",this.$slide=R}return this.$slide}wrapClassName(R){return`${this.namespace}-${R}`}}const j_="0.1.2",bL={kind:"Slide",setup(T){if(console.log("[Slide] setup @ "+j_),T.getIsWritable()&&T.storage.ensureState(G_),!T.storage.state.taskId)throw new Error("[Slide] no taskId");const R=T.getView();if(!R)throw new Error("[Slide] no view, please set scenePath on addApp()");R.disableCameraTransform=!0;const v=T.getBox();v.mountStyles(ZT);try{v.$content.dataset.appSlideVersion=j_}catch{}const b=T.getInitScenePath();let te=null;const fe=j=>{const F=T.getRoom();if(te&&te.slideController){let K=!1;F&&T.getIsWritable()&&(aT(F,T,te.slideController.slide,b),K=!0),Di("[Slide] page to",j,K),te.viewer.setPageIndex(j-1)}},$=j=>{var K,xe;const F=new oO(rT(U_({context:T},j),{onPageChanged:fe}));return z_&&wg.set(T.appId,F),((K=Gs.apps)[xe=T.appId]||(K[xe]={})).controller=F,F.readyPromise.then(j.onReady).then(()=>{const Re=T.getRoom();let Ie=!1;Re&&T.getIsWritable()&&(aT(Re,T,F.slide,b),Ie=!0),Di("[Slide] page to",F.slide.slideState.currentSlideIndex,Ie)}),F};te=new _L({box:v,view:R,mountSlideController:$,mountWhiteboard:T.mountView.bind(T)});const L=T.getRoom(),Y=new Ip;return Y.add(()=>{var j,F,K;return((j=Gs.apps)[F=T.appId]||(j[F]={})).context=T,Gs.enable=((K=T.getAppOptions())==null?void 0:K.debug)||!1,Gs.level="debug",()=>Gs.dispose(T.appId)}),L&&(te.toggleClickThrough(L.state.memberState.currentApplianceName),Y.add(()=>{const j=F=>{F.memberState&&te&&te.toggleClickThrough(F.memberState.currentApplianceName)};return L.callbacks.on("onRoomStateChanged",j),()=>L.callbacks.off("onRoomStateChanged",j)})),T.emitter.on("destroy",()=>{Di("[Slide]: destroy"),z_&&wg.delete(T.appId),Y.flushAll(),te&&(te.destroy(),te=null)}),te.mount(),{slide:()=>{var j;return(j=te==null?void 0:te.slideController)==null?void 0:j.slide},nextStep:()=>{var j;return te&&te.slideController?((j=te==null?void 0:te.slideController)==null||j.slide.nextStep(),!0):!1},prevStep:()=>{var j;return te&&te.slideController?((j=te==null?void 0:te.slideController)==null||j.slide.prevStep(),!0):!1},position:()=>{const j=te==null?void 0:te.slideController;if(j)return[j.page,j.pageCount]},nextPage:()=>{const j=te==null?void 0:te.slideController;if(j){const{page:F,pageCount:K}=j;if(K>0&&F<K)return j.jumpToPage(F+1),!0}return!1},prevPage:()=>{const j=te==null?void 0:te.slideController;if(j){const{page:F,pageCount:K}=j;if(K>0&&F>1)return j.jumpToPage(F-1),!0}return!1}}}};exports.DefaultUrl=V_;exports.FreezerLength=JT;exports.SlidePreviewer=KT;exports.addHooks=yL;exports.apps=wg;exports.default=bL;exports.previewSlide=xL;exports.version=j_;
6369
6369
  //# sourceMappingURL=main.cjs.js.map