1
0
Fork 0
DeadEndShrineOnline/flag/assets/js/app.js

1 line
860 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(){"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){try{return!!e()}catch(e){return!0}}function i(e){return n.call(e).slice(8,-1)}function l(e){if(null==e)throw TypeError("Can't call method on "+e);return e}function u(e){return w(l(e))}var t=e(window.Modernizr||{}),n={}.toString,r="".split,w=m(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?r.call(e,""):Object(e)}:Object,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e,t){return e(t={exports:{}},t.exports),t.exports}function c(e){return e&&e.Math==Math&&e}function d(t,n){try{Object.defineProperty(y,t,{value:n,configurable:!0,writable:!0})}catch(e){y[t]=n}return n}function _(e){return Object(l(e))}function f(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++T+k).toString(36)}function g(e){return"function"==typeof e}function h(e,t){return arguments.length<2?function(e){return g(e)?e:void 0}(y[e]):y[e]&&y[e][t]}var p,v,y=c("object"==typeof globalThis&&globalThis)||c("object"==typeof window&&window)||c("object"==typeof self&&self)||c("object"==typeof a&&a)||function(){return this}()||Function("return this")(),b="__core-js_shared__",x=y[b]||d(b,{}),S=s(function(e){(e.exports=function(e,t){return x[e]||(x[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.18.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})}),M={}.hasOwnProperty,E=Object.hasOwn||function(e,t){return M.call(_(e),t)},T=0,k=Math.random(),L=h("navigator","userAgent")||"",C=y.process,R=y.Deno,P=C&&C.versions||R&&R.version,A=P&&P.v8;A?v=(p=A.split("."))[0]<4?1:p[0]+p[1]:L&&(!(p=L.match(/Edge\/(\d+)/))||74<=p[1])&&(p=L.match(/Chrome\/(\d+)/))&&(v=p[1]);function O(e){return E(te,e)&&(K||"string"==typeof te[e])||(K&&E(ne,e)?te[e]=ne[e]:te[e]=re("Symbol."+e)),te[e]}function N(e){return"object"==typeof e?null!==e:g(e)}function D(e){if(N(e))return e;throw TypeError(String(e)+" is not an object")}function I(e){return oe?ae.createElement(e):{}}function z(e){try{return String(e)}catch(e){return"Object"}}function F(e){if(g(e))return e;throw TypeError(z(e)+" is not a function")}function U(e,t){var n=e[t];return null==n?void 0:F(n)}function B(e,t){if(!N(e)||le(e))return e;var n,r=U(e,ue);if(r){if(void 0===t&&(t="default"),n=r.call(e,t),!N(n)||le(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&g(n=e.toString)&&!N(r=n.call(e)))return r;if(g(n=e.valueOf)&&!N(r=n.call(e)))return r;if("string"!==t&&g(n=e.toString)&&!N(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}(e,t)}function H(e){var t=B(e,"string");return le(t)?t:String(t)}function G(e){var t=+e;return t!=t||0==t?0:(0<t?he:de)(t)}function V(e){return 0<e?me(G(e),9007199254740991):0}function W(e){return V(e.length)}function j(s){return function(e,t,n){var r,i=u(e),a=W(i),o=function(e,t){var n=G(e);return n<0?pe(n+t,0):ve(n,t)}(n,a);if(s&&t!=t){for(;o<a;)if((r=i[o++])!=r)return!0}else for(;o<a;o++)if((s||o in i)&&i[o]===t)return s||o||0;return!s&&-1}}function q(e,t){var n,r=u(e),i=0,a=[];for(n in r)!E(ye,n)&&E(r,n)&&a.push(n);for(;t.length>i;)E(r,n=t[i++])&&(~be(a,n)||a.push(n));return a}function X(e){return Me[e]||(Me[e]=f(e))}function Y(){}function Z(e){return"<script>"+e+"</"+Te+">"}function J(e){e.write(Z("")),e.close();var t=e.parentWindow.Object;return e=null,t}var $,Q=v&&+v,K=!!Object.getOwnPropertySymbols&&!m(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Q&&Q<41}),ee=K&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,te=S("wks"),ne=y.Symbol,re=ee?ne:ne&&ne.withoutSetter||f,ie=!m(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),ae=y.document,oe=N(ae)&&N(ae.createElement),se=!ie&&!m(function(){return 7!=Object.defineProperty(I("div"),"a",{get:function(){return 7}}).a}),le=ee?function(e){return"symbol"==typeof e}:function(e){var t=h("Symbol");return g(t)&&Object(e)instanceof t},ue=O("toPrimitive"),ce=Object.defineProperty,fe={f:ie?ce:function(e,t,n){if(D(e),t=H(t),D(n),se)try{return ce(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},de=Math.ceil,he=Math.floor,pe=Math.max,ve=Math.min,me=Math.min,ge={includes:j(!0),indexOf:j(!1)},ye={},be=ge.indexOf,xe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],we=Object.keys||function(e){return q(e,xe)},_e=ie?Object.defineProperties:function(e,t){D(e);for(var n,r=we(t),i=r.length,a=0;a<i;)fe.f(e,n=r[a++],t[n]);return e},Se=h("document","documentElement"),Me=S("keys"),Ee="prototype",Te="script",ke=X("IE_PROTO"),Le=function(){try{$=new ActiveXObject("htmlfile")}catch(e){}Le="undefined"!=typeof document?document.domain&&$?J($):function(){var e,t=I("iframe");return t.style.display="none",Se.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Z("document.F=Object")),e.close(),e.F}():J($);for(var e=xe.length;e--;)delete Le[Ee][xe[e]];return Le()};ye[ke]=!0;var Ce=Object.create||function(e,t){var n;return null!==e?(Y[Ee]=D(e),n=new Y,Y[Ee]=null,n[ke]=e):n=Le(),void 0===t?n:_e(n,t)},Re=O("unscopables"),Pe=Array.prototype;null==Pe[Re]&&fe.f(Pe,Re,{configurable:!0,value:Ce(null)});function Ae(e){Pe[Re][e]=!0}var Oe={},Ne=Function.toString;g(x.inspectSource)||(x.inspectSource=function(e){return Ne.call(e)});function De(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}var Ie,ze,Fe,Ue=x.inspectSource,Be=y.WeakMap,He=g(Be)&&/native code/.test(Ue(Be)),Ge=ie?function(e,t,n){return fe.f(e,t,De(1,n))}:function(e,t,n){return e[t]=n,e},Ve="Object already initialized",We=y.WeakMap;if(He||x.state){var je=x.state||(x.state=new We),qe=je.get,Xe=je.has,Ye=je.set;Ie=function(e,t){if(Xe.call(je,e))throw new TypeError(Ve);return t.facade=e,Ye.call(je,e,t),t},ze=function(e){return qe.call(je,e)||{}},Fe=function(e){return Xe.call(je,e)}}else{var Ze=X("state");ye[Ze]=!0,Ie=function(e,t){if(E(e,Ze))throw new TypeError(Ve);return t.facade=e,Ge(e,Ze,t),t},ze=function(e){return E(e,Ze)?e[Ze]:{}},Fe=function(e){return E(e,Ze)}}function Je(e,t){for(var n=mt(t),r=fe.f,i=st.f,a=0;a<n.length;a++){var o=n[a];E(e,o)||r(e,o,i(t,o))}}function $e(e,t){var n=bt[yt(e)];return n==wt||n!=xt&&(g(t)?m(t):!!t)}function Qe(e,t){var n,r,i,a,o,s=e.target,l=e.global,u=e.stat;if(n=l?y:u?y[s]||d(s,{}):(y[s]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(o=St(n,r))&&o.value:n[r],!_t(l?r:s+(u?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Je(a,i)}(e.sham||i&&i.sham)&&Ge(a,"sham",!0),dt(n,r,a,e)}}var Ke,et,tt,nt={set:Ie,get:ze,has:Fe,enforce:function(e){return Fe(e)?ze(e):Ie(e,{})},getterFor:function(n){return function(e){var t;if(!N(e)||(t=ze(e)).type!==n)throw TypeError("Incompatible receiver, "+n+" required");return t}}},rt={}.propertyIsEnumerable,it=Object.getOwnPropertyDescriptor,at={f:it&&!rt.call({1:2},1)?function(e){var t=it(this,e);return!!t&&t.enumerable}:rt},ot=Object.getOwnPropertyDescriptor,st={f:ie?ot:function(e,t){if(e=u(e),t=H(t),se)try{return ot(e,t)}catch(e){}if(E(e,t))return De(!at.f.call(e,t),e[t])}},lt=Function.prototype,ut=ie&&Object.getOwnPropertyDescriptor,ct=E(lt,"name"),ft={EXISTS:ct,PROPER:ct&&"something"===function(){}.name,CONFIGURABLE:ct&&(!ie||ie&&ut(lt,"name").configurable)},dt=s(function(e){var u=ft.CONFIGURABLE,t=nt.get,c=nt.enforce,f=String(String).split("String");(e.exports=function(e,t,n,r){var i,a=!!r&&!!r.unsafe,o=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet,l=r&&void 0!==r.name?r.name:t;g(n)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!E(n,"name")||u&&n.name!==l)&&Ge(n,"name",l),(i=c(n)).source||(i.source=f.join("string"==typeof l?l:""))),e!==y?(a?!s&&e[t]&&(o=!0):delete e[t],o?e[t]=n:Ge(e,t,n)):o?e[t]=n:d(t,n)})(Function.prototype,"toString",function(){return g(this)&&t(this).source||Ue(this)})}),ht=xe.concat("length","prototype"),pt={f:Object.getOwnPropertyNames||function(e){return q(e,ht)}},vt={f:Object.getOwnPropertySymbols},mt=h("Reflect","ownKeys")||function(e){var t=pt.f(D(e)),n=vt.f;return n?t.concat(n(e)):t},gt=/#|\.prototype\./,yt=$e.normalize=function(e){return String(e).replace(gt,".").toLowerCase()},bt=$e.data={},xt=$e.NATIVE="N",wt=$e.POLYFILL="P",_t=$e,St=st.f,Mt=!m(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Et=X("IE_PROTO"),Tt=Object.prototype,kt=Mt?Object.getPrototypeOf:function(e){var t=_(e);if(E(t,Et))return t[Et];var n=t.constructor;return g(n)&&t instanceof n?n.prototype:t instanceof Object?Tt:null},Lt=O("iterator"),Ct=!1;[].keys&&("next"in(tt=[].keys())?(et=kt(kt(tt)))!==Object.prototype&&(Ke=et):Ct=!0),null!=Ke&&!m(function(){var e={};return Ke[Lt].call(e)!==e})||(Ke={}),g(Ke[Lt])||dt(Ke,Lt,function(){return this});function Rt(e,t,n){e&&!E(e=n?e:e.prototype,zt)&&It(e,zt,{configurable:!0,value:t})}function Pt(){return this}function At(e,t,n){var r=t+" Iterator";return e.prototype=Ce(Ft,{next:De(1,n)}),Rt(e,r,!1),Oe[r]=Pt,e}function Ot(){return this}function Nt(e,t,n,r,i,a,o){function s(e){if(e===i&&v)return v;if(!Vt&&e in h)return h[e];switch(e){case"keys":case jt:case qt:return function(){return new n(this,e)}}return function(){return new n(this)}}At(n,t,r);var l,u,c,f=t+" Iterator",d=!1,h=e.prototype,p=h[Wt]||h["@@iterator"]||i&&h[i],v=!Vt&&p||s(i),m="Array"==t&&h.entries||p;if(m&&(l=kt(m.call(new e)))!==Object.prototype&&l.next&&(kt(l)!==Gt&&(Ut?Ut(l,Gt):g(l[Wt])||dt(l,Wt,Ot)),Rt(l,f,!0)),Bt&&i==jt&&p&&p.name!==jt&&(Ht?Ge(h,"name",jt):(d=!0,v=function(){return p.call(this)})),i)if(u={values:s(jt),keys:a?v:s("keys"),entries:s(qt)},o)for(c in u)!Vt&&!d&&c in h||dt(h,c,u[c]);else Qe({target:t,proto:!0,forced:Vt||d},u);return h[Wt]!==v&&dt(h,Wt,v,{name:i}),Oe[t]=v,u}var Dt={IteratorPrototype:Ke,BUGGY_SAFARI_ITERATORS:Ct},It=fe.f,zt=O("toStringTag"),Ft=Dt.IteratorPrototype,Ut=Object.setPrototypeOf||("__proto__"in{}?function(){var n,r=!1,e={};try{(n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),r=e instanceof Array}catch(e){}return function(e,t){return D(e),function(e){if("object"==typeof e||g(e))return;throw TypeError("Can't set "+String(e)+" as a prototype")}(t),r?n.call(e,t):e.__proto__=t,e}}():void 0),Bt=ft.PROPER,Ht=ft.CONFIGURABLE,Gt=Dt.IteratorPrototype,Vt=Dt.BUGGY_SAFARI_ITERATORS,Wt=O("iterator"),jt="values",qt="entries",Xt="Array Iterator",Yt=nt.set,Zt=nt.getterFor(Xt);Nt(Array,"Array",function(e,t){Yt(this,{type:Xt,target:u(e),index:0,kind:t})},function(){var e=Zt(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?{value:e.target=void 0,done:!0}:"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values"),Oe.Arguments=Oe.Array,Ae("keys"),Ae("values"),Ae("entries");var Jt=pt.f,$t={}.toString,Qt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Kt={f:function(e){return Qt&&"[object Window]"==$t.call(e)?function(e){try{return Jt(e)}catch(e){return Qt.slice()}}(e):Jt(u(e))}},en=!m(function(){return Object.isExtensible(Object.preventExtensions({}))}),tn=s(function(e){function n(e){t(e,o,{value:{objectID:"O"+i++,weakData:{}}})}var t=fe.f,r=!1,o=f("meta"),i=0,a=Object.isExtensible||function(){return!0},s=e.exports={enable:function(){s.enable=function(){},r=!0;var i=pt.f,a=[].splice,e={};e[o]=1,i(e).length&&(pt.f=function(e){for(var t=i(e),n=0,r=t.length;n<r;n++)if(t[n]===o){a.call(t,n,1);break}return t},Qe({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Kt.f}))},fastKey:function(e,t){if(!N(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!E(e,o)){if(!a(e))return"F";if(!t)return"E";n(e)}return e[o].objectID},getWeakData:function(e,t){if(!E(e,o)){if(!a(e))return!0;if(!t)return!1;n(e)}return e[o].weakData},onFreeze:function(e){return en&&r&&a(e)&&!E(e,o)&&n(e),e}};ye[o]=!0});tn.enable,tn.fastKey,tn.getWeakData,tn.onFreeze;function nn(e){return void 0!==e&&(Oe.Array===e||on[an]===e)}function rn(r,i,e){if(F(r),void 0===i)return r;switch(e){case 0:return function(){return r.call(i)};case 1:return function(e){return r.call(i,e)};case 2:return function(e,t){return r.call(i,e,t)};case 3:return function(e,t,n){return r.call(i,e,t,n)}}return function(){return r.apply(i,arguments)}}var an=O("iterator"),on=Array.prototype,sn={};sn[O("toStringTag")]="z";function ln(e){if(null!=e)return U(e,yn)||U(e,"@@iterator")||Oe[gn(e)]}function un(e,t){var n=arguments.length<2?ln(e):t;if(F(n))return D(n.call(e));throw TypeError(String(e)+" is not iterable")}function cn(e,t,n){var r,i;D(e);try{if(!(r=U(e,"return"))){if("throw"===t)throw n;return n}r=r.call(e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return D(r),n}function fn(e,t){this.stopped=e,this.result=t}function dn(e,t,n){function r(e){return a&&cn(a,"normal",e),new fn(!0,e)}function i(e){return h?(D(e),v?m(e[0],e[1],r):m(e[0],e[1])):v?m(e,r):m(e)}var a,o,s,l,u,c,f,d=n&&n.that,h=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),m=rn(t,d,1+h+v);if(p)a=e;else{if(!(o=ln(e)))throw TypeError(String(e)+" is not iterable");if(nn(o)){for(s=0,l=W(e);s<l;s++)if((u=i(e[s]))&&u instanceof fn)return u;return new fn(!1)}a=un(e,o)}for(c=a.next;!(f=c.call(a)).done;){try{u=i(f.value)}catch(e){cn(a,"throw",e)}if("object"==typeof u&&u&&u instanceof fn)return u}return new fn(!1)}function hn(e,t,n){if(e instanceof t)return e;throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}var pn="[object z]"===String(sn),vn=O("toStringTag"),mn="Arguments"==i(function(){return arguments}()),gn=pn?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),vn))?n:mn?i(t):"Object"==(r=i(t))&&g(t.callee)?"Arguments":r},yn=O("iterator"),bn=O("iterator"),xn=!1;try{var wn=0,_n={next:function(){return{done:!!wn++}},return:function(){xn=!0}};_n[bn]=function(){return this},Array.from(_n,function(){throw 2})}catch(e){}function Sn(e,t){if(!t&&!xn)return!1;var n=!1;try{var r={};r[bn]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}function Mn(r,e,t){function n(e){var n=l[e];dt(l,e,"add"==e?function(e){return n.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(a&&!N(e))&&n.call(this,0===e?0:e)}:"get"==e?function(e){return a&&!N(e)?void 0:n.call(this,0===e?0:e)}:"has"==e?function(e){return!(a&&!N(e))&&n.call(this,0===e?0:e)}:function(e,t){return n.call(this,0===e?0:e,t),this})}var i=-1!==r.indexOf("Map"),a=-1!==r.indexOf("Weak"),o=i?"set":"add",s=y[r],l=s&&s.prototype,u=s,c={};if(_t(r,!g(s)||!(a||l.forEach&&!m(function(){(new s).entries().next()}))))u=t.getConstructor(e,r,i,o),tn.enable();else if(_t(r,!0)){var f=new u,d=f[o](a?{}:-0,1)!=f,h=m(function(){f.has(1)}),p=Sn(function(e){new s(e)}),v=!a&&m(function(){for(var e=new s,t=5;t--;)e[o](t,t);return!e.has(-0)});p||(((u=e(function(e,t){hn(e,u,r);var n=function(e,t,n){var r,i;return Ut&&g(r=t.constructor)&&r!==n&&N(i=r.prototype)&&i!==n.prototype&&Ut(e,i),e}(new s,e,u);return null!=t&&dn(t,n[o],{that:n,AS_ENTRIES:i}),n})).prototype=l).constructor=u),(h||v)&&(n("delete"),n("has"),i&&n("get")),(v||d)&&n(o),a&&l.clear&&delete l.clear}return c[r]=u,Qe({global:!0,forced:u!=s},c),Rt(u,r),a||t.setStrong(u,r,i),u}function En(e,t,n){for(var r in t)dt(e,r,t[r],n);return e}function Tn(e){var t=h(e),n=fe.f;ie&&t&&!t[kn]&&n(t,kn,{configurable:!0,get:function(){return this}})}var kn=O("species"),Ln=fe.f,Cn=tn.fastKey,Rn=nt.set,Pn=nt.getterFor,An={getConstructor:function(e,n,r,i){function a(e,t,n){var r,i,a=s(e),o=l(e,t);return o?o.value=n:(a.last=o={index:i=Cn(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=o),r&&(r.next=o),ie?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e}var o=e(function(e,t){hn(e,o,n),Rn(e,{type:n,index:Ce(null),first:void 0,last:void 0,size:0}),ie||(e.size=0),null!=t&&dn(t,e[i],{that:e,AS_ENTRIES:r})}),s=Pn(n),l=function(e,t){var n,r=s(e),i=Cn(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return En(o.prototype,{clear:function(){for(var e=s(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,ie?e.size=0:this.size=0},delete:function(e){var t=s(this),n=l(this,e);if(n){var r=n.next,i=n.previous;delete t.index[n.index],n.removed=!0,i&&(i.next=r),r&&(r.previous=i),t.first==n&&(t.first=r),t.last==n&&(t.last=i),ie?t.size--:this.size--}return!!n},forEach:function(e,t){for(var n,r=s(this),i=rn(e,1<arguments.length?t:void 0,3);n=n?n.next:r.first;)for(i(n.value,n.key,this);n&&n.removed;)n=n.previous},has:function(e){return!!l(this,e)}}),En(o.prototype,r?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),ie&&Ln(o.prototype,"size",{get:function(){return s(this).size}}),o},setStrong:function(e,t,n){var r=t+" Iterator",i=Pn(t),a=Pn(r);Nt(e,t,function(e,t){Rn(this,{type:r,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:{value:e.target=void 0,done:!0}},n?"entries":"values",!n,!0),Tn(t)}};Mn("Map",function(t){return function(e){return t(this,arguments.length?e:void 0)}},An);var On=pn?{}.toString:function(){return"[object "+gn(this)+"]"};pn||dt(Object.prototype,"toString",On,{unsafe:!0});function Nn(e){if("Symbol"===gn(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)}function Dn(s){return function(e,t){var n,r,i=Nn(l(e)),a=G(t),o=i.length;return a<0||o<=a?s?"":void 0:(n=i.charCodeAt(a))<55296||56319<n||a+1===o||(r=i.charCodeAt(a+1))<56320||57343<r?s?i.charAt(a):n:s?i.slice(a,a+2):r-56320+(n-55296<<10)+65536}}var In={codeAt:Dn(!1),charAt:Dn(!0)},zn=In.charAt,Fn="String Iterator",Un=nt.set,Bn=nt.getterFor(Fn);Nt(String,"String",function(e){Un(this,{type:Fn,string:Nn(e),index:0})},function(){var e,t=Bn(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=zn(n,r),t.index+=e.length,{value:e,done:!1})});var Hn=y;Hn.Map,Mn("Set",function(t){return function(e){return t(this,arguments.length?e:void 0)}},An),Hn.Set;for(var Gn=s(function(o){(function(){var e,t,n,r,i,a;"undefined"!=typeof performance&&null!==performance&&performance.now?o.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(o.exports=function(){return(e()-i)/1e6},t=process.hrtime,r=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),a=1e9*process.uptime(),i=r-a):n=Date.now?(o.exports=function(){return Date.now()-n},Date.now()):(o.exports=function(){return(new Date).getTime()-n},(new Date).getTime())}).call(a)}),Vn="undefined"==typeof window?a:window,Wn=["moz","webkit"],jn="AnimationFrame",qn=Vn["request"+jn],Xn=Vn["cancel"+jn]||Vn["cancelRequest"+jn],Yn=0;!qn&&Yn<Wn.length;Yn++)qn=Vn[Wn[Yn]+"Request"+jn],Xn=Vn[Wn[Yn]+"Cancel"+jn]||Vn[Wn[Yn]+"CancelRequest"+jn];if(!qn||!Xn){var Zn=0,Jn=0,$n=[];qn=function(e){if(0===$n.length){var t=Gn(),n=Math.max(0,1e3/60-(t-Zn));Zn=n+t,setTimeout(function(){for(var e=$n.slice(0),t=$n.length=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(Zn)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return $n.push({handle:++Jn,callback:e,cancelled:!1}),Jn},Xn=function(e){for(var t=0;t<$n.length;t++)$n[t].handle===e&&($n[t].cancelled=!0)}}function Qn(e){return qn.call(Vn,e)}Qn.cancel=function(){Xn.apply(Vn,arguments)},Qn.polyfill=function(e){e||(e=Vn),e.requestAnimationFrame=qn,e.cancelAnimationFrame=Xn},Qn.polyfill();function Kn(e){if(!g(e))return!1;try{return ir(Object,rr,e),!0}catch(e){return!1}}function er(e,t){return new(function(e){var t;return nr(e)&&(t=e.constructor,lr(t)&&(t===Array||nr(t.prototype))?t=void 0:N(t)&&null===(t=t[ur])&&(t=void 0)),void 0===t?Array:t}(e))(0===t?0:t)}function tr(h){var p=1==h,v=2==h,m=3==h,g=4==h,y=6==h,b=7==h,x=5==h||y;return function(e,t,n,r){for(var i,a,o=_(e),s=w(o),l=rn(t,n,3),u=W(s),c=0,f=r||er,d=p?f(e,u):v||b?f(e,0):void 0;c<u;c++)if((x||c in s)&&(a=l(i=s[c],c,o),h))if(p)d[c]=a;else if(a)switch(h){case 3:return!0;case 5:return i;case 6:return c;case 2:cr.call(d,i)}else switch(h){case 4:return!1;case 7:cr.call(d,i)}return y?-1:m||g?g:d}}var nr=Array.isArray||function(e){return"Array"==i(e)},rr=[],ir=h("Reflect","construct"),ar=/^\s*(?:class|function)\b/,or=ar.exec,sr=!ar.exec(function(){}),lr=!ir||m(function(){var e;return Kn(Kn.call)||!Kn(Object)||!Kn(function(){e=!0})||e})?function(e){if(!g(e))return!1;switch(gn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return sr||!!or.call(ar,Ue(e))}:Kn,ur=O("species"),cr=[].push,fr={forEach:tr(0),map:tr(1),filter:tr(2),some:tr(3),every:tr(4),find:tr(5),findIndex:tr(6),filterReject:tr(7)},dr=fr.find,hr="find",pr=!0;hr in[]&&Array(1)[hr](function(){pr=!1}),Qe({target:"Array",proto:!0,forced:pr},{find:function(e,t){return dr(this,e,1<arguments.length?t:void 0)}}),Ae(hr);function vr(e,t,n){return rn(mr,y[e].prototype[t],n)}var mr=Function.call;vr("Array","find");var gr=fr.findIndex,yr="findIndex",br=!0;yr in[]&&Array(1)[yr](function(){br=!1}),Qe({target:"Array",proto:!0,forced:br},{findIndex:function(e,t){return gr(this,e,1<arguments.length?t:void 0)}}),Ae(yr),vr("Array","findIndex");function xr(t,e,n,r){try{return r?e(D(n)[0],n[1]):e(n)}catch(e){cn(t,"throw",e)}}function wr(e,t,n){var r=H(t);r in e?fe.f(e,r,De(0,n)):e[r]=n}function _r(e,t,n){var r=_(e),i=lr(this),a=arguments.length,o=1<a?t:void 0,s=void 0!==o;s&&(o=rn(o,2<a?n:void 0,2));var l,u,c,f,d,h,p=ln(r),v=0;if(!p||this==Array&&nn(p))for(l=W(r),u=i?new this(l):Array(l);v<l;v++)h=s?o(r[v],v):r[v],wr(u,v,h);else for(d=(f=un(r,p)).next,u=i?new this:[];!(c=d.call(f)).done;v++)h=s?xr(f,o,[c.value,v],!0):c.value,wr(u,v,h);return u.length=v,u}var Sr=!Sn(function(e){Array.from(e)});Qe({target:"Array",stat:!0,forced:Sr},{from:_r}),Hn.Array.from;var Mr=Object.assign,Er=Object.defineProperty,Tr=!Mr||m(function(){if(ie&&1!==Mr({b:1},Mr(Er({},"a",{enumerable:!0,get:function(){Er(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=Mr({},e)[n]||we(Mr({},t)).join("")!=r})?function(e,t){for(var n=_(e),r=arguments.length,i=1,a=vt.f,o=at.f;i<r;)for(var s,l=w(arguments[i++]),u=a?we(l).concat(a(l)):we(l),c=u.length,f=0;f<c;)s=u[f++],ie&&!o.call(l,s)||(n[s]=l[s]);return n}:Mr;Qe({target:"Object",stat:!0,forced:Object.assign!==Tr},{assign:Tr}),Hn.Object.assign;function kr(s){return function(e){for(var t,n=u(e),r=we(n),i=r.length,a=0,o=[];a<i;)t=r[a++],ie&&!Lr.call(n,t)||o.push(s?[t,n[t]]:n[t]);return o}}var Lr=at.f,Cr={entries:kr(!0),values:kr(!1)},Rr=Cr.entries;Qe({target:"Object",stat:!0},{entries:function(e){return Rr(e)}}),Hn.Object.entries;var Pr=Cr.values;Qe({target:"Object",stat:!0},{values:function(e){return Pr(e)}}),Hn.Object.values;var Ar=function(e,t,n){var r=this,i=2<arguments.length?n:void 0;if(!(r instanceof Ar))return new Ar(e,t,i);Ut&&(r=Ut(new Error(void 0),kt(r))),void 0!==t&&Ge(r,"message",Nn(t)),function(e,t){N(t)&&"cause"in t&&Ge(e,"cause",e.cause)}(r,i);var a=[];return dn(e,a.push,{that:a}),Ge(r,"errors",a),r};Ar.prototype=Ce(Error.prototype,{constructor:De(5,Ar),message:De(5,""),name:De(5,"AggregateError")}),Qe({global:!0},{AggregateError:Ar});function Or(e,t){var n,r=D(e).constructor;return void 0===r||null==(n=D(r)[Ur])?t:function(e){if(lr(e))return e;throw TypeError(z(e)+" is not a constructor")}(n)}var Nr,Dr,Ir,zr,Fr=y.Promise,Ur=O("species"),Br=/(?:ipad|iphone|ipod).*applewebkit/i.test(L),Hr="process"==i(y.process),Gr=y.setImmediate,Vr=y.clearImmediate,Wr=y.process,jr=y.MessageChannel,qr=y.Dispatch,Xr=0,Yr={},Zr="onreadystatechange";try{Nr=y.location}catch(e){}function Jr(e){if(Yr.hasOwnProperty(e)){var t=Yr[e];delete Yr[e],t()}}function $r(e){return function(){Jr(e)}}function Qr(e){Jr(e.data)}function Kr(e){y.postMessage(String(e),Nr.protocol+"//"+Nr.host)}Gr&&Vr||(Gr=function(e){for(var t=[],n=arguments.length,r=1;r<n;)t.push(arguments[r++]);return Yr[++Xr]=function(){(g(e)?e:Function(e)).apply(void 0,t)},Dr(Xr),Xr},Vr=function(e){delete Yr[e]},Hr?Dr=function(e){Wr.nextTick($r(e))}:qr&&qr.now?Dr=function(e){qr.now($r(e))}:jr&&!Br?(zr=(Ir=new jr).port2,Ir.port1.onmessage=Qr,Dr=rn(zr.postMessage,zr,1)):y.addEventListener&&g(y.postMessage)&&!y.importScripts&&Nr&&"file:"!==Nr.protocol&&!m(Kr)?(Dr=Kr,y.addEventListener("message",Qr,!1)):Dr=Zr in I("script")?function(e){Se.appendChild(I("script"))[Zr]=function(){Se.removeChild(this),Jr(e)}}:function(e){setTimeout($r(e),0)});var ei,ti,ni,ri,ii,ai,oi,si,li={set:Gr,clear:Vr},ui=/ipad|iphone|ipod/i.test(L)&&void 0!==y.Pebble,ci=/web0s(?!.*chrome)/i.test(L),fi=st.f,di=li.set,hi=y.MutationObserver||y.WebKitMutationObserver,pi=y.document,vi=y.process,mi=y.Promise,gi=fi(y,"queueMicrotask"),yi=gi&&gi.value;yi||(ei=function(){var e,t;for(Hr&&(e=vi.domain)&&e.exit();ti;){t=ti.fn,ti=ti.next;try{t()}catch(e){throw ti?ri():ni=void 0,e}}ni=void 0,e&&e.enter()},ri=Br||Hr||ci||!hi||!pi?!ui&&mi&&mi.resolve?((oi=mi.resolve(void 0)).constructor=mi,si=oi.then,function(){si.call(oi,ei)}):Hr?function(){vi.nextTick(ei)}:function(){di.call(y,ei)}:(ii=!0,ai=pi.createTextNode(""),new hi(ei).observe(ai,{characterData:!0}),function(){ai.data=ii=!ii}));function bi(e){var n,r;this.promise=new e(function(e,t){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=e,r=t}),this.resolve=F(n),this.reject=F(r)}function xi(e,t){if(D(e),N(t)&&t.constructor===e)return t;var n=Ai.f(e);return(0,n.resolve)(t),n.promise}function wi(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}function _i(e){var t;return!(!N(e)||!g(t=e.then))&&t}function Si(f,d){if(!f.notified){f.notified=!0;var h=f.reactions;Pi(function(){for(var e=f.value,t=1==f.state,n=0;h.length>n;){var r,i,a,o=h[n++],s=t?o.ok:o.fail,l=o.resolve,u=o.reject,c=o.domain;try{s?(t||(2===f.rejection&&na(f),f.rejection=1),!0===s?r=e:(c&&c.enter(),r=s(e),c&&(c.exit(),a=!0)),r===o.promise?u(Vi("Promise-chain cycle")):(i=_i(r))?i.call(r,l,u):l(r)):u(e)}catch(e){c&&!a&&c.exit(),u(e)}}f.reactions=[],f.notified=!1,d&&!f.rejection&&ea(f)})}}function Mi(e,t,n){var r,i;Yi?((r=Wi.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),y.dispatchEvent(r)):r={promise:t,reason:n},!Zi&&(i=y["on"+e])?i(r):e===Ji&&function(e,t){var n=y.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)}function Ei(t,n,r){return function(e){t(n,e,r)}}function Ti(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Si(e,!0))}var ki,Li,Ci,Ri,Pi=yi||function(e){var t={fn:e,next:void 0};ni&&(ni.next=t),ti||(ti=t,ri()),ni=t},Ai={f:function(e){return new bi(e)}},Oi="object"==typeof window,Ni=li.set,Di=O("species"),Ii="Promise",zi=nt.get,Fi=nt.set,Ui=nt.getterFor(Ii),Bi=Fr&&Fr.prototype,Hi=Fr,Gi=Bi,Vi=y.TypeError,Wi=y.document,ji=y.process,qi=Ai.f,Xi=qi,Yi=!!(Wi&&Wi.createEvent&&y.dispatchEvent),Zi=g(y.PromiseRejectionEvent),Ji="unhandledrejection",$i=!1,Qi=_t(Ii,function(){var e=Ue(Hi),t=e!==String(Hi);if(!t&&66===Q)return!0;if(51<=Q&&/native code/.test(e))return!1;function n(e){e(function(){},function(){})}var r=new Hi(function(e){e(1)});return(r.constructor={})[Di]=n,!($i=r.then(function(){})instanceof n)||!t&&Oi&&!Zi}),Ki=Qi||!Sn(function(e){Hi.all(e).catch(function(){})}),ea=function(r){Ni.call(y,function(){var e,t=r.facade,n=r.value;if(ta(r)&&(e=wi(function(){Hr?ji.emit("unhandledRejection",n,t):Mi(Ji,t,n)}),r.rejection=Hr||ta(r)?2:1,e.error))throw e.value})},ta=function(e){return 1!==e.rejection&&!e.parent},na=function(t){Ni.call(y,function(){var e=t.facade;Hr?ji.emit("rejectionHandled",e):Mi("rejectionhandled",e,t.value)})},ra=function(n,e,t){if(!n.done){n.done=!0,t&&(n=t);try{if(n.facade===e)throw Vi("Promise can't be resolved itself");var r=_i(e);r?Pi(function(){var t={done:!1};try{r.call(e,Ei(ra,t,n),Ei(Ti,t,n))}catch(e){Ti(t,e,n)}}):(n.value=e,n.state=1,Si(n,!1))}catch(e){Ti({done:!1},e,n)}}};if(Qi&&(Gi=(Hi=function(e){hn(this,Hi,Ii),F(e),ki.call(this);var t=zi(this);try{e(Ei(ra,t),Ei(Ti,t))}catch(e){Ti(t,e)}}).prototype,(ki=function(e){Fi(this,{type:Ii,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=En(Gi,{then:function(e,t){var n=Ui(this),r=qi(Or(this,Hi));return r.ok=!g(e)||e,r.fail=g(t)&&t,r.domain=Hr?ji.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Si(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Li=function(){var e=new ki,t=zi(e);this.promise=e,this.resolve=Ei(ra,t),this.reject=Ei(Ti,t)},Ai.f=qi=function(e){return e===Hi||e===Ci?new Li(e):Xi(e)},g(Fr)&&Bi!==Object.prototype)){Ri=Bi.then,$i||(dt(Bi,"then",function(e,t){var n=this;return new Hi(function(e,t){Ri.call(n,e,t)}).then(e,t)},{unsafe:!0}),dt(Bi,"catch",Gi.catch,{unsafe:!0}));try{delete Bi.constructor}catch(e){}Ut&&Ut(Bi,Gi)}Qe({global:!0,wrap:!0,forced:Qi},{Promise:Hi}),Rt(Hi,Ii,!1),Tn(Ii),Ci=h(Ii),Qe({target:Ii,stat:!0,forced:Qi},{reject:function(e){var t=qi(this);return t.reject.call(void 0,e),t.promise}}),Qe({target:Ii,stat:!0,forced:Qi},{resolve:function(e){return xi(this,e)}}),Qe({target:Ii,stat:!0,forced:Ki},{all:function(e){var s=this,t=qi(s),l=t.resolve,u=t.reject,n=wi(function(){var r=F(s.resolve),i=[],a=0,o=1;dn(e,function(e){var t=a++,n=!1;i.push(void 0),o++,r.call(s,e).then(function(e){n||(n=!0,i[t]=e,--o||l(i))},u)}),--o||l(i)});return n.error&&u(n.value),t.promise},race:function(e){var n=this,r=qi(n),i=r.reject,t=wi(function(){var t=F(n.resolve);dn(e,function(e){t.call(n,e).then(r.resolve,i)})});return t.error&&i(t.value),r.promise}}),Qe({target:"Promise",stat:!0},{allSettled:function(e){var s=this,t=Ai.f(s),l=t.resolve,n=t.reject,r=wi(function(){var r=F(s.resolve),i=[],a=0,o=1;dn(e,function(e){var t=a++,n=!1;i.push(void 0),o++,r.call(s,e).then(function(e){n||(n=!0,i[t]={status:"fulfilled",value:e},--o||l(i))},function(e){n||(n=!0,i[t]={status:"rejected",reason:e},--o||l(i))})}),--o||l(i)});return r.error&&n(r.value),t.promise}});var ia="No one promise resolved";Qe({target:"Promise",stat:!0},{any:function(e){var l=this,t=Ai.f(l),u=t.resolve,c=t.reject,n=wi(function(){var r=F(l.resolve),i=[],a=0,o=1,s=!1;dn(e,function(e){var t=a++,n=!1;i.push(void 0),o++,r.call(l,e).then(function(e){n||s||(s=!0,u(e))},function(e){n||s||(n=!0,i[t]=e,--o||c(new(h("AggregateError"))(i,ia)))})}),--o||c(new(h("AggregateError"))(i,ia))});return n.error&&c(n.value),t.promise}});var aa=!!Fr&&m(function(){Fr.prototype.finally.call({then:function(){}},function(){})});if(Qe({target:"Promise",proto:!0,real:!0,forced:aa},{finally:function(t){var n=Or(this,h("Promise")),e=g(t);return this.then(e?function(e){return xi(n,t()).then(function(){return e})}:t,e?function(e){return xi(n,t()).then(function(){throw e})}:t)}}),g(Fr)){var oa=h("Promise").prototype.finally;Fr.prototype.finally!==oa&&dt(Fr.prototype,"finally",oa,{unsafe:!0})}Hn.Promise;function sa(e){if(function(e){var t;return N(e)&&(void 0!==(t=e[ua])?!!t:"RegExp"==i(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e}var la,ua=O("match"),ca=O("match"),fa=st.f,da="".startsWith,ha=Math.min,pa=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[ca]=!1,"/./"[t](n)}catch(e){}}return!1}("startsWith"),va=!(pa||(!(la=fa(String.prototype,"startsWith"))||la.writable));Qe({target:"String",proto:!0,forced:!va&&!pa},{startsWith:function(e,t){var n=Nn(l(this));sa(e);var r=V(ha(1<arguments.length?t:void 0,n.length)),i=Nn(e);return da?da.call(n,i,r):n.slice(r,r+i.length)===i}}),vr("String","startsWith");function ma(e){if(!N(e))return!1;var t=e[ba];return void 0!==t?!!t:nr(e)}var ga,ya=O("species"),ba=O("isConcatSpreadable"),xa=9007199254740991,wa="Maximum allowed index exceeded",_a=51<=Q||!m(function(){var e=[];return e[ba]=!1,e.concat()[0]!==e}),Sa=(ga="concat",51<=Q||!m(function(){var e=[];return(e.constructor={})[ya]=function(){return{foo:1}},1!==e[ga](Boolean).foo}));Qe({target:"Array",proto:!0,forced:!_a||!Sa},{concat:function(e){var t,n,r,i,a,o=_(this),s=er(o,0),l=0;for(t=-1,r=arguments.length;t<r;t++)if(ma(a=-1===t?o:arguments[t])){if(i=W(a),xa<l+i)throw TypeError(wa);for(n=0;n<i;n++,l++)n in a&&wr(s,l,a[n])}else{if(xa<=l)throw TypeError(wa);wr(s,l++,a)}return s.length=l,s}});function Ma(e){var t=Hn.Symbol||(Hn.Symbol={});E(t,e)||Ra(t,e,{value:Ca.f(e)})}function Ea(e,t){var n=ja[e]=Ce(Ua[Na]);return Ia(n,{type:Oa,tag:e,description:t}),ie||(n.description=t),n}function Ta(t,e){D(t);var n=u(e),r=we(n).concat(to(n));return Pa(r,function(e){ie&&!eo.call(n,e)||Ka(t,e,n[e])}),t}function ka(e,t){var n=u(e),r=H(t);if(n!==Fa||!E(ja,r)||E(qa,r)){var i=Ha(n,r);return!i||!E(ja,r)||E(n,Aa)&&n[Aa][r]||(i.enumerable=!0),i}}function La(e){var t=Va(u(e)),n=[];return Pa(t,function(e){E(ja,e)||E(ye,e)||n.push(e)}),n}var Ca={f:O},Ra=fe.f,Pa=fr.forEach,Aa=X("hidden"),Oa="Symbol",Na="prototype",Da=O("toPrimitive"),Ia=nt.set,za=nt.getterFor(Oa),Fa=Object[Na],Ua=y.Symbol,Ba=h("JSON","stringify"),Ha=st.f,Ga=fe.f,Va=Kt.f,Wa=at.f,ja=S("symbols"),qa=S("op-symbols"),Xa=S("string-to-symbol-registry"),Ya=S("symbol-to-string-registry"),Za=S("wks"),Ja=y.QObject,$a=!Ja||!Ja[Na]||!Ja[Na].findChild,Qa=ie&&m(function(){return 7!=Ce(Ga({},"a",{get:function(){return Ga(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=Ha(Fa,t);r&&delete Fa[t],Ga(e,t,n),r&&e!==Fa&&Ga(Fa,t,r)}:Ga,Ka=function(e,t,n){e===Fa&&Ka(qa,t,n),D(e);var r=H(t);return D(n),E(ja,r)?(n.enumerable?(E(e,Aa)&&e[Aa][r]&&(e[Aa][r]=!1),n=Ce(n,{enumerable:De(0,!1)})):(E(e,Aa)||Ga(e,Aa,De(1,{})),e[Aa][r]=!0),Qa(e,r,n)):Ga(e,r,n)},eo=function(e){var t=H(e),n=Wa.call(this,t);return!(this===Fa&&E(ja,t)&&!E(qa,t))&&(!(n||!E(this,t)||!E(ja,t)||E(this,Aa)&&this[Aa][t])||n)},to=function(e){var t=e===Fa,n=Va(t?qa:u(e)),r=[];return Pa(n,function(e){!E(ja,e)||t&&!E(Fa,e)||r.push(ja[e])}),r};if(K||(dt((Ua=function(e){if(this instanceof Ua)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==e?Nn(e):void 0,n=f(t),r=function(e){this===Fa&&r.call(qa,e),E(this,Aa)&&E(this[Aa],n)&&(this[Aa][n]=!1),Qa(this,n,De(1,e))};return ie&&$a&&Qa(Fa,n,{configurable:!0,set:r}),Ea(n,t)})[Na],"toString",function(){return za(this).tag}),dt(Ua,"withoutSetter",function(e){return Ea(f(e),e)}),at.f=eo,fe.f=Ka,st.f=ka,pt.f=Kt.f=La,vt.f=to,Ca.f=function(e){return Ea(O(e),e)},ie&&(Ga(Ua[Na],"description",{configurable:!0,get:function(){return za(this).description}}),dt(Fa,"propertyIsEnumerable",eo,{unsafe:!0}))),Qe({global:!0,wrap:!0,forced:!K,sham:!K},{Symbol:Ua}),Pa(we(Za),function(e){Ma(e)}),Qe({target:Oa,stat:!0,forced:!K},{for:function(e){var t=Nn(e);if(E(Xa,t))return Xa[t];var n=Ua(t);return Xa[t]=n,Ya[n]=t,n},keyFor:function(e){if(!le(e))throw TypeError(e+" is not a symbol");if(E(Ya,e))return Ya[e]},useSetter:function(){$a=!0},useSimple:function(){$a=!1}}),Qe({target:"Object",stat:!0,forced:!K,sham:!ie},{create:function(e,t){return void 0===t?Ce(e):Ta(Ce(e),t)},defineProperty:Ka,defineProperties:Ta,getOwnPropertyDescriptor:ka}),Qe({target:"Object",stat:!0,forced:!K},{getOwnPropertyNames:La,getOwnPropertySymbols:to}),Qe({target:"Object",stat:!0,forced:m(function(){vt.f(1)})},{getOwnPropertySymbols:function(e){return vt.f(_(e))}}),Ba){var no=!K||m(function(){var e=Ua();return"[null]"!=Ba([e])||"{}"!=Ba({a:e})||"{}"!=Ba(Object(e))});Qe({target:"JSON",stat:!0,forced:no},{stringify:function(e,t,n){for(var r,i=[e],a=1;a<arguments.length;)i.push(arguments[a++]);if((N(r=t)||void 0!==e)&&!le(e))return nr(t)||(t=function(e,t){if(g(r)&&(t=r.call(this,e,t)),!le(t))return t}),i[1]=t,Ba.apply(null,i)}})}if(!Ua[Na][Da]){var ro=Ua[Na].valueOf;dt(Ua[Na],Da,function(){return ro.apply(this,arguments)})}Rt(Ua,Oa),ye[Aa]=!0,Ma("asyncIterator");var io=fe.f,ao=y.Symbol;if(ie&&g(ao)&&(!("description"in ao.prototype)||void 0!==ao().description)){var oo={},so=function(e){var t=arguments.length<1||void 0===e?void 0:String(e),n=this instanceof so?new ao(t):void 0===t?ao():ao(t);return""===t&&(oo[n]=!0),n};Je(so,ao);var lo=so.prototype=ao.prototype;lo.constructor=so;var uo=lo.toString,co="Symbol(test)"==String(ao("test")),fo=/^Symbol\((.*)\)[^)]+$/;io(lo,"description",{configurable:!0,get:function(){var e=N(this)?this.valueOf():this,t=uo.call(e);if(E(oo,e))return"";var n=co?t.slice(7,-1):t.replace(fo,"$1");return""===n?void 0:n}}),Qe({global:!0,forced:!0},{Symbol:so})}Ma("hasInstance"),Ma("isConcatSpreadable"),Ma("iterator"),Ma("match"),Ma("matchAll"),Ma("replace"),Ma("search"),Ma("species"),Ma("split"),Ma("toPrimitive"),Ma("toStringTag"),Ma("unscopables"),Rt(y.JSON,"JSON",!0),Rt(Math,"Math",!0),Qe({global:!0},{Reflect:{}}),Rt(y.Reflect,"Reflect",!0),Hn.Symbol;function ho(e){return e+22+75*(e<26)}function po(e,t,n){var r=0;for(e=n?Co(e/700):e>>1,e+=Co(e/t);455<e;r+=36)e=Co(e/35);return Co(r+36*e/(e+38))}function vo(e){var t,n,r=[],i=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(55296<=i&&i<=56319&&n<r){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),n--)}else t.push(i)}return t}(e)).length,a=128,o=0,s=72;for(t=0;t<e.length;t++)(n=e[t])<128&&r.push(Ro(n));var l=r.length,u=l;for(l&&r.push("-");u<i;){var c=Eo;for(t=0;t<e.length;t++)a<=(n=e[t])&&n<c&&(c=n);var f=u+1;if(c-a>Co((Eo-o)/f))throw RangeError(Lo);for(o+=(c-a)*f,a=c,t=0;t<e.length;t++){if((n=e[t])<a&&++o>Eo)throw RangeError(Lo);if(n==a){for(var d=o,h=36;;h+=36){var p=h<=s?1:s+26<=h?26:h-s;if(d<p)break;var v=d-p,m=36-p;r.push(Ro(ho(p+v%m))),d=Co(v/m)}r.push(Ro(ho(d))),s=po(o,f,u==l),o=0,++u}}++o,++a}return r.join("")}function mo(t){try{return decodeURIComponent(t)}catch(e){return t}}function go(e){var t,n=e.replace(Ho," "),r=4;try{return decodeURIComponent(n)}catch(e){for(;r;)n=n.replace((t=r--,Go[t-1]||(Go[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))),mo);return n}}function yo(e){return Wo[e]}function bo(e){return encodeURIComponent(e).replace(Vo,yo)}function xo(e,t){if(t)for(var n,r,i=t.split("&"),a=0;a<i.length;)(n=i[a++]).length&&(r=n.split("="),e.push({key:go(r.shift()),value:go(r.join("="))}))}function wo(e){this.entries.length=0,xo(this.entries,e)}function _o(e,t){if(e<t)throw TypeError("Not enough arguments")}var So=O("iterator"),Mo=!m(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),n=e.searchParams,r="";return e.pathname="c%20d",n.forEach(function(e,t){n.delete("b"),r+=t+e}),!n.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==n.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!n[So]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}),Eo=2147483647,To=/[^\0-\u007E]/,ko=/[.\u3002\uFF0E\uFF61]/g,Lo="Overflow: input needs wider integers to process",Co=Math.floor,Ro=String.fromCharCode,Po=h("fetch"),Ao=h("Request"),Oo=Ao&&Ao.prototype,No=h("Headers"),Do=O("iterator"),Io="URLSearchParams",zo=Io+"Iterator",Fo=nt.set,Uo=nt.getterFor(Io),Bo=nt.getterFor(zo),Ho=/\+/g,Go=Array(4),Vo=/[!'()~]|%20/g,Wo={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},jo=At(function(e,t){Fo(this,{type:zo,iterator:un(Uo(e).entries),kind:t})},"Iterator",function(){var e=Bo(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n}),qo=function(e){hn(this,qo,Io);var t,n,r,i,a,o,s,l,u,c=0<arguments.length?e:void 0,f=[];if(Fo(this,{type:Io,entries:f,updateURL:function(){},updateSearchParams:wo}),void 0!==c)if(N(c))if(t=ln(c))for(r=(n=un(c,t)).next;!(i=r.call(n)).done;){if((s=(o=(a=un(D(i.value))).next).call(a)).done||(l=o.call(a)).done||!o.call(a).done)throw TypeError("Expected sequence with length 2");f.push({key:Nn(s.value),value:Nn(l.value)})}else for(u in c)E(c,u)&&f.push({key:u,value:Nn(c[u])});else xo(f,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:Nn(c))},Xo=qo.prototype;if(En(Xo,{append:function(e,t){_o(arguments.length,2);var n=Uo(this);n.entries.push({key:Nn(e),value:Nn(t)}),n.updateURL()},delete:function(e){_o(arguments.length,1);for(var t=Uo(this),n=t.entries,r=Nn(e),i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL()},get:function(e){_o(arguments.length,1);for(var t=Uo(this).entries,n=Nn(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){_o(arguments.length,1);for(var t=Uo(this).entries,n=Nn(e),r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){_o(arguments.length,1);for(var t=Uo(this).entries,n=Nn(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){_o(arguments.length,1);for(var n,r=Uo(this),i=r.entries,a=!1,o=Nn(e),s=Nn(t),l=0;l<i.length;l++)(n=i[l]).key===o&&(a?i.splice(l--,1):(a=!0,n.value=s));a||i.push({key:o,value:s}),r.updateURL()},sort:function(){var e,t,n,r=Uo(this),i=r.entries,a=i.slice();for(n=i.length=0;n<a.length;n++){for(e=a[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e,t){for(var n,r=Uo(this).entries,i=rn(e,1<arguments.length?t:void 0,3),a=0;a<r.length;)i((n=r[a++]).value,n.key,this)},keys:function(){return new jo(this,"keys")},values:function(){return new jo(this,"values")},entries:function(){return new jo(this,"entries")}},{enumerable:!0}),dt(Xo,Do,Xo.entries,{name:"entries"}),dt(Xo,"toString",function(){for(var e,t=Uo(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(bo(e.key)+"="+bo(e.value));return n.join("&")},{enumerable:!0}),Rt(qo,Io),Qe({global:!0,forced:!Mo},{URLSearchParams:qo}),!Mo&&g(No)){var Yo=function(e){if(N(e)){var t,n=e.body;if(gn(n)===Io)return(t=e.headers?new No(e.headers):new No).has("content-type")||t.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),Ce(e,{body:De(0,String(n)),headers:De(0,t)})}return e};if(g(Po)&&Qe({global:!0,enumerable:!0,forced:!0},{fetch:function(e,t){return Po(e,1<arguments.length?Yo(t):{})}}),g(Ao)){var Zo=function(e,t){return hn(this,Zo,"Request"),new Ao(e,1<arguments.length?Yo(t):{})};(Oo.constructor=Zo).prototype=Oo,Qe({global:!0,forced:!0},{Request:Zo})}}function Jo(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return ms;if(!(n=Rs(t.slice(1,-1))))return ms;e.host=n}else if(zs(e)){if(t=function(e){var t,n,r=[],i=e.toLowerCase().replace(ko,".").split(".");for(t=0;t<i.length;t++)n=i[t],r.push(To.test(n)?"xn--"+vo(n):n);return r.join(".")}(t),Es.test(t))return ms;if(null===(n=Cs(t)))return ms;e.host=n}else{if(Ts.test(t))return ms;for(n="",r=_r(t),i=0;i<r.length;i++)n+=Ds(r[i],Ps);e.host=n}}function $o(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=hs(e/256);return t.join(".")}if("object"!=typeof e)return e;for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(n<i&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return n<i&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}function Qo(e){return""!=e.username||""!=e.password}function Ko(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme}function es(e,t){var n;return 2==e.length&&ys.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)}function ts(e){var t;return 1<e.length&&es(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)}function ns(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&es(t[0],!0)||t.pop()}function rs(e,t,n,r){var i,a,o,s,l,u,c=n||Fs,f=0,d="",h=!1,p=!1,v=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(ks,"")),t=t.replace(Ls,""),i=_r(t);f<=i.length;){switch(a=i[f],c){case Fs:if(!a||!ys.test(a)){if(n)return vs;c=Bs;continue}d+=a.toLowerCase(),c=Us;break;case Us:if(a&&(bs.test(a)||"+"==a||"-"==a||"."==a))d+=a.toLowerCase();else{if(":"!=a){if(n)return vs;d="",c=Bs,f=0;continue}if(n&&(zs(e)!=E(Is,d)||"file"==d&&(Qo(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=d,n)return void(zs(e)&&Is[e.scheme]==e.port&&(e.port=null));d="","file"==e.scheme?c=$s:zs(e)&&r&&r.scheme==e.scheme?c=Hs:zs(e)?c=js:"/"==i[f+1]?(c=Gs,f++):(e.cannotBeABaseURL=!0,e.path.push(""),c=nl)}break;case Bs:if(!r||r.cannotBeABaseURL&&"#"!=a)return vs;if(r.cannotBeABaseURL&&"#"==a){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,c=il;break}c="file"==r.scheme?$s:Vs;continue;case Hs:if("/"!=a||"/"!=i[f+1]){c=Vs;continue}c=qs,f++;break;case Gs:if("/"==a){c=Xs;break}c=tl;continue;case Vs:if(e.scheme=r.scheme,a==as)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==a||"\\"==a&&zs(e))c=Ws;else if("?"==a)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",c=rl;else{if("#"!=a){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),c=tl;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",c=il}break;case Ws:if(!zs(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,c=tl;continue}c=Xs}else c=qs;break;case js:if(c=qs,"/"!=a||"/"!=d.charAt(f+1))continue;f++;break;case qs:if("/"==a||"\\"==a)break;c=Xs;continue;case Xs:if("@"==a){h&&(d="%40"+d),h=!0,o=_r(d);for(var m=0;m<o.length;m++){var g=o[m];if(":"!=g||v){var y=Ds(g,Ns);v?e.password+=y:e.username+=y}else v=!0}d=""}else if(a==as||"/"==a||"?"==a||"#"==a||"\\"==a&&zs(e)){if(h&&""==d)return"Invalid authority";f-=_r(d).length+1,d="",c=Ys}else d+=a;break;case Ys:case Zs:if(n&&"file"==e.scheme){c=Ks;continue}if(":"!=a||p){if(a==as||"/"==a||"?"==a||"#"==a||"\\"==a&&zs(e)){if(zs(e)&&""==d)return ms;if(n&&""==d&&(Qo(e)||null!==e.port))return;if(s=Jo(e,d))return s;if(d="",c=el,n)return;continue}"["==a?p=!0:"]"==a&&(p=!1),d+=a}else{if(""==d)return ms;if(s=Jo(e,d))return s;if(d="",c=Js,n==Zs)return}break;case Js:if(!xs.test(a)){if(a==as||"/"==a||"?"==a||"#"==a||"\\"==a&&zs(e)||n){if(""!=d){var b=parseInt(d,10);if(65535<b)return gs;e.port=zs(e)&&b===Is[e.scheme]?null:b,d=""}if(n)return;c=el;continue}return gs}d+=a;break;case $s:if(e.scheme="file","/"==a||"\\"==a)c=Qs;else{if(!r||"file"!=r.scheme){c=tl;continue}if(a==as)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==a)e.host=r.host,e.path=r.path.slice(),e.query="",c=rl;else{if("#"!=a){ts(i.slice(f).join(""))||(e.host=r.host,e.path=r.path.slice(),ns(e)),c=tl;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",c=il}}break;case Qs:if("/"==a||"\\"==a){c=Ks;break}r&&"file"==r.scheme&&!ts(i.slice(f).join(""))&&(es(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),c=tl;continue;case Ks:if(a==as||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&es(d))c=tl;else if(""==d){if(e.host="",n)return;c=el}else{if(s=Jo(e,d))return s;if("localhost"==e.host&&(e.host=""),n)return;d="",c=el}continue}d+=a;break;case el:if(zs(e)){if(c=tl,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=as&&(c=tl,"/"!=a))continue}else e.fragment="",c=il;else e.query="",c=rl;break;case tl:if(a==as||"/"==a||"\\"==a&&zs(e)||!n&&("?"==a||"#"==a)){if(".."===(u=(u=d).toLowerCase())||"%2e."===u||".%2e"===u||"%2e%2e"===u?(ns(e),"/"==a||"\\"==a&&zs(e)||e.path.push("")):"."===(l=d)||"%2e"===l.toLowerCase()?"/"==a||"\\"==a&&zs(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&es(d)&&(e.host&&(e.host=""),d=d.charAt(0)+":"),e.path.push(d)),d="","file"==e.scheme&&(a==as||"?"==a||"#"==a))for(;1<e.path.length&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",c=rl):"#"==a&&(e.fragment="",c=il)}else d+=Ds(a,Os);break;case nl:"?"==a?(e.query="",c=rl):"#"==a?(e.fragment="",c=il):a!=as&&(e.path[0]+=Ds(a,Ps));break;case rl:n||"#"!=a?a!=as&&("'"==a&&zs(e)?e.query+="%27":e.query+="#"==a?"%23":Ds(a,Ps)):(e.fragment="",c=il);break;case il:a!=as&&(e.fragment+=Ds(a,As))}f++}}function is(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}}var as,os={URLSearchParams:qo,getState:Uo},ss=In.codeAt,ls=y.URL,us=os.URLSearchParams,cs=os.getState,fs=nt.set,ds=nt.getterFor("URL"),hs=Math.floor,ps=Math.pow,vs="Invalid scheme",ms="Invalid host",gs="Invalid port",ys=/[A-Za-z]/,bs=/[\d+-.A-Za-z]/,xs=/\d/,ws=/^0x/i,_s=/^[0-7]+$/,Ss=/^\d+$/,Ms=/^[\dA-Fa-f]+$/,Es=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ts=/[\0\t\n\r #/:<>?@[\\\]^|]/,ks=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Ls=/[\t\n\r]/g,Cs=function(e){var t,n,r,i,a,o,s,l=e.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),4<(t=l.length))return e;for(n=[],r=0;r<t;r++){if(""==(i=l[r]))return e;if(a=10,1<i.length&&"0"==i.charAt(0)&&(a=ws.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)o=0;else{if(!(10==a?Ss:8==a?_s:Ms).test(i))return e;o=parseInt(i,a)}n.push(o)}for(r=0;r<t;r++)if(o=n[r],r==t-1){if(o>=ps(256,5-t))return null}else if(255<o)return null;for(s=n.pop(),r=0;r<n.length;r++)s+=n[r]*ps(256,3-r);return s},Rs=function(e){function t(){return e.charAt(d)}var n,r,i,a,o,s,l,u=[0,0,0,0,0,0,0,0],c=0,f=null,d=0;if(":"==t()){if(":"!=e.charAt(1))return;d+=2,f=++c}for(;t();){if(8==c)return;if(":"!=t()){for(n=r=0;r<4&&Ms.test(t());)n=16*n+parseInt(t(),16),d++,r++;if("."==t()){if(0==r)return;if(d-=r,6<c)return;for(i=0;t();){if(a=null,0<i){if(!("."==t()&&i<4))return;d++}if(!xs.test(t()))return;for(;xs.test(t());){if(o=parseInt(t(),10),null===a)a=o;else{if(0==a)return;a=10*a+o}if(255<a)return;d++}u[c]=256*u[c]+a,2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==t()){if(d++,!t())return}else if(t())return;u[c++]=n}else{if(null!==f)return;d++,f=++c}}if(null!==f)for(s=c-f,c=7;0!=c&&0<s;)l=u[c],u[c--]=u[f+s-1],u[f+--s]=l;else if(8!=c)return;return u},Ps={},As=Tr({},Ps,{" ":1,'"':1,"<":1,">":1,"`":1}),Os=Tr({},As,{"#":1,"?":1,"{":1,"}":1}),Ns=Tr({},Os,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ds=function(e,t){var n=ss(e,0);return 32<n&&n<127&&!E(t,e)?e:encodeURIComponent(e)},Is={ftp:21,file:null,http:80,https:443,ws:80,wss:443},zs=function(e){return E(Is,e.scheme)},Fs={},Us={},Bs={},Hs={},Gs={},Vs={},Ws={},js={},qs={},Xs={},Ys={},Zs={},Js={},$s={},Qs={},Ks={},el={},tl={},nl={},rl={},il={},al=function(e,t){var n,r,i=hn(this,al,"URL"),a=1<arguments.length?t:void 0,o=Nn(e),s=fs(i,{type:"URL"});if(void 0!==a)if(a instanceof al)n=ds(a);else if(r=rs(n={},Nn(a)))throw TypeError(r);if(r=rs(s,o,null,n))throw TypeError(r);var l=s.searchParams=new us,u=cs(l);u.updateSearchParams(s.query),u.updateURL=function(){s.query=String(l)||null},ie||(i.href=sl.call(i),i.origin=ll.call(i),i.protocol=ul.call(i),i.username=cl.call(i),i.password=fl.call(i),i.host=dl.call(i),i.hostname=hl.call(i),i.port=pl.call(i),i.pathname=vl.call(i),i.search=ml.call(i),i.searchParams=gl.call(i),i.hash=yl.call(i))},ol=al.prototype,sl=function(){var e=ds(this),t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,o=e.path,s=e.query,l=e.fragment,u=t+":";return null!==i?(u+="//",Qo(e)&&(u+=n+(r?":"+r:"")+"@"),u+=$o(i),null!==a&&(u+=":"+a)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(u+="?"+s),null!==l&&(u+="#"+l),u},ll=function(){var e=ds(this),t=e.scheme,n=e.port;if("blob"==t)try{return new al(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&zs(e)?t+"://"+$o(e.host)+(null!==n?":"+n:""):"null"},ul=function(){return ds(this).scheme+":"},cl=function(){return ds(this).username},fl=function(){return ds(this).password},dl=function(){var e=ds(this),t=e.host,n=e.port;return null===t?"":null===n?$o(t):$o(t)+":"+n},hl=function(){var e=ds(this).host;return null===e?"":$o(e)},pl=function(){var e=ds(this).port;return null===e?"":String(e)},vl=function(){var e=ds(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},ml=function(){var e=ds(this).query;return e?"?"+e:""},gl=function(){return ds(this).searchParams},yl=function(){var e=ds(this).fragment;return e?"#"+e:""};if(ie&&_e(ol,{href:is(sl,function(e){var t=ds(this),n=Nn(e),r=rs(t,n);if(r)throw TypeError(r);cs(t.searchParams).updateSearchParams(t.query)}),origin:is(ll),protocol:is(ul,function(e){var t=ds(this);rs(t,Nn(e)+":",Fs)}),username:is(cl,function(e){var t=ds(this),n=_r(Nn(e));if(!Ko(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=Ds(n[r],Ns)}}),password:is(fl,function(e){var t=ds(this),n=_r(Nn(e));if(!Ko(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=Ds(n[r],Ns)}}),host:is(dl,function(e){var t=ds(this);t.cannotBeABaseURL||rs(t,Nn(e),Ys)}),hostname:is(hl,function(e){var t=ds(this);t.cannotBeABaseURL||rs(t,Nn(e),Zs)}),port:is(pl,function(e){var t=ds(this);Ko(t)||(""==(e=Nn(e))?t.port=null:rs(t,e,Js))}),pathname:is(vl,function(e){var t=ds(this);t.cannotBeABaseURL||(t.path=[],rs(t,Nn(e),el))}),search:is(ml,function(e){var t=ds(this);""==(e=Nn(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",rs(t,e,rl)),cs(t.searchParams).updateSearchParams(t.query)}),searchParams:is(gl),hash:is(yl,function(e){var t=ds(this);""!=(e=Nn(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",rs(t,e,il)):t.fragment=null})}),dt(ol,"toJSON",function(){return sl.call(this)},{enumerable:!0}),dt(ol,"toString",function(){return sl.call(this)},{enumerable:!0}),ls){var bl=ls.createObjectURL,xl=ls.revokeObjectURL;bl&&dt(al,"createObjectURL",function(e){return bl.apply(ls,arguments)}),xl&&dt(al,"revokeObjectURL",function(e){return xl.apply(ls,arguments)})}function wl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wl(Object(n),!0).forEach(function(e){Cl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Sl(e){return(Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ml(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function El(s){return function(){var e=this,o=arguments;return new Promise(function(t,n){var r=s.apply(e,o);function i(e){Ml(r,t,n,i,a,"next",e)}function a(e){Ml(r,t,n,i,a,"throw",e)}i(void 0)})}}function Tl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ll(e,t,n){return t&&kl(e.prototype,t),n&&kl(e,n),e}function Cl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rl(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Al(e,t)}function Pl(e){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Al(e,t){return(Al=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ol(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Nl(e,t,n){return(Nl=Ol()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Al(i,n.prototype),i}).apply(null,arguments)}function Dl(e){var n="function"==typeof Map?new Map:void 0;return(Dl=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return Nl(e,arguments,Pl(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Al(t,e)})(e)}function Il(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fl(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zl(e)}function Ul(r){var i=Ol();return function(){var e,t=Pl(r);if(i){var n=Pl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Fl(this,e)}}function Bl(e,t,n){return(Bl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Pl(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function Hl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return a}(e,t)||Vl(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gl(e){return function(e){if(Array.isArray(e))return Wl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Vl(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vl(e,t){if(e){if("string"==typeof e)return Wl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wl(e,t):void 0}}function Wl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Vl(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}Rt(al,"URL"),Qe({global:!0,forced:!Mo,sham:!ie},{URL:al}),Qe({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}}),Hn.URL,s(function(e){var t=function(o){var l,e=Object.prototype,c=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},i=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new L(r||[]);return a._invoke=function(a,o,s){var l=u;return function(e,t){if(l===h)throw new Error("Generator is already running");if(l===p){if("throw"===e)throw t;return R()}for(s.method=e,s.arg=t;;){var n=s.delegate;if(n){var r=E(n,s);if(r){if(r===v)continue;return r}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(l===u)throw l=p,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);l=h;var i=f(a,o,s);if("normal"===i.type){if(l=s.done?p:d,i.arg===v)continue;return{value:i.arg,done:s.done}}"throw"===i.type&&(l=p,s.method="throw",s.arg=i.arg)}}}(e,n,o),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}o.wrap=s;var u="suspendedStart",d="suspendedYield",h="executing",p="completed",v={};function m(){}function g(){}function y(){}var b={};a(b,i,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x(C([])));w&&w!==e&&c.call(w,i)&&(b=w);var _=y.prototype=m.prototype=Object.create(b);function S(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function M(l,u){var t;this._invoke=function(n,r){function e(){return new u(function(e,t){!function t(e,n,r,i){var a=f(l[e],l,n);if("throw"!==a.type){var o=a.arg,s=o.value;return s&&"object"===Sl(s)&&c.call(s,"__await")?u.resolve(s.__await).then(function(e){t("next",e,r,i)},function(e){t("throw",e,r,i)}):u.resolve(s).then(function(e){o.value=e,r(o)},function(e){return t("throw",e,r,i)})}i(a.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}}function E(e,t){var n=e.iterator[t.method];if(n===l){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=l,E(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=l),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(c.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=l,e.done=!0,e};return r.next=r}}return{next:R}}function R(){return{value:l,done:!0}}return a(_,"constructor",g.prototype=y),a(y,"constructor",g),g.displayName=a(y,r,"GeneratorFunction"),o.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,a(e,r,"GeneratorFunction")),e.prototype=Object.create(_),e},o.awrap=function(e){return{__await:e}},S(M.prototype),a(M.prototype,n,function(){return this}),o.AsyncIterator=M,o.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var a=new M(s(e,t,n,r),i);return o.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},S(_),a(_,r,"Generator"),a(_,i,function(){return this}),a(_,"toString",function(){return"[object Generator]"}),o.keys=function(n){var r=[];for(var e in n)r.push(e);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},o.values=C,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&c.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=l)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return a.type="throw",a.arg=n,r.next=e,t&&(r.method="next",r.arg=l),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var o=c.call(i,"catchLoc"),s=c.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&c.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=l),v}},o}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":Sl(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}});for(var ql,Xl=.12,Yl={DEXTER:"dexter",SINISTER:"sinister"},Zl={TOP:"top",LEFT:"left",BOTTOM:"bottom",RIGHT:"right"},Jl={VERTICAL:"vertical",HORIZONTAL:"horizontal",OUTRIGGER:"outrigger",CROSSBAR:"crossbar",GALLERY:"gallery",AUSTRALIAN:"australian"},$l={NONE:"none",TOP_RIGHT:"topright",TOP_LEFT:"topleft"},Ql=0,Kl=1,eu=2,tu=1,nu=2,ru=3,iu=0,au=1,ou=2,su=0,lu=1,uu=2,cu=3,fu=4,du=5,hu=100,pu=101,vu=102,mu=103,gu=104,yu=200,bu=201,xu=202,wu=203,_u=204,Su=205,Mu=206,Eu=207,Tu=208,ku=209,Lu=210,Cu=0,Ru=1,Pu=2,Au=3,Ou=4,Nu=5,Du=6,Iu=7,zu=0,Fu=1,Uu=2,Bu=0,Hu=1,Gu=2,Vu=3,Wu=4,ju=5,qu=301,Xu=302,Yu=303,Zu=304,Ju=306,$u=307,Qu=1e3,Ku=1001,ec=1002,tc=1003,nc=1004,rc=1005,ic=1006,ac=1007,oc=1008,sc=1009,lc=1010,uc=1011,cc=1012,fc=1013,dc=1014,hc=1015,pc=1016,vc=1017,mc=1018,gc=1019,yc=1020,bc=1021,xc=1022,wc=1023,_c=1024,Sc=1025,Mc=wc,Ec=1026,Tc=1027,kc=1028,Lc=1029,Cc=1030,Rc=1031,Pc=1032,Ac=1033,Oc=33776,Nc=33777,Dc=33778,Ic=33779,zc=35840,Fc=35841,Uc=35842,Bc=35843,Hc=36196,Gc=37492,Vc=37496,Wc=37808,jc=37809,qc=37810,Xc=37811,Yc=37812,Zc=37813,Jc=37814,$c=37815,Qc=37816,Kc=37817,ef=37818,tf=37819,nf=37820,rf=37821,af=36492,of=37840,sf=37841,lf=37842,uf=37843,cf=37844,ff=37845,df=37846,hf=37847,pf=37848,vf=37849,mf=37850,gf=37851,yf=37852,bf=37853,xf=3e3,wf=3001,_f=3007,Sf=3002,Mf=3003,Ef=3004,Tf=3005,kf=3006,Lf=3201,Cf=0,Rf=1,Pf=35044,Af=35048,Of="300 es",Nf=function(){function e(){Tl(this,e)}return Ll(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e);e.target=null}}}}]),e}(),Df=Math.PI/180,If=180/Math.PI,zf=[],Ff=0;Ff<256;Ff++)zf[Ff]=(Ff<16?"0":"")+Ff.toString(16);var Uf="undefined"!=typeof crypto&&"randomUUID"in crypto;function Bf(){if(Uf)return crypto.randomUUID().toUpperCase();var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(zf[255&e]+zf[e>>8&255]+zf[e>>16&255]+zf[e>>24&255]+"-"+zf[255&t]+zf[t>>8&255]+"-"+zf[t>>16&15|64]+zf[t>>24&255]+"-"+zf[63&n|128]+zf[n>>8&255]+"-"+zf[n>>16&255]+zf[n>>24&255]+zf[255&r]+zf[r>>8&255]+zf[r>>16&255]+zf[r>>24&255]).toUpperCase()}function Hf(e,t,n){return Math.max(t,Math.min(n,e))}function Gf(e,t,n){return(1-n)*e+n*t}function Vf(e){return 0==(e&e-1)&&0!==e}function Wf(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var jf=function(){function n(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;Tl(this,n),this.x=e,this.y=t}return Ll(n,[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e,t){return void 0!==t?(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)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(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)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var 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}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(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}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){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}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:0;return this.x=e[n],this.y=e[n+1],this}},{key:"toArray",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0;return n[r]=this.x,n[r+1]=this.y,n}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:case"end":return e.stop()}},e,this)})}]),n}();jf.prototype.isVector2=!0;var qf,Xf=function(){function e(){Tl(this,e),this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}return Ll(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,l){var u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=l,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var 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}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var 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}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],u=n[4],c=n[7],f=n[2],d=n[5],h=n[8],p=r[0],v=r[3],m=r[6],g=r[1],y=r[4],b=r[7],x=r[2],w=r[5],_=r[8];return i[0]=a*p+o*g+s*x,i[3]=a*v+o*y+s*w,i[6]=a*m+o*b+s*_,i[1]=l*p+u*g+c*x,i[4]=l*v+u*y+c*w,i[7]=l*m+u*b+c*_,i[2]=f*p+d*g+h*x,i[5]=f*v+d*y+h*w,i[8]=f*m+d*b+h*_,this}},{key:"multiplyScalar",value:function(e){var 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}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*a*u-t*o*l-n*i*u+n*o*s+r*i*l-r*a*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=u*a-o*l,f=o*s-u*i,d=l*i-a*s,h=t*c+n*f+r*d;if(0==h)return this.set(0,0,0,0,0,0,0,0,0);var p=1/h;return e[0]=c*p,e[1]=(r*l-u*n)*p,e[2]=(o*n-r*a)*p,e[3]=f*p,e[4]=(u*t-r*s)*p,e[5]=(r*i-o*t)*p,e[6]=d*p,e[7]=(n*s-l*t)*p,e[8]=(a*t-n*i)*p,this}},{key:"transpose",value:function(){var e,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}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var 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}},{key:"setUvTransform",value:function(e,t,n,r,i,a,o){var s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}},{key:"scale",value:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],u=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*u,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*u,this}},{key:"translate",value:function(e,t){var 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}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e,t){for(var n=1<arguments.length&&void 0!==t?t:0,r=0;r<9;r++)this.elements[r]=e[r+n];return this}},{key:"toArray",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0,i=this.elements;return n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3],n[r+4]=i[4],n[r+5]=i[5],n[r+6]=i[6],n[r+7]=i[7],n[r+8]=i[8],n}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}]),e}();function Yf(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}function Zf(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}Xf.prototype.isMatrix3=!0;var Jf=function(){function e(){Tl(this,e)}return Ll(e,null,[{key:"getDataURL",value:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===qf&&(qf=Zf("canvas")),qf.width=e.width,qf.height=e.height;var n=qf.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=qf}return 2048<t.width||2048<t.height?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}]),e}(),$f=0,Qf=function(){Rl(d,Nf);var f=Ul(d);function d(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:d.DEFAULT_IMAGE,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:d.DEFAULT_MAPPING,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:Ku,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:Ku,a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:ic,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:oc,s=6<arguments.length&&void 0!==arguments[6]?arguments[6]:wc,l=7<arguments.length&&void 0!==arguments[7]?arguments[7]:sc,u=8<arguments.length&&void 0!==arguments[8]?arguments[8]:1,c=9<arguments.length&&void 0!==arguments[9]?arguments[9]:xf;return Tl(this,d),e=f.call(this),Object.defineProperty(zl(e),"id",{value:$f++}),e.uuid=Bf(),e.name="",e.image=t,e.mipmaps=[],e.mapping=n,e.wrapS=r,e.wrapT=i,e.magFilter=a,e.minFilter=o,e.anisotropy=u,e.format=s,e.internalFormat=null,e.type=l,e.offset=new jf(0,0),e.repeat=new jf(1,1),e.center=new jf(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new Xf,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.encoding=c,e.version=0,e.onUpdate=null,e.isRenderTargetTexture=!1,e}return Ll(d,[{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(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}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var 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(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=Bf()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)r[a].isDataTexture?i.push(Kf(r[a].image)):i.push(Kf(r[a]))}else i=Kf(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||1<e.x)switch(this.wrapS){case Qu:e.x=e.x-Math.floor(e.x);break;case Ku:e.x=e.x<0?0:1;break;case ec:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||1<e.y)switch(this.wrapT){case Qu:e.y=e.y-Math.floor(e.y);break;case Ku:e.y=e.y<0?0:1;break;case ec:1===Math.abs(Math.floor(e.y)%2)?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}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),d}();function Kf(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Jf.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Qf.DEFAULT_IMAGE=void 0,Qf.DEFAULT_MAPPING=300,Qf.prototype.isTexture=!0;var ed=function(){function i(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;Tl(this,i),this.x=e,this.y=t,this.z=n,this.w=r}return Ll(i,[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e,t){return void 0!==t?(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)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(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}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(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)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(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}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var 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}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,a=e.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],f=a[9],d=a[2],h=a[6],p=a[10];if(Math.abs(s-u)<.01&&Math.abs(l-d)<.01&&Math.abs(f-h)<.01){if(Math.abs(s+u)<.1&&Math.abs(l+d)<.1&&Math.abs(f+h)<.1&&Math.abs(o+c+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var v=(o+1)/2,m=(c+1)/2,g=(p+1)/2,y=(s+u)/4,b=(l+d)/4,x=(f+h)/4;return m<v&&g<v?i=v<.01?(n=0,r=.707106781):(r=y/(n=Math.sqrt(v)),b/n):g<m?i=m<.01?(r=0,n=.707106781):(n=y/(r=Math.sqrt(m)),x/r):g<.01?(r=n=.707106781,i=0):(n=b/(i=Math.sqrt(g)),r=x/i),this.set(n,r,i,t),this}var w=Math.sqrt((h-f)*(h-f)+(l-d)*(l-d)+(u-s)*(u-s));return Math.abs(w)<.001&&(w=1),this.x=(h-f)/w,this.y=(l-d)/w,this.z=(u-s)/w,this.w=Math.acos((o+c+p-1)/2),this}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(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}},{key:"clampScalar",value:function(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}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){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}},{key:"ceil",value:function(){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}},{key:"round",value:function(){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}},{key:"roundToZero",value:function(){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}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(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}},{key:"lerpVectors",value:function(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}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:0;return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}},{key:"toArray",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0;return n[r]=this.x,n[r+1]=this.y,n[r+2]=this.z,n[r+3]=this.w,n}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&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}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:return e.next=8,this.w;case 8:case"end":return e.stop()}},e,this)})}]),i}();ed.prototype.isVector4=!0;var td=function(){Rl(a,Nf);var i=Ul(a);function a(e,t){var n,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return Tl(this,a),(n=i.call(this)).width=e,n.height=t,n.depth=1,n.scissor=new ed(0,0,e,t),n.scissorTest=!1,n.viewport=new ed(0,0,e,t),n.texture=new Qf(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),n.texture.isRenderTargetTexture=!0,n.texture.image={width:e,height:t,depth:1},n.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,n.texture.internalFormat=void 0!==r.internalFormat?r.internalFormat:null,n.texture.minFilter=void 0!==r.minFilter?r.minFilter:ic,n.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,n.stencilBuffer=void 0!==r.stencilBuffer&&r.stencilBuffer,n.depthTexture=void 0!==r.depthTexture?r.depthTexture:null,n}return Ll(a,[{key:"setTexture",value:function(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}},{key:"setSize",value:function(e,t,n){var r=2<arguments.length&&void 0!==n?n:1;this.width===e&&this.height===t&&this.depth===r||(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(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=_l({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),a}();td.prototype.isWebGLRenderTarget=!0;var nd=function(){Rl(a,td);var i=Ul(a);function a(e,t,n){var r;return Tl(this,a),(r=i.call(this,e,t,n)).samples=4,r}return Ll(a,[{key:"copy",value:function(e){return Bl(Pl(a.prototype),"copy",this).call(this,e),this.samples=e.samples,this}}]),a}();nd.prototype.isWebGLMultisampleRenderTarget=!0;var rd=function(){function i(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;Tl(this,i),this._x=e,this._y=t,this._z=n,this._w=r}return Ll(i,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(r/2),c=o(i/2),f=s(n/2),d=s(r/2),h=s(i/2);switch(a){case"XYZ":this._x=f*u*c+l*d*h,this._y=l*d*c-f*u*h,this._z=l*u*h+f*d*c,this._w=l*u*c-f*d*h;break;case"YXZ":this._x=f*u*c+l*d*h,this._y=l*d*c-f*u*h,this._z=l*u*h-f*d*c,this._w=l*u*c+f*d*h;break;case"ZXY":this._x=f*u*c-l*d*h,this._y=l*d*c+f*u*h,this._z=l*u*h+f*d*c,this._w=l*u*c-f*d*h;break;case"ZYX":this._x=f*u*c-l*d*h,this._y=l*d*c+f*u*h,this._z=l*u*h-f*d*c,this._w=l*u*c+f*d*h;break;case"YZX":this._x=f*u*c+l*d*h,this._y=l*d*c+f*u*h,this._z=l*u*h-f*d*c,this._w=l*u*c-f*d*h;break;case"XZY":this._x=f*u*c-l*d*h,this._y=l*d*c-f*u*h,this._z=l*u*h+f*d*c,this._w=l*u*c+f*d*h;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var 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}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],u=t[6],c=t[10],f=n+o+c;if(0<f){var d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(u-s)*d,this._y=(i-l)*d,this._z=(a-r)*d}else if(o<n&&c<n){var h=2*Math.sqrt(1+n-o-c);this._w=(u-s)/h,this._x=.25*h,this._y=(r+a)/h,this._z=(i+l)/h}else if(c<o){var p=2*Math.sqrt(1+o-n-c);this._w=(i-l)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(s+u)/p}else{var v=2*Math.sqrt(1+c-n-o);this._w=(a-r)/v,this._x=(i+l)/v,this._y=(s+u)/v,this._z=.25*v}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var 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._x=0,this._y=-e.z,this._z=e.y)):(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()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(Hf(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(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}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+r*l-i*s,this._y=r*u+a*s+i*o-n*l,this._z=i*u+a*l+n*s-r*o,this._w=a*u-n*o-r*s-i*l,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),c=Math.atan2(u,o),f=Math.sin((1-t)*c)/u,d=Math.sin(t*c)/u;return this._w=a*f+this._w*d,this._x=n*f+this._x*d,this._y=r*f+this._y*d,this._z=i*f+this._z*d,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,n){this.copy(e).slerp(t,n)}},{key:"random",value:function(){var e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(i),n*Math.cos(i),t*Math.sin(r))}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:0;return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}},{key:"toArray",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0;return n[r]=this._x,n[r+1]=this._y,n[r+2]=this._z,n[r+3]=this._w,n}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}}],[{key:"slerp",value:function(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)}},{key:"slerpFlat",value:function(e,t,n,r,i,a,o){var s=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3],f=i[a+0],d=i[a+1],h=i[a+2],p=i[a+3];if(0===o)return e[t+0]=s,e[t+1]=l,e[t+2]=u,void(e[t+3]=c);if(1===o)return e[t+0]=f,e[t+1]=d,e[t+2]=h,void(e[t+3]=p);if(c!==p||s!==f||l!==d||u!==h){var v=1-o,m=s*f+l*d+u*h+c*p,g=0<=m?1:-1,y=1-m*m;if(y>Number.EPSILON){var b=Math.sqrt(y),x=Math.atan2(b,m*g);v=Math.sin(v*x)/b,o=Math.sin(o*x)/b}var w=o*g;if(s=s*v+f*w,l=l*v+d*w,u=u*v+h*w,c=c*v+p*w,v===1-o){var _=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=_,l*=_,u*=_,c*=_}}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=c}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,a){var o=n[r],s=n[r+1],l=n[r+2],u=n[r+3],c=i[a],f=i[a+1],d=i[a+2],h=i[a+3];return e[t]=o*h+u*c+s*d-l*f,e[t+1]=s*h+u*f+l*c-o*d,e[t+2]=l*h+u*d+o*f-s*c,e[t+3]=u*h-o*c-s*f-l*d,e}}]),i}();rd.prototype.isQuaternion=!0;var id=function(){function r(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;Tl(this,r),this.x=e,this.y=t,this.z=n}return Ll(r,[{key:"set",value:function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e,t){return void 0!==t?(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)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(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)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(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)}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(od.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(od.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}},{key:"applyQuaternion",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,u=s*n+o*t-i*r,c=s*r+i*n-a*t,f=-i*t-a*n-o*r;return this.x=l*s+f*-i+u*-o-c*-a,this.y=u*s+f*-a+c*-i-l*-o,this.z=c*s+f*-o+l*-a-u*-i,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(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}},{key:"clampScalar",value:function(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}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){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}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(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}},{key:"lerpVectors",value:function(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}},{key:"cross",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(e){return ad.copy(this).projectOnVector(e),this.sub(ad)}},{key:"reflect",value:function(e){return this.sub(ad.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(Hf(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var 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}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var 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}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:0;return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}},{key:"toArray",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0;return n[r]=this.x,n[r+1]=this.y,n[r+2]=this.z,n}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&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}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-Math.pow(e,2));return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}},{key:Symbol.iterator,value:regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:case"end":return e.stop()}},e,this)})}]),r}();id.prototype.isVector3=!0;var ad=new id,od=new rd,sd=function(){function n(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new id(1/0,1/0,1/0),t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new id(-1/0,-1/0,-1/0);Tl(this,n),this.min=e,this.max=t}return Ll(n,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.length;s<l;s+=3){var u=e[s],c=e[s+1],f=e[s+2];u<t&&(t=u),c<n&&(n=c),f<r&&(r=f),i<u&&(i=u),a<c&&(a=c),o<f&&(o=f)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.count;s<l;s++){var u=e.getX(s),c=e.getY(s),f=e.getZ(s);u<t&&(t=u),c<n&&(n=c),f<r&&(r=f),i<u&&(i=u),a<c&&(a=c),o<f&&(o=f)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}},{key:"setFromCenterAndSize",value:function(e,t){var n=ud.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}},{key:"setFromObject",value:function(e){return this.makeEmpty(),this.expandByObject(e)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"expandByObject",value:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),cd.copy(t.boundingBox),cd.applyMatrix4(e.matrixWorld),this.union(cd));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this}},{key:"containsPoint",value:function(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)}},{key:"containsBox",value:function(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}},{key:"getParameter",value:function(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))}},{key:"intersectsBox",value:function(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)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,ud),ud.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,n;return n=0<e.normal.x?(t=e.normal.x*this.min.x,e.normal.x*this.max.x):(t=e.normal.x*this.max.x,e.normal.x*this.min.x),0<e.normal.y?(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),0<e.normal.z?(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}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(gd),yd.subVectors(this.max,gd),fd.subVectors(e.a,gd),dd.subVectors(e.b,gd),hd.subVectors(e.c,gd),pd.subVectors(dd,fd),vd.subVectors(hd,dd),md.subVectors(fd,hd);var t=[0,-pd.z,pd.y,0,-vd.z,vd.y,0,-md.z,md.y,pd.z,0,-pd.x,vd.z,0,-vd.x,md.z,0,-md.x,-pd.y,pd.x,0,-vd.y,vd.x,0,-md.y,md.x,0];return!!wd(t,fd,dd,hd,yd)&&(!!wd(t=[1,0,0,0,1,0,0,0,1],fd,dd,hd,yd)&&(bd.crossVectors(pd,vd),wd(t=[bd.x,bd.y,bd.z],fd,dd,hd,yd)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return ud.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"getBoundingSphere",value:function(e){return this.getCenter(e.center),e.radius=.5*this.getSize(ud).length(),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(ld[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ld[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ld[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ld[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ld[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ld[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ld[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ld[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ld)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),n}();sd.prototype.isBox3=!0;var ld=[new id,new id,new id,new id,new id,new id,new id,new id],ud=new id,cd=new sd,fd=new id,dd=new id,hd=new id,pd=new id,vd=new id,md=new id,gd=new id,yd=new id,bd=new id,xd=new id;function wd(e,t,n,r,i){for(var a=0,o=e.length-3;a<=o;a+=3){xd.fromArray(e,a);var s=i.x*Math.abs(xd.x)+i.y*Math.abs(xd.y)+i.z*Math.abs(xd.z),l=t.dot(xd),u=n.dot(xd),c=r.dot(xd);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var _d=new sd,Sd=new id,Md=new id,Ed=new id,Td=function(){function n(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new id,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1;Tl(this,n),this.center=e,this.radius=t}return Ll(n,[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var n=this.center;void 0!==t?n.copy(t):_d.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}},{key:"copy",value:function(e){return this.center.copy(e.center),this.radius=e.radius,this}},{key:"isEmpty",value:function(){return this.radius<0}},{key:"makeEmpty",value:function(){return this.center.set(0,0,0),this.radius=-1,this}},{key:"containsPoint",value:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}},{key:"distanceToPoint",value:function(e){return e.distanceTo(this.center)-this.radius}},{key:"intersectsSphere",value:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}},{key:"intersectsBox",value:function(e){return e.intersectsSphere(this)}},{key:"intersectsPlane",value:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}},{key:"clampPoint",value:function(e,t){var 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}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){Ed.subVectors(e,this.center);var t=Ed.lengthSq();if(t>this.radius*this.radius){var n=Math.sqrt(t),r=.5*(n-this.radius);this.center.add(Ed.multiplyScalar(r/n)),this.radius+=r}return this}},{key:"union",value:function(e){return Md.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Sd.copy(e.center).add(Md)),this.expandByPoint(Sd.copy(e.center).sub(Md)),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),n}(),kd=new id,Ld=new id,Cd=new id,Rd=new id,Pd=new id,Ad=new id,Od=new id,Nd=function(){function n(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new id,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new id(0,0,-1);Tl(this,n),this.origin=e,this.direction=t}return Ll(n,[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,kd)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=kd.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(kd.copy(this.direction).multiplyScalar(t).add(this.origin),kd.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,n,r){Ld.copy(e).add(t).multiplyScalar(.5),Cd.copy(t).sub(e).normalize(),Rd.copy(this.origin).sub(Ld);var i,a,o,s,l=.5*e.distanceTo(t),u=-this.direction.dot(Cd),c=Rd.dot(this.direction),f=-Rd.dot(Cd),d=Rd.lengthSq(),h=Math.abs(1-u*u);if(0<h)if(a=u*c-f,s=l*h,0<=(i=u*f-c))if(-s<=a)if(a<=s){var p=1/h;o=(i*=p)*(i+u*(a*=p)+2*c)+a*(u*i+a+2*f)+d}else a=l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*f)+d;else a=-l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*f)+d;else o=a<=-s?-(i=Math.max(0,-(-u*l+c)))*i+(a=0<i?-l:Math.min(Math.max(-l,-f),l))*(a+2*f)+d:a<=s?(i=0,(a=Math.min(Math.max(-l,-f),l))*(a+2*f)+d):-(i=Math.max(0,-(u*l+c)))*i+(a=0<i?l:Math.min(Math.max(-l,-f),l))*(a+2*f)+d;else a=0<u?-l:l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*f)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Cd).multiplyScalar(a).add(Ld),o}},{key:"intersectSphere",value:function(e,t){kd.subVectors(e.center,this.origin);var n=kd.dot(this.direction),r=kd.dot(kd)-n*n,i=e.radius*e.radius;if(i<r)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return 0<=n?n:null}},{key:"intersectPlane",value:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var n,r,i,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,f=this.origin;return r=0<=l?(n=(e.min.x-f.x)*l,(e.max.x-f.x)*l):(n=(e.max.x-f.x)*l,(e.min.x-f.x)*l),(a=0<=u?(i=(e.min.y-f.y)*u,(e.max.y-f.y)*u):(i=(e.max.y-f.y)*u,(e.min.y-f.y)*u))<n||r<i?null:((n<i||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),(s=0<=c?(o=(e.min.z-f.z)*c,(e.max.z-f.z)*c):(o=(e.max.z-f.z)*c,(e.min.z-f.z)*c))<n||r<o?null:((n<o||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(0<=n?n:r,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,kd)}},{key:"intersectTriangle",value:function(e,t,n,r,i){Pd.subVectors(t,e),Ad.subVectors(n,e),Od.crossVectors(Pd,Ad);var a,o=this.direction.dot(Od);if(0<o){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Rd.subVectors(this.origin,e);var s=a*this.direction.dot(Ad.crossVectors(Rd,Ad));if(s<0)return null;var l=a*this.direction.dot(Pd.cross(Rd));if(l<0)return null;if(o<s+l)return null;var u=-a*Rd.dot(Od);return u<0?null:this.at(u/o,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),n}(),Dd=function(){function e(){Tl(this,e),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}return Ll(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,l,u,c,f,d,h,p,v){var m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=a,m[9]=o,m[13]=s,m[2]=l,m[6]=u,m[10]=c,m[14]=f,m[3]=d,m[7]=h,m[11]=p,m[15]=v,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var 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}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"setFromMatrix3",value:function(e){var 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}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(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}},{key:"extractRotation",value:function(e){var t=this.elements,n=e.elements,r=1/Id.setFromMatrixColumn(e,0).length(),i=1/Id.setFromMatrixColumn(e,1).length(),a=1/Id.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]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var f=a*u,d=a*c,h=o*u,p=o*c;t[0]=s*u,t[4]=-s*c,t[8]=l,t[1]=d+h*l,t[5]=f-p*l,t[9]=-o*s,t[2]=p-f*l,t[6]=h+d*l,t[10]=a*s}else if("YXZ"===e.order){var v=s*u,m=s*c,g=l*u,y=l*c;t[0]=v+y*o,t[4]=g*o-m,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-o,t[2]=m*o-g,t[6]=y+v*o,t[10]=a*s}else if("ZXY"===e.order){var b=s*u,x=s*c,w=l*u,_=l*c;t[0]=b-_*o,t[4]=-a*c,t[8]=w+x*o,t[1]=x+w*o,t[5]=a*u,t[9]=_-b*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var S=a*u,M=a*c,E=o*u,T=o*c;t[0]=s*u,t[4]=E*l-M,t[8]=S*l+T,t[1]=s*c,t[5]=T*l+S,t[9]=M*l-E,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var k=a*s,L=a*l,C=o*s,R=o*l;t[0]=s*u,t[4]=R-k*c,t[8]=C*c+L,t[1]=c,t[5]=a*u,t[9]=-o*u,t[2]=-l*u,t[6]=L*c+C,t[10]=k-R*c}else if("XZY"===e.order){var P=a*s,A=a*l,O=o*s,N=o*l;t[0]=s*u,t[4]=-c,t[8]=l*u,t[1]=P*c+N,t[5]=a*u,t[9]=A*c-O,t[2]=O*c-A,t[6]=o*u,t[10]=N*c+P}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Fd,e,Ud)}},{key:"lookAt",value:function(e,t,n){var r=this.elements;return Gd.subVectors(e,t),0===Gd.lengthSq()&&(Gd.z=1),Gd.normalize(),Bd.crossVectors(n,Gd),0===Bd.lengthSq()&&(1===Math.abs(n.z)?Gd.x+=1e-4:Gd.z+=1e-4,Gd.normalize(),Bd.crossVectors(n,Gd)),Bd.normalize(),Hd.crossVectors(Gd,Bd),r[0]=Bd.x,r[4]=Hd.x,r[8]=Gd.x,r[1]=Bd.y,r[5]=Hd.y,r[9]=Gd.y,r[2]=Bd.z,r[6]=Hd.z,r[10]=Gd.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],u=n[1],c=n[5],f=n[9],d=n[13],h=n[2],p=n[6],v=n[10],m=n[14],g=n[3],y=n[7],b=n[11],x=n[15],w=r[0],_=r[4],S=r[8],M=r[12],E=r[1],T=r[5],k=r[9],L=r[13],C=r[2],R=r[6],P=r[10],A=r[14],O=r[3],N=r[7],D=r[11],I=r[15];return i[0]=a*w+o*E+s*C+l*O,i[4]=a*_+o*T+s*R+l*N,i[8]=a*S+o*k+s*P+l*D,i[12]=a*M+o*L+s*A+l*I,i[1]=u*w+c*E+f*C+d*O,i[5]=u*_+c*T+f*R+d*N,i[9]=u*S+c*k+f*P+d*D,i[13]=u*M+c*L+f*A+d*I,i[2]=h*w+p*E+v*C+m*O,i[6]=h*_+p*T+v*R+m*N,i[10]=h*S+p*k+v*P+m*D,i[14]=h*M+p*L+v*A+m*I,i[3]=g*w+y*E+b*C+x*O,i[7]=g*_+y*T+b*R+x*N,i[11]=g*S+y*k+b*P+x*D,i[15]=g*M+y*L+b*A+x*I,this}},{key:"multiplyScalar",value:function(e){var 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}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],u=e[2],c=e[6],f=e[10],d=e[14];return e[3]*(+i*s*c-r*l*c-i*o*f+n*l*f+r*o*d-n*s*d)+e[7]*(+t*s*d-t*l*f+i*a*f-r*a*d+r*l*u-i*s*u)+e[11]*(+t*l*c-t*o*d-i*a*c+n*a*d+i*o*u-n*l*u)+e[15]*(-r*o*u-t*s*c+t*o*f+r*a*c-n*a*f+n*s*u)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,n){var 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}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],h=e[12],p=e[13],v=e[14],m=e[15],g=c*v*l-p*f*l+p*s*d-o*v*d-c*s*m+o*f*m,y=h*f*l-u*v*l-h*s*d+a*v*d+u*s*m-a*f*m,b=u*p*l-h*c*l+h*o*d-a*p*d-u*o*m+a*c*m,x=h*c*s-u*p*s-h*o*f+a*p*f+u*o*v-a*c*v,w=t*g+n*y+r*b+i*x;if(0==w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var _=1/w;return e[0]=g*_,e[1]=(p*f*i-c*v*i-p*r*d+n*v*d+c*r*m-n*f*m)*_,e[2]=(o*v*i-p*s*i+p*r*l-n*v*l-o*r*m+n*s*m)*_,e[3]=(c*s*i-o*f*i-c*r*l+n*f*l+o*r*d-n*s*d)*_,e[4]=y*_,e[5]=(u*v*i-h*f*i+h*r*d-t*v*d-u*r*m+t*f*m)*_,e[6]=(h*s*i-a*v*i-h*r*l+t*v*l+a*r*m-t*s*m)*_,e[7]=(a*f*i-u*s*i+u*r*l-t*f*l-a*r*d+t*s*d)*_,e[8]=b*_,e[9]=(h*c*i-u*p*i-h*n*d+t*p*d+u*n*m-t*c*m)*_,e[10]=(a*p*i-h*o*i+h*n*l-t*p*l-a*n*m+t*o*m)*_,e[11]=(u*o*i-a*c*i-u*n*l+t*c*l+a*n*d-t*o*d)*_,e[12]=x*_,e[13]=(u*p*r-h*c*r+h*n*f-t*p*f-u*n*v+t*c*v)*_,e[14]=(h*o*r-a*p*r-h*n*s+t*p*s+a*n*v-t*o*v)*_,e[15]=(a*c*r-u*o*r+u*n*s-t*c*s-a*n*f+t*o*f)*_,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var 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))}},{key:"makeTranslation",value:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var 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}},{key:"makeRotationY",value:function(e){var 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}},{key:"makeRotationZ",value:function(e){var 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}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,u=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,u*o+n,u*s-r*a,0,l*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,u=a+a,c=o+o,f=i*l,d=i*u,h=i*c,p=a*u,v=a*c,m=o*c,g=s*l,y=s*u,b=s*c,x=n.x,w=n.y,_=n.z;return r[0]=(1-(p+m))*x,r[1]=(d+b)*x,r[2]=(h-y)*x,r[3]=0,r[4]=(d-b)*w,r[5]=(1-(f+m))*w,r[6]=(v+g)*w,r[7]=0,r[8]=(h+y)*_,r[9]=(v-g)*_,r[10]=(1-(f+p))*_,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(e,t,n){var r=this.elements,i=Id.set(r[0],r[1],r[2]).length(),a=Id.set(r[4],r[5],r[6]).length(),o=Id.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],zd.copy(this);var s=1/i,l=1/a,u=1/o;return zd.elements[0]*=s,zd.elements[1]*=s,zd.elements[2]*=s,zd.elements[4]*=l,zd.elements[5]*=l,zd.elements[6]*=l,zd.elements[8]*=u,zd.elements[9]*=u,zd.elements[10]*=u,t.setFromRotationMatrix(zd),n.x=i,n.y=a,n.z=o,this}},{key:"makePerspective",value:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),c=(n+r)/(n-r),f=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=f,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),l=1/(n-r),u=1/(a-i),c=(t+e)*s,f=(n+r)*l,d=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-f,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e,t){for(var n=1<arguments.length&&void 0!==t?t:0,r=0;r<16;r++)this.elements[r]=e[r+n];return this}},{key:"toArray",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0,i=this.elements;return n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3],n[r+4]=i[4],n[r+5]=i[5],n[r+6]=i[6],n[r+7]=i[7],n[r+8]=i[8],n[r+9]=i[9],n[r+10]=i[10],n[r+11]=i[11],n[r+12]=i[12],n[r+13]=i[13],n[r+14]=i[14],n[r+15]=i[15],n}}]),e}();Dd.prototype.isMatrix4=!0;var Id=new id,zd=new Dd,Fd=new id(0,0,0),Ud=new id(1,1,1),Bd=new id,Hd=new id,Gd=new id,Vd=new Dd,Wd=new rd,jd=function(){function i(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:i.DefaultOrder;Tl(this,i),this._x=e,this._y=t,this._z=n,this._order=r}return Ll(i,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){var i=3<arguments.length&&void 0!==r?r:this._order;return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e,t,n){var r=1<arguments.length&&void 0!==t?t:this._order,i=!(2<arguments.length&&void 0!==n)||n,a=e.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],f=a[9],d=a[2],h=a[6],p=a[10];switch(r){case"XYZ":this._y=Math.asin(Hf(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Hf(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(l,p),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(Hf(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-Hf(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(Hf(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(l,p));break;case"XZY":this._z=Math.asin(-Hf(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-f,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+r)}return this._order=r,!0===i&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,n){return Vd.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Vd,t,n)}},{key:"setFromVector3",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:this._order;return this.set(e.x,e.y,e.z,n)}},{key:"reorder",value:function(e){return Wd.setFromEuler(this),this.setFromQuaternion(Wd,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0;return n[r]=this._x,n[r+1]=this._y,n[r+2]=this._z,n[r+3]=this._order,n}},{key:"toVector3",value:function(e){return e?e.set(this._x,this._y,this._z):new id(this._x,this._y,this._z)}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}}]),i}();jd.prototype.isEuler=!0,jd.DefaultOrder="XYZ",jd.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var qd=function(){function e(){Tl(this,e),this.mask=1}return Ll(e,[{key:"set",value:function(e){this.mask=1<<e|0}},{key:"enable",value:function(e){this.mask|=1<<e|0}},{key:"enableAll",value:function(){this.mask=-1}},{key:"toggle",value:function(e){this.mask^=1<<e|0}},{key:"disable",value:function(e){this.mask&=~(1<<e|0)}},{key:"disableAll",value:function(){this.mask=0}},{key:"test",value:function(e){return 0!=(this.mask&e.mask)}}]),e}(),Xd=0,Yd=new id,Zd=new rd,Jd=new Dd,$d=new id,Qd=new id,Kd=new id,eh=new rd,th=new id(1,0,0),nh=new id(0,1,0),rh=new id(0,0,1),ih={type:"added"},ah={type:"removed"},oh=function(){Rl(o,Nf);var a=Ul(o);function o(){var e;Tl(this,o),e=a.call(this),Object.defineProperty(zl(e),"id",{value:Xd++}),e.uuid=Bf(),e.name="",e.type="Object3D",e.parent=null,e.children=[],e.up=o.DefaultUp.clone();var t=new id,n=new jd,r=new rd,i=new id(1,1,1);return n._onChange(function(){r.setFromEuler(n,!1)}),r._onChange(function(){n.setFromQuaternion(r,void 0,!1)}),Object.defineProperties(zl(e),{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Dd},normalMatrix:{value:new Xf}}),e.matrix=new Dd,e.matrixWorld=new Dd,e.matrixAutoUpdate=o.DefaultMatrixAutoUpdate,e.matrixWorldNeedsUpdate=!1,e.layers=new qd,e.visible=!0,e.castShadow=!1,e.receiveShadow=!1,e.frustumCulled=!0,e.renderOrder=0,e.animations=[],e.userData={},e}return Ll(o,[{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(e){return this.quaternion.premultiply(e),this}},{key:"setRotationFromAxisAngle",value:function(e,t){this.quaternion.setFromAxisAngle(e,t)}},{key:"setRotationFromEuler",value:function(e){this.quaternion.setFromEuler(e,!0)}},{key:"setRotationFromMatrix",value:function(e){this.quaternion.setFromRotationMatrix(e)}},{key:"setRotationFromQuaternion",value:function(e){this.quaternion.copy(e)}},{key:"rotateOnAxis",value:function(e,t){return Zd.setFromAxisAngle(e,t),this.quaternion.multiply(Zd),this}},{key:"rotateOnWorldAxis",value:function(e,t){return Zd.setFromAxisAngle(e,t),this.quaternion.premultiply(Zd),this}},{key:"rotateX",value:function(e){return this.rotateOnAxis(th,e)}},{key:"rotateY",value:function(e){return this.rotateOnAxis(nh,e)}},{key:"rotateZ",value:function(e){return this.rotateOnAxis(rh,e)}},{key:"translateOnAxis",value:function(e,t){return Yd.copy(e).applyQuaternion(this.quaternion),this.position.add(Yd.multiplyScalar(t)),this}},{key:"translateX",value:function(e){return this.translateOnAxis(th,e)}},{key:"translateY",value:function(e){return this.translateOnAxis(nh,e)}},{key:"translateZ",value:function(e){return this.translateOnAxis(rh,e)}},{key:"localToWorld",value:function(e){return e.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(e){return e.applyMatrix4(Jd.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(e,t,n){e.isVector3?$d.copy(e):$d.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),Qd.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Jd.lookAt(Qd,$d,this.up):Jd.lookAt($d,Qd,this.up),this.quaternion.setFromRotationMatrix(Jd),r&&(Jd.extractRotation(r.matrixWorld),Zd.setFromRotationMatrix(Jd),this.quaternion.premultiply(Zd.invert()))}},{key:"add",value:function(e){if(1<arguments.length){for(var 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):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),(e.parent=this).children.push(e),e.dispatchEvent(ih)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this}},{key:"remove",value:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(ah)),this}},{key:"removeFromParent",value:function(){var e=this.parent;return null!==e&&e.remove(this),this}},{key:"clear",value:function(){for(var e=0;e<this.children.length;e++){var t=this.children[e];t.parent=null,t.dispatchEvent(ah)}return this.children.length=0,this}},{key:"attach",value:function(e){return this.updateWorldMatrix(!0,!1),Jd.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Jd.multiply(e.parent.matrixWorld)),e.applyMatrix4(Jd),this.add(e),e.updateWorldMatrix(!1,!0),this}},{key:"getObjectById",value:function(e){return this.getObjectByProperty("id",e)}},{key:"getObjectByName",value:function(e){return this.getObjectByProperty("name",e)}},{key:"getObjectByProperty",value:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}},{key:"getWorldPosition",value:function(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qd,e,Kd),e}},{key:"getWorldScale",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qd,eh,e),e}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)}},{key:"traverseVisible",value:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}}},{key:"traverseAncestors",value:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e=!(this.matrixWorldNeedsUpdate=!1));for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}},{key:"updateWorldMatrix",value:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)}},{key:"toJSON",value:function(n){var e=void 0===n||"string"==typeof n,t={};e&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},t.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(e,t){return void 0===e[t.uuid]&&(e[t.uuid]=t.toJSON(n)),t.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(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(n).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(n).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(n.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var u=o[s];i(n.shapes,u)}else i(n.shapes,o)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(n.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var c=[],f=0,d=this.material.length;f<d;f++)c.push(i(n.materials,this.material[f]));r.material=c}else r.material=i(n.materials,this.material);if(0<this.children.length){r.children=[];for(var h=0;h<this.children.length;h++)r.children.push(this.children[h].toJSON(n).object)}if(0<this.animations.length){r.animations=[];for(var p=0;p<this.animations.length;p++){var v=this.animations[p];r.animations.push(i(n.animations,v))}}if(e){var m=S(n.geometries),g=S(n.materials),y=S(n.textures),b=S(n.images),x=S(n.shapes),w=S(n.skeletons),_=S(n.animations);0<m.length&&(t.geometries=m),0<g.length&&(t.materials=g),0<y.length&&(t.textures=y),0<b.length&&(t.images=b),0<x.length&&(t.shapes=x),0<w.length&&(t.skeletons=w),0<_.length&&(t.animations=_)}return t.object=r,t;function S(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e,t){var n=!(1<arguments.length&&void 0!==t)||t;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)),!0===n)for(var r=0;r<e.children.length;r++){var i=e.children[r];this.add(i.clone())}return this}}]),o}();oh.DefaultUp=new id(0,1,0),oh.DefaultMatrixAutoUpdate=!0,oh.prototype.isObject3D=!0;var sh=new id,lh=new id,uh=new id,ch=new id,fh=new id,dh=new id,hh=new id,ph=new id,vh=new id,mh=new id,gh=function(){function a(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new id,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new id,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new id;Tl(this,a),this.a=e,this.b=t,this.c=n}return Ll(a,[{key:"set",value:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}},{key:"setFromAttributeAndIndices",value:function(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return sh.subVectors(this.c,this.b),lh.subVectors(this.a,this.b),.5*sh.cross(lh).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(e){return a.getNormal(this.a,this.b,this.c,e)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(e,t){return a.getBarycoord(e,this.a,this.b,this.c,t)}},{key:"getUV",value:function(e,t,n,r,i){return a.getUV(e,this.a,this.b,this.c,t,n,r,i)}},{key:"containsPoint",value:function(e){return a.containsPoint(e,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(e){return a.isFrontFacing(this.a,this.b,this.c,e)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var n,r,i=this.a,a=this.b,o=this.c;fh.subVectors(a,i),dh.subVectors(o,i),ph.subVectors(e,i);var s=fh.dot(ph),l=dh.dot(ph);if(s<=0&&l<=0)return t.copy(i);vh.subVectors(e,a);var u=fh.dot(vh),c=dh.dot(vh);if(0<=u&&c<=u)return t.copy(a);var f=s*c-u*l;if(f<=0&&0<=s&&u<=0)return n=s/(s-u),t.copy(i).addScaledVector(fh,n);mh.subVectors(e,o);var d=fh.dot(mh),h=dh.dot(mh);if(0<=h&&d<=h)return t.copy(o);var p=d*l-s*h;if(p<=0&&0<=l&&h<=0)return r=l/(l-h),t.copy(i).addScaledVector(dh,r);var v=u*h-d*c;if(v<=0&&0<=c-u&&0<=d-h)return hh.subVectors(o,a),r=(c-u)/(c-u+(d-h)),t.copy(a).addScaledVector(hh,r);var m=1/(v+p+f);return n=p*m,r=f*m,t.copy(i).addScaledVector(fh,n).addScaledVector(dh,r)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,n,r){r.subVectors(n,t),sh.subVectors(e,t),r.cross(sh);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,n,r,i){sh.subVectors(r,t),lh.subVectors(n,t),uh.subVectors(e,t);var a=sh.dot(sh),o=sh.dot(lh),s=sh.dot(uh),l=lh.dot(lh),u=lh.dot(uh),c=a*l-o*o;if(0==c)return i.set(-2,-1,-1);var f=1/c,d=(l*s-o*u)*f,h=(a*u-o*s)*f;return i.set(1-d-h,h,d)}},{key:"containsPoint",value:function(e,t,n,r){return this.getBarycoord(e,t,n,r,ch),0<=ch.x&&0<=ch.y&&ch.x+ch.y<=1}},{key:"getUV",value:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,ch),s.set(0,0),s.addScaledVector(i,ch.x),s.addScaledVector(a,ch.y),s.addScaledVector(o,ch.z),s}},{key:"isFrontFacing",value:function(e,t,n,r){return sh.subVectors(n,t),lh.subVectors(e,t),sh.cross(lh).dot(r)<0}}]),a}(),yh=0,bh=function(){Rl(n,Nf);var t=Ul(n);function n(){var e;return Tl(this,n),e=t.call(this),Object.defineProperty(zl(e),"id",{value:yh++}),e.uuid=Bf(),e.name="",e.type="Material",e.fog=!0,e.blending=lu,e.side=iu,e.vertexColors=!1,e.opacity=1,e.format=wc,e.transparent=!1,e.blendSrc=_u,e.blendDst=Su,e.blendEquation=hu,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthFunc=Au,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=7680,e.stencilZFail=7680,e.stencilZPass=7680,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e._alphaTest=0,e}return Ll(n,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(e){0<this._alphaTest!=0<e&&this.version++,this._alphaTest=e}},{key:"onBuild",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?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.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}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()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenTint&&this.sheenTint.isColor&&(n.sheenTint=this.sheenTint.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(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.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationTint&&(n.attenuationTint=this.attenuationTint.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==lu&&(n.blending=this.blending),this.side!==iu&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.format!==wc&&(n.format=this.format),!0===this.transparent&&(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&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);0<i.length&&(n.textures=i),0<a.length&&(n.images=a)}return n}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(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.format=e.format,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;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].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}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),n}();bh.prototype.isMaterial=!0;var xh={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},wh={h:0,s:0,l:0},_h={h:0,s:0,l:0};function Sh(e,t,n){return n<0&&(n+=1),1<n&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Mh(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Eh(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Th=function(){function r(e,t,n){return Tl(this,r),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}return Ll(r,[{key:"set",value:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,n){return this.r=e,this.g=t,this.b=n,this}},{key:"setHSL",value:function(e,t,n){if(e=function(e,t){return(e%t+t)%t}(e,1),t=Hf(t,0,1),n=Hf(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Sh(i,r,e+1/3),this.g=Sh(i,r,e),this.b=Sh(i,r,e-1/3)}return this}},{key:"setStyle",value:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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,e(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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,e(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(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return e(r[4]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){var u=n[1],c=u.length;if(3===c)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}return t&&0<t.length?this.setColorName(t):this}},{key:"setColorName",value:function(e){var t=xh[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:2;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}},{key:"copyLinearToGamma",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:2,r=0<n?1/n:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(e){return this.r=Mh(e.r),this.g=Mh(e.g),this.b=Mh(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Eh(e.r),this.g=Eh(e.g),this.b=Eh(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),l=(s+o)/2;if(s===o)n=t=0;else{var u=o-s;switch(n=l<=.5?u/(o+s):u/(2-o-s),o){case r:t=(i-a)/u+(i<a?6:0);break;case i:t=(a-r)/u+2;break;case a:t=(r-i)/u+4}t/=6}return e.h=t,e.s=n,e.l=l,e}},{key:"getStyle",value:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}},{key:"offsetHSL",value:function(e,t,n){return this.getHSL(wh),wh.h+=e,wh.s+=t,wh.l+=n,this.setHSL(wh.h,wh.s,wh.l),this}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(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}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(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}},{key:"lerpColors",value:function(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}},{key:"lerpHSL",value:function(e,t){this.getHSL(wh),e.getHSL(_h);var n=Gf(wh.h,_h.h,t),r=Gf(wh.s,_h.s,t),i=Gf(wh.l,_h.l,t);return this.setHSL(n,r,i),this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:0;return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}},{key:"toArray",value:function(e,t){var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0;return n[r]=this.r,n[r+1]=this.g,n[r+2]=this.b,n}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),r}();Th.NAMES=xh,Th.prototype.isColor=!0,Th.prototype.r=1,Th.prototype.g=1,Th.prototype.b=1;var kh=function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="MeshBasicMaterial",t.color=new Th(16777215),t.map=null,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=null,t.aoMapIntensity=1,t.specularMap=null,t.alphaMap=null,t.envMap=null,t.combine=zu,t.reflectivity=1,t.refractionRatio=.98,t.wireframe=!1,t.wireframeLinewidth=1,t.wireframeLinecap="round",t.wireframeLinejoin="round",t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,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}}]),r}();kh.prototype.isMeshBasicMaterial=!0;var Lh=new id,Ch=new jf,Rh=function(){function r(e,t,n){if(Tl(this,r),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Pf,this.updateRange={offset:0,count:-1},this.version=0}return Ll(r,[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(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}},{key:"copyAt",value:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}},{key:"copyArray",value:function(e){return this.array.set(e),this}},{key:"copyColorsArray",value:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new Th),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this}},{key:"copyVector2sArray",value:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new jf),t[n++]=a.x,t[n++]=a.y}return this}},{key:"copyVector3sArray",value:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new id),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this}},{key:"copyVector4sArray",value:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new ed),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this}},{key:"applyMatrix3",value:function(e){if(2===this.itemSize)for(var t=0,n=this.count;t<n;t++)Ch.fromBufferAttribute(this,t),Ch.applyMatrix3(e),this.setXY(t,Ch.x,Ch.y);else if(3===this.itemSize)for(var r=0,i=this.count;r<i;r++)Lh.fromBufferAttribute(this,r),Lh.applyMatrix3(e),this.setXYZ(r,Lh.x,Lh.y,Lh.z);return this}},{key:"applyMatrix4",value:function(e){for(var t=0,n=this.count;t<n;t++)Lh.x=this.getX(t),Lh.y=this.getY(t),Lh.z=this.getZ(t),Lh.applyMatrix4(e),this.setXYZ(t,Lh.x,Lh.y,Lh.z);return this}},{key:"applyNormalMatrix",value:function(e){for(var t=0,n=this.count;t<n;t++)Lh.x=this.getX(t),Lh.y=this.getY(t),Lh.z=this.getZ(t),Lh.applyNormalMatrix(e),this.setXYZ(t,Lh.x,Lh.y,Lh.z);return this}},{key:"transformDirection",value:function(e){for(var t=0,n=this.count;t<n;t++)Lh.x=this.getX(t),Lh.y=this.getY(t),Lh.z=this.getZ(t),Lh.transformDirection(e),this.setXYZ(t,Lh.x,Lh.y,Lh.z);return this}},{key:"set",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:0;return this.array.set(e,n),this}},{key:"getX",value:function(e){return this.array[e*this.itemSize]}},{key:"setX",value:function(e,t){return this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){return this.array[e*this.itemSize+1]}},{key:"setY",value:function(e,t){return this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){return this.array[e*this.itemSize+2]}},{key:"setZ",value:function(e,t){return this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){return this.array[e*this.itemSize+3]}},{key:"setW",value:function(e,t){return this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}},{key:"setXYZ",value:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}},{key:"setXYZW",value:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var 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!==Pf&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}]),r}();Rh.prototype.isBufferAttribute=!0;var Ph=function(){Rl(i,Rh);var r=Ul(i);function i(e,t,n){return Tl(this,i),r.call(this,new Uint16Array(e),t,n)}return i}(),Ah=function(){Rl(i,Rh);var r=Ul(i);function i(e,t,n){return Tl(this,i),r.call(this,new Uint32Array(e),t,n)}return i}(),Oh=function(){Rl(i,Rh);var r=Ul(i);function i(e,t,n){return Tl(this,i),r.call(this,new Float32Array(e),t,n)}return i}(),Nh=0,Dh=new Dd,Ih=new oh,zh=new id,Fh=new sd,Uh=new sd,Bh=new id,Hh=function(){Rl(g,Nf);var t=Ul(g);function g(){var e;return Tl(this,g),e=t.call(this),Object.defineProperty(zl(e),"id",{value:Nh++}),e.uuid=Bf(),e.name="",e.type="BufferGeometry",e.index=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return Ll(g,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(65535<Yf(e)?Ah:Ph)(e,1):this.index=e,this}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t,n){var r=2<arguments.length&&void 0!==n?n:0;this.groups.push({start:e,count:t,materialIndex:r})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new Xf).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return Dh.makeRotationFromQuaternion(e),this.applyMatrix4(Dh),this}},{key:"rotateX",value:function(e){return Dh.makeRotationX(e),this.applyMatrix4(Dh),this}},{key:"rotateY",value:function(e){return Dh.makeRotationY(e),this.applyMatrix4(Dh),this}},{key:"rotateZ",value:function(e){return Dh.makeRotationZ(e),this.applyMatrix4(Dh),this}},{key:"translate",value:function(e,t,n){return Dh.makeTranslation(e,t,n),this.applyMatrix4(Dh),this}},{key:"scale",value:function(e,t,n){return Dh.makeScale(e,t,n),this.applyMatrix4(Dh),this}},{key:"lookAt",value:function(e){return Ih.lookAt(e),Ih.updateMatrix(),this.applyMatrix4(Ih.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(zh).negate(),this.translate(zh.x,zh.y,zh.z),this}},{key:"setFromPoints",value:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Oh(t,3)),this}},{key:"computeBoundingBox",value:function(){null===this.boundingBox&&(this.boundingBox=new sd);var 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 id(-1/0,-1/0,-1/0),new id(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];Fh.setFromBufferAttribute(i),this.morphTargetsRelative?(Bh.addVectors(this.boundingBox.min,Fh.min),this.boundingBox.expandByPoint(Bh),Bh.addVectors(this.boundingBox.max,Fh.max),this.boundingBox.expandByPoint(Bh)):(this.boundingBox.expandByPoint(Fh.min),this.boundingBox.expandByPoint(Fh.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)}},{key:"computeBoundingSphere",value:function(){null===this.boundingSphere&&(this.boundingSphere=new Td);var 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 id,1/0);if(e){var n=this.boundingSphere.center;if(Fh.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];Uh.setFromBufferAttribute(a),this.morphTargetsRelative?(Bh.addVectors(Fh.min,Uh.min),Fh.expandByPoint(Bh),Bh.addVectors(Fh.max,Uh.max),Fh.expandByPoint(Bh)):(Fh.expandByPoint(Uh.min),Fh.expandByPoint(Uh.max))}Fh.getCenter(n);for(var o=0,s=0,l=e.count;s<l;s++)Bh.fromBufferAttribute(e,s),o=Math.max(o,n.distanceToSquared(Bh));if(t)for(var u=0,c=t.length;u<c;u++)for(var f=t[u],d=this.morphTargetsRelative,h=0,p=f.count;h<p;h++)Bh.fromBufferAttribute(f,h),d&&(zh.fromBufferAttribute(e,h),Bh.add(zh)),o=Math.max(o,n.distanceToSquared(Bh));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}},{key:"computeTangents",value:function(){var e=this.index,t=this.attributes;if(null!==e&&void 0!==t.position&&void 0!==t.normal&&void 0!==t.uv){var n=e.array,i=t.position.array,r=t.normal.array,a=t.uv.array,o=i.length/3;void 0===t.tangent&&this.setAttribute("tangent",new Rh(new Float32Array(4*o),4));for(var s=t.tangent.array,l=[],u=[],c=0;c<o;c++)l[c]=new id,u[c]=new id;var f=new id,d=new id,h=new id,p=new jf,v=new jf,m=new jf,g=new id,y=new id,b=this.groups;0===b.length&&(b=[{start:0,count:n.length}]);for(var x=0,w=b.length;x<w;++x)for(var _=b[x],S=_.start,M=S,E=S+_.count;M<E;M+=3)I(n[M+0],n[M+1],n[M+2]);for(var T=new id,k=new id,L=new id,C=new id,R=0,P=b.length;R<P;++R)for(var A=b[R],O=A.start,N=O,D=O+A.count;N<D;N+=3)z(n[N+0]),z(n[N+1]),z(n[N+2])}else console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");function I(e,t,n){f.fromArray(i,3*e),d.fromArray(i,3*t),h.fromArray(i,3*n),p.fromArray(a,2*e),v.fromArray(a,2*t),m.fromArray(a,2*n),d.sub(f),h.sub(f),v.sub(p),m.sub(p);var r=1/(v.x*m.y-m.x*v.y);isFinite(r)&&(g.copy(d).multiplyScalar(m.y).addScaledVector(h,-v.y).multiplyScalar(r),y.copy(h).multiplyScalar(v.x).addScaledVector(d,-m.x).multiplyScalar(r),l[e].add(g),l[t].add(g),l[n].add(g),u[e].add(y),u[t].add(y),u[n].add(y))}function z(e){L.fromArray(r,3*e),C.copy(L);var t=l[e];T.copy(t),T.sub(L.multiplyScalar(L.dot(t))).normalize(),k.crossVectors(C,t);var n=k.dot(u[e])<0?-1:1;s[4*e]=T.x,s[4*e+1]=T.y,s[4*e+2]=T.z,s[4*e+3]=n}}},{key:"computeVertexNormals",value:function(){var e=this.index,t=this.getAttribute("position");if(void 0!==t){var n=this.getAttribute("normal");if(void 0===n)n=new Rh(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(var r=0,i=n.count;r<i;r++)n.setXYZ(r,0,0,0);var a=new id,o=new id,s=new id,l=new id,u=new id,c=new id,f=new id,d=new id;if(e)for(var h=0,p=e.count;h<p;h+=3){var v=e.getX(h+0),m=e.getX(h+1),g=e.getX(h+2);a.fromBufferAttribute(t,v),o.fromBufferAttribute(t,m),s.fromBufferAttribute(t,g),f.subVectors(s,o),d.subVectors(a,o),f.cross(d),l.fromBufferAttribute(n,v),u.fromBufferAttribute(n,m),c.fromBufferAttribute(n,g),l.add(f),u.add(f),c.add(f),n.setXYZ(v,l.x,l.y,l.z),n.setXYZ(m,u.x,u.y,u.z),n.setXYZ(g,c.x,c.y,c.z)}else for(var y=0,b=t.count;y<b;y+=3)a.fromBufferAttribute(t,y+0),o.fromBufferAttribute(t,y+1),s.fromBufferAttribute(t,y+2),f.subVectors(s,o),d.subVectors(a,o),f.cross(d),n.setXYZ(y+0,f.x,f.y,f.z),n.setXYZ(y+1,f.x,f.y,f.z),n.setXYZ(y+2,f.x,f.y,f.z);this.normalizeNormals(),n.needsUpdate=!0}}},{key:"merge",value:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,a=e.attributes[r],o=a.array,s=a.itemSize*t,l=Math.min(o.length,i.length-s),u=0,c=s;u<l;u++,c++)i[c]=o[u];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)}},{key:"normalizeNormals",value:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Bh.fromBufferAttribute(e,t),Bh.normalize(),e.setXYZ(t,Bh.x,Bh.y,Bh.z)}},{key:"toNonIndexed",value:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0,l=0,u=t.length;l<u;l++){o=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*r;for(var c=0;c<r;c++)a[s++]=n[o++]}return new Rh(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;var t=new g,n=this.index.array,r=this.attributes;for(var i in r){var a=e(r[i],n);t.setAttribute(i,a)}var o=this.morphAttributes;for(var s in o){for(var l=[],u=o[s],c=0,f=u.length;c<f;c++){var d=e(u[c],n);l.push(d)}t.morphAttributes[s]=l}t.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,p=0,v=h.length;p<v;p++){var m=h[p];t.addGroup(m.start,m.count,m.materialIndex)}return t}},{key:"toJSON",value:function(){var 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),0<Object.keys(this.userData).length&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var a in i){var o=i[a];e.data.attributes[a]=o.toJSON(e.data)}var s={},l=!1;for(var u in this.morphAttributes){for(var c=this.morphAttributes[u],f=[],d=0,h=c.length;d<h;d++){var p=c[d];f.push(p.toJSON(e.data))}0<f.length&&(s[u]=f,l=!0)}l&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var v=this.groups;0<v.length&&(e.data.groups=JSON.parse(JSON.stringify(v)));var m=this.boundingSphere;return null!==m&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone(t));var r=e.attributes;for(var i in r){var a=r[i];this.setAttribute(i,a.clone(t))}var o=e.morphAttributes;for(var s in o){for(var l=[],u=o[s],c=0,f=u.length;c<f;c++)l.push(u[c].clone(t));this.morphAttributes[s]=l}this.morphTargetsRelative=e.morphTargetsRelative;for(var d=e.groups,h=0,p=d.length;h<p;h++){var v=d[h];this.addGroup(v.start,v.count,v.materialIndex)}var m=e.boundingBox;null!==m&&(this.boundingBox=m.clone());var g=e.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),g}();Hh.prototype.isBufferGeometry=!0;var Gh=new Dd,Vh=new Nd,Wh=new Td,jh=new id,qh=new id,Xh=new id,Yh=new id,Zh=new id,Jh=new id,$h=new id,Qh=new id,Kh=new id,ep=new jf,tp=new jf,np=new jf,rp=new id,ip=new id,ap=function(){Rl(i,oh);var r=Ul(i);function i(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Hh,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new kh;return Tl(this,i),(e=r.call(this)).type="Mesh",e.geometry=t,e.material=n,e.updateMorphTargets(),e}return Ll(i,[{key:"copy",value:function(e){return Bl(Pl(i.prototype),"copy",this).call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(0<n.length){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=r.length;i<a;i++){var o=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}else{var s=e.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"raycast",value:function(e,t){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),Wh.copy(r.boundingSphere),Wh.applyMatrix4(a),!1!==e.ray.intersectsSphere(Wh)&&(Gh.copy(a).invert(),Vh.copy(e.ray).applyMatrix4(Gh),null===r.boundingBox||!1!==Vh.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o=r.index,s=r.attributes.position,l=r.morphAttributes.position,u=r.morphTargetsRelative,c=r.attributes.uv,f=r.attributes.uv2,d=r.groups,h=r.drawRange;if(null!==o)if(Array.isArray(i))for(var p=0,v=d.length;p<v;p++)for(var m=d[p],g=i[m.materialIndex],y=Math.max(m.start,h.start),b=Math.min(o.count,Math.min(m.start+m.count,h.start+h.count));y<b;y+=3){var x=o.getX(y),w=o.getX(y+1),_=o.getX(y+2);(n=op(this,g,e,Vh,s,l,u,c,f,x,w,_))&&(n.faceIndex=Math.floor(y/3),n.face.materialIndex=m.materialIndex,t.push(n))}else for(var S=Math.max(0,h.start),M=Math.min(o.count,h.start+h.count);S<M;S+=3){var E=o.getX(S),T=o.getX(S+1),k=o.getX(S+2);(n=op(this,i,e,Vh,s,l,u,c,f,E,T,k))&&(n.faceIndex=Math.floor(S/3),t.push(n))}else if(void 0!==s)if(Array.isArray(i))for(var L=0,C=d.length;L<C;L++)for(var R=d[L],P=i[R.materialIndex],A=Math.max(R.start,h.start),O=Math.min(s.count,Math.min(R.start+R.count,h.start+h.count));A<O;A+=3){(n=op(this,P,e,Vh,s,l,u,c,f,A,A+1,A+2))&&(n.faceIndex=Math.floor(A/3),n.face.materialIndex=R.materialIndex,t.push(n))}else for(var N=Math.max(0,h.start),D=Math.min(s.count,h.start+h.count);N<D;N+=3){(n=op(this,i,e,Vh,s,l,u,c,f,N,N+1,N+2))&&(n.faceIndex=Math.floor(N/3),t.push(n))}}else r.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}]),i}();function op(e,t,n,r,i,a,o,s,l,u,c,f){jh.fromBufferAttribute(i,u),qh.fromBufferAttribute(i,c),Xh.fromBufferAttribute(i,f);var d=e.morphTargetInfluences;if(a&&d){$h.set(0,0,0),Qh.set(0,0,0),Kh.set(0,0,0);for(var h=0,p=a.length;h<p;h++){var v=d[h],m=a[h];0!==v&&(Yh.fromBufferAttribute(m,u),Zh.fromBufferAttribute(m,c),Jh.fromBufferAttribute(m,f),o?($h.addScaledVector(Yh,v),Qh.addScaledVector(Zh,v),Kh.addScaledVector(Jh,v)):($h.addScaledVector(Yh.sub(jh),v),Qh.addScaledVector(Zh.sub(qh),v),Kh.addScaledVector(Jh.sub(Xh),v)))}jh.add($h),qh.add(Qh),Xh.add(Kh)}e.isSkinnedMesh&&(e.boneTransform(u,jh),e.boneTransform(c,qh),e.boneTransform(f,Xh));var g=function(e,t,n,r,i,a,o,s){if(null===(t.side===au?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==ou,s)))return null;ip.copy(s),ip.applyMatrix4(e.matrixWorld);var l=n.ray.origin.distanceTo(ip);return l<n.near||l>n.far?null:{distance:l,point:ip.clone(),object:e}}(e,t,n,r,jh,qh,Xh,rp);if(g){s&&(ep.fromBufferAttribute(s,u),tp.fromBufferAttribute(s,c),np.fromBufferAttribute(s,f),g.uv=gh.getUV(rp,jh,qh,Xh,ep,tp,np,new jf)),l&&(ep.fromBufferAttribute(l,u),tp.fromBufferAttribute(l,c),np.fromBufferAttribute(l,f),g.uv2=gh.getUV(rp,jh,qh,Xh,ep,tp,np,new jf));var y={a:u,b:c,c:f,normal:new id,materialIndex:0};gh.getNormal(jh,qh,Xh,y.normal),g.face=y}return g}ap.prototype.isMesh=!0;var sp=function(){Rl(u,Hh);var l=Ul(u);function u(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:1,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:1;Tl(this,u),(e=l.call(this)).type="BoxGeometry",e.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o};var P=zl(e);i=Math.floor(i),a=Math.floor(a),o=Math.floor(o);var A=[],O=[],N=[],D=[],I=0,z=0;function s(e,t,n,r,i,a,o,s,l,u,c){for(var f=a/l,d=o/u,h=a/2,p=o/2,v=s/2,m=l+1,g=u+1,y=0,b=0,x=new id,w=0;w<g;w++)for(var _=w*d-p,S=0;S<m;S++){var M=S*f-h;x[e]=M*r,x[t]=_*i,x[n]=v,O.push(x.x,x.y,x.z),x[e]=0,x[t]=0,x[n]=0<s?1:-1,N.push(x.x,x.y,x.z),D.push(S/l),D.push(1-w/u),y+=1}for(var E=0;E<u;E++)for(var T=0;T<l;T++){var k=I+T+m*E,L=I+T+m*(E+1),C=I+(T+1)+m*(E+1),R=I+(T+1)+m*E;A.push(k,L,R),A.push(L,C,R),b+=6}P.addGroup(z,b,c),z+=b,I+=y}return s("z","y","x",-1,-1,r,n,t,o,a,0),s("z","y","x",1,-1,r,n,-t,o,a,1),s("x","z","y",1,1,t,r,n,i,o,2),s("x","z","y",1,-1,t,r,-n,i,o,3),s("x","y","z",1,-1,t,n,r,i,a,4),s("x","y","z",-1,-1,t,n,-r,i,a,5),e.setIndex(A),e.setAttribute("position",new Oh(O,3)),e.setAttribute("normal",new Oh(N,3)),e.setAttribute("uv",new Oh(D,2)),e}return Ll(u,null,[{key:"fromJSON",value:function(e){return new u(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}]),u}();function lp(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function up(e){for(var t={},n=0;n<e.length;n++){var r=lp(e[n]);for(var i in r)t[i]=r[i]}return t}var cp={clone:lp,merge:up},fp=function(){Rl(o,bh);var n=Ul(o);function o(e){var t;return Tl(this,o),(t=n.call(this)).type="ShaderMaterial",t.defines={},t.uniforms={},t.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",t.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",t.linewidth=1,t.wireframe=!1,t.wireframeLinewidth=1,t.fog=!1,t.lights=!1,t.clipping=!1,t.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},t.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},t.index0AttributeName=void 0,t.uniformsNeedUpdate=!1,t.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),t.setValues(e)),t}return Ll(o,[{key:"copy",value:function(e){return Bl(Pl(o.prototype),"copy",this).call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=lp(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}},{key:"toJSON",value:function(e){var t=Bl(Pl(o.prototype),"toJSON",this).call(this,e);for(var n in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}0<Object.keys(this.defines).length&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return 0<Object.keys(i).length&&(t.extensions=i),t}}]),o}();fp.prototype.isShaderMaterial=!0;var dp=function(){Rl(n,oh);var t=Ul(n);function n(){var e;return Tl(this,n),(e=t.call(this)).type="Camera",e.matrixWorldInverse=new Dd,e.projectionMatrix=new Dd,e.projectionMatrixInverse=new Dd,e}return Ll(n,[{key:"copy",value:function(e,t){return Bl(Pl(n.prototype),"copy",this).call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(e){Bl(Pl(n.prototype),"updateMatrixWorld",this).call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,t){Bl(Pl(n.prototype),"updateWorldMatrix",this).call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),n}();dp.prototype.isCamera=!0;var hp=function(){Rl(o,dp);var a=Ul(o);function o(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:50,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:.1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:2e3;return Tl(this,o),(e=a.call(this)).type="PerspectiveCamera",e.fov=t,e.zoom=1,e.near=r,e.far=i,e.focus=10,e.aspect=n,e.view=null,e.filmGauge=35,e.filmOffset=0,e.updateProjectionMatrix(),e}return Ll(o,[{key:"copy",value:function(e,t){return Bl(Pl(o.prototype),"copy",this).call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}},{key:"setFocalLength",value:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*If*Math.atan(t),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*Df*this.fov);return.5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*If*Math.atan(Math.tan(.5*Df*this.fov)/this.zoom)}},{key:"getFilmWidth",value:function(){return this.filmGauge*Math.min(this.aspect,1)}},{key:"getFilmHeight",value:function(){return this.filmGauge/Math.max(this.aspect,1)}},{key:"setViewOffset",value:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(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=i,this.view.height=a,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=this.near,t=e*Math.tan(.5*Df*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=Bl(Pl(o.prototype),"toJSON",this).call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}]),o}();hp.prototype.isPerspectiveCamera=!0;var pp=function(){Rl(f,oh);var c=Ul(f);function f(e,t,n){var r;if(Tl(this,f),(r=c.call(this)).type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."),Fl(r);r.renderTarget=n;var i=new hp(90,1,e,t);i.layers=r.layers,i.up.set(0,-1,0),i.lookAt(new id(1,0,0)),r.add(i);var a=new hp(90,1,e,t);a.layers=r.layers,a.up.set(0,-1,0),a.lookAt(new id(-1,0,0)),r.add(a);var o=new hp(90,1,e,t);o.layers=r.layers,o.up.set(0,0,1),o.lookAt(new id(0,1,0)),r.add(o);var s=new hp(90,1,e,t);s.layers=r.layers,s.up.set(0,0,-1),s.lookAt(new id(0,-1,0)),r.add(s);var l=new hp(90,1,e,t);l.layers=r.layers,l.up.set(0,-1,0),l.lookAt(new id(0,0,1)),r.add(l);var u=new hp(90,1,e,t);return u.layers=r.layers,u.up.set(0,-1,0),u.lookAt(new id(0,0,-1)),r.add(u),r}return Ll(f,[{key:"update",value:function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,r=Hl(this.children,6),i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=e.xr.enabled,f=e.getRenderTarget();e.xr.enabled=!1;var d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,a),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,s),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,u),e.setRenderTarget(f),e.xr.enabled=c}}]),f}(),vp=function(){Rl(d,Qf);var f=Ul(d);function d(e,t,n,r,i,a,o,s,l,u){var c;return Tl(this,d),e=void 0!==e?e:[],t=void 0!==t?t:qu,(c=f.call(this,e,t,n,r,i,a,o,s,l,u)).flipY=!1,c}return Ll(d,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}]),d}();vp.prototype.isCubeTexture=!0;var mp=function(){Rl(a,td);var i=Ul(a);function a(e,t,n){var r;return Tl(this,a),Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),r=i.call(this,e,e,t),t=t||{},r.texture=new vp(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),r.texture.isRenderTargetTexture=!0,r.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,r.texture.minFilter=void 0!==t.minFilter?t.minFilter:ic,r.texture._needsFlipEnvMap=!1,r}return Ll(a,[{key:"fromEquirectangularTexture",value:function(e,t){this.texture.type=t.type,this.texture.format=wc,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",a=new sp(5,5,5),o=new fp({name:"CubemapFromEquirect",uniforms:lp(n),vertexShader:r,fragmentShader:i,side:au,blending:su});o.uniforms.tEquirect.value=t;var s=new ap(a,o),l=t.minFilter;return t.minFilter===oc&&(t.minFilter=ic),new pp(1,10,this).update(e,s),t.minFilter=l,s.geometry.dispose(),s.material.dispose(),this}},{key:"clear",value:function(e,t,n,r){for(var i=e.getRenderTarget(),a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(i)}}]),a}();mp.prototype.isWebGLCubeRenderTarget=!0;var gp=new id,yp=new id,bp=new Xf,xp=function(){function n(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new id(1,0,0),t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;Tl(this,n),this.normal=e,this.constant=t}return Ll(n,[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,n){var r=gp.subVectors(n,t).cross(yp.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}},{key:"intersectLine",value:function(e,t){var n=e.delta(gp),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||1<i?null:t.copy(n).multiplyScalar(i).add(e.start)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&0<n||n<0&&0<t}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var n=t||bp.getNormalMatrix(e),r=this.coplanarPoint(gp).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),n}();xp.prototype.isPlane=!0;var wp=new Td,_p=new id,Sp=function(){function o(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new xp,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new xp,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new xp,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:new xp,i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:new xp,a=5<arguments.length&&void 0!==arguments[5]?arguments[5]:new xp;Tl(this,o),this.planes=[e,t,n,r,i,a]}return Ll(o,[{key:"set",value:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6],c=n[7],f=n[8],d=n[9],h=n[10],p=n[11],v=n[12],m=n[13],g=n[14],y=n[15];return t[0].setComponents(o-r,c-s,p-f,y-v).normalize(),t[1].setComponents(o+r,c+s,p+f,y+v).normalize(),t[2].setComponents(o+i,c+l,p+d,y+m).normalize(),t[3].setComponents(o-i,c-l,p-d,y-m).normalize(),t[4].setComponents(o-a,c-u,p-h,y-g).normalize(),t[5].setComponents(o+a,c+u,p+h,y+g).normalize(),this}},{key:"intersectsObject",value:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),wp.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(wp)}},{key:"intersectsSprite",value:function(e){return wp.center.set(0,0,0),wp.radius=.7071067811865476,wp.applyMatrix4(e.matrixWorld),this.intersectsSphere(wp)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0}},{key:"intersectsBox",value:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(_p.x=0<r.normal.x?e.max.x:e.min.x,_p.y=0<r.normal.y?e.max.y:e.min.y,_p.z=0<r.normal.z?e.max.z:e.min.z,r.distanceToPoint(_p)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),o}();function Mp(){var n=null,e=!1,r=null,i=null;function a(e,t){r(e,t),i=n.requestAnimationFrame(a)}return{start:function(){!0!==e&&null!==r&&(i=n.requestAnimationFrame(a),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(e){r=e},setContext:function(e){n=e}}}function Ep(o,e){var s=e.isWebGL2,i=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var t=i.get(e);t&&(o.deleteBuffer(t.buffer),i.delete(e))},update:function(e,t){if(e.isGLBufferAttribute){var n=i.get(e);(!n||n.version<e.version)&&i.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version})}else{e.isInterleavedBufferAttribute&&(e=e.data);var r=i.get(e);void 0===r?i.set(e,function(e,t){var n=e.array,r=e.usage,i=o.createBuffer();o.bindBuffer(t,i),o.bufferData(t,n,r),e.onUploadCallback();var a=5126;return n instanceof Float32Array?a=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?e.isFloat16BufferAttribute?s?a=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):a=5123:n instanceof Int16Array?a=5122:n instanceof Uint32Array?a=5125:n instanceof Int32Array?a=5124:n instanceof Int8Array?a=5120:n instanceof Uint8Array?a=5121:n instanceof Uint8ClampedArray&&(a=5121),{buffer:i,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}(e,t)):r.version<e.version&&(function(e,t,n){var r=t.array,i=t.updateRange;o.bindBuffer(n,e),-1===i.count?o.bufferSubData(n,0,r):(s?o.bufferSubData(n,i.offset*r.BYTES_PER_ELEMENT,r,i.offset,i.count):o.bufferSubData(n,i.offset*r.BYTES_PER_ELEMENT,r.subarray(i.offset,i.offset+i.count)),i.count=-1)}(r.buffer,e,t),r.version=e.version)}}}}var Tp=function(){Rl(L,Hh);var k=Ul(L);function L(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;Tl(this,L),(e=k.call(this)).type="PlaneGeometry",e.parameters={width:t,height:n,widthSegments:r,heightSegments:i};for(var a=t/2,o=n/2,s=Math.floor(r),l=Math.floor(i),u=s+1,c=l+1,f=t/s,d=n/l,h=[],p=[],v=[],m=[],g=0;g<c;g++)for(var y=g*d-o,b=0;b<u;b++){var x=b*f-a;p.push(x,-y,0),v.push(0,0,1),m.push(b/s),m.push(1-g/l)}for(var w=0;w<l;w++)for(var _=0;_<s;_++){var S=_+u*w,M=_+u*(w+1),E=_+1+u*(w+1),T=_+1+u*w;h.push(S,M,T),h.push(M,E,T)}return e.setIndex(h),e.setAttribute("position",new Oh(p,3)),e.setAttribute("normal",new Oh(v,3)),e.setAttribute("uv",new Oh(m,2)),e}return Ll(L,null,[{key:"fromJSON",value:function(e){return new L(e.width,e.height,e.widthSegments,e.heightSegments)}}]),L}(),kp={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenTint, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenTint * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularTintFactor = specularTint;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARTINTMAP\n\t\t\tspecularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularTintFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenTint = sheenTint;\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenTint;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenTint, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationTint, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationTint;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( float roughness, float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularTint;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARTINTMAP\n\t\tuniform sampler2D specularTintMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenTint;\n\tuniform float sheenRoughness;\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},Lp={common:{diffuse:{value:new Th(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Xf},uv2Transform:{value:new Xf},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},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 jf(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 Th(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 Th(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Xf}},sprite:{diffuse:{value:new Th(16777215)},opacity:{value:1},center:{value:new jf(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Xf}}},Cp={basic:{uniforms:up([Lp.common,Lp.specularmap,Lp.envmap,Lp.aomap,Lp.lightmap,Lp.fog]),vertexShader:kp.meshbasic_vert,fragmentShader:kp.meshbasic_frag},lambert:{uniforms:up([Lp.common,Lp.specularmap,Lp.envmap,Lp.aomap,Lp.lightmap,Lp.emissivemap,Lp.fog,Lp.lights,{emissive:{value:new Th(0)}}]),vertexShader:kp.meshlambert_vert,fragmentShader:kp.meshlambert_frag},phong:{uniforms:up([Lp.common,Lp.specularmap,Lp.envmap,Lp.aomap,Lp.lightmap,Lp.emissivemap,Lp.bumpmap,Lp.normalmap,Lp.displacementmap,Lp.fog,Lp.lights,{emissive:{value:new Th(0)},specular:{value:new Th(1118481)},shininess:{value:30}}]),vertexShader:kp.meshphong_vert,fragmentShader:kp.meshphong_frag},standard:{uniforms:up([Lp.common,Lp.envmap,Lp.aomap,Lp.lightmap,Lp.emissivemap,Lp.bumpmap,Lp.normalmap,Lp.displacementmap,Lp.roughnessmap,Lp.metalnessmap,Lp.fog,Lp.lights,{emissive:{value:new Th(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:kp.meshphysical_vert,fragmentShader:kp.meshphysical_frag},toon:{uniforms:up([Lp.common,Lp.aomap,Lp.lightmap,Lp.emissivemap,Lp.bumpmap,Lp.normalmap,Lp.displacementmap,Lp.gradientmap,Lp.fog,Lp.lights,{emissive:{value:new Th(0)}}]),vertexShader:kp.meshtoon_vert,fragmentShader:kp.meshtoon_frag},matcap:{uniforms:up([Lp.common,Lp.bumpmap,Lp.normalmap,Lp.displacementmap,Lp.fog,{matcap:{value:null}}]),vertexShader:kp.meshmatcap_vert,fragmentShader:kp.meshmatcap_frag},points:{uniforms:up([Lp.points,Lp.fog]),vertexShader:kp.points_vert,fragmentShader:kp.points_frag},dashed:{uniforms:up([Lp.common,Lp.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:kp.linedashed_vert,fragmentShader:kp.linedashed_frag},depth:{uniforms:up([Lp.common,Lp.displacementmap]),vertexShader:kp.depth_vert,fragmentShader:kp.depth_frag},normal:{uniforms:up([Lp.common,Lp.bumpmap,Lp.normalmap,Lp.displacementmap,{opacity:{value:1}}]),vertexShader:kp.meshnormal_vert,fragmentShader:kp.meshnormal_frag},sprite:{uniforms:up([Lp.sprite,Lp.fog]),vertexShader:kp.sprite_vert,fragmentShader:kp.sprite_frag},background:{uniforms:{uvTransform:{value:new Xf},t2D:{value:null}},vertexShader:kp.background_vert,fragmentShader:kp.background_frag},cube:{uniforms:up([Lp.envmap,{opacity:{value:1}}]),vertexShader:kp.cube_vert,fragmentShader:kp.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:kp.equirect_vert,fragmentShader:kp.equirect_frag},distanceRGBA:{uniforms:up([Lp.common,Lp.displacementmap,{referencePosition:{value:new id},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:kp.distanceRGBA_vert,fragmentShader:kp.distanceRGBA_frag},shadow:{uniforms:up([Lp.lights,Lp.fog,{color:{value:new Th(0)},opacity:{value:1}}]),vertexShader:kp.shadow_vert,fragmentShader:kp.shadow_frag}};function Rp(o,s,n,l,r){var u,c,f=new Th(0),d=0,h=null,p=0,v=null;function m(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return f},setClearColor:function(e,t){var n=1<arguments.length&&void 0!==t?t:1;f.set(e),m(f,d=n)},getClearAlpha:function(){return d},setClearAlpha:function(e){m(f,d=e)},render:function(e,t){var n=!1,r=!0===t.isScene?t.background:null;r&&r.isTexture&&(r=s.get(r));var i=o.xr,a=i.getSession&&i.getSession();a&&"additive"===a.environmentBlendMode&&(r=null),null===r?m(f,d):r&&r.isColor&&(m(r,1),n=!0),(o.autoClear||n)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),r&&(r.isCubeTexture||r.mapping===Ju)?(void 0===c&&((c=new ap(new sp(1,1,1),new fp({name:"BackgroundCubeMaterial",uniforms:lp(Cp.cube.uniforms),vertexShader:Cp.cube.vertexShader,fragmentShader:Cp.cube.fragmentShader,side:au,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),l.update(c)),c.material.uniforms.envMap.value=r,c.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,h===r&&p===r.version&&v===o.toneMapping||(c.material.needsUpdate=!0,p=(h=r).version,v=o.toneMapping),e.unshift(c,c.geometry,c.material,0,0,null)):r&&r.isTexture&&(void 0===u&&((u=new ap(new Tp(2,2),new fp({name:"BackgroundMaterial",uniforms:lp(Cp.background.uniforms),vertexShader:Cp.background.vertexShader,fragmentShader:Cp.background.fragmentShader,side:iu,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),l.update(u)),!0===(u.material.uniforms.t2D.value=r).matrixAutoUpdate&&r.updateMatrix(),u.material.uniforms.uvTransform.value.copy(r.matrix),h===r&&p===r.version&&v===o.toneMapping||(u.material.needsUpdate=!0,p=(h=r).version,v=o.toneMapping),e.unshift(u,u.geometry,u.material,0,0,null))}}}function Pp(T,k,L,C){var a=T.getParameter(34921),l=C.isWebGL2?null:k.get("OES_vertex_array_object"),u=C.isWebGL2||null!==l,c={},e=h(null),f=e;function d(e){return C.isWebGL2?T.bindVertexArray(e):l.bindVertexArrayOES(e)}function o(e){return C.isWebGL2?T.deleteVertexArray(e):l.deleteVertexArrayOES(e)}function h(e){for(var t=[],n=[],r=[],i=0;i<a;i++)t[i]=0,n[i]=0,r[i]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function R(){for(var e=f.newAttributes,t=0,n=e.length;t<n;t++)e[t]=0}function P(e){A(e,0)}function A(e,t){var n=f.newAttributes,r=f.enabledAttributes,i=f.attributeDivisors;n[e]=1,0===r[e]&&(T.enableVertexAttribArray(e),r[e]=1),i[e]!==t&&((C.isWebGL2?T:k.get("ANGLE_instanced_arrays"))[C.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,t),i[e]=t)}function O(){for(var e=f.newAttributes,t=f.enabledAttributes,n=0,r=t.length;n<r;n++)t[n]!==e[n]&&(T.disableVertexAttribArray(n),t[n]=0)}function N(e,t,n,r,i,a){!0!==C.isWebGL2||5124!==n&&5125!==n?T.vertexAttribPointer(e,t,n,r,i,a):T.vertexAttribIPointer(e,t,n,i,a)}function s(){t(),f!==e&&d((f=e).object)}function t(){e.geometry=null,e.program=null,e.wireframe=!1}return{setup:function(e,t,n,r,i){var a=!1;if(u){var o=function(e,t,n){var r=!0===n.wireframe,i=c[e.id];void 0===i&&(i={},c[e.id]=i);var a=i[t.id];void 0===a&&(a={},i[t.id]=a);var o=a[r];void 0===o&&(o=h(C.isWebGL2?T.createVertexArray():l.createVertexArrayOES()),a[r]=o);return o}(r,n,t);f!==o&&d((f=o).object),(a=function(e,t){var n=f.attributes,r=e.attributes,i=0;for(var a in r){var o=n[a],s=r[a];if(void 0===o)return!0;if(o.attribute!==s)return!0;if(o.data!==s.data)return!0;i++}return f.attributesNum!==i||f.index!==t}(r,i))&&function(e,t){var n={},r=e.attributes,i=0;for(var a in r){var o=r[a],s={};(s.attribute=o).data&&(s.data=o.data),n[a]=s,i++}f.attributes=n,f.attributesNum=i,f.index=t}(r,i)}else{var s=!0===t.wireframe;f.geometry===r.id&&f.program===n.id&&f.wireframe===s||(f.geometry=r.id,f.program=n.id,f.wireframe=s,a=!0)}!0===e.isInstancedMesh&&(a=!0),null!==i&&L.update(i,34963),a&&(function(e,t,n,r){if(!1===C.isWebGL2&&(e.isInstancedMesh||r.isInstancedBufferGeometry)&&null===k.get("ANGLE_instanced_arrays"))return;R();var i=r.attributes,a=n.getAttributes(),o=t.defaultAttributeValues;for(var s in a){var l=a[s];if(0<=l.location){var u=i[s];if(void 0===u&&("instanceMatrix"===s&&e.instanceMatrix&&(u=e.instanceMatrix),"instanceColor"===s&&e.instanceColor&&(u=e.instanceColor)),void 0!==u){var c=u.normalized,f=u.itemSize,d=L.get(u);if(void 0===d)continue;var h=d.buffer,p=d.type,v=d.bytesPerElement;if(u.isInterleavedBufferAttribute){var m=u.data,g=m.stride,y=u.offset;if(m&&m.isInstancedInterleavedBuffer){for(var b=0;b<l.locationSize;b++)A(l.location+b,m.meshPerAttribute);!0!==e.isInstancedMesh&&void 0===r._maxInstanceCount&&(r._maxInstanceCount=m.meshPerAttribute*m.count)}else for(var x=0;x<l.locationSize;x++)P(l.location+x);T.bindBuffer(34962,h);for(var w=0;w<l.locationSize;w++)N(l.location+w,f/l.locationSize,p,c,g*v,(y+f/l.locationSize*w)*v)}else{if(u.isInstancedBufferAttribute){for(var _=0;_<l.locationSize;_++)A(l.location+_,u.meshPerAttribute);!0!==e.isInstancedMesh&&void 0===r._maxInstanceCount&&(r._maxInstanceCount=u.meshPerAttribute*u.count)}else for(var S=0;S<l.locationSize;S++)P(l.location+S);T.bindBuffer(34962,h);for(var M=0;M<l.locationSize;M++)N(l.location+M,f/l.locationSize,p,c,f*v,f/l.locationSize*M*v)}}else if(void 0!==o){var E=o[s];if(void 0!==E)switch(E.length){case 2:T.vertexAttrib2fv(l.location,E);break;case 3:T.vertexAttrib3fv(l.location,E);break;case 4:T.vertexAttrib4fv(l.location,E);break;default:T.vertexAttrib1fv(l.location,E)}}}}O()}(e,t,n,r),null!==i&&T.bindBuffer(34963,L.get(i).buffer))},reset:s,resetDefaultState:t,dispose:function(){for(var e in s(),c){var t=c[e];for(var n in t){var r=t[n];for(var i in r)o(r[i].object),delete r[i];delete t[n]}delete c[e]}},releaseStatesOfGeometry:function(e){if(void 0!==c[e.id]){var t=c[e.id];for(var n in t){var r=t[n];for(var i in r)o(r[i].object),delete r[i];delete t[n]}delete c[e.id]}},releaseStatesOfProgram:function(e){for(var t in c){var n=c[t];if(void 0!==n[e.id]){var r=n[e.id];for(var i in r)o(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:R,enableAttribute:P,disableUnusedAttributes:O}}function Ap(a,o,s,e){var l,u=e.isWebGL2;this.setMode=function(e){l=e},this.render=function(e,t){a.drawArrays(l,e,t),s.update(t,l,1)},this.renderInstances=function(e,t,n){if(0!==n){var r,i;if(u)r=a,i="drawArraysInstanced";else if(i="drawArraysInstancedANGLE",null===(r=o.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[i](l,e,t,n),s.update(t,l,n)}}}function Op(t,n,e){var r;function i(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,o=void 0!==e.precision?e.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=a||n.has("WEBGL_draw_buffers"),u=!0===e.logarithmicDepthBuffer,c=t.getParameter(34930),f=t.getParameter(35660),d=t.getParameter(3379),h=t.getParameter(34076),p=t.getParameter(34921),v=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),y=0<f,b=a||n.has("OES_texture_float");return{isWebGL2:a,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===n.has("EXT_texture_filter_anisotropic")){var e=n.get("EXT_texture_filter_anisotropic");r=t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:f,maxTextureSize:d,maxCubemapSize:h,maxAttributes:p,maxVertexUniforms:v,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:y,floatFragmentTextures:b,floatVertexTextures:y&&b,maxSamples:a?t.getParameter(36183):0}}function Np(f){var c=this,d=null,h=0,p=!1,v=!1,m=new xp,g=new Xf,y={value:null,needsUpdate:!1};function b(){y.value!==d&&(y.value=d,y.needsUpdate=0<h),c.numPlanes=h,c.numIntersection=0}function x(e,t,n,r){var i=null!==e?e.length:0,a=null;if(0!==i){if(a=y.value,!0!==r||null===a){var o=n+4*i,s=t.matrixWorldInverse;g.getNormalMatrix(s),(null===a||a.length<o)&&(a=new Float32Array(o));for(var l=0,u=n;l!==i;++l,u+=4)m.copy(e[l]).applyMatrix4(s,g),m.normal.toArray(a,u),a[u+3]=m.constant}y.value=a,y.needsUpdate=!0}return c.numPlanes=i,c.numIntersection=0,a}this.uniform=y,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,n){var r=0!==e.length||t||0!==h||p;return p=t,d=x(e,n,0),h=e.length,r},this.beginShadows=function(){v=!0,x(null)},this.endShadows=function(){v=!1,b()},this.setState=function(e,t,n){var r=e.clippingPlanes,i=e.clipIntersection,a=e.clipShadows,o=f.get(e);if(!p||null===r||0===r.length||v&&!a)v?x(null):b();else{var s=v?0:h,l=4*s,u=o.clippingState||null;y.value=u,u=x(r,t,l,n);for(var c=0;c!==l;++c)u[c]=d[c];o.clippingState=u,this.numIntersection=i?this.numPlanes:0,this.numPlanes+=s}}}function Dp(a){var o=new WeakMap;function s(e,t){return t===Yu?e.mapping=qu:t===Zu&&(e.mapping=Xu),e}function l(e){var t=e.target;t.removeEventListener("dispose",l);var n=o.get(t);void 0!==n&&(o.delete(t),n.dispose())}return{get:function(e){if(e&&e.isTexture&&!1===e.isRenderTargetTexture){var t=e.mapping;if(t===Yu||t===Zu){if(o.has(e))return s(o.get(e).texture,e.mapping);var n=e.image;if(n&&0<n.height){var r=a.getRenderTarget(),i=new mp(n.height/2);return i.fromEquirectangularTexture(a,e),o.set(e,i),a.setRenderTarget(r),e.addEventListener("dispose",l),s(i.texture,e.mapping)}return null}}return e},dispose:function(){o=new WeakMap}}}Cp.physical={uniforms:up([Cp.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new jf(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenTint:{value:new Th(0)},sheenRoughness:{value:0},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new jf},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new Th(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new Th(1,1,1)},specularTintMap:{value:null}}]),vertexShader:kp.meshphysical_vert,fragmentShader:kp.meshphysical_frag};var Ip=function(){Rl(l,dp);var s=Ul(l);function l(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:-1,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:-1,a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:.1,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:2e3;return Tl(this,l),(e=s.call(this)).type="OrthographicCamera",e.zoom=1,e.view=null,e.left=t,e.right=n,e.top=r,e.bottom=i,e.near=a,e.far=o,e.updateProjectionMatrix(),e}return Ll(l,[{key:"copy",value:function(e,t){return Bl(Pl(l.prototype),"copy",this).call(this,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=null===e.view?null:Object.assign({},e.view),this}},{key:"setViewOffset",value:function(e,t,n,r,i,a){null===this.view&&(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=i,this.view.height=a,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var 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,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=l*this.view.offsetX)+l*this.view.width,s=(o-=u*this.view.offsetY)-u*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=Bl(Pl(l.prototype),"toJSON",this).call(this,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}]),l}();Ip.prototype.isOrthographicCamera=!0;var zp=function(){Rl(r,fp);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).type="RawShaderMaterial",t}return r}();zp.prototype.isRawShaderMaterial=!0;var Fp=Math.pow(2,8),Up=[.125,.215,.35,.446,.526,.582],Bp=5+Up.length,Hp=(Cl(ql={},xf,0),Cl(ql,wf,1),Cl(ql,Sf,2),Cl(ql,Ef,3),Cl(ql,Tf,4),Cl(ql,kf,5),Cl(ql,_f,6),ql),Gp=new Ip,Vp=Kp(),Wp=Vp._lodPlanes,jp=Vp._sizeLods,qp=Vp._sigmas,Xp=new Th,Yp=null,Zp=(1+Math.sqrt(5))/2,Jp=1/Zp,$p=[new id(1,1,1),new id(-1,1,1),new id(1,1,-1),new id(-1,1,-1),new id(0,Zp,Jp),new id(0,Zp,-Jp),new id(Jp,0,Zp),new id(-Jp,0,Zp),new id(Zp,Jp,0),new id(-Zp,Jp,0)],Qp=function(){function t(e){Tl(this,t),this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(e){var t=new Float32Array(e),n=new id(0,1,0);return new zp({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:Hp[xf]},outputEncoding:{value:Hp[xf]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:su,depthTest:!1,depthWrite:!1})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}return Ll(t,[{key:"fromScene",value:function(e,t,n,r){var i=1<arguments.length&&void 0!==t?t:0,a=2<arguments.length&&void 0!==n?n:.1,o=3<arguments.length&&void 0!==r?r:100;Yp=this._renderer.getRenderTarget();var s=this._allocateTargets();return this._sceneToCubeUV(e,a,o,s),0<i&&this._blur(s,0,0,i),this._applyPMREM(s),this._cleanup(s),s}},{key:"fromEquirectangular",value:function(e){return this._fromTexture(e)}},{key:"fromCubemap",value:function(e){return this._fromTexture(e)}},{key:"compileCubemapShader",value:function(){null===this._cubemapShader&&(this._cubemapShader=rv(),this._compileMaterial(this._cubemapShader))}},{key:"compileEquirectangularShader",value:function(){null===this._equirectShader&&(this._equirectShader=nv(),this._compileMaterial(this._equirectShader))}},{key:"dispose",value:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e<Wp.length;e++)Wp[e].dispose()}},{key:"_cleanup",value:function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Yp),e.scissorTest=!1,tv(e,0,0,e.width,e.height)}},{key:"_fromTexture",value:function(e){Yp=this._renderer.getRenderTarget();var t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}},{key:"_allocateTargets",value:function(e){var t={magFilter:tc,minFilter:tc,generateMipmaps:!1,type:sc,format:Mc,encoding:function(e){return void 0!==e&&e.type===sc&&(e.encoding===xf||e.encoding===wf||e.encoding===_f)}(e)?e.encoding:Sf,depthBuffer:!1},n=ev(t);return n.depthBuffer=!e,this._pingPongRenderTarget=ev(t),n}},{key:"_compileMaterial",value:function(e){var t=new ap(Wp[0],e);this._renderer.compile(t,Gp)}},{key:"_sceneToCubeUV",value:function(e,t,n,r){var i=new hp(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,l=s.autoClear,u=s.outputEncoding,c=s.toneMapping;s.getClearColor(Xp),s.toneMapping=Bu,s.outputEncoding=xf,s.autoClear=!1;var f=new kh({name:"PMREM.Background",side:au,depthWrite:!1,depthTest:!1}),d=new ap(new sp,f),h=!1,p=e.background;p?p.isColor&&(f.color.copy(p),h=!(e.background=null)):(f.color.copy(Xp),h=!0);for(var v=0;v<6;v++){var m=v%3;0==m?(i.up.set(0,a[v],0),i.lookAt(o[v],0,0)):1==m?(i.up.set(0,0,a[v]),i.lookAt(0,o[v],0)):(i.up.set(0,a[v],0),i.lookAt(0,0,o[v])),tv(r,m*Fp,2<v?Fp:0,Fp,Fp),s.setRenderTarget(r),h&&s.render(d,i),s.render(e,i)}d.geometry.dispose(),d.material.dispose(),s.toneMapping=c,s.outputEncoding=u,s.autoClear=l,e.background=p}},{key:"_setEncoding",value:function(e,t){!0===this._renderer.capabilities.isWebGL2&&t.format===wc&&t.type===sc&&t.encoding===wf?e.value=Hp[xf]:e.value=Hp[t.encoding]}},{key:"_textureToCubeUV",value:function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=rv()):null==this._equirectShader&&(this._equirectShader=nv());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new ap(Wp[0],r),a=r.uniforms;(a.envMap.value=e).isCubeTexture||a.texelSize.value.set(1/e.image.width,1/e.image.height),this._setEncoding(a.inputEncoding,e),this._setEncoding(a.outputEncoding,t.texture),tv(t,0,0,3*Fp,2*Fp),n.setRenderTarget(t),n.render(i,Gp)}},{key:"_applyPMREM",value:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r<Bp;r++){var i=Math.sqrt(qp[r]*qp[r]-qp[r-1]*qp[r-1]),a=$p[(r-1)%$p.length];this._blur(e,r-1,r,i,a)}t.autoClear=n}},{key:"_blur",value:function(e,t,n,r,i){var a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",i),this._halfBlur(a,e,n,n,r,"longitudinal",i)}},{key:"_halfBlur",value:function(e,t,n,r,i,a,o){var s=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var u=new ap(Wp[r],l),c=l.uniforms,f=jp[n]-1,d=isFinite(i)?Math.PI/(2*f):2*Math.PI/39,h=i/d,p=isFinite(i)?1+Math.floor(3*h):20;20<p&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(p," samples when the maximum is set to ").concat(20));for(var v=[],m=0,g=0;g<20;++g){var y=g/h,b=Math.exp(-y*y/2);v.push(b),0==g?m+=b:g<p&&(m+=2*b)}for(var x=0;x<v.length;x++)v[x]=v[x]/m;c.envMap.value=e.texture,c.samples.value=p,c.weights.value=v,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o),c.dTheta.value=d,c.mipInt.value=8-n,this._setEncoding(c.inputEncoding,e.texture),this._setEncoding(c.outputEncoding,e.texture);var w=jp[r];tv(t,3*Math.max(0,Fp-2*w),(0===r?0:2*Fp)+2*w*(4<r?r-8+4:0),3*w,2*w),s.setRenderTarget(t),s.render(u,Gp)}}]),t}();function Kp(){for(var e=[],t=[],n=[],r=8,i=0;i<Bp;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;4<i?o=Up[i-8+4-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,u=1+s/2,c=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),d=new Float32Array(72),h=new Float32Array(36),p=0;p<6;p++){var v=p%3*2/3-1,m=2<p?0:-1,g=[v,m,0,v+2/3,m,0,v+2/3,1+m,0,v,m,0,v+2/3,1+m,0,v,1+m,0];f.set(g,18*p),d.set(c,12*p);var y=[p,p,p,p,p,p];h.set(y,6*p)}var b=new Hh;b.setAttribute("position",new Rh(f,3)),b.setAttribute("uv",new Rh(d,2)),b.setAttribute("faceIndex",new Rh(h,1)),e.push(b),4<r&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function ev(e){var t=new td(3*Fp,3*Fp,e);return t.texture.mapping=Ju,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function tv(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function nv(){var e=new jf(1,1);return new zp({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:Hp[xf]},outputEncoding:{value:Hp[xf]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:su,depthTest:!1,depthWrite:!1})}function rv(){return new zp({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Hp[xf]},outputEncoding:{value:Hp[xf]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:su,depthTest:!1,depthWrite:!1})}function iv(s){var l=new WeakMap,u=null;function c(e){var t=e.target;t.removeEventListener("dispose",c);var n=l.get(t);void 0!==n&&(l.delete(t),n.dispose())}return{get:function(e){if(e&&e.isTexture&&!1===e.isRenderTargetTexture){var t=e.mapping,n=t===Yu||t===Zu,r=t===qu||t===Xu;if(n||r){if(l.has(e))return l.get(e).texture;var i=e.image;if(n&&i&&0<i.height||r&&i&&function(e){for(var t=0,n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(i)){var a=s.getRenderTarget();null===u&&(u=new Qp(s));var o=n?u.fromEquirectangular(e):u.fromCubemap(e);return l.set(e,o),s.setRenderTarget(a),e.addEventListener("dispose",c),o.texture}return null}}return e},dispose:function(){l=new WeakMap,null!==u&&(u.dispose(),u=null)}}}function av(n){var r={};function i(e){if(void 0!==r[e])return r[e];var t;switch(e){case"WEBGL_depth_texture":t=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":t=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":t=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":t=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:t=n.getExtension(e)}return r[e]=t}return{has:function(e){return null!==i(e)},init:function(e){e.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float")},get:function(e){var t=i(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function ov(e,b,i,a){var o={},x=new WeakMap;function s(e){var t=e.target;for(var n in null!==t.index&&b.remove(t.index),t.attributes)b.remove(t.attributes[n]);t.removeEventListener("dispose",s),delete o[t.id];var r=x.get(t);r&&(b.remove(r),x.delete(t)),a.releaseStatesOfGeometry(t),!0===t.isInstancedBufferGeometry&&delete t._maxInstanceCount,i.memory.geometries--}function r(e){var t=[],n=e.index,r=e.attributes.position,i=0;if(null!==n){var a=n.array;i=n.version;for(var o=0,s=a.length;o<s;o+=3){var l=a[o+0],u=a[o+1],c=a[o+2];t.push(l,u,u,c,c,l)}}else{var f=r.array;i=r.version;for(var d=0,h=f.length/3-1;d<h;d+=3){var p=d+0,v=d+1,m=d+2;t.push(p,v,v,m,m,p)}}var g=new(65535<Yf(t)?Ah:Ph)(t,1);g.version=i;var y=x.get(e);y&&b.remove(y),x.set(e,g)}return{get:function(e,t){return!0===o[t.id]||(t.addEventListener("dispose",s),o[t.id]=!0,i.memory.geometries++),t},update:function(e){var t=e.attributes;for(var n in t)b.update(t[n],34962);var r=e.morphAttributes;for(var i in r)for(var a=r[i],o=0,s=a.length;o<s;o++)b.update(a[o],34962)},getWireframeAttribute:function(e){var t=x.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&r(e)}else r(e);return x.get(e)}}}function sv(a,o,s,e){var l,u,c,f=e.isWebGL2;this.setMode=function(e){l=e},this.setIndex=function(e){u=e.type,c=e.bytesPerElement},this.render=function(e,t){a.drawElements(l,t,u,e*c),s.update(t,l,1)},this.renderInstances=function(e,t,n){if(0!==n){var r,i;if(f)r=a,i="drawElementsInstanced";else if(i="drawElementsInstancedANGLE",null===(r=o.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[i](l,t,u,e*c,n),s.update(t,l,n)}}}function lv(e){var r={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:r,programs:null,autoReset:!0,reset:function(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0},update:function(e,t,n){switch(r.calls++,t){case 4:r.triangles+=n*(e/3);break;case 1:r.lines+=n*(e/2);break;case 3:r.lines+=n*(e-1);break;case 2:r.lines+=n*e;break;case 0:r.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",t)}}}}var uv=function(){Rl(o,Qf);var a=Ul(o);function o(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;return Tl(this,o),(e=a.call(this,null)).image={data:t,width:n,height:r,depth:i},e.magFilter=tc,e.minFilter=tc,e.wrapR=Ku,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return o}();function cv(e,t){return e[0]-t[0]}function fv(e,t){return Math.abs(t[1])-Math.abs(e[1])}function dv(e,t){var n=1,r=t.isInterleavedBufferAttribute?t.data.array:t.array;r instanceof Int8Array?n=127:r instanceof Int16Array?n=32767:r instanceof Int32Array?n=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",r),e.divideScalar(n)}function hv(U,B,H){for(var G={},V=new Float32Array(8),W=new WeakMap,j=new id,q=[],e=0;e<8;e++)q[e]=[e,0];return{update:function(e,t,n,r){var i=e.morphTargetInfluences;if(!0===B.isWebGL2){var a=t.morphAttributes.position.length,o=W.get(t);if(void 0===o||o.count!==a){void 0!==o&&o.texture.dispose();var s=void 0!==t.morphAttributes.normal,l=t.morphAttributes.position,u=t.morphAttributes.normal||[],c=!0==s?2:1,f=t.attributes.position.count*c,d=1;f>B.maxTextureSize&&(d=Math.ceil(f/B.maxTextureSize),f=B.maxTextureSize);var h=new Float32Array(f*d*4*a),p=new uv(h,f,d,a);p.format=wc,p.type=hc;for(var v=4*c,m=0;m<a;m++)for(var g=l[m],y=u[m],b=f*d*4*m,x=0;x<g.count;x++){j.fromBufferAttribute(g,x),!0===g.normalized&&dv(j,g);var w=x*v;h[b+w+0]=j.x,h[b+w+1]=j.y,h[b+w+2]=j.z,!(h[b+w+3]=0)==s&&(j.fromBufferAttribute(y,x),!0===y.normalized&&dv(j,y),h[b+w+4]=j.x,h[b+w+5]=j.y,h[b+w+6]=j.z,h[b+w+7]=0)}o={count:a,texture:p,size:new jf(f,d)},W.set(t,o)}for(var _=0,S=0;S<i.length;S++)_+=i[S];var M=t.morphTargetsRelative?1:1-_;r.getUniforms().setValue(U,"morphTargetBaseInfluence",M),r.getUniforms().setValue(U,"morphTargetInfluences",i),r.getUniforms().setValue(U,"morphTargetsTexture",o.texture,H),r.getUniforms().setValue(U,"morphTargetsTextureSize",o.size)}else{var E=void 0===i?0:i.length,T=G[t.id];if(void 0===T||T.length!==E){T=[];for(var k=0;k<E;k++)T[k]=[k,0];G[t.id]=T}for(var L=0;L<E;L++){var C=T[L];C[0]=L,C[1]=i[L]}T.sort(fv);for(var R=0;R<8;R++)R<E&&T[R][1]?(q[R][0]=T[R][0],q[R][1]=T[R][1]):(q[R][0]=Number.MAX_SAFE_INTEGER,q[R][1]=0);q.sort(cv);for(var P=t.morphAttributes.position,A=t.morphAttributes.normal,O=0,N=0;N<8;N++){var D=q[N],I=D[0],z=D[1];I!==Number.MAX_SAFE_INTEGER&&z?(P&&t.getAttribute("morphTarget"+N)!==P[I]&&t.setAttribute("morphTarget"+N,P[I]),A&&t.getAttribute("morphNormal"+N)!==A[I]&&t.setAttribute("morphNormal"+N,A[I]),O+=V[N]=z):(P&&!0===t.hasAttribute("morphTarget"+N)&&t.deleteAttribute("morphTarget"+N),A&&!0===t.hasAttribute("morphNormal"+N)&&t.deleteAttribute("morphNormal"+N),V[N]=0)}var F=t.morphTargetsRelative?1:1-O;r.getUniforms().setValue(U,"morphTargetBaseInfluence",F),r.getUniforms().setValue(U,"morphTargetInfluences",V)}}}}function pv(e,i,a,o){var s=new WeakMap;function l(e){var t=e.target;t.removeEventListener("dispose",l),a.remove(t.instanceMatrix),null!==t.instanceColor&&a.remove(t.instanceColor)}return{update:function(e){var t=o.render.frame,n=e.geometry,r=i.get(e,n);return s.get(r)!==t&&(i.update(r),s.set(r,t)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",l)&&e.addEventListener("dispose",l),a.update(e.instanceMatrix,34962),null!==e.instanceColor&&a.update(e.instanceColor,34962)),r},dispose:function(){s=new WeakMap}}}uv.prototype.isDataTexture2DArray=!0;var vv=function(){Rl(o,Qf);var a=Ul(o);function o(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;return Tl(this,o),(e=a.call(this,null)).image={data:t,width:n,height:r,depth:i},e.magFilter=tc,e.minFilter=tc,e.wrapR=Ku,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return o}();vv.prototype.isDataTexture3D=!0;var mv=new Qf,gv=new uv,yv=new vv,bv=new vp,xv=[],wv=[],_v=new Float32Array(16),Sv=new Float32Array(9),Mv=new Float32Array(4);function Ev(e,t,n){var r=e[0];if(r<=0||0<r)return e;var i=t*n,a=xv[i];if(void 0===a&&(a=new Float32Array(i),xv[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function Tv(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function kv(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function Lv(e,t){var n=wv[t];void 0===n&&(n=new Int32Array(t),wv[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Cv(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Rv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Tv(n,t))return;e.uniform2fv(this.addr,t),kv(n,t)}}function Pv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Tv(n,t))return;e.uniform3fv(this.addr,t),kv(n,t)}}function Av(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Tv(n,t))return;e.uniform4fv(this.addr,t),kv(n,t)}}function Ov(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Tv(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),kv(n,t)}else{if(Tv(n,r))return;Mv.set(r),e.uniformMatrix2fv(this.addr,!1,Mv),kv(n,r)}}function Nv(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Tv(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),kv(n,t)}else{if(Tv(n,r))return;Sv.set(r),e.uniformMatrix3fv(this.addr,!1,Sv),kv(n,r)}}function Dv(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Tv(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),kv(n,t)}else{if(Tv(n,r))return;_v.set(r),e.uniformMatrix4fv(this.addr,!1,_v),kv(n,r)}}function Iv(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function zv(e,t){var n=this.cache;Tv(n,t)||(e.uniform2iv(this.addr,t),kv(n,t))}function Fv(e,t){var n=this.cache;Tv(n,t)||(e.uniform3iv(this.addr,t),kv(n,t))}function Uv(e,t){var n=this.cache;Tv(n,t)||(e.uniform4iv(this.addr,t),kv(n,t))}function Bv(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Hv(e,t){var n=this.cache;Tv(n,t)||(e.uniform2uiv(this.addr,t),kv(n,t))}function Gv(e,t){var n=this.cache;Tv(n,t)||(e.uniform3uiv(this.addr,t),kv(n,t))}function Vv(e,t){var n=this.cache;Tv(n,t)||(e.uniform4uiv(this.addr,t),kv(n,t))}function Wv(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||mv,i)}function jv(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||yv,i)}function qv(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||bv,i)}function Xv(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||gv,i)}function Yv(e,t){e.uniform1fv(this.addr,t)}function Zv(e,t){var n=Ev(t,this.size,2);e.uniform2fv(this.addr,n)}function Jv(e,t){var n=Ev(t,this.size,3);e.uniform3fv(this.addr,n)}function $v(e,t){var n=Ev(t,this.size,4);e.uniform4fv(this.addr,n)}function Qv(e,t){var n=Ev(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Kv(e,t){var n=Ev(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function em(e,t){var n=Ev(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function tm(e,t){e.uniform1iv(this.addr,t)}function nm(e,t){e.uniform2iv(this.addr,t)}function rm(e,t){e.uniform3iv(this.addr,t)}function im(e,t){e.uniform4iv(this.addr,t)}function am(e,t){e.uniform1uiv(this.addr,t)}function om(e,t){e.uniform2uiv(this.addr,t)}function sm(e,t){e.uniform3uiv(this.addr,t)}function lm(e,t){e.uniform4uiv(this.addr,t)}function um(e,t,n){var r=t.length,i=Lv(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||mv,i[a])}function cm(e,t,n){var r=t.length,i=Lv(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||bv,i[a])}function fm(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Cv;case 35664:return Rv;case 35665:return Pv;case 35666:return Av;case 35674:return Ov;case 35675:return Nv;case 35676:return Dv;case 5124:case 35670:return Iv;case 35667:case 35671:return zv;case 35668:case 35672:return Fv;case 35669:case 35673:return Uv;case 5125:return Bv;case 36294:return Hv;case 36295:return Gv;case 36296:return Vv;case 35678:case 36198:case 36298:case 36306:case 35682:return Wv;case 35679:case 36299:case 36307:return jv;case 35680:case 36300:case 36308:case 36293:return qv;case 36289:case 36303:case 36311:case 36292:return Xv}}(t.type)}function dm(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Yv;case 35664:return Zv;case 35665:return Jv;case 35666:return $v;case 35674:return Qv;case 35675:return Kv;case 35676:return em;case 5124:case 35670:return tm;case 35667:case 35671:return nm;case 35668:case 35672:return rm;case 35669:case 35673:return im;case 5125:return am;case 36294:return om;case 36295:return sm;case 36296:return lm;case 35678:case 36198:case 36298:case 36306:case 35682:return um;case 35680:case 36300:case 36308:case 36293:return cm}}(t.type)}function hm(e){this.id=e,this.seq=[],this.map={}}dm.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),kv(t,e)},hm.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var pm=/(\w+)(\])?(\[|\.)?/g;function vm(e,t){e.seq.push(t),e.map[t.id]=t}function mm(e,t,n){var r=e.name,i=r.length;for(pm.lastIndex=0;;){var a=pm.exec(r),o=pm.lastIndex,s=a[1],l="]"===a[2],u=a[3];if(l&&(s|=0),void 0===u||"["===u&&o+2===i){vm(n,void 0===u?new fm(s,e,t):new dm(s,e,t));break}var c=n.map[s];void 0===c&&vm(n,c=new hm(s)),n=c}}function gm(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r);mm(i,e.getUniformLocation(t,i.name),this)}}function ym(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}gm.prototype.setValue=function(e,t,n,r){var i=this.map[t];void 0!==i&&i.setValue(e,n,r)},gm.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},gm.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},gm.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var bm=0;function xm(e){switch(e){case xf:return["Linear","( value )"];case wf:return["sRGB","( value )"];case Sf:return["RGBE","( value )"];case Ef:return["RGBM","( value, 7.0 )"];case Tf:return["RGBM","( value, 16.0 )"];case kf:return["RGBD","( value, 256.0 )"];case _f:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Mf:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function wm(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();return r&&""===i?"":n.toUpperCase()+"\n\n"+i+"\n\n"+function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(e.getShaderSource(t))}function _m(e,t){var n=xm(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Sm(e){return""!==e}function Mm(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Em(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Tm=/^[ \t]*#include +<([\w\d./]+)>/gm;function km(e){return e.replace(Tm,Lm)}function Lm(e,t){var n=kp[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return km(n)}var Cm=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Rm=/#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 Pm(e){return e.replace(Rm,Om).replace(Cm,Am)}function Am(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Om(e,t,n,r)}function Om(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function Nm(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Dm(e,t,n,r){var i,a,o=e.getContext(),s=n.defines,l=n.vertexShader,u=n.fragmentShader,c=function(e){var t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===tu?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===nu?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===ru&&(t="SHADOWMAP_TYPE_VSM"),t}(n),f=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case qu:case Xu:t="ENVMAP_TYPE_CUBE";break;case Ju:case $u:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),d=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case Xu:case $u:t="ENVMAP_MODE_REFRACTION"}return t}(n),h=function(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case zu:t="ENVMAP_BLENDING_MULTIPLY";break;case Fu:t="ENVMAP_BLENDING_MIX";break;case Uu:t="ENVMAP_BLENDING_ADD"}return t}(n),p=0<e.gammaFactor?e.gammaFactor:1,v=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Sm).join("\n")}(n),m=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),g=o.createProgram(),y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(0<(i=[m].filter(Sm).join("\n")).length&&(i+="\n"),0<(a=[v,m].filter(Sm).join("\n")).length&&(a+="\n")):(i=[Nm(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularTintMap?"#define USE_SPECULARTINTMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphTargets&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargets&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Sm).join("\n"),a=[v,Nm(n),"#define SHADER_NAME "+n.shaderName,m,"#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.envMap?"#define "+d:"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularTintMap?"#define USE_SPECULARTINTMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Bu?"#define TONE_MAPPING":"",n.toneMapping!==Bu?kp.tonemapping_pars_fragment:"",n.toneMapping!==Bu?function(e,t){var n;switch(t){case Hu:n="Linear";break;case Gu:n="Reinhard";break;case Vu:n="OptimizedCineon";break;case Wu:n="ACESFilmic";break;case ju:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.format===xc?"#define OPAQUE":"",kp.encodings_pars_fragment,n.map?_m("mapTexelToLinear",n.mapEncoding):"",n.matcap?_m("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?_m("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?_m("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.specularTintMap?_m("specularTintMapTexelToLinear",n.specularTintMapEncoding):"",n.lightMap?_m("lightMapTexelToLinear",n.lightMapEncoding):"",function(e,t){var n=xm(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Sm).join("\n")),l=Em(l=Mm(l=km(l),n),n),u=Em(u=Mm(u=km(u),n),n),l=Pm(l),u=Pm(u),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",i=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,a=["#define varying in",n.glslVersion===Of?"":"out highp vec4 pc_fragColor;",n.glslVersion===Of?"":"#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("\n")+"\n"+a);var b,x,w=y+a+u,_=ym(o,35633,y+i+l),S=ym(o,35632,w);if(o.attachShader(g,_),o.attachShader(g,S),void 0!==n.index0AttributeName?o.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&o.bindAttribLocation(g,0,"position"),o.linkProgram(g),e.debug.checkShaderErrors){var M=o.getProgramInfoLog(g).trim(),E=o.getShaderInfoLog(_).trim(),T=o.getShaderInfoLog(S).trim(),k=!0,L=!0;if(!1===o.getProgramParameter(g,35714)){k=!1;var C=wm(o,_,"vertex"),R=wm(o,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+o.getError()+" - VALIDATE_STATUS "+o.getProgramParameter(g,35715)+"\n\nProgram Info Log: "+M+"\n"+C+"\n"+R)}else""!==M?console.warn("THREE.WebGLProgram: Program Info Log:",M):""!==E&&""!==T||(L=!1);L&&(this.diagnostics={runnable:k,programLog:M,vertexShader:{log:E,prefix:i},fragmentShader:{log:T,prefix:a}})}return o.deleteShader(_),o.deleteShader(S),this.getUniforms=function(){return void 0===b&&(b=new gm(o,g)),b},this.getAttributes=function(){return void 0===x&&(x=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i),o=a.name,s=1;35674===a.type&&(s=2),35675===a.type&&(s=3),35676===a.type&&(s=4),n[o]={type:a.type,location:e.getAttribLocation(t,o),locationSize:s}}return n}(o,g)),x},this.destroy=function(){r.releaseStatesOfProgram(this),o.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=bm++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=_,this.fragmentShader=S,this}function Im(m,g,y,b,x,o,w){var s=[],_=x.isWebGL2,S=x.logarithmicDepthBuffer,M=x.floatVertexTextures,E=x.maxVertexUniforms,T=x.vertexTextures,k=x.precision,L={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"},i=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","morphTargetsCount","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","sheen","transmission","transmissionMap","thicknessMap"];function C(e){var t;return t=e&&e.isTexture?e.encoding:e&&e.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e.texture.encoding):xf,_&&e&&e.isTexture&&e.format===wc&&e.type===sc&&e.encoding===wf&&(t=xf),t}return{getParameters:function(e,t,n,r,i){var a,o,s=r.fog,l=e.isMeshStandardMaterial?r.environment:null,u=(e.isMeshStandardMaterial?y:g).get(e.envMap||l),c=L[e.type],f=i.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(M)return 1024;var n=E,r=Math.floor((n-20)/4),i=Math.min(r,t.length);return i<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+i+"."),0):i}(i):0;if(null!==e.precision&&(k=x.getMaxPrecision(e.precision))!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",k,"instead."),c){var d=Cp[c];a=d.vertexShader,o=d.fragmentShader}else a=e.vertexShader,o=e.fragmentShader;var h=m.getRenderTarget(),p=0<e.alphaTest,v=0<e.clearcoat;return{isWebGL2:_,shaderID:c,shaderName:e.type,vertexShader:a,fragmentShader:o,defines:e.defines,isRawShaderMaterial:!0===e.isRawShaderMaterial,glslVersion:e.glslVersion,precision:k,instancing:!0===i.isInstancedMesh,instancingColor:!0===i.isInstancedMesh&&null!==i.instanceColor,supportsVertexTextures:T,outputEncoding:null!==h?C(h.texture):m.outputEncoding,map:!!e.map,mapEncoding:C(e.map),matcap:!!e.matcap,matcapEncoding:C(e.matcap),envMap:!!u,envMapMode:u&&u.mapping,envMapEncoding:C(u),envMapCubeUV:!!u&&(u.mapping===Ju||u.mapping===$u),lightMap:!!e.lightMap,lightMapEncoding:C(e.lightMap),aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:C(e.emissiveMap),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===Rf,tangentSpaceNormalMap:e.normalMapType===Cf,clearcoat:v,clearcoatMap:v&&!!e.clearcoatMap,clearcoatRoughnessMap:v&&!!e.clearcoatRoughnessMap,clearcoatNormalMap:v&&!!e.clearcoatNormalMap,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,specularIntensityMap:!!e.specularIntensityMap,specularTintMap:!!e.specularTintMap,specularTintMapEncoding:C(e.specularTintMap),alphaMap:!!e.alphaMap,alphaTest:p,gradientMap:!!e.gradientMap,sheen:0<e.sheen,transmission:0<e.transmission,transmissionMap:!!e.transmissionMap,thicknessMap:!!e.thicknessMap,combine:e.combine,vertexTangents:!!e.normalMap&&!!i.geometry&&!!i.geometry.attributes.tangent,vertexColors:e.vertexColors,vertexAlphas:!0===e.vertexColors&&!!i.geometry&&!!i.geometry.attributes.color&&4===i.geometry.attributes.color.itemSize,vertexUvs:!!(e.map||e.bumpMap||e.normalMap||e.specularMap||e.alphaMap||e.emissiveMap||e.roughnessMap||e.metalnessMap||e.clearcoatMap||e.clearcoatRoughnessMap||e.clearcoatNormalMap||e.displacementMap||e.transmissionMap||e.thicknessMap||e.specularIntensityMap||e.specularTintMap),uvsVertexOnly:!(e.map||e.bumpMap||e.normalMap||e.specularMap||e.alphaMap||e.emissiveMap||e.roughnessMap||e.metalnessMap||e.clearcoatNormalMap||0<e.transmission||e.transmissionMap||e.thicknessMap||e.specularIntensityMap||e.specularTintMap||!e.displacementMap),fog:!!s,useFog:e.fog,fogExp2:s&&s.isFogExp2,flatShading:!!e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:S,skinning:!0===i.isSkinnedMesh&&0<f,maxBones:f,useVertexTexture:M,morphTargets:!!i.geometry&&!!i.geometry.morphAttributes.position,morphNormals:!!i.geometry&&!!i.geometry.morphAttributes.normal,morphTargetsCount:i.geometry&&i.geometry.morphAttributes.position?i.geometry.morphAttributes.position.length:0,numDirLights:t.directional.length,numPointLights:t.point.length,numSpotLights:t.spot.length,numRectAreaLights:t.rectArea.length,numHemiLights:t.hemi.length,numDirLightShadows:t.directionalShadowMap.length,numPointLightShadows:t.pointShadowMap.length,numSpotLightShadows:t.spotShadowMap.length,numClippingPlanes:w.numPlanes,numClipIntersection:w.numIntersection,format:e.format,dithering:e.dithering,shadowMapEnabled:m.shadowMap.enabled&&0<n.length,shadowMapType:m.shadowMap.type,toneMapping:e.toneMapped?m.toneMapping:Bu,physicallyCorrectLights:m.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,doubleSided:e.side===ou,flipSided:e.side===au,depthPacking:void 0!==e.depthPacking&&e.depthPacking,index0AttributeName:e.index0AttributeName,extensionDerivatives:e.extensions&&e.extensions.derivatives,extensionFragDepth:e.extensions&&e.extensions.fragDepth,extensionDrawBuffers:e.extensions&&e.extensions.drawBuffers,extensionShaderTextureLOD:e.extensions&&e.extensions.shaderTextureLOD,rendererExtensionFragDepth:_||b.has("EXT_frag_depth"),rendererExtensionDrawBuffers:_||b.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:_||b.has("EXT_shader_texture_lod"),customProgramCacheKey:e.customProgramCacheKey()}},getProgramCacheKey:function(e){var t=[];if(e.shaderID?t.push(e.shaderID):(t.push(e.fragmentShader),t.push(e.vertexShader)),void 0!==e.defines)for(var n in e.defines)t.push(n),t.push(e.defines[n]);if(!1===e.isRawShaderMaterial){for(var r=0;r<i.length;r++)t.push(e[i[r]]);t.push(m.outputEncoding),t.push(m.gammaFactor)}return t.push(e.customProgramCacheKey),t.join()},getUniforms:function(e){var t,n=L[e.type];if(n){var r=Cp[n];t=cp.clone(r.uniforms)}else t=e.uniforms;return t},acquireProgram:function(e,t){for(var n,r=0,i=s.length;r<i;r++){var a=s[r];if(a.cacheKey===t){++(n=a).usedTimes;break}}return void 0===n&&(n=new Dm(m,t,e,o),s.push(n)),n},releaseProgram:function(e){if(0==--e.usedTimes){var t=s.indexOf(e);s[t]=s[s.length-1],s.pop(),e.destroy()}},programs:s}}function zm(){var r=new WeakMap;return{get:function(e){var t=r.get(e);return void 0===t&&(t={},r.set(e,t)),t},remove:function(e){r.delete(e)},update:function(e,t,n){r.get(e)[t]=n},dispose:function(){r=new WeakMap}}}function Fm(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Um(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Bm(l){var u=[],c=0,s=[],f=[],d=[],h={id:-1};function p(e,t,n,r,i,a){var o=u[c],s=l.get(n);return void 0===o?(o={id:e.id,object:e,geometry:t,material:n,program:s.program||h,groupOrder:r,renderOrder:e.renderOrder,z:i,group:a},u[c]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=n,o.program=s.program||h,o.groupOrder=r,o.renderOrder=e.renderOrder,o.z=i,o.group=a),c++,o}return{opaque:s,transmissive:f,transparent:d,init:function(){c=0,s.length=0,f.length=0,d.length=0},push:function(e,t,n,r,i,a){var o=p(e,t,n,r,i,a);0<n.transmission?f.push(o):!0===n.transparent?d.push(o):s.push(o)},unshift:function(e,t,n,r,i,a){var o=p(e,t,n,r,i,a);0<n.transmission?f.unshift(o):!0===n.transparent?d.unshift(o):s.unshift(o)},finish:function(){for(var e=c,t=u.length;e<t;e++){var n=u[e];if(null===n.id)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.program=null,n.group=null}},sort:function(e,t){1<s.length&&s.sort(e||Fm),1<f.length&&f.sort(t||Um),1<d.length&&d.sort(t||Um)}}}function Hm(r){var i=new WeakMap;return{get:function(e,t){var n;return!1===i.has(e)?(n=new Bm(r),i.set(e,[n])):t>=i.get(e).length?(n=new Bm(r),i.get(e).push(n)):n=i.get(e)[t],n},dispose:function(){i=new WeakMap}}}function Gm(){var n={};return{get:function(e){if(void 0!==n[e.id])return n[e.id];var t;switch(e.type){case"DirectionalLight":t={direction:new id,color:new Th};break;case"SpotLight":t={position:new id,direction:new id,color:new Th,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new id,color:new Th,distance:0,decay:0};break;case"HemisphereLight":t={direction:new id,skyColor:new Th,groundColor:new Th};break;case"RectAreaLight":t={color:new Th,position:new id,halfWidth:new id,halfHeight:new id}}return n[e.id]=t}}}var Vm=0;function Wm(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function jm(D,I){for(var z=new Gm,F=function(){var n={};return{get:function(e){if(void 0!==n[e.id])return n[e.id];var t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jf};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jf,shadowCameraNear:1,shadowCameraFar:1e3}}return n[e.id]=t}}}(),U={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:[]},e=0;e<9;e++)U.probe.push(new id);var m=new id,g=new Dd,y=new Dd;return{setup:function(e,t){for(var n=0,r=0,i=0,a=0;a<9;a++)U.probe[a].set(0,0,0);var o=0,s=0,l=0,u=0,c=0,f=0,d=0,h=0;e.sort(Wm);for(var p=!0!==t?Math.PI:1,v=0,m=e.length;v<m;v++){var g=e[v],y=g.color,b=g.intensity,x=g.distance,w=g.shadow&&g.shadow.map?g.shadow.map.texture:null;if(g.isAmbientLight)n+=y.r*b*p,r+=y.g*b*p,i+=y.b*b*p;else if(g.isLightProbe)for(var _=0;_<9;_++)U.probe[_].addScaledVector(g.sh.coefficients[_],b);else if(g.isDirectionalLight){var S=z.get(g);if(S.color.copy(g.color).multiplyScalar(g.intensity*p),g.castShadow){var M=g.shadow,E=F.get(g);E.shadowBias=M.bias,E.shadowNormalBias=M.normalBias,E.shadowRadius=M.radius,E.shadowMapSize=M.mapSize,U.directionalShadow[o]=E,U.directionalShadowMap[o]=w,U.directionalShadowMatrix[o]=g.shadow.matrix,f++}U.directional[o]=S,o++}else if(g.isSpotLight){var T=z.get(g);if(T.position.setFromMatrixPosition(g.matrixWorld),T.color.copy(y).multiplyScalar(b*p),T.distance=x,T.coneCos=Math.cos(g.angle),T.penumbraCos=Math.cos(g.angle*(1-g.penumbra)),T.decay=g.decay,g.castShadow){var k=g.shadow,L=F.get(g);L.shadowBias=k.bias,L.shadowNormalBias=k.normalBias,L.shadowRadius=k.radius,L.shadowMapSize=k.mapSize,U.spotShadow[l]=L,U.spotShadowMap[l]=w,U.spotShadowMatrix[l]=g.shadow.matrix,h++}U.spot[l]=T,l++}else if(g.isRectAreaLight){var C=z.get(g);C.color.copy(y).multiplyScalar(b),C.halfWidth.set(.5*g.width,0,0),C.halfHeight.set(0,.5*g.height,0),U.rectArea[u]=C,u++}else if(g.isPointLight){var R=z.get(g);if(R.color.copy(g.color).multiplyScalar(g.intensity*p),R.distance=g.distance,R.decay=g.decay,g.castShadow){var P=g.shadow,A=F.get(g);A.shadowBias=P.bias,A.shadowNormalBias=P.normalBias,A.shadowRadius=P.radius,A.shadowMapSize=P.mapSize,A.shadowCameraNear=P.camera.near,A.shadowCameraFar=P.camera.far,U.pointShadow[s]=A,U.pointShadowMap[s]=w,U.pointShadowMatrix[s]=g.shadow.matrix,d++}U.point[s]=R,s++}else if(g.isHemisphereLight){var O=z.get(g);O.skyColor.copy(g.color).multiplyScalar(b*p),O.groundColor.copy(g.groundColor).multiplyScalar(b*p),U.hemi[c]=O,c++}}0<u&&(I.isWebGL2?(U.rectAreaLTC1=Lp.LTC_FLOAT_1,U.rectAreaLTC2=Lp.LTC_FLOAT_2):!0===D.has("OES_texture_float_linear")?(U.rectAreaLTC1=Lp.LTC_FLOAT_1,U.rectAreaLTC2=Lp.LTC_FLOAT_2):!0===D.has("OES_texture_half_float_linear")?(U.rectAreaLTC1=Lp.LTC_HALF_1,U.rectAreaLTC2=Lp.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),U.ambient[0]=n,U.ambient[1]=r,U.ambient[2]=i;var N=U.hash;N.directionalLength===o&&N.pointLength===s&&N.spotLength===l&&N.rectAreaLength===u&&N.hemiLength===c&&N.numDirectionalShadows===f&&N.numPointShadows===d&&N.numSpotShadows===h||(U.directional.length=o,U.spot.length=l,U.rectArea.length=u,U.point.length=s,U.hemi.length=c,U.directionalShadow.length=f,U.directionalShadowMap.length=f,U.pointShadow.length=d,U.pointShadowMap.length=d,U.spotShadow.length=h,U.spotShadowMap.length=h,U.directionalShadowMatrix.length=f,U.pointShadowMatrix.length=d,U.spotShadowMatrix.length=h,N.directionalLength=o,N.pointLength=s,N.spotLength=l,N.rectAreaLength=u,N.hemiLength=c,N.numDirectionalShadows=f,N.numPointShadows=d,N.numSpotShadows=h,U.version=Vm++)},setupView:function(e,t){for(var n=0,r=0,i=0,a=0,o=0,s=t.matrixWorldInverse,l=0,u=e.length;l<u;l++){var c=e[l];if(c.isDirectionalLight){var f=U.directional[n];f.direction.setFromMatrixPosition(c.matrixWorld),m.setFromMatrixPosition(c.target.matrixWorld),f.direction.sub(m),f.direction.transformDirection(s),n++}else if(c.isSpotLight){var d=U.spot[i];d.position.setFromMatrixPosition(c.matrixWorld),d.position.applyMatrix4(s),d.direction.setFromMatrixPosition(c.matrixWorld),m.setFromMatrixPosition(c.target.matrixWorld),d.direction.sub(m),d.direction.transformDirection(s),i++}else if(c.isRectAreaLight){var h=U.rectArea[a];h.position.setFromMatrixPosition(c.matrixWorld),h.position.applyMatrix4(s),y.identity(),g.copy(c.matrixWorld),g.premultiply(s),y.extractRotation(g),h.halfWidth.set(.5*c.width,0,0),h.halfHeight.set(0,.5*c.height,0),h.halfWidth.applyMatrix4(y),h.halfHeight.applyMatrix4(y),a++}else if(c.isPointLight){var p=U.point[r];p.position.setFromMatrixPosition(c.matrixWorld),p.position.applyMatrix4(s),r++}else if(c.isHemisphereLight){var v=U.hemi[o];v.direction.setFromMatrixPosition(c.matrixWorld),v.direction.transformDirection(s),v.direction.normalize(),o++}}},state:U}}function qm(e,t){var n=new jm(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,e)},setupLightsView:function(e){n.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function Xm(r,i){var a=new WeakMap;return{get:function(e){var t,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return!1===a.has(e)?(t=new qm(r,i),a.set(e,[t])):n>=a.get(e).length?(t=new qm(r,i),a.get(e).push(t)):t=a.get(e)[n],t},dispose:function(){a=new WeakMap}}}var Ym=function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="MeshDepthMaterial",t.depthPacking=3200,t.map=null,t.alphaMap=null,t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.wireframe=!1,t.wireframeLinewidth=1,t.fog=!1,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,e),this.depthPacking=e.depthPacking,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}}]),r}();Ym.prototype.isMeshDepthMaterial=!0;var Zm=function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="MeshDistanceMaterial",t.referencePosition=new id,t.nearDistance=1,t.farDistance=1e3,t.map=null,t.alphaMap=null,t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.fog=!1,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}]),r}();Zm.prototype.isMeshDistanceMaterial=!0;var Jm="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",$m="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nuniform float samples;\n#include <packing>\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function Qm(g,y,e){var b=new Sp,x=new jf,w=new jf,_=new ed,h=new Ym({depthPacking:Lf}),p=new Zm,v={},S=e.maxTextureSize,m={0:au,1:iu,2:ou},r=new fp({uniforms:{shadow_pass:{value:null},resolution:{value:new jf},radius:{value:4},samples:{value:8}},vertexShader:Jm,fragmentShader:$m}),i=r.clone();i.defines.HORIZONTAL_PASS=1;var t=new Hh;t.setAttribute("position",new Rh(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var a=new ap(t,r),M=this;function E(e,t){var n=y.update(a);r.uniforms.shadow_pass.value=e.map.texture,r.uniforms.resolution.value=e.mapSize,r.uniforms.radius.value=e.radius,r.uniforms.samples.value=e.blurSamples,g.setRenderTarget(e.mapPass),g.clear(),g.renderBufferDirect(t,null,n,r,a,null),i.uniforms.shadow_pass.value=e.mapPass.texture,i.uniforms.resolution.value=e.mapSize,i.uniforms.radius.value=e.radius,i.uniforms.samples.value=e.blurSamples,g.setRenderTarget(e.map),g.clear(),g.renderBufferDirect(t,null,n,i,a,null)}function T(e,t,n,r,i,a,o){var s=null,l=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(s=void 0!==l?l:!0===r.isPointLight?p:h,g.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&0<n.alphaTest){var u=s.uuid,c=n.uuid,f=v[u];void 0===f&&(f={},v[u]=f);var d=f[c];void 0===d&&(d=s.clone(),f[c]=d),s=d}return s.visible=n.visible,s.wireframe=n.wireframe,s.side=o===ru?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:m[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===r.isPointLight&&!0===s.isMeshDistanceMaterial&&(s.referencePosition.setFromMatrixPosition(r.matrixWorld),s.nearDistance=i,s.farDistance=a),s}function k(e,t,n,r,i){if(!1!==e.visible){if(e.layers.test(t.layers)&&(e.isMesh||e.isLine||e.isPoints)&&(e.castShadow||e.receiveShadow&&i===ru)&&(!e.frustumCulled||b.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld);var a=y.update(e),o=e.material;if(Array.isArray(o))for(var s=a.groups,l=0,u=s.length;l<u;l++){var c=s[l],f=o[c.materialIndex];if(f&&f.visible){var d=T(e,0,f,r,n.near,n.far,i);g.renderBufferDirect(n,null,a,d,e,c)}}else if(o.visible){var h=T(e,0,o,r,n.near,n.far,i);g.renderBufferDirect(n,null,a,h,e,null)}}for(var p=e.children,v=0,m=p.length;v<m;v++)k(p[v],t,n,r,i)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=tu,this.render=function(e,t,n){if(!1!==M.enabled&&(!1!==M.autoUpdate||!1!==M.needsUpdate)&&0!==e.length){var r=g.getRenderTarget(),i=g.getActiveCubeFace(),a=g.getActiveMipmapLevel(),o=g.state;o.setBlending(su),o.buffers.color.setClear(1,1,1,1),o.buffers.depth.setTest(!0),o.setScissorTest(!1);for(var s=0,l=e.length;s<l;s++){var u=e[s],c=u.shadow;if(void 0!==c){if(!1!==c.autoUpdate||!1!==c.needsUpdate){x.copy(c.mapSize);var f=c.getFrameExtents();if(x.multiply(f),w.copy(c.mapSize),(x.x>S||x.y>S)&&(x.x>S&&(w.x=Math.floor(S/f.x),x.x=w.x*f.x,c.mapSize.x=w.x),x.y>S&&(w.y=Math.floor(S/f.y),x.y=w.y*f.y,c.mapSize.y=w.y)),null===c.map&&!c.isPointLightShadow&&this.type===ru){var d={minFilter:ic,magFilter:ic,format:wc};c.map=new td(x.x,x.y,d),c.map.texture.name=u.name+".shadowMap",c.mapPass=new td(x.x,x.y,d),c.camera.updateProjectionMatrix()}if(null===c.map){var h={minFilter:tc,magFilter:tc,format:wc};c.map=new td(x.x,x.y,h),c.map.texture.name=u.name+".shadowMap",c.camera.updateProjectionMatrix()}g.setRenderTarget(c.map),g.clear();for(var p=c.getViewportCount(),v=0;v<p;v++){var m=c.getViewport(v);_.set(w.x*m.x,w.y*m.y,w.x*m.z,w.y*m.w),o.viewport(_),c.updateMatrices(u,v),b=c.getFrustum(),k(t,n,c.camera,u,this.type)}c.isPointLightShadow||this.type!==ru||E(c,n),c.needsUpdate=!1}}else console.warn("THREE.WebGLShadowMap:",u,"has no shadow.")}M.needsUpdate=!1,g.setRenderTarget(r,i,a)}}}function Km(c,e,t){var n,r,i=t.isWebGL2;var a=new function(){var t=!1,a=new ed,n=null,o=new ed(0,0,0,0);return{setMask:function(e){n===e||t||(c.colorMask(e,e,e,e),n=e)},setLocked:function(e){t=e},setClear:function(e,t,n,r,i){!0===i&&(e*=r,t*=r,n*=r),a.set(e,t,n,r),!1===o.equals(a)&&(c.clearColor(e,t,n,r),o.copy(a))},reset:function(){t=!1,n=null,o.set(-1,0,0,0)}}},o=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){e?U(2929):B(2929)},setMask:function(e){n===e||t||(c.depthMask(e),n=e)},setFunc:function(e){if(r!==e){if(e)switch(e){case Cu:c.depthFunc(512);break;case Ru:c.depthFunc(519);break;case Pu:c.depthFunc(513);break;case Au:c.depthFunc(515);break;case Ou:c.depthFunc(514);break;case Nu:c.depthFunc(518);break;case Du:c.depthFunc(516);break;case Iu:c.depthFunc(517);break;default:c.depthFunc(515)}else c.depthFunc(515);r=e}},setLocked:function(e){t=e},setClear:function(e){i!==e&&(c.clearDepth(e),i=e)},reset:function(){t=!1,i=r=n=null}}},s=new function(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;return{setTest:function(e){t||(e?U(2960):B(2960))},setMask:function(e){n===e||t||(c.stencilMask(e),n=e)},setFunc:function(e,t,n){r===e&&i===t&&a===n||(c.stencilFunc(e,t,n),r=e,i=t,a=n)},setOp:function(e,t,n){o===e&&s===t&&l===n||(c.stencilOp(e,t,n),o=e,s=t,l=n)},setLocked:function(e){t=e},setClear:function(e){u!==e&&(c.clearStencil(e),u=e)},reset:function(){t=!1,u=l=s=o=a=i=r=n=null}}},l={},u=null,f={},d=null,h=!1,p=null,v=null,m=null,g=null,y=null,b=null,x=null,w=!1,_=null,S=null,M=null,E=null,T=null,k=c.getParameter(35661),L=!1,C=0,R=c.getParameter(7938);-1!==R.indexOf("WebGL")?(C=parseFloat(/^WebGL (\d)/.exec(R)[1]),L=1<=C):-1!==R.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL ES (\d)/.exec(R)[1]),L=2<=C);var P=null,A={},O=c.getParameter(3088),N=c.getParameter(2978),D=(new ed).fromArray(O),I=(new ed).fromArray(N);function z(e,t,n){var r=new Uint8Array(4),i=c.createTexture();c.bindTexture(e,i),c.texParameteri(e,10241,9728),c.texParameteri(e,10240,9728);for(var a=0;a<n;a++)c.texImage2D(t+a,0,6408,1,1,0,6408,5121,r);return i}var F={};function U(e){!0!==l[e]&&(c.enable(e),l[e]=!0)}function B(e){!1!==l[e]&&(c.disable(e),l[e]=!1)}F[3553]=z(3553,3553,1),F[34067]=z(34067,34069,6),a.setClear(0,0,0,1),o.setClear(1),s.setClear(0),U(2929),o.setFunc(Au),j(!1),q(Kl),U(2884),W(su);var H=(Cl(n={},hu,32774),Cl(n,pu,32778),Cl(n,vu,32779),n);if(i)H[mu]=32775,H[gu]=32776;else{var G=e.get("EXT_blend_minmax");null!==G&&(H[mu]=G.MIN_EXT,H[gu]=G.MAX_EXT)}var V=(Cl(r={},yu,0),Cl(r,bu,1),Cl(r,xu,768),Cl(r,_u,770),Cl(r,Lu,776),Cl(r,Tu,774),Cl(r,Mu,772),Cl(r,wu,769),Cl(r,Su,771),Cl(r,ku,775),Cl(r,Eu,773),r);function W(e,t,n,r,i,a,o,s){if(e!==su){if(!1===h&&(U(3042),h=!0),e===du)i=i||t,a=a||n,o=o||r,t===v&&i===y||(c.blendEquationSeparate(H[t],H[i]),v=t,y=i),n===m&&r===g&&a===b&&o===x||(c.blendFuncSeparate(V[n],V[r],V[a],V[o]),m=n,g=r,b=a,x=o),p=e,w=null;else if(e!==p||s!==w){if(v===hu&&y===hu||(c.blendEquation(32774),y=v=hu),s)switch(e){case lu:c.blendFuncSeparate(1,771,1,771);break;case uu:c.blendFunc(1,1);break;case cu:c.blendFuncSeparate(0,0,769,771);break;case fu:c.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case lu:c.blendFuncSeparate(770,771,1,771);break;case uu:c.blendFunc(770,1);break;case cu:c.blendFunc(0,769);break;case fu:c.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}x=b=g=m=null,p=e,w=s}}else!0===h&&(B(3042),h=!1)}function j(e){_!==e&&(e?c.frontFace(2304):c.frontFace(2305),_=e)}function q(e){e!==Ql?(U(2884),e!==S&&(e===Kl?c.cullFace(1029):e===eu?c.cullFace(1028):c.cullFace(1032))):B(2884),S=e}function X(e,t,n){e?(U(32823),E===t&&T===n||(c.polygonOffset(t,n),E=t,T=n)):B(32823)}function Y(e){void 0===e&&(e=33984+k-1),P!==e&&(c.activeTexture(e),P=e)}return{buffers:{color:a,depth:o,stencil:s},enable:U,disable:B,bindFramebuffer:function(e,t){return null===t&&null!==u&&(t=u),f[e]!==t&&(c.bindFramebuffer(e,t),f[e]=t,i&&(36009===e&&(f[36160]=t),36160===e&&(f[36009]=t)),!0)},bindXRFramebuffer:function(e){e!==u&&(c.bindFramebuffer(36160,e),u=e)},useProgram:function(e){return d!==e&&(c.useProgram(e),d=e,!0)},setBlending:W,setMaterial:function(e,t){e.side===ou?B(2884):U(2884);var n=e.side===au;t&&(n=!n),j(n),e.blending===lu&&!1===e.transparent?W(su):W(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),o.setFunc(e.depthFunc),o.setTest(e.depthTest),o.setMask(e.depthWrite),a.setMask(e.colorWrite);var r=e.stencilWrite;s.setTest(r),r&&(s.setMask(e.stencilWriteMask),s.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),s.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),X(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?U(32926):B(32926)},setFlipSided:j,setCullFace:q,setLineWidth:function(e){e!==M&&(L&&c.lineWidth(e),M=e)},setPolygonOffset:X,setScissorTest:function(e){e?U(3089):B(3089)},activeTexture:Y,bindTexture:function(e,t){null===P&&Y();var n=A[P];void 0===n&&(n={type:void 0,texture:void 0},A[P]=n),n.type===e&&n.texture===t||(c.bindTexture(e,t||F[e]),n.type=e,n.texture=t)},unbindTexture:function(){var e=A[P];void 0!==e&&void 0!==e.type&&(c.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{c.compressedTexImage2D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{c.texImage2D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{c.texImage3D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(e){!1===D.equals(e)&&(c.scissor(e.x,e.y,e.z,e.w),D.copy(e))},viewport:function(e){!1===I.equals(e)&&(c.viewport(e.x,e.y,e.z,e.w),I.copy(e))},reset:function(){c.disable(3042),c.disable(2884),c.disable(2929),c.disable(32823),c.disable(3089),c.disable(2960),c.disable(32926),c.blendEquation(32774),c.blendFunc(1,0),c.blendFuncSeparate(1,0,1,0),c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.depthMask(!0),c.depthFunc(513),c.clearDepth(1),c.stencilMask(4294967295),c.stencilFunc(519,0,4294967295),c.stencilOp(7680,7680,7680),c.clearStencil(0),c.cullFace(1029),c.frontFace(2305),c.polygonOffset(0,0),c.activeTexture(33984),c.bindFramebuffer(36160,null),!0===i&&(c.bindFramebuffer(36009,null),c.bindFramebuffer(36008,null)),c.useProgram(null),c.lineWidth(1),c.scissor(0,0,c.canvas.width,c.canvas.height),c.viewport(0,0,c.canvas.width,c.canvas.height),l={},A={},w=h=!(f={}),T=E=M=S=_=x=b=y=g=m=v=p=d=u=P=null,D.set(0,0,c.canvas.width,c.canvas.height),I.set(0,0,c.canvas.width,c.canvas.height),a.reset(),o.reset(),s.reset()}}}function eg(E,a,T,k,L,C,R){var e,t,u,P=L.isWebGL2,n=L.maxTextures,w=L.maxCubemapSize,y=L.maxTextureSize,r=L.maxSamples,i=new WeakMap,o=!1;try{o="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function c(e,t){return o?new OffscreenCanvas(e,t):Zf("canvas")}function _(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?Wf:Math.floor,o=a(i*e.width),s=a(i*e.height);void 0===u&&(u=c(o,s));var l=n?c(o,s):u;return l.width=o,l.height=s,l.getContext("2d").drawImage(e,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function A(e){return Vf(e.width)&&Vf(e.height)}function O(e,t){return e.generateMipmaps&&t&&e.minFilter!==tc&&e.minFilter!==ic}function N(e,t,n,r,i){var a=4<arguments.length&&void 0!==i?i:1;E.generateMipmap(e),k.get(t).__maxMipLevel=Math.log2(Math.max(n,r,a))}function D(e,t,n,r){if(!1===P)return t;if(null!==e){if(void 0!==E[e])return E[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}var i=t;return 6403===t&&(5126===n&&(i=33326),5131===n&&(i=33325),5121===n&&(i=33321)),6407===t&&(5126===n&&(i=34837),5131===n&&(i=34843),5121===n&&(i=32849)),6408===t&&(5126===n&&(i=34836),5131===n&&(i=34842),5121===n&&(i=r===wf?35907:32856)),33325!==i&&33326!==i&&34842!==i&&34836!==i||a.get("EXT_color_buffer_float"),i}function s(e){return e===tc||e===nc||e===rc?9728:9729}function l(e){var t=e.target;t.removeEventListener("dispose",l),function(e){var t=k.get(e);if(void 0===t.__webglInit)return;E.deleteTexture(t.__webglTexture),k.remove(e)}(t),t.isVideoTexture&&i.delete(t),R.memory.textures--}function I(e){var t=e.target;t.removeEventListener("dispose",I),function(e){var t=e.texture,n=k.get(e),r=k.get(t);if(!e)return;void 0!==r.__webglTexture&&(E.deleteTexture(r.__webglTexture),R.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(var i=0;i<6;i++)E.deleteFramebuffer(n.__webglFramebuffer[i]),n.__webglDepthbuffer&&E.deleteRenderbuffer(n.__webglDepthbuffer[i]);else E.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&E.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&E.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&E.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&E.deleteRenderbuffer(n.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(var a=0,o=t.length;a<o;a++){var s=k.get(t[a]);s.__webglTexture&&(E.deleteTexture(s.__webglTexture),R.memory.textures--),k.remove(t[a])}k.remove(t),k.remove(e)}(t)}var f=0;function d(e,t){var n=k.get(e);if(e.isVideoTexture&&function(e){var t=R.render.frame;i.get(e)!==t&&(i.set(e,t),e.update())}(e),0<e.version&&n.__version!==e.version){var r=e.image;if(void 0===r)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==r.complete)return void m(n,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}T.activeTexture(33984+t),T.bindTexture(3553,n.__webglTexture)}function h(e,t){var n=k.get(e);0<e.version&&n.__version!==e.version?function(e,t,n){if(6!==t.image.length)return;S(e,t),T.activeTexture(33984+n),T.bindTexture(34067,e.__webglTexture),E.pixelStorei(37440,t.flipY),E.pixelStorei(37441,t.premultiplyAlpha),E.pixelStorei(3317,t.unpackAlignment),E.pixelStorei(37443,0);for(var r=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),i=t.image[0]&&t.image[0].isDataTexture,a=[],o=0;o<6;o++)a[o]=r||i?i?t.image[o].image:t.image[o]:_(t.image[o],!1,!0,w);var s,l=a[0],u=A(l)||P,c=C.convert(t.format),f=C.convert(t.type),d=D(t.internalFormat,c,f,t.encoding);if(z(34067,t,u),r){for(var h=0;h<6;h++){s=a[h].mipmaps;for(var p=0;p<s.length;p++){var v=s[p];t.format!==wc&&t.format!==xc?null!==c?T.compressedTexImage2D(34069+h,p,d,v.width,v.height,0,v.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):T.texImage2D(34069+h,p,d,v.width,v.height,0,c,f,v.data)}}e.__maxMipLevel=s.length-1}else{s=t.mipmaps;for(var m=0;m<6;m++)if(i){T.texImage2D(34069+m,0,d,a[m].width,a[m].height,0,c,f,a[m].data);for(var g=0;g<s.length;g++){var y=s[g].image[m].image;T.texImage2D(34069+m,g+1,d,y.width,y.height,0,c,f,y.data)}}else{T.texImage2D(34069+m,0,d,c,f,a[m]);for(var b=0;b<s.length;b++){var x=s[b];T.texImage2D(34069+m,b+1,d,c,f,x.image[m])}}e.__maxMipLevel=s.length}O(t,u)&&N(34067,t,l.width,l.height);e.__version=t.version,t.onUpdate&&t.onUpdate(t)}(n,e,t):(T.activeTexture(33984+t),T.bindTexture(34067,n.__webglTexture))}var p=(Cl(e={},Qu,10497),Cl(e,Ku,33071),Cl(e,ec,33648),e),v=(Cl(t={},tc,9728),Cl(t,nc,9984),Cl(t,rc,9986),Cl(t,ic,9729),Cl(t,ac,9985),Cl(t,oc,9987),t);function z(e,t,n){if(n?(E.texParameteri(e,10242,p[t.wrapS]),E.texParameteri(e,10243,p[t.wrapT]),32879!==e&&35866!==e||E.texParameteri(e,32882,p[t.wrapR]),E.texParameteri(e,10240,v[t.magFilter]),E.texParameteri(e,10241,v[t.minFilter])):(E.texParameteri(e,10242,33071),E.texParameteri(e,10243,33071),32879!==e&&35866!==e||E.texParameteri(e,32882,33071),t.wrapS===Ku&&t.wrapT===Ku||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),E.texParameteri(e,10240,s(t.magFilter)),E.texParameteri(e,10241,s(t.minFilter)),t.minFilter!==tc&&t.minFilter!==ic&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===a.has("EXT_texture_filter_anisotropic")){var r=a.get("EXT_texture_filter_anisotropic");if(t.type===hc&&!1===a.has("OES_texture_float_linear"))return;if(!1===P&&t.type===pc&&!1===a.has("OES_texture_half_float_linear"))return;(1<t.anisotropy||k.get(t).__currentAnisotropy)&&(E.texParameterf(e,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,L.getMaxAnisotropy())),k.get(t).__currentAnisotropy=t.anisotropy)}}function S(e,t){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",l),e.__webglTexture=E.createTexture(),R.memory.textures++)}function m(e,t,n){var r=3553;t.isDataTexture2DArray&&(r=35866),t.isDataTexture3D&&(r=32879),S(e,t),T.activeTexture(33984+n),T.bindTexture(r,e.__webglTexture),E.pixelStorei(37440,t.flipY),E.pixelStorei(37441,t.premultiplyAlpha),E.pixelStorei(3317,t.unpackAlignment),E.pixelStorei(37443,0);var i,a=function(e){return!P&&(e.wrapS!==Ku||e.wrapT!==Ku||e.minFilter!==tc&&e.minFilter!==ic)}(t)&&!1===A(t.image),o=_(t.image,a,!1,y),s=A(o)||P,l=C.convert(t.format),u=C.convert(t.type),c=D(t.internalFormat,l,u,t.encoding);z(r,t,s);var f=t.mipmaps;if(t.isDepthTexture)c=6402,P?c=t.type===hc?36012:t.type===dc?33190:t.type===yc?35056:33189:t.type===hc&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),t.format===Ec&&6402===c&&t.type!==cc&&t.type!==dc&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),t.type=cc,u=C.convert(t.type)),t.format===Tc&&6402===c&&(c=34041,t.type!==yc&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),t.type=yc,u=C.convert(t.type))),T.texImage2D(3553,0,c,o.width,o.height,0,l,u,null);else if(t.isDataTexture)if(0<f.length&&s){for(var d=0,h=f.length;d<h;d++)i=f[d],T.texImage2D(3553,d,c,i.width,i.height,0,l,u,i.data);t.generateMipmaps=!1,e.__maxMipLevel=f.length-1}else T.texImage2D(3553,0,c,o.width,o.height,0,l,u,o.data),e.__maxMipLevel=0;else if(t.isCompressedTexture){for(var p=0,v=f.length;p<v;p++)i=f[p],t.format!==wc&&t.format!==xc?null!==l?T.compressedTexImage2D(3553,p,c,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):T.texImage2D(3553,p,c,i.width,i.height,0,l,u,i.data);e.__maxMipLevel=f.length-1}else if(t.isDataTexture2DArray)T.texImage3D(35866,0,c,o.width,o.height,o.depth,0,l,u,o.data),e.__maxMipLevel=0;else if(t.isDataTexture3D)T.texImage3D(32879,0,c,o.width,o.height,o.depth,0,l,u,o.data),e.__maxMipLevel=0;else if(0<f.length&&s){for(var m=0,g=f.length;m<g;m++)i=f[m],T.texImage2D(3553,m,c,l,u,i);t.generateMipmaps=!1,e.__maxMipLevel=f.length-1}else T.texImage2D(3553,0,c,l,u,o),e.__maxMipLevel=0;O(t,s)&&N(r,t,o.width,o.height),e.__version=t.version,t.onUpdate&&t.onUpdate(t)}function F(e,t,n,r,i){var a=C.convert(n.format),o=C.convert(n.type),s=D(n.internalFormat,a,o,n.encoding);32879===i||35866===i?T.texImage3D(i,0,s,t.width,t.height,t.depth,0,a,o,null):T.texImage2D(i,0,s,t.width,t.height,0,a,o,null),T.bindFramebuffer(36160,e),E.framebufferTexture2D(36160,r,i,k.get(n).__webglTexture,0),T.bindFramebuffer(36160,null)}function U(e,t,n){if(E.bindRenderbuffer(36161,e),t.depthBuffer&&!t.stencilBuffer){var r=33189;if(n){var i=t.depthTexture;i&&i.isDepthTexture&&(i.type===hc?r=36012:i.type===dc&&(r=33190));var a=H(t);E.renderbufferStorageMultisample(36161,a,r,t.width,t.height)}else E.renderbufferStorage(36161,r,t.width,t.height);E.framebufferRenderbuffer(36160,36096,36161,e)}else if(t.depthBuffer&&t.stencilBuffer){if(n){var o=H(t);E.renderbufferStorageMultisample(36161,o,35056,t.width,t.height)}else E.renderbufferStorage(36161,34041,t.width,t.height);E.framebufferRenderbuffer(36160,33306,36161,e)}else{var s=!0===t.isWebGLMultipleRenderTargets?t.texture[0]:t.texture,l=C.convert(s.format),u=C.convert(s.type),c=D(s.internalFormat,l,u,s.encoding);if(n){var f=H(t);E.renderbufferStorageMultisample(36161,f,c,t.width,t.height)}else E.renderbufferStorage(36161,c,t.width,t.height)}E.bindRenderbuffer(36161,null)}function B(e){var t=k.get(e),n=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,t){if(t&&t.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(T.bindFramebuffer(36160,e),!t.depthTexture||!t.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");k.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),d(t.depthTexture,0);var n=k.get(t.depthTexture).__webglTexture;if(t.depthTexture.format===Ec)E.framebufferTexture2D(36160,36096,3553,n,0);else{if(t.depthTexture.format!==Tc)throw new Error("Unknown depthTexture format");E.framebufferTexture2D(36160,33306,3553,n,0)}}(t.__webglFramebuffer,e)}else if(n){t.__webglDepthbuffer=[];for(var r=0;r<6;r++)T.bindFramebuffer(36160,t.__webglFramebuffer[r]),t.__webglDepthbuffer[r]=E.createRenderbuffer(),U(t.__webglDepthbuffer[r],e,!1)}else T.bindFramebuffer(36160,t.__webglFramebuffer),t.__webglDepthbuffer=E.createRenderbuffer(),U(t.__webglDepthbuffer,e,!1);T.bindFramebuffer(36160,null)}function H(e){return P&&e.isWebGLMultisampleRenderTarget?Math.min(r,e.samples):0}var g=!1,b=!1;this.allocateTextureUnit=function(){var e=f;return n<=e&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+n),f+=1,e},this.resetTextureUnits=function(){f=0},this.setTexture2D=d,this.setTexture2DArray=function(e,t){var n=k.get(e);0<e.version&&n.__version!==e.version?m(n,e,t):(T.activeTexture(33984+t),T.bindTexture(35866,n.__webglTexture))},this.setTexture3D=function(e,t){var n=k.get(e);0<e.version&&n.__version!==e.version?m(n,e,t):(T.activeTexture(33984+t),T.bindTexture(32879,n.__webglTexture))},this.setTextureCube=h,this.setupRenderTarget=function(e){var t=e.texture,n=k.get(e),r=k.get(t);e.addEventListener("dispose",I),!0!==e.isWebGLMultipleRenderTargets&&(r.__webglTexture=E.createTexture(),r.__version=t.version,R.memory.textures++);var i=!0===e.isWebGLCubeRenderTarget,a=!0===e.isWebGLMultipleRenderTargets,o=!0===e.isWebGLMultisampleRenderTarget,s=t.isDataTexture3D||t.isDataTexture2DArray,l=A(e)||P;if(!P||t.format!==xc||t.type!==hc&&t.type!==pc||(t.format=wc,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),i){n.__webglFramebuffer=[];for(var u=0;u<6;u++)n.__webglFramebuffer[u]=E.createFramebuffer()}else if(n.__webglFramebuffer=E.createFramebuffer(),a)if(L.drawBuffers)for(var c=e.texture,f=0,d=c.length;f<d;f++){var h=k.get(c[f]);void 0===h.__webglTexture&&(h.__webglTexture=E.createTexture(),R.memory.textures++)}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(o)if(P){n.__webglMultisampledFramebuffer=E.createFramebuffer(),n.__webglColorRenderbuffer=E.createRenderbuffer(),E.bindRenderbuffer(36161,n.__webglColorRenderbuffer);var p=C.convert(t.format),v=C.convert(t.type),m=D(t.internalFormat,p,v,t.encoding),g=H(e);E.renderbufferStorageMultisample(36161,g,m,e.width,e.height),T.bindFramebuffer(36160,n.__webglMultisampledFramebuffer),E.framebufferRenderbuffer(36160,36064,36161,n.__webglColorRenderbuffer),E.bindRenderbuffer(36161,null),e.depthBuffer&&(n.__webglDepthRenderbuffer=E.createRenderbuffer(),U(n.__webglDepthRenderbuffer,e,!0)),T.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(i){T.bindTexture(34067,r.__webglTexture),z(34067,t,l);for(var y=0;y<6;y++)F(n.__webglFramebuffer[y],e,t,36064,34069+y);O(t,l)&&N(34067,t,e.width,e.height),T.unbindTexture()}else if(a){for(var b=e.texture,x=0,w=b.length;x<w;x++){var _=b[x],S=k.get(_);T.bindTexture(3553,S.__webglTexture),z(3553,_,l),F(n.__webglFramebuffer,e,_,36064+x,3553),O(_,l)&&N(3553,_,e.width,e.height)}T.unbindTexture()}else{var M=3553;if(s)if(P)M=t.isDataTexture3D?32879:35866;else console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.");T.bindTexture(M,r.__webglTexture),z(M,t,l),F(n.__webglFramebuffer,e,t,36064,M),O(t,l)&&N(M,t,e.width,e.height,e.depth),T.unbindTexture()}e.depthBuffer&&B(e)},this.updateRenderTargetMipmap=function(e){for(var t=A(e)||P,n=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture],r=0,i=n.length;r<i;r++){var a=n[r];if(O(a,t)){var o=e.isWebGLCubeRenderTarget?34067:3553,s=k.get(a).__webglTexture;T.bindTexture(o,s),N(o,a,e.width,e.height),T.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(P){var t=e.width,n=e.height,r=16384;e.depthBuffer&&(r|=256),e.stencilBuffer&&(r|=1024);var i=k.get(e);T.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),T.bindFramebuffer(36009,i.__webglFramebuffer),E.blitFramebuffer(0,0,t,n,0,0,t,n,r,9728),T.bindFramebuffer(36008,null),T.bindFramebuffer(36009,i.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===g&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),g=!0),e=e.texture),d(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===b&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),b=!0),e=e.texture),h(e,t)}}function tg(e,n,t){var r=t.isWebGL2;return{convert:function(e){var t;if(e===sc)return 5121;if(e===vc)return 32819;if(e===mc)return 32820;if(e===gc)return 33635;if(e===lc)return 5120;if(e===uc)return 5122;if(e===cc)return 5123;if(e===fc)return 5124;if(e===dc)return 5125;if(e===hc)return 5126;if(e===pc)return r?5131:null!==(t=n.get("OES_texture_half_float"))?t.HALF_FLOAT_OES:null;if(e===bc)return 6406;if(e===xc)return 6407;if(e===wc)return 6408;if(e===_c)return 6409;if(e===Sc)return 6410;if(e===Ec)return 6402;if(e===Tc)return 34041;if(e===kc)return 6403;if(e===Lc)return 36244;if(e===Cc)return 33319;if(e===Rc)return 33320;if(e===Pc)return 36248;if(e===Ac)return 36249;if(e===Oc||e===Nc||e===Dc||e===Ic){if(null===(t=n.get("WEBGL_compressed_texture_s3tc")))return null;if(e===Oc)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Nc)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Dc)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Ic)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===zc||e===Fc||e===Uc||e===Bc){if(null===(t=n.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===zc)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Fc)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===Uc)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===Bc)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===Hc)return null!==(t=n.get("WEBGL_compressed_texture_etc1"))?t.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===Gc||e===Vc)&&null!==(t=n.get("WEBGL_compressed_texture_etc"))){if(e===Gc)return t.COMPRESSED_RGB8_ETC2;if(e===Vc)return t.COMPRESSED_RGBA8_ETC2_EAC}return e===Wc||e===jc||e===qc||e===Xc||e===Yc||e===Zc||e===Jc||e===$c||e===Qc||e===Kc||e===ef||e===tf||e===nf||e===rf||e===of||e===sf||e===lf||e===uf||e===cf||e===ff||e===df||e===hf||e===pf||e===vf||e===mf||e===gf||e===yf||e===bf?null!==(t=n.get("WEBGL_compressed_texture_astc"))?e:null:e===af?null!==(t=n.get("EXT_texture_compression_bptc"))?e:null:e===yc?r?34042:null!==(t=n.get("WEBGL_depth_texture"))?t.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}var ng=function(){Rl(r,hp);var n=Ul(r);function r(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return Tl(this,r),(e=n.call(this)).cameras=t,e}return r}();ng.prototype.isArrayCamera=!0;var rg=function(){Rl(n,oh);var t=Ul(n);function n(){var e;return Tl(this,n),(e=t.call(this)).type="Group",e}return n}();rg.prototype.isGroup=!0;var ig={type:"move"},ag=function(){function e(){Tl(this,e),this._targetRay=null,this._grip=null,this._hand=null}return Ll(e,[{key:"getHandSpace",value:function(){return null===this._hand&&(this._hand=new rg,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}},{key:"getTargetRaySpace",value:function(){return null===this._targetRay&&(this._targetRay=new rg,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new id,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new id),this._targetRay}},{key:"getGripSpace",value:function(){return null===this._grip&&(this._grip=new rg,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new id,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new id),this._grip}},{key:"dispatchEvent",value:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}},{key:"disconnect",value:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}},{key:"update",value:function(e,t,n){var r=null,i=null,a=null,o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==o&&null!==(r=t.getPose(e.targetRaySpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(ig)),l&&e.hand){a=!0;var u,c=jl(e.hand.values());try{for(c.s();!(u=c.n()).done;){var f=u.value,d=t.getJointPose(f,n);if(void 0===l.joints[f.jointName]){var h=new rg;h.matrixAutoUpdate=!1,h.visible=!1,l.joints[f.jointName]=h,l.add(h)}var p=l.joints[f.jointName];null!==d&&(p.matrix.fromArray(d.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=d.radius),p.visible=null!==d}}catch(e){c.e(e)}finally{c.f()}var v=l.joints["index-finger-tip"],m=l.joints["thumb-tip"],g=v.position.distanceTo(m.position);l.inputState.pinching&&.025<g?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&g<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1);return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}}]),e}(),og=function(){Rl(r,Nf);var n=Ul(r);function r(e,v){var t;Tl(this,r);var s=zl(t=n.call(this)),m=e.state,g=null,l=1,y=null,u="local-floor",b=null,x=null,w=null,_=null,S=null,M=!1,E=null,c=null,f=null,T=null,k=null,L=null,C=[],d=new Map,h=new hp;h.layers.enable(1),h.viewport=new ed;var p=new hp;p.layers.enable(2),p.viewport=new ed;var R=[h,p],P=new ng;P.layers.enable(1),P.layers.enable(2);var A=null,O=null;function N(e){var t=d.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function D(){d.forEach(function(e,t){e.disconnect(t)}),d.clear(),O=A=null,m.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),w&&v.deleteFramebuffer(w),E&&v.deleteFramebuffer(E),c&&v.deleteRenderbuffer(c),f&&v.deleteRenderbuffer(f),g=x=_=S=f=c=E=w=null,H.stop(),s.isPresenting=!1,s.dispatchEvent({type:"sessionend"})}function I(e){for(var t=g.inputSources,n=0;n<C.length;n++)d.set(t[n],C[n]);for(var r=0;r<e.removed.length;r++){var i=e.removed[r],a=d.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),d.delete(i))}for(var o=0;o<e.added.length;o++){var s=e.added[o],l=d.get(s);l&&l.dispatchEvent({type:"connected",data:s})}}t.cameraAutoUpdate=!0,t.enabled=!1,t.isPresenting=!1,t.getController=function(e){var t=C[e];return void 0===t&&(t=new ag,C[e]=t),t.getTargetRaySpace()},t.getControllerGrip=function(e){var t=C[e];return void 0===t&&(t=new ag,C[e]=t),t.getGripSpace()},t.getHand=function(e){var t=C[e];return void 0===t&&(t=new ag,C[e]=t),t.getHandSpace()},t.setFramebufferScaleFactor=function(e){l=e,!0===s.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},t.setReferenceSpaceType=function(e){u=e,!0===s.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},t.getReferenceSpace=function(){return y},t.getBaseLayer=function(){return null!==_?_:S},t.getBinding=function(){return x},t.getFrame=function(){return T},t.getSession=function(){return g},t.setSession=function(){var t=El(regeneratorRuntime.mark(function e(t){var n,r,i,a,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(g=t)){e.next=22;break}if(g.addEventListener("select",N),g.addEventListener("selectstart",N),g.addEventListener("selectend",N),g.addEventListener("squeeze",N),g.addEventListener("squeezestart",N),g.addEventListener("squeezeend",N),g.addEventListener("end",D),g.addEventListener("inputsourceschange",I),!0!==(n=v.getContextAttributes()).xrCompatible)return e.next=14,v.makeXRCompatible();e.next=14;break;case 14:return void 0===g.renderState.layers?(r={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:l},S=new XRWebGLLayer(g,v,r),g.updateRenderState({baseLayer:S})):v instanceof WebGLRenderingContext?(i={antialias:!0,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:l},S=new XRWebGLLayer(g,v,i),g.updateRenderState({layers:[S]})):(M=n.antialias,a=null,n.depth&&(L=256,n.stencil&&(L|=1024),k=n.stencil?33306:36096,a=n.stencil?35056:33190),o={colorFormat:n.alpha?32856:32849,depthFormat:a,scaleFactor:l},x=new XRWebGLBinding(g,v),_=x.createProjectionLayer(o),w=v.createFramebuffer(),g.updateRenderState({layers:[_]}),M&&(E=v.createFramebuffer(),c=v.createRenderbuffer(),v.bindRenderbuffer(36161,c),v.renderbufferStorageMultisample(36161,4,32856,_.textureWidth,_.textureHeight),m.bindFramebuffer(36160,E),v.framebufferRenderbuffer(36160,36064,36161,c),v.bindRenderbuffer(36161,null),null!==a&&(f=v.createRenderbuffer(),v.bindRenderbuffer(36161,f),v.renderbufferStorageMultisample(36161,4,a,_.textureWidth,_.textureHeight),v.framebufferRenderbuffer(36160,k,36161,f),v.bindRenderbuffer(36161,null)),m.bindFramebuffer(36160,null))),e.next=17,g.requestReferenceSpace(u);case 17:y=e.sent,H.setContext(g),H.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"});case 22:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}();var z=new id,F=new id;function U(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}t.updateCamera=function(e){if(null!==g){P.near=p.near=h.near=e.near,P.far=p.far=h.far=e.far,A===P.near&&O===P.far||(g.updateRenderState({depthNear:P.near,depthFar:P.far}),A=P.near,O=P.far);var t=e.parent,n=P.cameras;U(P,t);for(var r=0;r<n.length;r++)U(n[r],t);P.matrixWorld.decompose(P.position,P.quaternion,P.scale),e.position.copy(P.position),e.quaternion.copy(P.quaternion),e.scale.copy(P.scale),e.matrix.copy(P.matrix),e.matrixWorld.copy(P.matrixWorld);for(var i=e.children,a=0,o=i.length;a<o;a++)i[a].updateMatrixWorld(!0);2===n.length?function(e,t,n){z.setFromMatrixPosition(t.matrixWorld),F.setFromMatrixPosition(n.matrixWorld);var r=z.distanceTo(F),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],f=(a[8]+1)/a[0],d=o*c,h=o*f,p=r/(f-c),v=p*-c;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(v),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();var m=o+p,g=s+p,y=d-v,b=r-v+h,x=l*s/g*m,w=u*s/g*m;e.projectionMatrix.makePerspective(y,b,x,w,m,g)}(P,h,p):P.projectionMatrix.copy(h.projectionMatrix)}},t.getCamera=function(){return P},t.getFoveation=function(){return null!==_?_.fixedFoveation:null!==S?S.fixedFoveation:void 0},t.setFoveation=function(e){null!==_&&(_.fixedFoveation=e),null!==S&&void 0!==S.fixedFoveation&&(S.fixedFoveation=e)};var B=null;var H=new Mp;return H.setAnimationLoop(function(e,t){if(b=t.getViewerPose(y),T=t,null!==b){var n=b.views;null!==S&&m.bindXRFramebuffer(S.framebuffer);var r=!1;n.length!==P.cameras.length&&(r=!(P.cameras.length=0));for(var i=0;i<n.length;i++){var a=n[i],o=null;if(null!==S)o=S.getViewport(a);else{var s=x.getViewSubImage(_,a);m.bindXRFramebuffer(w),void 0!==s.depthStencilTexture&&v.framebufferTexture2D(36160,k,3553,s.depthStencilTexture,0),v.framebufferTexture2D(36160,36064,3553,s.colorTexture,0),o=s.viewport}var l=R[i];l.matrix.fromArray(a.transform.matrix),l.projectionMatrix.fromArray(a.projectionMatrix),l.viewport.set(o.x,o.y,o.width,o.height),0===i&&P.matrix.copy(l.matrix),!0===r&&P.cameras.push(l)}M&&(m.bindXRFramebuffer(E),null!==L&&v.clear(L))}for(var u=g.inputSources,c=0;c<C.length;c++){var f=C[c],d=u[c];f.update(d,t,y)}if(B&&B(e,t),M){var h=_.textureWidth,p=_.textureHeight;m.bindFramebuffer(36008,E),m.bindFramebuffer(36009,w),v.invalidateFramebuffer(36008,[k]),v.invalidateFramebuffer(36009,[k]),v.blitFramebuffer(0,0,h,p,0,0,h,p,16384,9728),v.invalidateFramebuffer(36008,[36064]),m.bindFramebuffer(36008,null),m.bindFramebuffer(36009,null),m.bindFramebuffer(36160,E)}T=null}),t.setAnimationLoop=function(e){B=e},t.dispose=function(){},t}return r}();function sg(o){function a(e,t){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),0<t.alphaTest&&(e.alphaTest.value=t.alphaTest);var n,r,i=o.get(t).envMap;if(i){e.envMap.value=i,e.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,e.reflectivity.value=t.reflectivity,e.ior.value=t.ior,e.refractionRatio.value=t.refractionRatio;var a=o.get(i).__maxMipLevel;void 0!==a&&(e.maxMipLevel.value=a)}t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap?n=t.emissiveMap:t.clearcoatMap?n=t.clearcoatMap:t.clearcoatNormalMap?n=t.clearcoatNormalMap:t.clearcoatRoughnessMap?n=t.clearcoatRoughnessMap:t.specularIntensityMap?n=t.specularIntensityMap:t.specularTintMap?n=t.specularTintMap:t.transmissionMap?n=t.transmissionMap:t.thicknessMap&&(n=t.thicknessMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix)),t.aoMap?r=t.aoMap:t.lightMap&&(r=t.lightMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uv2Transform.value.copy(r.matrix))}function s(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===au&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===au&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),o.get(t).envMap&&(e.envMapIntensity.value=t.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,t,n,r,i){t.isMeshBasicMaterial?a(e,t):t.isMeshLambertMaterial?(a(e,t),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,t)):t.isMeshToonMaterial?(a(e,t),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap);t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===au&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===au&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,t)):t.isMeshPhongMaterial?(a(e,t),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===au&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===au&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,t)):t.isMeshStandardMaterial?(a(e,t),t.isMeshPhysicalMaterial?function(e,t,n){s(e,t),e.ior.value=t.ior,0<t.sheen&&(e.sheenTint.value.copy(t.sheenTint).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness);0<t.clearcoat&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===au&&e.clearcoatNormalScale.value.negate()));0<t.transmission&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationTint.value.copy(t.attenuationTint));e.specularIntensity.value=t.specularIntensity,e.specularTint.value.copy(t.specularTint),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap);t.specularTintMap&&(e.specularTintMap.value=t.specularTintMap)}(e,t,i):s(e,t)):t.isMeshMatcapMaterial?(a(e,t),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===au&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===au&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,t)):t.isMeshDepthMaterial?(a(e,t),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,t)):t.isMeshDistanceMaterial?(a(e,t),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,t)):t.isMeshNormalMaterial?(a(e,t),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===au&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===au&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,t)):t.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,t),t.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,t)):t.isPointsMaterial?function(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);0<t.alphaTest&&(e.alphaTest.value=t.alphaTest);var i;t.map?i=t.map:t.alphaMap&&(i=t.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,t,n,r):t.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);0<t.alphaTest&&(e.alphaTest.value=t.alphaTest);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}}}function lg(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=void 0!==e.canvas?e.canvas:function(){var e=Zf("canvas");return e.style.display="block",e}(),t=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,i=void 0===e.stencil||e.stencil,s=void 0!==e.antialias&&e.antialias,o=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,u=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,y=null,T=null,f=[],d=[];this.domElement=a,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=xf,this.physicallyCorrectLights=!1,this.toneMapping=Bu,this.toneMappingExposure=1;var k=this,h=!1,v=0,m=0,L=null,C=-1,R=null,g=new ed,b=new ed,x=null,p=a.width,P=a.height,A=1,w=null,_=null,S=new ed(0,0,p,P),M=new ed(0,0,p,P),E=!1,O=[],N=new Sp,D=!1,I=!1,z=null,F=new Dd,U=new id,B={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function H(){return null===L?A:1}var G,V,W,j,q,X,Y,Z,J,$,Q,K,ee,te,ne,re,ie,ae,oe,se,le,ue,ce,fe=t;function de(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=a.getContext(r,t);if(null!==i)return i}return null}try{var he={alpha:n,depth:r,stencil:i,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:c};if(a.addEventListener("webglcontextlost",ge,!1),a.addEventListener("webglcontextrestored",ye,!1),null===fe){var pe=["webgl2","webgl","experimental-webgl"];if(!0===k.isWebGL1Renderer&&pe.shift(),null===(fe=de(pe,he)))throw de(pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===fe.getShaderPrecisionFormat&&(fe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ve(){G=new av(fe),V=new Op(fe,G,e),G.init(V),ue=new tg(fe,G,V),W=new Km(fe,G,V),O[0]=1029,j=new lv(fe),q=new zm,X=new eg(fe,G,W,q,V,ue,j),Y=new Dp(k),Z=new iv(k),J=new Ep(fe,V),ce=new Pp(fe,G,J,V),$=new ov(fe,J,j,ce),Q=new pv(fe,$,J,j),oe=new hv(fe,V,X),re=new Np(q),K=new Im(k,Y,Z,G,V,ce,re),ee=new sg(q),te=new Hm(q),ne=new Xm(G,V),ae=new Rp(k,Y,W,Q,o),ie=new Qm(k,Q,V),se=new Ap(fe,G,j,V),le=new sv(fe,G,j,V),j.programs=K.programs,k.capabilities=V,k.extensions=G,k.properties=q,k.renderLists=te,k.shadowMap=ie,k.state=W,k.info=j}ve();var me=new og(k,fe);function ge(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),h=!0}function ye(){console.log("THREE.WebGLRenderer: Context Restored."),h=!1;var e=j.autoReset,t=ie.enabled,n=ie.autoUpdate,r=ie.needsUpdate,i=ie.type;ve(),j.autoReset=e,ie.enabled=t,ie.autoUpdate=n,ie.needsUpdate=r,ie.type=i}function be(e){var t=e.target;t.removeEventListener("dispose",be),function(e){(function(e){var t=q.get(e).programs;void 0!==t&&t.forEach(function(e){K.releaseProgram(e)})})(e),q.remove(e)}(t)}this.xr=me,this.getContext=function(){return fe},this.getContextAttributes=function(){return fe.getContextAttributes()},this.forceContextLoss=function(){var e=G.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=G.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return A},this.setPixelRatio=function(e){void 0!==e&&(A=e,this.setSize(p,P,!1))},this.getSize=function(e){return e.set(p,P)},this.setSize=function(e,t,n){me.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(p=e,P=t,a.width=Math.floor(e*A),a.height=Math.floor(t*A),!1!==n&&(a.style.width=e+"px",a.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(p*A,P*A).floor()},this.setDrawingBufferSize=function(e,t,n){p=e,P=t,A=n,a.width=Math.floor(e*n),a.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(g)},this.getViewport=function(e){return e.copy(S)},this.setViewport=function(e,t,n,r){e.isVector4?S.set(e.x,e.y,e.z,e.w):S.set(e,t,n,r),W.viewport(g.copy(S).multiplyScalar(A).floor())},this.getScissor=function(e){return e.copy(M)},this.setScissor=function(e,t,n,r){e.isVector4?M.set(e.x,e.y,e.z,e.w):M.set(e,t,n,r),W.scissor(b.copy(M).multiplyScalar(A).floor())},this.getScissorTest=function(){return E},this.setScissorTest=function(e){W.setScissorTest(E=e)},this.setOpaqueSort=function(e){w=e},this.setTransparentSort=function(e){_=e},this.getClearColor=function(e){return e.copy(ae.getClearColor())},this.setClearColor=function(){ae.setClearColor.apply(ae,arguments)},this.getClearAlpha=function(){return ae.getClearAlpha()},this.setClearAlpha=function(){ae.setClearAlpha.apply(ae,arguments)},this.clear=function(e,t,n){var r=0;void 0!==e&&!e||(r|=16384),void 0!==t&&!t||(r|=256),void 0!==n&&!n||(r|=1024),fe.clear(r)},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(){a.removeEventListener("webglcontextlost",ge,!1),a.removeEventListener("webglcontextrestored",ye,!1),te.dispose(),ne.dispose(),q.dispose(),Y.dispose(),Z.dispose(),Q.dispose(),ce.dispose(),me.dispose(),me.removeEventListener("sessionstart",we),me.removeEventListener("sessionend",_e),z&&(z.dispose(),z=null),Se.stop()},this.renderBufferImmediate=function(e,t){ce.initAttributes();var n=q.get(e);e.hasPositions&&!n.position&&(n.position=fe.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=fe.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=fe.createBuffer()),e.hasColors&&!n.color&&(n.color=fe.createBuffer());var r=t.getAttributes();e.hasPositions&&(fe.bindBuffer(34962,n.position),fe.bufferData(34962,e.positionArray,35048),ce.enableAttribute(r.position.location),fe.vertexAttribPointer(r.position.location,3,5126,!1,0,0)),e.hasNormals&&(fe.bindBuffer(34962,n.normal),fe.bufferData(34962,e.normalArray,35048),ce.enableAttribute(r.normal.location),fe.vertexAttribPointer(r.normal.location,3,5126,!1,0,0)),e.hasUvs&&(fe.bindBuffer(34962,n.uv),fe.bufferData(34962,e.uvArray,35048),ce.enableAttribute(r.uv.location),fe.vertexAttribPointer(r.uv.location,2,5126,!1,0,0)),e.hasColors&&(fe.bindBuffer(34962,n.color),fe.bufferData(34962,e.colorArray,35048),ce.enableAttribute(r.color.location),fe.vertexAttribPointer(r.color.location,3,5126,!1,0,0)),ce.disableUnusedAttributes(),fe.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=B);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=Ce(e,t,n,r,i);W.setMaterial(r,o);var l=n.index,u=n.attributes.position;if(null===l){if(void 0===u||0===u.count)return}else if(0===l.count)return;var c,f=1;!0===r.wireframe&&(l=$.getWireframeAttribute(n),f=2),ce.setup(i,r,s,n,l);var d=se;null!==l&&(c=J.get(l),(d=le).setIndex(c));var h=null!==l?l.count:u.count,p=n.drawRange.start*f,v=n.drawRange.count*f,m=null!==a?a.start*f:0,g=null!==a?a.count*f:1/0,y=Math.max(p,m),b=Math.min(h,p+v,m+g)-1,x=Math.max(0,b-y+1);if(0!==x){if(i.isMesh)!0===r.wireframe?(W.setLineWidth(r.wireframeLinewidth*H()),d.setMode(1)):d.setMode(4);else if(i.isLine){var w=r.linewidth;void 0===w&&(w=1),W.setLineWidth(w*H()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);if(i.isInstancedMesh)d.renderInstances(y,x,i.count);else if(n.isInstancedBufferGeometry){var _=Math.min(n.instanceCount,n._maxInstanceCount);d.renderInstances(y,x,_)}else d.render(y,x)}},this.compile=function(r,t){(T=ne.get(r)).init(),d.push(T),r.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(T.pushLight(e),e.castShadow&&T.pushShadow(e))}),T.setupLights(k.physicallyCorrectLights),r.traverse(function(e){var t=e.material;if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++){ke(t[n],r,e)}else ke(t,r,e)}),d.pop(),T=null};var xe=null;function we(){Se.stop()}function _e(){Se.start()}var Se=new Mp;function Me(e,t,n,r){var i=e.opaque,a=e.transmissive,o=e.transparent;T.setupLightsView(n),0<a.length&&function(e,t,n){if(null===z){var r=!0===s&&!0===V.isWebGL2;z=new(r?nd:td)(1024,1024,{generateMipmaps:!0,type:null!==ue.convert(pc)?pc:sc,minFilter:oc,magFilter:tc,wrapS:Ku,wrapT:Ku})}var i=k.getRenderTarget();k.setRenderTarget(z),k.clear();var a=k.toneMapping;k.toneMapping=Bu,Ee(e,t,n),k.toneMapping=a,X.updateMultisampleRenderTarget(z),X.updateRenderTargetMipmap(z),k.setRenderTarget(i)}(i,t,n),r&&W.viewport(g.copy(r)),0<i.length&&Ee(i,t,n),0<a.length&&Ee(a,t,n),0<o.length&&Ee(o,t,n)}function Ee(e,t,n){for(var r=!0===t.isScene?t.overrideMaterial:null,i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,l=o.geometry,u=null===r?o.material:r,c=o.group;s.layers.test(n.layers)&&Te(s,t,n,l,u,c)}}function Te(e,t,n,r,i,a){if(e.onBeforeRender(k,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(k,t,n,r,e,a),e.isImmediateRenderObject){var o=Ce(n,t,r,i,e);W.setMaterial(i),ce.reset(),function(e,t){e.render(function(e){k.renderBufferImmediate(e,t)})}(e,o)}else!0===i.transparent&&i.side===ou?(i.side=au,i.needsUpdate=!0,k.renderBufferDirect(n,t,r,i,e,a),i.side=iu,i.needsUpdate=!0,k.renderBufferDirect(n,t,r,i,e,a),i.side=ou):k.renderBufferDirect(n,t,r,i,e,a);e.onAfterRender(k,t,n,r,i,a)}function ke(e,t,n){!0!==t.isScene&&(t=B);var r=q.get(e),i=T.state.lights,a=T.state.shadowsArray,o=i.state.version,s=K.getParameters(e,i.state,a,t,n),l=K.getProgramCacheKey(s),u=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?Z:Y).get(e.envMap||r.environment),void 0===u&&(e.addEventListener("dispose",be),u=new Map,r.programs=u);var c=u.get(l);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===o)return Le(e,s),c}else s.uniforms=K.getUniforms(e),e.onBuild(s,k),e.onBeforeCompile(s,k),c=K.acquireProgram(s,l),u.set(l,c),r.uniforms=s.uniforms;var f=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(f.clippingPlanes=re.uniform),Le(e,s),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var d=c.getUniforms(),h=gm.seqWithValue(d.seq,f);return r.currentProgram=c,r.uniformsList=h,c}function Le(e,t){var n=q.get(e);n.outputEncoding=t.outputEncoding,n.instancing=t.instancing,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents}function Ce(e,t,n,r,i){!0!==t.isScene&&(t=B),X.resetTextureUnits();var a=t.fog,o=r.isMeshStandardMaterial?t.environment:null,s=null===L?k.outputEncoding:L.texture.encoding,l=(r.isMeshStandardMaterial?Z:Y).get(r.envMap||o),u=!0===r.vertexColors&&!!n&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!r.normalMap&&!!n&&!!n.attributes.tangent,f=!!n&&!!n.morphAttributes.position,d=!!n&&!!n.morphAttributes.normal,h=n&&n.morphAttributes.position?n.morphAttributes.position.length:0,p=q.get(r),v=T.state.lights;if(!0===D&&(!0===I||e!==R)){var m=e===R&&r.id===C;re.setState(r,e,m)}var g=!1;r.version===p.__version?p.needsLights&&p.lightsStateVersion!==v.state.version?g=!0:p.outputEncoding!==s?g=!0:i.isInstancedMesh&&!1===p.instancing?g=!0:i.isInstancedMesh||!0!==p.instancing?i.isSkinnedMesh&&!1===p.skinning?g=!0:i.isSkinnedMesh||!0!==p.skinning?p.envMap!==l?g=!0:r.fog&&p.fog!==a?g=!0:void 0===p.numClippingPlanes||p.numClippingPlanes===re.numPlanes&&p.numIntersection===re.numIntersection?p.vertexAlphas!==u?g=!0:p.vertexTangents!==c?g=!0:p.morphTargets!==f?g=!0:p.morphNormals!==d?g=!0:!0===V.isWebGL2&&p.morphTargetsCount!==h&&(g=!0):g=!0:g=!0:g=!0:(g=!0,p.__version=r.version);var y=p.currentProgram;!0===g&&(y=ke(r,t,i));var b=!1,x=!1,w=!1,_=y.getUniforms(),S=p.uniforms;if(W.useProgram(y.program)&&(w=x=b=!0),r.id!==C&&(C=r.id,x=!0),b||R!==e){if(_.setValue(fe,"projectionMatrix",e.projectionMatrix),V.logarithmicDepthBuffer&&_.setValue(fe,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),R!==e&&(R=e,w=x=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){var M=_.map.cameraPosition;void 0!==M&&M.setValue(fe,U.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&_.setValue(fe,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||i.isSkinnedMesh)&&_.setValue(fe,"viewMatrix",e.matrixWorldInverse)}if(i.isSkinnedMesh){_.setOptional(fe,i,"bindMatrix"),_.setOptional(fe,i,"bindMatrixInverse");var E=i.skeleton;E&&(V.floatVertexTextures?(null===E.boneTexture&&E.computeBoneTexture(),_.setValue(fe,"boneTexture",E.boneTexture,X),_.setValue(fe,"boneTextureSize",E.boneTextureSize)):_.setOptional(fe,E,"boneMatrices"))}return!n||void 0===n.morphAttributes.position&&void 0===n.morphAttributes.normal||oe.update(i,n,r,y),!x&&p.receiveShadow===i.receiveShadow||(p.receiveShadow=i.receiveShadow,_.setValue(fe,"receiveShadow",i.receiveShadow)),x&&(_.setValue(fe,"toneMappingExposure",k.toneMappingExposure),p.needsLights&&function(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(S,w),a&&r.fog&&ee.refreshFogUniforms(S,a),ee.refreshMaterialUniforms(S,r,A,P,z),gm.upload(fe,p.uniformsList,S,X)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(gm.upload(fe,p.uniformsList,S,X),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&_.setValue(fe,"center",i.center),_.setValue(fe,"modelViewMatrix",i.modelViewMatrix),_.setValue(fe,"normalMatrix",i.normalMatrix),_.setValue(fe,"modelMatrix",i.matrixWorld),y}Se.setAnimationLoop(function(e){xe&&xe(e)}),"undefined"!=typeof window&&Se.setContext(window),this.setAnimationLoop=function(e){xe=e,me.setAnimationLoop(e),null===e?Se.stop():Se.start()},me.addEventListener("sessionstart",we),me.addEventListener("sessionend",_e),this.render=function(e,t){if(void 0===t||!0===t.isCamera){if(!0!==h){!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===me.enabled&&!0===me.isPresenting&&(!0===me.cameraAutoUpdate&&me.updateCamera(t),t=me.getCamera()),!0===e.isScene&&e.onBeforeRender(k,e,t,L),(T=ne.get(e,d.length)).init(),d.push(T),F.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),N.setFromProjectionMatrix(F),I=this.localClippingEnabled,D=re.init(this.clippingPlanes,I,t),(y=te.get(e,f.length)).init(),f.push(y),function e(t,n,r,i){if(!1===t.visible)return;var a=t.layers.test(n.layers);if(a)if(t.isGroup)r=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(n);else if(t.isLight)T.pushLight(t),t.castShadow&&T.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||N.intersectsSprite(t)){i&&U.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F);var o=Q.update(t),s=t.material;s.visible&&y.push(t,o,s,r,U.z,null)}}else if(t.isImmediateRenderObject)i&&U.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F),y.push(t,null,t.material,r,U.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==j.render.frame&&(t.skeleton.update(),t.skeleton.frame=j.render.frame),!t.frustumCulled||N.intersectsObject(t))){i&&U.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F);var l=Q.update(t),u=t.material;if(Array.isArray(u))for(var c=l.groups,f=0,d=c.length;f<d;f++){var h=c[f],p=u[h.materialIndex];p&&p.visible&&y.push(t,l,p,r,U.z,h)}else u.visible&&y.push(t,l,u,r,U.z,null)}var v=t.children;for(var m=0,g=v.length;m<g;m++)e(v[m],n,r,i)}(e,t,0,k.sortObjects),y.finish(),!0===k.sortObjects&&y.sort(w,_),!0===D&&re.beginShadows();var n=T.state.shadowsArray;if(ie.render(n,e,t),!0===D&&re.endShadows(),!0===this.info.autoReset&&this.info.reset(),ae.render(y,e),T.setupLights(k.physicallyCorrectLights),t.isArrayCamera)for(var r=t.cameras,i=0,a=r.length;i<a;i++){var o=r[i];Me(y,e,o,o.viewport)}else Me(y,e,t);null!==L&&(X.updateMultisampleRenderTarget(L),X.updateRenderTargetMipmap(L)),!0===e.isScene&&e.onAfterRender(k,e,t),W.buffers.depth.setTest(!0),W.buffers.depth.setMask(!0),W.buffers.color.setMask(!0),W.setPolygonOffset(!1),ce.resetDefaultState(),C=-1,R=null,d.pop(),T=0<d.length?d[d.length-1]:null,f.pop(),y=0<f.length?f[f.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return m},this.getRenderTarget=function(){return L},this.setRenderTarget=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;v=t,m=n,(L=e)&&void 0===q.get(e).__webglFramebuffer&&X.setupRenderTarget(e);var r=null,i=!1,a=!1;if(e){var o=e.texture;(o.isDataTexture3D||o.isDataTexture2DArray)&&(a=!0);var s=q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=s[t],i=!0):r=e.isWebGLMultisampleRenderTarget?q.get(e).__webglMultisampledFramebuffer:s,g.copy(e.viewport),b.copy(e.scissor),x=e.scissorTest}else g.copy(S).multiplyScalar(A).floor(),b.copy(M).multiplyScalar(A).floor(),x=E;if(W.bindFramebuffer(36160,r)&&V.drawBuffers){var l=!1;if(e)if(e.isWebGLMultipleRenderTargets){var u=e.texture;if(O.length!==u.length||36064!==O[0]){for(var c=0,f=u.length;c<f;c++)O[c]=36064+c;O.length=u.length,l=!0}}else 1===O.length&&36064===O[0]||(O[0]=36064,O.length=1,l=!0);else 1===O.length&&1029===O[0]||(O[0]=1029,O.length=1,l=!0);l&&(V.isWebGL2?fe.drawBuffers(O):G.get("WEBGL_draw_buffers").drawBuffersWEBGL(O))}if(W.viewport(g),W.scissor(b),W.setScissorTest(x),i){var d=q.get(e.texture);fe.framebufferTexture2D(36160,36064,34069+t,d.__webglTexture,n)}else if(a){var h=q.get(e.texture),p=t||0;fe.framebufferTextureLayer(36160,36064,h.__webglTexture,n||0,p)}C=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(e&&e.isWebGLRenderTarget){var s=q.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){W.bindFramebuffer(36160,s);try{var l=e.texture,u=l.format,c=l.type;if(u!==wc&&ue.convert(u)!==fe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");var f=c===pc&&(G.has("EXT_color_buffer_half_float")||V.isWebGL2&&G.has("EXT_color_buffer_float"));if(!(c===sc||ue.convert(c)===fe.getParameter(35738)||c===hc&&(V.isWebGL2||G.has("OES_texture_float")||G.has("WEBGL_color_buffer_float"))||f))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===fe.checkFramebufferStatus(36160)?0<=t&&t<=e.width-r&&0<=n&&n<=e.height-i&&fe.readPixels(t,n,r,i,ue.convert(u),ue.convert(c),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{var d=null!==L?q.get(L).__webglFramebuffer:null;W.bindFramebuffer(36160,d)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=ue.convert(t.format);V.isWebGL2&&(6407===o&&(o=32849),6408===o&&(o=32856)),X.setTexture2D(t,0),fe.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),W.unbindTexture()},this.copyTextureToTexture=function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,i=t.image.width,a=t.image.height,o=ue.convert(n.format),s=ue.convert(n.type);X.setTexture2D(n,0),fe.pixelStorei(37440,n.flipY),fe.pixelStorei(37441,n.premultiplyAlpha),fe.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?fe.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?fe.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):fe.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),0===r&&n.generateMipmaps&&fe.generateMipmap(3553),W.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0;if(k.isWebGL1Renderer)console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");else{var a,o=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,l=e.max.z-e.min.z+1,u=ue.convert(r.format),c=ue.convert(r.type);if(r.isDataTexture3D)X.setTexture3D(r,0),a=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");X.setTexture2DArray(r,0),a=35866}fe.pixelStorei(37440,r.flipY),fe.pixelStorei(37441,r.premultiplyAlpha),fe.pixelStorei(3317,r.unpackAlignment);var f=fe.getParameter(3314),d=fe.getParameter(32878),h=fe.getParameter(3316),p=fe.getParameter(3315),v=fe.getParameter(32877),m=n.isCompressedTexture?n.mipmaps[0]:n.image;fe.pixelStorei(3314,m.width),fe.pixelStorei(32878,m.height),fe.pixelStorei(3316,e.min.x),fe.pixelStorei(3315,e.min.y),fe.pixelStorei(32877,e.min.z),n.isDataTexture||n.isDataTexture3D?fe.texSubImage3D(a,i,t.x,t.y,t.z,o,s,l,u,c,m.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),fe.compressedTexSubImage3D(a,i,t.x,t.y,t.z,o,s,l,u,m.data)):fe.texSubImage3D(a,i,t.x,t.y,t.z,o,s,l,u,c,m),fe.pixelStorei(3314,f),fe.pixelStorei(32878,d),fe.pixelStorei(3316,h),fe.pixelStorei(3315,p),fe.pixelStorei(32877,v),0===i&&r.generateMipmaps&&fe.generateMipmap(a),W.unbindTexture()}},this.initTexture=function(e){X.setTexture2D(e,0),W.unbindTexture()},this.resetState=function(){m=v=0,L=null,W.reset(),ce.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var ug=function(){function r(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1e3;Tl(this,r),this.name="",this.color=new Th(e),this.near=t,this.far=n}return Ll(r,[{key:"clone",value:function(){return new r(this.color,this.near,this.far)}},{key:"toJSON",value:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}]),r}();ug.prototype.isFog=!0;var cg=function(){Rl(n,oh);var t=Ul(n);function n(){var e;return Tl(this,n),(e=t.call(this)).type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:zl(e)})),e}return Ll(n,[{key:"copy",value:function(e,t){return Bl(Pl(n.prototype),"copy",this).call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var t=Bl(Pl(n.prototype),"toJSON",this).call(this,e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}]),n}();cg.prototype.isScene=!0;var fg=function(){function n(e,t){Tl(this,n),this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Pf,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Bf()}return Ll(n,[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}},{key:"set",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:0;return this.array.set(e,n),this}},{key:"clone",value:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Bf()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"toJSON",value:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Bf()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(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}}}]),n}();fg.prototype.isInterleavedBuffer=!0,function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="SpriteMaterial",t.color=new Th(16777215),t.map=null,t.alphaMap=null,t.rotation=0,t.sizeAttenuation=!0,t.transparent=!0,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}]),r}().prototype.isSpriteMaterial=!0;var dg=function(){Rl(p,Qf);var h=Ul(p);function p(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length?arguments[3]:void 0,a=4<arguments.length?arguments[4]:void 0,o=5<arguments.length?arguments[5]:void 0,s=6<arguments.length?arguments[6]:void 0,l=7<arguments.length?arguments[7]:void 0,u=8<arguments.length&&void 0!==arguments[8]?arguments[8]:tc,c=9<arguments.length&&void 0!==arguments[9]?arguments[9]:tc,f=10<arguments.length?arguments[10]:void 0,d=11<arguments.length?arguments[11]:void 0;return Tl(this,p),(e=h.call(this,null,o,s,l,u,c,i,a,f,d)).image={data:t,width:n,height:r},e.magFilter=u,e.minFilter=c,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return p}();dg.prototype.isDataTexture=!0;var hg=function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="LineBasicMaterial",t.color=new Th(16777215),t.linewidth=1,t.linecap="round",t.linejoin="round",t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}]),r}();hg.prototype.isLineBasicMaterial=!0;var pg=new id,vg=new id,mg=new Dd,gg=new Nd,yg=new Td,bg=function(){Rl(i,oh);var r=Ul(i);function i(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Hh,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new hg;return Tl(this,i),(e=r.call(this)).type="Line",e.geometry=t,e.material=n,e.updateMorphTargets(),e}return Ll(i,[{key:"copy",value:function(e){return Bl(Pl(i.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)pg.fromBufferAttribute(t,r-1),vg.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=pg.distanceTo(vg);e.setAttribute("lineDistance",new Oh(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}},{key:"raycast",value:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),yg.copy(n.boundingSphere),yg.applyMatrix4(r),yg.radius+=i,!1!==e.ray.intersectsSphere(yg)){mg.copy(r).invert(),gg.copy(e.ray).applyMatrix4(mg);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=new id,u=new id,c=new id,f=new id,d=this.isLineSegments?2:1;if(n.isBufferGeometry){var h=n.index,p=n.attributes.position;if(null!==h)for(var v=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count)-1;v<m;v+=d){var g=h.getX(v),y=h.getX(v+1);if(l.fromBufferAttribute(p,g),u.fromBufferAttribute(p,y),!(s<gg.distanceSqToSegment(l,u,f,c))){f.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(f);b<e.near||b>e.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(var x=Math.max(0,a.start),w=Math.min(p.count,a.start+a.count)-1;x<w;x+=d){if(l.fromBufferAttribute(p,x),u.fromBufferAttribute(p,x+1),!(s<gg.distanceSqToSegment(l,u,f,c))){f.applyMatrix4(this.matrixWorld);var _=e.ray.origin.distanceTo(f);_<e.near||_>e.far||t.push({distance:_,point:c.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(0<n.length){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=r.length;i<a;i++){var o=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}else{var s=e.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),i}();bg.prototype.isLine=!0;var xg=new id,wg=new id;(function(){Rl(i,bg);var r=Ul(i);function i(e,t){var n;return Tl(this,i),(n=r.call(this,e,t)).type="LineSegments",n}return Ll(i,[{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)xg.fromBufferAttribute(t,r),wg.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+xg.distanceTo(wg);e.setAttribute("lineDistance",new Oh(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}}]),i})().prototype.isLineSegments=!0,function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="PointsMaterial",t.color=new Th(16777215),t.map=null,t.alphaMap=null,t.size=1,t.sizeAttenuation=!0,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}]),r}().prototype.isPointsMaterial=!0;var _g=function(){Rl(i,Hh);var r=Ul(i);function i(){var e,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,x=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,w=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,_=3<arguments.length&&void 0!==arguments[3]?arguments[3]:8,S=4<arguments.length&&void 0!==arguments[4]?arguments[4]:1,t=5<arguments.length&&void 0!==arguments[5]&&arguments[5],M=6<arguments.length&&void 0!==arguments[6]?arguments[6]:0,E=7<arguments.length&&void 0!==arguments[7]?arguments[7]:2*Math.PI;Tl(this,i),(e=r.call(this)).type="CylinderGeometry",e.parameters={radiusTop:b,radiusBottom:x,height:w,radialSegments:_,heightSegments:S,openEnded:t,thetaStart:M,thetaLength:E};var T=zl(e);_=Math.floor(_),S=Math.floor(S);var k=[],L=[],C=[],R=[],P=0,A=[],O=w/2,N=0;function n(e){for(var t=P,n=new jf,r=new id,i=0,a=!0===e?b:x,o=!0===e?1:-1,s=1;s<=_;s++)L.push(0,O*o,0),C.push(0,o,0),R.push(.5,.5),P++;for(var l=P,u=0;u<=_;u++){var c=u/_*E+M,f=Math.cos(c),d=Math.sin(c);r.x=a*d,r.y=O*o,r.z=a*f,L.push(r.x,r.y,r.z),C.push(0,o,0),n.x=.5*f+.5,n.y=.5*d*o+.5,R.push(n.x,n.y),P++}for(var h=0;h<_;h++){var p=t+h,v=l+h;!0===e?k.push(v,v+1,p):k.push(v+1,v,p),i+=3}T.addGroup(N,i,!0===e?1:2),N+=i}return function(){for(var e=new id,t=new id,n=0,r=(x-b)/w,i=0;i<=S;i++){for(var a=[],o=i/S,s=o*(x-b)+b,l=0;l<=_;l++){var u=l/_,c=u*E+M,f=Math.sin(c),d=Math.cos(c);t.x=s*f,t.y=-o*w+O,t.z=s*d,L.push(t.x,t.y,t.z),e.set(f,r,d).normalize(),C.push(e.x,e.y,e.z),R.push(u,1-o),a.push(P++)}A.push(a)}for(var h=0;h<_;h++)for(var p=0;p<S;p++){var v=A[p][h],m=A[p+1][h],g=A[p+1][h+1],y=A[p][h+1];k.push(v,m,y),k.push(m,g,y),n+=6}T.addGroup(N,n,0),N+=n}(),!1===t&&(0<b&&n(!0),0<x&&n(!1)),e.setIndex(k),e.setAttribute("position",new Oh(L,3)),e.setAttribute("normal",new Oh(C,3)),e.setAttribute("uv",new Oh(R,2)),e}return Ll(i,null,[{key:"fromJSON",value:function(e){return new i(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}]),i}();new id,new id,new id,new gh;var Sg=function(){function e(){Tl(this,e),this.type="Curve",this.arcLengthDivisions=200}return Ll(e,[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)}},{key:"getPoints",value:function(e){for(var t=0<arguments.length&&void 0!==e?e:5,n=[],r=0;r<=t;r++)n.push(this.getPoint(r/t));return n}},{key:"getSpacedPoints",value:function(e){for(var t=0<arguments.length&&void 0!==e?e:5,n=[],r=0;r<=t;r++)n.push(this.getPointAt(r/t));return n}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(e){var t=0<arguments.length&&void 0!==e?e:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,r=[],i=this.getPoint(0),a=0;r.push(0);for(var o=1;o<=t;o++)a+=(n=this.getPoint(o/t)).distanceTo(i),r.push(a),i=n;return this.cacheArcLengths=r}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(0<o)){l=i;break}l=i-1}if(r[i=l]===n)return i/(a-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(a-1)}},{key:"getTangent",value:function(e,t){var n=e-1e-4,r=e+1e-4;n<0&&(n=0),1<r&&(r=1);var i=this.getPoint(n),a=this.getPoint(r),o=t||(i.isVector2?new jf:new id);return o.copy(a).sub(i).normalize(),o}},{key:"getTangentAt",value:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)}},{key:"computeFrenetFrames",value:function(e,t){for(var n=new id,r=[],i=[],a=[],o=new id,s=new Dd,l=0;l<=e;l++){var u=l/e;r[l]=this.getTangentAt(u,new id)}i[0]=new id,a[0]=new id;var c=Number.MAX_VALUE,f=Math.abs(r[0].x),d=Math.abs(r[0].y),h=Math.abs(r[0].z);f<=c&&(c=f,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),h<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(var p=1;p<=e;p++){if(i[p]=i[p-1].clone(),a[p]=a[p-1].clone(),o.crossVectors(r[p-1],r[p]),o.length()>Number.EPSILON){o.normalize();var v=Math.acos(Hf(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(o,v))}a[p].crossVectors(r[p],i[p])}if(!0===t){var m=Math.acos(Hf(i[0].dot(i[e]),-1,1));m/=e,0<r[0].dot(o.crossVectors(i[0],i[e]))&&(m=-m);for(var g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],m*g)),a[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:a}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}]),e}(),Mg=function(){Rl(c,Sg);var u=Ul(c);function c(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:2*Math.PI,s=6<arguments.length&&void 0!==arguments[6]&&arguments[6],l=7<arguments.length&&void 0!==arguments[7]?arguments[7]:0;return Tl(this,c),(e=u.call(this)).type="EllipseCurve",e.aX=t,e.aY=n,e.xRadius=r,e.yRadius=i,e.aStartAngle=a,e.aEndAngle=o,e.aClockwise=s,e.aRotation=l,e}return Ll(c,[{key:"getPoint",value:function(e,t){for(var n=t||new jf,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;r<i;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var u=Math.cos(this.aRotation),c=Math.sin(this.aRotation),f=s-this.aX,d=l-this.aY;s=f*u-d*c+this.aX,l=f*c+d*u+this.aY}return n.set(s,l)}},{key:"copy",value:function(e){return Bl(Pl(c.prototype),"copy",this).call(this,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}},{key:"toJSON",value:function(){var e=Bl(Pl(c.prototype),"toJSON",this).call(this);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}},{key:"fromJSON",value:function(e){return Bl(Pl(c.prototype),"fromJSON",this).call(this,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}}]),c}();Mg.prototype.isEllipseCurve=!0;var Eg=function(){Rl(l,Mg);var s=Ul(l);function l(e,t,n,r,i,a){var o;return Tl(this,l),(o=s.call(this,e,t,n,n,r,i,a)).type="ArcCurve",o}return l}();function Tg(){var i=0,a=0,o=0,s=0;function u(e,t,n,r){o=-3*(i=e)+3*t-2*(a=n)-r,s=2*e-2*t+n+r}return{initCatmullRom:function(e,t,n,r,i){u(t,n,i*(n-e),i*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,i,a,o){var s=(t-e)/i-(n-e)/(i+a)+(n-t)/a,l=(n-t)/a-(r-t)/(a+o)+(r-n)/o;u(t,n,s*=a,l*=a)},calc:function(e){var t=e*e;return i+a*e+o*t+s*(t*e)}}}Eg.prototype.isArcCurve=!0;var kg=new id,Lg=new Tg,Cg=new Tg,Rg=new Tg,Pg=function(){Rl(o,Sg);var a=Ul(o);function o(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"centripetal",i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:.5;return Tl(this,o),(e=a.call(this)).type="CatmullRomCurve3",e.points=t,e.closed=n,e.curveType=r,e.tension=i,e}return Ll(o,[{key:"getPoint",value:function(e,t){var n,r,i=1<arguments.length&&void 0!==t?t:new id,a=this.points,o=a.length,s=(o-(this.closed?0:1))*e,l=Math.floor(s),u=s-l;this.closed?l+=0<l?0:(Math.floor(Math.abs(l)/o)+1)*o:0===u&&l===o-1&&(l=o-2,u=1),n=this.closed||0<l?a[(l-1)%o]:(kg.subVectors(a[0],a[1]).add(a[0]),kg);var c=a[l%o],f=a[(l+1)%o];if(r=this.closed||l+2<o?a[(l+2)%o]:(kg.subVectors(a[o-1],a[o-2]).add(a[o-1]),kg),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,h=Math.pow(n.distanceToSquared(c),d),p=Math.pow(c.distanceToSquared(f),d),v=Math.pow(f.distanceToSquared(r),d);p<1e-4&&(p=1),h<1e-4&&(h=p),v<1e-4&&(v=p),Lg.initNonuniformCatmullRom(n.x,c.x,f.x,r.x,h,p,v),Cg.initNonuniformCatmullRom(n.y,c.y,f.y,r.y,h,p,v),Rg.initNonuniformCatmullRom(n.z,c.z,f.z,r.z,h,p,v)}else"catmullrom"===this.curveType&&(Lg.initCatmullRom(n.x,c.x,f.x,r.x,this.tension),Cg.initCatmullRom(n.y,c.y,f.y,r.y,this.tension),Rg.initCatmullRom(n.z,c.z,f.z,r.z,this.tension));return i.set(Lg.calc(u),Cg.calc(u),Rg.calc(u)),i}},{key:"copy",value:function(e){Bl(Pl(o.prototype),"copy",this).call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},{key:"toJSON",value:function(){var e=Bl(Pl(o.prototype),"toJSON",this).call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}},{key:"fromJSON",value:function(e){Bl(Pl(o.prototype),"fromJSON",this).call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new id).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}]),o}();function Ag(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function Og(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Ng(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}Pg.prototype.isCatmullRomCurve3=!0;var Dg=function(){Rl(o,Sg);var a=Ul(o);function o(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new jf,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new jf,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new jf,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:new jf;return Tl(this,o),(e=a.call(this)).type="CubicBezierCurve",e.v0=t,e.v1=n,e.v2=r,e.v3=i,e}return Ll(o,[{key:"getPoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:new jf,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Ng(e,r.x,i.x,a.x,o.x),Ng(e,r.y,i.y,a.y,o.y)),n}},{key:"copy",value:function(e){return Bl(Pl(o.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=Bl(Pl(o.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return Bl(Pl(o.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),o}();Dg.prototype.isCubicBezierCurve=!0;var Ig=function(){Rl(o,Sg);var a=Ul(o);function o(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new id,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new id,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new id,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:new id;return Tl(this,o),(e=a.call(this)).type="CubicBezierCurve3",e.v0=t,e.v1=n,e.v2=r,e.v3=i,e}return Ll(o,[{key:"getPoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:new id,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Ng(e,r.x,i.x,a.x,o.x),Ng(e,r.y,i.y,a.y,o.y),Ng(e,r.z,i.z,a.z,o.z)),n}},{key:"copy",value:function(e){return Bl(Pl(o.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=Bl(Pl(o.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return Bl(Pl(o.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),o}();Ig.prototype.isCubicBezierCurve3=!0;var zg=function(){Rl(i,Sg);var r=Ul(i);function i(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new jf,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new jf;return Tl(this,i),(e=r.call(this)).type="LineCurve",e.v1=t,e.v2=n,e}return Ll(i,[{key:"getPoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:new jf;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e,t){var n=t||new jf;return n.copy(this.v2).sub(this.v1).normalize(),n}},{key:"copy",value:function(e){return Bl(Pl(i.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Bl(Pl(i.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Bl(Pl(i.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),i}();zg.prototype.isLineCurve=!0;var Fg=function(){Rl(i,Sg);var r=Ul(i);function i(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new id,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new id;return Tl(this,i),(e=r.call(this)).type="LineCurve3",e.isLineCurve3=!0,e.v1=t,e.v2=n,e}return Ll(i,[{key:"getPoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:new id;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"copy",value:function(e){return Bl(Pl(i.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Bl(Pl(i.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Bl(Pl(i.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),i}(),Ug=function(){Rl(a,Sg);var i=Ul(a);function a(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new jf,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new jf,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new jf;return Tl(this,a),(e=i.call(this)).type="QuadraticBezierCurve",e.v0=t,e.v1=n,e.v2=r,e}return Ll(a,[{key:"getPoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:new jf,r=this.v0,i=this.v1,a=this.v2;return n.set(Og(e,r.x,i.x,a.x),Og(e,r.y,i.y,a.y)),n}},{key:"copy",value:function(e){return Bl(Pl(a.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Bl(Pl(a.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Bl(Pl(a.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),a}();Ug.prototype.isQuadraticBezierCurve=!0;var Bg=function(){Rl(a,Sg);var i=Ul(a);function a(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new id,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new id,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new id;return Tl(this,a),(e=i.call(this)).type="QuadraticBezierCurve3",e.v0=t,e.v1=n,e.v2=r,e}return Ll(a,[{key:"getPoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:new id,r=this.v0,i=this.v1,a=this.v2;return n.set(Og(e,r.x,i.x,a.x),Og(e,r.y,i.y,a.y),Og(e,r.z,i.z,a.z)),n}},{key:"copy",value:function(e){return Bl(Pl(a.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Bl(Pl(a.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Bl(Pl(a.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),a}();Bg.prototype.isQuadraticBezierCurve3=!0;var Hg=function(){Rl(i,Sg);var n=Ul(i);function i(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return Tl(this,i),(e=n.call(this)).type="SplineCurve",e.points=t,e}return Ll(i,[{key:"getPoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:new jf,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],l=r[a],u=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(Ag(o,s.x,l.x,u.x,c.x),Ag(o,s.y,l.y,u.y,c.y)),n}},{key:"copy",value:function(e){Bl(Pl(i.prototype),"copy",this).call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this}},{key:"toJSON",value:function(){var e=Bl(Pl(i.prototype),"toJSON",this).call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e}},{key:"fromJSON",value:function(e){Bl(Pl(i.prototype),"fromJSON",this).call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new jf).fromArray(r))}return this}}]),i}();Hg.prototype.isSplineCurve=!0;var Gg=Object.freeze({__proto__:null,ArcCurve:Eg,CatmullRomCurve3:Pg,CubicBezierCurve:Dg,CubicBezierCurve3:Ig,EllipseCurve:Mg,LineCurve:zg,LineCurve3:Fg,QuadraticBezierCurve:Ug,QuadraticBezierCurve3:Bg,SplineCurve:Hg}),Vg=function(){Rl(i,Sg);var t=Ul(i);function i(){var e;return Tl(this,i),(e=t.call(this)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return Ll(i,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new zg(t,e))}},{key:"getPoint",value:function(e,t){for(var n=e*this.getLength(),r=this.getCurveLengths(),i=0;i<r.length;){if(r[i]>=n){var a=r[i]-n,o=this.curves[i],s=o.getLength(),l=0===s?0:1-a/s;return o.getPointAt(l,t)}i++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e}},{key:"getSpacedPoints",value:function(e){for(var t=0<arguments.length&&void 0!==e?e:40,n=[],r=0;r<=t;r++)n.push(this.getPoint(r/t));return this.autoClose&&n.push(n[0]),n}},{key:"getPoints",value:function(e){for(var t,n=0<arguments.length&&void 0!==e?e:12,r=[],i=0,a=this.curves;i<a.length;i++)for(var o=a[i],s=o&&o.isEllipseCurve?2*n:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?n*o.points.length:n,l=o.getPoints(s),u=0;u<l.length;u++){var c=l[u];t&&t.equals(c)||(r.push(c),t=c)}return this.autoClose&&1<r.length&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r}},{key:"copy",value:function(e){Bl(Pl(i.prototype),"copy",this).call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}},{key:"toJSON",value:function(){var e=Bl(Pl(i.prototype),"toJSON",this).call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e}},{key:"fromJSON",value:function(e){Bl(Pl(i.prototype),"fromJSON",this).call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Gg[r.type]).fromJSON(r))}return this}}]),i}(),Wg=function(){Rl(r,Vg);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="Path",t.currentPoint=new jf,e&&t.setFromPoints(e),t}return Ll(r,[{key:"setFromPoints",value:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}},{key:"moveTo",value:function(e,t){return this.currentPoint.set(e,t),this}},{key:"lineTo",value:function(e,t){var n=new zg(this.currentPoint.clone(),new jf(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}},{key:"quadraticCurveTo",value:function(e,t,n,r){var i=new Ug(this.currentPoint.clone(),new jf(e,t),new jf(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}},{key:"bezierCurveTo",value:function(e,t,n,r,i,a){var o=new Dg(this.currentPoint.clone(),new jf(e,t),new jf(n,r),new jf(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}},{key:"splineThru",value:function(e){var t=[this.currentPoint.clone()].concat(e),n=new Hg(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}},{key:"arc",value:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this}},{key:"absarc",value:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this}},{key:"ellipse",value:function(e,t,n,r,i,a,o,s){var l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,n,r,i,a,o,s),this}},{key:"absellipse",value:function(e,t,n,r,i,a,o,s){var l=new Mg(e,t,n,r,i,a,o,s);if(0<this.curves.length){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var c=l.getPoint(1);return this.currentPoint.copy(c),this}},{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,e),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=Bl(Pl(r.prototype),"toJSON",this).call(this);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return Bl(Pl(r.prototype),"fromJSON",this).call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}]),r}(),jg=function(){Rl(i,Wg);var n=Ul(i);function i(e){var t;return Tl(this,i),(t=n.call(this,e)).uuid=Bf(),t.type="Shape",t.holes=[],t}return Ll(i,[{key:"getPointsHoles",value:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}},{key:"extractPoints",value:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}},{key:"copy",value:function(e){Bl(Pl(i.prototype),"copy",this).call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this}},{key:"toJSON",value:function(){var e=Bl(Pl(i.prototype),"toJSON",this).call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e}},{key:"fromJSON",value:function(e){Bl(Pl(i.prototype),"fromJSON",this).call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Wg).fromJSON(r))}return this}}]),i}(),qg=function(e,t,n){var r,i,a,o,s,l,u,c=2<arguments.length&&void 0!==n?n:2,f=t&&t.length,d=f?t[0]*c:e.length,h=Xg(e,0,d,c,!0),p=[];if(!h||h.next===h.prev)return p;if(f&&(h=function(e,t,n,r){var i,a,o,s,l,u=[];for(i=0,a=t.length;i<a;i++)o=t[i]*r,s=i<a-1?t[i+1]*r:e.length,(l=Xg(e,o,s,r,!1))===l.next&&(l.steiner=!0),u.push(ry(l));for(u.sort(ey),i=0;i<u.length;i++)ty(u[i],n),n=Yg(n,n.next);return n}(e,t,h,c)),e.length>80*c){r=a=e[0],i=o=e[1];for(var v=c;v<d;v+=c)(s=e[v])<r&&(r=s),(l=e[v+1])<i&&(i=l),a<s&&(a=s),o<l&&(o=l);u=0!==(u=Math.max(a-r,o-i))?1/u:0}return Zg(h,p,c,r,i,u),p};function Xg(e,t,n,r,i){var a,o;if(i===0<function(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r))for(a=t;a<n;a+=r)o=dy(a,e[a],e[a+1],o);else for(a=n-r;t<=a;a-=r)o=dy(a,e[a],e[a+1],o);return o&&oy(o,o.next)&&(hy(o),o=o.next),o}function Yg(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!oy(r,r.next)&&0!==ay(r.prev,r,r.next))r=r.next;else{if(hy(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Zg(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;for(;null===i.z&&(i.z=ny(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==e;);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,l,u=1;do{for(n=e,a=e=null,o=0;n;){for(o++,r=n,t=s=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;0<s||0<l&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(n=(i=n).nextZ,s--):(r=(i=r).nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(1<o)}(i)}(e,r,i,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?$g(e,r,i,a):Jg(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),hy(e),e=l.next,u=l.next;else if((e=l)===u){o?1===o?Zg(e=Qg(Yg(e),t,n),t,n,r,i,a,2):2===o&&Kg(e,t,n,r,i,a):Zg(Yg(e),t,n,r,i,a,1);break}}}function Jg(e){var t=e.prev,n=e,r=e.next;if(0<=ay(t,n,r))return!1;for(var i=e.next.next;i!==e.prev;){if(iy(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=ay(i.prev,i,i.next))return!1;i=i.next}return!0}function $g(e,t,n,r){var i=e.prev,a=e,o=e.next;if(0<=ay(i,a,o))return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=ny(s,l,t,n,r),d=ny(u,c,t,n,r),h=e.prevZ,p=e.nextZ;h&&h.z>=f&&p&&p.z<=d;){if(h!==e.prev&&h!==e.next&&iy(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&0<=ay(h.prev,h,h.next))return!1;if(h=h.prevZ,p!==e.prev&&p!==e.next&&iy(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=ay(p.prev,p,p.next))return!1;p=p.nextZ}for(;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&iy(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&0<=ay(h.prev,h,h.next))return!1;h=h.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&iy(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=ay(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function Qg(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!oy(i,a)&&sy(i,r,r.next,a)&&cy(i,a)&&cy(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),hy(r),hy(r.next),r=e=a),r=r.next}while(r!==e);return Yg(r)}function Kg(e,t,n,r,i,a){var o,s,l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&(s=u,(o=l).next.i!==s.i&&o.prev.i!==s.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&sy(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(o,s)&&(cy(o,s)&&cy(s,o)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;for(;n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(o,s)&&(ay(o.prev,o,s.prev)||ay(o,s.prev,s))||oy(o,s)&&0<ay(o.prev,o,o.next)&&0<ay(s.prev,s,s.next)))){var c=fy(l,u);return l=Yg(l,l.next),c=Yg(c,c.next),Zg(l,t,n,r,i,a),void Zg(c,t,n,r,i,a)}u=u.next}l=l.next}while(l!==e)}function ey(e,t){return e.x-t.x}function ty(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&o<s){if((o=s)===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n;var l,u=n,c=n.x,f=n.y,d=1/0;r=n;for(;i>=r.x&&r.x>=c&&i!==r.x&&iy(a<f?i:o,a,c,f,a<f?o:i,a,r.x,r.y)&&(l=Math.abs(a-r.y)/(i-r.x),cy(r,e)&&(l<d||l===d&&(r.x>n.x||r.x===n.x&&(p=r,ay((h=n).prev,h,p.prev)<0&&ay(p.next,h,h.next)<0)))&&(n=r,d=l)),r=r.next,r!==u;);var h,p;return n}(e,t)){var n=fy(t,e);Yg(t,t.next),Yg(n,n.next)}}function ny(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ry(e){for(var t=e,n=e;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),(t=t.next)!==e;);return n}function iy(e,t,n,r,i,a,o,s){return 0<=(i-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(r-s)-(n-o)*(t-s)&&0<=(n-o)*(a-s)-(i-o)*(r-s)}function ay(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function oy(e,t){return e.x===t.x&&e.y===t.y}function sy(e,t,n,r){var i=uy(ay(e,t,n)),a=uy(ay(e,t,r)),o=uy(ay(n,r,e)),s=uy(ay(n,r,t));return i!==a&&o!==s||(!(0!==i||!ly(e,n,t))||(!(0!==a||!ly(e,r,t))||(!(0!==o||!ly(n,e,r))||!(0!==s||!ly(n,t,r)))))}function ly(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function uy(e){return 0<e?1:e<0?-1:0}function cy(e,t){return ay(e.prev,e,e.next)<0?0<=ay(e,t,e.next)&&0<=ay(e,e.prev,t):ay(e,t,e.prev)<0||ay(e,e.next,t)<0}function fy(e,t){var n=new py(e.i,e.x,e.y),r=new py(t.i,t.x,t.y),i=e.next,a=t.prev;return(e.next=t).prev=e,(n.next=i).prev=n,(r.next=n).prev=r,(a.next=r).prev=a,r}function dy(e,t,n,r){var i=new py(e,t,n);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function hy(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function py(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var vy=function(){function t(){Tl(this,t)}return Ll(t,null,[{key:"area",value:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}},{key:"isClockWise",value:function(e){return t.area(e)<0}},{key:"triangulateShape",value:function(e,t){var n=[],r=[],i=[];my(e),gy(n,e);var a=e.length;t.forEach(my);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,gy(n,t[o]);for(var s=qg(n,r),l=0;l<s.length;l+=3)i.push(s.slice(l,l+3));return i}}]),t}();function my(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function gy(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}var yy=function(){Rl(s,Hh);var a=Ul(s);function s(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new jg([new jf(.5,.5),new jf(-.5,.5),new jf(-.5,-.5),new jf(.5,-.5)]),Ae=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};Tl(this,s),(e=a.call(this)).type="ExtrudeGeometry",e.parameters={shapes:t,options:Ae},t=Array.isArray(t)?t:[t];for(var Oe=zl(e),Ne=[],De=[],n=0,r=t.length;n<r;n++){i(t[n])}function i(e){var r=[],t=void 0!==Ae.curveSegments?Ae.curveSegments:12,f=void 0!==Ae.steps?Ae.steps:1,n=void 0!==Ae.depth?Ae.depth:1,d=void 0===Ae.bevelEnabled||Ae.bevelEnabled,i=void 0!==Ae.bevelThickness?Ae.bevelThickness:.2,a=void 0!==Ae.bevelSize?Ae.bevelSize:i-.1,o=void 0!==Ae.bevelOffset?Ae.bevelOffset:0,h=void 0!==Ae.bevelSegments?Ae.bevelSegments:3,s=Ae.extrudePath,l=void 0!==Ae.UVGenerator?Ae.UVGenerator:by;void 0!==Ae.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),n=Ae.amount);var u,c,p,v,m,g=!1;s&&(u=s.getSpacedPoints(f),d=!(g=!0),c=s.computeFrenetFrames(f,!1),p=new id,v=new id,m=new id),d||(o=a=i=h=0);var y=e.extractPoints(t),b=y.shape,x=y.holes;if(!vy.isClockWise(b)){b=b.reverse();for(var w=0,_=x.length;w<_;w++){var S=x[w];vy.isClockWise(S)&&(x[w]=S.reverse())}}for(var M=vy.triangulateShape(b,x),E=b,T=0,k=x.length;T<k;T++){var L=x[T];b=b.concat(L)}function C(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var R=b.length,P=M.length;function A(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,u=n.y-e.y,c=o*o+s*s,f=o*u-s*l;if(Math.abs(f)>Number.EPSILON){var d=Math.sqrt(c),h=Math.sqrt(l*l+u*u),p=t.x-s/d,v=t.y+o/d,m=((n.x-u/h-p)*u-(n.y+l/h-v)*l)/(o*u-s*l),g=(r=p+o*m-e.x)*r+(i=v+s*m-e.y)*i;if(g<=2)return new jf(r,i);a=Math.sqrt(g/2)}else{var y=!1;o>Number.EPSILON?l>Number.EPSILON&&(y=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),a=y?(r=-s,i=o,Math.sqrt(c)):(r=o,i=s,Math.sqrt(c/2))}return new jf(r/a,i/a)}for(var O=[],N=0,D=E.length,I=D-1,z=N+1;N<D;N++,I++,z++)I===D&&(I=0),z===D&&(z=0),O[N]=A(E[N],E[I],E[z]);for(var F,U=[],B=O.concat(),H=0,G=x.length;H<G;H++){var V=x[H];F=[];for(var W=0,j=V.length,q=j-1,X=W+1;W<j;W++,q++,X++)q===j&&(q=0),X===j&&(X=0),F[W]=A(V[W],V[q],V[X]);U.push(F),B=B.concat(F)}for(var Y=0;Y<h;Y++){for(var Z=Y/h,J=i*Math.cos(Z*Math.PI/2),$=a*Math.sin(Z*Math.PI/2)+o,Q=0,K=E.length;Q<K;Q++){var ee=C(E[Q],O[Q],$);ke(ee.x,ee.y,-J)}for(var te=0,ne=x.length;te<ne;te++){var re=x[te];F=U[te];for(var ie=0,ae=re.length;ie<ae;ie++){var oe=C(re[ie],F[ie],$);ke(oe.x,oe.y,-J)}}}for(var se=a+o,le=0;le<R;le++){var ue=d?C(b[le],B[le],se):b[le];g?(v.copy(c.normals[0]).multiplyScalar(ue.x),p.copy(c.binormals[0]).multiplyScalar(ue.y),m.copy(u[0]).add(v).add(p),ke(m.x,m.y,m.z)):ke(ue.x,ue.y,0)}for(var ce=1;ce<=f;ce++)for(var fe=0;fe<R;fe++){var de=d?C(b[fe],B[fe],se):b[fe];g?(v.copy(c.normals[ce]).multiplyScalar(de.x),p.copy(c.binormals[ce]).multiplyScalar(de.y),m.copy(u[ce]).add(v).add(p),ke(m.x,m.y,m.z)):ke(de.x,de.y,n/f*ce)}for(var he=h-1;0<=he;he--){for(var pe=he/h,ve=i*Math.cos(pe*Math.PI/2),me=a*Math.sin(pe*Math.PI/2)+o,ge=0,ye=E.length;ge<ye;ge++){var be=C(E[ge],O[ge],me);ke(be.x,be.y,n+ve)}for(var xe=0,we=x.length;xe<we;xe++){var _e=x[xe];F=U[xe];for(var Se=0,Me=_e.length;Se<Me;Se++){var Ee=C(_e[Se],F[Se],me);g?ke(Ee.x,Ee.y+u[f-1].y,u[f-1].x+ve):ke(Ee.x,Ee.y,n+ve)}}}function Te(e,t){for(var n=e.length;0<=--n;){var r=n,i=n-1;i<0&&(i=e.length-1);for(var a=0,o=f+2*h;a<o;a++){var s=R*a,l=R*(a+1);Ce(t+r+s,t+i+s,t+i+l,t+r+l)}}}function ke(e,t,n){r.push(e),r.push(t),r.push(n)}function Le(e,t,n){Re(e),Re(t),Re(n);var r=Ne.length/3,i=l.generateTopUV(Oe,Ne,r-3,r-2,r-1);Pe(i[0]),Pe(i[1]),Pe(i[2])}function Ce(e,t,n,r){Re(e),Re(t),Re(r),Re(t),Re(n),Re(r);var i=Ne.length/3,a=l.generateSideWallUV(Oe,Ne,i-6,i-3,i-2,i-1);Pe(a[0]),Pe(a[1]),Pe(a[3]),Pe(a[1]),Pe(a[2]),Pe(a[3])}function Re(e){Ne.push(r[3*e+0]),Ne.push(r[3*e+1]),Ne.push(r[3*e+2])}function Pe(e){De.push(e.x),De.push(e.y)}!function(){var e=Ne.length/3;if(d){for(var t=0,n=R*t,r=0;r<P;r++){var i=M[r];Le(i[2]+n,i[1]+n,i[0]+n)}n=R*(t=f+2*h);for(var a=0;a<P;a++){var o=M[a];Le(o[0]+n,o[1]+n,o[2]+n)}}else{for(var s=0;s<P;s++){var l=M[s];Le(l[2],l[1],l[0])}for(var u=0;u<P;u++){var c=M[u];Le(c[0]+R*f,c[1]+R*f,c[2]+R*f)}}Oe.addGroup(e,Ne.length/3-e,0)}(),function(){var e=Ne.length/3,t=0;Te(E,t),t+=E.length;for(var n=0,r=x.length;n<r;n++){var i=x[n];Te(i,t),t+=i.length}Oe.addGroup(e,Ne.length/3-e,1)}()}return e.setAttribute("position",new Oh(Ne,3)),e.setAttribute("uv",new Oh(De,2)),e.computeVertexNormals(),e}return Ll(s,[{key:"toJSON",value:function(){var e=Bl(Pl(s.prototype),"toJSON",this).call(this);return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}}],[{key:"fromJSON",value:function(e,t){for(var n=[],r=0,i=e.shapes.length;r<i;r++){var a=t[e.shapes[r]];n.push(a)}var o=e.options.extrudePath;return void 0!==o&&(e.options.extrudePath=(new Gg[o.type]).fromJSON(o)),new s(n,e.options)}}]),s}(),by={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],u=t[3*i],c=t[3*i+1];return[new jf(a,o),new jf(s,l),new jf(u,c)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],l=t[3*n+2],u=t[3*r],c=t[3*r+1],f=t[3*r+2],d=t[3*i],h=t[3*i+1],p=t[3*i+2],v=t[3*a],m=t[3*a+1],g=t[3*a+2];return Math.abs(s-c)<Math.abs(o-u)?[new jf(o,1-l),new jf(u,1-f),new jf(d,1-p),new jf(v,1-g)]:[new jf(s,1-l),new jf(c,1-f),new jf(h,1-p),new jf(m,1-g)]}};var xy=function(){Rl(o,Hh);var a=Ul(o);function o(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new jg([new jf(0,.5),new jf(-.5,-.5),new jf(.5,-.5)]),w=1<arguments.length&&void 0!==arguments[1]?arguments[1]:12;Tl(this,o),(e=a.call(this)).type="ShapeGeometry",e.parameters={shapes:t,curveSegments:w};var _=[],S=[],M=[],E=[],n=0,T=0;if(!1===Array.isArray(t))i(t);else for(var r=0;r<t.length;r++)i(t[r]),e.addGroup(n,T,r),n+=T,T=0;function i(e){var t=S.length/3,n=e.extractPoints(w),r=n.shape,i=n.holes;!1===vy.isClockWise(r)&&(r=r.reverse());for(var a=0,o=i.length;a<o;a++){var s=i[a];!0===vy.isClockWise(s)&&(i[a]=s.reverse())}for(var l=vy.triangulateShape(r,i),u=0,c=i.length;u<c;u++){var f=i[u];r=r.concat(f)}for(var d=0,h=r.length;d<h;d++){var p=r[d];S.push(p.x,p.y,0),M.push(0,0,1),E.push(p.x,p.y)}for(var v=0,m=l.length;v<m;v++){var g=l[v],y=g[0]+t,b=g[1]+t,x=g[2]+t;_.push(y,b,x),T+=3}}return e.setIndex(_),e.setAttribute("position",new Oh(S,3)),e.setAttribute("normal",new Oh(M,3)),e.setAttribute("uv",new Oh(E,2)),e}return Ll(o,[{key:"toJSON",value:function(){var e=Bl(Pl(o.prototype),"toJSON",this).call(this);return function(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}}],[{key:"fromJSON",value:function(e,t){for(var n=[],r=0,i=e.shapes.length;r<i;r++){var a=t[e.shapes[r]];n.push(a)}return new o(n,e.curveSegments)}}]),o}();(function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="ShadowMaterial",t.color=new Th(0),t.transparent=!0,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,e),this.color.copy(e.color),this}}]),r})().prototype.isShadowMaterial=!0;var wy=function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).defines={STANDARD:""},t.type="MeshStandardMaterial",t.color=new Th(16777215),t.roughness=1,t.metalness=0,t.map=null,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=null,t.aoMapIntensity=1,t.emissive=new Th(0),t.emissiveIntensity=1,t.emissiveMap=null,t.bumpMap=null,t.bumpScale=1,t.normalMap=null,t.normalMapType=Cf,t.normalScale=new jf(1,1),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.roughnessMap=null,t.metalnessMap=null,t.alphaMap=null,t.envMap=null,t.envMapIntensity=1,t.refractionRatio=.98,t.wireframe=!1,t.wireframeLinewidth=1,t.wireframeLinecap="round",t.wireframeLinejoin="round",t.flatShading=!1,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,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.flatShading=e.flatShading,this}}]),r}();wy.prototype.isMeshStandardMaterial=!0,function(){Rl(r,wy);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).defines={STANDARD:"",PHYSICAL:""},t.type="MeshPhysicalMaterial",t.clearcoatMap=null,t.clearcoatRoughness=0,t.clearcoatRoughnessMap=null,t.clearcoatNormalScale=new jf(1,1),t.clearcoatNormalMap=null,t.ior=1.5,Object.defineProperty(zl(t),"reflectivity",{get:function(){return Hf(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),t.sheenTint=new Th(0),t.sheenRoughness=1,t.transmissionMap=null,t.thickness=.01,t.thicknessMap=null,t.attenuationDistance=0,t.attenuationTint=new Th(1,1,1),t.specularIntensity=1,t.specularIntensityMap=null,t.specularTint=new Th(1,1,1),t.specularTintMap=null,t._sheen=0,t._clearcoat=0,t._transmission=0,t.setValues(e),t}return Ll(r,[{key:"sheen",get:function(){return this._sheen},set:function(e){0<this._sheen!=0<e&&this.version++,this._sheen=e}},{key:"clearcoat",get:function(){return this._clearcoat},set:function(e){0<this._clearcoat!=0<e&&this.version++,this._clearcoat=e}},{key:"transmission",get:function(){return this._transmission},set:function(e){0<this._transmission!=0<e&&this.version++,this._transmission=e}},{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,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.ior=e.ior,this.sheen=e.sheen,this.sheenTint.copy(e.sheenTint),this.sheenRoughness=e.sheenRoughness,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationTint.copy(e.attenuationTint),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularTint.copy(e.specularTint),this.specularTintMap=e.specularTintMap,this}}]),r}().prototype.isMeshPhysicalMaterial=!0;var _y=function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="MeshPhongMaterial",t.color=new Th(16777215),t.specular=new Th(1118481),t.shininess=30,t.map=null,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=null,t.aoMapIntensity=1,t.emissive=new Th(0),t.emissiveIntensity=1,t.emissiveMap=null,t.bumpMap=null,t.bumpScale=1,t.normalMap=null,t.normalMapType=Cf,t.normalScale=new jf(1,1),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=null,t.alphaMap=null,t.envMap=null,t.combine=zu,t.reflectivity=1,t.refractionRatio=.98,t.wireframe=!1,t.wireframeLinewidth=1,t.wireframeLinecap="round",t.wireframeLinejoin="round",t.flatShading=!1,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,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.flatShading=e.flatShading,this}}]),r}();_y.prototype.isMeshPhongMaterial=!0,function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).defines={TOON:""},t.type="MeshToonMaterial",t.color=new Th(16777215),t.map=null,t.gradientMap=null,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=null,t.aoMapIntensity=1,t.emissive=new Th(0),t.emissiveIntensity=1,t.emissiveMap=null,t.bumpMap=null,t.bumpScale=1,t.normalMap=null,t.normalMapType=Cf,t.normalScale=new jf(1,1),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.alphaMap=null,t.wireframe=!1,t.wireframeLinewidth=1,t.wireframeLinecap="round",t.wireframeLinejoin="round",t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,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}}]),r}().prototype.isMeshToonMaterial=!0,function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="MeshNormalMaterial",t.bumpMap=null,t.bumpScale=1,t.normalMap=null,t.normalMapType=Cf,t.normalScale=new jf(1,1),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.wireframe=!1,t.wireframeLinewidth=1,t.fog=!1,t.flatShading=!1,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,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.flatShading=e.flatShading,this}}]),r}().prototype.isMeshNormalMaterial=!0,function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="MeshLambertMaterial",t.color=new Th(16777215),t.map=null,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=null,t.aoMapIntensity=1,t.emissive=new Th(0),t.emissiveIntensity=1,t.emissiveMap=null,t.specularMap=null,t.alphaMap=null,t.envMap=null,t.combine=zu,t.reflectivity=1,t.refractionRatio=.98,t.wireframe=!1,t.wireframeLinewidth=1,t.wireframeLinecap="round",t.wireframeLinejoin="round",t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,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}}]),r}().prototype.isMeshLambertMaterial=!0,function(){Rl(r,bh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).defines={MATCAP:""},t.type="MeshMatcapMaterial",t.color=new Th(16777215),t.matcap=null,t.map=null,t.bumpMap=null,t.bumpScale=1,t.normalMap=null,t.normalMapType=Cf,t.normalScale=new jf(1,1),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.alphaMap=null,t.flatShading=!1,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,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.flatShading=e.flatShading,this}}]),r}().prototype.isMeshMatcapMaterial=!0,function(){Rl(r,hg);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="LineDashedMaterial",t.scale=1,t.dashSize=3,t.gapSize=1,t.setValues(e),t}return Ll(r,[{key:"copy",value:function(e){return Bl(Pl(r.prototype),"copy",this).call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}]),r}().prototype.isLineDashedMaterial=!0;var Sy={arraySlice:function(e,t,n){return Sy.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(n){for(var e=n.length,t=new Array(e),r=0;r!==e;++r)t[r]=r;return t.sort(function(e,t){return n[e]-n[t]}),t},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,l=0;l!==t;++l)i[o++]=e[s+l];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))for(;void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,o)),void 0!==(a=e[i++]););else if(void 0!==o.toArray)for(;void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),void 0!==(a=e[i++]););else for(;void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),void 0!==(a=e[i++]););}},subclip:function(e,t,n,r,i){var a=4<arguments.length&&void 0!==i?i:30,o=e.clone();o.name=t;for(var s=[],l=0;l<o.tracks.length;++l){for(var u=o.tracks[l],c=u.getValueSize(),f=[],d=[],h=0;h<u.times.length;++h){var p=u.times[h]*a;if(!(p<n||r<=p)){f.push(u.times[h]);for(var v=0;v<c;++v)d.push(u.values[h*c+v])}}0!==f.length&&(u.times=Sy.convertArray(f,u.times.constructor),u.values=Sy.convertArray(d,u.values.constructor),s.push(u))}o.tracks=s;for(var m=1/0,g=0;g<o.tracks.length;++g)m>o.tracks[g].times[0]&&(m=o.tracks[g].times[0]);for(var y=0;y<o.tracks.length;++y)o.tracks[y].shift(-1*m);return o.resetDuration(),o},makeClipAdditive:function(_,e,t,n){var r=1<arguments.length&&void 0!==e?e:0,S=2<arguments.length&&void 0!==t?t:_,i=3<arguments.length&&void 0!==n?n:30;i<=0&&(i=30);for(var a=S.tracks.length,M=r/i,o=function(e){var t=S.tracks[e],n=t.ValueTypeName;if("bool"===n||"string"===n)return"continue";var r=_.tracks.find(function(e){return e.name===t.name&&e.ValueTypeName===n});if(void 0===r)return"continue";var i=0,a=t.getValueSize();t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(i=a/3);var o=0,s=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(o=s/3);var l=t.times.length-1,u=void 0;if(M<=t.times[0]){var c=i,f=a-i;u=Sy.arraySlice(t.values,c,f)}else if(M>=t.times[l]){var d=l*a+i,h=d+a-i;u=Sy.arraySlice(t.values,d,h)}else{var p=t.createInterpolant(),v=i,m=a-i;p.evaluate(M),u=Sy.arraySlice(p.resultBuffer,v,m)}"quaternion"===n&&(new rd).fromArray(u).normalize().conjugate().toArray(u);for(var g=r.times.length,y=0;y<g;++y){var b=y*s+o;if("quaternion"===n)rd.multiplyQuaternionsFlat(r.values,b,u,0,r.values,b);else for(var x=s-2*o,w=0;w<x;++w)r.values[b+w]-=u[w]}},s=0;s<a;++s)o(s);return _.blendMode=2501,_}},My=function(){function i(e,t,n,r){Tl(this,i),this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}return Ll(i,[{key:"evaluate",value:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(i<=e)break e;var s=t[1];e<s&&(n=2,i=s);for(var l=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===l)break;if(r=i,(i=t[--n-1])<=e)break t}a=n,n=0}for(;n<a;){var u=n+a>>>1;e<t[u]?a=u:n=1+u}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}},{key:"getSettings_",value:function(){return this.settings||this.DefaultSettings_}},{key:"copySampleValue_",value:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t}},{key:"interpolate_",value:function(){throw new Error("call to abstract method")}},{key:"intervalChanged_",value:function(){}}]),i}();My.prototype.beforeStart_=My.prototype.copySampleValue_,My.prototype.afterEnd_=My.prototype.copySampleValue_;var Ey=function(){Rl(o,My);var a=Ul(o);function o(e,t,n,r){var i;return Tl(this,o),(i=a.call(this,e,t,n,r))._weightPrev=-0,i._offsetPrev=-0,i._weightNext=-0,i._offsetNext=-0,i.DefaultSettings_={endingStart:2400,endingEnd:2400},i}return Ll(o,[{key:"intervalChanged_",value:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:i=e,o=2*t-n;break;case 2402:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*n-t;break;case 2402:s=n+r[a=1]-r[0];break;default:a=e-1,s=t}var l=.5*(n-t),u=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u}},{key:"interpolate_",value:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=this._offsetPrev,c=this._offsetNext,f=this._weightPrev,d=this._weightNext,h=(n-t)/(r-t),p=h*h,v=p*h,m=-f*v+2*f*p-f*h,g=(1+f)*v+(-1.5-2*f)*p+(-.5+f)*h+1,y=(-1-d)*v+(1.5+d)*p+.5*h,b=d*v-d*p,x=0;x!==o;++x)i[x]=m*a[u+x]+g*a[l+x]+y*a[s+x]+b*a[c+x];return i}}]),o}(),Ty=function(){Rl(a,My);var i=Ul(a);function a(e,t,n,r){return Tl(this,a),i.call(this,e,t,n,r)}return Ll(a,[{key:"interpolate_",value:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=(n-t)/(r-t),c=1-u,f=0;f!==o;++f)i[f]=a[l+f]*c+a[s+f]*u;return i}}]),a}(),ky=function(){Rl(a,My);var i=Ul(a);function a(e,t,n,r){return Tl(this,a),i.call(this,e,t,n,r)}return Ll(a,[{key:"interpolate_",value:function(e){return this.copySampleValue_(e-1)}}]),a}(),Ly=function(){function i(e,t,n,r){if(Tl(this,i),void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Sy.convertArray(t,this.TimeBufferType),this.values=Sy.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}return Ll(i,[{key:"InterpolantFactoryMethodDiscrete",value:function(e){return new ky(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodLinear",value:function(e){return new Ty(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodSmooth",value:function(e){return new Ey(this.times,this.values,this.getValueSize(),e)}},{key:"setInterpolation",value:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)return this.createInterpolant=t,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}},{key:"getInterpolation",value:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}},{key:"getValueSize",value:function(){return this.values.length/this.times.length}},{key:"shift",value:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this}},{key:"scale",value:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this}},{key:"trim",value:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){a<=i&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Sy.arraySlice(n,i,a),this.values=Sy.arraySlice(this.values,i*o,a*o)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&Sy.isTypedArray(r))for(var l=0,u=r.length;l!==u;++l){var c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=Sy.arraySlice(this.times),t=Sy.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=e.length-1,a=1,o=1;o<i;++o){var s=!1,l=e[o];if(l!==e[o+1]&&(1!==o||l!==e[0]))if(r)s=!0;else for(var u=o*n,c=u-n,f=u+n,d=0;d!==n;++d){var h=t[u+d];if(h!==t[c+d]||h!==t[f+d]){s=!0;break}}if(s){if(o!==a){e[a]=e[o];for(var p=o*n,v=a*n,m=0;m!==n;++m)t[v+m]=t[p+m]}++a}}if(0<i){e[a]=e[i];for(var g=i*n,y=a*n,b=0;b!==n;++b)t[y+b]=t[g+b];++a}return a!==e.length?(this.times=Sy.arraySlice(e,0,a),this.values=Sy.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=Sy.arraySlice(this.times,0),t=Sy.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}],[{key:"toJSON",value:function(e){var t,n=e.constructor;if(n.toJSON!==this.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Sy.convertArray(e.times,Array),values:Sy.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}]),i}();Ly.prototype.TimeBufferType=Float32Array,Ly.prototype.ValueBufferType=Float32Array;var Cy={enabled:!(Ly.prototype.DefaultInterpolation=2301),files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},Ry=new function e(t,n,r){Tl(this,e);var i=this,a=!1,o=0,s=0,l=void 0,u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=n,this.onError=r,this.itemStart=function(e){s++,!1===a&&void 0!==i.onStart&&i.onStart(e,o,s),a=!0},this.itemEnd=function(e){o++,void 0!==i.onProgress&&i.onProgress(e,o,s),o===s&&(a=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return l?l(e):e},this.setURLModifier=function(e){return l=e,this},this.addHandler=function(e,t){return u.push(e,t),this},this.removeHandler=function(e){var t=u.indexOf(e);return-1!==t&&u.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=u.length;t<n;t+=2){var r=u[t],i=u[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}},Py=function(){function t(e){Tl(this,t),this.manager=void 0!==e?e:Ry,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}return Ll(t,[{key:"load",value:function(){}},{key:"loadAsync",value:function(n,r){var i=this;return new Promise(function(e,t){i.load(n,e,r,t)})}},{key:"parse",value:function(){}},{key:"setCrossOrigin",value:function(e){return this.crossOrigin=e,this}},{key:"setWithCredentials",value:function(e){return this.withCredentials=e,this}},{key:"setPath",value:function(e){return this.path=e,this}},{key:"setResourcePath",value:function(e){return this.resourcePath=e,this}},{key:"setRequestHeader",value:function(e){return this.requestHeader=e,this}}]),t}(),Ay={},Oy=function(){Rl(n,Py);var t=Ul(n);function n(e){return Tl(this,n),t.call(this,e)}return Ll(n,[{key:"load",value:function(u,e,t,n){void 0===u&&(u=""),void 0!==this.path&&(u=this.path+u),u=this.manager.resolveURL(u);var c=this,r=Cy.get(u);if(void 0!==r)return c.manager.itemStart(u),setTimeout(function(){e&&e(r),c.manager.itemEnd(u)},0),r;if(void 0===Ay[u]){var i,a=u.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var o=a[1],s=!!a[2],l=a[3];l=decodeURIComponent(l),s&&(l=atob(l));try{var f,d=(this.responseType||"").toLowerCase();switch(d){case"arraybuffer":case"blob":for(var h=new Uint8Array(l.length),p=0;p<l.length;p++)h[p]=l.charCodeAt(p);f="blob"===d?new Blob([h.buffer],{type:o}):h.buffer;break;case"document":var v=new DOMParser;f=v.parseFromString(l,o);break;case"json":f=JSON.parse(l);break;default:f=l}setTimeout(function(){e&&e(f),c.manager.itemEnd(u)},0)}catch(e){setTimeout(function(){n&&n(e),c.manager.itemError(u),c.manager.itemEnd(u)},0)}}else{for(var m in Ay[u]=[],Ay[u].push({onLoad:e,onProgress:t,onError:n}),(i=new XMLHttpRequest).open("GET",u,!0),i.addEventListener("load",function(e){var t=this.response,n=Ay[u];if(delete Ay[u],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Cy.add(u,t);for(var r=0,i=n.length;r<i;r++){var a=n[r];a.onLoad&&a.onLoad(t)}c.manager.itemEnd(u)}else{for(var o=0,s=n.length;o<s;o++){var l=n[o];l.onError&&l.onError(e)}c.manager.itemError(u),c.manager.itemEnd(u)}},!1),i.addEventListener("progress",function(e){for(var t=Ay[u],n=0,r=t.length;n<r;n++){var i=t[n];i.onProgress&&i.onProgress(e)}},!1),i.addEventListener("error",function(e){var t=Ay[u];delete Ay[u];for(var n=0,r=t.length;n<r;n++){var i=t[n];i.onError&&i.onError(e)}c.manager.itemError(u),c.manager.itemEnd(u)},!1),i.addEventListener("abort",function(e){var t=Ay[u];delete Ay[u];for(var n=0,r=t.length;n<r;n++){var i=t[n];i.onError&&i.onError(e)}c.manager.itemError(u),c.manager.itemEnd(u)},!1),void 0!==this.responseType&&(i.responseType=this.responseType),void 0!==this.withCredentials&&(i.withCredentials=this.withCredentials),i.overrideMimeType&&i.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)i.setRequestHeader(m,this.requestHeader[m]);i.send(null)}return c.manager.itemStart(u),i}Ay[u].push({onLoad:e,onProgress:t,onError:n})}},{key:"setResponseType",value:function(e){return this.responseType=e,this}},{key:"setMimeType",value:function(e){return this.mimeType=e,this}}]),n}(),Ny=function(){Rl(n,Py);var t=Ul(n);function n(e){return Tl(this,n),t.call(this,e)}return Ll(n,[{key:"load",value:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=Cy.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;var o=Zf("img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),Cy.add(t,this),e&&e(this),i.manager.itemEnd(t)}function l(e){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}}]),n}(),Dy=function(){Rl(n,Py);var t=Ul(n);function n(e){return Tl(this,n),t.call(this,e)}return Ll(n,[{key:"load",value:function(e,n,t,r){var i=new vp,a=new Ny(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(t){a.load(e[t],function(e){i.images[t]=e,6===++o&&(i.needsUpdate=!0,n&&n(i))},void 0,r)}for(var l=0;l<e.length;++l)s(l);return i}}]),n}(),Iy=function(){Rl(n,Py);var t=Ul(n);function n(e){return Tl(this,n),t.call(this,e)}return Ll(n,[{key:"load",value:function(e,t,n,r){var i=new Qf,a=new Ny(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)},n,r),i}}]),n}(),zy=function(){Rl(i,oh);var r=Ul(i);function i(e){var t,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return Tl(this,i),(t=r.call(this)).type="Light",t.color=new Th(e),t.intensity=n,t}return Ll(i,[{key:"dispose",value:function(){}},{key:"copy",value:function(e){return Bl(Pl(i.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this}},{key:"toJSON",value:function(e){var t=Bl(Pl(i.prototype),"toJSON",this).call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}]),i}();zy.prototype.isLight=!0;var Fy=new Dd,Uy=new id,By=new id,Hy=function(){function t(e){Tl(this,t),this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new jf(512,512),this.map=null,this.mapPass=null,this.matrix=new Dd,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Sp,this._frameExtents=new jf(1,1),this._viewportCount=1,this._viewports=[new ed(0,0,1,1)]}return Ll(t,[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(e){var t=this.camera,n=this.matrix;Uy.setFromMatrixPosition(e.matrixWorld),t.position.copy(Uy),By.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(By),t.updateMatrixWorld(),Fy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Fy),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}},{key:"getViewport",value:function(e){return this._viewports[e]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"dispose",value:function(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}},{key:"copy",value:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}]),t}(),Gy=function(){Rl(t,Hy);var e=Ul(t);function t(){return Tl(this,t),e.call(this,new Ip(-5,5,5,-5,.5,500))}return t}();Gy.prototype.isDirectionalLightShadow=!0;var Vy=function(){Rl(i,zy);var r=Ul(i);function i(e,t){var n;return Tl(this,i),(n=r.call(this,e,t)).type="DirectionalLight",n.position.copy(oh.DefaultUp),n.updateMatrix(),n.target=new oh,n.shadow=new Gy,n}return Ll(i,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return Bl(Pl(i.prototype),"copy",this).call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}]),i}();Vy.prototype.isDirectionalLight=!0;var Wy=function(){Rl(i,zy);var r=Ul(i);function i(e,t){var n;return Tl(this,i),(n=r.call(this,e,t)).type="AmbientLight",n}return i}();Wy.prototype.isAmbientLight=!0;var jy=function(){function t(){Tl(this,t),this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new id)}return Ll(t,[{key:"set",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}},{key:"getIrradianceAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}},{key:"add",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}},{key:"addScaledSH",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}},{key:"scale",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}},{key:"lerp",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}},{key:"equals",value:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e,t){for(var n=1<arguments.length&&void 0!==t?t:0,r=this.coefficients,i=0;i<9;i++)r[i].fromArray(e,n+3*i);return this}},{key:"toArray",value:function(e,t){for(var n=0<arguments.length&&void 0!==e?e:[],r=1<arguments.length&&void 0!==t?t:0,i=this.coefficients,a=0;a<9;a++)i[a].toArray(n,r+3*a);return n}}],[{key:"getBasisAt",value:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}]),t}();jy.prototype.isSphericalHarmonics3=!0,function(){Rl(i,zy);var r=Ul(i);function i(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new jy,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return Tl(this,i),(e=r.call(this,void 0,n)).sh=t,e}return Ll(i,[{key:"copy",value:function(e){return Bl(Pl(i.prototype),"copy",this).call(this,e),this.sh.copy(e.sh),this}},{key:"fromJSON",value:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}},{key:"toJSON",value:function(e){var t=Bl(Pl(i.prototype),"toJSON",this).call(this,e);return t.object.sh=this.sh.toArray(),t}}]),i}().prototype.isLightProbe=!0;var qy,Xy=function(){function e(){Tl(this,e)}return Ll(e,null,[{key:"decodeText",value:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}},{key:"extractUrlBase",value:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}}]),e}(),Yy=function(){return void 0===qy&&(qy=new(window.AudioContext||window.webkitAudioContext)),qy},Zy=function(){Rl(n,Py);var t=Ul(n);function n(e){return Tl(this,n),t.call(this,e)}return Ll(n,[{key:"load",value:function(n,r,e,i){var a=this,t=new Oy(this.manager);t.setResponseType("arraybuffer"),t.setPath(this.path),t.setRequestHeader(this.requestHeader),t.setWithCredentials(this.withCredentials),t.load(n,function(e){try{var t=e.slice(0);Yy().decodeAudioData(t,function(e){r(e)})}catch(e){i?i(e):console.error(e),a.manager.itemError(n)}},e,i)}}]),n}(),Jy=function(){function t(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];Tl(this,t),this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}return Ll(t,[{key:"start",value:function(){this.startTime=$y(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=$y();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}]),t}();function $y(){return("undefined"==typeof performance?Date:performance).now()}var Qy=function(){Rl(r,oh);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).type="Audio",t.listener=e,t.context=e.context,t.gain=t.context.createGain(),t.gain.connect(e.getInput()),t.autoplay=!1,t.buffer=null,t.detune=0,t.loop=!1,t.loopStart=0,t.loopEnd=0,t.offset=0,t.duration=void 0,t.playbackRate=1,t.isPlaying=!1,t.hasPlaybackControl=!0,t.source=null,t.sourceType="empty",t._startedAt=0,t._progress=0,t._connected=!1,t.filters=[],t}return Ll(r,[{key:"getOutput",value:function(){return this.gain}},{key:"setNodeSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}},{key:"setMediaElementSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}},{key:"setMediaStreamSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}},{key:"setBuffer",value:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}},{key:"play",value:function(e){var t=0<arguments.length&&void 0!==e?e:0;if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")}},{key:"pause",value:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(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.")}},{key:"stop",value:function(){if(!1!==this.hasPlaybackControl)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.")}},{key:"connect",value:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var 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}},{key:"disconnect",value:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var 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}},{key:"getFilters",value:function(){return this.filters}},{key:"setFilters",value:function(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}},{key:"setDetune",value:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}},{key:"getDetune",value:function(){return this.detune}},{key:"getFilter",value:function(){return this.getFilters()[0]}},{key:"setFilter",value:function(e){return this.setFilters(e?[e]:[])}},{key:"setPlaybackRate",value:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"getPlaybackRate",value:function(){return this.playbackRate}},{key:"onEnded",value:function(){this.isPlaying=!1}},{key:"getLoop",value:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}},{key:"setLoop",value:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"setLoopStart",value:function(e){return this.loopStart=e,this}},{key:"setLoopEnd",value:function(e){return this.loopEnd=e,this}},{key:"getVolume",value:function(){return this.gain.gain.value}},{key:"setVolume",value:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}]),r}(),Ky="\\[\\]\\.:\\/",eb="[^"+Ky+"]",tb="[^"+Ky.replace("\\.","")+"]";/((?:WC+[\/:])*)/.source.replace("WC",eb),/(WCOD+)?/.source.replace("WCOD",tb),/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",eb),/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",eb);var nb=new Float32Array(1);new Int32Array(nb.buffer),Sg.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Sg.prototype),(e.prototype.constructor=e).prototype.getPoint=t,e},Wg.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},Py.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Xy.extractUrlBase(e)},Py.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.")}},sd.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},sd.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},sd.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},sd.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},sd.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},Td.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Sp.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Xf.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Xf.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},Xf.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},Xf.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},Xf.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},Xf.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Dd.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},Dd.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Dd.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new id).setFromMatrixColumn(this,3)},Dd.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},Dd.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Dd.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Dd.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Dd.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Dd.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},Dd.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Dd.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Dd.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Dd.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Dd.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Dd.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Dd.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Dd.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Dd.prototype.makeFrustum=function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)},Dd.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},xp.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},rd.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},rd.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},Nd.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Nd.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},Nd.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},gh.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},gh.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},gh.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},gh.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},gh.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},gh.barycoordFromPoint=function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),gh.getBarycoord(e,t,n,r,i)},gh.normal=function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),gh.getNormal(e,t,n,r)},jg.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},jg.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new yy(this,e)},jg.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new xy(this,e)},jf.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},jf.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},jf.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},id.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},id.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},id.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},id.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},id.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},id.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},id.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},id.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},id.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ed.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},ed.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},oh.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},oh.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},oh.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},oh.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},oh.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(oh.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},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.")}}}),ap.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(ap.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},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.")}}}),hp.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(zy.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Rh.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===Af},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Af)}}}),Rh.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Af:Pf),this},Rh.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Rh.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Hh.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},Hh.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Rh(t,arguments[2])))},Hh.prototype.addDrawCall=function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},Hh.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Hh.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Hh.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},Hh.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(Hh.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}}}),fg.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Af:Pf),this},fg.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},yy.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},yy.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},yy.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},cg.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Object.defineProperties(bh.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 Th}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(fp.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),lg.prototype.clearTarget=function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},lg.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},lg.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},lg.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},lg.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},lg.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},lg.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},lg.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},lg.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},lg.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},lg.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},lg.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},lg.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},lg.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},lg.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},lg.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},lg.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},lg.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},lg.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},lg.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},lg.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},lg.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},lg.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},lg.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},lg.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(lg.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},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(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?wf:xf}},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(Qm.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(td.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Qy.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Zy).load(e,function(e){t.setBuffer(e)}),this},pp.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},pp.prototype.clear=function(e,t,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,n,r)},Jf.crossOrigin=void 0,Jf.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Iy;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Jf.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Dy;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Jf.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Jf.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"133"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="133");var rb=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ib=function(e){return!(!e||"object"!==Sl(e))},ab={depth_frag:"uniform sampler2D textureMap;\nvarying vec2 vUV;\nout vec4 outColor;\nvec4 pack_depth(const in float depth) {\n const vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n vec4 res = fract(depth * bit_shift);\n res -= res.xxyz * bit_mask;\n return res;\n}\nvoid main() {\n vec4 pixel = texture2D(textureMap, vUV);\n if (pixel.a < 0.5) discard;\n outColor = pack_depth(gl_FragCoord.z);\n}\n",depth_vert:"varying vec2 vUV;\nvoid main() {\n vUV = 0.75 * uv;\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n}\n"},ob=function(){Rl(E,Hh);var M=Ul(E);function E(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:function(e,t,n){return n.set(e,t,Math.cos(e)*Math.sin(t))},n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:8,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:8;Tl(this,E),(e=M.call(this)).type="ParametricGeometry",e.parameters={func:t,slices:n,stacks:r};var i=[],a=[],o=[],s=[],l=new id,u=new id,c=new id,f=new id,d=new id;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var h=n+1,p=0;p<=r;p++)for(var v=p/r,m=0;m<=n;m++){var g=m/n;t(g,v,u),a.push(u.x,u.y,u.z),0<=g-1e-5?(t(g-1e-5,v,c),f.subVectors(u,c)):(t(1e-5+g,v,c),f.subVectors(c,u)),0<=v-1e-5?(t(g,v-1e-5,c),d.subVectors(u,c)):(t(g,1e-5+v,c),d.subVectors(c,u)),l.crossVectors(f,d).normalize(),o.push(l.x,l.y,l.z),s.push(g,v)}for(var y=0;y<r;y++)for(var b=0;b<n;b++){var x=y*h+b,w=y*h+b+1,_=(y+1)*h+b+1,S=(y+1)*h+b;i.push(x,w,S),i.push(w,_,S)}return e.setIndex(i),e.setAttribute("position",new Oh(a,3)),e.setAttribute("normal",new Oh(o,3)),e.setAttribute("uv",new Oh(s,2)),e}return E}(),sb=function(){function n(e,t){Tl(this,n),this.position=e.clone(),this.previous=e.clone(),this.original=e.clone(),this.mass=t,this.inverseMass=1/t,this.acceleration=new id,this.tmp=new id}return Ll(n,[{key:"applyForce",value:function(e){this.acceleration.addScaledVector(e,this.inverseMass)}},{key:"integrate",value:function(e){var t=this.tmp.subVectors(this.position,this.previous).multiplyScalar(.97).add(this.position).addScaledVector(this.acceleration,e);this.tmp=this.previous,this.previous=this.position,this.position=t,this.acceleration.set(0,0,0)}}]),n}(),lb=new id,ub=function(){function r(e,t,n){Tl(this,r),this.p1=e,this.p2=t,this.restDistance=n}return Ll(r,[{key:"resolve",value:function(){var e=this.p1,t=this.p2,n=this.restDistance;lb.subVectors(t.position,e.position);var r=lb.length();if(0!==r){var i=lb.multiplyScalar((1-n/r)/2);e.position.add(i),t.position.sub(i)}}}]),r}(),cb=function(){function M(n,e,t,r){Tl(this,M);for(var i=t*n,a=t*e,o=[],s=[],l=function(e,t){return o[e+t*(n+1)]},u=function(e,t,n){n.set(e*i,t*a,0)},c=new id,f=r/((e+1)*(n+1)),d=0;d<=e;d++)for(var h=0;h<=n;h++)u(h/n,d/e,c),o.push(new sb(c,f));for(var p=0;p<e;p++)for(var v=0;v<n;v++)s.push(new ub(l(v,p),l(v,p+1),t)),s.push(new ub(l(v,p),l(v+1,p),t));for(var m=n,g=0;g<e;g++)s.push(new ub(l(m,g),l(m,g+1),t));for(var y=e,b=0;b<n;b++)s.push(new ub(l(b,y),l(b+1,y),t));for(var x=Math.sqrt(t*t*2),w=0;w<e;w++)for(var _=0;_<n;_++)s.push(new ub(l(_,w),l(_+1,w+1),x)),s.push(new ub(l(_+1,w),l(_,w+1),x));var S=new ob(u,n,e);S.getAttribute("position").setUsage(35040),this.xSegments=n,this.ySegments=e,this.restDistance=t,this.width=i,this.height=a,this.particles=o,this.constraints=s,this.particleAt=l,this.geometry=S}return Ll(M,[{key:"reset",value:function(){for(var e=this.particles,t=0,n=e.length;t<n;t++){var r=e[t];r.previous.copy(r.position.copy(r.original))}}},{key:"simulate",value:function(e){for(var t=this.particles,n=this.constraints,r=e*e,i=0,a=t.length;i<a;i++)t[i].integrate(r);for(var o=0,s=n.length;o<s;o++)n[o].resolve()}},{key:"render",value:function(){for(var e=this.particles,t=this.geometry,n=t.getAttribute("position"),r=n.array,i=0,a=e.length;i<a;i++){var o=e[i].position,s=3*i;r[s]=o.x,r[1+s]=o.y,r[2+s]=o.z}n.needsUpdate=!0,t.computeVertexNormals()}}]),M}(),fb=new id,db=function(){Rl(t,ub);var e=Ul(t);function t(){return Tl(this,t),e.apply(this,arguments)}return Ll(t,[{key:"resolve",value:function(){var e=this.p1,t=this.p2,n=1.2*this.restDistance;fb.subVectors(e.position,t.position);var r=fb.length()/1.2;fb.normalize();var i=fb.multiplyScalar(r-n);n<r&&t.position.add(i)}}]),t}(),hb=function(e,t,n){for(var r=e*t,i=new Uint8Array(3*r),a=Math.floor(255*n.r),o=Math.floor(255*n.g),s=Math.floor(255*n.b),l=0;l<r;l++){var u=3*l;i[u]=a,i[1+u]=o,i[2+u]=s}return new dg(i,e,t,xc)}(1,1,new Th(16777215));var pb,vb=(pb={edges:[],spacing:1},function(e,t,n){var r=Object.assign({},pb,n),i=r.edges;if(r.spacing=function(e){return rb(e)&&1<=e?Math.floor(e):pb.spacing}(r.spacing),"string"==typeof i)mb(e,t,i,r);else if(i&&i.length)for(var a=0,o=i.length;a<o;a++)mb(e,t,i[a],r)});function mb(e,t,n,r){var i=e.xSegments,a=e.ySegments,o=e.particleAt,s=r.spacing;switch(n){case Zl.TOP:for(var l=0;l<=i;l+=s)t.push(o(l,a));break;case Zl.LEFT:for(var u=0;u<=a;u+=s)t.push(o(0,u));break;case Zl.BOTTOM:for(var c=0;c<=i;c+=s)t.push(o(c,0));break;case Zl.RIGHT:for(var f=0;f<=a;f+=s)t.push(o(i,f))}}var gb=function(){function n(e){Tl(this,n);var t=Object.assign({},n.defaults,e);this.cloth=function(e){var t=e.width,n=e.height,r=e.mass,i=n/e.granularity;return new cb(Math.round(t/i),Math.round(n/i),i,r*t*n)}(t),this.pins=[],this.lengthConstraints=[],this.mesh=function(e,t){var n=e.geometry,r=hb;t&&t.texture&&(t.texture instanceof Qf?((r=t.texture).needsUpdate=!0,r.anisotropy=16,r.minFilter=ic,r.magFilter=ic,r.wrapS=r.wrapT=Ku):console.error("FlagWaver.Flag: options.texture must be an instance of THREE.Texture.")),r.encoding=wf;var i=new _y({alphaTest:.5,color:16777215,specular:197379,shininess:.001,side:ou,map:r}),a=new ap(n,i);return a.castShadow=!0,a.customDepthMaterial=new fp({glslVersion:Of,uniforms:{textureMap:{value:r}},vertexShader:ab.depth_vert,fragmentShader:ab.depth_frag}),a}(this.cloth,t),this.mesh.position.set(0,-this.cloth.height,0),this.object=new oh,this.object.add(this.mesh),this.pin(t.pin)}return Ll(n,[{key:"destroy",value:function(){this.mesh instanceof ap&&(this.mesh.material.dispose(),this.mesh.geometry.dispose(),this.mesh.material.map.dispose(),this.mesh.customDepthMaterial.dispose())}},{key:"pin",value:function(e){vb(this.cloth,this.pins,e)}},{key:"unpin",value:function(){this.pins=[]}},{key:"setLengthConstraints",value:function(e){var t=this.cloth,n=t.xSegments,r=t.ySegments,i=t.restDistance,a=t.particleAt,o=[];if(e===Zl.LEFT)for(var s=0;s<=r;s++)for(var l=0;l<n;l++)o.push(new db(a(l,s),a(l+1,s),i));else if(e===Zl.TOP)for(var u=0;u<=n;u++)for(var c=r;0<c;c--)o.push(new db(a(u,c),a(u,c-1),i));this.lengthConstraints=o}},{key:"reset",value:function(){this.cloth.reset()}},{key:"simulate",value:function(e){var t=this.pins,n=this.lengthConstraints;this.cloth.simulate(e);for(var r=0,i=t.length;r<i;r++){var a=t[r];a.previous.copy(a.position.copy(a.original))}for(var o=0,s=n.length;o<s;o++)n[o].resolve()}},{key:"render",value:function(){this.cloth.render()}}]),n}();function yb(e,t){for(var n=1<arguments.length&&void 0!==t&&t,r=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),a=new Set(Object.keys(e[0].morphAttributes)),o={},s={},l=e[0].morphTargetsRelative,u=new Hh,c=0,f=0;f<e.length;++f){var d=e[f],h=0;if(r!=(null!==d.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var p in d.attributes){if(!i.has(p))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+'. All geometries must have compatible attributes; make sure "'+p+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[p]&&(o[p]=[]),o[p].push(d.attributes[p]),h++}if(h!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". Make sure all geometries have the same number of attributes."),null;if(l!==d.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var v in d.morphAttributes){if(!a.has(v))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". .morphAttributes must be consistent throughout all geometries."),null;void 0===s[v]&&(s[v]=[]),s[v].push(d.morphAttributes[v])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(d.userData),n){var m=void 0;if(r)m=d.index.count;else{if(void 0===d.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". The geometry must have either an index or a position attribute"),null;m=d.attributes.position.count}u.addGroup(c,m,f),c+=m}}if(r){for(var g=0,y=[],b=0;b<e.length;++b){for(var x=e[b].index,w=0;w<x.count;++w)y.push(x.getX(w)+g);g+=e[b].attributes.position.count}u.setIndex(y)}for(var _ in o){var S=bb(o[_]);if(!S)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+_+" attribute."),null;u.setAttribute(_,S)}for(var M in s){var E=s[M][0].length;if(0===E)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[M]=[];for(var T=0;T<E;++T){for(var k=[],L=0;L<s[M].length;++L)k.push(s[M][L][T]);var C=bb(k);if(!C)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+M+" morphAttribute."),null;u.morphAttributes[M].push(C)}}return u}function bb(e){for(var t,n,r,i=0,a=0;a<e.length;++a){var o=e[a];if(o.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;i+=o.array.length}for(var s=new t(i),l=0,u=0;u<e.length;++u)s.set(e[u].array,l),l+=e[u].array.length;return new Rh(s,n,r)}function xb(e){var t=e.poleWidth/2,n=e.poleLength,r=e.poleCapSize/2,i=new _g(t,t,n);i.translate(0,e.poleLength/2,0);var a=new _g(r,r,r);return a.translate(0,n+r/2,0),yb([i,a])}Cl(gb,"defaults",{width:1.8,height:1.2,mass:.11,granularity:10,rigidness:1,texture:hb,pin:{edges:[Zl.LEFT]}});var wb,_b=function(){function a(e){Tl(this,a);var t=Object.assign({},this.constructor.defaults,e),n=this.buildGeometry(t),r=new _y({color:6974058,specular:16777215,shininess:18}),i=new ap(n,r);i.receiveShadow=!0,i.castShadow=!0,this.top=new id(0,t.poleLength,0),this.mesh=i,this.object=this.mesh}return Ll(a,[{key:"destroy",value:function(){this.mesh instanceof ap&&(this.mesh.material.dispose(),this.mesh.geometry.dispose())}},{key:"buildGeometry",value:function(e){return xb(e)}},{key:"addFlag",value:function(e){e.unpin(),e.pin({edges:[Zl.LEFT]}),e.setLengthConstraints(Zl.LEFT),e.object.position.add(this.top)}}]),a}();Cl(_b,"defaults",((wb={}).flagpoleType=Jl.VERTICAL,wb.poleWidth=.076,wb.poleLength=6,wb.poleCapSize=4*wb.poleWidth/3,wb.crossbarWidth=2*wb.poleWidth/3,wb.crossbarLength=1.2,wb.crossbarCapSize=3*wb.crossbarWidth/2,wb.poleTopOffset=.1,wb));var Sb=function(){function i(e){Tl(this,i);var t=Object.assign({},e),n=t.flagpole,r=t.flag;this.flagpole=n||new _b,this.flag=r||new gb,this.flagpole.addFlag(this.flag,0),this.object=new oh,this.object.add(this.flagpole.object),this.object.add(this.flag.object)}return Ll(i,[{key:"destroy",value:function(){this.destroyChildSubject(this.flagpole),this.destroyChildSubject(this.flag)}},{key:"destroyChildSubject",value:function(e){e&&(this.object.remove(e.object),e.destroy())}},{key:"reset",value:function(){this.flag.reset()}},{key:"simulate",value:function(e){this.flag.simulate(e)}},{key:"render",value:function(){this.flag.render()}}]),i}(),Mb={noEffect:function(e){return e},blowFromLeftDirection:function(e,t){return e.set(2e3,0,1e3)},rotatingDirection:function(e,t){return e.set(Math.sin(t/2e3),Math.cos(t/3e3),Math.sin(t/1e3))},constantSpeed:function(e,t){return e},variableSpeed:function(e,t){return e*(1+.25*Math.cos(t/7e3))}};var Eb=function(){function n(e){Tl(this,n);var t=Object.assign({},this.constructor.defaults,e);this.direction=t.direction,this.speed=t.speed,this.directionFn=t.directionFn,this.speedFn=t.speedFn,this.pressure=new id}return Ll(n,[{key:"update",value:function(){var e=Date.now();this.directionFn(function(e){return 0===e.x&&(e.x=.001),0===e.y&&(e.y=.001),0===e.z&&(e.z=.001),e}(this.pressure.copy(this.direction)),e).normalize().multiplyScalar(function(e){return.6125*e*e}(this.speedFn(function(e){return 0===e?.001:e}(this.speed),e)))}}]),n}();Cl(Eb,"defaults",{direction:new id(1,0,0),speed:10,directionFn:Mb.blowFromLeftDirection,speedFn:Mb.constantSpeed});var Tb=function(){Rl(i,_b);var r=Ul(i);function i(e){var t;Tl(this,i),t=r.call(this,e);var n=Object.assign({},t.constructor.defaults,e);return t.top.set(0,n.poleLength-n.poleTopOffset,n.poleWidth/2+n.crossbarWidth/2),t.verticalHoisting=n.verticalHoisting,t}return Ll(i,[{key:"buildGeometry",value:function(e){return function(e){var t=xb(e),n=e.poleWidth/2,r=e.poleLength,i=e.crossbarWidth/2,a=e.crossbarLength,o=e.crossbarCapSize/2,s=e.poleTopOffset,l=new _g(i,i,a);l.rotateZ(Math.PI/2);var u=new _g(o,o,o),c=u.clone();return u.rotateZ(Math.PI/2),u.translate(-a/2,0,0),c.rotateZ(-Math.PI/2),c.translate(a/2,0,0),l.translate(0,r-s,n+i),yb([t,l,u,c])}(e)}},{key:"addFlag",value:function(e){switch(e.unpin(),this.verticalHoisting){case $l.NONE:e.pin({edges:[Zl.TOP]}),e.setLengthConstraints(Zl.TOP),e.object.position.add(this.top),e.object.position.x=-e.cloth.width/2;break;case $l.TOP_LEFT:e.pin({edges:[Zl.LEFT]}),e.setLengthConstraints(Zl.LEFT),e.object.position.add(this.top),e.object.position.x=-e.cloth.height/2,e.object.rotateZ(3*Math.PI/2),e.object.rotateX(Math.PI);break;case $l.TOP_RIGHT:default:e.pin({edges:[Zl.LEFT]}),e.setLengthConstraints(Zl.LEFT),e.object.position.add(this.top),e.object.position.x=e.cloth.height/2,e.object.rotateZ(3*Math.PI/2)}}}]),i}(),kb=function(){Rl(t,_b);var e=Ul(t);function t(){return Tl(this,t),e.apply(this,arguments)}return Ll(t,[{key:"buildGeometry",value:function(e){return function(e){var t=xb(e),n=e.poleLength,r=e.poleCapSize/2,i=e.crossbarWidth/2,a=e.crossbarLength,o=new _g(i,i,a);return o.rotateZ(Math.PI/2),o.translate(a/2,n+r-i,0),yb([t,o])}(e)}},{key:"addFlag",value:function(e){e.unpin(),e.pin({edges:[Zl.LEFT,Zl.TOP]}),e.setLengthConstraints(Zl.LEFT),e.object.position.add(this.top)}}]),t}(),Lb=new id(0,0,1),Cb=function(){Rl(r,_b);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).top.applyAxisAngle(Lb,3*Math.PI/2),t}return Ll(r,[{key:"buildGeometry",value:function(e){var t=xb(e);return t.rotateZ(3*Math.PI/2),t}},{key:"addFlag",value:function(e){e.unpin(),e.pin({edges:[Zl.LEFT]}),e.setLengthConstraints(Zl.LEFT),e.object.position.add(this.top),e.object.rotateZ(3*Math.PI/2)}}]),r}(),Rb=new id(0,0,1),Pb=function(){Rl(r,_b);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).top.applyAxisAngle(Rb,7*Math.PI/4),t}return Ll(r,[{key:"buildGeometry",value:function(e){var t=xb(e);return t.rotateZ(7*Math.PI/4),t}},{key:"addFlag",value:function(e){e.unpin(),e.pin({edges:[Zl.LEFT]}),e.setLengthConstraints(Zl.LEFT),e.object.position.add(this.top),e.object.rotateZ(7*Math.PI/4)}}]),r}(),Ab=new id,Ob=new id;function Nb(e,t){return Ab.copy(e),t instanceof oh&&(Ob.setFromMatrixPosition(t.matrixWorld),Ab.add(Ob),t.worldToLocal(Ab)),Ab}var Db=new id(0,-9.80665,0);new id;var Ib=new id,zb=new id;s(function(e,t){var n;e.exports=((n=function e(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?"block":"none";r=e}var r=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(e){e.preventDefault(),n(++r%i.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,l=t(new e.Panel("FPS","#0ff","#002")),u=t(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new e.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:i,addPanel:t,showPanel:n,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(u.update(e-a,200),o+1e3<e&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}}).Panel=function(n,r,i){var a=1/0,o=0,s=Math.round,l=s(window.devicePixelRatio||1),u=80*l,e=48*l,c=3*l,f=2*l,d=3*l,h=15*l,p=74*l,v=30*l,m=document.createElement("canvas");m.width=u,m.height=e,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*l+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,u,e),g.fillStyle=r,g.fillText(n,c,f),g.fillRect(d,h,p,v),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(d,h,p,v),{dom:m,update:function(e,t){a=Math.min(a,e),o=Math.max(o,e),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,u,h),g.fillStyle=r,g.fillText(s(e)+" "+n+" ("+s(a)+"-"+s(o)+")",c,f),g.drawImage(m,d+l,h,p-l,v,d,h,p-l,v),g.fillRect(d+p-l,h,l,v),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(d+p-l,h,l,s((1-e/t)*v))}}},n)});var Fb=function(){function e(){Tl(this,e)}return Ll(e,[{key:"init",value:function(){}},{key:"deinit",value:function(){}}]),e}();Cl(Fb,"displayName","module");var Ub=function(){function t(e){Tl(this,t),this.context=e||this,this.modules=[]}return Ll(t,[{key:"getModulesByType",value:function(e){for(var t=this.modules,n=[],r=0,i=t.length;r<i;r++){var a=t[r];a.constructor.displayName===e&&n.push(a)}return n}},{key:"module",value:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=this.modules,r=0,i=n.length,a=0;r<i;r++){var o=n[r];if(o.constructor.displayName===e){if(a===t)return o;a++}}return null}},{key:"add",value:function(e){if(e instanceof Fb)return e.init&&e.init(this.context),this.modules.push(e),e}},{key:"remove",value:function(e){if(e instanceof Fb){var t=this.modules,n=t.indexOf(e);if(!(n<0))return e.deinit&&e.deinit(this.context),t.splice(n,1)[0]}}}]),t}(),Bb=function(){Rl(v,Ub);var p=Ul(v);function v(e){var a;Tl(this,v),a=p.call(this);function t(){l.lookAt(c),u.render(s,l)}function n(){!function(){for(var e=a.modules,t=0,n=e.length;t<n;t++){var r=e[t];r.subject&&r.reset&&r.reset()}}(),t()}function r(e){a.needsUpdate&&(function(e){for(var t=a.modules,n=0,r=t.length;n<r;n++){var i=t[n];"needsUpdate"in i&&(i.needsUpdate=e)}}(!0),a.needsUpdate=!1),function(e){for(var t=a.modules,n=0,r=t.length;n<r;n++){var i=t[n];i.update&&i.update(e)}}(e),t()}function i(){if(requestAnimationFrame(i),f.running){var e=0;for(d+=f.getDelta();1/60<=d;)if(r(1/60),d-=1/60,90<=++e){d=0,h<=255&&(255===h?console.warn("FlagWaver.App: maxUpdatesPerFrame exceeded. Suppressing further warnings."):console.warn("FlagWaver.App: maxUpdatesPerFrame exceeded."),h++);break}}}var o=Object.assign({},a.constructor.defaults,e),s=o.scene,l=o.camera,u=o.renderer,c=new id(0,5,0),f=new Jy,d=0,h=0;return s.add(l),f.start(),n(),i(),a.scene=s,a.camera=l,a.renderer=u,a.canvas=u.domElement,a.clock=f,a.timestep=1/60,a.destroy=function(){f.stop(),function(){for(var e=a.modules,t=0,n=e.length;t<n;t++)a.remove(e[t])}(),cancelAnimationFrame(i),u.dispose(),u.forceContextLoss(),a.canvas=u.domElement=null,a.scene=s=null,a.camera=l=null,a.renderer=u=null},a.render=t,a.start=n,a.update=r,a.needsUpdate=!1,a}return v}(),Hb=function(){Rl(n,Fb);var t=Ul(n);function n(){var e;return Tl(this,n),(e=t.call(this)).app=null,e}return Ll(n,[{key:"init",value:function(e){this.app=e}},{key:"deinit",value:function(){this.play&&this.play()}},{key:"play",value:function(){var e=this.app.clock;e.running||e.start()}},{key:"pause",value:function(){this.app.clock.stop()}},{key:"step",value:function(){var e=this.app,t=e.clock,n=e.timestep;t.running||(t.elapsedTime+=n,this.app.update(n))}},{key:"reset",value:function(){var e=this.app.clock;e.startTime=0,e.oldTime=0,e.elapsedTime=0,this.app.start()}}]),n}();Cl(Hb,"displayName","animationModule");var Gb=function(){Rl(n,Fb);var t=Ul(n);function n(){var e;return Tl(this,n),(e=t.call(this)).app=null,e.resize=e.resize.bind(zl(e)),e}return Ll(n,[{key:"init",value:function(e){this.app=e,window.addEventListener("resize",this.resize),this.resize()}},{key:"deinit",value:function(){window.removeEventListener("resize",this.resize)}},{key:"resize",value:function(){var e=this.app,t=e.scene,n=e.camera,r=e.renderer,i=r.domElement.parentElement,a=1,o=1;i&&(o=i.clientWidth,a=i.clientHeight),n.aspect=o/a,n.updateProjectionMatrix(),r.setSize(o,a),r.render(t,n)}}]),n}();Cl(Gb,"displayName","resizeModule");var Vb=function(){Rl(r,Fb);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).subject=new Sb(Object.assign({},Sb.defaults,e)),t.app=null,t}return Ll(r,[{key:"init",value:function(e){this.app=e,this.app.scene.add(this.subject.object)}},{key:"deinit",value:function(){this.app.scene.remove(this.subject.object),this.subject.destroy()}},{key:"reset",value:function(){this.subject.reset(),this.subject.render()}},{key:"update",value:function(e){this.subject.simulate(e),this.subject.render()}}]),r}();Cl(Vb,"displayName","flagGroupModule");var Wb=function(){Rl(i,Fb);var r=Ul(i);function i(e,t){var n;return Tl(this,i),(n=r.call(this)).updateFn=e,n.onNeedsUpdate=t||function(){},n.needsUpdate=!1,n}return Ll(i,[{key:"update",value:function(e){this.needsUpdate&&(this.onNeedsUpdate(),this.needsUpdate=!1),this.updateFn(e)}}]),i}();Cl(Wb,"displayName","processModule");var jb=function(){Rl(r,Fb);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).subject=new Eb(Object.assign({},Eb.defaults,e)),t}return Ll(r,[{key:"update",value:function(e){this.subject.update(e)}}]),r}();function qb(e){return new gb(function(e){var t=Object.assign({},e);return rb(t.width)||(t.width=gb.defaults.width),rb(t.height)||(t.height=gb.defaults.height),t}(e))}Cl(jb,"displayName","windModule");var Xb={width:"auto",height:"auto",hoisting:Yl.DEXTER,orientation:Zl.TOP};function Yb(e,t){var n={width:t.width,height:t.height};return e&&(n=function(e,t){if("auto"!==t.width||"auto"!==t.height)return"auto"===t.width&&rb(t.height)?{width:t.height*e.width/e.height,height:t.height}:rb(t.width)&&"auto"===t.height?{width:t.width,height:t.width*e.height/e.width}:{width:t.width,height:t.height};var n=gb.defaults.height;return e.width<e.height?{width:n,height:n*e.height/e.width}:{width:n*e.width/e.height,height:n}}(e,n)),rb(n.width)&&rb(n.height)?n:{width:gb.defaults.width,height:gb.defaults.height}}function Zb(e){var t={};return t.reflect=e.hoisting===Yl.SINISTER,t.rotate=function(e){switch(e){case Zl.TOP:return 0;case Zl.LEFT:return-Math.PI/2;case Zl.BOTTOM:return Math.PI;case Zl.RIGHT:return Math.PI/2;default:return 0}}(e.orientation),t}function Jb(e,t){var n=Object.assign({},t);return function(e){return e.orientation===Zl.LEFT||e.orientation===Zl.RIGHT}(t)&&(n.width=t.height,n.height=t.width),e&&(n.texture=function(e,t){var n=new Qf(e);if(n.matrixAutoUpdate=!1,ib(t)){var r=n.matrix;r.scale(1,1),t.reflect&&r.translate(-1,0).scale(-1,1),rb(t.rotate)&&r.translate(-.5,-.5).rotate(-t.rotate).translate(.5,.5)}return n}(e,Zb(t))),n}var $b=new Ny;function Qb(n,r){return new Promise(function(t,e){!function(t,e,n){$b.load(t,e,null,function(e){console.error("FlagWaver.loadImage: Failed to load image from ".concat(t,".")),n&&n(e)})}(n,function(e){t(function(e,t){var n=Object.assign({},Xb,t);return Object.assign(n,Yb(e,n)),new gb(Jb(e,n))}(e,r))},function(){e(qb(r))})})}$b.setCrossOrigin("anonymous");var Kb=function(){Rl(i,_b);var r=Ul(i);function i(e){var t;Tl(this,i),t=r.call(this,e);var n=Object.assign({},t.constructor.defaults,e);return t.top.set(0,2*n.poleLength/3,0),t}return Ll(i,[{key:"buildGeometry",value:function(e){var t=xb(e);return t.translate(0,5*-e.poleLength/3,0),t.rotateZ(Math.PI),t}},{key:"addFlag",value:function(e){e.unpin(),e.pin({edges:[Zl.LEFT]}),e.setLengthConstraints(Zl.LEFT),e.object.position.add(this.top),e.object.translateY(e.cloth.height)}}]),i}();var ex=Object.getOwnPropertySymbols,tx=Object.prototype.hasOwnProperty,nx=Object.prototype.propertyIsEnumerable;var rx=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var o in n=Object(arguments[a]))tx.call(n,o)&&(i[o]=n[o]);if(ex){r=ex(n);for(var s=0;s<r.length;s++)nx.call(n,r[s])&&(i[r[s]]=n[r[s]])}}return i},ix=s(function(e,t){var c=60103,u=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var n=60109,r=60110,i=60112;t.Suspense=60113;var a=60115,o=60116;if("function"==typeof Symbol&&Symbol.for){var s=Symbol.for;c=s("react.element"),u=s("react.portal"),t.Fragment=s("react.fragment"),t.StrictMode=s("react.strict_mode"),t.Profiler=s("react.profiler"),n=s("react.provider"),r=s("react.context"),i=s("react.forward_ref"),t.Suspense=s("react.suspense"),a=s("react.memo"),o=s("react.lazy")}var f="function"==typeof Symbol&&Symbol.iterator;function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h={};function p(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||l}function v(){}function m(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||l}p.prototype.isReactComponent={},p.prototype.setState=function(e,t){if("object"!==Sl(e)&&"function"!=typeof e&&null!=e)throw Error(d(85));this.updater.enqueueSetState(this,e,t,"setState")},p.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=p.prototype;var g=m.prototype=new v;g.constructor=m,rx(g,p.prototype),g.isPureReactComponent=!0;var y={current:null},b=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function w(e,t,n){var r,i={},a=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(a=""+t.key),t)b.call(t,r)&&!x.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(1===s)i.children=n;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===i[r]&&(i[r]=s[r]);return{$$typeof:c,type:e,key:a,ref:o,props:i,_owner:y.current}}function _(e){return"object"===Sl(e)&&null!==e&&e.$$typeof===c}var S=/\/+/g;function M(e,t){return"object"===Sl(e)&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function E(e,t,n,r,i){var a=Sl(e);"undefined"!==a&&"boolean"!==a||(e=null);var o=!1;if(null===e)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case c:case u:o=!0}}if(o)return i=i(o=e),e=""===r?"."+M(o,0):r,Array.isArray(i)?(n="",null!=e&&(n=e.replace(S,"$&/")+"/"),E(i,t,n,"",function(e){return e})):null!=i&&(_(i)&&(i=function(e,t){return{$$typeof:c,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(S,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=""===r?".":r+":",Array.isArray(e))for(var s=0;s<e.length;s++){var l=r+M(a=e[s],s);o+=E(a,t,n,l,i)}else if("function"==typeof(l=function(e){return null===e||"object"!==Sl(e)?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e)))for(e=l.call(e),s=0;!(a=e.next()).done;)o+=E(a=a.value,t,n,l=r+M(a,s++),i);else if("object"===a)throw t=""+e,Error(d(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return o}function T(e,t,n){if(null==e)return e;var r=[],i=0;return E(e,r,"","",function(e){return t.call(n,e,i++)}),r}function k(t){if(-1===t._status){var e=t._result;e=e(),t._status=0,(t._result=e).then(function(e){0===t._status&&(e=e.default,t._status=1,t._result=e)},function(e){0===t._status&&(t._status=2,t._result=e)})}if(1===t._status)return t._result;throw t._result}var L={current:null};function C(){var e=L.current;if(null===e)throw Error(d(321));return e}var R={ReactCurrentDispatcher:L,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:y,IsSomeRendererActing:{current:!1},assign:rx};t.Children={map:T,forEach:function(e,t,n){T(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!_(e))throw Error(d(143));return e}},t.Component=p,t.PureComponent=m,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.cloneElement=function(e,t,n){if(null==e)throw Error(d(267,e));var r=rx({},e.props),i=e.key,a=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,o=y.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)b.call(t,l)&&!x.hasOwnProperty(l)&&(r[l]=void 0===t[l]&&void 0!==s?s[l]:t[l])}var l=arguments.length-2;if(1===l)r.children=n;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:c,type:e.type,key:i,ref:a,props:r,_owner:o}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:r,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:n,_context:e},e.Consumer=e},t.createElement=w,t.createFactory=function(e){var t=w.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:i,render:e}},t.isValidElement=_,t.lazy=function(e){return{$$typeof:o,_payload:{_status:-1,_result:e},_init:k}},t.memo=function(e,t){return{$$typeof:a,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return C().useCallback(e,t)},t.useContext=function(e,t){return C().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return C().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return C().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return C().useLayoutEffect(e,t)},t.useMemo=function(e,t){return C().useMemo(e,t)},t.useReducer=function(e,t,n){return C().useReducer(e,t,n)},t.useRef=function(e){return C().useRef(e)},t.useState=function(e){return C().useState(e)},t.version="17.0.2"});ix.Fragment,ix.StrictMode,ix.Profiler,ix.Suspense,ix.Children,ix.Component,ix.PureComponent,ix.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ix.cloneElement,ix.createContext,ix.createElement,ix.createFactory,ix.createRef,ix.forwardRef,ix.isValidElement,ix.lazy,ix.memo,ix.useCallback,ix.useContext,ix.useDebugValue,ix.useEffect,ix.useImperativeHandle,ix.useLayoutEffect,ix.useMemo,ix.useReducer,ix.useRef,ix.useState,ix.version;var ax=s(function(e,t){});ax.Fragment,ax.StrictMode,ax.Profiler,ax.Suspense,ax.Children,ax.Component,ax.PureComponent,ax.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ax.cloneElement,ax.createContext,ax.createElement,ax.createFactory,ax.createRef,ax.forwardRef,ax.isValidElement,ax.lazy,ax.memo,ax.useCallback,ax.useContext,ax.useDebugValue,ax.useEffect,ax.useImperativeHandle,ax.useLayoutEffect,ax.useMemo,ax.useReducer,ax.useRef,ax.useState,ax.version;var ox=s(function(e){e.exports=ix}),sx=ox.Children;ox.createRef;var lx=ox.Component;ox.PureComponent;var ux=ox.createContext,cx=ox.forwardRef;ox.lazy,ox.memo;var fx=ox.useCallback,dx=ox.useContext,hx=ox.useEffect;ox.useImperativeHandle,ox.useDebugValue;var px=ox.useLayoutEffect,vx=ox.useMemo,mx=ox.useReducer,gx=ox.useRef,yx=ox.useState,bx=ox.Fragment;ox.StrictMode,ox.Suspense;var xx=ox.createElement,wx=ox.cloneElement;ox.createFactory,ox.isValidElement,ox.version,ox.unstable_ConcurrentMode,ox.unstable_Profiler;var _x=s(function(e,s){var a,l,u,t;if("object"===("undefined"==typeof performance?"undefined":Sl(performance))&&"function"==typeof performance.now){var n=performance;s.unstable_now=function(){return n.now()}}else{var r=Date,i=r.now();s.unstable_now=function(){return r.now()-i}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var o=null,c=null,f=function t(){if(null!==o)try{var e=s.unstable_now();o(!0,e),o=null}catch(e){throw setTimeout(t,0),e}};a=function(e){null!==o?setTimeout(a,0,e):(o=e,setTimeout(f,0))},l=function(e,t){c=setTimeout(e,t)},u=function(){clearTimeout(c)},s.unstable_shouldYield=function(){return!1},t=s.unstable_forceFrameRate=function(){}}else{var d=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var v=!1,m=null,g=-1,y=5,b=0;s.unstable_shouldYield=function(){return s.unstable_now()>=b},t=function(){},s.unstable_forceFrameRate=function(e){e<0||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,w=x.port2;x.port1.onmessage=function(){if(null!==m){var e=s.unstable_now();b=e+y;try{m(!0,e)?w.postMessage(null):(v=!1,m=null)}catch(e){throw w.postMessage(null),e}}else v=!1},a=function(e){m=e,v||(v=!0,w.postMessage(null))},l=function(e,t){g=d(function(){e(s.unstable_now())},t)},u=function(){h(g),g=-1}}function _(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<E(i,t)))break e;e[r]=t,e[n]=i,n=r}}function S(e){return void 0===(e=e[0])?null:e}function M(e){var t=e[0];if(void 0===t)return null;var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var a=2*(r+1)-1,o=e[a],s=1+a,l=e[s];if(void 0!==o&&E(o,n)<0)r=void 0!==l&&E(l,o)<0?(e[r]=l,e[s]=n,s):(e[r]=o,e[a]=n,a);else{if(!(void 0!==l&&E(l,n)<0))break e;e[r]=l,e[s]=n,r=s}}}return t}function E(e,t){var n=e.sortIndex-t.sortIndex;return 0!=n?n:e.id-t.id}var T=[],k=[],L=1,C=null,R=3,P=!1,A=!1,O=!1;function N(e){for(var t=S(k);null!==t;){if(null===t.callback)M(k);else{if(!(t.startTime<=e))break;M(k),t.sortIndex=t.expirationTime,_(T,t)}t=S(k)}}function D(e){if(O=!1,N(e),!A)if(null!==S(T))A=!0,a(I);else{var t=S(k);null!==t&&l(D,t.startTime-e)}}function I(e,t){A=!1,O&&(O=!1,u()),P=!0;var n=R;try{for(N(t),C=S(T);null!==C&&(!(C.expirationTime>t)||e&&!s.unstable_shouldYield());){var r=C.callback;if("function"==typeof r){C.callback=null,R=C.priorityLevel;var i=r(C.expirationTime<=t);t=s.unstable_now(),"function"==typeof i?C.callback=i:C===S(T)&&M(T),N(t)}else M(T);C=S(T)}if(null!==C)var a=!0;else{var o=S(k);null!==o&&l(D,o.startTime-t),a=!1}return a}finally{C=null,R=n,P=!1}}var z=t;s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(e){e.callback=null},s.unstable_continueExecution=function(){A||P||(A=!0,a(I))},s.unstable_getCurrentPriorityLevel=function(){return R},s.unstable_getFirstCallbackNode=function(){return S(T)},s.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=z,s.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},s.unstable_scheduleCallback=function(e,t,n){var r=s.unstable_now();switch(n="object"===Sl(n)&&null!==n?"number"==typeof(n=n.delay)&&0<n?r+n:r:r,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return e={id:L++,callback:t,priorityLevel:e,startTime:n,expirationTime:i=n+i,sortIndex:-1},r<n?(e.sortIndex=n,_(k,e),null===S(T)&&e===S(k)&&(O?u():O=!0,l(D,n-r))):(e.sortIndex=i,_(T,e),A||P||(A=!0,a(I))),e},s.unstable_wrapCallback=function(t){var n=R;return function(){var e=R;R=n;try{return t.apply(this,arguments)}finally{R=e}}}});_x.unstable_now,_x.unstable_shouldYield,_x.unstable_forceFrameRate,_x.unstable_IdlePriority,_x.unstable_ImmediatePriority,_x.unstable_LowPriority,_x.unstable_NormalPriority,_x.unstable_Profiling,_x.unstable_UserBlockingPriority,_x.unstable_cancelCallback,_x.unstable_continueExecution,_x.unstable_getCurrentPriorityLevel,_x.unstable_getFirstCallbackNode,_x.unstable_next,_x.unstable_pauseExecution,_x.unstable_requestPaint,_x.unstable_runWithPriority,_x.unstable_scheduleCallback,_x.unstable_wrapCallback;var Sx=s(function(e,t){});Sx.unstable_now,Sx.unstable_shouldYield,Sx.unstable_forceFrameRate,Sx.unstable_IdlePriority,Sx.unstable_ImmediatePriority,Sx.unstable_LowPriority,Sx.unstable_NormalPriority,Sx.unstable_Profiling,Sx.unstable_UserBlockingPriority,Sx.unstable_cancelCallback,Sx.unstable_continueExecution,Sx.unstable_getCurrentPriorityLevel,Sx.unstable_getFirstCallbackNode,Sx.unstable_next,Sx.unstable_pauseExecution,Sx.unstable_requestPaint,Sx.unstable_runWithPriority,Sx.unstable_scheduleCallback,Sx.unstable_wrapCallback;var Mx=s(function(e){e.exports=_x});function Ex(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!ox)throw Error(Ex(227));var Tx=new Set,kx={};function Lx(e,t){Cx(e,t),Cx(e+"Capture",t)}function Cx(e,t){for(kx[e]=t,e=0;e<t.length;e++)Tx.add(t[e])}var Rx=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Px=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ax=Object.prototype.hasOwnProperty,Ox={},Nx={};function Dx(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(Sl(t)){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||t<1}return!1}function Ix(e,t,n,r,i,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var zx={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){zx[e]=new Ix(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];zx[t]=new Ix(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){zx[e]=new Ix(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){zx[e]=new Ix(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){zx[e]=new Ix(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){zx[e]=new Ix(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){zx[e]=new Ix(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){zx[e]=new Ix(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){zx[e]=new Ix(e,5,!1,e.toLowerCase(),null,!1,!1)});var Fx=/[\-:]([a-z])/g;function Ux(e){return e[1].toUpperCase()}function Bx(e,t,n,r){var i=zx.hasOwnProperty(t)?zx[t]:null;(null!==i?0!==i.type:r||(!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1]))&&(Dx(t,n,i,r)&&(n=null),r||null===i?function(e){return!!Ax.call(Nx,e)||!Ax.call(Ox,e)&&(Px.test(e)?Nx[e]=!0:!(Ox[e]=!0))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Fx,Ux);zx[t]=new Ix(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Fx,Ux);zx[t]=new Ix(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Fx,Ux);zx[t]=new Ix(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){zx[e]=new Ix(e,1,!1,e.toLowerCase(),null,!1,!1)}),zx.xlinkHref=new Ix("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){zx[e]=new Ix(e,1,!1,e.toLowerCase(),null,!0,!0)});var Hx=ox.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Gx=60103,Vx=60106,Wx=60107,jx=60108,qx=60114,Xx=60109,Yx=60110,Zx=60112,Jx=60113,$x=60120,Qx=60115,Kx=60116,ew=60121,tw=60128,nw=60129,rw=60130,iw=60131;if("function"==typeof Symbol&&Symbol.for){var aw=Symbol.for;Gx=aw("react.element"),Vx=aw("react.portal"),Wx=aw("react.fragment"),jx=aw("react.strict_mode"),qx=aw("react.profiler"),Xx=aw("react.provider"),Yx=aw("react.context"),Zx=aw("react.forward_ref"),Jx=aw("react.suspense"),$x=aw("react.suspense_list"),Qx=aw("react.memo"),Kx=aw("react.lazy"),ew=aw("react.block"),aw("react.scope"),tw=aw("react.opaque.id"),nw=aw("react.debug_trace_mode"),rw=aw("react.offscreen"),iw=aw("react.legacy_hidden")}var ow,sw="function"==typeof Symbol&&Symbol.iterator;function lw(e){return null===e||"object"!==Sl(e)?null:"function"==typeof(e=sw&&e[sw]||e["@@iterator"])?e:null}function uw(e){if(void 0===ow)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ow=t&&t[1]||""}return"\n"+ow+e}var cw=!1;function fw(e,t){if(!e||cw)return"";cw=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===("undefined"==typeof Reflect?"undefined":Sl(Reflect))&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,--s<0||i[o]!==a[s])return"\n"+i[o].replace(" at new "," at ")}while(1<=o&&0<=s);break}}}finally{cw=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?uw(e):""}function dw(e){switch(e.tag){case 5:return uw(e.type);case 16:return uw("Lazy");case 13:return uw("Suspense");case 19:return uw("SuspenseList");case 0:case 2:case 15:return e=fw(e.type,!1);case 11:return e=fw(e.type.render,!1);case 22:return e=fw(e.type._render,!1);case 1:return e=fw(e.type,!0);default:return""}}function hw(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case Wx:return"Fragment";case Vx:return"Portal";case qx:return"Profiler";case jx:return"StrictMode";case Jx:return"Suspense";case $x:return"SuspenseList"}if("object"===Sl(e))switch(e.$$typeof){case Yx:return(e.displayName||"Context")+".Consumer";case Xx:return(e._context.displayName||"Context")+".Provider";case Zx:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case Qx:return hw(e.type);case ew:return hw(e._render);case Kx:t=e._payload,e=e._init;try{return hw(e(t))}catch(e){}}return null}function pw(e){switch(Sl(e)){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function vw(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function mw(e){e._valueTracker||(e._valueTracker=function(e){var t=vw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function gw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vw(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function yw(t){if(void 0===(t=t||("undefined"!=typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}function bw(e,t){var n=t.checked;return rx({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function xw(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=pw(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function ww(e,t){null!=(t=t.checked)&&Bx(e,"checked",t,!1)}function _w(e,t){ww(e,t);var n=pw(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Mw(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mw(e,t.type,pw(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Sw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Mw(e,t,n){"number"===t&&yw(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Ew(e,t){return e=rx({children:void 0},t),(t=function(e){var t="";return ox.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function Tw(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+pw(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function kw(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(Ex(91));return rx({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Lw(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(Ex(92));if(Array.isArray(n)){if(!(n.length<=1))throw Error(Ex(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:pw(n)}}function Cw(e,t){var n=pw(t.value),r=pw(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Rw(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Pw={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Aw(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ow(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Aw(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Nw,Dw,Iw=(Dw=function(e,t){if(e.namespaceURI!==Pw.svg||"innerHTML"in e)e.innerHTML=t;else{for((Nw=Nw||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Nw.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Dw(e,t)})}:Dw);function zw(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Fw={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Uw=["Webkit","ms","Moz","O"];function Bw(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Fw.hasOwnProperty(e)&&Fw[e]?(""+t).trim():t+"px"}function Hw(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=Bw(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(Fw).forEach(function(t){Uw.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Fw[e]=Fw[t]})});var Gw=rx({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vw(e,t){if(t){if(Gw[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(Ex(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(Ex(60));if(!("object"===Sl(t.dangerouslySetInnerHTML)&&"__html"in t.dangerouslySetInnerHTML))throw Error(Ex(61))}if(null!=t.style&&"object"!==Sl(t.style))throw Error(Ex(62))}}function Ww(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function jw(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var qw=null,Xw=null,Yw=null;function Zw(e){if(e=mE(e)){if("function"!=typeof qw)throw Error(Ex(280));var t=e.stateNode;t&&(t=yE(t),qw(e.stateNode,e.type,t))}}function Jw(e){Xw?Yw?Yw.push(e):Yw=[e]:Xw=e}function $w(){if(Xw){var e=Xw,t=Yw;if(Yw=Xw=null,Zw(e),t)for(e=0;e<t.length;e++)Zw(t[e])}}function Qw(e,t){return e(t)}function Kw(e,t,n,r,i){return e(t,n,r,i)}function e_(){}var t_=Qw,n_=!1,r_=!1;function i_(){null===Xw&&null===Yw||(e_(),$w())}function a_(e,t){var n=e.stateNode;if(null===n)return null;var r=yE(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(Ex(231,t,Sl(n)));return n}var o_=!1;if(Rx)try{var s_={};Object.defineProperty(s_,"passive",{get:function(){o_=!0}}),window.addEventListener("test",s_,s_),window.removeEventListener("test",s_,s_)}catch(e){o_=!1}var l_=!1,u_=null,c_=!1,f_=null,d_={onError:function(e){l_=!0,u_=e}};function h_(e,t,n,r,i,a,o,s,l){l_=!1,u_=null,function(e,t,n,r,i,a,o,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}.apply(d_,arguments)}function p_(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else for(e=t;0!=(1026&(t=e).flags)&&(n=t.return),e=t.return;);return 3===t.tag?n:null}function v_(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function m_(e){if(p_(e)!==e)throw Error(Ex(188))}function g_(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=p_(e)))throw Error(Ex(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null!==a){if(i.child===a.child){for(a=i.child;a;){if(a===n)return m_(i),e;if(a===r)return m_(i),t;a=a.sibling}throw Error(Ex(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,s=i.child;s;){if(s===n){o=!0,n=i,r=a;break}if(s===r){o=!0,r=i,n=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===n){o=!0,n=a,r=i;break}if(s===r){o=!0,r=a,n=i;break}s=s.sibling}if(!o)throw Error(Ex(189))}}if(n.alternate!==r)throw Error(Ex(190))}else{if(null===(r=i.return))break;n=r}}if(3!==n.tag)throw Error(Ex(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t=(t.child.return=t).child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function y_(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var b_,x_,w_,__,S_=!1,M_=[],E_=null,T_=null,k_=null,L_=new Map,C_=new Map,R_=[],P_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function A_(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function O_(e,t){switch(e){case"focusin":case"focusout":E_=null;break;case"dragenter":case"dragleave":T_=null;break;case"mouseover":case"mouseout":k_=null;break;case"pointerover":case"pointerout":L_.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":C_.delete(t.pointerId)}}function N_(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e=A_(t,n,r,i,a),null===t||null!==(t=mE(t))&&x_(t)):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i)),e}function D_(e){var t=vE(e.target);if(null!==t){var n=p_(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=v_(n)))return e.blockedOn=t,void __(e.lanePriority,function(){Mx.unstable_runWithPriority(e.priority,function(){w_(n)})})}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function I_(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=gS(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=mE(n))&&x_(t),e.blockedOn=n,!1;t.shift()}return!0}function z_(e,t,n){I_(e)&&n.delete(t)}function F_(){for(S_=!1;0<M_.length;){var e=M_[0];if(null!==e.blockedOn){null!==(e=mE(e.blockedOn))&&b_(e);break}for(var t=e.targetContainers;0<t.length;){var n=gS(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&M_.shift()}null!==E_&&I_(E_)&&(E_=null),null!==T_&&I_(T_)&&(T_=null),null!==k_&&I_(k_)&&(k_=null),L_.forEach(z_),C_.forEach(z_)}function U_(e,t){e.blockedOn===t&&(e.blockedOn=null,S_||(S_=!0,Mx.unstable_scheduleCallback(Mx.unstable_NormalPriority,F_)))}function B_(t){function e(e){return U_(e,t)}if(0<M_.length){U_(M_[0],t);for(var n=1;n<M_.length;n++){var r=M_[n];r.blockedOn===t&&(r.blockedOn=null)}}for(null!==E_&&U_(E_,t),null!==T_&&U_(T_,t),null!==k_&&U_(k_,t),L_.forEach(e),C_.forEach(e),n=0;n<R_.length;n++)(r=R_[n]).blockedOn===t&&(r.blockedOn=null);for(;0<R_.length&&null===(n=R_[0]).blockedOn;)D_(n),null===n.blockedOn&&R_.shift()}function H_(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var G_={animationend:H_("Animation","AnimationEnd"),animationiteration:H_("Animation","AnimationIteration"),animationstart:H_("Animation","AnimationStart"),transitionend:H_("Transition","TransitionEnd")},V_={},W_={};function j_(e){if(V_[e])return V_[e];if(!G_[e])return e;var t,n=G_[e];for(t in n)if(n.hasOwnProperty(t)&&t in W_)return V_[e]=n[t];return e}Rx&&(W_=document.createElement("div").style,"AnimationEvent"in window||(delete G_.animationend.animation,delete G_.animationiteration.animation,delete G_.animationstart.animation),"TransitionEvent"in window||delete G_.transitionend.transition);var q_=j_("animationend"),X_=j_("animationiteration"),Y_=j_("animationstart"),Z_=j_("transitionend"),J_=new Map,$_=new Map,Q_=["abort","abort",q_,"animationEnd",X_,"animationIteration",Y_,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Z_,"transitionEnd","waiting","waiting"];function K_(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),$_.set(r,t),J_.set(r,i),Lx(i,[r])}}(0,Mx.unstable_now)();var eS=8;function tS(e){if(0!=(1&e))return eS=15,1;if(0!=(2&e))return eS=14,2;if(0!=(4&e))return eS=13,4;var t=24&e;return 0!==t?(eS=12,t):0!=(32&e)?(eS=11,32):0!==(t=192&e)?(eS=10,t):0!=(256&e)?(eS=9,256):0!==(t=3584&e)?(eS=8,t):0!=(4096&e)?(eS=7,4096):0!==(t=4186112&e)?(eS=6,t):0!==(t=62914560&e)?(eS=5,t):67108864&e?(eS=4,67108864):0!=(134217728&e)?(eS=3,134217728):0!==(t=805306368&e)?(eS=2,t):0!=(1073741824&e)?(eS=1,1073741824):(eS=8,e)}function nS(e,t){var n=e.pendingLanes;if(0===n)return eS=0;var r=0,i=0,a=e.expiredLanes,o=e.suspendedLanes,s=e.pingedLanes;if(0!==a)r=a,i=eS=15;else if(0!==(a=134217727&n)){var l=a&~o;0!=l?(r=tS(l),i=eS):0!==(s&=a)&&(r=tS(s),i=eS)}else 0!==(a=n&~o)?(r=tS(a),i=eS):0!==s&&(r=tS(s),i=eS);if(0===r)return 0;if(r=n&(((r=31-lS(r))<0?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&o)){if(tS(t),i<=eS)return t;eS=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-lS(t)),r|=e[n],t&=~i;return r}function rS(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function iS(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=aS(24&~t))?iS(10,t):e;case 10:return 0===(e=aS(192&~t))?iS(8,t):e;case 8:return 0===(e=aS(3584&~t))&&(0===(e=aS(4186112&~t))&&(e=512)),e;case 2:return 0===(t=aS(805306368&~t))&&(t=268435456),t}throw Error(Ex(358,e))}function aS(e){return e&-e}function oS(e){for(var t=[],n=0;n<31;n++)t.push(e);return t}function sS(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-lS(t)]=n}var lS=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(uS(e)/cS|0)|0},uS=Math.log,cS=Math.LN2;var fS=Mx.unstable_UserBlockingPriority,dS=Mx.unstable_runWithPriority,hS=!0;function pS(e,t,n,r){n_||e_();var i=mS,a=n_;n_=!0;try{Kw(i,e,t,n,r)}finally{(n_=a)||i_()}}function vS(e,t,n,r){dS(fS,mS.bind(null,e,t,n,r))}function mS(e,t,n,r){var i;if(hS)if((i=0==(4&t))&&0<M_.length&&-1<P_.indexOf(e))e=A_(null,e,t,n,r),M_.push(e);else{var a=gS(e,t,n,r);if(null===a)i&&O_(e,r);else{if(i){if(-1<P_.indexOf(e))return e=A_(a,e,t,n,r),void M_.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return E_=N_(E_,e,t,n,r,i),!0;case"dragenter":return T_=N_(T_,e,t,n,r,i),!0;case"mouseover":return k_=N_(k_,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return L_.set(a,N_(L_.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,C_.set(a,N_(C_.get(a)||null,e,t,n,r,i)),!0}return!1}(a,e,t,n,r))return;O_(e,r)}YM(e,t,r,null,n)}}}function gS(e,t,n,r){var i=jw(r);if(null!==(i=vE(i))){var a=p_(i);if(null===a)i=null;else{var o=a.tag;if(13===o){if(null!==(i=v_(a)))return i;i=null}else if(3===o){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return YM(e,t,r,i,n),null}var yS=null,bS=null,xS=null;function wS(){if(xS)return xS;var e,t,n=bS,r=n.length,i="value"in yS?yS.value:yS.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return xS=i.slice(e,1<t?1-t:void 0)}function _S(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function SS(){return!0}function MS(){return!1}function ES(o){function e(e,t,n,r,i){for(var a in this._reactName=e,this._targetInst=n,this.type=t,this.nativeEvent=r,this.target=i,this.currentTarget=null,o)o.hasOwnProperty(a)&&(e=o[a],this[a]=e?e(r):r[a]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?SS:MS,this.isPropagationStopped=MS,this}return rx(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=SS)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=SS)},persist:function(){},isPersistent:SS}),e}var TS,kS,LS,CS={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},RS=ES(CS),PS=rx({},CS,{view:0,detail:0}),AS=ES(PS),OS=rx({},PS,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:WS,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==LS&&(kS=LS&&"mousemove"===e.type?(TS=e.screenX-LS.screenX,e.screenY-LS.screenY):TS=0,LS=e),TS)},movementY:function(e){return"movementY"in e?e.movementY:kS}}),NS=ES(OS),DS=ES(rx({},OS,{dataTransfer:0})),IS=ES(rx({},PS,{relatedTarget:0})),zS=ES(rx({},CS,{animationName:0,elapsedTime:0,pseudoElement:0})),FS=ES(rx({},CS,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),US=ES(rx({},CS,{data:0})),BS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},GS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=GS[e])&&!!t[e]}function WS(){return VS}var jS=ES(rx({},PS,{key:function(e){if(e.key){var t=BS[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=_S(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?HS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:WS,charCode:function(e){return"keypress"===e.type?_S(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?_S(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),qS=ES(rx({},OS,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),XS=ES(rx({},PS,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:WS})),YS=ES(rx({},CS,{propertyName:0,elapsedTime:0,pseudoElement:0})),ZS=ES(rx({},OS,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),JS=[9,13,27,32],$S=Rx&&"CompositionEvent"in window,QS=null;Rx&&"documentMode"in document&&(QS=document.documentMode);var KS=Rx&&"TextEvent"in window&&!QS,eM=Rx&&(!$S||QS&&8<QS&&QS<=11),tM=String.fromCharCode(32),nM=!1;function rM(e,t){switch(e){case"keyup":return-1!==JS.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iM(e){return"object"===Sl(e=e.detail)&&"data"in e?e.data:null}var aM=!1;var oM={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sM(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!oM[e.type]:"textarea"===t}function lM(e,t,n,r){Jw(r),0<(t=JM(t,"onChange")).length&&(n=new RS("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var uM=null,cM=null;function fM(e){GM(e,0)}function dM(e){if(gw(gE(e)))return e}function hM(e,t){if("change"===e)return t}var pM=!1;if(Rx){var vM;if(Rx){var mM="oninput"in document;if(!mM){var gM=document.createElement("div");gM.setAttribute("oninput","return;"),mM="function"==typeof gM.oninput}vM=mM}else vM=!1;pM=vM&&(!document.documentMode||9<document.documentMode)}function yM(){uM&&(uM.detachEvent("onpropertychange",bM),cM=uM=null)}function bM(e){if("value"===e.propertyName&&dM(cM)){var t=[];if(lM(t,cM,e,jw(e)),e=fM,n_)e(t);else{n_=!0;try{Qw(e,t)}finally{n_=!1,i_()}}}}function xM(e,t,n){"focusin"===e?(yM(),cM=n,(uM=t).attachEvent("onpropertychange",bM)):"focusout"===e&&yM()}function wM(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return dM(cM)}function _M(e,t){if("click"===e)return dM(t)}function SM(e,t){if("input"===e||"change"===e)return dM(t)}var MM="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},EM=Object.prototype.hasOwnProperty;function TM(e,t){if(MM(e,t))return!0;if("object"!==Sl(e)||null===e||"object"!==Sl(t)||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!EM.call(t,n[r])||!MM(e[n[r]],t[n[r]]))return!1;return!0}function kM(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function LM(e,t){var n,r=kM(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&t<=n)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=kM(r)}}function CM(){for(var e=window,t=yw();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=yw((e=t.contentWindow).document)}return t}function RM(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var PM=Rx&&"documentMode"in document&&document.documentMode<=11,AM=null,OM=null,NM=null,DM=!1;function IM(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;DM||null==AM||AM!==yw(r)||(r="selectionStart"in(r=AM)&&RM(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},NM&&TM(NM,r)||(NM=r,0<(r=JM(OM,"onSelect")).length&&(t=new RS("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=AM)))}K_("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),K_("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),K_(Q_,2);for(var zM="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),FM=0;FM<zM.length;FM++)$_.set(zM[FM],0);Cx("onMouseEnter",["mouseout","mouseover"]),Cx("onMouseLeave",["mouseout","mouseover"]),Cx("onPointerEnter",["pointerout","pointerover"]),Cx("onPointerLeave",["pointerout","pointerover"]),Lx("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Lx("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Lx("onBeforeInput",["compositionend","keypress","textInput","paste"]),Lx("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Lx("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Lx("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var UM="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),BM=new Set("cancel close invalid load scroll toggle".split(" ").concat(UM));function HM(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,a,o,s,l){if(h_.apply(this,arguments),l_){if(!l_)throw Error(Ex(198));var u=u_;l_=!1,u_=null,c_||(c_=!0,f_=u)}}(r,t,void 0,e),e.currentTarget=null}function GM(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;HM(i,s,u),a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,u=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;HM(i,s,u),a=l}}}if(c_)throw e=f_,c_=!1,f_=null,e}function VM(e,t){var n=bE(t),r=e+"__bubble";n.has(r)||(XM(t,e,2,!1),n.add(r))}var WM="_reactListening"+Math.random().toString(36).slice(2);function jM(t){t[WM]||(t[WM]=!0,Tx.forEach(function(e){BM.has(e)||qM(e,!1,t,null),qM(e,!0,t,null)}))}function qM(e,t,n,r,i){var a=4<arguments.length&&void 0!==i?i:0,o=n;if("selectionchange"===e&&9!==n.nodeType&&(o=n.ownerDocument),null!==r&&!t&&BM.has(e)){if("scroll"!==e)return;a|=2,o=r}var s=bE(o),l=e+"__"+(t?"capture":"bubble");s.has(l)||(t&&(a|=4),XM(o,e,a,t),s.add(l))}function XM(e,t,n,r){var i=$_.get(t);switch(void 0===i?2:i){case 0:i=pS;break;case 1:i=vS;break;default:i=mS}n=i.bind(null,t,n,e),i=void 0,!o_||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function YM(m,g,y,e,t){var b=e;if(0==(1&g)&&0==(2&g)&&null!==e)e:for(;;){if(null===e)return;var n=e.tag;if(3===n||4===n){var r=e.stateNode.containerInfo;if(r===t||8===r.nodeType&&r.parentNode===t)break;if(4===n)for(n=e.return;null!==n;){var i=n.tag;if((3===i||4===i)&&((i=n.stateNode.containerInfo)===t||8===i.nodeType&&i.parentNode===t))return;n=n.return}for(;null!==r;){if(null===(n=vE(r)))return;if(5===(i=n.tag)||6===i){e=b=n;continue e}r=r.parentNode}}e=e.return}!function(e,t,n){if(r_)return e(t,n);r_=!0;try{t_(e,t,n)}finally{r_=!1,i_()}}(function(){var e=b,t=jw(y),n=[];e:{var r=J_.get(m);if(void 0!==r){var i=RS,a=m;switch(m){case"keypress":if(0===_S(y))break e;case"keydown":case"keyup":i=jS;break;case"focusin":a="focus",i=IS;break;case"focusout":a="blur",i=IS;break;case"beforeblur":case"afterblur":i=IS;break;case"click":if(2===y.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":i=NS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":i=DS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":i=XS;break;case q_:case X_:case Y_:i=zS;break;case Z_:i=YS;break;case"scroll":i=AS;break;case"wheel":i=ZS;break;case"copy":case"cut":case"paste":i=FS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":i=qS}var o=0!=(4&g),s=!o&&"scroll"===m,l=o?null!==r?r+"Capture":null:r;o=[];for(var u,c=e;null!==c;){var f=(u=c).stateNode;if(5===u.tag&&null!==f&&(u=f,null!==l&&(null!=(f=a_(c,l))&&o.push(ZM(c,f,u)))),s)break;c=c.return}0<o.length&&(r=new i(r,a,null,y,t),n.push({event:r,listeners:o}))}}if(0==(7&g)){if(i="mouseout"===m||"pointerout"===m,(!(r="mouseover"===m||"pointerover"===m)||0!=(16&g)||!(a=y.relatedTarget||y.fromElement)||!vE(a)&&!a[hE])&&(i||r)&&(r=t.window===t?t:(r=t.ownerDocument)?r.defaultView||r.parentWindow:window,i?(i=e,null!==(a=(a=y.relatedTarget||y.toElement)?vE(a):null)&&(a!==(s=p_(a))||5!==a.tag&&6!==a.tag)&&(a=null)):(i=null,a=e),i!==a)){if(o=NS,f="onMouseLeave",l="onMouseEnter",c="mouse","pointerout"!==m&&"pointerover"!==m||(o=qS,f="onPointerLeave",l="onPointerEnter",c="pointer"),s=null==i?r:gE(i),u=null==a?r:gE(a),(r=new o(f,c+"leave",i,y,t)).target=s,r.relatedTarget=u,f=null,vE(t)===e&&((o=new o(l,c+"enter",a,y,t)).target=u,o.relatedTarget=s,f=o),s=f,i&&a)e:{for(l=a,c=0,u=o=i;u;u=$M(u))c++;for(u=0,f=l;f;f=$M(f))u++;for(;0<c-u;)o=$M(o),c--;for(;0<u-c;)l=$M(l),u--;for(;c--;){if(o===l||null!==l&&o===l.alternate)break e;o=$M(o),l=$M(l)}o=null}else o=null;null!==i&&QM(n,r,i,o,!1),null!==a&&null!==s&&QM(n,s,a,o,!0)}if("select"===(i=(r=e?gE(e):window).nodeName&&r.nodeName.toLowerCase())||"input"===i&&"file"===r.type)var d=hM;else if(sM(r))if(pM)d=SM;else{d=wM;var h=xM}else!(i=r.nodeName)||"input"!==i.toLowerCase()||"checkbox"!==r.type&&"radio"!==r.type||(d=_M);switch(d&&(d=d(m,e))?lM(n,d,y,t):(h&&h(m,r,e),"focusout"===m&&(h=r._wrapperState)&&h.controlled&&"number"===r.type&&Mw(r,"number",r.value)),h=e?gE(e):window,m){case"focusin":!sM(h)&&"true"!==h.contentEditable||(AM=h,OM=e,NM=null);break;case"focusout":NM=OM=AM=null;break;case"mousedown":DM=!0;break;case"contextmenu":case"mouseup":case"dragend":DM=!1,IM(n,y,t);break;case"selectionchange":if(PM)break;case"keydown":case"keyup":IM(n,y,t)}var p;if($S)e:{switch(m){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else aM?rM(m,y)&&(v="onCompositionEnd"):"keydown"===m&&229===y.keyCode&&(v="onCompositionStart");v&&(eM&&"ko"!==y.locale&&(aM||"onCompositionStart"!==v?"onCompositionEnd"===v&&aM&&(p=wS()):(bS="value"in(yS=t)?yS.value:yS.textContent,aM=!0)),0<(h=JM(e,v)).length&&(v=new US(v,m,null,y,t),n.push({event:v,listeners:h}),p?v.data=p:null!==(p=iM(y))&&(v.data=p))),(p=KS?function(e,t){switch(e){case"compositionend":return iM(t);case"keypress":return 32!==t.which?null:(nM=!0,tM);case"textInput":return(e=t.data)===tM&&nM?null:e;default:return null}}(m,y):function(e,t){if(aM)return"compositionend"===e||!$S&&rM(e,t)?(e=wS(),xS=bS=yS=null,aM=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return eM&&"ko"!==t.locale?null:t.data;default:return null}}(m,y))&&(0<(e=JM(e,"onBeforeInput")).length&&(t=new US("onBeforeInput","beforeinput",null,y,t),n.push({event:t,listeners:e}),t.data=p))}GM(n,g)})}function ZM(e,t,n){return{instance:e,listener:t,currentTarget:n}}function JM(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=a_(e,n))&&r.unshift(ZM(e,a,i)),null!=(a=a_(e,t))&&r.push(ZM(e,a,i))),e=e.return}return r}function $M(e){if(null===e)return null;for(;(e=e.return)&&5!==e.tag;);return e||null}function QM(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,i?null!=(l=a_(n,a))&&o.unshift(ZM(n,l,s)):i||null!=(l=a_(n,a))&&o.push(ZM(n,l,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}function KM(){}var eE=null,tE=null;function nE(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function rE(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"===Sl(t.dangerouslySetInnerHTML)&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var iE="function"==typeof setTimeout?setTimeout:void 0,aE="function"==typeof clearTimeout?clearTimeout:void 0;function oE(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function sE(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function lE(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var uE=0;var cE=Math.random().toString(36).slice(2),fE="__reactFiber$"+cE,dE="__reactProps$"+cE,hE="__reactContainer$"+cE,pE="__reactEvents$"+cE;function vE(e){var t=e[fE];if(t)return t;for(var n=e.parentNode;n;){if(t=n[hE]||n[fE]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=lE(e);null!==e;){if(n=e[fE])return n;e=lE(e)}return t}n=(e=n).parentNode}return null}function mE(e){return!(e=e[fE]||e[hE])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function gE(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Ex(33))}function yE(e){return e[dE]||null}function bE(e){var t=e[pE];return void 0===t&&(t=e[pE]=new Set),t}var xE=[],wE=-1;function _E(e){return{current:e}}function SE(e){wE<0||(e.current=xE[wE],xE[wE]=null,wE--)}function ME(e,t){xE[++wE]=e.current,e.current=t}var EE={},TE=_E(EE),kE=_E(!1),LE=EE;function CE(e,t){var n=e.type.contextTypes;if(!n)return EE;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function RE(e){return null!=(e=e.childContextTypes)}function PE(){SE(kE),SE(TE)}function AE(e,t,n){if(TE.current!==EE)throw Error(Ex(168));ME(TE,t),ME(kE,n)}function OE(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(Ex(108,hw(t)||"Unknown",i));return rx({},n,r)}function NE(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||EE,LE=TE.current,ME(TE,e),ME(kE,kE.current),!0}function DE(e,t,n){var r=e.stateNode;if(!r)throw Error(Ex(169));n?(e=OE(e,t,LE),r.__reactInternalMemoizedMergedChildContext=e,SE(kE),SE(TE),ME(TE,e)):SE(kE),ME(kE,n)}var IE=null,zE=null,FE=Mx.unstable_runWithPriority,UE=Mx.unstable_scheduleCallback,BE=Mx.unstable_cancelCallback,HE=Mx.unstable_shouldYield,GE=Mx.unstable_requestPaint,VE=Mx.unstable_now,WE=Mx.unstable_getCurrentPriorityLevel,jE=Mx.unstable_ImmediatePriority,qE=Mx.unstable_UserBlockingPriority,XE=Mx.unstable_NormalPriority,YE=Mx.unstable_LowPriority,ZE=Mx.unstable_IdlePriority,JE={},$E=void 0!==GE?GE:function(){},QE=null,KE=null,eT=!1,tT=VE(),nT=tT<1e4?VE:function(){return VE()-tT};function rT(){switch(WE()){case jE:return 99;case qE:return 98;case XE:return 97;case YE:return 96;case ZE:return 95;default:throw Error(Ex(332))}}function iT(e){switch(e){case 99:return jE;case 98:return qE;case 97:return XE;case 96:return YE;case 95:return ZE;default:throw Error(Ex(332))}}function aT(e,t){return e=iT(e),FE(e,t)}function oT(e,t,n){return e=iT(e),UE(e,t,n)}function sT(){if(null!==KE){var e=KE;KE=null,BE(e)}lT()}function lT(){if(!eT&&null!==QE){eT=!0;var t=0;try{var n=QE;aT(99,function(){for(;t<n.length;t++)for(var e=n[t];null!==(e=e(!0)););}),QE=null}catch(e){throw null!==QE&&(QE=QE.slice(t+1)),UE(jE,sT),e}finally{eT=!1}}}var uT=Hx.ReactCurrentBatchConfig;function cT(e,t){if(e&&e.defaultProps){for(var n in t=rx({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var fT=_E(null),dT=null,hT=null,pT=null;function vT(){pT=hT=dT=null}function mT(e){var t=fT.current;SE(fT),e.type._context._currentValue=t}function gT(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function yT(e,t){pT=hT=null,null!==(e=(dT=e).dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Yk=!0),e.firstContext=null)}function bT(e,t){if(pT!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(pT=e,t=1073741823),t={context:e,observedBits:t,next:null},null===hT){if(null===dT)throw Error(Ex(308));hT=t,dT.dependencies={lanes:0,firstContext:t,responders:null}}else hT=hT.next=t;return e._currentValue}var xT=!1;function wT(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function _T(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ST(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function MT(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ET(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function TT(e,t,n,r){var i=e.updateQueue;xT=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,u=l.next;(l.next=null)===o?a=u:o.next=u,o=l;var c=e.alternate;if(null!==c){var f=(c=c.updateQueue).lastBaseUpdate;f!==o&&(null===f?c.firstBaseUpdate=u:f.next=u,c.lastBaseUpdate=l)}}if(null!==a){for(f=i.baseState,o=0,c=u=l=null;;){s=a.lane;var d=a.eventTime;if((r&s)===s){null!==c&&(c=c.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,p=a;switch(s=t,d=n,p.tag){case 1:if("function"==typeof(h=p.payload)){f=h.call(d,f,s);break e}f=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null==(s="function"==typeof(h=p.payload)?h.call(d,f,s):h))break e;f=rx({},f,s);break e;case 2:xT=!0}}null!==a.callback&&(e.flags|=32,null===(s=i.effects)?i.effects=[a]:s.push(a))}else d={eventTime:d,lane:s,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=d,l=f):c=c.next=d,o|=s;if(null===(a=a.next)){if(null===(s=i.shared.pending))break;a=s.next,s.next=null,i.lastBaseUpdate=s,i.shared.pending=null}}null===c&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,JL|=o,e.lanes=o,e.memoizedState=f}}function kT(e,t,n){if(e=t.effects,(t.effects=null)!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(Ex(191,i));i.call(r)}}}var LT=(new ox.Component).refs;function CT(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:rx({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var RT={isMounted:function(e){return!!(e=e._reactInternals)&&p_(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wC(),i=_C(e),a=ST(r,i);a.payload=t,null!=n&&(a.callback=n),MT(e,a),SC(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wC(),i=_C(e),a=ST(r,i);a.tag=1,a.payload=t,null!=n&&(a.callback=n),MT(e,a),SC(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wC(),r=_C(e),i=ST(n,r);i.tag=2,null!=t&&(i.callback=t),MT(e,i),SC(e,r,n)}};function PT(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!TM(n,r)||!TM(i,a))}function AT(e,t,n){var r=!1,i=EE,a=t.contextType;return t=new t(n,a="object"===Sl(a)&&null!==a?bT(a):(i=RE(t)?LE:TE.current,(r=null!=(r=t.contextTypes))?CE(e,i):EE)),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=RT,(e.stateNode=t)._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function OT(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&RT.enqueueReplaceState(t,t.state,null)}function NT(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=LT,wT(e);var a=t.contextType;"object"===Sl(a)&&null!==a?i.context=bT(a):(a=RE(t)?LE:TE.current,i.context=CE(e,a)),TT(e,n,i,r),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(CT(e,t,a,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&RT.enqueueReplaceState(i,i.state,null),TT(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var DT=Array.isArray;function IT(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!==Sl(e)){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(Ex(309));var r=n.stateNode}if(!r)throw Error(Ex(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=r.refs;t===LT&&(t=r.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(Ex(284));if(!n._owner)throw Error(Ex(290,e))}return e}function zT(e,t){if("textarea"!==e.type)throw Error(Ex(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function FT(f){function d(e,t){if(f){var n=e.lastEffect;null!==n?(n.nextEffect=t,e.lastEffect=t):e.firstEffect=e.lastEffect=t,t.nextEffect=null,t.flags=8}}function h(e,t){if(!f)return null;for(;null!==t;)d(e,t),t=t.sibling;return null}function p(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=QC(e,t)).index=0,e.sibling=null,e}function v(e,t,n){return e.index=n,f?null!==(n=e.alternate)?(n=n.index)<t?(e.flags=2,t):n:(e.flags=2,t):t}function s(e){return f&&null===e.alternate&&(e.flags=2),e}function a(e,t,n,r){return null===t||6!==t.tag?(t=nR(n,e.mode,r)).return=e:(t=o(t,n)).return=e,t}function l(e,t,n,r){return null!==t&&t.elementType===n.type?(r=o(t,n.props)).ref=IT(e,t,n):(r=KC(n.type,n.key,n.props,null,e.mode,r)).ref=IT(e,t,n),r.return=e,r}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=rR(n,e.mode,r)).return=e:(t=o(t,n.children||[])).return=e,t}function c(e,t,n,r,i){return null===t||7!==t.tag?(t=eR(n,e.mode,r,i)).return=e:(t=o(t,n)).return=e,t}function m(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=nR(""+t,e.mode,n)).return=e,t;if("object"===Sl(t)&&null!==t){switch(t.$$typeof){case Gx:return(n=KC(t.type,t.key,t.props,null,e.mode,n)).ref=IT(e,null,t),n.return=e,n;case Vx:return(t=rR(t,e.mode,n)).return=e,t}if(DT(t)||lw(t))return(t=eR(t,e.mode,n,null)).return=e,t;zT(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:a(e,t,""+n,r);if("object"===Sl(n)&&null!==n){switch(n.$$typeof){case Gx:return n.key===i?n.type===Wx?c(e,t,n.props.children,r,i):l(e,t,n,r):null;case Vx:return n.key===i?u(e,t,n,r):null}if(DT(n)||lw(n))return null!==i?null:c(e,t,n,r,null);zT(e,n)}return null}function y(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return a(t,e=e.get(n)||null,""+r,i);if("object"===Sl(r)&&null!==r){switch(r.$$typeof){case Gx:return e=e.get(null===r.key?n:r.key)||null,r.type===Wx?c(t,e,r.props.children,i,r.key):l(t,e,r,i);case Vx:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(DT(r)||lw(r))return c(t,e=e.get(n)||null,r,i,null);zT(t,r)}return null}return function(e,t,n,r){var i="object"===Sl(n)&&null!==n&&n.type===Wx&&null===n.key;i&&(n=n.props.children);var a="object"===Sl(n)&&null!==n;if(a)switch(n.$$typeof){case Gx:e:{for(a=n.key,i=t;null!==i;){if(i.key===a){switch(i.tag){case 7:if(n.type!==Wx)break;h(e,i.sibling),(t=o(i,n.props.children)).return=e,e=t;break e;default:if(i.elementType===n.type){h(e,i.sibling),(t=o(i,n.props)).ref=IT(e,i,n),t.return=e,e=t;break e}}h(e,i);break}d(e,i),i=i.sibling}e=n.type===Wx?((t=eR(n.props.children,e.mode,r,n.key)).return=e,t):((r=KC(n.type,n.key,n.props,null,e.mode,r)).ref=IT(e,t,n),r.return=e,r)}return s(e);case Vx:e:{for(i=n.key;null!==t;){if(t.key===i){if(4===t.tag&&t.stateNode.containerInfo===n.containerInfo&&t.stateNode.implementation===n.implementation){h(e,t.sibling),(t=o(t,n.children||[])).return=e,e=t;break e}h(e,t);break}d(e,t),t=t.sibling}(t=rR(n,e.mode,r)).return=e,e=t}return s(e)}if("string"==typeof n||"number"==typeof n)return n=""+n,s(e=((t=null!==t&&6===t.tag?(h(e,t.sibling),o(t,n)):(h(e,t),nR(n,e.mode,r))).return=e,t));if(DT(n))return function(t,e,n,r){for(var i=null,a=null,o=e,s=e=0,l=null;null!==o&&s<n.length;s++){o.index>s?(l=o,o=null):l=o.sibling;var u=g(t,o,n[s],r);if(null===u){null===o&&(o=l);break}f&&o&&null===u.alternate&&d(t,o),e=v(u,e,s),null===a?i=u:a.sibling=u,a=u,o=l}if(s===n.length)return h(t,o),i;if(null===o){for(;s<n.length;s++)null!==(o=m(t,n[s],r))&&(e=v(o,e,s),null===a?i=o:a.sibling=o,a=o);return i}for(o=p(t,o);s<n.length;s++)null!==(l=y(o,t,s,n[s],r))&&(f&&null!==l.alternate&&o.delete(null===l.key?s:l.key),e=v(l,e,s),null===a?i=l:a.sibling=l,a=l);return f&&o.forEach(function(e){return d(t,e)}),i}(e,t,n,r);if(lw(n))return function(t,e,n,r){var i=lw(n);if("function"!=typeof i)throw Error(Ex(150));if(null==(n=i.call(n)))throw Error(Ex(151));for(var a=i=null,o=e,s=e=0,l=null,u=n.next();null!==o&&!u.done;s++,u=n.next()){o.index>s?(l=o,o=null):l=o.sibling;var c=g(t,o,u.value,r);if(null===c){null===o&&(o=l);break}f&&o&&null===c.alternate&&d(t,o),e=v(c,e,s),null===a?i=c:a.sibling=c,a=c,o=l}if(u.done)return h(t,o),i;if(null===o){for(;!u.done;s++,u=n.next())null!==(u=m(t,u.value,r))&&(e=v(u,e,s),null===a?i=u:a.sibling=u,a=u);return i}for(o=p(t,o);!u.done;s++,u=n.next())null!==(u=y(o,t,s,u.value,r))&&(f&&null!==u.alternate&&o.delete(null===u.key?s:u.key),e=v(u,e,s),null===a?i=u:a.sibling=u,a=u);return f&&o.forEach(function(e){return d(t,e)}),i}(e,t,n,r);if(a&&zT(e,n),void 0===n&&!i)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Ex(152,hw(e.type)||"Component"))}return h(e,t)}}var UT=FT(!0),BT=FT(!1),HT={},GT=_E(HT),VT=_E(HT),WT=_E(HT);function jT(e){if(e===HT)throw Error(Ex(174));return e}function qT(e,t){switch(ME(WT,t),ME(VT,e),ME(GT,HT),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ow(null,"");break;default:t=Ow(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}SE(GT),ME(GT,t)}function XT(){SE(GT),SE(VT),SE(WT)}function YT(e){jT(WT.current);var t=jT(GT.current),n=Ow(t,e.type);t!==n&&(ME(VT,e),ME(GT,n))}function ZT(e){VT.current===e&&(SE(GT),SE(VT))}var JT=_E(0);function $T(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t=(t.child.return=t).child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var QT=null,KT=null,ek=!1;function tk(e,t){var n=JC(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function nk(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function rk(e){if(ek){var t=KT;if(t){var n=t;if(!nk(e,t)){if(!(t=sE(n.nextSibling))||!nk(e,t))return e.flags=-1025&e.flags|2,ek=!1,void(QT=e);tk(QT,n)}QT=e,KT=sE(t.firstChild)}else e.flags=-1025&e.flags|2,ek=!1,QT=e}}function ik(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;QT=e}function ak(e){if(e!==QT)return!1;if(!ek)return ik(e),!(ek=!0);var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!rE(t,e.memoizedProps))for(t=KT;t;)tk(e,t),t=sE(t.nextSibling);if(ik(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(Ex(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){KT=sE(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}KT=null}}else KT=QT?sE(e.stateNode.nextSibling):null;return!0}function ok(){KT=QT=null,ek=!1}var sk=[];function lk(){for(var e=0;e<sk.length;e++)sk[e]._workInProgressVersionPrimary=null;sk.length=0}var uk=Hx.ReactCurrentDispatcher,ck=Hx.ReactCurrentBatchConfig,fk=0,dk=null,hk=null,pk=null,vk=!1,mk=!1;function gk(){throw Error(Ex(321))}function yk(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!MM(e[n],t[n]))return!1;return!0}function bk(e,t,n,r,i,a){if(fk=a,(dk=t).memoizedState=null,t.updateQueue=null,t.lanes=0,uk.current=null===e||null===e.memoizedState?Wk:jk,e=n(r,i),mk){a=0;do{if(mk=!1,!(a<25))throw Error(Ex(301));a+=1,pk=hk=null,t.updateQueue=null,uk.current=qk,e=n(r,i)}while(mk)}if(uk.current=Vk,t=null!==hk&&null!==hk.next,fk=0,pk=hk=dk=null,vk=!1,t)throw Error(Ex(300));return e}function xk(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===pk?dk.memoizedState=pk=e:pk=pk.next=e,pk}function wk(){if(null===hk){var e=dk.alternate;e=null!==e?e.memoizedState:null}else e=hk.next;var t=null===pk?dk.memoizedState:pk.next;if(null!==t)pk=t,hk=e;else{if(null===e)throw Error(Ex(310));e={memoizedState:(hk=e).memoizedState,baseState:hk.baseState,baseQueue:hk.baseQueue,queue:hk.queue,next:null},null===pk?dk.memoizedState=pk=e:pk=pk.next=e}return pk}function _k(e,t){return"function"==typeof t?t(e):t}function Sk(e){var t=wk(),n=t.queue;if(null===n)throw Error(Ex(311));n.lastRenderedReducer=e;var r=hk,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var s=o=a=null,l=i;do{var u=l.lane;if((fk&u)===u)null!==s&&(s=s.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===e?l.eagerState:e(r,l.action);else{var c={lane:u,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};null===s?(o=s=c,a=r):s=s.next=c,dk.lanes|=u,JL|=u}l=l.next}while(null!==l&&l!==i);null===s?a=r:s.next=o,MM(r,t.memoizedState)||(Yk=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Mk(e){var t=wk(),n=t.queue;if(null===n)throw Error(Ex(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;for(var o=i=i.next;a=e(a,o.action),(o=o.next)!==i;);MM(a,t.memoizedState)||(Yk=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Ek(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(fk&e)===e)&&(t._workInProgressVersionPrimary=r,sk.push(t))),e)return n(t._source);throw sk.push(t),Error(Ex(350))}function Tk(e,a,o,t){var s=GL;if(null===s)throw Error(Ex(349));var l=a._getVersion,u=l(a._source),n=uk.current,r=n.useState(function(){return Ek(s,a,o)}),c=r[1],f=r[0];r=pk;var i=e.memoizedState,d=i.refs,h=d.getSnapshot,p=i.source;i=i.subscribe;var v=dk;return e.memoizedState={refs:d,source:a,subscribe:t},n.useEffect(function(){d.getSnapshot=o,d.setSnapshot=c;var e=l(a._source);if(!MM(u,e)){e=o(a._source),MM(f,e)||(c(e),e=_C(v),s.mutableReadLanes|=e&s.pendingLanes),e=s.mutableReadLanes,s.entangledLanes|=e;for(var t=s.entanglements,n=e;0<n;){var r=31-lS(n),i=1<<r;t[r]|=e,n&=~i}}},[o,a,t]),n.useEffect(function(){return t(a._source,function(){var e=d.getSnapshot,t=d.setSnapshot;try{t(e(a._source));var n=_C(v);s.mutableReadLanes|=n&s.pendingLanes}catch(e){t(function(){throw e})}})},[a,t]),MM(h,o)&&MM(p,a)&&MM(i,t)||((e={pending:null,dispatch:null,lastRenderedReducer:_k,lastRenderedState:f}).dispatch=c=Gk.bind(null,dk,e),r.queue=e,r.baseQueue=null,f=Ek(s,a,o),r.memoizedState=r.baseState=f),f}function kk(e,t,n){return Tk(wk(),e,t,n)}function Lk(e){var t=xk();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:_k,lastRenderedState:e}).dispatch=Gk.bind(null,dk,e),[t.memoizedState,e]}function Ck(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=dk.updateQueue)?(t={lastEffect:null},(dk.updateQueue=t).lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,(n.next=e).next=r,t.lastEffect=e),e}function Rk(e){return e={current:e},xk().memoizedState=e}function Pk(){return wk().memoizedState}function Ak(e,t,n,r){var i=xk();dk.flags|=e,i.memoizedState=Ck(1|t,n,void 0,void 0===r?null:r)}function Ok(e,t,n,r){var i=wk();r=void 0===r?null:r;var a=void 0;if(null!==hk){var o=hk.memoizedState;if(a=o.destroy,null!==r&&yk(r,o.deps))return void Ck(t,n,a,r)}dk.flags|=e,i.memoizedState=Ck(1|t,n,a,r)}function Nk(e,t){return Ak(516,4,e,t)}function Dk(e,t){return Ok(516,4,e,t)}function Ik(e,t){return Ok(4,2,e,t)}function zk(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Fk(e,t,n){return n=null!=n?n.concat([e]):null,Ok(4,2,zk.bind(null,t,e),n)}function Uk(){}function Bk(e,t){var n=wk();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&yk(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hk(e,t){var n=wk();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&yk(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Gk(e,t,n){var r=wC(),i=_C(e),a={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},o=t.pending;if(null===o?a.next=a:(a.next=o.next,o.next=a),t.pending=a,o=e.alternate,e===dk||null!==o&&o===dk)mk=vk=!0;else{if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=o(s,n);if(a.eagerReducer=o,a.eagerState=l,MM(l,s))return}catch(e){}SC(e,i,r)}}var Vk={readContext:bT,useCallback:gk,useContext:gk,useEffect:gk,useImperativeHandle:gk,useLayoutEffect:gk,useMemo:gk,useReducer:gk,useRef:gk,useState:gk,useDebugValue:gk,useDeferredValue:gk,useTransition:gk,useMutableSource:gk,useOpaqueIdentifier:gk,unstable_isNewReconciler:!1},Wk={readContext:bT,useCallback:function(e,t){return xk().memoizedState=[e,void 0===t?null:t],e},useContext:bT,useEffect:Nk,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ak(4,2,zk.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ak(4,2,e,t)},useMemo:function(e,t){var n=xk();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xk();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Gk.bind(null,dk,e),[r.memoizedState,e]},useRef:Rk,useState:Lk,useDebugValue:Uk,useDeferredValue:function(t){var e=Lk(t),n=e[0],r=e[1];return Nk(function(){var e=ck.transition;ck.transition=1;try{r(t)}finally{ck.transition=e}},[t]),n},useTransition:function(){var e=Lk(!1),t=e[0];return Rk(e=function(t,n){var e=rT();aT(e<98?98:e,function(){t(!0)}),aT(97<e?97:e,function(){var e=ck.transition;ck.transition=1;try{t(!1),n()}finally{ck.transition=e}})}.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=xk();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},Tk(r,e,t,n)},useOpaqueIdentifier:function(){if(ek){var e=!1,t=function(e){return{$$typeof:tw,toString:e,valueOf:e}}(function(){throw e||(e=!0,n("r:"+(uE++).toString(36))),Error(Ex(355))}),n=Lk(t)[1];return 0==(2&dk.mode)&&(dk.flags|=516,Ck(5,function(){n("r:"+(uE++).toString(36))},void 0,null)),t}return Lk(t="r:"+(uE++).toString(36)),t},unstable_isNewReconciler:!1},jk={readContext:bT,useCallback:Bk,useContext:bT,useEffect:Dk,useImperativeHandle:Fk,useLayoutEffect:Ik,useMemo:Hk,useReducer:Sk,useRef:Pk,useState:function(){return Sk(_k)},useDebugValue:Uk,useDeferredValue:function(t){var e=Sk(_k),n=e[0],r=e[1];return Dk(function(){var e=ck.transition;ck.transition=1;try{r(t)}finally{ck.transition=e}},[t]),n},useTransition:function(){var e=Sk(_k)[0];return[Pk().current,e]},useMutableSource:kk,useOpaqueIdentifier:function(){return Sk(_k)[0]},unstable_isNewReconciler:!1},qk={readContext:bT,useCallback:Bk,useContext:bT,useEffect:Dk,useImperativeHandle:Fk,useLayoutEffect:Ik,useMemo:Hk,useReducer:Mk,useRef:Pk,useState:function(){return Mk(_k)},useDebugValue:Uk,useDeferredValue:function(t){var e=Mk(_k),n=e[0],r=e[1];return Dk(function(){var e=ck.transition;ck.transition=1;try{r(t)}finally{ck.transition=e}},[t]),n},useTransition:function(){var e=Mk(_k)[0];return[Pk().current,e]},useMutableSource:kk,useOpaqueIdentifier:function(){return Mk(_k)[0]},unstable_isNewReconciler:!1},Xk=Hx.ReactCurrentOwner,Yk=!1;function Zk(e,t,n,r){t.child=null===e?BT(t,null,n,r):UT(t,e.child,n,r)}function Jk(e,t,n,r,i){n=n.render;var a=t.ref;return yT(t,i),r=bk(e,t,n,r,a,i),null===e||Yk?(t.flags|=1,Zk(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,gL(e,t,i))}function $k(e,t,n,r,i,a){if(null!==e)return o=e.child,0==(i&a)&&(i=o.memoizedProps,(n=null!==(n=n.compare)?n:TM)(i,r)&&e.ref===t.ref)?gL(e,t,a):(t.flags|=1,(e=QC(o,r)).ref=t.ref,(e.return=t).child=e);var o=n.type;return"function"!=typeof o||$C(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=KC(n.type,null,r,t,t.mode,a)).ref=t.ref,(e.return=t).child=e):(t.tag=15,t.type=o,Qk(e,t,o,r,i,a))}function Qk(e,t,n,r,i,a){if(null!==e&&TM(e.memoizedProps,r)&&e.ref===t.ref){if(Yk=!1,0==(a&i))return t.lanes=e.lanes,gL(e,t,a);0!=(16384&e.flags)&&(Yk=!0)}return tL(e,t,n,r,a)}function Kk(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},RC(t,n);else{if(0==(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},RC(t,e),null;t.memoizedState={baseLanes:0},RC(t,null!==a?a.baseLanes:n)}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,RC(t,r);return Zk(e,t,i,n),t.child}function eL(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function tL(e,t,n,r,i){var a=RE(n)?LE:TE.current;return a=CE(t,a),yT(t,i),n=bk(e,t,n,r,a,i),null===e||Yk?(t.flags|=1,Zk(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,gL(e,t,i))}function nL(e,t,n,r,i){if(RE(n)){var a=!0;NE(t)}else a=!1;if(yT(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),AT(t,n,r),NT(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;u="object"===Sl(u)&&null!==u?bT(u):CE(t,u=RE(n)?LE:TE.current);var c=n.getDerivedStateFromProps,f="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;f||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||s===r&&l===u||OT(t,o,r,u),xT=!1;var d=t.memoizedState;o.state=d,TT(t,r,o,i),l=t.memoizedState,r=s!==r||d!==l||kE.current||xT?("function"==typeof c&&(CT(t,n,c,r),l=t.memoizedState),(s=xT||PT(t,n,s,r,d,l,u))?(f||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4)):("function"==typeof o.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,s):("function"==typeof o.componentDidMount&&(t.flags|=4),!1)}else{o=t.stateNode,_T(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:cT(t.type,s),o.props=u,f=t.pendingProps,d=o.context,l="object"===Sl(l=n.contextType)&&null!==l?bT(l):CE(t,l=RE(n)?LE:TE.current);var h=n.getDerivedStateFromProps;(c="function"==typeof h||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||s===f&&d===l||OT(t,o,r,l),xT=!1,d=t.memoizedState,o.state=d,TT(t,r,o,i);var p=t.memoizedState;r=s!==f||d!==p||kE.current||xT?("function"==typeof h&&(CT(t,n,h,r),p=t.memoizedState),(u=xT||PT(t,n,u,r,d,p,l))?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,p,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=l,u):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),!1)}return rL(e,t,n,r,a,i)}function rL(e,t,n,r,i,a){eL(e,t);var o=0!=(64&t.flags);if(!r&&!o)return i&&DE(t,n,!1),gL(e,t,a);r=t.stateNode,Xk.current=t;var s=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=UT(t,e.child,null,a),t.child=UT(t,null,s,a)):Zk(e,t,s,a),t.memoizedState=r.state,i&&DE(t,n,!0),t.child}function iL(e){var t=e.stateNode;t.pendingContext?AE(0,t.pendingContext,t.pendingContext!==t.context):t.context&&AE(0,t.context,!1),qT(e,t.containerInfo)}var aL,oL,sL,lL,uL={dehydrated:null,retryLane:0};function cL(e,t,n){var r,i=t.pendingProps,a=JT.current,o=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(o=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),ME(JT,1&a),null===e?(void 0!==i.fallback&&rk(t),e=i.children,a=i.fallback,o?(e=fL(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=uL,e):"number"==typeof i.unstable_expectedLoadTime?(e=fL(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=uL,t.lanes=33554432,e):((n=tR({mode:"visible",children:e},t.mode,n,null)).return=t).child=n):(e.memoizedState,o?(i=hL(e,t,i.children,i.fallback,n),o=t.child,a=e.child.memoizedState,o.memoizedState=null===a?{baseLanes:n}:{baseLanes:a.baseLanes|n},o.childLanes=e.childLanes&~n,t.memoizedState=uL,i):(n=dL(e,t,i.children,n),t.memoizedState=null,n))}function fL(e,t,n,r){var i=e.mode,a=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==a?(a.childLanes=0,a.pendingProps=t):a=tR(t,i,0,null),n=eR(n,i,r,null),a.return=e,n.return=e,a.sibling=n,e.child=a,n}function dL(e,t,n,r){var i=e.child;return e=i.sibling,n=QC(i,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,(n.sibling=null)!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function hL(e,t,n,r,i){var a=t.mode,o=e.child;e=o.sibling;var s={mode:"hidden",children:n};return 0==(2&a)&&t.child!==o?((n=t.child).childLanes=0,n.pendingProps=s,null!==(o=n.lastEffect)?(t.firstEffect=n.firstEffect,(t.lastEffect=o).nextEffect=null):t.firstEffect=t.lastEffect=null):n=QC(o,s),null!==e?r=QC(e,r):(r=eR(r,a,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function pL(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),gT(e.return,t)}function vL(e,t,n,r,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.lastEffect=a)}function mL(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Zk(e,t,r.children,n),0!=(2&(r=JT.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&pL(e,n);else if(19===e.tag)pL(e,n);else if(null!==e.child){e=(e.child.return=e).child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ME(JT,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===$T(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),vL(t,!1,i,n,a,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===$T(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}vL(t,!0,n,null,a,t.lastEffect);break;case"together":vL(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function gL(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),JL|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(Ex(153));if(null!==t.child){for(n=QC(e=t.child,e.pendingProps),(t.child=n).return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=QC(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function yL(e,t){if(!ek)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function bL(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return RE(t.type)&&PE(),null;case 3:return XT(),SE(kE),SE(TE),lk(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ak(t)?t.flags|=4:r.hydrate||(t.flags|=256)),oL(t),null;case 5:ZT(t);var i=jT(WT.current);if(n=t.type,null!==e&&null!=t.stateNode)sL(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(Ex(166));return null}if(e=jT(GT.current),ak(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[fE]=t,r[dE]=a,n){case"dialog":VM("cancel",r),VM("close",r);break;case"iframe":case"object":case"embed":VM("load",r);break;case"video":case"audio":for(e=0;e<UM.length;e++)VM(UM[e],r);break;case"source":VM("error",r);break;case"img":case"image":case"link":VM("error",r),VM("load",r);break;case"details":VM("toggle",r);break;case"input":xw(r,a),VM("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},VM("invalid",r);break;case"textarea":Lw(r,a),VM("invalid",r)}for(var o in Vw(n,a),e=null,a)a.hasOwnProperty(o)&&(i=a[o],"children"===o?"string"==typeof i?r.textContent!==i&&(e=["children",i]):"number"==typeof i&&r.textContent!==""+i&&(e=["children",""+i]):kx.hasOwnProperty(o)&&null!=i&&"onScroll"===o&&VM("scroll",r));switch(n){case"input":mw(r),Sw(r,a,!0);break;case"textarea":mw(r),Rw(r);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(r.onclick=KM)}r=e,null!==(t.updateQueue=r)&&(t.flags|=4)}else{switch(o=9===i.nodeType?i:i.ownerDocument,e===Pw.html&&(e=Aw(n)),e===Pw.html?"script"===n?((e=o.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),"select"===n&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[fE]=t,e[dE]=r,aL(e,t,!1,!1),t.stateNode=e,o=Ww(n,r),n){case"dialog":VM("cancel",e),VM("close",e),i=r;break;case"iframe":case"object":case"embed":VM("load",e),i=r;break;case"video":case"audio":for(i=0;i<UM.length;i++)VM(UM[i],e);i=r;break;case"source":VM("error",e),i=r;break;case"img":case"image":case"link":VM("error",e),VM("load",e),i=r;break;case"details":VM("toggle",e),i=r;break;case"input":xw(e,r),i=bw(e,r),VM("invalid",e);break;case"option":i=Ew(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=rx({},r,{value:void 0}),VM("invalid",e);break;case"textarea":Lw(e,r),i=kw(e,r),VM("invalid",e);break;default:i=r}Vw(n,i);var s=i;for(a in s)if(s.hasOwnProperty(a)){var l=s[a];"style"===a?Hw(e,l):"dangerouslySetInnerHTML"===a?null!=(l=l?l.__html:void 0)&&Iw(e,l):"children"===a?"string"==typeof l?"textarea"===n&&""===l||zw(e,l):"number"==typeof l&&zw(e,""+l):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(kx.hasOwnProperty(a)?null!=l&&"onScroll"===a&&VM("scroll",e):null!=l&&Bx(e,a,l,o))}switch(n){case"input":mw(e),Sw(e,r,!1);break;case"textarea":mw(e),Rw(e);break;case"option":null!=r.value&&e.setAttribute("value",""+pw(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?Tw(e,!!r.multiple,a,!1):null!=r.defaultValue&&Tw(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=KM)}nE(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)lL(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(Ex(166));n=jT(WT.current),jT(GT.current),ak(t)?(r=t.stateNode,n=t.memoizedProps,r[fE]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[fE]=t).stateNode=r}return null;case 13:return SE(JT),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&ak(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&JT.current)?0===XL&&(XL=3):(0!==XL&&3!==XL||(XL=4),null===GL||0==(134217727&JL)&&0==(134217727&$L)||TC(GL,WL))),(r||n)&&(t.flags|=4),null);case 4:return XT(),oL(t),null===e&&jM(t.stateNode.containerInfo),null;case 10:return mT(t),null;case 17:return RE(t.type)&&PE(),null;case 19:if(SE(JT),null===(r=t.memoizedState))return null;if(a=0!=(64&t.flags),null===(o=r.rendering))if(a)yL(r,!1);else{if(0!==XL||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(o=$T(e))){for(t.flags|=64,yL(r,!1),null!==(a=o.updateQueue)&&(t.updateQueue=a,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=2,a.nextEffect=null,a.firstEffect=null,(a.lastEffect=null)===(o=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ME(JT,1&JT.current|2),t.child}e=e.sibling}null!==r.tail&&nT()>tC&&(t.flags|=64,yL(r,!(a=!0)),t.lanes=33554432)}else{if(!a)if(null!==(e=$T(o))){if(t.flags|=64,a=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),yL(r,!0),null===r.tail&&"hidden"===r.tailMode&&!o.alternate&&!ek)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*nT()-r.renderingStartTime>tC&&1073741824!==n&&(t.flags|=64,yL(r,!(a=!0)),t.lanes=33554432);r.isBackwards?(o.sibling=t.child,t.child=o):(null!==(n=r.last)?n.sibling=o:t.child=o,r.last=o)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=nT(),n.sibling=null,t=JT.current,ME(JT,a?1&t|2:1&t),n):null;case 23:case 24:return PC(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(Ex(156,t.tag))}function xL(e){switch(e.tag){case 1:RE(e.type)&&PE();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(XT(),SE(kE),SE(TE),lk(),0!=(64&(t=e.flags)))throw Error(Ex(285));return e.flags=-4097&t|64,e;case 5:return ZT(e),null;case 13:return SE(JT),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return SE(JT),null;case 4:return XT(),null;case 10:return mT(e),null;case 23:case 24:return PC(),null;default:return null}}function wL(e,t){try{for(var n="",r=t;n+=dw(r),r=r.return;);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function _L(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}aL=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n=(n.child.return=n).child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},oL=function(){},sL=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,jT(GT.current);var a,o=null;switch(n){case"input":i=bw(e,i),r=bw(e,r),o=[];break;case"option":i=Ew(e,i),r=Ew(e,r),o=[];break;case"select":i=rx({},i,{value:void 0}),r=rx({},r,{value:void 0}),o=[];break;case"textarea":i=kw(e,i),r=kw(e,r),o=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=KM)}for(u in Vw(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(kx.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(null!=l||null!=s))if("style"===u)if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else"dangerouslySetInnerHTML"===u?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(o=o||[]).push(u,l)):"children"===u?"string"!=typeof l&&"number"!=typeof l||(o=o||[]).push(u,""+l):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(kx.hasOwnProperty(u)?(null!=l&&"onScroll"===u&&VM("scroll",e),o||s===l||(o=[])):"object"===Sl(l)&&null!==l&&l.$$typeof===tw?l.toString():(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},lL=function(e,t,n,r){n!==r&&(t.flags|=4)};var SL="function"==typeof WeakMap?WeakMap:Map;function ML(e,t,n){(n=ST(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){aC||(aC=!0,oC=r),_L(0,t)},n}function EL(e,t,n){(n=ST(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return _L(0,t),r(i)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===sC?sC=new Set([this]):sC.add(this),_L(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var TL="function"==typeof WeakSet?WeakSet:Set;function kL(t){var e=t.ref;if(null!==e)if("function"==typeof e)try{e(null)}catch(e){XC(t,e)}else e.current=null}function LL(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:cT(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&oE(t.stateNode.containerInfo));case 5:case 6:case 4:case 17:return}throw Error(Ex(163))}function CL(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(WC(n,e),VC(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:cT(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&kT(n,t,e));case 3:if(null!==(t=n.updateQueue)){if((e=null)!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}kT(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&nE(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(null!==(n=n.alternate)&&(null!==(n=n.memoizedState)&&(null!==(n=n.dehydrated)&&B_(n)))));case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(Ex(163))}function RL(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,r.style.display=Bw("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n=(n.child.return=n).child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function PL(e,t){if(zE&&"function"==typeof zE.onCommitFiberUnmount)try{zE.onCommitFiberUnmount(IE,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!=(4&r))WC(t,n);else{r=t;try{i()}catch(e){XC(r,e)}}n=n.next}while(n!==e)}break;case 1:if(kL(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){XC(t,e)}break;case 5:kL(t);break;case 4:DL(e,t)}}function AL(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function OL(e){return 5===e.tag||3===e.tag||4===e.tag}function NL(e){e:{for(var t=e.return;null!==t;){if(OL(t))break e;t=t.return}throw Error(Ex(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(Ex(161))}16&n.flags&&(zw(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||OL(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n=(n.child.return=n).child}if(!(2&n.flags)){n=n.stateNode;break e}}r?function e(t,n,r){var i=t.tag,a=5===i||6===i;if(a)t=a?t.stateNode:t.stateNode.instance,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode,n.insertBefore(t,r)):(n=r,n.appendChild(t)),r=r._reactRootContainer,null!=r||null!==n.onclick||(n.onclick=KM));else if(4!==i&&(t=t.child,null!==t))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t):function e(t,n,r){var i=t.tag,a=5===i||6===i;if(a)t=a?t.stateNode:t.stateNode.instance,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==i&&(t=t.child,null!==t))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t)}function DL(e,t){for(var n,r,i=t,a=!1;;){if(!a){a=i.return;e:for(;;){if(null===a)throw Error(Ex(160));switch(n=a.stateNode,a.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}a=a.return}a=!0}if(5===i.tag||6===i.tag){e:for(var o=e,s=i,l=s;;)if(PL(o,l),null!==l.child&&4!==l.tag)l=(l.child.return=l).child;else{if(l===s)break e;for(;null===l.sibling;){if(null===l.return||l.return===s)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}r?(o=n,s=i.stateNode,8===o.nodeType?o.parentNode.removeChild(s):o.removeChild(s)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i=(i.child.return=i).child;continue}}else if(PL(e,i),null!==i.child){i=(i.child.return=i).child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(a=!1)}i.sibling.return=i.return,i=i.sibling}}function IL(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null))for(var r=n=n.next;3==(3&r.tag)&&(e=r.destroy,(r.destroy=void 0)!==e&&e()),(r=r.next)!==n;);return;case 1:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if((t.updateQueue=null)!==a){for(n[dE]=r,"input"===e&&"radio"===r.type&&null!=r.name&&ww(n,r),Ww(e,i),t=Ww(e,r),i=0;i<a.length;i+=2){var o=a[i],s=a[i+1];"style"===o?Hw(n,s):"dangerouslySetInnerHTML"===o?Iw(n,s):"children"===o?zw(n,s):Bx(n,o,s,t)}switch(e){case"input":_w(n,r);break;case"textarea":Cw(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(a=r.value)?Tw(n,!!r.multiple,a,!1):e!==!!r.multiple&&(null!=r.defaultValue?Tw(n,!!r.multiple,r.defaultValue,!0):Tw(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(Ex(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,B_(n.containerInfo)));case 12:return;case 13:return null!==t.memoizedState&&(eC=nT(),RL(t.child,!0)),void zL(t);case 19:return void zL(t);case 17:return;case 23:case 24:return void RL(t,null!==t.memoizedState)}throw Error(Ex(163))}function zL(n){var e=n.updateQueue;if(null!==e){n.updateQueue=null;var r=n.stateNode;null===r&&(r=n.stateNode=new TL),e.forEach(function(e){var t=function(e,t){var n=e.stateNode;null!==n&&n.delete(t),(t=0)===t&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===rT()?1:2:(0===gC&&(gC=ZL),0===(t=aS(62914560&~gC))&&(t=4194304))),n=wC(),null!==(e=MC(e,t))&&(sS(e,t,n),EC(e,n))}.bind(null,n,e);r.has(e)||(r.add(e),e.then(t,t))})}}var FL=Math.ceil,UL=Hx.ReactCurrentDispatcher,BL=Hx.ReactCurrentOwner,HL=0,GL=null,VL=null,WL=0,jL=0,qL=_E(0),XL=0,YL=null,ZL=0,JL=0,$L=0,QL=0,KL=null,eC=0,tC=1/0;function nC(){tC=nT()+500}var rC,iC=null,aC=!1,oC=null,sC=null,lC=!1,uC=null,cC=90,fC=[],dC=[],hC=null,pC=0,vC=null,mC=-1,gC=0,yC=0,bC=null,xC=!1;function wC(){return 0!=(48&HL)?nT():-1!==mC?mC:mC=nT()}function _C(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===rT()?1:2;if(0===gC&&(gC=ZL),0===uT.transition)return e=rT(),e=0!=(4&HL)&&98===e?iS(12,gC):iS(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),gC);0!==yC&&(yC=null!==KL?KL.pendingLanes:0),e=gC;var t=4186112&~yC;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}function SC(e,t,n){if(50<pC)throw pC=0,vC=null,Error(Ex(185));if(null===(e=MC(e,t)))return null;sS(e,t,n),e===GL&&($L|=t,4===XL&&TC(e,WL));var r=rT();1===t?0!=(8&HL)&&0==(48&HL)?kC(e):(EC(e,n),0===HL&&(nC(),sT())):(0==(4&HL)||98!==r&&99!==r||(null===hC?hC=new Set([e]):hC.add(e)),EC(e,n)),KL=e}function MC(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),e=(n=e).return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),e=(n=e).return;return 3===n.tag?n.stateNode:null}function EC(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-lS(o),l=1<<s,u=a[s];if(-1===u){if(0==(l&r)||0!=(l&i)){u=t,tS(l);var c=eS;a[s]=10<=c?u+250:6<=c?u+5e3:-1}}else u<=t&&(e.expiredLanes|=l);o&=~l}if(r=nS(e,e===GL?WL:0),t=eS,0===r)null!==n&&(n!==JE&&BE(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==JE&&BE(n)}n=15===t?(n=kC.bind(null,e),null===QE?(QE=[n],KE=UE(jE,lT)):QE.push(n),JE):14===t?oT(99,kC.bind(null,e)):oT(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(Ex(358,e))}}(t),function e(t){mC=-1;yC=gC=0;if(0!=(48&HL))throw Error(Ex(327));var n=t.callbackNode;if(GC()&&t.callbackNode!==n)return null;var r=nS(t,t===GL?WL:0);if(0===r)return null;var i=r;var a=HL;HL|=16;var o=NC();GL===t&&WL===i||(nC(),AC(t,i));for(;;)try{zC();break}catch(e){OC(t,e)}vT();UL.current=o;HL=a;i=null!==VL?0:(GL=null,WL=0,XL);if(0!=(ZL&$L))AC(t,0);else if(0!==i){if(2===i&&(HL|=64,t.hydrate&&(t.hydrate=!1,oE(t.containerInfo)),0!==(r=rS(t))&&(i=DC(t,r))),1===i)throw n=YL,AC(t,0),TC(t,r),EC(t,nT()),n;switch(t.finishedWork=t.current.alternate,t.finishedLanes=r,i){case 0:case 1:throw Error(Ex(345));case 2:BC(t);break;case 3:if(TC(t,r),(62914560&r)===r&&10<(i=eC+500-nT())){if(0!==nS(t,0))break;if(((a=t.suspendedLanes)&r)!==r){wC(),t.pingedLanes|=t.suspendedLanes&a;break}t.timeoutHandle=iE(BC.bind(null,t),i);break}BC(t);break;case 4:if(TC(t,r),(4186112&r)===r)break;for(i=t.eventTimes,a=-1;0<r;){var s=31-lS(r);o=1<<s,s=i[s],a<s&&(a=s),r&=~o}if(r=a,10<(r=((r=nT()-r)<120?120:r<480?480:r<1080?1080:r<1920?1920:r<3e3?3e3:r<4320?4320:1960*FL(r/1960))-r)){t.timeoutHandle=iE(BC.bind(null,t),r);break}BC(t);break;case 5:BC(t);break;default:throw Error(Ex(329))}}EC(t,nT());return t.callbackNode===n?e.bind(null,t):null}.bind(null,e)),e.callbackPriority=t,e.callbackNode=n}}function TC(e,t){for(t&=~QL,t&=~$L,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-lS(t),r=1<<n;e[n]=-1,t&=~r}}function kC(e){if(0!=(48&HL))throw Error(Ex(327));if(GC(),e===GL&&0!=(e.expiredLanes&WL)){var t=WL,n=DC(e,t);0!=(ZL&$L)&&(n=DC(e,t=nS(e,t)))}else n=DC(e,t=nS(e,0));if(0!==e.tag&&2===n&&(HL|=64,e.hydrate&&(e.hydrate=!1,oE(e.containerInfo)),0!==(t=rS(e))&&(n=DC(e,t))),1===n)throw n=YL,AC(e,0),TC(e,t),EC(e,nT()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,BC(e),EC(e,nT()),null}function LC(e,t){var n=HL;HL|=1;try{return e(t)}finally{0===(HL=n)&&(nC(),sT())}}function CC(e,t){var n=HL;HL&=-2,HL|=8;try{return e(t)}finally{0===(HL=n)&&(nC(),sT())}}function RC(e,t){ME(qL,jL),jL|=t,ZL|=t}function PC(){jL=qL.current,SE(qL)}function AC(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,aE(n)),null!==VL)for(n=VL.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&PE();break;case 3:XT(),SE(kE),SE(TE),lk();break;case 5:ZT(r);break;case 4:XT();break;case 13:case 19:SE(JT);break;case 10:mT(r);break;case 23:case 24:PC()}n=n.return}VL=QC((GL=e).current,null),WL=jL=ZL=t,YL=null,QL=$L=JL=XL=0}function OC(e,t){for(;;){var n=VL;try{if(vT(),uk.current=Vk,vk){for(var r=dk.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}vk=!1}if(fk=0,pk=hk=dk=null,mk=!1,(BL.current=null)===n||null===n.return){XL=1,YL=t,VL=null;break}e:{var a=e,o=n.return,s=n,l=t;if(t=WL,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"===Sl(l)&&"function"==typeof l.then){var u=l;if(0==(2&s.mode)){var c=s.alternate;c?(s.updateQueue=c.updateQueue,s.memoizedState=c.memoizedState,s.lanes=c.lanes):(s.updateQueue=null,s.memoizedState=null)}var f=0!=(1&JT.current),d=o;do{var h;if(h=13===d.tag){var p=d.memoizedState;if(null!==p)h=null!==p.dehydrated;else{var v=d.memoizedProps;h=void 0!==v.fallback&&(!0!==v.unstable_avoidThisFallback||!f)}}if(h){var m=d.updateQueue;if(null===m){var g=new Set;g.add(u),d.updateQueue=g}else m.add(u);if(0==(2&d.mode)){if(d.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var y=ST(-1,1);y.tag=2,MT(s,y)}s.lanes|=1;break e}l=void 0,s=t;var b=a.pingCache;if(null===b?(b=a.pingCache=new SL,l=new Set,b.set(u,l)):void 0===(l=b.get(u))&&(l=new Set,b.set(u,l)),!l.has(s)){l.add(s);var x=YC.bind(null,a,u,s);u.then(x,x)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);l=Error((hw(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==XL&&(XL=2),l=wL(l,s),d=o;do{switch(d.tag){case 3:a=l,d.flags|=4096,t&=-t,d.lanes|=t,ET(d,ML(0,a,t));break e;case 1:a=l;var w=d.type,_=d.stateNode;if(0==(64&d.flags)&&("function"==typeof w.getDerivedStateFromError||null!==_&&"function"==typeof _.componentDidCatch&&(null===sC||!sC.has(_)))){d.flags|=4096,t&=-t,d.lanes|=t,ET(d,EL(d,a,t));break e}}d=d.return}while(null!==d)}UC(n)}catch(e){t=e,VL===n&&null!==n&&(VL=n=n.return);continue}break}}function NC(){var e=UL.current;return UL.current=Vk,null===e?Vk:e}function DC(t,e){var n=HL;HL|=16;var r=NC();for(GL===t&&WL===e||AC(t,e);;)try{IC();break}catch(e){OC(t,e)}if(vT(),HL=n,UL.current=r,null!==VL)throw Error(Ex(261));return GL=null,WL=0,XL}function IC(){for(;null!==VL;)FC(VL)}function zC(){for(;null!==VL&&!HE();)FC(VL)}function FC(e){var t=rC(e.alternate,e,jL);e.memoizedProps=e.pendingProps,null===t?UC(e):VL=t,BL.current=null}function UC(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=bL(n,t,jL)))return void(VL=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&jL)||0==(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=xL(t)))return n.flags&=2047,void(VL=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(VL=t);VL=t=e}while(null!==t);0===XL&&(XL=5)}function BC(e){var t=rT();return aT(99,function(e,t){for(;GC(),null!==uC;);if(0!=(48&HL))throw Error(Ex(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Ex(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,a=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var o=e.eventTimes,s=e.expirationTimes;0<a;){var l=31-lS(a),u=1<<l;i[l]=0,o[l]=-1,s[l]=-1,a&=~u}if(null!==hC&&0==(24&r)&&hC.has(e)&&hC.delete(e),e===GL&&(VL=GL=null,WL=0),null!==(r=1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n).firstEffect:n:n.firstEffect)){if(i=HL,HL|=32,BL.current=null,eE=hS,RM(o=CM())){if("selectionStart"in o)s={start:o.selectionStart,end:o.selectionEnd};else e:if(s=(s=o.ownerDocument)&&s.defaultView||window,(u=s.getSelection&&s.getSelection())&&0!==u.rangeCount){s=u.anchorNode,a=u.anchorOffset,l=u.focusNode,u=u.focusOffset;try{s.nodeType,l.nodeType}catch(e){s=null;break e}var c=0,f=-1,d=-1,h=0,p=0,v=o,m=null;t:for(;;){for(var g;v!==s||0!==a&&3!==v.nodeType||(f=c+a),v!==l||0!==u&&3!==v.nodeType||(d=c+u),3===v.nodeType&&(c+=v.nodeValue.length),null!==(g=v.firstChild);)m=v,v=g;for(;;){if(v===o)break t;if(m===s&&++h===a&&(f=c),m===l&&++p===u&&(d=c),null!==(g=v.nextSibling))break;m=(v=m).parentNode}v=g}s=-1===f||-1===d?null:{start:f,end:d}}else s=null;s=s||{start:0,end:0}}else s=null;bC=null,xC=hS=!(tE={focusedElem:o,selectionRange:s}),iC=r;do{try{HC()}catch(e){if(null===iC)throw Error(Ex(330));XC(iC,e),iC=iC.nextEffect}}while(null!==iC);bC=null,iC=r;do{try{for(o=e;null!==iC;){var y=iC.flags;if(16&y&&zw(iC.stateNode,""),128&y){var b=iC.alternate;if(null!==b){var x=b.ref;null!==x&&("function"==typeof x?x(null):x.current=null)}}switch(1038&y){case 2:NL(iC),iC.flags&=-3;break;case 6:NL(iC),iC.flags&=-3,IL(iC.alternate,iC);break;case 1024:iC.flags&=-1025;break;case 1028:iC.flags&=-1025,IL(iC.alternate,iC);break;case 4:IL(iC.alternate,iC);break;case 8:DL(o,s=iC);var w=s.alternate;AL(s),null!==w&&AL(w)}iC=iC.nextEffect}}catch(e){if(null===iC)throw Error(Ex(330));XC(iC,e),iC=iC.nextEffect}}while(null!==iC);if(x=tE,b=CM(),y=x.focusedElem,o=x.selectionRange,b!==y&&y&&y.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(y.ownerDocument.documentElement,y)){null!==o&&RM(y)&&(b=o.start,void 0===(x=o.end)&&(x=b),"selectionStart"in y?(y.selectionStart=b,y.selectionEnd=Math.min(x,y.value.length)):(x=(b=y.ownerDocument||document)&&b.defaultView||window).getSelection&&(x=x.getSelection(),s=y.textContent.length,w=Math.min(o.start,s),o=void 0===o.end?w:Math.min(o.end,s),!x.extend&&o<w&&(s=o,o=w,w=s),s=LM(y,w),a=LM(y,o),s&&a&&(1!==x.rangeCount||x.anchorNode!==s.node||x.anchorOffset!==s.offset||x.focusNode!==a.node||x.focusOffset!==a.offset)&&((b=b.createRange()).setStart(s.node,s.offset),x.removeAllRanges(),o<w?(x.addRange(b),x.extend(a.node,a.offset)):(b.setEnd(a.node,a.offset),x.addRange(b))))),b=[];for(x=y;x=x.parentNode;)1===x.nodeType&&b.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof y.focus&&y.focus(),y=0;y<b.length;y++)(x=b[y]).element.scrollLeft=x.left,x.element.scrollTop=x.top}hS=!!eE,tE=eE=null,e.current=n,iC=r;do{try{for(y=e;null!==iC;){var _=iC.flags;if(36&_&&CL(y,iC.alternate,iC),128&_){b=void 0;var S=iC.ref;if(null!==S){var M=iC.stateNode;switch(iC.tag){case 5:b=M;break;default:b=M}"function"==typeof S?S(b):S.current=b}}iC=iC.nextEffect}}catch(e){if(null===iC)throw Error(Ex(330));XC(iC,e),iC=iC.nextEffect}}while(null!==iC);iC=null,$E(),HL=i}else e.current=n;if(lC)lC=!1,uC=e,cC=t;else for(iC=r;null!==iC;)t=iC.nextEffect,iC.nextEffect=null,8&iC.flags&&((_=iC).sibling=null,_.stateNode=null),iC=t;if(0===(r=e.pendingLanes)&&(sC=null),1===r?e===vC?pC++:(pC=0,vC=e):pC=0,n=n.stateNode,zE&&"function"==typeof zE.onCommitFiberRoot)try{zE.onCommitFiberRoot(IE,n,void 0,64==(64&n.current.flags))}catch(e){}if(EC(e,nT()),aC)throw aC=!1,e=oC,oC=null,e;return 0!=(8&HL)||sT(),null}.bind(null,e,t)),null}function HC(){for(;null!==iC;){var e=iC.alternate;xC||null===bC||(0!=(8&iC.flags)?y_(iC,bC)&&(xC=!0):13!==iC.tag||(r=iC,null===(n=e)||null!==(n=n.memoizedState)&&null===n.dehydrated||null===(r=r.memoizedState)||null!==r.dehydrated)||!y_(iC,bC)||(xC=!0));var t=iC.flags;0!=(256&t)&&LL(e,iC),0==(512&t)||lC||(lC=!0,oT(97,function(){return GC(),null})),iC=iC.nextEffect}var n,r}function GC(){if(90===cC)return!1;var e=97<cC?97:cC;return cC=90,aT(e,jC)}function VC(e,t){fC.push(t,e),lC||(lC=!0,oT(97,function(){return GC(),null}))}function WC(e,t){dC.push(t,e),lC||(lC=!0,oT(97,function(){return GC(),null}))}function jC(){if(null===uC)return!1;var e=uC;if(uC=null,0!=(48&HL))throw Error(Ex(331));var t=HL;HL|=32;var n=dC;dC=[];for(var r=0;r<n.length;r+=2){var i=n[r],a=n[r+1],o=i.destroy;if(i.destroy=void 0,"function"==typeof o)try{o()}catch(e){if(null===a)throw Error(Ex(330));XC(a,e)}}for(n=fC,fC=[],r=0;r<n.length;r+=2){i=n[r],a=n[r+1];try{var s=i.create;i.destroy=s()}catch(e){if(null===a)throw Error(Ex(330));XC(a,e)}}for(s=e.current.firstEffect;null!==s;)e=s.nextEffect,s.nextEffect=null,8&s.flags&&(s.sibling=null,s.stateNode=null),s=e;return HL=t,sT(),!0}function qC(e,t,n){MT(e,t=ML(0,t=wL(n,t),1)),t=wC(),null!==(e=MC(e,1))&&(sS(e,1,t),EC(e,t))}function XC(e,t){if(3===e.tag)qC(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){qC(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===sC||!sC.has(r))){var i=EL(n,e=wL(t,e),1);if(MT(n,i),i=wC(),null!==(n=MC(n,1)))sS(n,1,i),EC(n,i);else if("function"==typeof r.componentDidCatch&&(null===sC||!sC.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function YC(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=wC(),e.pingedLanes|=e.suspendedLanes&n,GL===e&&(WL&n)===n&&(4===XL||3===XL&&(62914560&WL)===WL&&nT()-eC<500?AC(e,0):QL|=n),EC(e,t)}function ZC(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function JC(e,t,n,r){return new ZC(e,t,n,r)}function $C(e){return!(!(e=e.prototype)||!e.isReactComponent)}function QC(e,t){var n=e.alternate;return null===n?((n=JC(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,(n.alternate=e).alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function KC(e,t,n,r,i,a){var o=2;if("function"==typeof(r=e))$C(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case Wx:return eR(n.children,i,a,t);case nw:o=8,i|=16;break;case jx:o=8,i|=1;break;case qx:return(e=JC(12,n,t,8|i)).elementType=qx,e.type=qx,e.lanes=a,e;case Jx:return(e=JC(13,n,t,i)).type=Jx,e.elementType=Jx,e.lanes=a,e;case $x:return(e=JC(19,n,t,i)).elementType=$x,e.lanes=a,e;case rw:return tR(n,i,a,t);case iw:return(e=JC(24,n,t,i)).elementType=iw,e.lanes=a,e;default:if("object"===Sl(e)&&null!==e)switch(e.$$typeof){case Xx:o=10;break e;case Yx:o=9;break e;case Zx:o=11;break e;case Qx:o=14;break e;case Kx:o=16,r=null;break e;case ew:o=22;break e}throw Error(Ex(130,null==e?e:Sl(e),""))}return(t=JC(o,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function eR(e,t,n,r){return(e=JC(7,e,r,t)).lanes=n,e}function tR(e,t,n,r){return(e=JC(23,e,r,t)).elementType=rw,e.lanes=n,e}function nR(e,t,n){return(e=JC(6,e,null,t)).lanes=n,e}function rR(e,t,n){return(t=JC(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iR(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=oS(0),this.expirationTimes=oS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oS(0),this.mutableSourceEagerHydrationData=null}function aR(e,t,n,r){var i=t.current,a=wC(),o=_C(i);e:if(n){t:{if(p_(n=n._reactInternals)!==n||1!==n.tag)throw Error(Ex(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(RE(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(Ex(171))}if(1===n.tag){var l=n.type;if(RE(l)){n=OE(n,l,s);break e}}n=s}else n=EE;return null===t.context?t.context=n:t.pendingContext=n,(t=ST(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),MT(i,t),SC(i,o,a),o}function oR(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function sR(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function lR(e,t){sR(e,t),(e=e.alternate)&&sR(e,t)}function uR(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new iR(e,t,null!=n&&!0===n.hydrate),t=JC(3,null,null,2===t?7:1===t?3:0),(n.current=t).stateNode=n,wT(t),e[hE]=n.current,jM(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function cR(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function fR(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a._internalRoot;if("function"==typeof i){var s=i;i=function(){var e=oR(o);s.call(e)}}aR(t,o,e,i)}else{if(a=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new uR(e,0,t?{hydrate:!0}:void 0)}(n,r),o=a._internalRoot,"function"==typeof i){var l=i;i=function(){var e=oR(o);l.call(e)}}CC(function(){aR(t,o,e,i)})}return oR(o)}function dR(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!cR(t))throw Error(Ex(200));return function(e,t,n,r){var i=3<arguments.length&&void 0!==r?r:null;return{$$typeof:Vx,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}rC=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||kE.current)Yk=!0;else{if(0==(n&r)){switch(Yk=!1,t.tag){case 3:iL(t),ok();break;case 5:YT(t);break;case 1:RE(t.type)&&NE(t);break;case 4:qT(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;ME(fT,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?cL(e,t,n):(ME(JT,1&JT.current),null!==(t=gL(e,t,n))?t.sibling:null);ME(JT,1&JT.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return mL(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),ME(JT,JT.current),r)break;return null;case 23:case 24:return t.lanes=0,Kk(e,t,n)}return gL(e,t,n)}Yk=0!=(16384&e.flags)}else Yk=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=CE(t,TE.current),yT(t,n),i=bk(null,t,r,e,i,n),t.flags|=1,"object"===Sl(i)&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,RE(r)){var a=!0;NE(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,wT(t);var o=r.getDerivedStateFromProps;"function"==typeof o&&CT(t,r,o,e),i.updater=RT,NT((t.stateNode=i)._reactInternals=t,r,e,n),t=rL(null,t,r,!0,a,n)}else t.tag=0,Zk(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(a=i._init)(i._payload),t.type=i,a=t.tag=function(e){if("function"==typeof e)return $C(e)?1:0;if(null!=e){if((e=e.$$typeof)===Zx)return 11;if(e===Qx)return 14}return 2}(i),e=cT(i,e),a){case 0:t=tL(null,t,i,e,n);break e;case 1:t=nL(null,t,i,e,n);break e;case 11:t=Jk(null,t,i,e,n);break e;case 14:t=$k(null,t,i,cT(i.type,e),r,n);break e}throw Error(Ex(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,tL(e,t,r,i=t.elementType===r?i:cT(r,i),n);case 1:return r=t.type,i=t.pendingProps,nL(e,t,r,i=t.elementType===r?i:cT(r,i),n);case 3:if(iL(t),r=t.updateQueue,null===e||null===r)throw Error(Ex(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,_T(e,t),TT(t,r,null,n),(r=t.memoizedState.element)===i)ok(),t=gL(e,t,n);else{if((a=(i=t.stateNode).hydrate)&&(KT=sE(t.stateNode.containerInfo.firstChild),QT=t,a=ek=!0),a){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(a=e[i])._workInProgressVersionPrimary=e[i+1],sk.push(a);for(n=BT(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Zk(e,t,r,n),ok();t=t.child}return t;case 5:return YT(t),null===e&&rk(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,rE(r,i)?o=null:null!==a&&rE(r,a)&&(t.flags|=16),eL(e,t),Zk(e,t,o,n),t.child;case 6:return null===e&&rk(t),null;case 13:return cL(e,t,n);case 4:return qT(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=UT(t,null,r,n):Zk(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Jk(e,t,r,i=t.elementType===r?i:cT(r,i),n);case 7:return Zk(e,t,t.pendingProps,n),t.child;case 8:case 12:return Zk(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value;var s=t.type._context;if(ME(fT,s._currentValue),s._currentValue=a,null!==o)if(s=o.value,0===(a=MM(s,a)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,a):1073741823))){if(o.children===i.children&&!kE.current){t=gL(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){o=s.child;for(var u=l.firstContext;null!==u;){if(u.context===r&&0!=(u.observedBits&a)){1===s.tag&&((u=ST(-1,n&-n)).tag=2,MT(s,u)),s.lanes|=n,null!==(u=s.alternate)&&(u.lanes|=n),gT(s.return,n),l.lanes|=n;break}u=u.next}}else o=10===s.tag&&s.type===t.type?null:s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===t){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}Zk(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(a=t.pendingProps).children,yT(t,n),r=r(i=bT(i,a.unstable_observedBits)),t.flags|=1,Zk(e,t,r,n),t.child;case 14:return a=cT(i=t.type,t.pendingProps),$k(e,t,i,a=cT(i.type,a),r,n);case 15:return Qk(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:cT(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,RE(r)?(e=!0,NE(t)):e=!1,yT(t,n),AT(t,r,i),NT(t,r,i,n),rL(null,t,r,!0,e,n);case 19:return mL(e,t,n);case 23:case 24:return Kk(e,t,n)}throw Error(Ex(156,t.tag))},uR.prototype.render=function(e){aR(e,this._internalRoot,null,null)},uR.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;aR(null,e,null,function(){t[hE]=null})},b_=function(e){13===e.tag&&(SC(e,4,wC()),lR(e,4))},x_=function(e){13===e.tag&&(SC(e,67108864,wC()),lR(e,67108864))},w_=function(e){if(13===e.tag){var t=wC(),n=_C(e);SC(e,n,t),lR(e,n)}},__=function(e,t){return t()},qw=function(e,t,n){switch(t){case"input":if(_w(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=yE(r);if(!i)throw Error(Ex(90));gw(r),_w(r,i)}}}break;case"textarea":Cw(e,n);break;case"select":null!=(t=n.value)&&Tw(e,!!n.multiple,t,!1)}},Qw=LC,Kw=function(e,t,n,r,i){var a=HL;HL|=4;try{return aT(98,e.bind(null,t,n,r,i))}finally{0===(HL=a)&&(nC(),sT())}},e_=function(){0==(49&HL)&&(function(){if(null!==hC){var e=hC;hC=null,e.forEach(function(e){e.expiredLanes|=24&e.pendingLanes,EC(e,nT())})}sT()}(),GC())};var hR={Events:[mE,gE,yE,Jw,$w,GC,{current:!(t_=function(e,t){var n=HL;HL|=2;try{return e(t)}finally{0===(HL=n)&&(nC(),sT())}})}]},pR={findFiberByHostInstance:vE,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},vR={bundleType:pR.bundleType,version:pR.version,rendererPackageName:pR.rendererPackageName,rendererConfig:pR.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Hx.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=g_(e))?null:e.stateNode},findFiberByHostInstance:pR.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var mR=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mR.isDisabled&&mR.supportsFiber)try{IE=mR.inject(vR),zE=mR}catch(e){}}var gR={__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:hR,createPortal:dR,findDOMNode:function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0!==t)return e=null===(e=g_(t))?null:e.stateNode;if("function"==typeof e.render)throw Error(Ex(188));throw Error(Ex(268,Object.keys(e)))},flushSync:function(e,t){var n=HL;if(0!=(48&n))return e(t);HL|=1;try{if(e)return aT(99,e.bind(null,t))}finally{HL=n,sT()}},hydrate:function(e,t,n){if(!cR(t))throw Error(Ex(200));return fR(null,e,t,!0,n)},render:function(e,t,n){if(!cR(t))throw Error(Ex(200));return fR(null,e,t,!1,n)},unmountComponentAtNode:function(e){if(!cR(e))throw Error(Ex(40));return!!e._reactRootContainer&&(CC(function(){fR(null,null,e,!1,function(){e._reactRootContainer=null,e[hE]=null})}),!0)},unstable_batchedUpdates:LC,unstable_createPortal:function(e,t,n){return dR(e,t,2<arguments.length&&void 0!==n?n:null)},unstable_renderSubtreeIntoContainer:function(e,t,n,r){if(!cR(n))throw Error(Ex(200));if(null==e||void 0===e._reactInternals)throw Error(Ex(38));return fR(e,t,n,!1,r)},version:"17.0.2"},yR=0,bR={__interactionsRef:null,__subscriberRef:null,unstable_clear:function(e){return e()},unstable_getCurrent:function(){return null},unstable_getThreadID:function(){return++yR},unstable_subscribe:function(){},unstable_trace:function(e,t,n){return n()},unstable_unsubscribe:function(){},unstable_wrap:function(e){return e}},xR=s(function(e,t){});xR.__interactionsRef,xR.__subscriberRef,xR.unstable_clear,xR.unstable_getCurrent,xR.unstable_getThreadID,xR.unstable_subscribe,xR.unstable_trace,xR.unstable_unsubscribe,xR.unstable_wrap,s(function(e){e.exports=bR});var wR=s(function(e,t){});wR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wR.createPortal,wR.findDOMNode,wR.flushSync,wR.hydrate,wR.render,wR.unmountComponentAtNode,wR.unstable_batchedUpdates,wR.unstable_createPortal,wR.unstable_renderSubtreeIntoContainer,wR.version;var _R=s(function(e){!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=gR});_R.createPortal,_R.findDOMNode,_R.hydrate;var SR=_R.render;_R.unstable_renderSubtreeIntoContainer,_R.unmountComponentAtNode,_R.unstable_createPortal;var MR=_R.unstable_batchedUpdates;_R.unstable_interactiveUpdates,_R.flushSync,_R.unstable_createRoot,_R.unstable_flushControlled;var ER=s(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116;function m(e){if("object"===Sl(e)&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case f:case a:case s:case o:case h:return e;default:switch(e=e&&e.$$typeof){case u:case d:case l:return e;default:return t}}case v:case p:case i:return t}}}function g(e){return m(e)===f}t.typeOf=m,t.AsyncMode=c,t.ConcurrentMode=f,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=d,t.Fragment=a,t.Lazy=v,t.Memo=p,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=h,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===s||e===o||e===h||"object"===Sl(e)&&null!==e&&(e.$$typeof===v||e.$$typeof===p||e.$$typeof===l||e.$$typeof===u||e.$$typeof===d)},t.isAsyncMode=function(e){return g(e)||m(e)===c},t.isConcurrentMode=g,t.isContextConsumer=function(e){return m(e)===u},t.isContextProvider=function(e){return m(e)===l},t.isElement=function(e){return"object"===Sl(e)&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return m(e)===d},t.isFragment=function(e){return m(e)===a},t.isLazy=function(e){return m(e)===v},t.isMemo=function(e){return m(e)===p},t.isPortal=function(e){return m(e)===i},t.isProfiler=function(e){return m(e)===s},t.isStrictMode=function(e){return m(e)===o},t.isSuspense=function(e){return m(e)===h}});o(ER),ER.typeOf,ER.AsyncMode,ER.ConcurrentMode,ER.ContextConsumer,ER.ContextProvider,ER.Element,ER.ForwardRef,ER.Fragment,ER.Lazy,ER.Memo,ER.Portal,ER.Profiler,ER.StrictMode,ER.Suspense,ER.isValidElementType,ER.isAsyncMode,ER.isConcurrentMode,ER.isContextConsumer,ER.isContextProvider,ER.isElement,ER.isForwardRef,ER.isFragment,ER.isLazy,ER.isMemo,ER.isPortal,ER.isProfiler,ER.isStrictMode,ER.isSuspense;var TR=s(function(e,t){});o(TR),TR.typeOf,TR.AsyncMode,TR.ConcurrentMode,TR.ContextConsumer,TR.ContextProvider,TR.Element,TR.ForwardRef,TR.Fragment,TR.Lazy,TR.Memo,TR.Portal,TR.Profiler,TR.StrictMode,TR.Suspense,TR.isValidElementType,TR.isAsyncMode,TR.isConcurrentMode,TR.isContextConsumer,TR.isContextProvider,TR.isElement,TR.isForwardRef,TR.isFragment,TR.isLazy,TR.isMemo,TR.isPortal,TR.isProfiler,TR.isStrictMode,TR.isSuspense;var kR=s(function(e){e.exports=ER});function LR(){}function CR(){}Function.call.bind(Object.prototype.hasOwnProperty),CR.resetWarningCache=LR;var RR=s(function(e){e.exports=function(){function e(e,t,n,r,i,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:CR,resetWarningCache:LR};return n.PropTypes=n}()}),PR=ox.createContext(null);var AR=function(e){e()},OR=function(){return AR};var NR={notify:function(){},get:function(){return[]}};function DR(e,t){var n,r=NR;function i(){o.onStateChange&&o.onStateChange()}function a(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){var e=OR(),r=null,i=null;return{clear:function(){i=r=null},notify:function(){e(function(){for(var e=r;e;)e.callback(),e=e.next})},get:function(){for(var e=[],t=r;t;)e.push(t),t=t.next;return e},subscribe:function(e){var t=!0,n=i={callback:e,next:null,prev:i};return n.prev?n.prev.next=n:r=n,function(){t&&null!==r&&(t=!1,n.next?n.next.prev=n.prev:i=n.prev,n.prev?n.prev.next=n.next:r=n.next)}}}}())}var o={addNestedSub:function(e){return a(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return Boolean(n)},trySubscribe:a,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=NR)},getListeners:function(){return r}};return o}var IR="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?px:hx;function zR(e){var t=e.store,n=e.context,r=e.children,i=vx(function(){var e=DR(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}},[t]),a=vx(function(){return t.getState()},[t]);IR(function(){var e=i.subscription;return e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[i,a]);var o=n||PR;return ox.createElement(o.Provider,{value:i},r)}function FR(){return(FR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function UR(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i}var BR={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},HR={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},GR={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},VR={};function WR(e){return kR.isMemo(e)?GR:VR[e.$$typeof]||BR}VR[kR.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},VR[kR.Memo]=GR;var jR=Object.defineProperty,qR=Object.getOwnPropertyNames,XR=Object.getOwnPropertySymbols,YR=Object.getOwnPropertyDescriptor,ZR=Object.getPrototypeOf,JR=Object.prototype;var $R=function e(t,n,r){if("string"!=typeof n){if(JR){var i=ZR(n);i&&i!==JR&&e(t,i,r)}var a=qR(n);XR&&(a=a.concat(XR(n)));for(var o=WR(t),s=WR(n),l=0;l<a.length;++l){var u=a[l];if(!(HR[u]||r&&r[u]||s&&s[u]||o&&o[u])){var c=YR(n,u);try{jR(t,u,c)}catch(e){}}}}return t},QR="function"==typeof Symbol&&Symbol.for,KR=QR?Symbol.for("react.element"):60103,eP=QR?Symbol.for("react.portal"):60106,tP=QR?Symbol.for("react.fragment"):60107,nP=QR?Symbol.for("react.strict_mode"):60108,rP=QR?Symbol.for("react.profiler"):60114,iP=QR?Symbol.for("react.provider"):60109,aP=QR?Symbol.for("react.context"):60110,oP=QR?Symbol.for("react.async_mode"):60111,sP=QR?Symbol.for("react.concurrent_mode"):60111,lP=QR?Symbol.for("react.forward_ref"):60112,uP=QR?Symbol.for("react.suspense"):60113,cP=QR?Symbol.for("react.suspense_list"):60120,fP=QR?Symbol.for("react.memo"):60115,dP=QR?Symbol.for("react.lazy"):60116,hP=QR?Symbol.for("react.block"):60121,pP=QR?Symbol.for("react.fundamental"):60117,vP=QR?Symbol.for("react.responder"):60118,mP=QR?Symbol.for("react.scope"):60119;function gP(e){if("object"===Sl(e)&&null!==e){var t=e.$$typeof;switch(t){case KR:switch(e=e.type){case oP:case sP:case tP:case rP:case nP:case uP:return e;default:switch(e=e&&e.$$typeof){case aP:case lP:case dP:case fP:case iP:return e;default:return t}}case eP:return t}}}function yP(e){return gP(e)===sP}var bP={AsyncMode:oP,ConcurrentMode:sP,ContextConsumer:aP,ContextProvider:iP,Element:KR,ForwardRef:lP,Fragment:tP,Lazy:dP,Memo:fP,Portal:eP,Profiler:rP,StrictMode:nP,Suspense:uP,isAsyncMode:function(e){return yP(e)||gP(e)===oP},isConcurrentMode:yP,isContextConsumer:function(e){return gP(e)===aP},isContextProvider:function(e){return gP(e)===iP},isElement:function(e){return"object"===Sl(e)&&null!==e&&e.$$typeof===KR},isForwardRef:function(e){return gP(e)===lP},isFragment:function(e){return gP(e)===tP},isLazy:function(e){return gP(e)===dP},isMemo:function(e){return gP(e)===fP},isPortal:function(e){return gP(e)===eP},isProfiler:function(e){return gP(e)===rP},isStrictMode:function(e){return gP(e)===nP},isSuspense:function(e){return gP(e)===uP},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===tP||e===sP||e===rP||e===nP||e===uP||e===cP||"object"===Sl(e)&&null!==e&&(e.$$typeof===dP||e.$$typeof===fP||e.$$typeof===iP||e.$$typeof===aP||e.$$typeof===lP||e.$$typeof===pP||e.$$typeof===vP||e.$$typeof===mP||e.$$typeof===hP)},typeOf:gP},xP=s(function(e,t){});xP.AsyncMode,xP.ConcurrentMode,xP.ContextConsumer,xP.ContextProvider,xP.Element,xP.ForwardRef,xP.Fragment,xP.Lazy,xP.Memo,xP.Portal,xP.Profiler,xP.StrictMode,xP.Suspense,xP.isAsyncMode,xP.isConcurrentMode,xP.isContextConsumer,xP.isContextProvider,xP.isElement,xP.isForwardRef,xP.isFragment,xP.isLazy,xP.isMemo,xP.isPortal,xP.isProfiler,xP.isStrictMode,xP.isSuspense,xP.isValidElementType,xP.typeOf;var wP=s(function(e){e.exports=bP});wP.typeOf,wP.AsyncMode,wP.ConcurrentMode,wP.ContextConsumer,wP.ContextProvider,wP.Element,wP.ForwardRef,wP.Fragment,wP.Lazy,wP.Memo,wP.Portal,wP.Profiler,wP.StrictMode,wP.Suspense,wP.isValidElementType,wP.isAsyncMode,wP.isConcurrentMode;var _P=wP.isContextConsumer;wP.isContextProvider,wP.isElement,wP.isForwardRef,wP.isFragment,wP.isLazy,wP.isMemo,wP.isPortal,wP.isProfiler,wP.isStrictMode,wP.isSuspense;var SP=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],MP=["reactReduxForwardedRef"],EP=[],TP=[null,null];function kP(e,t){var n=e[1];return[t.payload,n+1]}function LP(e,t,n){IR(function(){return e.apply(void 0,t)},n)}function CP(e,t,n,r,i,a,o){e.current=r,t.current=i,n.current=!1,a.current&&(a.current=null,o())}function RP(e,r,t,i,a,o,s,l,u,c){if(e){var f=!1,d=null,n=function(){if(!f){var e,t,n=r.getState();try{e=i(n,a.current)}catch(e){d=t=e}t||(d=null),e===o.current?s.current||u():(o.current=e,l.current=e,s.current=!0,c({type:"STORE_UPDATED",payload:{error:t}}))}};t.onStateChange=n,t.trySubscribe(),n();return function(){if(f=!0,t.tryUnsubscribe(),t.onStateChange=null,d)throw d}}}var PP=function(){return[null,0]};function AP(T,e){void 0===e&&(e={});var t=e,n=t.getDisplayName,o=void 0===n?function(e){return"ConnectAdvanced("+e+")"}:n,r=t.methodName,s=void 0===r?"connectAdvanced":r,i=t.renderCountProp,l=void 0===i?void 0:i,a=t.shouldHandleStateChanges,k=void 0===a||a,u=t.storeKey,c=void 0===u?"store":u;t.withRef;var f=t.forwardRef,d=void 0!==f&&f,h=t.context,p=void 0===h?PR:h,v=UR(t,SP),L=p;return function(S){var e=S.displayName||S.name||"Component",t=o(e),M=FR({},v,{getDisplayName:o,methodName:s,renderCountProp:l,shouldHandleStateChanges:k,storeKey:c,displayName:t,wrappedComponentName:e,WrappedComponent:S}),n=v.pure;var E=n?vx:function(e){return e()};function r(n){var e=vx(function(){var e=n.reactReduxForwardedRef,t=UR(n,MP);return[n.context,e,t]},[n]),t=e[0],r=e[1],i=e[2],a=vx(function(){return t&&t.Consumer&&_P(ox.createElement(t.Consumer,null))?t:L},[t,L]),o=dx(a),s=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(o)&&Boolean(o.store);var l=s?n.store:o.store,u=vx(function(){return function(e){return T(e.dispatch,M)}(l)},[l]),c=vx(function(){if(!k)return TP;var e=DR(l,s?null:o.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[l,s,o]),f=c[0],d=c[1],h=vx(function(){return s?o:FR({},o,{subscription:f})},[s,o,f]),p=mx(kP,EP,PP),v=p[0][0],m=p[1];if(v&&v.error)throw v.error;var g=gx(),y=gx(i),b=gx(),x=gx(!1),w=E(function(){return b.current&&i===y.current?b.current:u(l.getState(),i)},[l,v,i]);LP(CP,[y,g,x,i,w,b,d]),LP(RP,[k,l,f,u,y,g,x,b,d,m],[l,f,u]);var _=vx(function(){return ox.createElement(S,FR({},w,{ref:r}))},[r,S,w]);return vx(function(){return k?ox.createElement(a.Provider,{value:h},_):_},[a,_,h])}var i=n?ox.memo(r):r;if(i.WrappedComponent=S,i.displayName=r.displayName=t,d){var a=ox.forwardRef(function(e,t){return ox.createElement(i,FR({},e,{reactReduxForwardedRef:t}))});return a.displayName=t,a.WrappedComponent=S,$R(a,S)}return $R(i,S)}}function OP(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function NP(e,t){if(OP(e,t))return!0;if("object"!==Sl(e)||null===e||"object"!==Sl(t)||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!OP(e[n[i]],t[n[i]]))return!1;return!0}function DP(i){return function(e,t){var n=i(e,t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function IP(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function zP(i){return function(e,t){t.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(e,t){r.mapToProps=i,r.dependsOnOwnProps=IP(i);var n=r(e,t);return"function"==typeof n&&(r.mapToProps=n,r.dependsOnOwnProps=IP(n),n=r(e,t)),n},r}}var FP=[function(e){return"function"==typeof e?zP(e):void 0},function(e){return e?void 0:DP(function(e){return{dispatch:e}})},function(t){return t&&"object"===Sl(t)?DP(function(e){return function(n,r){function e(e){var t=n[e];"function"==typeof t&&(i[e]=function(){return r(t.apply(void 0,arguments))})}var i={};for(var t in n)e(t);return i}(t,e)}):void 0}];var UP=[function(e){return"function"==typeof e?zP(e):void 0},function(e){return e?void 0:DP(function(){return{}})}];function BP(e,t,n){return FR({},n,e,t)}var HP=[function(e){return"function"==typeof e?function(l){return function(e,t){t.displayName;var i,a=t.pure,o=t.areMergedPropsEqual,s=!1;return function(e,t,n){var r=l(e,t,n);return s?a&&o(r,i)||(i=r):(s=!0,i=r),i}}}(e):void 0},function(e){return e?void 0:function(){return BP}}],GP=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function VP(n,r,i,a){return function(e,t){return i(n(e,t),r(a,t),t)}}function WP(i,a,o,s,e){var l,u,c,f,d,h=e.areStatesEqual,p=e.areOwnPropsEqual,v=e.areStatePropsEqual,n=!1;function r(e,t){var n=!p(t,u),r=!h(e,l);return l=e,u=t,n&&r?(c=i(l,u),a.dependsOnOwnProps&&(f=a(s,u)),d=o(c,f,u)):n?(i.dependsOnOwnProps&&(c=i(l,u)),a.dependsOnOwnProps&&(f=a(s,u)),d=o(c,f,u)):r?function(){var e=i(l,u),t=!v(e,c);return c=e,t&&(d=o(c,f,u)),d}():d}return function(e,t){return n?r(e,t):function(e,t){return c=i(l=e,u=t),f=a(s,u),d=o(c,f,u),n=!0,d}(e,t)}}function jP(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,a=UR(t,GP),o=n(e,a),s=r(e,a),l=i(e,a);return(a.pure?WP:VP)(o,s,l,e,a)}var qP=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function XP(n,e,r){for(var t=e.length-1;0<=t;t--){var i=e[t](n);if(i)return i}return function(e,t){throw new Error("Invalid value of type "+Sl(n)+" for "+r+" argument when connecting component "+t.wrappedComponentName+".")}}function YP(e,t){return e===t}function ZP(e){var t=void 0===e?{}:e,n=t.connectHOC,b=void 0===n?AP:n,r=t.mapStateToPropsFactories,x=void 0===r?UP:r,i=t.mapDispatchToPropsFactories,w=void 0===i?FP:i,a=t.mergePropsFactories,_=void 0===a?HP:a,o=t.selectorFactory,S=void 0===o?jP:o;return function(e,t,n,r){void 0===r&&(r={});var i=r,a=i.pure,o=void 0===a||a,s=i.areStatesEqual,l=void 0===s?YP:s,u=i.areOwnPropsEqual,c=void 0===u?NP:u,f=i.areStatePropsEqual,d=void 0===f?NP:f,h=i.areMergedPropsEqual,p=void 0===h?NP:h,v=UR(i,qP),m=XP(e,x,"mapStateToProps"),g=XP(t,w,"mapDispatchToProps"),y=XP(n,_,"mergeProps");return b(S,FR({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:m,initMapDispatchToProps:g,initMergeProps:y,pure:o,areStatesEqual:l,areOwnPropsEqual:c,areStatePropsEqual:d,areMergedPropsEqual:p},v))}}var JP=ZP();AR=MR;var $P={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},QP=ox.createContext&&ox.createContext($P),KP=function(){return(KP=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},eA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function tA(t){return function(e){return ox.createElement(nA,KP({attr:KP({},t.attr)},e),function n(e){return e&&e.map(function(e,t){return ox.createElement(e.tag,KP({key:t},e.attr),n(e.child))})}(t.child))}}function nA(s){function t(e){var t,n=s.attr,r=s.size,i=s.title,a=eA(s,["attr","size","title"]),o=r||e.size||"1em";return e.className&&(t=e.className),s.className&&(t=(t?t+" ":"")+s.className),ox.createElement("svg",KP({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,n,a,{className:t,style:KP(KP({color:s.color||e.color},e.style),s.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),i&&ox.createElement("title",null,i),s.children)}return void 0!==QP?ox.createElement(QP.Consumer,null,function(e){return t(e)}):t($P)}function rA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}}]})(e)}function iA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 5v14l11-7z"}}]})(e)}function aA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"}}]})(e)}function oA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 6h12v12H6z"}}]})(e)}function sA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z"}}]})(e)}function lA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}}]})(e)}function uA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 10l5 5 5-5z"}}]})(e)}function cA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 14l5-5 5 5z"}}]})(e)}function fA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}}]})(e)}function dA(e){return tA({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}]})(e)}var hA={defaultValue:"",parse:function(e){return e},stringify:function(e){return e}};function pA(e,t){return t===e.defaultValue||""===t||null==t}var vA=function(){function e(n){Tl(this,e),this.fields=Object.keys(n).reduce(function(e,t){return e[t]=Object.assign({},hA,n[t]),e},{})}return Ll(e,[{key:"parse",value:function(e){var a=this.fields,o=function(n){return Object.keys(n).reduce(function(e,t){return e[t.toLowerCase()]=n[t],e},{})}(function(e){var t={};if("string"!=typeof e)return t;for(var n=e.split("&"),r=0,i=n.length;r<i;r++){var a=n[r];if(a){var o=a.split("="),s=o[0];s&&(t[s]=void 0!==o[1]?o.slice(1).join("="):null)}}return t}(e));return Object.keys(a).reduce(function(e,t){var n=a[t],r=o[t],i=r&&n.parse(r);return e[t]=pA(n,i)?n.defaultValue:i,e},o)}},{key:"stringify",value:function(i){var a=this.fields;return function(e){for(var t=Object.keys(e),n=[],r=0,i=t.length;r<i;r++){var a=t[r],o=e[a];null===o?n.push(a):void 0!==o&&n.push(a+"="+o)}return n.join("&")}(Object.keys(a).reduce(function(e,t){var n=a[t],r=i[t];return pA(n,r)||(e[t]=n.stringify(r)),e},{}))}}]),e}(),mA=window,gA=mA.history,yA=mA.location,bA=!(!gA||!gA.replaceState),xA=function(){try{gA.replaceState(null,"",yA.href)}catch(e){return!1}return!0}();var wA=/^(?:[^#]*(?:#!|#\?|#)|[^\?]*\?)?(.*)$/;function _A(e){!function(e){if(bA&&xA){var t=yA.href.split("#")[0]+(e?"#"+e:"");gA.replaceState(null,"",t)}else yA.hash=e}(e?"?"+e:"")}function SA(e){Tl(this,SA);var t=new vA(e);this.getState=function(){return t.parse(function(e){return e.replace(wA,"$1")}(yA.href))},this.setState=function(e){return _A(e?t.stringify(e):"")}}var MA={CLASSIC:"classic",BLUE_SKY:"blue-sky",NIGHT_SKY_CLOUDS:"night-sky-clouds"},EA="flagwaver/fileRecord/SET_FILE_RECORD";function TA(e){return{type:EA,payload:e}}var kA={url:"",file:null};var LA="flagwaver/flagGroup/SET_FLAG_GROUP_OPTIONS";function CA(e){return{type:LA,payload:e}}var RA={hoisting:Yl.DEXTER,orientation:Zl.TOP,width:"auto",height:"auto",mass:.11,granularity:10,imageSrc:"",flagpoleType:Jl.VERTICAL,verticalHoisting:$l.TOP_RIGHT};function PA(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:RA,t=1<arguments.length?arguments[1]:void 0;switch(t.type){case LA:return _l(_l({},e),t.payload);default:return e}}var AA="flagwaver/scenery/SET_SCENERY_OPTIONS";function OA(e){return{type:AA,payload:e}}var NA={background:MA.CLASSIC};function DA(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:NA,t=1<arguments.length?arguments[1]:void 0;switch(t.type){case AA:return _l(_l({},e),t.payload);default:return e}}var IA=PA(void 0,{}),zA=DA(void 0,{});function FA(e,t){var n=t.toLowerCase();return Object.values(e).find(function(e){return e.toLowerCase()===n})||null}var UA=new SA({src:{defaultValue:IA.imageSrc,parse:function(e){return decodeURIComponent(e)},stringify:function(e){return encodeURIComponent(e)}},hoisting:{defaultValue:IA.hoisting,parse:function(e){return e.match(/^dex(ter)?$/gi)?Yl.DEXTER:e.match(/^sin(ister)?$/gi)?Yl.SINISTER:null},stringify:function(e){return"sin"}},orientation:{defaultValue:IA.orientation,parse:function(e){return FA(Zl,e)}},flagpoletype:{defaultValue:IA.flagpoleType,parse:function(e){return FA(Jl,e)}},vhoisting:{defaultValue:IA.verticalHoisting,parse:function(e){return FA($l,e)}},background:{defaultValue:zA.background,parse:function(e){return FA(MA,e)}}});function BA(e){return{fileRecord:{url:e.src,file:null},flagGroup:function(r,i){return Object.keys(r).reduce(function(e,t){var n=i[t];return e[t]=null!=n?n:r[t],e},{})}(IA,{imageSrc:e.src,hoisting:e.hoisting,orientation:e.orientation,flagpoleType:e.flagpoletype,verticalHoisting:e.vhoisting}),scenery:{background:e.background}}}function HA(e){var t=BA(function(e){var t=e;if(!t.src){var n=window.location.hash.slice(1);/^[^!\?].*/.test(n)&&(t=_l(_l({},t),{},{src:window.unescape(n)}))}return t.topedge&&t.orientation===IA.orientation&&(t=_l(_l({},t),{},{orientation:FA(Zl,t.topedge)})),t}(UA.getState()));e.dispatch(TA(t.fileRecord)),e.dispatch(CA(t.flagGroup)),e.dispatch(OA(t.scenery))}function GA(){var t=new Bb({scene:function(){var e=new cg;return e.fog=new ug(13426942,1,1e3),e}(),camera:function(){var e=new hp(30,window.innerWidth/window.innerHeight,.1,1e3);return e.position.set(0,5,12),e}(),renderer:function(){var e=window.devicePixelRatio?window.devicePixelRatio:1,t=new lg({antialias:!0,alpha:!0});return t.setSize(window.innerWidth,window.innerHeight),t.setPixelRatio(e),t.outputEncoding=wf,t.shadowMap.enabled=!0,t.shadowMap.type=nu,t}()});return t.add(new Gb),t.add(new Hb),t.add(function(e,t){var n=function(){};return new Wb(function(e){n(e)},function(){n=function(r,e){var i=function(s){var l=s.length-1,u=[];return function e(t,n){for(var r=s[t],i=0,a=r.length;i<a;i++){var o=n.concat([r[i]]);t===l?u.push(o):e(t+1,o)}}(0,[]),u}(e);return function(e){for(var t=0,n=i.length;t<n;t++)r(i[t])}}(t,e())})}(function(){return["flagGroupModule","windModule"].map(function(e){return t.getModulesByType(e).map(function(e){return e.subject})})},function(e){var t=e[0],n=e[1],r=t.flag;!function(e,t){for(var n=e.particles,r=Nb(Db,t),i=0,a=n.length;i<a;i++)n[i].acceleration.add(r)}(r.cloth,r.object),function(e,t,n){var r,i,a,o=e.particles,s=e.geometry.getIndex();if(t)for(var l=e.restDistance*e.restDistance/2,u=Nb(t.pressure,n).multiplyScalar(Xl*l/3),c=0,f=s.count;c<f;c+=3){var d=s.getX(c),h=s.getX(c+1),p=s.getX(c+2),v=o[d],m=o[h],g=o[p],y=(r=v.position,i=m.position,a=g.position,Ib.subVectors(a,i),zb.subVectors(r,i),Ib.cross(zb),Ib.normalize(),Ib);y.multiplyScalar(y.dot(u)),v.applyForce(y),m.applyForce(y),g.applyForce(y)}}(r.cloth,n,r.object)})),t}var VA=s(function(e,t){var s=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var n=Symbol.for;s=n("react.element"),t.Fragment=n("react.fragment")}var l=ox.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function r(e,t,n){var r,i={},a=null,o=null;for(r in void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(o=t.ref),t)u.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:s,type:e,key:a,ref:o,props:i,_owner:l.current}}t.jsx=r,t.jsxs=r});VA.Fragment,VA.jsx,VA.jsxs;var WA=s(function(e,t){});WA.Fragment,WA.jsx,WA.jsxs;var jA=s(function(e){e.exports=VA}),qA=jA.jsx,XA=jA.jsxs;function YA(){return XA("div",{className:"content-section",children:[qA("p",{children:"A web app for simulating a waving flag."}),qA("hr",{}),XA("p",{children:["To learn more about FlagWaver,",qA("br",{})," ",qA("a",{href:"https://github.com/krikienoid/flagwaver",target:"_blank",rel:"noopener",children:"view the project on GitHub"}),"."]})]})}var ZA=ux(null);function JA(n){return function(t){return qA(ZA.Consumer,{children:function(e){return e&&qA(n,_l(_l({},t),{},{app:e}))}})}}var $A=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).setRef=t.setRef.bind(zl(t)),t.ref=null,t}return Ll(r,[{key:"setRef",value:function(e){this.ref=e}},{key:"componentDidMount",value:function(){var e=this.props.app;e.canvas.setAttribute("role","img"),e.canvas.setAttribute("aria-label","View of a waving flag"),this.ref.appendChild(e.canvas),e.module("resizeModule").resize()}},{key:"componentWillUnmount",value:function(){this.ref.removeChild(this.props.app.canvas)}},{key:"render",value:function(){return qA("div",{ref:this.setRef,className:"app-canvas"})}}]),r}();Cl($A,"propTypes",{app:RR.object.isRequired});var QA=JA($A);function KA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function eO(i){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?KA(Object(a),!0).forEach(function(e){var t,n,r;t=i,r=a[n=e],n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):KA(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))})}return i}function tO(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}function nO(){return Math.random().toString(36).substring(7).split("").join(".")}var rO="function"==typeof Symbol&&Symbol.observable||"@@observable",iO={INIT:"@@redux/INIT"+nO(),REPLACE:"@@redux/REPLACE"+nO(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+nO()}};function aO(e,t){return function(){return t(e.apply(this,arguments))}}function oO(e,t){if("function"==typeof e)return aO(e,t);if("object"!==Sl(e)||null===e)throw new Error(tO(16));var n={};for(var r in e){var i=e[r];"function"==typeof i&&(n[r]=aO(i,t))}return n}var sO=function(){Rl(t,lx);var e=Ul(t);function t(){return Tl(this,t),e.apply(this,arguments)}return Ll(t,[{key:"componentDidMount",value:function(){var e=this.props.app;this.module=new Vb,e.add(this.module),e.needsUpdate=!0,this.renderModule()}},{key:"componentDidUpdate",value:function(e){e.options!==this.props.options&&this.renderModule()}},{key:"componentWillUnmount",value:function(){this.props.app.remove(this.module)}},{key:"updateFlag",value:function(e){var t=this.props,n=t.app,r=t.options;if(n.remove(this.module),this.module=new Vb({flagpole:function(e,t){var n,r=Object.assign({},e);switch(r.flagpoleType){case Jl.HORIZONTAL:n=new Cb(r);break;case Jl.OUTRIGGER:n=new Pb(r);break;case Jl.CROSSBAR:r.crossbarLength=r.verticalHoisting===$l.NONE?t.cloth.width:t.cloth.height,n=new Tb(r);break;case Jl.GALLERY:r.crossbarLength=t.cloth.width,n=new kb(r);break;case Jl.AUSTRALIAN:n=new Kb(r);break;case Jl.VERTICAL:default:n=new _b(r)}return n}(r,e),flag:e}),r.flagpoleType===Jl.HORIZONTAL||r.flagpoleType===Jl.OUTRIGGER){var i=this.module.subject,a=i.flagpole,o=a.constructor.defaults.poleLength;i.object.position.set(0,o,0).sub(a.top)}n.add(this.module),n.render(),n.needsUpdate=!0}},{key:"renderModule",value:function(){var t=this,e=this.props,n=e.options,r=e.addToast;Qb(n.imageSrc||"./assets/img/flag-default.png",n).then(function(e){t.updateFlag(e)}).catch(function(e){t.updateFlag(e),r({status:"error",message:"Image could not be loaded."})})}},{key:"render",value:function(){return null}}]),t}();Cl(sO,"propTypes",{app:RR.object.isRequired,options:RR.object.isRequired,addToast:RR.func.isRequired});var lO=JA(sO),uO="flagwaver/toasts/ADD_TOAST",cO="flagwaver/toasts/REMOVE_TOAST",fO=0,dO={status:"default",message:""};function hO(){return{type:uO,payload:function(e){return _l(_l(_l({},dO),e),{},{id:fO++})}(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{})}}function pO(e){return{type:cO,payload:e}}var vO=JP(function(e){return{options:e.flagGroup}},function(e){return oO({addToast:hO},e)})(lO);function mO(e){e.castShadow=!0,e.shadow.mapSize.width=2048,e.shadow.mapSize.height=2048,e.shadow.camera.top=10,e.shadow.camera.left=-10,e.shadow.camera.bottom=-10,e.shadow.camera.right=10,e.shadow.camera.far=1e3}var gO=function(){Rl(t,lx);var e=Ul(t);function t(){return Tl(this,t),e.apply(this,arguments)}return Ll(t,[{key:"componentDidMount",value:function(){this.lights=[],this.renderModule()}},{key:"componentDidUpdate",value:function(e){e.options!==this.props.options&&this.renderModule()}},{key:"componentWillUnmount",value:function(){var t=this.props.app.scene;this.lights.map(function(e){t.remove(e)})}},{key:"renderModule",value:function(){var e=this.props,t=e.app,n=e.options,r=t.scene;switch(this.lights.map(function(e){r.remove(e)}),n.background){case MA.BLUE_SKY:this.lights=function(){var e=new Wy(3355443,1),t=new Vy(14674943,2.5);t.position.set(20,70,40),mO(t);var n=new Vy(11329439,.35);return n.position.set(0,-1,0),[e,t,n]}();break;case MA.NIGHT_SKY_CLOUDS:this.lights=function(){var e=new Wy(65793,.3),t=new Vy(9150975,1.5);t.position.set(-55,50,-80),mO(t);var n=new Vy(4547789,.08);return n.position.set(0,1,0),[e,t,n]}();break;case MA.CLASSIC:default:this.lights=function(){var e=new Wy(2236962,1),t=new Vy(16711674,1.5);return t.position.set(20,70,40),mO(t),[e,t]}()}this.lights.map(function(e){r.add(e)}),t.render()}},{key:"render",value:function(){return null}}]),t}();Cl(gO,"propTypes",{app:RR.object.isRequired,options:RR.object.isRequired});var yO=JA(gO),bO=JP(function(e){return{options:e.scenery}})(yO),xO=new id(0,-1,0);function wO(e){return new id(0,0,1).applyAxisAngle(xO,e*Math.PI/180)}var _O=function(){Rl(t,lx);var e=Ul(t);function t(){return Tl(this,t),e.apply(this,arguments)}return Ll(t,[{key:"componentDidMount",value:function(){var e=this.props.app;this.module=new jb,e.add(this.module),e.needsUpdate=!0,this.renderModule()}},{key:"componentDidUpdate",value:function(e){e.options!==this.props.options&&this.renderModule()}},{key:"componentWillUnmount",value:function(){this.props.app.remove(this.module)}},{key:"renderModule",value:function(){var e=this.props,t=e.app,n=e.options;t.remove(this.module),this.module=new jb({speed:n.enabled?n.controlled?n.speed:Eb.defaults.speed:0,direction:n.controlled?wO(n.direction):wO(0),directionFn:n.controlled?Mb.noEffect:Mb.rotatingDirection}),t.add(this.module),t.needsUpdate=!0}},{key:"render",value:function(){return null}}]),t}();Cl(_O,"propTypes",{app:RR.object.isRequired,options:RR.object.isRequired});var SO=JA(_O),MO=JP(function(e){return{options:e.wind}})(SO);function EO(){return XA(bx,{children:[qA(vO,{}),qA(bO,{}),qA(MO,{})]})}function TO(e){var t=e.className,n=e.openClassName,r=e.open,i=e.onClick,a=e.children;return qA("button",{type:"button",className:t+(r?" "+n:""),onClick:i,children:a})}function kO(e){var t=e.className,n=e.openClassName,r=e.open,i=e.onClick;return qA("div",{className:t+(r?" "+n:""),onClick:i})}function LO(e){var t=e.className,n=e.openClassName,r=e.open,i=e.children;return qA("div",{className:t+(r?" "+n:""),"aria-hidden":!r,children:i})}function CO(e){var t=gx(null),n=sx.only(e);return[wx(n,{ref:function(e){t.current=e,"function"==typeof n.ref&&n.ref(e)}}),t.current]}TO.propTypes={className:RR.string,openClassName:RR.string,open:RR.bool.isRequired,onClick:RR.func,children:RR.node},TO.defaultProps={className:"drawer-btn",openClassName:"open"},kO.propTypes={className:RR.string,openClassName:RR.string,open:RR.bool.isRequired,onClick:RR.func},kO.defaultProps={className:"drawer-overlay",openClassName:"open"},LO.propTypes={className:RR.string,openClassName:RR.string,open:RR.bool.isRequired,children:RR.node},LO.defaultProps={className:"drawer",openClassName:"open"},LO.Button=TO,LO.Overlay=kO;function RO(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName&&"DETAILS"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:t}function PO(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function AO(e){return"INPUT"===e.tagName}function OO(e){return function(e){return AO(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;function t(e){return r.querySelectorAll('input[type="radio"][name="'+e+'"]')}var n,r=e.form||e.ownerDocument;if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)n=t(window.CSS.escape(e.name));else try{n=t(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(n,e.form);return!i||i===e}(e)}function NO(e,t){return!(t.disabled||function(e){return AO(e)&&"hidden"===e.type}(t)||function(e,t){if("hidden"===getComputedStyle(e).visibility)return!0;var n=zO.call(e,"details>summary:first-of-type")?e.parentElement:e;if(zO.call(n,"details:not([open]) *"))return!0;if(t&&"full"!==t){if("non-zero-area"===t){var r=e.getBoundingClientRect(),i=r.width,a=r.height;return 0===i&&0===a}}else for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(t,e.displayCheck)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(AO(e)||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||"BUTTON"===e.tagName)for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!r.contains(e)}return!0}t=t.parentElement}return!1}(t))}var DO=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],IO=DO.join(","),zO="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,FO=function(e,t){var r=[],i=[];return function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(IO));return t&&zO.call(e,IO)&&r.unshift(e),r=r.filter(n)}(e,(t=t||{}).includeContainer,function(e,t){return!(!NO(e,t)||OO(t)||RO(t)<0)}.bind(null,t)).forEach(function(e,t){var n=RO(e);0===n?r.push(e):i.push({documentOrder:t,tabIndex:n,node:e})}),i.sort(PO).map(function(e){return e.node}).concat(r)},UO=DO.concat("iframe").join(","),BO=function(e){for(var t=0,n=e.length;t<n;t++)e[t].setAttribute("tabindex","-1")},HO=function(e){for(var t=0,n=e.length;t<n;t++)e[t].removeAttribute("tabindex")};function GO(e){var t=e.disabled,n=Hl(CO(e.children),2),r=n[0];return function(e,t){var n=gx([]);hx(function(){e&&(t?(n.current=FO(e),BO(n.current)):HO(n.current))},[e,t])}(n[1],t),r}function VO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function WO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}GO.propTypes={disabled:RR.bool.isRequired,children:RR.element.isRequired};function jO(e){return setTimeout(e,0)}function qO(e,n){var r=-1;return e.every(function(e,t){return!n(e)||(r=t,!1)}),r}function XO(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e}function YO(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target}var ZO,JO=(ZO=[],{activateTrap:function(e){if(0<ZO.length){var t=ZO[ZO.length-1];t!==e&&t.pause()}var n=ZO.indexOf(e);-1===n||ZO.splice(n,1),ZO.push(e)},deactivateTrap:function(e){var t=ZO.indexOf(e);-1!==t&&ZO.splice(t,1),0<ZO.length&&ZO[ZO.length-1].unpause()}}),$O=function(e,t){function o(e,t,n){return e&&void 0!==e[t]?e[t]:g[n||t]}function r(t){return!(!t||!y.containers.some(function(e){return e.contains(t)}))}function l(e){var t=g[e];if("function"==typeof t){for(var n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t=t.apply(void 0,r)}if(!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=m.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a}function i(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e)if(r(m.activeElement))e=m.activeElement;else{var t=y.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e}function u(){if(y.tabbableGroups=y.containers.map(function(e){var t=FO(e);if(0<t.length)return{container:e,firstTabbableNode:t[0],lastTabbableNode:t[t.length-1]}}).filter(function(e){return!!e}),y.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")}function c(e){!1!==e&&e!==m.activeElement&&(e&&e.focus?(e.focus({preventScroll:!!g.preventScroll}),function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(y.mostRecentlyFocusedNode=e)&&e.select()):c(i()))}function s(e){var t=l("setReturnFocus",e);return t||!1!==t&&e}function n(e){var t=YO(e);r(t)||(XO(g.clickOutsideDeactivates,e)?v.deactivate({returnFocus:g.returnFocusOnDeactivate&&!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==zO.call(e,UO)&&NO(t,e)}(t)}):XO(g.allowOutsideClick,e)||e.preventDefault())}function a(e){var t=YO(e),n=r(t);n||t instanceof Document?n&&(y.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),c(y.mostRecentlyFocusedNode||i()))}function f(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==XO(g.escapeDeactivates,e))return e.preventDefault(),void v.deactivate();!function(e){return"Tab"===e.key||9===e.keyCode}(e)||function(e){var n=YO(e);u();var t=null;if(0<y.tabbableGroups.length){var r=qO(y.tabbableGroups,function(e){return e.container.contains(n)});if(r<0)t=e.shiftKey?y.tabbableGroups[y.tabbableGroups.length-1].lastTabbableNode:y.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var i=qO(y.tabbableGroups,function(e){var t=e.firstTabbableNode;return n===t});if(i<0&&y.tabbableGroups[r].container===n&&(i=r),0<=i){var a=0===i?y.tabbableGroups.length-1:i-1;t=y.tabbableGroups[a].lastTabbableNode}}else{var o=qO(y.tabbableGroups,function(e){var t=e.lastTabbableNode;return n===t});if(o<0&&y.tabbableGroups[r].container===n&&(o=r),0<=o){var s=o===y.tabbableGroups.length-1?0:o+1;t=y.tabbableGroups[s].firstTabbableNode}}}else t=l("fallbackFocus");t&&(e.preventDefault(),c(t))}(e)}function d(e){if(!XO(g.clickOutsideDeactivates,e)){var t=YO(e);r(t)||XO(g.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}}function h(){if(y.active)return JO.activateTrap(v),y.delayInitialFocusTimer=g.delayInitialFocus?jO(function(){c(i())}):c(i()),m.addEventListener("focusin",a,!0),m.addEventListener("mousedown",n,{capture:!0,passive:!1}),m.addEventListener("touchstart",n,{capture:!0,passive:!1}),m.addEventListener("click",d,{capture:!0,passive:!1}),m.addEventListener("keydown",f,{capture:!0,passive:!1}),v}function p(){if(y.active)return m.removeEventListener("focusin",a,!0),m.removeEventListener("mousedown",n,!0),m.removeEventListener("touchstart",n,!0),m.removeEventListener("click",d,!0),m.removeEventListener("keydown",f,!0),v}var v,m=(null==t?void 0:t.document)||document,g=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?VO(Object(n),!0).forEach(function(e){WO(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):VO(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),y={containers:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0};return(v={activate:function(e){if(y.active)return this;var t=o(e,"onActivate"),n=o(e,"onPostActivate"),r=o(e,"checkCanFocusTrap");r||u(),y.active=!0,y.paused=!1,y.nodeFocusedBeforeActivation=m.activeElement,t&&t();function i(){r&&u(),h(),n&&n()}return r?r(y.containers.concat()).then(i,i):i(),this},deactivate:function(e){if(!y.active)return this;clearTimeout(y.delayInitialFocusTimer),y.delayInitialFocusTimer=void 0,p(),y.active=!1,y.paused=!1,JO.deactivateTrap(v);var t=o(e,"onDeactivate"),n=o(e,"onPostDeactivate"),r=o(e,"checkCanReturnFocus");t&&t();function i(){jO(function(){a&&c(s(y.nodeFocusedBeforeActivation)),n&&n()})}var a=o(e,"returnFocus","returnFocusOnDeactivate");return a&&r?r(s(y.nodeFocusedBeforeActivation)).then(i,i):i(),this},pause:function(){return y.paused||!y.active||(y.paused=!0,p()),this},unpause:function(){return y.paused&&y.active&&(y.paused=!1,u(),h()),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return y.containers=t.map(function(e){return"string"==typeof e?m.querySelector(e):e}),y.active&&u(),this}}).updateContainerElements(e),v};function QO(e){var t=e.active,n=e.focusTrapOptions,r=Hl(CO(e.children),2),i=r[0];return function(e,t,n){var r=2<arguments.length&&void 0!==n?n:{},i=gx(null);hx(function(){e&&(t?(i.current||(i.current=$O(e,r)),i.current.activate()):i.current&&i.current.deactivate())},[e,t])}(r[1],t,n),i}function KO(e){var t=e.component,n=e.className;return qA(t,{className:"icon svg-icon"+(n?" "+n:""),attr:{"aria-hidden":!0,focusable:!1}})}QO.propTypes={active:RR.bool.isRequired,focusTrapOptions:RR.object,children:RR.element.isRequired},KO.propTypes={component:RR.elementType.isRequired,className:RR.string};var eN=function(){Rl(t,lx);var e=Ul(t);function t(){return Tl(this,t),e.apply(this,arguments)}return Ll(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.children;return XA("section",{className:"panel",children:[qA("header",{className:"panel-header",children:XA("div",{className:"panel-header-inner",children:[qA("div",{className:"panel-side"}),qA("div",{className:"panel-main",children:qA("h2",{className:"panel-heading",children:t})})]})}),qA("div",{className:"panel-body",children:n})]})}}]),t}();function tN(e){var t=e.paused,n=e.setPaused,r=dx(ZA);if(r){var i=r.module("animationModule");return qA("div",{className:"form-section",children:qA("div",{className:"form-group",children:XA("div",{className:"btn-group",children:[qA("button",{type:"button",className:"btn",onClick:function(){t?i.play():i.pause(),n(!t)},children:XA(bx,t?{children:[qA(KO,{component:iA}),qA("span",{className:"sr-only",children:"Play"})]}:{children:[qA(KO,{component:rA}),qA("span",{className:"sr-only",children:"Pause"})]})}),XA("button",{type:"button",className:"btn",onClick:function(){i.pause(),i.reset(),n(!0)},children:[qA(KO,{component:oA}),qA("span",{className:"sr-only",children:"Stop"})]}),XA("button",{type:"button",className:"btn",onClick:function(){i.step()},children:[qA(KO,{component:aA}),qA("span",{className:"sr-only",children:"Step forward"})]})]})})})}return null}Cl(eN,"propTypes",{title:RR.node,children:RR.node}),tN.propTypes={paused:RR.bool,setPaused:RR.func};var nN="flagwaver/animationControl/SET_PAUSED";function rN(e){return{type:nN,payload:e}}var iN={paused:!(tN.defaultProps={setPaused:function(){}})};var aN=JP(function(e){return{paused:e.animationControl.paused}},function(e){return oO({setPaused:rN},e)})(tN);function oN(e){var t=e.options.background;return qA("div",{className:"app-bg bg-image-full bg-".concat(t)})}oN.propTypes={options:RR.object.isRequired};var sN=JP(function(e){return{options:e.scenery}})(oN),lN=["className","valid","feedback","feedbackId","children"];function uN(e){var t=e.className,n=e.valid,r=e.feedback,i=e.feedbackId,a=e.children,o=Il(e,lN);return XA("div",_l(_l({className:t+(n?"":" has-error")},o),{},{children:[a,n?null:qA("p",{className:"form-input-hint",id:i,children:r})]}))}uN.propTypes={className:RR.string,valid:RR.bool.isRequired,feedback:RR.node,feedbackId:RR.string,children:RR.node},uN.defaultProps={className:"form-group"};var cN=0;function fN(e){var t=Hl(yx(e),2),n=t[0],r=t[1];if(n)return n;var i=function(e){return"".concat(0<arguments.length&&void 0!==e?e:"id-").concat(++cN)}("uid-");return r(i),i}function dN(e){var t=e.id,n=e.label,o=e.name,s=e.value,r=e.options,l=e.disabled,i=e.block,u=e.buttonClassName,c=e.buttonActiveClassName,a=e.validator,f=e.onChange,d=fN(t),h=a(s),p=h.valid,v=h.feedback,m=v?"".concat(d,"-feedback"):null,g="".concat(d,"-options");return qA(uN,{valid:p,feedback:v,feedbackId:m,children:XA("fieldset",{className:"btn-select"+(i?" btn-select-block":""),children:[qA("legend",{className:"form-label",children:n}),qA("div",{className:"btn-select-options",children:r.map(function(e,t){var n=e.label,r=e.value,i="".concat(d,"-option-").concat(t+1),a=r===s;return XA("div",{className:"btn-select-option",children:[qA("input",{type:"radio",id:i,name:g,value:r,checked:a,disabled:l,onChange:function(){f(o,r)}}),qA("label",{className:u+(a?" "+c:""),htmlFor:i,children:n})]},r)})})]})})}dN.propTypes={id:RR.string,label:RR.node,name:RR.string,value:RR.string,options:RR.arrayOf(RR.shape({label:RR.node,value:RR.string.isRequired})),disabled:RR.bool,block:RR.bool,buttonClassName:RR.string,buttonActiveClassName:RR.string,validator:RR.func,onChange:RR.func},dN.defaultProps={label:"Select",options:[],disabled:!1,buttonClassName:"btn",buttonActiveClassName:"active",validator:function(){return{valid:!0}},onChange:function(){}};var hN=RR.shape({url:RR.string,file:RR.shape({name:RR.string.isRequired,size:RR.number.isRequired})}),pN=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).handleChange=t.handleChange.bind(zl(t)),t}return Ll(r,[{key:"handleChange",value:function(e){if(window.File&&window.FileReader){var t=this.props,n=t.name,r=t.onChange,i=t.onLoad,a=t.isValidFileType,o=e.target.files[0];if(o)if(a(o.type)){r(n,{url:"",file:o});var s=new FileReader;s.addEventListener("load",function(e){i(n,{url:e.target.result,file:o})}),s.readAsDataURL(o)}else console.error("Invalid file type.");else console.error("No file was uploaded.")}else console.error("The File APIs are not fully supported in this browser.")}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.label,r=e.name,i=e.value,a=e.accept,o=e.defaultText,s=e.disabled,l=e.buttonText,u=(0,e.validator)(i),c=u.valid,f=u.feedback,d=f?"".concat(t,"-feedback"):null,h=i&&i.file||null;return XA(uN,{valid:c,feedback:f,feedbackId:d,children:[qA("label",{className:"form-label",htmlFor:t,children:n}),XA("div",{className:"form-file",children:[qA("input",{type:"file",className:"form-file-input",id:t,name:r,accept:a,disabled:s,"aria-describedby":d,onChange:this.handleChange}),XA("div",{className:"input-group form-file-btn","aria-hidden":"true",children:[qA("input",{type:"text",className:"form-input",value:h?h.name:"",placeholder:o,disabled:"disabled"}),qA("div",{className:"btn input-group-btn",children:l})]})]})]})}}]),r}();Cl(pN,"propTypes",{id:RR.string.isRequired,label:RR.node,name:RR.string,value:hN,accept:RR.string,defaultText:RR.node,disabled:RR.bool,buttonText:RR.node,validator:RR.func,onChange:RR.func,onLoad:RR.func,isValidFileType:RR.func}),Cl(pN,"defaultProps",{label:"File",defaultText:"Select file...",disabled:!1,buttonText:"Browse...",validator:function(){return{valid:!0}},onChange:function(){},onLoad:function(){},isValidFileType:function(){return!0}});var vN,mN=(vN=pN,function(e){var t=fN(e.id);return qA(vN,_l(_l({},e),{},{id:t}))});function gN(e){var t=e.id,n=e.label,r=e.name,i=e.placeholder,a=e.value,o=e.disabled,s=e.buttonText,l=e.validator,u=e.onChange,c=e.onSubmit,f=fN(t),d=l(a),h=d.valid,p=d.feedback,v=p?"".concat(f,"-feedback"):null;return XA(uN,{valid:h,feedback:p,feedbackId:v,children:[qA("label",{className:"form-label",htmlFor:f,children:n}),XA("div",{className:"input-group",children:[qA("input",{type:"url",className:"form-input",id:f,name:r,value:a,placeholder:i,disabled:o,"aria-describedby":v,onChange:u,onKeyDown:function(e){var t=e.key||e.keyCode;"Enter"!==t&&13!==t||c(e)}}),qA("button",{type:"button",className:"btn input-group-btn",disabled:o,onClick:c,children:s})]})]})}gN.propTypes={id:RR.string,label:RR.node,name:RR.string,placeholder:RR.string,value:RR.string,disabled:RR.bool,buttonText:RR.node,validator:RR.func,onChange:RR.func,onSubmit:RR.func},gN.defaultProps={label:"URL",placeholder:"https://www...",disabled:!1,buttonText:"Go",validator:function(){return{valid:!0}}};var yN="web",bN="file",xN=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).state={inputMode:yN,url:"",hasSubmittedURL:!1},t.validateURL=t.validateURL.bind(zl(t)),t.handleModeChange=t.handleModeChange.bind(zl(t)),t.handleURLChange=t.handleURLChange.bind(zl(t)),t.handleURLSubmit=t.handleURLSubmit.bind(zl(t)),t.handleFileChange=t.handleFileChange.bind(zl(t)),t.handleFileLoad=t.handleFileLoad.bind(zl(t)),t}return Ll(r,[{key:"componentDidMount",value:function(){var e=this.props.value;this.updateURL(e)}},{key:"componentDidUpdate",value:function(e){var t=this.props.value;e.value!==t&&this.updateURL(t)}},{key:"validateURL",value:function(e){return!this.state.hasSubmittedURL||e&&function(e){try{return!!new URL(e)}catch(e){return!1}}(e)?{valid:!0}:{valid:!1,feedback:"Please enter a valid URL."}}},{key:"handleModeChange",value:function(e,t){this.setState({inputMode:t,hasSubmittedURL:!1})}},{key:"handleURLChange",value:function(e){this.setState({url:e.target.value,hasSubmittedURL:!1})}},{key:"handleURLSubmit",value:function(){var e=this.props,t=e.name,n=e.onChange,r=e.onLoad,i={url:this.state.url,file:null};this.setState({hasSubmittedURL:!0}),n(t,i),r(t,i)}},{key:"handleFileChange",value:function(e,t){var n=this.props,r=n.name;(0,n.onChange)(r,t),this.setState({url:""})}},{key:"handleFileLoad",value:function(e,t){var n=this.props,r=n.name,i=n.onChange,a=n.onLoad;i(r,t),a(r,t),this.setState({url:""})}},{key:"updateURL",value:function(e){this.setState({url:e&&!e.file&&e.url||""})}},{key:"render",value:function(){var e=this.props,t=e.label,n=e.value,r=e.accept,i=e.isValidFileType,a=this.state,o=a.inputMode,s=a.url;return qA("div",{className:"form-group",children:XA("fieldset",{className:"field-group",children:[qA("legend",{className:"field-group-legend",children:t}),XA("div",{className:"field-group-body",children:[qA(dN,{label:"From",name:"inputMode",value:o,options:[{label:"Web",value:yN},{label:"File",value:bN}],block:!0,onChange:this.handleModeChange}),o===yN&&qA(gN,{label:"URL",name:"url",value:s,buttonText:XA(bx,{children:[qA(KO,{component:fA}),qA("span",{className:"sr-only",children:"Enter"})]}),validator:this.validateURL,onChange:this.handleURLChange,onSubmit:this.handleURLSubmit}),o===bN&&qA(mN,{label:"File",name:"file",value:n,accept:r,defaultText:"Select file...",buttonText:XA(bx,{children:[qA(KO,{component:lA}),qA("span",{className:"sr-only",children:"Browse"})]}),onChange:this.handleFileChange,onLoad:this.handleFileLoad,isValidFileType:i})]})]})})}}]),r}();Cl(xN,"propTypes",{label:RR.node,name:RR.string,value:hN,accept:RR.string,onChange:RR.func,onLoad:RR.func,isValidFileType:RR.func}),Cl(xN,"defaultProps",{label:"Select File",onChange:function(){},onLoad:function(){}});var wN="default",_N="success",SN="warning",MN="error";function EN(e){var t=e.status,n=e.children;return qA("div",{className:"message message-".concat(t),children:qA("div",{className:"message-body",children:n})})}EN.propTypes={status:RR.oneOf([wN,_N,SN,MN]),children:RR.node.isRequired},EN.defaultProps={status:wN};var TN=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).handleFilePickerChange=t.handleFilePickerChange.bind(zl(t)),t.handleFilePickerLoad=t.handleFilePickerLoad.bind(zl(t)),t}return Ll(r,[{key:"handleFilePickerChange",value:function(e,t){this.props.setFileRecord(t)}},{key:"handleFilePickerLoad",value:function(e,t){this.props.setOptions({imageSrc:t.url})}},{key:"render",value:function(){var e=this.props,t=e.fileRecord;return e.options?qA("div",{className:"form-section",children:qA(xN,{label:"Select image",value:t,accept:"image/*",onChange:this.handleFilePickerChange,onLoad:this.handleFilePickerLoad,isValidFileType:function(e){return e.match("image.*")}})}):qA(EN,{status:"error",children:qA("p",{children:"Error: Object does not exist."})})}}]),r}();Cl(TN,"propTypes",{fileRecord:hN,options:RR.object,setFileRecord:RR.func,setOptions:RR.func}),Cl(TN,"defaultProps",{setFileRecord:function(){},setOptions:function(){}});var kN=JP(function(e){return{fileRecord:e.fileRecord,options:e.flagGroup}},function(e){return oO({setFileRecord:TA,setOptions:CA},e)})(TN);function LN(e){var t=e.id,n=e.label,r=e.name,i=e.value,a=e.options,o=e.disabled,s=e.validator,l=e.onChange,u=fN(t),c=s(i),f=c.valid,d=c.feedback,h=d?"".concat(u,"-feedback"):null;return XA(uN,{valid:f,feedback:d,feedbackId:h,children:[qA("label",{className:"form-label",htmlFor:u,children:n}),qA("select",{className:"form-select",id:u,name:r,value:i,disabled:o,"aria-describedby":h,onChange:l,children:a.map(function(e){return qA("option",{value:e.value,children:e.label},e.value)})})]})}LN.propTypes={id:RR.string,label:RR.node,name:RR.string,value:RR.string,options:RR.arrayOf(RR.shape({label:RR.node,value:RR.string.isRequired})),disabled:RR.bool,validator:RR.func,onChange:RR.func},LN.defaultProps={label:"Select",options:[],disabled:!1,validator:function(){return{valid:!0}}};var CN=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).handleChange=t.handleChange.bind(zl(t)),t.handleButtonSelectChange=t.handleButtonSelectChange.bind(zl(t)),t.handleFilePickerChange=t.handleFilePickerChange.bind(zl(t)),t.handleFilePickerLoad=t.handleFilePickerLoad.bind(zl(t)),t}return Ll(r,[{key:"handleChange",value:function(e){this.props.setOptions(Cl({},e.target.name,e.target.value))}},{key:"handleButtonSelectChange",value:function(e,t){this.props.setOptions(Cl({},e,t))}},{key:"handleFilePickerChange",value:function(e,t){this.props.setFileRecord(t)}},{key:"handleFilePickerLoad",value:function(e,t){this.props.setOptions({imageSrc:t.url})}},{key:"render",value:function(){var e=this.props,t=e.fileRecord,n=e.options;return n?XA("div",{className:"form-section",children:[qA(xN,{label:"Select image",value:t,accept:"image/*",onChange:this.handleFilePickerChange,onLoad:this.handleFilePickerLoad,isValidFileType:function(e){return e.match("image.*")}}),qA(dN,{label:"Hoisting",name:"hoisting",value:n.hoisting,options:[{value:Yl.SINISTER,label:XA(bx,{children:[qA(KO,{component:sA,className:"icon-hoisting-sinister"}),qA("span",{className:"btn-text",children:"Sinister"})]})},{value:Yl.DEXTER,label:XA(bx,{children:[qA(KO,{component:sA,className:"icon-hoisting-dexter"}),qA("span",{className:"btn-text",children:"Dexter"})]})}],block:!0,onChange:this.handleButtonSelectChange}),qA(LN,{label:"Orientation",name:"orientation",value:n.orientation,onChange:this.handleChange,options:[{value:Zl.TOP,label:"Top"},{value:Zl.LEFT,label:"Left"},{value:Zl.BOTTOM,label:"Bottom"},{value:Zl.RIGHT,label:"Right"}]}),qA(LN,{label:"Flagpole type",name:"flagpoleType",value:n.flagpoleType,onChange:this.handleChange,options:[{value:Jl.VERTICAL,label:"Standard"},{value:Jl.HORIZONTAL,label:"Horizontal"},{value:Jl.OUTRIGGER,label:"Outrigger"},{value:Jl.CROSSBAR,label:"Crossbar"},{value:Jl.GALLERY,label:"Gallery"}]}),qA(LN,{label:"Vertical hanging method",name:"verticalHoisting",value:n.verticalHoisting,disabled:n.flagpoleType!==Jl.CROSSBAR,onChange:this.handleChange,options:[{value:$l.TOP_RIGHT,label:"Rotate clockwise"},{value:$l.TOP_LEFT,label:"Rotate and flip"},{value:$l.NONE,label:"No change"}]})]}):qA(EN,{status:"error",children:qA("p",{children:"Error: Object does not exist."})})}}]),r}();Cl(CN,"propTypes",{fileRecord:hN,options:RR.object,setFileRecord:RR.func,setOptions:RR.func}),Cl(CN,"defaultProps",{setFileRecord:function(){},setOptions:function(){}});var RN=JP(function(e){return{fileRecord:e.fileRecord,options:e.flagGroup}},function(e){return oO({setFileRecord:TA,setOptions:CA},e)})(CN),PN=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).handleChange=t.handleChange.bind(zl(t)),t}return Ll(r,[{key:"handleChange",value:function(e){this.props.setOptions(Cl({},e.target.name,e.target.value))}},{key:"render",value:function(){var e=this.props.options;return qA("div",{className:"form-section",children:qA(LN,{label:"Background",name:"background",value:e.background,onChange:this.handleChange,options:[{value:MA.CLASSIC,label:"Classic"},{value:MA.BLUE_SKY,label:"Blue sky"},{value:MA.NIGHT_SKY_CLOUDS,label:"Night sky with clouds"}]})})}}]),r}();Cl(PN,"propTypes",{options:RR.object.isRequired,setOptions:RR.func}),Cl(PN,"defaultProps",{setOptions:function(){}});var AN=JP(function(e){return{options:e.scenery}},function(e){return oO({setOptions:OA},e)})(PN),ON=YN(),NN=function(e){return WN(e,ON)},DN=YN();NN.write=function(e){return WN(e,DN)};var IN=YN();NN.onStart=function(e){return WN(e,IN)};var zN=YN();NN.onFrame=function(e){return WN(e,zN)};var FN=YN();NN.onFinish=function(e){return WN(e,FN)};var UN=[];NN.setTimeout=function(e,t){var n=NN.now()+t,r={time:n,handler:e,cancel:function t(){var e=UN.findIndex(function(e){return e.cancel==t});~e&&UN.splice(e,1),JN.count-=~e?1:0}};return UN.splice(BN(n),0,r),JN.count+=1,jN(),r};var BN=function(t){return~(~UN.findIndex(function(e){return e.time>t})||~UN.length)};NN.cancel=function(e){ON.delete(e),DN.delete(e)},NN.sync=function(e){VN=!0,NN.batchedUpdates(e),VN=!1},NN.throttle=function(e){var r;function i(){try{e.apply(void 0,Gl(r))}finally{r=null}}function t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r=t,NN.onStart(i)}return t.handler=e,t.cancel=function(){IN.delete(i),r=null},t};var HN="undefined"!=typeof window?window.requestAnimationFrame:function(){};NN.use=function(e){return HN=e},NN.now="undefined"!=typeof performance?function(){return performance.now()}:Date.now,NN.batchedUpdates=function(e){return e()},NN.catch=console.error,NN.frameLoop="always",NN.advance=function(){"demand"!==NN.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):XN()};var GN=-1,VN=!1;function WN(e,t){VN?(t.delete(e),e(0)):(t.add(e),jN())}function jN(){GN<0&&(GN=0,"demand"!==NN.frameLoop&&HN(qN))}function qN(){~GN&&(HN(qN),NN.batchedUpdates(XN))}function XN(){var e=GN;GN=NN.now();var t=BN(GN);t&&(ZN(UN.splice(0,t),function(e){return e.handler()}),JN.count-=t),IN.flush(),ON.flush(e?Math.min(64,GN-e):16.667),zN.flush(),DN.flush(),FN.flush()}function YN(){var n=new Set,r=n;return{add:function(e){JN.count+=r!=n||n.has(e)?0:1,n.add(e)},delete:function(e){return JN.count-=r==n&&n.has(e)?1:0,n.delete(e)},flush:function(t){r.size&&(n=new Set,JN.count-=r.size,ZN(r,function(e){return e(t)&&n.add(e)}),JN.count+=n.size,r=n)}}}function ZN(e,t){e.forEach(function(e){try{t(e)}catch(e){NN.catch(e)}})}var JN={count:0,clear:function(){GN=-1,UN=[],IN=YN(),ON=YN(),zN=YN(),DN=YN(),FN=YN(),JN.count=0}};function $N(){}var QN={arr:Array.isArray,obj:function(e){return!!e&&"Object"===e.constructor.name},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e}};function KN(e,t){if(QN.arr(e)){if(!QN.arr(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var eD=function(e,t){return e.forEach(t)};function tD(e,t,n){if(QN.arr(e))for(var r=0;r<e.length;r++)t.call(n,e[r],"".concat(r));else for(var i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i)}var nD=function(e){return QN.und(e)?[]:QN.arr(e)?e:[e]};function rD(e,t){if(e.size){var n=Array.from(e);e.clear(),eD(n,t)}}var iD,aD,oD=function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return rD(e,function(e){return e.apply(void 0,n)})},sD=null,lD=!1,uD=$N,cD=Object.freeze({__proto__:null,get createStringInterpolator(){return iD},get to(){return aD},get colors(){return sD},get skipAnimation(){return lD},get willAdvance(){return uD},assign:function(e){e.to&&(aD=e.to),e.now&&(NN.now=e.now),void 0!==e.colors&&(sD=e.colors),null!=e.skipAnimation&&(lD=e.skipAnimation),e.createStringInterpolator&&(iD=e.createStringInterpolator),e.requestAnimationFrame&&NN.use(e.requestAnimationFrame),e.batchedUpdates&&(NN.batchedUpdates=e.batchedUpdates),e.willAdvance&&(uD=e.willAdvance),e.frameLoop&&(NN.frameLoop=e.frameLoop)}}),fD=new Set,dD=[],hD=[],pD=0,vD={get idle(){return!fD.size&&!dD.length},start:function(e){pD>e.priority?(fD.add(e),NN.onStart(mD)):(gD(e),NN(bD))},advance:bD,sort:function(e){if(pD)NN.onFrame(function(){return vD.sort(e)});else{var t=dD.indexOf(e);~t&&(dD.splice(t,1),yD(e))}},clear:function(){dD=[],fD.clear()}};function mD(){fD.forEach(gD),fD.clear(),NN(bD)}function gD(e){dD.includes(e)||yD(e)}function yD(t){dD.splice(function(e,t){var n=e.findIndex(t);return n<0?e.length:n}(dD,function(e){return e.priority>t.priority}),0,t)}function bD(e){for(var t=hD,n=0;n<dD.length;n++){var r=dD[n];pD=r.priority,r.idle||(uD(r),r.advance(e),r.idle||t.push(r))}return pD=0,((hD=dD).length=0)<(dD=t).length}var xD="[-+]?\\d*\\.?\\d+",wD=xD+"%";function _D(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var SD=new RegExp("rgb"+_D(xD,xD,xD)),MD=new RegExp("rgba"+_D(xD,xD,xD,xD)),ED=new RegExp("hsl"+_D(xD,wD,wD)),TD=new RegExp("hsla"+_D(xD,wD,wD,xD)),kD=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,LD=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,CD=/^#([0-9a-fA-F]{6})$/,RD=/^#([0-9a-fA-F]{8})$/;function PD(e,t,n){return n<0&&(n+=1),1<n&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function AD(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=PD(i,r,e+1/3),o=PD(i,r,e),s=PD(i,r,e-1/3);return Math.round(255*a)<<24|Math.round(255*o)<<16|Math.round(255*s)<<8}function OD(e){var t=parseInt(e,10);return t<0?0:255<t?255:t}function ND(e){return(parseFloat(e)%360+360)%360/360}function DD(e){var t=parseFloat(e);return t<0?0:1<t?255:Math.round(255*t)}function ID(e){var t=parseFloat(e);return t<0?0:100<t?1:t/100}function zD(e){var t=function(e){var t;return"number"==typeof e?e>>>0===e&&0<=e&&e<=4294967295?e:null:(t=CD.exec(e))?parseInt(t[1]+"ff",16)>>>0:sD&&void 0!==sD[e]?sD[e]:(t=SD.exec(e))?(OD(t[1])<<24|OD(t[2])<<16|OD(t[3])<<8|255)>>>0:(t=MD.exec(e))?(OD(t[1])<<24|OD(t[2])<<16|OD(t[3])<<8|DD(t[4]))>>>0:(t=kD.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=RD.exec(e))?parseInt(t[1],16)>>>0:(t=LD.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ED.exec(e))?(255|AD(ND(t[1]),ID(t[2]),ID(t[3])))>>>0:(t=TD.exec(e))?(AD(ND(t[1]),ID(t[2]),ID(t[3]))|DD(t[4]))>>>0:null}(e);if(null===t)return e;var n=(16711680&(t=t||0))>>>16,r=(65280&t)>>>8,i=(255&t)/255;return"rgba(".concat((4278190080&t)>>>24,", ").concat(n,", ").concat(r,", ").concat(i,")")}function FD(e,t,n){if(QN.fun(e))return e;if(QN.arr(e))return FD({range:e,output:t,extrapolate:n});if(QN.str(e.output[0]))return iD(e);var r=e,i=r.output,a=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,a);return function(e,t,n,r,i,a,o,s,l){var u=l?l(e):e;if(u<t){if("identity"===o)return u;"clamp"===o&&(u=t)}if(n<u){if("identity"===s)return u;"clamp"===s&&(u=n)}if(r===i)return r;if(t===n)return e<=t?r:i;t===-1/0?u=-u:n===1/0?u-=t:u=(u-t)/(n-t);u=a(u),r===-1/0?u=-u:i===1/0?u+=r:u=u*(i-r)+r;return u}(e,a[t],a[t+1],i[t],i[t+1],l,o,s,r.map)}}function UD(){return(UD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function BD(e){return Boolean(e&&e[GD])}function HD(e){return e[VD]||null}var GD=Symbol.for("FluidValue.get"),VD=Symbol.for("FluidValue.observers"),WD=function(e){return e&&e[GD]?e[GD]():e};function jD(e,t){var n=e[VD];n&&n.forEach(function(e){!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)})}function qD(e){if(Tl(this,qD),this[GD]=void 0,this[VD]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");XD(this,e)}var XD=function(e,t){return eI(e,GD,t)};function YD(e,t){if(e[GD]){var n=e[VD];n||eI(e,VD,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function ZD(e,t){var n=e[VD];if(n&&n.has(t)){var r=n.size-1;r?n.delete(t):e[VD]=null,e.observerRemoved&&e.observerRemoved(r,t)}}function JD(e,t,n,r,i){return"rgba(".concat(Math.round(t),", ").concat(Math.round(n),", ").concat(Math.round(r),", ").concat(i,")")}function $D(t){KD||(KD=sD?new RegExp("(".concat(Object.keys(sD).join("|"),")(?!\\w)"),"g"):/^\b$/);var n=t.output.map(function(e){return WD(e).replace(nI,zD).replace(KD,zD)}),r=n.map(function(e){return e.match(tI).map(Number)}),i=r[0].map(function(e,t){return r.map(function(e){if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})}).map(function(e){return FD(UD({},t,{output:e}))});return function(e){var t=0;return n[0].replace(tI,function(){return String(i[t++](e))}).replace(rI,JD)}}function QD(e){var t=e,n=!1;if("function"!=typeof t)throw new TypeError("".concat(iI,"once requires a function parameter"));return function(){n||(t.apply(void 0,arguments),n=!0)}}var KD,eI=function(e,t,n){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})},tI=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,nI=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,rI=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,iI="react-spring: ",aI=QD(console.warn);var oI=QD(console.warn);function sI(e){return QN.str(e)&&("#"==e[0]||/\d/.test(e)||e in(sD||{}))}var lI=function(e){return hx(e,uI)},uI=[];function cI(){var e=yx()[1],t=yx(fI)[0];return lI(t.unmount),function(){t.current&&e({})}}function fI(){var e={current:!0,unmount:function(){return function(){e.current=!1}}};return e}function dI(e,t){return function(e,t,n){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}(e,vI,t)}function hI(e){return e&&e[vI]&&e[vI].getPayload()}var pI="undefined"!=typeof window&&window.document&&window.document.createElement?px:hx,vI=Symbol.for("Animated:node"),mI=function(e){return e&&e[vI]},gI=function(){function e(){Tl(this,e),this.payload=void 0,dI(this,this)}return Ll(e,[{key:"getPayload",value:function(){return this.payload||[]}}]),e}(),yI=function(){Rl(r,gI);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).done=!0,t.elapsedTime=void 0,t.lastPosition=void 0,t.lastVelocity=void 0,t.v0=void 0,t.durationProgress=0,t._value=e,QN.num(t._value)&&(t.lastPosition=t._value),t}return Ll(r,[{key:"getPayload",value:function(){return[this]}},{key:"getValue",value:function(){return this._value}},{key:"setValue",value:function(e,t){return QN.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}},{key:"reset",value:function(){var e=this.done;this.done=!1,QN.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}],[{key:"create",value:function(e){return new r(e)}}]),r}(),bI=function(){Rl(r,yI);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,0))._string=null,t._toString=void 0,t._toString=FD({output:[e,e]}),t}return Ll(r,[{key:"getValue",value:function(){var e=this._string;return null==e?this._string=this._toString(this._value):e}},{key:"setValue",value:function(e){if(QN.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!Bl(Pl(r.prototype),"setValue",this).call(this,e))return!1;this._string=null}return!0}},{key:"reset",value:function(e){e&&(this._toString=FD({output:[this.getValue(),e]})),this._value=0,Bl(Pl(r.prototype),"reset",this).call(this)}}],[{key:"create",value:function(e){return new r(e)}}]),r}(),xI={dependencies:null},wI=function(){Rl(r,gI);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this)).source=e,t.setValue(e),t}return Ll(r,[{key:"getValue",value:function(n){var r={};return tD(this.source,function(e,t){!function(e){return!!e&&e[vI]===e}(e)?BD(e)?r[t]=WD(e):n||(r[t]=e):r[t]=e.getValue(n)}),r}},{key:"setValue",value:function(e){this.source=e,this.payload=this._makePayload(e)}},{key:"reset",value:function(){this.payload&&eD(this.payload,function(e){return e.reset()})}},{key:"_makePayload",value:function(e){if(e){var t=new Set;return tD(e,this._addToPayload,t),Array.from(t)}}},{key:"_addToPayload",value:function(e){var t=this;xI.dependencies&&BD(e)&&xI.dependencies.add(e);var n=hI(e);n&&eD(n,function(e){return t.add(e)})}}]),r}(),_I=function(){Rl(r,wI);var t=Ul(r);function r(e){return Tl(this,r),t.call(this,e)}return Ll(r,[{key:"getValue",value:function(){return this.source.map(function(e){return e.getValue()})}},{key:"setValue",value:function(n){var e=this.getPayload();return n.length==e.length?e.map(function(e,t){return e.setValue(n[t])}).some(Boolean):(Bl(Pl(r.prototype),"setValue",this).call(this,n.map(SI)),!0)}}],[{key:"create",value:function(e){return new r(e)}}]),r}();function SI(e){return(sI(e)?bI:yI).create(e)}function MI(e){var t=mI(e);return t?t.constructor:QN.arr(e)?_I:sI(e)?bI:yI}function EI(){return(EI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function TI(d,h){var p=!QN.fun(d)||d.prototype&&d.prototype.isReactComponent;return cx(function(e,t){function n(){var e=r.current;p&&!e||!1===(!!e&&h.applyAnimatedValues(e,o.getValue(!0)))&&l()}var r=gx(null),i=p&&fx(function(e){r.current=function(e,t){e&&(QN.fun(e)?e(t):e.current=t);return t}(t,e)},[t]),a=Hl(function(e,t){var n=new Set;xI.dependencies=n,e.style&&(e=EI({},e,{style:t.createAnimatedStyle(e.style)}));return e=new wI(e),xI.dependencies=null,[e,n]}(e,h),2),o=a[0],s=a[1],l=cI(),u=new kI(n,s),c=gx();pI(function(){var t=c.current;c.current=u,eD(s,function(e){return YD(e,u)}),t&&(eD(t.deps,function(e){return ZD(e,t)}),NN.cancel(t.update))}),hx(n,[]),lI(function(){return function(){var t=c.current;eD(t.deps,function(e){return ZD(e,t)})}});var f=h.getComponentProps(o.getValue());return xx(d,EI({},f,{ref:i}))})}var kI=function(){function n(e,t){Tl(this,n),this.update=e,this.deps=t}return Ll(n,[{key:"eventObserved",value:function(e){"change"==e.type&&NN.write(this.update)}}]),n}();var LI=Symbol.for("AnimatedComponent"),CI=function(e){return QN.str(e)?e:e&&QN.str(e.displayName)?e.displayName:QN.fun(e)&&e.name||null};function RI(){return(RI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function PI(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return QN.fun(e)?e.apply(void 0,n):e}function AI(e,t){return QN.obj(e)?t&&e[t]:e}function OI(e){return e}var NI=function(e,t){return!0===e||!!(t&&e&&(QN.fun(e)?e(t):nD(e).includes(t)))},DI=function(e,t){return!0===e.default?e[t]:e.default?e.default[t]:void 0},II=function(e,t){var n=1<arguments.length&&void 0!==t?t:OI,r=zI;e.default&&!0!==e.default&&(e=e.default,r=Object.keys(e));var i,a={},o=jl(r);try{for(o.s();!(i=o.n()).done;){var s=i.value,l=n(e[s],s);QN.und(l)||(a[s]=l)}}catch(e){o.e(e)}finally{o.f()}return a},zI=["config","onProps","onStart","onChange","onPause","onResume","onRest"],FI={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function UI(e){var n=function(e){var n={},r=0;if(tD(e,function(e,t){FI[t]||(n[t]=e,r++)}),r)return n}(e);if(n){var r={to:n};return tD(e,function(e,t){return t in n||(r[t]=e)}),r}return RI({},e)}function BI(e){return e=WD(e),QN.arr(e)?e.map(BI):sI(e)?cD.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function HI(e){return QN.fun(e)||QN.arr(e)&&QN.obj(e[0])}function GI(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function VI(){Tl(this,VI),this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,WI)}var WI=RI({},{tension:170,friction:26},{mass:1,damping:1,easing:function(e){return e},clamp:!1});function jI(e,t){if(QN.und(t.decay)){var n=!QN.und(t.tension)||!QN.und(t.friction);!n&&QN.und(t.frequency)&&QN.und(t.damping)&&QN.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}function qI(){Tl(this,qI),this.changed=!1,this.values=XI,this.toValues=null,this.fromValues=XI,this.to=void 0,this.from=void 0,this.config=new VI,this.immediate=!1}var XI=[];function YI(c,e){var f=e.key,d=e.props,h=e.defaultProps,p=e.state,v=e.actions;return new Promise(function(e,t){var n,r,i,a=NI(null!=(n=d.cancel)?n:null==h?void 0:h.cancel,f);if(a)u();else{QN.und(d.pause)||(p.paused=NI(d.pause,f));var o=null==h?void 0:h.pause;!0!==o&&(o=p.paused||NI(o,f)),r=PI(d.delay||0,f),o?(p.resumeQueue.add(l),v.pause()):(v.resume(),l())}function s(){p.resumeQueue.add(l),p.timeouts.delete(i),i.cancel(),r=i.time-NN.now()}function l(){0<r?(i=NN.setTimeout(u,r),p.pauseQueue.add(s),p.timeouts.add(i)):u()}function u(){p.pauseQueue.delete(s),p.timeouts.delete(i),c<=(p.cancelId||0)&&(a=!0);try{v.start(RI({},d,{callId:c,cancel:a}),e)}catch(e){t(e)}}})}var ZI=function(e,t){return 1==t.length?t[0]:t.some(function(e){return e.cancelled})?QI(e.get()):t.every(function(e){return e.noop})?JI(e.get()):$I(e.get(),t.every(function(e){return e.finished}))},JI=function(e){return{value:e,noop:!0,finished:!0,cancelled:!1}},$I=function(e,t,n){return{value:e,finished:t,cancelled:2<arguments.length&&void 0!==n&&n}},QI=function(e){return{value:e,cancelled:!0,finished:!1}};function KI(o,c,f,d){var h=c.callId,p=c.parentId,v=c.onRest,m=f.asyncTo,g=f.promise;return p||o!==m||c.reset?f.promise=El(regeneratorRuntime.mark(function e(){var s,n,l,t,u,a,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(f.asyncId=h,f.asyncTo=o,s=II(c,function(e,t){return"onRest"===t?void 0:e}),t=new Promise(function(e,t){return n=e,l=t}),u=function(e){var t=h<=(f.cancelId||0)&&QI(d)||h!==f.asyncId&&$I(d,!1);if(t)throw e.result=t,l(e),e},a=function(r,i){var a=new sz,o=new lz;return El(regeneratorRuntime.mark(function e(){var n,t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(cD.skipAnimation)throw ez(f),o.result=$I(d,!1),l(o),o;e.next=5;break;case 5:return u(a),(n=QN.obj(r)?RI({},r):RI({},i,{to:r})).parentId=h,tD(s,function(e,t){QN.und(n[t])&&(n[t]=e)}),e.next=11,d.start(n);case 11:if(t=e.sent,u(a),f.paused)return e.next=16,new Promise(function(e){f.resumeQueue.add(e)});e.next=16;break;case 16:return e.abrupt("return",t);case 17:case"end":return e.stop()}},e)}))()},cD.skipAnimation)return ez(f),e.abrupt("return",$I(d,!1));e.next=9;break;case 9:return e.prev=9,i=QN.arr(o)?function(){var t=El(regeneratorRuntime.mark(function e(t){var n,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=jl(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return i=r.value,e.next=7,a(i);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}},e,null,[[1,11,14,17]])}));return function(e){return t.apply(this,arguments)}}()(o):Promise.resolve(o(a,d.stop.bind(d))),e.next=13,Promise.all([i.then(n),t]);case 13:r=$I(d.get(),!0,!1),e.next=27;break;case 16:if(e.prev=16,e.t0=e.catch(9),!(e.t0 instanceof sz)){e.next=22;break}r=e.t0.result,e.next=27;break;case 22:if(!(e.t0 instanceof lz)){e.next=26;break}r=e.t0.result,e.next=27;break;case 26:throw e.t0;case 27:return e.prev=27,h==f.asyncId&&(f.asyncId=p,f.asyncTo=p?m:void 0,f.promise=p?g:void 0),e.finish(27);case 30:return QN.fun(v)&&NN.batchedUpdates(function(){v(r,d,d.item)}),e.abrupt("return",r);case 32:case"end":return e.stop()}},e,null,[[9,16,27,30]])}))():g}function ez(e,t){rD(e.timeouts,function(e){return e.cancel()}),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}function tz(e){return e instanceof cz}function nz(e){return 0<(1&e[fz])}function rz(e){return 0<(2&e[fz])}function iz(e){return 0<(4&e[fz])}function az(e,t){return t?e[fz]|=3:e[fz]&=-3}function oz(e,t){return t?e[fz]|=4:e[fz]&=-5}var sz=function(){Rl(n,Dl(Error));var t=Ul(n);function n(){var e;return Tl(this,n),(e=t.call(this,"An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")).result=void 0,e}return n}(),lz=function(){Rl(n,Dl(Error));var t=Ul(n);function n(){var e;return Tl(this,n),(e=t.call(this,"SkipAnimationSignal")).result=void 0,e}return n}(),uz=1,cz=function(){Rl(a,qD);var i=Ul(a);function a(){var e;Tl(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=i.call.apply(i,[this].concat(n))).id=uz++,e.key=void 0,e._priority=0,e}return Ll(a,[{key:"priority",get:function(){return this._priority},set:function(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}},{key:"get",value:function(){var e=mI(this);return e&&e.getValue()}},{key:"to",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return cD.to(this,t)}},{key:"interpolate",value:function(){aI("".concat(iI,'The "interpolate" function is deprecated in v9 (use "to" instead)'));for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return cD.to(this,t)}},{key:"toJSON",value:function(){return this.get()}},{key:"observerAdded",value:function(e){1==e&&this._attach()}},{key:"observerRemoved",value:function(e){0==e&&this._detach()}},{key:"_attach",value:function(){}},{key:"_detach",value:function(){}},{key:"_onChange",value:function(e,t){jD(this,{type:"change",parent:this,value:e,idle:1<arguments.length&&void 0!==t&&t})}},{key:"_onPriorityChange",value:function(e){this.idle||vD.sort(this),jD(this,{type:"priority",parent:this,priority:e})}}]),a}(),fz=Symbol.for("SpringPhase"),dz=function(){Rl(a,cz);var i=Ul(a);function a(e,t){var n;if(Tl(this,a),(n=i.call(this)).key=void 0,n.animation=new qI,n.queue=void 0,n.defaultProps={},n._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},n._pendingCalls=new Set,n._lastCallId=0,n._lastToId=0,n._memoizedDuration=0,!QN.und(e)||!QN.und(t)){var r=QN.obj(e)?RI({},e):RI({},t,{from:e});QN.und(r.default)&&(r.default=!0),n.start(r)}return n}return Ll(a,[{key:"idle",get:function(){return!(rz(this)||this._state.asyncTo)||iz(this)}},{key:"goal",get:function(){return WD(this.animation.to)}},{key:"velocity",get:function(){var e=mI(this);return e instanceof yI?e.lastVelocity||0:e.getPayload().map(function(e){return e.lastVelocity||0})}},{key:"hasAnimated",get:function(){return nz(this)}},{key:"isAnimating",get:function(){return rz(this)}},{key:"isPaused",get:function(){return iz(this)}},{key:"advance",value:function(b){var x=this,w=!0,_=!1,S=this.animation,M=S.config,E=S.toValues,T=hI(S.to);!T&&BD(S.to)&&(E=nD(WD(S.to))),S.values.forEach(function(e,t){if(!e.done){var n=e.constructor==bI?1:T?T[t].lastPosition:E[t],r=S.immediate,i=n;if(!r){if(i=e.lastPosition,M.tension<=0)return void(e.done=!0);var a,o=e.elapsedTime+=b,s=S.fromValues[t],l=null!=e.v0?e.v0:e.v0=QN.arr(M.velocity)?M.velocity[t]:M.velocity;if(QN.und(M.duration))if(M.decay){var u=!0===M.decay?.998:M.decay,c=Math.exp(-(1-u)*o);i=s+l/(1-u)*(1-c),r=Math.abs(e.lastPosition-i)<.1,a=l*c}else{a=null==e.lastVelocity?l:e.lastVelocity;for(var f=M.precision||(s==n?.005:Math.min(1,.001*Math.abs(n-s))),d=M.restVelocity||f/10,h=M.clamp?0:M.bounce,p=!QN.und(h),v=s==n?0<e.v0:s<n,m=Math.ceil(b/1),g=0;g<m&&(Math.abs(a)>d||!(r=Math.abs(n-i)<=f));++g){p&&(i==n||n<i==v)&&(a=-a*h,i=n),i+=1*(a+=1*((1e-6*-M.tension*(i-n)+.001*-M.friction*a)/M.mass))}}else{var y=1;0<M.duration&&(x._memoizedDuration!==M.duration&&(x._memoizedDuration=M.duration,0<e.durationProgress&&(e.elapsedTime=M.duration*e.durationProgress,o=e.elapsedTime+=b)),y=1<(y=(M.progress||0)+o/x._memoizedDuration)?1:y<0?0:y,e.durationProgress=y),a=((i=s+M.easing(y)*(n-s))-e.lastPosition)/b,r=1==y}e.lastVelocity=a,Number.isNaN(i)&&(console.warn("Got NaN while animating:",x),r=!0)}T&&!T[t].done&&(r=!1),r?e.done=!0:w=!1,e.setValue(i,M.round)&&(_=!0)}});var e=mI(this),t=e.getValue();if(w){var n=WD(S.to);t===n&&!_||M.decay?_&&M.decay&&this._onChange(t):(e.setValue(n),this._onChange(n)),this._stop()}else _&&this._onChange(t)}},{key:"set",value:function(e){var t=this;return NN.batchedUpdates(function(){t._stop(),t._focus(e),t._set(e)}),this}},{key:"pause",value:function(){this._update({pause:!0})}},{key:"resume",value:function(){this._update({pause:!1})}},{key:"finish",value:function(){var e=this;if(rz(this)){var t=this.animation,n=t.to,r=t.config;NN.batchedUpdates(function(){e._onStart(),r.decay||e._set(n,!1),e._stop()})}return this}},{key:"update",value:function(e){return(this.queue||(this.queue=[])).push(e),this}},{key:"start",value:function(e,t){var n,r=this;return QN.und(e)?(n=this.queue||[],this.queue=[]):n=[QN.obj(e)?e:RI({},t,{to:e})],Promise.all(n.map(function(e){return r._update(e)})).then(function(e){return ZI(r,e)})}},{key:"stop",value:function(e){var t=this,n=this.animation.to;return this._focus(this.get()),ez(this._state,e&&this._lastCallId),NN.batchedUpdates(function(){return t._stop(n,e)}),this}},{key:"reset",value:function(){this._update({reset:!0})}},{key:"eventObserved",value:function(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}},{key:"_prepareNode",value:function(e){var t=this.key||"",n=e.to,r=e.from;null!=(n=QN.obj(n)?n[t]:n)&&!HI(n)||(n=void 0),null==(r=QN.obj(r)?r[t]:r)&&(r=void 0);var i={to:n,from:r};if(!nz(this)){if(e.reverse){var a=[r,n];n=a[0],r=a[1]}r=WD(r),QN.und(r)?mI(this)||this._set(n):this._set(r)}return i}},{key:"_update",value:function(e,n){var r=this,i=RI({},e),a=this.key,t=this.defaultProps;i.default&&Object.assign(t,II(i,function(e,t){return/^on/.test(t)?AI(e,a):e})),yz(this,i,"onProps"),bz(this,"onProps",i,this);var o=this._prepareNode(i);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");var s=this._state;return YI(++this._lastCallId,{key:a,props:i,defaultProps:t,state:s,actions:{pause:function(){iz(r)||(oz(r,!0),oD(s.pauseQueue),bz(r,"onPause",$I(r,hz(r,r.animation.to)),r))},resume:function(){iz(r)&&(oz(r,!1),rz(r)&&r._resume(),oD(s.resumeQueue),bz(r,"onResume",$I(r,hz(r,r.animation.to)),r))},start:this._merge.bind(this,o)}}).then(function(e){if(i.loop&&e.finished&&(!n||!e.noop)){var t=pz(i);if(t)return r._update(t,!0)}return e})}},{key:"_merge",value:function(e,t,n){var r=this;if(t.cancel)return this.stop(!0),n(QI(this));var i=!QN.und(e.to),a=!QN.und(e.from);if(i||a){if(!(t.callId>this._lastToId))return n(QI(this));this._lastToId=t.callId}var o=this.key,s=this.defaultProps,l=this.animation,u=l.to,c=l.from,f=e.to,d=void 0===f?u:f,h=e.from,p=void 0===h?c:h;if(!a||i||t.default&&!QN.und(d)||(d=p),t.reverse){var v=[p,d];d=v[0],p=v[1]}var m=!KN(p,c);m&&(l.from=p),p=WD(p);var g=!KN(d,u);g&&this._focus(d);var y=HI(t.to),b=l.config,x=b.decay,w=b.velocity;(i||a)&&(b.velocity=0),t.config&&!y&&function(e,t,n){for(var r in n&&(jI(n=RI({},n),t),t=RI({},n,t)),jI(e,t),Object.assign(e,t),WI)null==e[r]&&(e[r]=WI[r]);var i=e.mass,a=e.frequency,o=e.damping;QN.und(a)||(a<.01&&(a=.01),o<0&&(o=0),e.tension=Math.pow(2*Math.PI/a,2)*i,e.friction=4*Math.PI*o*i/a)}(b,PI(t.config,o),t.config!==s.config?PI(s.config,o):void 0);var _=mI(this);if(!_||QN.und(d))return n($I(this,!0));var S=QN.und(t.reset)?a&&!t.default:!QN.und(p)&&NI(t.reset,o),M=S?p:this.get(),E=BI(d),T=QN.num(E)||QN.arr(E)||sI(E),k=!y&&(!T||NI(s.immediate||t.immediate,o));if(g){var L=MI(d);if(L!==_.constructor){if(!k)throw Error("Cannot animate between ".concat(_.constructor.name," and ").concat(L.name,', as the "to" prop suggests'));_=this._set(E)}}var C=_.constructor,R=BD(d),P=!1;if(!R){var A=S||!nz(this)&&m;(g||A)&&(R=!(P=KN(BI(M),E))),(KN(l.immediate,k)||k)&&KN(b.decay,x)&&KN(b.velocity,w)||(R=!0)}if(P&&rz(this)&&(l.changed&&!S?R=!0:R||this._stop(u)),!y&&((R||BD(u))&&(l.values=_.getPayload(),l.toValues=BD(d)?null:C==bI?[1]:nD(E)),l.immediate!=k&&((l.immediate=k)||S||this._set(u)),R)){var O=l.onRest;eD(gz,function(e){return yz(r,t,e)});var N=$I(this,hz(this,u));oD(this._pendingCalls,N),this._pendingCalls.add(n),l.changed&&NN.batchedUpdates(function(){l.changed=!S,null==O||O(N,r),S?PI(s.onRest,N):null==l.onStart||l.onStart(N,r)})}S&&this._set(M),y?n(KI(t.to,t,this._state,this)):R?this._start():rz(this)&&!g?this._pendingCalls.add(n):n(JI(M))}},{key:"_focus",value:function(e){var t=this.animation;e!==t.to&&(HD(this)&&this._detach(),t.to=e,HD(this)&&this._attach())}},{key:"_attach",value:function(){var e=0,t=this.animation.to;BD(t)&&(YD(t,this),tz(t)&&(e=t.priority+1)),this.priority=e}},{key:"_detach",value:function(){var e=this.animation.to;BD(e)&&ZD(e,this)}},{key:"_set",value:function(e,t){var n=this,r=!(1<arguments.length&&void 0!==t)||t,i=WD(e);if(!QN.und(i)){var a=mI(this);if(!a||!KN(i,a.getValue())){var o=MI(i);a&&a.constructor==o?a.setValue(i):dI(this,o.create(i)),a&&NN.batchedUpdates(function(){n._onChange(i,r)})}}return mI(this)}},{key:"_onStart",value:function(){var e=this.animation;e.changed||(e.changed=!0,bz(this,"onStart",$I(this,hz(this,e.to)),this))}},{key:"_onChange",value:function(e,t){t||(this._onStart(),PI(this.animation.onChange,e,this)),PI(this.defaultProps.onChange,e,this),Bl(Pl(a.prototype),"_onChange",this).call(this,e,t)}},{key:"_start",value:function(){var e=this.animation;mI(this).reset(WD(e.to)),e.immediate||(e.fromValues=e.values.map(function(e){return e.lastPosition})),rz(this)||(az(this,!0),iz(this)||this._resume())}},{key:"_resume",value:function(){cD.skipAnimation?this.finish():vD.start(this)}},{key:"_stop",value:function(e,t){if(rz(this)){az(this,!1);var n=this.animation;eD(n.values,function(e){e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),jD(this,{type:"idle",parent:this});var r=t?QI(this.get()):$I(this.get(),hz(this,null!=e?e:n.to));oD(this._pendingCalls,r),n.changed&&(n.changed=!1,bz(this,"onRest",r,this))}}}]),a}();function hz(e,t){var n=BI(t);return KN(BI(e.get()),n)}function pz(e,t,n){var r=1<arguments.length&&void 0!==t?t:e.loop,i=2<arguments.length&&void 0!==n?n:e.to,a=PI(r);if(a){var o=!0!==a&&UI(a),s=(o||e).reverse,l=!o||o.reset;return vz(RI({},e,{loop:r,default:!1,pause:void 0,to:!s||HI(i)?i:void 0,from:l?e.from:void 0,reset:l},o))}}function vz(e){var t=e=UI(e),n=t.to,r=t.from,i=new Set;return QN.obj(n)&&mz(n,i),QN.obj(r)&&mz(r,i),e.keys=i.size?Array.from(i):null,e}function mz(e,n){tD(e,function(e,t){return null!=e&&n.add(t)})}var gz=["onStart","onRest","onChange","onPause","onResume"];function yz(e,t,n){e.animation[n]=t[n]!==DI(t,n)?AI(t[n],e.key):void 0}function bz(e,t){for(var n,r,i,a,o,s,l=arguments.length,u=new Array(2<l?l-2:0),c=2;c<l;c++)u[c-2]=arguments[c];null==(i=(a=e.animation)[t])||(n=i).call.apply(n,[a].concat(u)),null==(o=(s=e.defaultProps)[t])||(r=o).call.apply(r,[s].concat(u))}var xz=["onStart","onChange","onRest"],wz=1,_z=function(){function n(e,t){Tl(this,n),this.id=wz++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(RI({default:!0},e))}return Ll(n,[{key:"idle",get:function(){return!this._state.asyncTo&&Object.values(this.springs).every(function(e){return e.idle})}},{key:"item",get:function(){return this._item},set:function(e){this._item=e}},{key:"get",value:function(){var n={};return this.each(function(e,t){return n[t]=e.get()}),n}},{key:"set",value:function(e){for(var t in e){var n=e[t];QN.und(n)||this.springs[t].set(n)}}},{key:"update",value:function(e){return e&&this.queue.push(vz(e)),this}},{key:"start",value:function(e){var t=this.queue;return e?t=nD(e).map(vz):this.queue=[],this._flush?this._flush(this,t):(Lz(this,t),function(t,e){return Promise.all(e.map(function(e){return Sz(t,e)})).then(function(e){return ZI(t,e)})}(this,t))}},{key:"stop",value:function(t,e){if(t!==!!t&&(e=t),e){var n=this.springs;eD(nD(e),function(e){return n[e].stop(!!t)})}else ez(this._state,this._lastAsyncId),this.each(function(e){return e.stop(!!t)});return this}},{key:"pause",value:function(e){if(QN.und(e))this.start({pause:!0});else{var t=this.springs;eD(nD(e),function(e){return t[e].pause()})}return this}},{key:"resume",value:function(e){if(QN.und(e))this.start({pause:!1});else{var t=this.springs;eD(nD(e),function(e){return t[e].resume()})}return this}},{key:"each",value:function(e){tD(this.springs,e)}},{key:"_onFrame",value:function(){var i=this,e=this._events,t=e.onStart,n=e.onChange,r=e.onRest,a=0<this._active.size,o=0<this._changed.size;(a&&!this._started||o&&!this._started)&&(this._started=!0,rD(t,function(e){var t=Hl(e,2),n=t[0],r=t[1];r.value=i.get(),n(r,i,i._item)}));var s=!a&&this._started,l=o||s&&r.size?this.get():null;o&&n.size&&rD(n,function(e){var t=Hl(e,2),n=t[0],r=t[1];r.value=l,n(r,i,i._item)}),s&&(this._started=!1,rD(r,function(e){var t=Hl(e,2),n=t[0],r=t[1];r.value=l,n(r,i,i._item)}))}},{key:"eventObserved",value:function(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}NN.onFrame(this._onFrame)}}]),n}();function Sz(){return Mz.apply(this,arguments)}function Mz(){return(Mz=El(regeneratorRuntime.mark(function e(n,t,r){var i,a,o,s,l,u,c,f,d,h,p,v,m;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.keys,a=t.to,o=t.from,s=t.loop,l=t.onRest,u=t.onResolve,c=QN.obj(t.default)&&t.default,s&&(t.loop=!1),!1===a&&(t.to=null),!1===o&&(t.from=null),(f=QN.arr(a)||QN.fun(a)?a:void 0)?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):eD(xz,function(e){var i=t[e];if(QN.fun(i)){var a=n._events[e];t[e]=function(e){var t=e.finished,n=e.cancelled,r=a.get(i);r?(t||(r.finished=!1),n&&(r.cancelled=!0)):a.set(i,{value:null,finished:t||!1,cancelled:n||!1})},c&&(c[e]=t[e])}}),d=n._state,t.pause===!d.paused?(d.paused=t.pause,oD(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0),h=(i||Object.keys(n.springs)).map(function(e){return n.springs[e].start(t)}),p=!0===t.cancel||!0===DI(t,"cancel"),(f||p&&d.asyncId)&&h.push(YI(++n._lastAsyncId,{props:t,state:d,actions:{pause:$N,resume:$N,start:function(e,t){p?(ez(d,n._lastAsyncId),t(QI(n))):(e.onRest=l,t(KI(f,e,d,n)))}}})),d.paused)return e.next=15,new Promise(function(e){d.resumeQueue.add(e)});e.next=15;break;case 15:return e.t0=ZI,e.t1=n,e.next=19,Promise.all(h);case 19:if(e.t2=e.sent,v=(0,e.t0)(e.t1,e.t2),!s||!v.finished||r&&v.noop){e.next=26;break}if(m=pz(t,s,a))return Lz(n,[m]),e.abrupt("return",Sz(n,m,!0));e.next=26;break;case 26:return u&&NN.batchedUpdates(function(){return u(v,n,n.item)}),e.abrupt("return",v);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ez(e,t){var n=RI({},e.springs);return t&&eD(nD(t),function(e){QN.und(e.keys)&&(e=vz(e)),QN.obj(e.to)||(e=RI({},e,{to:void 0})),kz(n,e,function(e){return Tz(e)})}),function(n,e){tD(e,function(e,t){n.springs[t]||YD(n.springs[t]=e,n)})}(e,n),n}function Tz(e,t){var n=new dz;return n.key=e,t&&YD(n,t),n}function kz(t,n,r){n.keys&&eD(n.keys,function(e){(t[e]||(t[e]=r(e)))._prepareNode(n)})}function Lz(t,e){eD(e,function(e){kz(t.springs,e,function(e){return Tz(e,t)})})}var Cz,Rz,Pz=["children"],Az=function(e){var t=e.children,n=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i}(e,Pz),r=dx(Oz),i=n.pause||!!r.pause,a=n.immediate||!!r.immediate;n=function(e,t){var n=Hl(yx(function(){return{inputs:t,result:e()}}),1)[0],r=gx(),i=r.current,a=i;return a?Boolean(t&&a.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,a.inputs))||(a={inputs:t,result:e()}):a=n,hx(function(){r.current=a,i==n&&(n.inputs=n.result=void 0)},[a]),a.result}(function(){return{pause:i,immediate:a}},[i,a]);var o=Oz.Provider;return xx(o,{value:n},t)},Oz=(Cz=Az,Rz={},Object.assign(Cz,ux(Rz)),(Cz.Provider._context=Cz).Consumer._context=Cz);Az.Provider=Oz.Provider,Az.Consumer=Oz.Consumer;var Nz,Dz,Iz=function(){function e(r){oI("".concat(iI,'Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions'));var i=[];return eD(o,function(e,t){if(QN.und(r))i.push(e.start());else{var n=a(r,e,t);n&&i.push(e.start(n))}}),i}var o=[];e.current=o,e.add=function(e){o.includes(e)||o.push(e)},e.delete=function(e){var t=o.indexOf(e);~t&&o.splice(t,1)},e.pause=function(){var t=arguments;return eD(o,function(e){return e.pause.apply(e,Gl(t))}),this},e.resume=function(){var t=arguments;return eD(o,function(e){return e.resume.apply(e,Gl(t))}),this},e.set=function(t){eD(o,function(e){return e.set(t)})},e.start=function(r){var i=this,a=[];return eD(o,function(e,t){if(QN.und(r))a.push(e.start());else{var n=i._getProps(r,e,t);n&&a.push(e.start(n))}}),a},e.stop=function(){var t=arguments;return eD(o,function(e){return e.stop.apply(e,Gl(t))}),this},e.update=function(n){var r=this;return eD(o,function(e,t){return e.update(r._getProps(n,e,t))}),this};var a=function(e,t,n){return QN.fun(e)?e(n,t):e};return e._getProps=a,e};function zz(e,v,t){var n=arguments,m=QN.fun(v)&&v,r=m?m():v,i=r.reset,a=r.sort,o=r.trail,g=void 0===o?0:o,s=r.expires,y=void 0===s||s,l=r.onDestroyed,b=r.ref,x=r.config,u=vx(function(){return m||3==n.length?Iz():void 0},[]),c=nD(e),f=[],w=gx(null),_=i?null:w.current;pI(function(){w.current=f}),lI(function(){return function(){return eD(w.current,function(e){e.expired&&clearTimeout(e.expirationId),GI(e.ctrl,u),e.ctrl.stop(!0)})}});var S=function(e,t,n){var r=t.key,i=t.keys,a=void 0===i?r:i;if(null!==a)return QN.und(a)?e:QN.fun(a)?e.map(a):nD(a);var o=new Set;return e.map(function(t){var e=n&&n.find(function(e){return e.item===t&&e.phase!==Nz.LEAVE&&!o.has(e)});return e?(o.add(e),e.key):Fz++})}(c,m?m():v,_),d=i&&w.current||[];pI(function(){return eD(d,function(e){var t=e.ctrl,n=e.item,r=e.key;GI(t,u),PI(l,n,r)})});var h=[];if(_&&eD(_,function(e,t){e.expired?(clearTimeout(e.expirationId),d.push(e)):~(t=h[t]=S.indexOf(e.key))&&(f[t]=e)}),eD(c,function(e,t){f[t]||(f[t]={key:S[t],item:e,phase:Nz.MOUNT,ctrl:new _z},f[t].ctrl.item=e)}),h.length){var p=-1,M=(m?m():v).leave;eD(h,function(e,t){var n=_[t];~e?(p=f.indexOf(n),f[p]=RI({},n,{item:c[e]})):M&&f.splice(++p,0,n)})}QN.fun(a)&&f.sort(function(e,t){return a(e.item,t.item)});var E=-g,T=cI(),k=II(v),L=new Map;eD(f,function(e,t){var n,r,o=e.key,i=e.phase,a=m?m():v,s=PI(a.delay||0,o);if(i==Nz.MOUNT)n=a.enter,r=Nz.ENTER;else{var l=S.indexOf(o)<0;if(i!=Nz.LEAVE)if(l)n=a.leave,r=Nz.LEAVE;else{if(!(n=a.update))return;r=Nz.UPDATE}else{if(l)return;n=a.enter,r=Nz.ENTER}}if(n=PI(n,e.item,t),!(n=QN.obj(n)?UI(n):{to:n}).config){var u=x||k.config;n.config=PI(u,e.item,t,r)}var c=RI({},k,{delay:s+(E+=g),ref:b,immediate:a.immediate,reset:!1},n);if(r==Nz.ENTER&&QN.und(c.from)){var f=m?m():v,d=QN.und(f.initial)||_?f.from:f.initial;c.from=PI(d,e.item,t)}var h=c.onResolve;c.onResolve=function(e){PI(h,e);var t=w.current,n=t.find(function(e){return e.key===o});if(n&&(!e.cancelled||n.phase==Nz.UPDATE)&&n.ctrl.idle){var r=t.every(function(e){return e.ctrl.idle});if(n.phase==Nz.LEAVE){var i=PI(y,n.item);if(!1!==i){var a=!0===i?0:i;if(n.expired=!0,!r&&0<a)return void(a<=2147483647&&(n.expirationId=setTimeout(T,a)))}}r&&t.some(function(e){return e.expired})&&T()}};var p=Ez(e.ctrl,c);L.set(e,{phase:r,springs:p,payload:c})});var C=dx(Az),R=function(e){var t=gx();return hx(function(){t.current=e}),t.current}(C),P=C!==R&&function(e){for(var t in e)return!0;return!1}(C);pI(function(){P&&eD(f,function(e){e.ctrl.start({default:C})})},[C]),pI(function(){eD(L,function(e,t){var n=e.phase,r=e.payload,i=t.ctrl;t.phase=n,null==u||u.add(i),P&&n==Nz.ENTER&&i.start({default:C}),r&&(function(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}(i,r.ref),i.ref?i.update(r):i.start(r))})},i?void 0:t);function A(i){return xx(bx,null,f.map(function(e,t){var n=(L.get(e)||e.ctrl).springs,r=i(RI({},n),e.item,e,t);return r&&r.type?xx(r.type,RI({},r.props,{key:QN.str(e.key)||QN.num(e.key)?e.key:e.ctrl.id,ref:r.ref})):r}))}return u?[A,u]:A}(Dz=Nz||(Nz={})).MOUNT="mount",Dz.ENTER="enter",Dz.UPDATE="update",Dz.LEAVE="leave";var Fz=1;var Uz=function(){Rl(o,cz);var a=Ul(o);function o(e,t){var n;Tl(this,o),(n=a.call(this)).key=void 0,n.idle=!0,n.calc=void 0,n._active=new Set,n.source=e,n.calc=FD.apply(void 0,Gl(t));var r=n._get(),i=MI(r);return dI(zl(n),i.create(r)),n}return Ll(o,[{key:"advance",value:function(e){var t=this._get();KN(t,this.get())||(mI(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Hz(this._active)&&Gz(this)}},{key:"_get",value:function(){var e=QN.arr(this.source)?this.source.map(WD):nD(WD(this.source));return this.calc.apply(this,Gl(e))}},{key:"_start",value:function(){var e=this;this.idle&&!Hz(this._active)&&(this.idle=!1,eD(hI(this),function(e){e.done=!1}),cD.skipAnimation?(NN.batchedUpdates(function(){return e.advance()}),Gz(this)):vD.start(this))}},{key:"_attach",value:function(){var t=this,n=1;eD(nD(this.source),function(e){BD(e)&&YD(e,t),tz(e)&&(e.idle||t._active.add(e),n=Math.max(n,e.priority+1))}),this.priority=n,this._start()}},{key:"_detach",value:function(){var t=this;eD(nD(this.source),function(e){BD(e)&&ZD(e,t)}),this._active.clear(),Gz(this)}},{key:"eventObserved",value:function(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=nD(this.source).reduce(function(e,t){return Math.max(e,(tz(t)?t.priority:0)+1)},0))}}]),o}();function Bz(e){return!1!==e.idle}function Hz(e){return!e.size||Array.from(e).every(Bz)}function Gz(e){e.idle||(e.idle=!0,eD(hI(e),function(e){e.done=!0}),jD(e,{type:"idle",parent:e}))}function Vz(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i}cD.assign({createStringInterpolator:$D,to:function(e,t){return new Uz(e,t)}});var Wz=["style","children","scrollTop","scrollLeft"],jz=/^--/;var qz={};var Xz={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yz=["Webkit","Ms","Moz","O"];Xz=Object.keys(Xz).reduce(function(t,n){return Yz.forEach(function(e){return t[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(e,n)]=t[n]}),t},Xz);function Zz(e,t){return QN.num(e)&&0!==e?e+t:e}function Jz(e,t){return QN.arr(e)?e.every(function(e){return Jz(e,t)}):QN.num(e)?e===t:parseFloat(e)===t}var $z=["x","y","z"],Qz=/^(matrix|translate|scale|rotate|skew)/,Kz=/^(translate)/,eF=/^(rotate|skew)/,tF=function(){Rl(l,wI);var o=Ul(l);function l(e){Tl(this,l);var t=e.x,n=e.y,r=e.z,i=Vz(e,$z),a=[],s=[];return(t||n||r)&&(a.push([t||0,n||0,r||0]),s.push(function(e){return["translate3d(".concat(e.map(function(e){return Zz(e,"px")}).join(","),")"),Jz(e,0)]})),tD(i,function(e,t){if("transform"===t)a.push([e||""]),s.push(function(e){return[e,""===e]});else if(Qz.test(t)){if(delete i[t],QN.und(e))return;var o=Kz.test(t)?"px":eF.test(t)?"deg":"";a.push(nD(e)),s.push("rotate3d"===t?function(e){var t=Hl(e,4),n=t[0],r=t[1],i=t[2],a=t[3];return["rotate3d(".concat(n,",").concat(r,",").concat(i,",").concat(Zz(a,o),")"),Jz(a,0)]}:function(e){return["".concat(t,"(").concat(e.map(function(e){return Zz(e,o)}).join(","),")"),Jz(e,t.startsWith("scale")?1:0)]})}}),a.length&&(i.transform=new nF(a,s)),o.call(this,i)}return l}(),nF=function(){Rl(i,qD);var r=Ul(i);function i(e,t){var n;return Tl(this,i),(n=r.call(this))._value=null,n.inputs=e,n.transforms=t,n}return Ll(i,[{key:"get",value:function(){return this._value||(this._value=this._get())}},{key:"_get",value:function(){var o=this,s="",l=!0;return eD(this.inputs,function(e,t){var n=WD(e[0]),r=Hl(o.transforms[t](QN.arr(n)?n:e.map(WD)),2),i=r[0],a=r[1];s+=" "+i,l=l&&a}),l?"none":s}},{key:"observerAdded",value:function(e){var t=this;1==e&&eD(this.inputs,function(e){return eD(e,function(e){return BD(e)&&YD(e,t)})})}},{key:"observerRemoved",value:function(e){var t=this;0==e&&eD(this.inputs,function(e){return eD(e,function(e){return BD(e)&&ZD(e,t)})})}},{key:"eventObserved",value:function(e){"change"==e.type&&(this._value=null),jD(this,e)}}]),i}(),rF=["scrollTop","scrollLeft"];cD.assign({batchedUpdates:MR,createStringInterpolator:$D,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var iF=function(n,e){function r(e){var t=CI(e)||"Anonymous";return(e=QN.str(e)?r[e]||(r[e]=TI(e,u)):e[LI]||(e[LI]=TI(e,u))).displayName="Animated(".concat(t,")"),e}var t=1<arguments.length&&void 0!==e?e:{},i=t.applyAnimatedValues,a=void 0===i?function(){return!1}:i,o=t.createAnimatedStyle,s=void 0===o?function(e){return new wI(e)}:o,l=t.getComponentProps,u={applyAnimatedValues:a,createAnimatedStyle:s,getComponentProps:void 0===l?function(e){return e}:l};return tD(n,function(e,t){QN.arr(n)&&(t=CI(e)),r[t]=r(e)}),{animated:r}}(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(n,e){if(!n.nodeType||!n.setAttribute)return!1;var t,r,i="filter"===n.nodeName||n.parentNode&&"filter"===n.parentNode.nodeName,a=e,o=a.style,s=a.children,l=a.scrollTop,u=a.scrollLeft,c=Vz(a,Wz),f=Object.values(c),d=Object.keys(c).map(function(e){return i||n.hasAttribute(e)?e:qz[e]||(qz[e]=e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}))});for(var h in void 0!==s&&(n.textContent=s),o)if(o.hasOwnProperty(h)){var p=null==(r=o[t=h])||"boolean"==typeof r||""===r?"":"number"!=typeof r||0===r||jz.test(t)||Xz.hasOwnProperty(t)&&Xz[t]?(""+r).trim():r+"px";jz.test(h)?n.style.setProperty(h,p):n.style[h]=p}d.forEach(function(e,t){n.setAttribute(e,f[t])}),void 0!==l&&(n.scrollTop=l),void 0!==u&&(n.scrollLeft=u)},createAnimatedStyle:function(e){return new tF(e)},getComponentProps:function(e){return Vz(e,rF)}}).animated,aF="default",oF="success",sF="warning",lF="error";function uF(e){var t=e.status,n=e.onDismissClick,r=e.children;return XA("div",{className:"toast toast-".concat(t),children:[qA("div",{className:"toast-body",children:r}),qA("button",{type:"button",className:"btn btn-clear",onClick:n,children:qA("span",{className:"sr-only",children:"Dismiss"})})]})}uF.propTypes={status:RR.oneOf([aF,oF,sF,lF]),onDismissClick:RR.func.isRequired,children:RR.node.isRequired},uF.defaultProps={status:aF};var cF=["id","message"];function fF(e){var o=e.toasts,s=e.removeToast,l=gx(new Map).current,t=zz(o,{keys:function(e){return e.id},from:{height:0,transform:"translate3d(22rem, 0, 0)"},enter:function(n){return function(){var t=El(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({height:l.get(n.id).offsetHeight});case 2:return e.next=4,t({transform:"translate3d(0rem, 0, 0)"});case 4:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}()},leave:[{transform:"translate3d(22rem, 0, 0)"},{height:0}]});return qA("div",{role:"alert","aria-live":"assertive","aria-atomic":"true",children:qA("ul",{className:"toasts",children:t(function(e,t){var n=t.id,r=t.message,i=Il(t,cF),a=!o.some(function(e){return e.id===n});return qA(iF.li,{style:e,children:qA(GO,{disabled:a,children:qA("div",{ref:function(t){return function(e){null!==e?l.set(t,e):l.delete(t)}}(n),className:"toasts-item-wrap",children:qA(uF,_l(_l({},i),{},{onDismissClick:function(){s(n)},children:qA("p",{children:r})}))})})})})})})}fF.propTypes={toasts:RR.arrayOf(RR.object).isRequired,removeToast:RR.func.isRequired};var dF=JP(function(e){return{toasts:e.toasts}},function(e){return oO({removeToast:pO},e)})(fF);function hF(e){var t=e.id,n=e.label,r=e.name,i=e.value,a=e.disabled,o=e.validator,s=e.onChange,l=fN(t),u=o(i),c=u.valid,f=u.feedback,d=f?"".concat(l,"-feedback"):null;return qA(uN,{valid:c,feedback:f,feedbackId:d,children:XA("div",{className:"form-switch",children:[qA("input",{type:"checkbox",className:"checkbox",id:l,name:r,checked:i,disabled:a,"aria-describedby":d,onChange:s}),qA("span",{className:"form-icon","aria-hidden":"true"}),XA("label",{htmlFor:l,children:[n,qA("span",{className:"form-icon-target"})]})]})})}hF.propTypes={id:RR.string,label:RR.node,name:RR.string,value:RR.bool,disabled:RR.bool,validator:RR.func,onChange:RR.func},hF.defaultProps={label:"Switch",disabled:!1,validator:function(){return{valid:!0}}};var pF=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).handleSwitchChange=t.handleSwitchChange.bind(zl(t)),t}return Ll(r,[{key:"handleSwitchChange",value:function(e){this.props.setOptions(Cl({},e.target.name,e.target.checked))}},{key:"render",value:function(){var e=this.props.options;return qA("div",{className:"form-section",children:qA(hF,{label:"Wind",name:"enabled",value:e.enabled,onChange:this.handleSwitchChange})})}}]),r}();Cl(pF,"propTypes",{options:RR.object.isRequired,setOptions:RR.func}),Cl(pF,"defaultProps",{setOptions:function(){}});var vF="flagwaver/wind/SET_WIND_OPTIONS";function mF(e){return{type:vF,payload:e}}var gF={enabled:!0,controlled:!1,direction:270,speed:10};var yF=JP(function(e){return{options:e.wind}},function(e){return oO({setOptions:mF},e)})(pF);function bF(e){function r(e){v(i,e.target.value)}var t=e.id,n=e.label,i=e.name,a=e.value,o=e.min,s=e.max,l=e.step,u=e.disabled,c=e.outputPrefix,f=e.outputSuffix,d=e.ticksLabel,h=e.ticks,p=e.validator,v=e.onChange,m=fN(t),g=p(a),y=g.valid,b=g.feedback,x=b?"".concat(m,"-feedback"):null,w="".concat(m,"-ticks");return XA(uN,{valid:y,feedback:b,feedbackId:x,children:[qA("label",{className:"form-label",htmlFor:m,children:n}),XA("div",{className:"form-static"+(u?" disabled":""),children:[c,qA("output",{htmlFor:m,children:a}),f]}),qA("input",{type:"range",className:"slider",id:m,name:i,value:a,min:o,max:s,step:l,disabled:u,"aria-describedby":x,onChange:r}),h&&h.length?XA("fieldset",{className:"form-group",disabled:u,children:[qA("legend",{className:"sr-only",children:qA("span",{className:"sr-only",children:d})}),qA("ul",{className:"slider-ticks",children:h.map(function(e){var t=e.label,n=e.value;return XA("li",{children:[qA("input",{type:"radio",id:"".concat(m,"-tick-").concat(n),name:w,value:n,checked:a===n,disabled:u,onChange:r}),qA("label",{htmlFor:"".concat(m,"-tick-").concat(n),children:t})]},n)})})]}):null]})}function xF(e){var t=e.symbol,n=e.text;return XA(bx,{children:[qA("span",{"aria-hidden":"true",children:t}),qA("span",{className:"sr-only",children:n})]})}bF.propTypes={id:RR.string,label:RR.node,name:RR.string,value:RR.number,min:RR.number,max:RR.number,step:RR.oneOfType([RR.number,RR.oneOf(["any"])]),disabled:RR.bool,outputPrefix:RR.string,outputSuffix:RR.string,ticksLabel:RR.node,ticks:RR.arrayOf(RR.shape({label:RR.node,value:RR.number.isRequired})),validator:RR.func,onChange:RR.func},bF.defaultProps={label:"Slider",min:0,max:100,step:1,disabled:!1,outputPrefix:"",outputSuffix:"",ticksLabel:"Select position",ticks:[],validator:function(){return{valid:!0}},onChange:function(){}};var wF=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).handleSliderChange=t.handleSliderChange.bind(zl(t)),t.handleSwitchChange=t.handleSwitchChange.bind(zl(t)),t}return Ll(r,[{key:"handleSliderChange",value:function(e,t){this.props.setOptions(Cl({},e,Number(t)))}},{key:"handleSwitchChange",value:function(e){this.props.setOptions(Cl({},e.target.name,e.target.checked))}},{key:"render",value:function(){var e=this.props.options,t=e.enabled&&e.controlled;return XA("div",{className:"form-section",children:[qA(hF,{label:"Wind",name:"enabled",value:e.enabled,onChange:this.handleSwitchChange}),qA(hF,{label:"Wind control",name:"controlled",value:e.controlled,disabled:!e.enabled,onChange:this.handleSwitchChange}),qA(bF,{label:"Direction",name:"direction",value:e.direction,min:0,max:360,outputSuffix:"°",ticksLabel:"Select cardinal direction",ticks:[{label:qA(xF,{symbol:"N",text:"North"}),value:0},{label:qA(xF,{symbol:"E",text:"East"}),value:90},{label:qA(xF,{symbol:"S",text:"South"}),value:180},{label:qA(xF,{symbol:"W",text:"West"}),value:270}],disabled:!t,onChange:this.handleSliderChange}),qA(bF,{label:"Speed",name:"speed",value:e.speed,min:0,max:30,outputSuffix:" m/s",disabled:!t,onChange:this.handleSliderChange})]})}}]),r}();Cl(wF,"propTypes",{options:RR.object.isRequired,setOptions:RR.func}),Cl(wF,"defaultProps",{setOptions:function(){}});var _F=JP(function(e){return{options:e.wind}},function(e){return oO({setOptions:mF},e)})(wF);function SF(e){var t=e.children;return qA("div",{className:"empty empty-screen",children:qA("div",{className:"v-align",children:qA("div",{className:"v-align-content",children:t})})})}SF.propTypes={children:RR.node.isRequired};var MF=PA(void 0,{}),EF=DA(void 0,{});function TF(e,t){var n=t.toLowerCase();return Object.values(e).find(function(e){return e.toLowerCase()===n})||null}var kF=new SA({src:{defaultValue:MF.imageSrc,parse:function(e){return decodeURIComponent(e)},stringify:function(e){return encodeURIComponent(e)}},hoisting:{defaultValue:MF.hoisting,parse:function(e){return e.match(/^dex(ter)?$/gi)?Yl.DEXTER:e.match(/^sin(ister)?$/gi)?Yl.SINISTER:null},stringify:function(e){return"sin"}},orientation:{defaultValue:MF.orientation,parse:function(e){return TF(Zl,e)}},flagpoletype:{defaultValue:MF.flagpoleType,parse:function(e){return TF(Jl,e)}},vhoisting:{defaultValue:MF.verticalHoisting,parse:function(e){return TF($l,e)}},background:{defaultValue:EF.background,parse:function(e){return TF(MA,e)}}});var LF=function(e){for(var t=Object.keys(e),u={},n=0;n<t.length;n++){var r=t[n];"function"==typeof e[r]&&(u[r]=e[r])}var c,f=Object.keys(u);try{!function(n){Object.keys(n).forEach(function(e){var t=n[e];if(void 0===t(void 0,{type:iO.INIT}))throw new Error(tO(12));if(void 0===t(void 0,{type:iO.PROBE_UNKNOWN_ACTION()}))throw new Error(tO(13))})}(u)}catch(e){c=e}return function(e,t){if(void 0===e&&(e={}),c)throw c;for(var n=!1,r={},i=0;i<f.length;i++){var a=f[i],o=u[a],s=e[a],l=o(s,t);if(void 0===l)throw t&&t.type,new Error(tO(14));r[a]=l,n=n||l!==s}return(n=n||f.length!==Object.keys(e).length)?r:e}}({animationControl:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:iN,t=1<arguments.length?arguments[1]:void 0;switch(t.type){case nN:return _l(_l({},e),{},{paused:t.payload});default:return e}},toasts:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=1<arguments.length?arguments[1]:void 0;switch(t.type){case uO:return[t.payload].concat(Gl(e));case cO:return e.filter(function(e){return e.id!==t.payload});default:return e}},fileRecord:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:kA,t=1<arguments.length?arguments[1]:void 0;switch(t.type){case EA:return t.payload;default:return e}},flagGroup:PA,scenery:DA,wind:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:gF,t=1<arguments.length?arguments[1]:void 0;switch(t.type){case vF:return _l(_l({},e),t.payload);default:return e}}});var CF,RF=function e(t,n,r){var i;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(tO(0));if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error(tO(1));return r(e)(t,n)}if("function"!=typeof t)throw new Error(tO(2));var a=t,o=n,s=[],l=s,u=!1;function c(){l===s&&(l=s.slice())}function f(){if(u)throw new Error(tO(3));return o}function d(t){if("function"!=typeof t)throw new Error(tO(4));if(u)throw new Error(tO(5));var n=!0;return c(),l.push(t),function(){if(n){if(u)throw new Error(tO(6));n=!1,c();var e=l.indexOf(t);l.splice(e,1),s=null}}}function h(e){if(!function(e){if("object"!==Sl(e)||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(tO(7));if(void 0===e.type)throw new Error(tO(8));if(u)throw new Error(tO(9));try{u=!0,o=a(o,e)}finally{u=!1}for(var t=s=l,n=0;n<t.length;n++)(0,t[n])();return e}return h({type:iO.INIT}),(i={dispatch:h,subscribe:d,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw new Error(tO(10));a=e,h({type:iO.REPLACE})}})[rO]=function(){var e,n=d;return(e={subscribe:function(e){if("object"!==Sl(e)||null===e)throw new Error(tO(11));function t(){e.next&&e.next(f())}return t(),{unsubscribe:n(t)}}})[rO]=function(){return this},e},i}(function(e,t){return"flagwaver/root/RESET_APP"===t.type?LF(void 0,t):LF(e,t)},function(){for(var e=arguments.length,a=new Array(e),t=0;t<e;t++)a[t]=arguments[t];return function(i){return function(){var e=i.apply(void 0,arguments),t=function(){throw new Error(tO(15))},n={getState:e.getState,dispatch:function(){return t.apply(void 0,arguments)}},r=a.map(function(e){return e(n)});return t=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}.apply(void 0,r)(e.dispatch),eO(eO({},e),{},{dispatch:t})}}}(function(r){return function(n){return function(e){var t=n(e);return function(e){var t=e.getState();!function(e){return!!e.flagGroup.imageSrc&&!e.fileRecord.file&&e.fileRecord.url===e.flagGroup.imageSrc}(t)?kF.setState(null):kF.setState(function(e){return{src:e.flagGroup.imageSrc,hoisting:e.flagGroup.hoisting,orientation:e.flagGroup.orientation,flagpoletype:e.flagGroup.flagpoleType,vhoisting:e.flagGroup.verticalHoisting,background:e.scenery.background}}(t))}(r),t}}},function(s){return function(o){return function(e){var t=o(e);if(e.type===uO){var n=t.payload,r=n.id,i=n.message,a=Math.max(Math.min(100*i.length,3500),8e3);setTimeout(function(){s.dispatch(pO(r))},a)}return t}}})),PF="".concat("https://krikienoid.github.io/flagwaver","/").concat(t.default.svgasimg?"assets/img/site-headline-inverse.svg":"assets/img/site-headline-inverse.png"),AF="edit",OF="animate",NF="about",DF=[{key:AF,displayName:"Flag"},{key:OF,displayName:"Animation control"},{key:NF,displayName:"About"}],IF=(CF=function(){Rl(r,lx);var n=Ul(r);function r(e){var t;return Tl(this,r),(t=n.call(this,e)).state={isDrawerOpen:!1,isNavOpen:!1,appMode:AF},t.setDrawerModalRef=t.setDrawerModalRef.bind(zl(t)),t.openDrawer=t.openDrawer.bind(zl(t)),t.closeDrawer=t.closeDrawer.bind(zl(t)),t.toggleDrawer=t.toggleDrawer.bind(zl(t)),t.openNav=t.openNav.bind(zl(t)),t.closeNav=t.closeNav.bind(zl(t)),t.handleHashChange=t.handleHashChange.bind(zl(t)),t.app=null,t.drawerModalRef=null,t}return Ll(r,[{key:"componentDidMount",value:function(){this.app=GA(),this.handleHashChange(),window.addEventListener("hashchange",this.handleHashChange),this.forceUpdate()}},{key:"componentWillUnmount",value:function(){this.app.destroy(),this.app=null,window.removeEventListener("hashchange",this.handleHashChange)}},{key:"setDrawerModalRef",value:function(e){this.drawerModalRef=e}},{key:"openDrawer",value:function(){this.setState({isDrawerOpen:!0})}},{key:"closeDrawer",value:function(){this.setState({isDrawerOpen:!1})}},{key:"toggleDrawer",value:function(){this.state.isDrawerOpen?this.closeDrawer():this.openDrawer()}},{key:"openNav",value:function(){this.setState({isNavOpen:!0})}},{key:"closeNav",value:function(){this.setState({isNavOpen:!1})}},{key:"setAppMode",value:function(e){this.setState({appMode:e,isNavOpen:!1})}},{key:"handleHashChange",value:function(){HA(RF)}},{key:"render",value:function(){var r=this,e=this.state,t=e.isDrawerOpen,n=e.isNavOpen,i=e.appMode;return XA(ZA.Provider,{value:this.app,children:[qA(EO,{}),XA("div",{className:"site-wrapper","aria-hidden":t,children:[qA("header",{className:"site-header",role:"banner",children:XA("div",{className:"site-header-layout",children:[qA("div",{className:"site-header-center",children:qA("h1",{className:"site-headline",children:qA("img",{width:"189",height:"48",alt:"FlagWaver",src:PF})})}),qA("div",{className:"site-header-left",children:XA(LO.Button,{className:"site-header-btn drawer-btn",open:t,onClick:this.toggleDrawer,children:[XA("span",{className:"icon icon-bars","aria-hidden":"true",children:[qA("span",{className:"icon-bar"}),qA("span",{className:"icon-bar"}),qA("span",{className:"icon-bar"})]}),qA("span",{className:"sr-only",children:"Open drawer"})]})}),qA("div",{className:"site-header-right",children:XA("button",{type:"button",className:"site-header-btn",children:[XA("span",{className:"icon icon-dots","aria-hidden":"true",children:[qA("span",{className:"icon-dot"}),qA("span",{className:"icon-dot"}),qA("span",{className:"icon-dot"})]}),qA("span",{className:"sr-only",children:"Options"})]})})]})}),XA("main",{className:"site-main",role:"main",children:[XA("div",{className:"app-viewer",children:[qA(sN,{}),qA(QA,{})]}),qA("section",{className:"bottom-app-bar","aria-label":"Toolbar",children:i===AF||i===NF?XA(bx,{children:[qA("div",{className:"bottom-app-bar-primary",children:qA(kN,{})}),qA("div",{className:"bottom-app-bar-secondary",children:qA(yF,{})}),qA("div",{className:"bottom-app-bar-tertiary",children:qA("div",{className:"form-section",children:qA("button",{type:"button",className:"btn btn-link",onClick:this.openDrawer,children:"All options"})})})]}):i===OF?qA("div",{className:"bottom-app-bar-primary",children:qA(aN,{})}):null})]})]}),qA(QO,{active:t,focusTrapOptions:{onDeactivate:this.closeDrawer,initialFocus:this.drawerModalRef},children:XA("div",{children:[qA(LO.Overlay,{open:t,onClick:this.closeDrawer}),qA(LO,{open:t,children:qA(GO,{disabled:!t,children:XA("section",{ref:this.setDrawerModalRef,className:"focusable-wrap",tabIndex:"-1",role:"dialog","aria-label":"Drawer",children:[qA("div",{className:"panel-navbar",children:XA("div",{className:"panel-navbar-layout",children:[qA("div",{className:"panel-navbar-left",children:XA("button",n?{type:"button",className:"btn btn-link",onClick:this.closeNav,children:[qA(KO,{component:cA}),qA("span",{className:"btn-text","aria-hidden":"true",children:"Panels"}),qA("span",{className:"sr-only",children:"Close panels menu"})]}:{type:"button",className:"btn btn-link",onClick:this.openNav,children:[qA(KO,{component:uA}),qA("span",{className:"btn-text","aria-hidden":"true",children:"Panels"}),qA("span",{className:"sr-only",children:"Open panels menu"})]})}),qA("div",{className:"panel-navbar-right",children:XA(LO.Button,{className:"btn btn-link",open:t,onClick:this.closeDrawer,children:[qA(KO,{component:dA}),qA("span",{className:"sr-only",children:"Close drawer"})]})})]})}),n?qA("section",{className:"panel",children:XA("div",{className:"panel-nav",children:[qA("h2",{className:"sr-only",children:"Panel menu"}),qA("ul",{className:"nav",children:DF.map(function(e){var t=e.key,n=e.displayName;return qA("li",{className:"nav-item"+(i===t?" active":""),children:qA("button",{type:"button",className:"link",onClick:function(){r.setAppMode(t)},children:n})},t)})})]})}):i===AF?XA(bx,{children:[qA(eN,{title:"Flag",children:qA(RN,{})}),qA(eN,{title:"Wind",children:qA(_F,{})}),qA(eN,{title:"Scenery",children:qA(AN,{})})]}):i===OF?qA(eN,{title:"Animation control",children:qA(aN,{})}):i===NF?qA(eN,{title:XA(bx,{children:["FlagWaver",qA("small",{children:"2.0.1"})]}),children:qA(YA,{})}):null]})})}),qA(dF,{})]})})]})}}]),r}(),function(e){if(!window.WebGLRenderingContext)return XA(SF,{children:[qA("h2",{children:"Your browser or device does not support WebGL"}),qA("p",{children:"This page requires a browser that supports WebGL."}),qA("p",{children:qA("a",{href:"http://get.webgl.org/",rel:"noopener",target:"_blank",children:"More information"})})]});var t=document.createElement("canvas");return t.getContext("webgl")||t.getContext("experimental-webgl")?qA(CF,_l({},e)):XA(SF,{children:[qA("h2",{children:"WebGL could not be initialized"}),qA("p",{children:"Your browser supports WebGL but has encountered another problem."}),qA("p",{children:qA("a",{href:"http://get.webgl.org/troubleshooting",rel:"noopener",target:"_blank",children:"More information"})})]})}),zF=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function FF(e){navigator.serviceWorker.register(e).then(function(t){t.onupdatefound=function(){var e=t.installing;e.onstatechange=function(){"installed"===e.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}}).catch(function(e){console.error("Error during service worker registration:",e)})}SR(qA(zR,{store:RF,children:qA(IF,{})}),document.getElementById("root")),function(){if("serviceWorker"in navigator){if(new URL("https://krikienoid.github.io/flagwaver",window.location).origin!==window.location.origin)return;window.addEventListener("load",function(){var e="".concat("https://krikienoid.github.io/flagwaver","/service-worker.js");zF?function(t){fetch(t).then(function(e){404===e.status||-1===e.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then(function(e){e.unregister().then(function(){window.location.reload()})}):FF(t)}).catch(function(){console.log("No internet connection found. App is running in offline mode.")})}(e):FF(e)})}}()}();