@procore/bim-webviewer-sdk 16.1.0-remove-worker-loader.0 → 16.1.0-target-modern-browsers.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +0,0 @@
1
- /*! For license information please see 126.Procore.Bim.Webviewer.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkProcoreBim=self.webpackChunkProcoreBim||[]).push([[126],{2287:function(e,t,n){var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)},r=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.createHttp=t.withDefaults=void 0;var a=n(4301);function o(e){return i({context:{},credentials:"same-origin",headers:{},mode:"same-origin"},e)}t.withDefaults=o,t.createHttp=function(e){var t,n;void 0===e&&(e={});var s,c=(void 0===(s=e.fetch)&&(s=fetch),function(e){var t=e.url,n=(e.context,r(e,["url","context"]));return s(t,n)}),l=null!==(n=null===(t=e.middleware)||void 0===t?void 0:t.call(e,c))&&void 0!==n?n:c,h=a.compose(l,o);return function(e,t){return void 0===t&&(t={}),h(i(i({},t),{url:e}))}}},2227:function(e,t,n){var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(2287),t)},7863:(e,t,n)=>{t.p=void 0;var i=n(4301);t.p=function(e){var t=function(e){return e.endsWith("/")?e.substring(0,e.length-1):e}(e);return i.createMiddleware((function(e){return function(n){var i=n.url.startsWith("/")?n.url.substring(1,n.url.length):n.url;return n.url=t+"/"+i,e(n)}}))}},3652:function(e,t,n){var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((i=i.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHeaders=void 0;var o=n(4301);t.defaultHeaders=function(e){var t=this;return o.createMiddleware((function(n){return function(o){return r(t,void 0,void 0,(function(){return a(this,(function(t){return o.headers=i(i({},e),o.headers),[2,n(o)]}))}))}}))}},4301:(e,t)=>{function n(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t.apply(void 0,n))}}))}Object.defineProperty(t,"__esModule",{value:!0}),t.createMiddleware=t.composeMiddleware=t.compose=void 0,t.compose=n,t.composeMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return e}:1===e.length?e[0]:n.apply(void 0,e)},t.createMiddleware=function(e){return e}},3675:(e,t,n)=>{n.d(t,{TW:()=>C});var i=Uint8Array,r=Uint16Array,a=Int32Array,o=new i([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new i([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),c=new i([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(e,t){for(var n=new r(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var o=new a(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)o[s]=s-n[i]<<5|i;return{b:n,r:o}},h=l(o,2),u=h.b,d=h.r;u[28]=258,d[258]=28;for(var p=l(s,0),f=p.b,m=(p.r,new r(32768)),g=0;g<32768;++g){var v=(43690&g)>>1|(21845&g)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,m[g]=((65280&v)>>8|(255&v)<<8)>>1}var y=function(e,t,n){for(var i=e.length,a=0,o=new r(t);a<i;++a)e[a]&&++o[e[a]-1];var s,c=new r(t);for(a=1;a<t;++a)c[a]=c[a-1]+o[a-1]<<1;if(n){s=new r(1<<t);var l=15-t;for(a=0;a<i;++a)if(e[a])for(var h=a<<4|e[a],u=t-e[a],d=c[e[a]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)s[m[d]>>l]=h}else for(s=new r(i),a=0;a<i;++a)e[a]&&(s[a]=m[c[e[a]-1]++]>>15-e[a]);return s},x=new i(288);for(g=0;g<144;++g)x[g]=8;for(g=144;g<256;++g)x[g]=9;for(g=256;g<280;++g)x[g]=7;for(g=280;g<288;++g)x[g]=8;var _=new i(32);for(g=0;g<32;++g)_[g]=5;var b=y(x,9,1),w=y(_,5,1),M=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},S=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},E=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},T=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new i(n-t);return r.set(e.subarray(t,n)),r},A=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],L=function e(t,n,i){var r=new Error(n||A[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,e),!i)throw r;return r},P=new i(0),R=function(){function e(e,t){"function"==typeof e&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new i(32768),this.p=new i(0),n&&this.o.set(n)}return e.prototype.e=function(e){if(this.ondata||L(5),this.d&&L(4),this.p.length){if(e.length){var t=new i(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}}else this.p=e},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=function(e,t,n,r){var a=e.length,l=r?r.length:0;if(!a||t.f&&!t.l)return n||new i(0);var h=!n||2!=t.i,d=t.i;n||(n=new i(3*a));var p,m=function(e){var t=n.length;if(e>t){var r=new i(Math.max(2*t,e));r.set(n),n=r}},g=t.f||0,v=t.p||0,x=t.b||0,_=t.l,A=t.d,P=t.m,R=t.n,C=8*a;do{if(!_){g=S(e,v,1);var N=S(e,v+1,3);if(v+=3,!N){var D=e[(p=v,(W=4+((p+7)/8|0))-4)]|e[W-3]<<8,I=W+D;if(I>a){d&&L(0);break}h&&m(x+D),n.set(e.subarray(W,I),x),t.b=x+=D,t.p=v=8*I,t.f=g;continue}if(1==N)_=b,A=w,P=9,R=5;else if(2==N){var O=S(e,v,31)+257,U=S(e,v+10,15)+4,z=O+S(e,v+5,31)+1;v+=14;for(var F=new i(z),B=new i(19),G=0;G<U;++G)B[c[G]]=S(e,v+3*G,7);v+=3*U;var V=M(B),H=(1<<V)-1,k=y(B,V,1);for(G=0;G<z;){var W,j=k[S(e,v,H)];if(v+=15&j,(W=j>>4)<16)F[G++]=W;else{var q=0,X=0;for(16==W?(X=3+S(e,v,3),v+=2,q=F[G-1]):17==W?(X=3+S(e,v,7),v+=3):18==W&&(X=11+S(e,v,127),v+=7);X--;)F[G++]=q}}var Y=F.subarray(0,O),Z=F.subarray(O);P=M(Y),R=M(Z),_=y(Y,P,1),A=y(Z,R,1)}else L(1);if(v>C){d&&L(0);break}}h&&m(x+131072);for(var J=(1<<P)-1,Q=(1<<R)-1,K=v;;K=v){var $=(q=_[E(e,v)&J])>>4;if((v+=15&q)>C){d&&L(0);break}if(q||L(2),$<256)n[x++]=$;else{if(256==$){K=v,_=null;break}var ee=$-254;if($>264){var te=o[G=$-257];ee=S(e,v,(1<<te)-1)+u[G],v+=te}var ne=A[E(e,v)&Q],ie=ne>>4;if(ne||L(3),v+=15&ne,Z=f[ie],ie>3&&(te=s[ie],Z+=E(e,v)&(1<<te)-1,v+=te),v>C){d&&L(0);break}h&&m(x+131072);var re=x+ee;if(x<Z){var ae=l-Z,oe=Math.min(Z,re);for(ae+x<0&&L(3);x<oe;++x)n[x]=r[ae+x]}for(;x<re;x+=4)n[x]=n[x-Z],n[x+1]=n[x+1-Z],n[x+2]=n[x+2-Z],n[x+3]=n[x+3-Z];x=re}}t.l=_,t.p=K,t.b=x,t.f=g,_&&(g=1,t.m=P,t.d=A,t.n=R)}while(!g);return x==n.length?n:T(n,0,x)}(this.p,this.s,this.o);this.ondata(T(n,t,this.s.b),this.d),this.o=T(n,this.s.b-32768),this.s.b=this.o.length,this.p=T(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),C=function(){function e(e,t){R.call(this,e,t),this.v=e&&e.dictionary?2:1}return e.prototype.push=function(e,t){if(R.prototype.e.call(this,e),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray((n=this.p,i=this.v-1,(8!=(15&n[0])||n[0]>>4>7||(n[0]<<8|n[1])%31)&&L(6,"invalid zlib data"),(n[1]>>5&1)==+!i&&L(6,"invalid zlib data: "+(32&n[1]?"need":"unexpected")+" dictionary"),2+(n[1]>>3&4))),this.v=0}var n,i;t&&(this.p.length<4&&L(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),R.prototype.c.call(this,t)},e}(),N="undefined"!=typeof TextDecoder&&new TextDecoder;try{N.decode(P,{stream:!0})}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout},475:(e,t,n)=>{function i(e){return i="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},i(e)}function r(){return"object"===("undefined"==typeof process?"undefined":i(process))&&"object"===i(process.versions)&&void 0!==process.versions.node}function a(e){return e instanceof Uint8Array&&(!r()||!Buffer.isBuffer(e))}function o(e){return e instanceof ArrayBuffer}function s(e){return!!r()&&Buffer.isBuffer(e)}var c=n(8017).c,l=n(6138).d,h="Argument compressed must be type of ArrayBuffer, Buffer, or Uint8Array";t.uncompress=function(e,t){if(!a(e)&&!o(e)&&!s(e))throw new TypeError(h);var n=!1,i=!1;a(e)?n=!0:o(e)&&(i=!0,e=new Uint8Array(e));var r,l,u=new c(e),d=u.readUncompressedLength();if(-1===d)throw new Error("Invalid Snappy bitstream");if(d>t)throw new Error("The uncompressed length of ".concat(d," is too big, expect at most ").concat(t));if(n){if(r=new Uint8Array(d),!u.uncompressToBuffer(r))throw new Error("Invalid Snappy bitstream")}else if(i){if(r=new ArrayBuffer(d),l=new Uint8Array(r),!u.uncompressToBuffer(l))throw new Error("Invalid Snappy bitstream")}else if(r=Buffer.alloc(d),!u.uncompressToBuffer(r))throw new Error("Invalid Snappy bitstream");return r},t.compress=function(e){if(!a(e)&&!o(e)&&!s(e))throw new TypeError(h);var t=!1,n=!1;a(e)?t=!0:o(e)&&(n=!0,e=new Uint8Array(e));var i,r,c,u=new l(e),d=u.maxCompressedLength();if(t?(i=new Uint8Array(d),c=u.compressToBuffer(i)):n?(i=new ArrayBuffer(d),r=new Uint8Array(i),c=u.compressToBuffer(r)):(i=Buffer.alloc(d),c=u.compressToBuffer(i)),!i.slice){var p=new Uint8Array(Array.prototype.slice.call(i,0,c));if(t)return p;if(n)return p.buffer;throw new Error("Not implemented")}return i.slice(0,c)}},6138:(e,t)=>{var n=new Array(15);function i(e,t){return 506832829*e>>>t}function r(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24)}function a(e,t,n){return e[t]===e[n]&&e[t+1]===e[n+1]&&e[t+2]===e[n+2]&&e[t+3]===e[n+3]}function o(e,t,n,i,r){return n<=60?(i[r]=n-1<<2,r+=1):n<256?(i[r]=240,i[r+1]=n-1,r+=2):(i[r]=244,i[r+1]=n-1&255,i[r+2]=n-1>>>8,r+=3),function(e,t,n,i,r){var a;for(a=0;a<r;a++)n[i+a]=e[t+a]}(e,t,i,r,n),r+n}function s(e,t,n,i){return i<12&&n<2048?(e[t]=1+(i-4<<2)+(n>>>8<<5),e[t+1]=255&n,t+2):(e[t]=2+(i-1<<2),e[t+1]=255&n,e[t+2]=n>>>8,t+3)}function c(e,t,n,i){for(;i>=68;)t=s(e,t,n,64),i-=64;return i>64&&(t=s(e,t,n,60),i-=60),s(e,t,n,i)}function l(e,t,s,l,h){for(var u=1;1<<u<=s&&u<=14;)u+=1;var d=32-(u-=1);void 0===n[u]&&(n[u]=new Uint16Array(1<<u));var p,f=n[u];for(p=0;p<f.length;p++)f[p]=0;var m,g,v,y,x,_,b,w,M,S,E=t+s,T=t,A=t,L=!0;if(s>=15)for(m=E-15,v=i(r(e,t+=1),d);L;){_=32,y=t;do{if(g=v,b=_>>>5,_+=1,y=(t=y)+b,t>m){L=!1;break}v=i(r(e,y),d),x=T+f[g],f[g]=t-T}while(!a(e,t,x));if(!L)break;h=o(e,A,t-A,l,h);do{for(w=t,M=4;t+M<E&&e[t+M]===e[x+M];)M+=1;if(t+=M,h=c(l,h,w-x,M),A=t,t>=m){L=!1;break}f[i(r(e,t-1),d)]=t-1-T,x=T+f[S=i(r(e,t),d)],f[S]=t-T}while(a(e,t,x));if(!L)break;v=i(r(e,t+=1),d)}return A<E&&(h=o(e,A,E-A,l,h)),h}function h(e){this.array=e}h.prototype.maxCompressedLength=function(){var e=this.array.length;return 32+e+Math.floor(e/6)},h.prototype.compressToBuffer=function(e){var t,n=this.array,i=n.length,r=0,a=0;for(a=function(e,t,n){do{t[n]=127&e,(e>>>=7)>0&&(t[n]+=128),n+=1}while(e>0);return n}(i,e,a);r<i;)a=l(n,r,t=Math.min(i-r,65536),e,a),r+=t;return a},t.d=h},8017:(e,t)=>{var n=[0,255,65535,16777215,4294967295];function i(e,t,n,i,r){var a;for(a=0;a<r;a++)n[i+a]=e[t+a]}function r(e,t,n,i){var r;for(r=0;r<i;r++)e[t+r]=e[t-n+r]}function a(e){this.array=e,this.pos=0}a.prototype.readUncompressedLength=function(){for(var e,t,n=0,i=0;i<32&&this.pos<this.array.length;){if(e=this.array[this.pos],this.pos+=1,(t=127&e)<<i>>>i!==t)return-1;if(n|=t<<i,e<128)return n;i+=7}return-1},a.prototype.uncompressToBuffer=function(e){for(var t,a,o,s,c=this.array,l=c.length,h=this.pos,u=0;h<c.length;)if(t=c[h],h+=1,3&t){switch(3&t){case 1:a=4+(t>>>2&7),s=c[h]+(t>>>5<<8),h+=1;break;case 2:if(h+1>=l)return!1;a=1+(t>>>2),s=c[h]+(c[h+1]<<8),h+=2;break;case 3:if(h+3>=l)return!1;a=1+(t>>>2),s=c[h]+(c[h+1]<<8)+(c[h+2]<<16)+(c[h+3]<<24),h+=4}if(0===s||s>u)return!1;r(e,u,s,a),u+=a}else{if((a=1+(t>>>2))>60){if(h+3>=l)return!1;o=a-60,a=1+((a=c[h]+(c[h+1]<<8)+(c[h+2]<<16)+(c[h+3]<<24))&n[o]),h+=o}if(h+a>l)return!1;i(c,h,e,u,a),h+=a,u+=a}return!0},t.c=a},9882:(e,t,n)=>{function i(e){return i="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},i(e)}function r(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=function(e){if("object"!==i(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t,n){return t=h(t),function(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){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(){})))}catch(e){return!1}}()?Reflect.construct(t,n||[],h(e).constructor):t.apply(e,n))}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function u(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}n.d(t,{BKk:()=>zn,GWd:()=>O,I9Y:()=>ee,LlO:()=>In,eaF:()=>wn,k6q:()=>A,nWS:()=>de,pxj:()=>$n,qUd:()=>Ac,zD7:()=>nl}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t});var p=0,f=0,m=1,g=100,v=204,y=205,x=3,_=0,b=1e3,w=1001,M=1002,S=1003,E=1004,T=1005,A=1006,L=1008,P=1009,R=1012,C=1015,N=1016,D=1020,I=1022,O=1023,U=1026,z=1027,F=2300,B=2301,G=2302,V=2400,H=2401,k=2402,W=0,j=3e3,q=7680,X=519,Y=35044,Z=35048;function J(){}Object.assign(J.prototype,{addEventListener: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)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}},dispatchEvent: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),i=0,r=n.length;i<r;i++)n[i].call(this,e)}}}});for(var Q=[],K=0;K<256;K++)Q[K]=(K<16?"0":"")+K.toString(16);var $={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Q[255&e]+Q[e>>8&255]+Q[e>>16&255]+Q[e>>24&255]+"-"+Q[255&t]+Q[t>>8&255]+"-"+Q[t>>16&15|64]+Q[t>>24&255]+"-"+Q[63&n|128]+Q[n>>8&255]+"-"+Q[n>>16&255]+Q[n>>24&255]+Q[255&i]+Q[i>>8&255]+Q[i>>16&255]+Q[i>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*$.DEG2RAD},radToDeg:function(e){return e*$.RAD2DEG},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function ee(e,t){this.x=e||0,this.y=t||0}function te(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==i?i:1}Object.defineProperties(ee.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(ee.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent: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},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add: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)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub: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)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp: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},clampScalar: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},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero: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},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute: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},rotateAround:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}}),Object.assign(te,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,r,a,o){var s=n[i+0],c=n[i+1],l=n[i+2],h=n[i+3],u=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(h!==f||s!==u||c!==d||l!==p){var m=1-o,g=s*u+c*d+l*p+h*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,g*v);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*v;if(s=s*m+u*b,c=c*m+d*b,l=l*m+p*b,h=h*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+c*c+l*l+h*h);s*=w,c*=w,l*=w,h*=w}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=h}}),Object.defineProperties(te.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(te.prototype,{isQuaternion:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler: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,i=e._y,r=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(i/2),h=o(r/2),u=s(n/2),d=s(i/2),p=s(r/2);return"XYZ"===a?(this._x=u*l*h+c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h-u*d*p):"YXZ"===a?(this._x=u*l*h+c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h+u*d*p):"ZXY"===a?(this._x=u*l*h-c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h-u*d*p):"ZYX"===a?(this._x=u*l*h-c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h+u*d*p):"YZX"===a?(this._x=u*l*h+c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h-u*d*p):"XZY"===a&&(this._x=u*l*h-c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h+u*d*p),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],h=n[6],u=n[10],d=i+s+u;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(h-c)*t,this._y=(a-l)*t,this._z=(o-r)*t):i>s&&i>u?(t=2*Math.sqrt(1+i-s-u),this._w=(h-c)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(a+l)/t):s>u?(t=2*Math.sqrt(1+s-i-u),this._w=(a-l)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(c+h)/t):(t=2*Math.sqrt(1+u-i-s),this._w=(o-r)/t,this._x=(a+l)/t,this._y=(c+h)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs($.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var i=Math.min(1,t/n);return this.slerp(e,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize: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},multiply: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)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+i*c-r*s,this._y=i*l+a*s+r*o-n*c,this._z=r*l+a*c+n*s-i*o,this._w=a*l-n*o-i*s-r*c,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*e._w+n*e._x+i*e._y+r*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),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-t;return this._w=c*a+t*this._w,this._x=c*n+t*this._x,this._y=c*i+t*this._y,this._z=c*r+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),h=Math.atan2(l,o),u=Math.sin((1-t)*h)/l,d=Math.sin(t*h)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var ne=new re,ie=new te;function re(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(re.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent: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},getComponent: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)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add: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)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub: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)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply: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)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ie.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(ie.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*i-o*n,l=s*n+o*t-r*i,h=s*i+r*n-a*t,u=-r*t-a*n-o*i;return this.x=c*s+u*-r+l*-o-h*-a,this.y=l*s+u*-a+h*-r-c*-o,this.z=h*s+u*-o+c*-a-l*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min: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},max: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},clamp: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},clampScalar: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},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero: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},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp: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},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross: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)},crossVectors:function(e,t){var n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(e){return ne.copy(this).projectOnVector(e),this.sub(ne)},reflect:function(e){return this.sub(ne.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());0===t&&console.error("THREE.Vector3: angleTo() can't handle zero length vectors.");var n=this.dot(e)/t;return Math.acos($.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute: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}});var ae,oe=new re;function se(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.assign(se.prototype,{isMatrix3:!0,set:function(e,t,n,i,r,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=i,l[2]=o,l[3]=t,l[4]=r,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy: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},setFromMatrix4: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},applyToBufferAttribute:function(e){for(var t=0,n=e.count;t<n;t++)oe.x=e.getX(t),oe.y=e.getY(t),oe.z=e.getZ(t),oe.applyMatrix3(this),e.setXYZ(t,oe.x,oe.y,oe.z);return e},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return r[0]=a*f+o*v+s*_,r[3]=a*m+o*y+s*b,r[6]=a*g+o*x+s*w,r[1]=c*f+l*v+h*_,r[4]=c*m+l*y+h*b,r[7]=c*g+l*x+h*w,r[2]=u*f+d*v+p*_,r[5]=u*m+d*y+p*b,r[8]=u*g+d*x+p*w,this},multiplyScalar: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},determinant:function(){var e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*r*l+n*o*s+i*r*c-i*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,i=this.elements,r=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],h=n[6],u=n[7],d=n[8],p=d*c-l*u,f=l*h-d*s,m=u*s-c*h,g=r*p+a*f+o*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return i[0]=p*y,i[1]=(o*u-d*a)*y,i[2]=(l*a-o*c)*y,i[3]=f*y,i[4]=(d*r-o*h)*y,i[5]=(o*s-l*r)*y,i[6]=m*y,i[7]=(a*h-u*r)*y,i[8]=(c*r-a*s)*y,this},transpose: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},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray: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},setUvTransform:function(e,t,n,i,r,a,o){var s=Math.cos(r),c=Math.sin(r);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-i*c,i*s,-i*(-c*a+s*o)+o+t,0,0,1)},scale: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},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],c=i[4],l=i[7];return i[0]=t*r+n*s,i[3]=t*a+n*c,i[6]=t*o+n*l,i[1]=-n*r+t*s,i[4]=-n*a+t*c,i[7]=-n*o+t*l,this},translate: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},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var ce={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===ae&&(ae=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),ae.width=e.width,ae.height=e.height;var n=ae.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ae}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},le=0;function he(e,t,n,i,r,a,o,s,c,l){Object.defineProperty(this,"id",{value:le++}),this.uuid=$.generateUUID(),this.name="",this.image=void 0!==e?e:he.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:he.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:w,this.wrapT=void 0!==i?i:w,this.magFilter=void 0!==r?r:A,this.minFilter=void 0!==a?a:L,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:O,this.type=void 0!==s?s:P,this.offset=new ee(0,0),this.repeat=new ee(1,1),this.center=new ee(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new se,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:j,this.version=0,this.onUpdate=null}function ue(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==i?i:1}function de(e,t,n){this.width=e,this.height=t,this.scissor=new ue(0,0,e,t),this.scissorTest=!1,this.viewport=new ue(0,0,e,t),n=n||{},this.texture=new he(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:A,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function pe(e,t,n){de.call(this,e,t,n),this.samples=4}he.DEFAULT_IMAGE=void 0,he.DEFAULT_MAPPING=300,he.prototype=Object.assign(Object.create(J.prototype),{constructor:he,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy: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.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON: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 i=this.image;if(void 0===i.uuid&&(i.uuid=$.generateUUID()),!t&&void 0===e.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(ce.getDataURL(i[a]))}else r=ce.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case b:e.x=e.x-Math.floor(e.x);break;case w:e.x=e.x<0?0:1;break;case M: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||e.y>1)switch(this.wrapT){case b:e.y=e.y-Math.floor(e.y);break;case w:e.y=e.y<0?0:1;break;case M: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}}),Object.defineProperty(he.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(ue.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(ue.prototype,{isVector4:!0,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent: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},getComponent: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)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy: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},add: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)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors: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},addScaledVector: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},sub: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)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors: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},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion: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},setAxisAngleFromRotationMatrix:function(e){var t,n,i,r,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],h=s[8],u=s[1],d=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(l-u)<a&&Math.abs(h-f)<a&&Math.abs(p-m)<a){if(Math.abs(l+u)<o&&Math.abs(h+f)<o&&Math.abs(p+m)<o&&Math.abs(c+d+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var v=(c+1)/2,y=(d+1)/2,x=(g+1)/2,_=(l+u)/4,b=(h+f)/4,w=(p+m)/4;return v>y&&v>x?v<a?(n=0,i=.707106781,r=.707106781):(i=_/(n=Math.sqrt(v)),r=b/n):y>x?y<a?(n=.707106781,i=0,r=.707106781):(n=_/(i=Math.sqrt(y)),r=w/i):x<a?(n=.707106781,i=.707106781,r=0):(n=b/(r=Math.sqrt(x)),i=w/r),this.set(n,i,r,t),this}var M=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-l)*(u-l));return Math.abs(M)<.001&&(M=1),this.x=(m-p)/M,this.y=(h-f)/M,this.z=(u-l)/M,this.w=Math.acos((c+d+g-1)/2),this},min: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},max: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},clamp: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},clampScalar: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},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor: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},ceil: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},round: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},roundToZero: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},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp: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},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute: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}}),de.prototype=Object.assign(Object.create(J.prototype),{constructor:de,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),pe.prototype=Object.assign(Object.create(de.prototype),{constructor:pe,isWebGLMultisampleRenderTarget:!0,copy:function(e){return de.prototype.copy.call(this,e),this.samples=e.samples,this}});var fe=new re,me=new be,ge=new re(0,0,0),ve=new re(1,1,1),ye=new re,xe=new re,_e=new re;function be(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(be.prototype,{isMatrix4:!0,set:function(e,t,n,i,r,a,o,s,c,l,h,u,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new be).fromArray(this.elements)},copy: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},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis: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},extractRotation:function(e){var t=this.elements,n=e.elements,i=1/fe.setFromMatrixColumn(e,0).length(),r=1/fe.setFromMatrixColumn(e,1).length(),a=1/fe.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,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},makeRotationFromEuler: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,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){var u=a*l,d=a*h,p=o*l,f=o*h;t[0]=s*l,t[4]=-s*h,t[8]=c,t[1]=d+p*c,t[5]=u-f*c,t[9]=-o*s,t[2]=f-u*c,t[6]=p+d*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,g=s*h,v=c*l,y=c*h;t[0]=m+y*o,t[4]=v*o-g,t[8]=a*c,t[1]=a*h,t[5]=a*l,t[9]=-o,t[2]=g*o-v,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order)m=s*l,g=s*h,v=c*l,y=c*h,t[0]=m-y*o,t[4]=-a*h,t[8]=v+g*o,t[1]=g+v*o,t[5]=a*l,t[9]=y-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s;else if("ZYX"===e.order)u=a*l,d=a*h,p=o*l,f=o*h,t[0]=s*l,t[4]=p*c-d,t[8]=u*c+f,t[1]=s*h,t[5]=f*c+u,t[9]=d*c-p,t[2]=-c,t[6]=o*s,t[10]=a*s;else if("YZX"===e.order){var x=a*s,_=a*c,b=o*s,w=o*c;t[0]=s*l,t[4]=w-x*h,t[8]=b*h+_,t[1]=h,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=_*h+b,t[10]=x-w*h}else"XZY"===e.order&&(x=a*s,_=a*c,b=o*s,w=o*c,t[0]=s*l,t[4]=-h,t[8]=c*l,t[1]=x*h+w,t[5]=a*l,t[9]=_*h-b,t[2]=b*h-_,t[6]=o*l,t[10]=w*h+x);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(ge,e,ve)},lookAt:function(e,t,n){var i=this.elements;return _e.subVectors(e,t),0===_e.lengthSq()&&(_e.z=1),_e.normalize(),ye.crossVectors(n,_e),0===ye.lengthSq()&&(1===Math.abs(n.z)?_e.x+=1e-4:_e.z+=1e-4,_e.normalize(),ye.crossVectors(n,_e)),ye.normalize(),xe.crossVectors(_e,ye),i[0]=ye.x,i[4]=xe.x,i[8]=_e.x,i[1]=ye.y,i[5]=xe.y,i[9]=_e.y,i[2]=ye.z,i[6]=xe.z,i[10]=_e.z,this},multiply: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)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],w=i[4],M=i[8],S=i[12],E=i[1],T=i[5],A=i[9],L=i[13],P=i[2],R=i[6],C=i[10],N=i[14],D=i[3],I=i[7],O=i[11],U=i[15];return r[0]=a*b+o*E+s*P+c*D,r[4]=a*w+o*T+s*R+c*I,r[8]=a*M+o*A+s*C+c*O,r[12]=a*S+o*L+s*N+c*U,r[1]=l*b+h*E+u*P+d*D,r[5]=l*w+h*T+u*R+d*I,r[9]=l*M+h*A+u*C+d*O,r[13]=l*S+h*L+u*N+d*U,r[2]=p*b+f*E+m*P+g*D,r[6]=p*w+f*T+m*R+g*I,r[10]=p*M+f*A+m*C+g*O,r[14]=p*S+f*L+m*N+g*U,r[3]=v*b+y*E+x*P+_*D,r[7]=v*w+y*T+x*R+_*I,r[11]=v*M+y*A+x*C+_*O,r[15]=v*S+y*L+x*N+_*U,this},multiplyScalar: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},applyToBufferAttribute:function(e){for(var t=0,n=e.count;t<n;t++)fe.x=e.getX(t),fe.y=e.getY(t),fe.z=e.getZ(t),fe.applyMatrix4(this),e.setXYZ(t,fe.x,fe.y,fe.z);return e},determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*s*h-i*c*h-r*o*u+n*c*u+i*o*d-n*s*d)+e[7]*(+t*s*d-t*c*u+r*a*u-i*a*d+i*c*l-r*s*l)+e[11]*(+t*c*h-t*o*d-r*a*h+n*a*d+r*o*l-n*c*l)+e[15]*(-i*o*l-t*s*h+t*o*u+i*a*h-n*a*u+n*s*l)},transpose: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},setPosition:function(e,t,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this},getInverse:function(e,t){var n=this.elements,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],_=p*y*u-v*f*u+v*h*m-l*y*m-p*h*x+l*f*x,b=g*f*u-d*y*u-g*h*m+c*y*m+d*h*x-c*f*x,w=d*v*u-g*p*u+g*l*m-c*v*m-d*l*x+c*p*x,M=g*p*h-d*v*h-g*l*f+c*v*f+d*l*y-c*p*y,S=r*_+a*b+o*w+s*M;if(0===S){var E="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(E);return console.warn(E),this.identity()}var T=1/S;return n[0]=_*T,n[1]=(v*f*s-p*y*s-v*o*m+a*y*m+p*o*x-a*f*x)*T,n[2]=(l*y*s-v*h*s+v*o*u-a*y*u-l*o*x+a*h*x)*T,n[3]=(p*h*s-l*f*s-p*o*u+a*f*u+l*o*m-a*h*m)*T,n[4]=b*T,n[5]=(d*y*s-g*f*s+g*o*m-r*y*m-d*o*x+r*f*x)*T,n[6]=(g*h*s-c*y*s-g*o*u+r*y*u+c*o*x-r*h*x)*T,n[7]=(c*f*s-d*h*s+d*o*u-r*f*u-c*o*m+r*h*m)*T,n[8]=w*T,n[9]=(g*p*s-d*v*s-g*a*m+r*v*m+d*a*x-r*p*x)*T,n[10]=(c*v*s-g*l*s+g*a*u-r*v*u-c*a*x+r*l*x)*T,n[11]=(d*l*s-c*p*s-d*a*u+r*p*u+c*a*m-r*l*m)*T,n[12]=M*T,n[13]=(d*v*o-g*p*o+g*a*f-r*v*f-d*a*y+r*p*y)*T,n[14]=(g*l*o-c*v*o-g*a*h+r*v*h+c*a*y-r*l*y)*T,n[15]=(c*p*o-d*l*o+d*a*h-r*p*h-c*a*f+r*l*f)*T,this},scale:function(e){var t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this},getMaxScaleOnAxis: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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX: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},makeRotationY: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},makeRotationZ: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},makeRotationAxis:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,c=r*a,l=r*o;return this.set(c*a+n,c*o-i*s,c*s+i*o,0,c*o+i*s,l*o+n,l*s-i*a,0,c*s-i*o,l*s+i*a,r*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,c=r+r,l=a+a,h=o+o,u=r*c,d=r*l,p=r*h,f=a*l,m=a*h,g=o*h,v=s*c,y=s*l,x=s*h,_=n.x,b=n.y,w=n.z;return i[0]=(1-(f+g))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(u+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+y)*w,i[9]=(m-v)*w,i[10]=(1-(u+f))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:function(e,t,n){var i=this.elements,r=fe.set(i[0],i[1],i[2]).length(),a=fe.set(i[4],i[5],i[6]).length(),o=fe.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],me.copy(this);var s=1/r,c=1/a,l=1/o;return me.elements[0]*=s,me.elements[1]*=s,me.elements[2]*=s,me.elements[4]*=c,me.elements[5]*=c,me.elements[6]*=c,me.elements[8]*=l,me.elements[9]*=l,me.elements[10]*=l,t.setFromRotationMatrix(me),n.x=r,n.y=a,n.z=o,this},makePerspective:function(e,t,n,i,r,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*r/(t-e),c=2*r/(n-i),l=(t+e)/(t-e),h=(n+i)/(n-i),u=-(a+r)/(a-r),d=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,i,r,a){var o=this.elements,s=1/(t-e),c=1/(n-i),l=1/(a-r),h=(t+e)*s,u=(n+i)*c,d=(a+r)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var we=new be,Me=new te;function Se(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||Se.DefaultOrder}function Ee(){this.mask=1}Se.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Se.DefaultOrder="XYZ",Object.defineProperties(Se.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(Se.prototype,{isEuler:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=$.clamp,r=e.elements,a=r[0],o=r[4],s=r[8],c=r[1],l=r[5],h=r[9],u=r[2],d=r[6],p=r[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===t?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return we.makeRotationFromQuaternion(e),this.setFromRotationMatrix(we,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return Me.setFromEuler(this),this.setFromQuaternion(Me,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray: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},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new re(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(Ee.prototype,{set:function(e){this.mask=1<<e},enable:function(e){this.mask|=1<<e},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e},disable:function(e){this.mask&=~(1<<e)},disableAll:function(){this.mask=0},test:function(e){return!!(this.mask&e.mask)}});var Te=0,Ae=new re,Le=new te,Pe=new be,Re=new re,Ce=new re,Ne=new re,De=new te,Ie=new re(1,0,0),Oe=new re(0,1,0),Ue=new re(0,0,1),ze={type:"added"},Fe={type:"removed"};function Be(){Object.defineProperty(this,"id",{value:Te++}),this.uuid=$.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Be.DefaultUp.clone();var e=new re,t=new Se,n=new te,i=new re(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new be},normalMatrix:{value:new se}}),this.matrix=new be,this.matrixWorld=new be,this.matrixAutoUpdate=Be.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ee,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Ge(){Be.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Be.DefaultUp=new re(0,1,0),Be.DefaultMatrixAutoUpdate=!0,Be.prototype=Object.assign(Object.create(J.prototype),{constructor:Be,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return Le.setFromAxisAngle(e,t),this.quaternion.multiply(Le),this},rotateOnWorldAxis:function(e,t){return Le.setFromAxisAngle(e,t),this.quaternion.premultiply(Le),this},rotateX:function(e){return this.rotateOnAxis(Ie,e)},rotateY:function(e){return this.rotateOnAxis(Oe,e)},rotateZ:function(e){return this.rotateOnAxis(Ue,e)},translateOnAxis:function(e,t){return Ae.copy(e).applyQuaternion(this.quaternion),this.position.add(Ae.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(Ie,e)},translateY:function(e){return this.translateOnAxis(Oe,e)},translateZ:function(e){return this.translateOnAxis(Ue,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(Pe.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?Re.copy(e):Re.set(e,t,n);var i=this.parent;this.updateWorldMatrix(!0,!1),Ce.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Pe.lookAt(Ce,Re,this.up):Pe.lookAt(Re,Ce,this.up),this.quaternion.setFromRotationMatrix(Pe),i&&(Pe.extractRotation(i.matrixWorld),Le.setFromRotationMatrix(Pe),this.quaternion.premultiply(Le.inverse()))},add:function(e){if(arguments.length>1){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),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(ze)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){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(Fe)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),Pe.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Pe.multiply(e.parent.matrixWorld)),e.applyMatrix(Pe),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new re),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new te),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ce,e,Ne),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new re),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ce,De,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new re),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld: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),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix: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 i=this.children,r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh&&this.drawMode!==W&&(i.drawMode=this.drawMode),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.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,c=o.length;s<c;s++){var l=o[s];r(e.shapes,l)}else r(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var h=[];for(s=0,c=this.material.length;s<c;s++)h.push(r(e.materials,this.material[s]));i.material=h}else i.material=r(e.materials,this.material);if(this.children.length>0)for(i.children=[],s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(e).object);if(t){var u=m(e.geometries),d=m(e.materials),p=m(e.textures),f=m(e.images);o=m(e.shapes),u.length>0&&(n.geometries=u),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),f.length>0&&(n.images=f),o.length>0&&(n.shapes=o)}return n.object=i,n;function m(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),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===t)for(var n=0;n<e.children.length;n++){var i=e.children[n];this.add(i.clone())}return this}}),Ge.prototype=Object.assign(Object.create(Be.prototype),{constructor:Ge,isScene:!0,copy:function(e,t){return Be.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.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},toJSON:function(e){var t=Be.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Ve=[new re,new re,new re,new re,new re,new re,new re,new re],He=new re,ke=new et,We=new re,je=new re,qe=new re,Xe=new re,Ye=new re,Ze=new re,Je=new re,Qe=new re,Ke=new re,$e=new re;function et(e,t){this.min=void 0!==e?e:new re(1/0,1/0,1/0),this.max=void 0!==t?t:new re(-1/0,-1/0,-1/0)}function tt(e,t,n,i,r){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){$e.fromArray(e,a);var s=r.x*Math.abs($e.x)+r.y*Math.abs($e.y)+r.z*Math.abs($e.z),c=t.dot($e),l=n.dot($e),h=i.dot($e);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>s)return!1}return!0}Object.assign(et.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],h=e[s+1],u=e[s+2];l<t&&(t=l),h<n&&(n=h),u<i&&(i=u),l>r&&(r=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),h=e.getY(s),u=e.getZ(s);l<t&&(t=l),h<n&&(n=h),u<i&&(i=u),l>r&&(r=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=He.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty: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},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new re),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new re),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),ke.copy(t.boundingBox),ke.applyMatrix4(e.matrixWorld),this.expandByPoint(ke.min),this.expandByPoint(ke.max));for(var n=e.children,i=0,r=n.length;i<r;i++)this.expandByObject(n[i]);return this},containsPoint: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)},containsBox: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},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new re),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox: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)},intersectsSphere:function(e){return this.clampPoint(e.center,He),He.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(Je),Qe.subVectors(this.max,Je),We.subVectors(e.a,Je),je.subVectors(e.b,Je),qe.subVectors(e.c,Je),Xe.subVectors(je,We),Ye.subVectors(qe,je),Ze.subVectors(We,qe);var t=[0,-Xe.z,Xe.y,0,-Ye.z,Ye.y,0,-Ze.z,Ze.y,Xe.z,0,-Xe.x,Ye.z,0,-Ye.x,Ze.z,0,-Ze.x,-Xe.y,Xe.x,0,-Ye.y,Ye.x,0,-Ze.y,Ze.x,0];return!!tt(t,We,je,qe,Qe)&&!!tt(t=[1,0,0,0,1,0,0,0,1],We,je,qe,Qe)&&(Ke.crossVectors(Xe,Ye),tt(t=[Ke.x,Ke.y,Ke.z],We,je,qe,Qe))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new re),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return He.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(He).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()||(Ve[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ve[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ve[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ve[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ve[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ve[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ve[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ve[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ve)),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var nt=new et;function it(e,t){this.center=void 0!==e?e:new re,this.radius=void 0!==t?t:0}Object.assign(it.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):nt.setFromPoints(e).getCenter(n);for(var i=0,r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new re),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new et),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var rt=new re,at=new re,ot=new re,st=new re,ct=new re,lt=new re,ht=new re;function ut(e,t){this.origin=void 0!==e?e:new re,this.direction=void 0!==t?t:new re(0,0,-1)}Object.assign(ut.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new re),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,rt)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new re),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)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=rt.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(rt.copy(this.direction).multiplyScalar(t).add(this.origin),rt.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,i){at.copy(e).add(t).multiplyScalar(.5),ot.copy(t).sub(e).normalize(),st.copy(this.origin).sub(at);var r,a,o,s,c=.5*e.distanceTo(t),l=-this.direction.dot(ot),h=st.dot(this.direction),u=-st.dot(ot),d=st.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(a=l*h-u,s=c*p,(r=l*u-h)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(r*=f)*(r+l*(a*=f)+2*h)+a*(l*r+a+2*u)+d}else a=c,o=-(r=Math.max(0,-(l*a+h)))*r+a*(a+2*u)+d;else a=-c,o=-(r=Math.max(0,-(l*a+h)))*r+a*(a+2*u)+d;else a<=-s?o=-(r=Math.max(0,-(-l*c+h)))*r+(a=r>0?-c:Math.min(Math.max(-c,-u),c))*(a+2*u)+d:a<=s?(r=0,o=(a=Math.min(Math.max(-c,-u),c))*(a+2*u)+d):o=-(r=Math.max(0,-(l*c+h)))*r+(a=r>0?c:Math.min(Math.max(-c,-u),c))*(a+2*u)+d;else a=l>0?-c:c,o=-(r=Math.max(0,-(l*a+h)))*r+a*(a+2*u)+d;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(ot).multiplyScalar(a).add(at),o},intersectSphere:function(e,t){rt.subVectors(e.center,this.origin);var n=rt.dot(this.direction),i=rt.dot(rt)-n*n,r=e.radius*e.radius;if(i>r)return null;var a=Math.sqrt(r-i),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane: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 n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,i,r,a,o,s,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(n=(e.min.x-u.x)*c,i=(e.max.x-u.x)*c):(n=(e.max.x-u.x)*c,i=(e.min.x-u.x)*c),l>=0?(r=(e.min.y-u.y)*l,a=(e.max.y-u.y)*l):(r=(e.max.y-u.y)*l,a=(e.min.y-u.y)*l),n>a||r>i?null:((r>n||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),h>=0?(o=(e.min.z-u.z)*h,s=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,s=(e.min.z-u.z)*h),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,rt)},intersectTriangle:function(e,t,n,i,r){ct.subVectors(t,e),lt.subVectors(n,e),ht.crossVectors(ct,lt);var a,o=this.direction.dot(ht);if(o>0){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}st.subVectors(this.origin,e);var s=a*this.direction.dot(lt.crossVectors(st,lt));if(s<0)return null;var c=a*this.direction.dot(ct.cross(st));if(c<0)return null;if(s+c>o)return null;var l=-a*st.dot(ht);return l<0?null:this.at(l/o,r)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var dt=new re,pt=new re,ft=new se;function mt(e,t){this.normal=void 0!==e?e:new re(1,0,0),this.constant=void 0!==t?t:0}Object.assign(mt.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var i=dt.subVectors(n,t).cross(pt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new re),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new re);var n=e.delta(dt),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?void 0:t.copy(n).multiplyScalar(r).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new re),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||ft.getNormalMatrix(e),i=this.coplanarPoint(dt).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var gt=new re,vt=new re,yt=new re,xt=new re,_t=new re,bt=new re,wt=new re,Mt=new re,St=new re,Et=new re;function Tt(e,t,n){this.a=void 0!==e?e:new re,this.b=void 0!==t?t:new re,this.c=void 0!==n?n:new re}Object.assign(Tt,{getNormal:function(e,t,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new re),i.subVectors(n,t),gt.subVectors(e,t),i.cross(gt);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(e,t,n,i,r){gt.subVectors(i,t),vt.subVectors(n,t),yt.subVectors(e,t);var a=gt.dot(gt),o=gt.dot(vt),s=gt.dot(yt),c=vt.dot(vt),l=vt.dot(yt),h=a*c-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new re),0===h)return r.set(-2,-1,-1);var u=1/h,d=(c*s-o*l)*u,p=(a*l-o*s)*u;return r.set(1-d-p,p,d)},containsPoint:function(e,t,n,i){return Tt.getBarycoord(e,t,n,i,xt),xt.x>=0&&xt.y>=0&&xt.x+xt.y<=1},getUV:function(e,t,n,i,r,a,o,s){return this.getBarycoord(e,t,n,i,xt),s.set(0,0),s.addScaledVector(r,xt.x),s.addScaledVector(a,xt.y),s.addScaledVector(o,xt.z),s},isFrontFacing:function(e,t,n,i){return gt.subVectors(n,t),vt.subVectors(e,t),gt.cross(vt).dot(i)<0}}),Object.assign(Tt.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return gt.subVectors(this.c,this.b),vt.subVectors(this.a,this.b),.5*gt.cross(vt).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new re),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Tt.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new mt),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return Tt.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,i,r){return Tt.getUV(e,this.a,this.b,this.c,t,n,i,r)},containsPoint:function(e){return Tt.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return Tt.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new re);var n,i,r=this.a,a=this.b,o=this.c;_t.subVectors(a,r),bt.subVectors(o,r),Mt.subVectors(e,r);var s=_t.dot(Mt),c=bt.dot(Mt);if(s<=0&&c<=0)return t.copy(r);St.subVectors(e,a);var l=_t.dot(St),h=bt.dot(St);if(l>=0&&h<=l)return t.copy(a);var u=s*h-l*c;if(u<=0&&s>=0&&l<=0)return n=s/(s-l),t.copy(r).addScaledVector(_t,n);Et.subVectors(e,o);var d=_t.dot(Et),p=bt.dot(Et);if(p>=0&&d<=p)return t.copy(o);var f=d*c-s*p;if(f<=0&&c>=0&&p<=0)return i=c/(c-p),t.copy(r).addScaledVector(bt,i);var m=l*p-d*h;if(m<=0&&h-l>=0&&d-p>=0)return wt.subVectors(o,a),i=(h-l)/(h-l+(d-p)),t.copy(a).addScaledVector(wt,i);var g=1/(m+f+u);return n=f*g,i=u*g,t.copy(r).addScaledVector(_t,n).addScaledVector(bt,i)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var At={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},Lt={h:0,s:0,l:0},Pt={h:0,s:0,l:0};function Rt(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function Ct(e,t,n){return n<0&&(n+=1),n>1&&(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 Nt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Dt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function It(e,t,n,i,r,a){this.a=e,this.b=t,this.c=n,this.normal=i&&i.isVector3?i:new re,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new Rt,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}Object.assign(Rt.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex: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},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=$.euclideanModulo(e,1),t=$.clamp(t,0,1),n=$.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=Ct(r,i,e+1/3),this.g=Ct(r,i,e),this.b=Ct(r,i,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=n[1],h=l.length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=At[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=Nt(e.r),this.g=Nt(e.g),this.b=Nt(e.b),this},copyLinearToSRGB:function(e){return this.r=Dt(e.r),this.g=Dt(e.g),this.b=Dt(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),c=(s+o)/2;if(s===o)t=0,n=0;else{var l=o-s;switch(n=c<=.5?l/(o+s):l/(2-o-s),o){case i:t=(r-a)/l+(r<a?6:0);break;case r:t=(a-i)/l+2;break;case a:t=(i-r)/l+4}t/=6}return e.h=t,e.s=n,e.l=c,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(Lt),Lt.h+=e,Lt.s+=t,Lt.l+=n,this.setHSL(Lt.h,Lt.s,Lt.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub: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},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp: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},lerpHSL:function(e,t){this.getHSL(Lt),e.getHSL(Pt);var n=$.lerp(Lt.h,Pt.h,t),i=$.lerp(Lt.s,Pt.s,t),r=$.lerp(Lt.l,Pt.l,t);return this.setHSL(n,i,r),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),Rt.NAMES=At,Object.assign(It.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Ot=0;function Ut(){Object.defineProperty(this,"id",{value:Ot++}),this.uuid=$.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=m,this.side=p,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=f,this.opacity=1,this.transparent=!1,this.blendSrc=v,this.blendDst=y,this.blendEquation=g,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=x,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=X,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=q,this.stencilZFail=q,this.stencilZPass=q,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function zt(e){Ut.call(this),this.type="MeshBasicMaterial",this.color=new Rt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}function Ft(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Y,this.updateRange={offset:0,count:-1},this.version=0}function Bt(e,t,n){Ft.call(this,new Int8Array(e),t,n)}function Gt(e,t,n){Ft.call(this,new Uint8Array(e),t,n)}function Vt(e,t,n){Ft.call(this,new Uint8ClampedArray(e),t,n)}function Ht(e,t,n){Ft.call(this,new Int16Array(e),t,n)}function kt(e,t,n){Ft.call(this,new Uint16Array(e),t,n)}function Wt(e,t,n){Ft.call(this,new Int32Array(e),t,n)}function jt(e,t,n){Ft.call(this,new Uint32Array(e),t,n)}function qt(e,t,n){Ft.call(this,new Float32Array(e),t,n)}function Xt(e,t,n){Ft.call(this,new Float64Array(e),t,n)}function Yt(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Zt(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}Ut.prototype=Object.assign(Object.create(J.prototype),{constructor:Ut,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}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.")}},toJSON: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 i(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}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),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),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.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),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),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==m&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==p&&(n.side=this.side),this.vertexColors!==f&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,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),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var r=i(e.textures),a=i(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var i=t.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=t[r].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.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Ut.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),zt.prototype=Object.create(Ut.prototype),zt.prototype.constructor=zt,zt.prototype.isMeshBasicMaterial=!0,zt.prototype.copy=function(e){return Ut.prototype.copy.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this},Object.defineProperty(Ft.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ft.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy: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},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new Rt),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new ee),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new re),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new ue),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Bt.prototype=Object.create(Ft.prototype),Bt.prototype.constructor=Bt,Gt.prototype=Object.create(Ft.prototype),Gt.prototype.constructor=Gt,Vt.prototype=Object.create(Ft.prototype),Vt.prototype.constructor=Vt,Ht.prototype=Object.create(Ft.prototype),Ht.prototype.constructor=Ht,kt.prototype=Object.create(Ft.prototype),kt.prototype.constructor=kt,Wt.prototype=Object.create(Ft.prototype),Wt.prototype.constructor=Wt,jt.prototype=Object.create(Ft.prototype),jt.prototype.constructor=jt,qt.prototype=Object.create(Ft.prototype),qt.prototype.constructor=qt,Xt.prototype=Object.create(Ft.prototype),Xt.prototype.constructor=Xt,Object.assign(Yt.prototype,{computeGroups:function(e){for(var t,n=[],i=void 0,r=e.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==i&&(i=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:i})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,i=e.vertices,r=e.faceVertexUvs,a=r[0]&&r[0].length>0,o=r[1]&&r[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var l=0;l<c;l++)t[l]={name:s[l].name,data:[]};this.morphTargets.position=t}var h,u=e.morphNormals,d=u.length;if(d>0){for(h=[],l=0;l<d;l++)h[l]={name:u[l].name,data:[]};this.morphTargets.normal=h}var p=e.skinIndices,f=e.skinWeights,m=p.length===i.length,g=f.length===i.length;for(i.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),l=0;l<n.length;l++){var v=n[l];this.vertices.push(i[v.a],i[v.b],i[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=v.normal;this.normals.push(x,x,x)}var _,b=v.vertexColors;if(3===b.length)this.colors.push(b[0],b[1],b[2]);else{var w=v.color;this.colors.push(w,w,w)}!0===a&&(void 0!==(_=r[0][l])?this.uvs.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new ee,new ee,new ee))),!0===o&&(void 0!==(_=r[1][l])?this.uvs2.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new ee,new ee,new ee)));for(var M=0;M<c;M++){var S=s[M].vertices;t[M].data.push(S[v.a],S[v.b],S[v.c])}for(M=0;M<d;M++){var E=u[M].vertexNormals[l];h[M].data.push(E.a,E.b,E.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var Jt=1,Qt=new be,Kt=new Be,$t=new re,en=new et,tn=new et,nn=new re;function rn(){Object.defineProperty(this,"id",{value:Jt+=2}),this.uuid=$.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}rn.prototype=Object.assign(Object.create(J.prototype),{constructor:rn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(Zt(e)>65535?jt:kt)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new se).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);var i=this.attributes.tangent;return void 0!==i&&((new se).getNormalMatrix(e).applyToBufferAttribute(i),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Qt.makeRotationX(e),this.applyMatrix(Qt),this},rotateY:function(e){return Qt.makeRotationY(e),this.applyMatrix(Qt),this},rotateZ:function(e){return Qt.makeRotationZ(e),this.applyMatrix(Qt),this},translate:function(e,t,n){return Qt.makeTranslation(e,t,n),this.applyMatrix(Qt),this},scale:function(e,t,n){return Qt.makeScale(e,t,n),this.applyMatrix(Qt),this},lookAt:function(e){return Kt.lookAt(e),Kt.updateMatrix(),this.applyMatrix(Kt.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter($t).negate(),this.translate($t.x,$t.y,$t.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new qt(3*t.vertices.length,3),i=new qt(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",i.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var r=new qt(t.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new qt(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Yt).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new Ft(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Ft(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(3*e.colors.length);this.setAttribute("color",new Ft(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var r=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Ft(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Ft(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,h=c.length;l<h;l++){var u=c[l],d=new qt(3*u.data.length,3);d.name=u.name,s.push(d.copyVector3sArray(u.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var p=new qt(4*e.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new qt(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new et);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,i=t.length;n<i;n++){var r=t[n];en.setFromBufferAttribute(r),this.morphTargetsRelative?(nn.addVectors(this.boundingBox.min,en.min),this.boundingBox.expandByPoint(nn),nn.addVectors(this.boundingBox.max,en.max),this.boundingBox.expandByPoint(nn)):(this.boundingBox.expandByPoint(en.min),this.boundingBox.expandByPoint(en.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new it);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(en.setFromBufferAttribute(e),t)for(var i=0,r=t.length;i<r;i++){var a=t[i];tn.setFromBufferAttribute(a),this.morphTargetsRelative?(nn.addVectors(en.min,tn.min),en.expandByPoint(nn),nn.addVectors(en.max,tn.max),en.expandByPoint(nn)):(en.expandByPoint(tn.min),en.expandByPoint(tn.max))}en.getCenter(n);var o=0;for(i=0,r=e.count;i<r;i++)nn.fromBufferAttribute(e,i),o=Math.max(o,n.distanceToSquared(nn));if(t)for(i=0,r=t.length;i<r;i++){a=t[i];for(var s=this.morphTargetsRelative,c=0,l=a.count;c<l;c++)nn.fromBufferAttribute(a,c),s&&($t.fromBufferAttribute(e,c),nn.add($t)),o=Math.max(o,n.distanceToSquared(nn))}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)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new Ft(new Float32Array(n.length),3));else for(var i=t.normal.array,r=0,a=i.length;r<a;r++)i[r]=0;var o,s,c,l=t.normal.array,h=new re,u=new re,d=new re,p=new re,f=new re;if(e){var m=e.array;for(r=0,a=e.count;r<a;r+=3)o=3*m[r+0],s=3*m[r+1],c=3*m[r+2],h.fromArray(n,o),u.fromArray(n,s),d.fromArray(n,c),p.subVectors(d,u),f.subVectors(h,u),p.cross(f),l[o]+=p.x,l[o+1]+=p.y,l[o+2]+=p.z,l[s]+=p.x,l[s+1]+=p.y,l[s+2]+=p.z,l[c]+=p.x,l[c+1]+=p.y,l[c+2]+=p.z}else for(r=0,a=n.length;r<a;r+=9)h.fromArray(n,r),u.fromArray(n,r+3),d.fromArray(n,r+6),p.subVectors(d,u),f.subVectors(h,u),p.cross(f),l[r]=p.x,l[r+1]=p.y,l[r+2]=p.z,l[r+3]=p.x,l[r+4]=p.y,l[r+5]=p.z,l[r+6]=p.x,l[r+7]=p.y,l[r+8]=p.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge: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 i in n)if(void 0!==e.attributes[i])for(var r=n[i].array,a=e.attributes[i],o=a.array,s=a.itemSize*t,c=Math.min(o.length,r.length-s),l=0,h=s;l<c;l++,h++)r[h]=o[l];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)nn.x=e.getX(t),nn.y=e.getY(t),nn.z=e.getZ(t),nn.normalize(),e.setXYZ(t,nn.x,nn.y,nn.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,i=e.itemSize,r=new n.constructor(t.length*i),a=0,o=0,s=0,c=t.length;s<c;s++){a=t[s]*i;for(var l=0;l<i;l++)r[o++]=n[a++]}return new Ft(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new rn,n=this.index.array,i=this.attributes;for(var r in i){var a=e(i[r],n);t.setAttribute(r,a)}var o=this.morphAttributes;for(r in o){for(var s=[],c=o[r],l=0,h=c.length;l<h;l++)a=e(c[l],n),s.push(a);t.morphAttributes[r]=s}t.morphTargetsRelative=this.morphTargetsRelative;for(var u=this.groups,d=(l=0,u.length);l<d;l++){var p=u[l];t.addGroup(p.start,p.count,p.materialIndex)}return t},toJSON: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),Object.keys(this.userData).length>0&&(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 i=this.index;null!==i&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a=(d=r[n]).toJSON();""!==d.name&&(a.name=d.name),e.data.attributes[n]=a}var o={},s=!1;for(var n in this.morphAttributes){for(var c=this.morphAttributes[n],l=[],h=0,u=c.length;h<u;h++){var d;a=(d=c[h]).toJSON(),""!==d.name&&(a.name=d.name),l.push(a)}l.length>0&&(o[n]=l,s=!0)}s&&(e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative);var p=this.groups;p.length>0&&(e.data.groups=JSON.parse(JSON.stringify(p)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new rn).copy(this)},copy:function(e){var t,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone());var a=e.attributes;for(t in a){var o=a[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,i=l.length;n<i;n++)c.push(l[n].clone());this.morphAttributes[t]=c}this.morphTargetsRelative=e.morphTargetsRelative;var h=e.groups;for(n=0,i=h.length;n<i;n++){var u=h[n];this.addGroup(u.start,u.count,u.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=e.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var an=new be,on=new ut,sn=new it,cn=new re,ln=new re,hn=new re,un=new re,dn=new re,pn=new re,fn=new re,mn=new re,gn=new re,vn=new ee,yn=new ee,xn=new ee,_n=new re,bn=new re;function wn(e,t){Be.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new rn,this.material=void 0!==t?t:new zt({color:16777215*Math.random()}),this.drawMode=W,this.updateMorphTargets()}function Mn(e,t,n,i,r,a,o,s){if(null===(1===t.side?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,2!==t.side,s)))return null;bn.copy(s),bn.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(bn);return c<n.near||c>n.far?null:{distance:c,point:bn.clone(),object:e}}function Sn(e,t,n,i,r,a,o,s,c,l,h,u){cn.fromBufferAttribute(r,l),ln.fromBufferAttribute(r,h),hn.fromBufferAttribute(r,u);var d=e.morphTargetInfluences;if(t.morphTargets&&a&&d){fn.set(0,0,0),mn.set(0,0,0),gn.set(0,0,0);for(var p=0,f=a.length;p<f;p++){var m=d[p],g=a[p];0!==m&&(un.fromBufferAttribute(g,l),dn.fromBufferAttribute(g,h),pn.fromBufferAttribute(g,u),o?(fn.addScaledVector(un,m),mn.addScaledVector(dn,m),gn.addScaledVector(pn,m)):(fn.addScaledVector(un.sub(cn),m),mn.addScaledVector(dn.sub(ln),m),gn.addScaledVector(pn.sub(hn),m)))}cn.add(fn),ln.add(mn),hn.add(gn)}var v=Mn(e,t,n,i,cn,ln,hn,_n);if(v){s&&(vn.fromBufferAttribute(s,l),yn.fromBufferAttribute(s,h),xn.fromBufferAttribute(s,u),v.uv=Tt.getUV(_n,cn,ln,hn,vn,yn,xn,new ee)),c&&(vn.fromBufferAttribute(c,l),yn.fromBufferAttribute(c,h),xn.fromBufferAttribute(c,u),v.uv2=Tt.getUV(_n,cn,ln,hn,vn,yn,xn,new ee));var y=new It(l,h,u);Tt.getNormal(cn,ln,hn,y.normal),v.face=y}return v}wn.prototype=Object.assign(Object.create(Be.prototype),{constructor:wn,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return Be.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,i=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),sn.copy(i.boundingSphere),sn.applyMatrix4(a),!1!==e.ray.intersectsSphere(sn)&&(an.getInverse(a),on.copy(e.ray).applyMatrix4(an),null===i.boundingBox||!1!==on.intersectsBox(i.boundingBox))))if(this.drawMode===W){if(i.isBufferGeometry){var o,s,c,l,h,u,d,p,f,m=i.index,g=i.attributes.position,v=i.morphAttributes.position,y=i.morphTargetsRelative,x=i.attributes.uv,_=i.attributes.uv2,b=i.groups,w=i.drawRange;if(null!==m)if(Array.isArray(r))for(l=0,u=b.length;l<u;l++)for(f=r[(p=b[l]).materialIndex],h=Math.max(p.start,w.start),d=Math.min(p.start+p.count,w.start+w.count);h<d;h+=3)o=m.getX(h),s=m.getX(h+1),c=m.getX(h+2),(n=Sn(this,f,e,on,g,v,y,x,_,o,s,c))&&(n.faceIndex=Math.floor(h/3),n.face.materialIndex=p.materialIndex,t.push(n));else for(l=Math.max(0,w.start),u=Math.min(m.count,w.start+w.count);l<u;l+=3)o=m.getX(l),s=m.getX(l+1),c=m.getX(l+2),(n=Sn(this,r,e,on,g,v,y,x,_,o,s,c))&&(n.faceIndex=Math.floor(l/3),t.push(n));else if(void 0!==g)if(Array.isArray(r))for(l=0,u=b.length;l<u;l++)for(f=r[(p=b[l]).materialIndex],h=Math.max(p.start,w.start),d=Math.min(p.start+p.count,w.start+w.count);h<d;h+=3)(n=Sn(this,f,e,on,g,v,y,x,_,o=h,s=h+1,c=h+2))&&(n.faceIndex=Math.floor(h/3),n.face.materialIndex=p.materialIndex,t.push(n));else for(l=Math.max(0,w.start),u=Math.min(g.count,w.start+w.count);l<u;l+=3)(n=Sn(this,r,e,on,g,v,y,x,_,o=l,s=l+1,c=l+2))&&(n.faceIndex=Math.floor(l/3),t.push(n))}else if(i.isGeometry){var M,S,E,T,A=Array.isArray(r),L=i.vertices,P=i.faces,R=i.faceVertexUvs[0];R.length>0&&(T=R);for(var C=0,N=P.length;C<N;C++){var D=P[C],I=A?r[D.materialIndex]:r;if(void 0!==I&&(M=L[D.a],S=L[D.b],E=L[D.c],n=Mn(this,I,e,on,M,S,E,_n))){if(T&&T[C]){var O=T[C];vn.copy(O[0]),yn.copy(O[1]),xn.copy(O[2]),n.uv=Tt.getUV(_n,M,S,E,vn,yn,xn,new ee)}n.face=D,n.faceIndex=C,t.push(n)}}}}else console.warn("THREE.Mesh: TriangleStripDrawMode and TriangleFanDrawMode are not supported by .raycast().")},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var En=0,Tn=new be,An=new Be,Ln=new re;function Pn(){Object.defineProperty(this,"id",{value:En+=2}),this.uuid=$.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}Pn.prototype=Object.assign(Object.create(J.prototype),{constructor:Pn,isGeometry:!0,applyMatrix:function(e){for(var t=(new se).getNormalMatrix(e),n=0,i=this.vertices.length;n<i;n++)this.vertices[n].applyMatrix4(e);for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(t).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return Tn.makeRotationX(e),this.applyMatrix(Tn),this},rotateY:function(e){return Tn.makeRotationY(e),this.applyMatrix(Tn),this},rotateZ:function(e){return Tn.makeRotationZ(e),this.applyMatrix(Tn),this},translate:function(e,t,n){return Tn.makeTranslation(e,t,n),this.applyMatrix(Tn),this},scale:function(e,t,n){return Tn.makeScale(e,t,n),this.applyMatrix(Tn),this},lookAt:function(e){return An.lookAt(e),An.updateMatrix(),this.applyMatrix(An.matrix),this},fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,i=e.attributes;if(void 0===i.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var r=i.position.array,a=void 0!==i.normal?i.normal.array:void 0,o=void 0!==i.color?i.color.array:void 0,s=void 0!==i.uv?i.uv.array:void 0,c=void 0!==i.uv2?i.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=0;l<r.length;l+=3)t.vertices.push((new re).fromArray(r,l)),void 0!==o&&t.colors.push((new Rt).fromArray(o,l));function h(e,n,i,r){var l=void 0===o?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[i].clone()],h=new It(e,n,i,void 0===a?[]:[(new re).fromArray(a,3*e),(new re).fromArray(a,3*n),(new re).fromArray(a,3*i)],l,r);t.faces.push(h),void 0!==s&&t.faceVertexUvs[0].push([(new ee).fromArray(s,2*e),(new ee).fromArray(s,2*n),(new ee).fromArray(s,2*i)]),void 0!==c&&t.faceVertexUvs[1].push([(new ee).fromArray(c,2*e),(new ee).fromArray(c,2*n),(new ee).fromArray(c,2*i)])}var u=e.groups;if(u.length>0)for(l=0;l<u.length;l++)for(var d=u[l],p=d.start,f=p,m=p+d.count;f<m;f+=3)void 0!==n?h(n[f],n[f+1],n[f+2],d.materialIndex):h(f,f+1,f+2,d.materialIndex);else if(void 0!==n)for(l=0;l<n.length;l+=3)h(n[l],n[l+1],n[l+2]);else for(l=0;l<r.length/3;l+=3)h(l,l+1,l+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ln).negate(),this.translate(Ln.x,Ln.y,Ln.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,i=new be;return i.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var e=new re,t=new re,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){var t,n,i,r,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new re;if(e){var s,c,l,h=new re,u=new re;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],s=this.vertices[a.a],c=this.vertices[a.b],l=this.vertices[a.c],h.subVectors(l,c),u.subVectors(s,c),h.cross(u),o[a.a].add(h),o[a.b].add(h),o[a.c].add(h)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)o[(a=this.faces[i]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(i=0,r=this.faces.length;i<r;i++){var d=(a=this.faces[i]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var i=(n=this.faces[e]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;e<t;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var a=new Pn;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)c=new re,l={a:new re,b:new re,c:new re},o.push(c),s.push(l)}var c,l,h=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],c=h.faceNormals[n],l=h.vertexNormals[n],c.copy(r.normal),l.a.copy(r.vertexNormals[0]),l.b.copy(r.vertexNormals[1]),l.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new et),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new it),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var i,r=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,l=this.colors,h=e.colors;void 0===n&&(n=0),void 0!==t&&(i=(new se).getNormalMatrix(t));for(var u=0,d=o.length;u<d;u++){var p=o[u].clone();void 0!==t&&p.applyMatrix4(t),a.push(p)}for(u=0,d=h.length;u<d;u++)l.push(h[u].clone());for(u=0,d=c.length;u<d;u++){var f,m,g,v=c[u],y=v.vertexNormals,x=v.vertexColors;(f=new It(v.a+r,v.b+r,v.c+r)).normal.copy(v.normal),void 0!==i&&f.normal.applyMatrix3(i).normalize();for(var _=0,b=y.length;_<b;_++)m=y[_].clone(),void 0!==i&&m.applyMatrix3(i).normalize(),f.vertexNormals.push(m);for(f.color.copy(v.color),_=0,b=x.length;_<b;_++)g=x[_],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+n,s.push(f)}for(u=0,d=e.faceVertexUvs.length;u<d;u++){var w=e.faceVertexUvs[u];for(void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]),_=0,b=w.length;_<b;_++){for(var M=w[_],S=[],E=0,T=M.length;E<T;E++)S.push(M[E].clone());this.faceVertexUvs[u].push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,i,r,a,o,s,c={},l=[],h=[],u=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)e=this.vertices[n],void 0===c[t=Math.round(e.x*u)+"_"+Math.round(e.y*u)+"_"+Math.round(e.z*u)]?(c[t]=n,l.push(this.vertices[n]),h[n]=l.length-1):h[n]=h[c[t]];var d=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=h[r.a],r.b=h[r.b],r.c=h[r.c],a=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var i=e[t];this.vertices.push(new re(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var i,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];for(a&&a.length===t&&(i=[]),o&&o.length===t&&(r=[]),n=0;n<t;n++){var s=e[n]._id;i&&i.push(a[s]),r&&r.push(o[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var i=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];i.push(a.x,a.y,a.z)}var o=[],s=[],c={},l=[],h={},u=[],d={};for(r=0;r<this.faces.length;r++){var p=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=p.normal.length()>0,g=p.vertexNormals.length>0,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,f),x=M(x,4,m),x=M(x,5,g),x=M(x,6,v),x=M(x,7,y),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var _=this.faceVertexUvs[0][r];o.push(T(_[0]),T(_[1]),T(_[2]))}if(m&&o.push(S(p.normal)),g){var b=p.vertexNormals;o.push(S(b[0]),S(b[1]),S(b[2]))}if(v&&o.push(E(p.color)),y){var w=p.vertexColors;o.push(E(w[0]),E(w[1]),E(w[2]))}}function M(e,t,n){return n?e|1<<t:e&~(1<<t)}function S(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]||(c[t]=s.length/3,s.push(e.x,e.y,e.z)),c[t]}function E(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]||(h[t]=l.length,l.push(e.getHex())),h[t]}function T(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=u.length/2,u.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=i,e.data.normals=s,l.length>0&&(e.data.colors=l),u.length>0&&(e.data.uvs=[u]),e.data.faces=o,e},clone:function(){return(new Pn).copy(this)},copy:function(e){var t,n,i,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var h=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),i=0,r=h.length;i<r;i++){var u=h[i],d=[];for(a=0,o=u.length;a<o;a++){var p=u[a];d.push(p.clone())}this.faceVertexUvs[t].push(d)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],i=0,r=f[t].vertices.length;i<r;i++)m.vertices.push(f[t].vertices[i].clone());if(void 0!==f[t].normals)for(m.normals=[],i=0,r=f[t].normals.length;i<r;i++)m.normals.push(f[t].normals[i].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var v={};if(void 0!==g[t].vertexNormals)for(v.vertexNormals=[],i=0,r=g[t].vertexNormals.length;i<r;i++){var y=g[t].vertexNormals[i],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[t].faceNormals)for(v.faceNormals=[],i=0,r=g[t].faceNormals.length;i<r;i++)v.faceNormals.push(g[t].faceNormals[i].clone());this.morphNormals.push(v)}var _=e.skinWeights;for(t=0,n=_.length;t<n;t++)this.skinWeights.push(_[t].clone());var b=e.skinIndices;for(t=0,n=b.length;t<n;t++)this.skinIndices.push(b[t].clone());var w=e.lineDistances;for(t=0,n=w.length;t<n;t++)this.lineDistances.push(w[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=e.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Rn=function(e){function t(e,n,i,r,a,o){var s;return c(this,t),(s=l(this,t)).type="BoxGeometry",s.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o},s.fromBufferGeometry(new Cn(e,n,i,r,a,o)),s.mergeVertices(),s}return u(t,e),o(t)}(Pn),Cn=function(e){function t(e,n,i,r,a,o){var s;c(this,t),(s=l(this,t)).type="BoxBufferGeometry",s.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o};var h=s;e=e||1,n=n||1,i=i||1,r=Math.floor(r)||1,a=Math.floor(a)||1,o=Math.floor(o)||1;var u=[],d=[],p=[],f=[],m=0,g=0;function v(e,t,n,i,r,a,o,s,c,l,v){var y,x,_=a/c,b=o/l,w=a/2,M=o/2,S=s/2,E=c+1,T=l+1,A=0,L=0,P=new re;for(x=0;x<T;x++){var R=x*b-M;for(y=0;y<E;y++){var C=y*_-w;P[e]=C*i,P[t]=R*r,P[n]=S,d.push(P.x,P.y,P.z),P[e]=0,P[t]=0,P[n]=s>0?1:-1,p.push(P.x,P.y,P.z),f.push(y/c),f.push(1-x/l),A+=1}}for(x=0;x<l;x++)for(y=0;y<c;y++){var N=m+y+E*x,D=m+y+E*(x+1),I=m+(y+1)+E*(x+1),O=m+(y+1)+E*x;u.push(N,D,O),u.push(D,I,O),L+=6}h.addGroup(g,L,v),g+=L,m+=A}return v("z","y","x",-1,-1,i,n,e,o,a,0),v("z","y","x",1,-1,i,n,-e,o,a,1),v("x","z","y",1,1,e,i,n,r,o,2),v("x","z","y",1,-1,e,i,-n,r,o,3),v("x","y","z",1,-1,e,n,i,r,a,4),v("x","y","z",-1,-1,e,n,-i,r,a,5),s.setIndex(u),s.setAttribute("position",new qt(d,3)),s.setAttribute("normal",new qt(p,3)),s.setAttribute("uv",new qt(f,2)),s}return u(t,e),o(t)}(rn);function Nn(e){var t={};for(var n in e)for(var i in t[n]={},e[n]){var r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}return t}function Dn(e){for(var t={},n=0;n<e.length;n++){var i=Nn(e[n]);for(var r in i)t[r]=i[r]}return t}var In={clone:Nn,merge:Dn},On="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",Un="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function zn(e){Ut.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=On,this.fragmentShader=Un,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Fn(){Be.call(this),this.type="Camera",this.matrixWorldInverse=new be,this.projectionMatrix=new be,this.projectionMatrixInverse=new be}function Bn(e,t,n,i){Fn.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}zn.prototype=Object.create(Ut.prototype),zn.prototype.constructor=zn,zn.prototype.isShaderMaterial=!0,zn.prototype.copy=function(e){return Ut.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Nn(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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},zn.prototype.toJSON=function(e){var t=Ut.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var r={};for(var a in this.extensions)!0===this.extensions[a]&&(r[a]=!0);return Object.keys(r).length>0&&(t.extensions=r),t},Fn.prototype=Object.assign(Object.create(Be.prototype),{constructor:Fn,isCamera:!0,copy:function(e,t){return Be.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new re),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Be.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Bn.prototype=Object.assign(Object.create(Fn.prototype),{constructor:Bn,isPerspectiveCamera:!0,copy:function(e,t){return Fn.prototype.copy.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},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*$.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*$.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*$.RAD2DEG*Math.atan(Math.tan(.5*$.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,i,r,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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*$.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,t-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(r+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Be.prototype.toJSON.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}});var Gn=90;function Vn(e,t,n,i){Be.call(this),this.type="CubeCamera";var r=new Bn(Gn,1,e,t);r.up.set(0,-1,0),r.lookAt(new re(1,0,0)),this.add(r);var a=new Bn(Gn,1,e,t);a.up.set(0,-1,0),a.lookAt(new re(-1,0,0)),this.add(a);var o=new Bn(Gn,1,e,t);o.up.set(0,0,1),o.lookAt(new re(0,1,0)),this.add(o);var s=new Bn(Gn,1,e,t);s.up.set(0,0,-1),s.lookAt(new re(0,-1,0)),this.add(s);var c=new Bn(Gn,1,e,t);c.up.set(0,-1,0),c.lookAt(new re(0,0,1)),this.add(c);var l=new Bn(Gn,1,e,t);l.up.set(0,-1,0),l.lookAt(new re(0,0,-1)),this.add(l),i=i||{format:I,magFilter:A,minFilter:A},this.renderTarget=new Hn(n,n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),i=this.renderTarget,h=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,a),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,s),e.setRenderTarget(i,4),e.render(t,c),i.texture.generateMipmaps=h,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(n)},this.clear=function(e,t,n,i){for(var r=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,i);e.setRenderTarget(r)}}function Hn(e,t,n){de.call(this,e,t,n)}function kn(e,t,n,i,r,a,o,s,c,l,h,u){he.call(this,null,a,o,s,c,l,i,r,h,u),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==c?c:S,this.minFilter=void 0!==l?l:S,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Vn.prototype=Object.create(Be.prototype),Vn.prototype.constructor=Vn,Hn.prototype=Object.create(de.prototype),Hn.prototype.constructor=Hn,Hn.prototype.isWebGLRenderTargetCube=!0,Hn.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new Ge,i={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new zn({type:"CubemapFromEquirect",uniforms:Nn(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;var a=new wn(new Cn(5,5,5),r);n.add(a);var o=new Vn(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,n),a.geometry.dispose(),a.material.dispose(),this},kn.prototype=Object.create(he.prototype),kn.prototype.constructor=kn,kn.prototype.isDataTexture=!0;var Wn=new it,jn=new re;function qn(e,t,n,i,r,a){this.planes=[void 0!==e?e:new mt,void 0!==t?t:new mt,void 0!==n?n:new mt,void 0!==i?i:new mt,void 0!==r?r:new mt,void 0!==a?a:new mt]}Object.assign(qn.prototype,{set:function(e,t,n,i,r,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-i,h-s,f-u,y-m).normalize(),t[1].setComponents(o+i,h+s,f+u,y+m).normalize(),t[2].setComponents(o+r,h+c,f+d,y+g).normalize(),t[3].setComponents(o-r,h-c,f-d,y-g).normalize(),t[4].setComponents(o-a,h-l,f-p,y-v).normalize(),t[5].setComponents(o+a,h+l,f+p,y+v).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Wn.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Wn)},intersectsSprite:function(e){return Wn.center.set(0,0,0),Wn.radius=.7071067811865476,Wn.applyMatrix4(e.matrixWorld),this.intersectsSphere(Wn)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,i=-e.radius,r=0;r<6;r++)if(t[r].distanceToPoint(n)<i)return!1;return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var i=t[n];if(jn.x=i.normal.x>0?e.max.x:e.min.x,jn.y=i.normal.y>0?e.max.y:e.min.y,jn.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(jn)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var Xn={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 ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\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.specularRoughness );\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:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_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_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * 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}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.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}\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_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\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 ) {\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 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\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 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 max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\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 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}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\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 return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\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 = min( floor( D ) / 255.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\t\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#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\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 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\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\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\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 fogDepth;\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 TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\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;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * 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#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * 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#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * 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#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\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 GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.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 GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",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;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, 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_Diffuse_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 );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\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.specularRoughness;\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#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_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_Diffuse_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 CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * 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 CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\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#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\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\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * 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 += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\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\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#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 * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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 * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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 * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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 );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\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 ) {\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\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef 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 );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",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 unpack2HalfToRGBA( 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#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#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#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 unpack2HalfToRGBA( 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 texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = ( floor( uv * size - 0.5 ) + 0.5 ) * texelSize;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\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 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\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\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#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#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#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\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\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\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;\nuniform float toneMappingWhitePoint;\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}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\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 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",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#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\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_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}",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}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\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}",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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\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\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\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>\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}",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 <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}",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}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\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}",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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_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 <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 <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_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\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * 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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\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 <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_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 <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 <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\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\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_Diffuse_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_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_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 <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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_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 <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\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\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\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 <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 <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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 <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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#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\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 <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 <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_normalmap_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 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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#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\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 <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#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\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}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#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\n#include <packing>\n#include <uv_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}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#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\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 <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#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\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}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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}",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 <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_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 <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\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}"},Yn={common:{diffuse:{value:new Rt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new se},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ee(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 Rt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Rt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new se}},sprite:{diffuse:{value:new Rt(15658734)},opacity:{value:1},center:{value:new ee(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new se}}},Zn={basic:{uniforms:Dn([Yn.common,Yn.specularmap,Yn.envmap,Yn.aomap,Yn.lightmap,Yn.fog]),vertexShader:Xn.meshbasic_vert,fragmentShader:Xn.meshbasic_frag},lambert:{uniforms:Dn([Yn.common,Yn.specularmap,Yn.envmap,Yn.aomap,Yn.lightmap,Yn.emissivemap,Yn.fog,Yn.lights,{emissive:{value:new Rt(0)}}]),vertexShader:Xn.meshlambert_vert,fragmentShader:Xn.meshlambert_frag},phong:{uniforms:Dn([Yn.common,Yn.specularmap,Yn.envmap,Yn.aomap,Yn.lightmap,Yn.emissivemap,Yn.bumpmap,Yn.normalmap,Yn.displacementmap,Yn.gradientmap,Yn.fog,Yn.lights,{emissive:{value:new Rt(0)},specular:{value:new Rt(1118481)},shininess:{value:30}}]),vertexShader:Xn.meshphong_vert,fragmentShader:Xn.meshphong_frag},standard:{uniforms:Dn([Yn.common,Yn.envmap,Yn.aomap,Yn.lightmap,Yn.emissivemap,Yn.bumpmap,Yn.normalmap,Yn.displacementmap,Yn.roughnessmap,Yn.metalnessmap,Yn.fog,Yn.lights,{emissive:{value:new Rt(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Xn.meshphysical_vert,fragmentShader:Xn.meshphysical_frag},matcap:{uniforms:Dn([Yn.common,Yn.bumpmap,Yn.normalmap,Yn.displacementmap,Yn.fog,{matcap:{value:null}}]),vertexShader:Xn.meshmatcap_vert,fragmentShader:Xn.meshmatcap_frag},points:{uniforms:Dn([Yn.points,Yn.fog]),vertexShader:Xn.points_vert,fragmentShader:Xn.points_frag},dashed:{uniforms:Dn([Yn.common,Yn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xn.linedashed_vert,fragmentShader:Xn.linedashed_frag},depth:{uniforms:Dn([Yn.common,Yn.displacementmap]),vertexShader:Xn.depth_vert,fragmentShader:Xn.depth_frag},normal:{uniforms:Dn([Yn.common,Yn.bumpmap,Yn.normalmap,Yn.displacementmap,{opacity:{value:1}}]),vertexShader:Xn.normal_vert,fragmentShader:Xn.normal_frag},sprite:{uniforms:Dn([Yn.sprite,Yn.fog]),vertexShader:Xn.sprite_vert,fragmentShader:Xn.sprite_frag},background:{uniforms:{uvTransform:{value:new se},t2D:{value:null}},vertexShader:Xn.background_vert,fragmentShader:Xn.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Xn.cube_vert,fragmentShader:Xn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xn.equirect_vert,fragmentShader:Xn.equirect_frag},distanceRGBA:{uniforms:Dn([Yn.common,Yn.displacementmap,{referencePosition:{value:new re},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xn.distanceRGBA_vert,fragmentShader:Xn.distanceRGBA_frag},shadow:{uniforms:Dn([Yn.lights,Yn.fog,{color:{value:new Rt(0)},opacity:{value:1}}]),vertexShader:Xn.shadow_vert,fragmentShader:Xn.shadow_frag}};function Jn(){var e=null,t=!1,n=null;function i(r,a){!1!==t&&(n(r,a),e.requestAnimationFrame(i))}return{start:function(){!0!==t&&null!==n&&(e.requestAnimationFrame(i),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Qn(e){var t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){n.isInterleavedBufferAttribute&&(n=n.data);var r=t.get(n);void 0===r?t.set(n,function(t,n){var i=t.array,r=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,i,r),t.onUploadCallback();var o=5126;return i instanceof Float32Array?o=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?o=5123:i instanceof Int16Array?o=5122:i instanceof Uint32Array?o=5125:i instanceof Int32Array?o=5124:i instanceof Int8Array?o=5120:i instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(n,i)):r.version<n.version&&(function(t,n,i){var r=n.array,a=n.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,r):(e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r.subarray(a.offset,a.offset+a.count)),a.count=-1)}(r.buffer,n,i),r.version=n.version)}}}function Kn(e,t,n,i){Pn.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new $n(e,t,n,i)),this.mergeVertices()}function $n(e,t,n,i){rn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};var r,a,o=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(n)||1,l=Math.floor(i)||1,h=c+1,u=l+1,d=e/c,p=t/l,f=[],m=[],g=[],v=[];for(a=0;a<u;a++){var y=a*p-s;for(r=0;r<h;r++){var x=r*d-o;m.push(x,-y,0),g.push(0,0,1),v.push(r/c),v.push(1-a/l)}}for(a=0;a<l;a++)for(r=0;r<c;r++){var _=r+h*a,b=r+h*(a+1),w=r+1+h*(a+1),M=r+1+h*a;f.push(_,b,M),f.push(b,w,M)}this.setIndex(f),this.setAttribute("position",new qt(m,3)),this.setAttribute("normal",new qt(g,3)),this.setAttribute("uv",new qt(v,2))}function ei(e,t,n,i){var r,a,o=new Rt(0),s=0,c=null,l=0;function h(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,i)}return{getClearColor:function(){return o},setClearColor:function(e,t){o.set(e),h(o,s=void 0!==t?t:1)},getClearAlpha:function(){return s},setClearAlpha:function(e){h(o,s=e)},render:function(t,i,u,d){var f=i.background,m=e.vr,g=m.getSession&&m.getSession();if(g&&"additive"===g.environmentBlendMode&&(f=null),null===f?(h(o,s),c=null,l=0):f&&f.isColor&&(h(f,1),d=!0,c=null,l=0),(e.autoClear||d)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLRenderTargetCube)){void 0===a&&((a=new wn(new Cn(1,1,1),new zn({type:"BackgroundCubeMaterial",uniforms:Nn(Zn.cube.uniforms),vertexShader:Zn.cube.vertexShader,fragmentShader:Zn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.tCube.value}}),n.update(a));var v=f.isWebGLRenderTargetCube?f.texture:f;a.material.uniforms.tCube.value=v,a.material.uniforms.tFlip.value=f.isWebGLRenderTargetCube?1:-1,c===f&&l===v.version||(a.material.needsUpdate=!0,c=f,l=v.version),t.unshift(a,a.geometry,a.material,0,0,null)}else f&&f.isTexture&&(void 0===r&&((r=new wn(new $n(2,2),new zn({type:"BackgroundMaterial",uniforms:Nn(Zn.background.uniforms),vertexShader:Zn.background.vertexShader,fragmentShader:Zn.background.fragmentShader,side:p,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(r)),r.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),r.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&l===f.version||(r.material.needsUpdate=!0,c=f,l=f.version),t.unshift(r,r.geometry,r.material,0,0,null))}}}function ti(e,t,n,i){var r,a=i.isWebGL2;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r)},this.renderInstances=function(i,o,s,c){if(0!==c){var l,h;if(a)l=e,h="drawArraysInstanced";else if(h="drawArraysInstancedANGLE",null===(l=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[h](r,o,s,c),n.update(s,r,c)}}}function ni(e,t,n){var i;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===n.logarithmicDepthBuffer,l=e.getParameter(34930),h=e.getParameter(35660),u=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=h>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=t.get("EXT_texture_filter_anisotropic");return i=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?e.getParameter(36183):0}}function ii(){var e=this,t=null,n=0,i=!1,r=!1,a=new mt,o=new se,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,i,r){var c=null!==t?t.length:0,l=null;if(0!==c){if(l=s.value,!0!==r||null===l){var h=i+4*c,u=n.matrixWorldInverse;o.getNormalMatrix(u),(null===l||l.length<h)&&(l=new Float32Array(h));for(var d=0,p=i;d!==c;++d,p+=4)a.copy(t[d]).applyMatrix4(u,o),a.normal.toArray(l,p),l[p+3]=a.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,r,a){var o=0!==e.length||r||0!==n||i;return i=r,t=l(e,a,0),n=e.length,o},this.beginShadows=function(){r=!0,l(null)},this.endShadows=function(){r=!1,c()},this.setState=function(e,a,o,h,u,d){if(!i||null===e||0===e.length||r&&!o)r?l(null):c();else{var p=r?0:n,f=4*p,m=u.clippingState||null;s.value=m,m=l(e,h,f,d);for(var g=0;g!==f;++g)m[g]=t[g];u.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}}}function ri(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=i,i}}}function ai(e,t,n){var i=new WeakMap,r=new WeakMap;function a(e){var o=e.target,s=i.get(o);for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);o.removeEventListener("dispose",a),i.delete(o);var l=r.get(s);l&&(t.remove(l),r.delete(s)),n.memory.geometries--}function o(e){var n=[],i=e.index,a=e.attributes.position,o=0;if(null!==i){var s=i.array;o=i.version;for(var c=0,l=s.length;c<l;c+=3){var h=s[c+0],u=s[c+1],d=s[c+2];n.push(h,u,u,d,d,h)}}else for(s=a.array,o=a.version,c=0,l=s.length/3-1;c<l;c+=3)h=c+0,u=c+1,d=c+2,n.push(h,u,u,d,d,h);var p=new(Zt(n)>65535?jt:kt)(n,1);p.version=o,t.update(p,34963);var f=r.get(e);f&&t.remove(f),r.set(e,p)}return{get:function(e,t){var r=i.get(t);return r||(t.addEventListener("dispose",a),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new rn).setFromObject(e)),r=t._bufferGeometry),i.set(t,r),n.memory.geometries++,r)},update:function(e){var n=e.index,i=e.attributes;for(var r in null!==n&&t.update(n,34963),i)t.update(i[r],34962);var a=e.morphAttributes;for(var r in a)for(var o=a[r],s=0,c=o.length;s<c;s++)t.update(o[s],34962)},getWireframeAttribute:function(e){var t=r.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return r.get(e)}}}function oi(e,t,n,i){var r,a,o,s=i.isWebGL2;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,i){e.drawElements(r,i,a,t*o),n.update(i,r)},this.renderInstances=function(i,c,l,h){if(0!==h){var u,d;if(s)u=e,d="drawElementsInstanced";else if(d="drawElementsInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[d](r,l,a,c*o,h),n.update(l,r,h)}}}function si(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,i){switch(i=i||1,t.calls++,n){case 4:t.triangles+=i*(e/3);break;case 5:case 6:t.triangles+=i*(e-2);break;case 1:t.lines+=i*(e/2);break;case 3:t.lines+=i*(e-1);break;case 2:t.lines+=i*e;break;case 0:t.points+=i*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function ci(e,t){return Math.abs(t[1])-Math.abs(e[1])}function li(e){var t={},n=new Float32Array(8);return{update:function(i,r,a,o){var s=i.morphTargetInfluences,c=s.length,l=t[r.id];if(void 0===l){l=[];for(var h=0;h<c;h++)l[h]=[h,0];t[r.id]=l}var u=a.morphTargets&&r.morphAttributes.position,d=a.morphNormals&&r.morphAttributes.normal;for(h=0;h<c;h++)0!==(f=l[h])[1]&&(u&&r.deleteAttribute("morphTarget"+h),d&&r.deleteAttribute("morphNormal"+h));for(h=0;h<c;h++)(f=l[h])[0]=h,f[1]=s[h];l.sort(ci);var p=0;for(h=0;h<8;h++){var f;if(f=l[h]){var m=f[0],g=f[1];if(g){u&&r.setAttribute("morphTarget"+h,u[m]),d&&r.setAttribute("morphNormal"+h,d[m]),n[h]=g,p+=g;continue}}n[h]=0}var v=r.morphTargetsRelative?1:1-p;o.getUniforms().setValue(e,"morphTargetBaseInfluence",v),o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function hi(e,t,n,i){var r={};return{update:function(e){var a=i.render.frame,o=e.geometry,s=t.get(e,o);return r[s.id]!==a&&(o.isGeometry&&s.updateFromObject(e),t.update(s),r[s.id]=a),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s},dispose:function(){r={}}}}function ui(e,t,n,i,r,a,o,s,c,l){e=void 0!==e?e:[],t=void 0!==t?t:301,o=void 0!==o?o:I,he.call(this,e,t,n,i,r,a,o,s,c,l),this.flipY=!1}function di(e,t,n,i){he.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=S,this.minFilter=S,this.wrapR=w,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function pi(e,t,n,i){he.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=S,this.minFilter=S,this.wrapR=w,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Zn.physical={uniforms:Dn([Zn.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new Rt(0)},clearcoatNormalScale:{value:new ee(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:Xn.meshphysical_vert,fragmentShader:Xn.meshphysical_frag},Kn.prototype=Object.create(Pn.prototype),Kn.prototype.constructor=Kn,$n.prototype=Object.create(rn.prototype),$n.prototype.constructor=$n,ui.prototype=Object.create(he.prototype),ui.prototype.constructor=ui,ui.prototype.isCubeTexture=!0,Object.defineProperty(ui.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),di.prototype=Object.create(he.prototype),di.prototype.constructor=di,di.prototype.isDataTexture2DArray=!0,pi.prototype=Object.create(he.prototype),pi.prototype.constructor=pi,pi.prototype.isDataTexture3D=!0;var fi=new he,mi=new di,gi=new pi,vi=new ui,yi=[],xi=[],_i=new Float32Array(16),bi=new Float32Array(9),wi=new Float32Array(4);function Mi(e,t,n){var i=e[0];if(i<=0||i>0)return e;var r=t*n,a=yi[r];if(void 0===a&&(a=new Float32Array(r),yi[r]=a),0!==t){i.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function Si(e,t){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Ei(e,t){for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}function Ti(e,t){var n=xi[t];void 0===n&&(n=new Int32Array(t),xi[t]=n);for(var i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Ai(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Li(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(Si(n,t))return;e.uniform2fv(this.addr,t),Ei(n,t)}}function Pi(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(Si(n,t))return;e.uniform3fv(this.addr,t),Ei(n,t)}}function Ri(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(Si(n,t))return;e.uniform4fv(this.addr,t),Ei(n,t)}}function Ci(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Si(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Ei(n,t)}else{if(Si(n,i))return;wi.set(i),e.uniformMatrix2fv(this.addr,!1,wi),Ei(n,i)}}function Ni(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Si(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ei(n,t)}else{if(Si(n,i))return;bi.set(i),e.uniformMatrix3fv(this.addr,!1,bi),Ei(n,i)}}function Di(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Si(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Ei(n,t)}else{if(Si(n,i))return;_i.set(i),e.uniformMatrix4fv(this.addr,!1,_i),Ei(n,i)}}function Ii(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(t||fi,r)}function Oi(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||mi,r)}function Ui(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||gi,r)}function zi(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(t||vi,r)}function Fi(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Bi(e,t){var n=this.cache;Si(n,t)||(e.uniform2iv(this.addr,t),Ei(n,t))}function Gi(e,t){var n=this.cache;Si(n,t)||(e.uniform3iv(this.addr,t),Ei(n,t))}function Vi(e,t){var n=this.cache;Si(n,t)||(e.uniform4iv(this.addr,t),Ei(n,t))}function Hi(e,t){e.uniform1fv(this.addr,t)}function ki(e,t){e.uniform1iv(this.addr,t)}function Wi(e,t){e.uniform2iv(this.addr,t)}function ji(e,t){e.uniform3iv(this.addr,t)}function qi(e,t){e.uniform4iv(this.addr,t)}function Xi(e,t){var n=Mi(t,this.size,2);e.uniform2fv(this.addr,n)}function Yi(e,t){var n=Mi(t,this.size,3);e.uniform3fv(this.addr,n)}function Zi(e,t){var n=Mi(t,this.size,4);e.uniform4fv(this.addr,n)}function Ji(e,t){var n=Mi(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Qi(e,t){var n=Mi(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Ki(e,t){var n=Mi(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function $i(e,t,n){var i=t.length,r=Ti(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTexture2D(t[a]||fi,r[a])}function er(e,t,n){var i=t.length,r=Ti(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTextureCube(t[a]||vi,r[a])}function tr(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Ai;case 35664:return Li;case 35665:return Pi;case 35666:return Ri;case 35674:return Ci;case 35675:return Ni;case 35676:return Di;case 35678:case 36198:return Ii;case 35679:return Ui;case 35680:return zi;case 36289:return Oi;case 5124:case 35670:return Fi;case 35667:case 35671:return Bi;case 35668:case 35672:return Gi;case 35669:case 35673:return Vi}}(t.type)}function nr(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Hi;case 35664:return Xi;case 35665:return Yi;case 35666:return Zi;case 35674:return Ji;case 35675:return Qi;case 35676:return Ki;case 35678:return $i;case 35680:return er;case 5124:case 35670:return ki;case 35667:case 35671:return Wi;case 35668:case 35672:return ji;case 35669:case 35673:return qi}}(t.type)}function ir(e){this.id=e,this.seq=[],this.map={}}nr.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Ei(t,e)},ir.prototype.setValue=function(e,t,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(e,t[o.id],n)}};var rr=/([\w\d_]+)(\])?(\[|\.)?/g;function ar(e,t){e.seq.push(t),e.map[t.id]=t}function or(e,t,n){var i=e.name,r=i.length;for(rr.lastIndex=0;;){var a=rr.exec(i),o=rr.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===r){ar(n,void 0===l?new tr(s,e,t):new nr(s,e,t));break}var h=n.map[s];void 0===h&&ar(n,h=new ir(s)),n=h}}function sr(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),i=0;i<n;++i){var r=e.getActiveUniform(t,i);or(r,e.getUniformLocation(t,r.name),this)}}function cr(e,t,n){var i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}sr.prototype.setValue=function(e,t,n,i){var r=this.map[t];void 0!==r&&r.setValue(e,n,i)},sr.prototype.setOptional=function(e,t,n){var i=t[n];void 0!==i&&this.setValue(e,n,i)},sr.upload=function(e,t,n,i){for(var r=0,a=t.length;r!==a;++r){var o=t[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,i)}},sr.seqWithValue=function(e,t){for(var n=[],i=0,r=e.length;i!==r;++i){var a=e[i];a.id in t&&n.push(a)}return n};var lr=0;function hr(e){switch(e){case j:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function ur(e,t,n){var i=e.getShaderParameter(t,35713),r=e.getShaderInfoLog(t).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+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 dr(e,t){var n=hr(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function pr(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;case 5:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function fr(e){return""!==e}function mr(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 gr(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var vr=/^[ \t]*#include +<([\w\d./]+)>/gm;function yr(e){return e.replace(vr,xr)}function xr(e,t){var n=Xn[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return yr(n)}var _r=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function br(e){return e.replace(_r,wr)}function wr(e,t,n,i){for(var r="",a=parseInt(t);a<parseInt(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function Mr(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 Sr(e,t,n,i,r,a){var o,s,c,l,h=e.getContext(),u=i.defines,d=r.vertexShader,p=r.fragmentShader,f=function(e){var t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(a),m=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:case 307:t="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:t="ENVMAP_TYPE_EQUIREC";break;case 305:t="ENVMAP_TYPE_SPHERE"}return t}(a),g=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case 302:case 304:t="ENVMAP_MODE_REFRACTION"}return t}(a),v=function(e){var t="ENVMAP_BLENDING_MULTIPLY";if(e.envMap)switch(e.combine){case _:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(a),y=e.gammaFactor>0?e.gammaFactor:1,x=a.isWebGL2?"":function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(fr).join("\n")}(i.extensions,a,t),b=function(e){var t=[];for(var n in e){var i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(u),w=h.createProgram(),M=a.numMultiviewViews;if(i.isRawShaderMaterial?((o=[b].filter(fr).join("\n")).length>0&&(o+="\n"),(s=[x,b].filter(fr).join("\n")).length>0&&(s+="\n")):(o=[Mr(a),"#define SHADER_NAME "+r.name,b,a.instancing?"#define USE_INSTANCING":"",a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+y,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp2?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+g:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.normalMap&&a.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",a.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.vertexUvs?"#define USE_UV":"",a.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+f:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(a.isWebGL2||t.get("EXT_frag_depth"))?"#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"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\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(fr).join("\n"),s=[x,Mr(a),"#define SHADER_NAME "+r.name,b,a.alphaTest?"#define ALPHATEST "+a.alphaTest+(a.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+y,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp2?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+m:"",a.envMap?"#define "+g:"",a.envMap?"#define "+v:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.normalMap&&a.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",a.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.sheen?"#define USE_SHEEN":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.vertexUvs?"#define USE_UV":"",a.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+f:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(a.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensions&&i.extensions.shaderTextureLOD||a.envMap)&&(a.isWebGL2||t.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==a.toneMapping?"#define TONE_MAPPING":"",0!==a.toneMapping?Xn.tonemapping_pars_fragment:"",0!==a.toneMapping?pr("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.matcapEncoding||a.envMapEncoding||a.emissiveMapEncoding?Xn.encodings_pars_fragment:"",a.mapEncoding?dr("mapTexelToLinear",a.mapEncoding):"",a.matcapEncoding?dr("matcapTexelToLinear",a.matcapEncoding):"",a.envMapEncoding?dr("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?dr("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(c=a.outputEncoding,l=hr(c),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+l[0]+l[1]+"; }"):"",a.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(fr).join("\n")),d=gr(d=mr(d=yr(d),a),a),p=gr(p=mr(p=yr(p),a),a),d=br(d),p=br(p),a.isWebGL2&&!i.isRawShaderMaterial){var S=!1,E=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==d.match(E)&&null!==p.match(E)&&(S=!0,d=d.replace(E,""),p=p.replace(E,"")),o=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+o,s=["#version 300 es\n","#define varying in",S?"":"out highp vec4 pc_fragColor;",S?"":"#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"+s,M>0&&(o=(o=o.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+M+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+M+"];","uniform mat4 projectionMatrices["+M+"];","uniform mat4 viewMatrices["+M+"];","uniform mat3 normalMatrices["+M+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),s=(s=s.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+M+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var T,A,L=s+p,P=cr(h,35633,o+d),R=cr(h,35632,L);if(h.attachShader(w,P),h.attachShader(w,R),void 0!==i.index0AttributeName?h.bindAttribLocation(w,0,i.index0AttributeName):!0===a.morphTargets&&h.bindAttribLocation(w,0,"position"),h.linkProgram(w),e.debug.checkShaderErrors){var C=h.getProgramInfoLog(w).trim(),N=h.getShaderInfoLog(P).trim(),D=h.getShaderInfoLog(R).trim(),I=!0,O=!0;if(!1===h.getProgramParameter(w,35714)){I=!1;var U=ur(h,P,"vertex"),z=ur(h,R,"fragment");console.error("THREE.WebGLProgram: shader error: ",h.getError(),"35715",h.getProgramParameter(w,35715),"gl.getProgramInfoLog",C,U,z)}else""!==C?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):""!==N&&""!==D||(O=!1);O&&(this.diagnostics={runnable:I,material:i,programLog:C,vertexShader:{log:N,prefix:o},fragmentShader:{log:D,prefix:s}})}return h.deleteShader(P),h.deleteShader(R),this.getUniforms=function(){return void 0===T&&(T=new sr(h,w)),T},this.getAttributes=function(){return void 0===A&&(A=function(e,t){for(var n={},i=e.getProgramParameter(t,35721),r=0;r<i;r++){var a=e.getActiveAttrib(t,r).name;n[a]=e.getAttribLocation(t,a)}return n}(h,w)),A},this.destroy=function(){h.deleteProgram(w),this.program=void 0},this.name=r.name,this.id=lr++,this.cacheKey=n,this.usedTimes=1,this.program=w,this.vertexShader=P,this.fragmentShader=R,this.numMultiviewViews=M,this}function Er(e,t,n){var i=[],r=n.isWebGL2,a=n.logarithmicDepthBuffer,o=n.floatVertexTextures,s=n.precision,c=n.maxVertexUniforms,l=n.vertexTextures,h={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},u=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function d(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=j,n===j&&t&&(n=3007),n}this.getParameters=function(t,i,u,p,f,m,g){var v=h[t.type],y=g.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(o)return 1024;var n=c,i=Math.floor((n-20)/4),r=Math.min(i,t.length);return r<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+r+"."),0):r}(g):0;null!==t.precision&&(s=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",s,"instead.");var x=e.getRenderTarget(),_=x&&x.isWebGLMultiviewRenderTarget?x.numViews:0;return{isWebGL2:r,shaderID:v,precision:s,instancing:!0===g.isInstancedMesh,supportsVertexTextures:l,numMultiviewViews:_,outputEncoding:d(x?x.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:d(t.map,e.gammaInput),matcap:!!t.matcap,matcapEncoding:d(t.matcap,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:d(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(306===t.envMap.mapping||307===t.envMap.mapping),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:d(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:1===t.normalMapType,tangentSpaceNormalMap:0===t.normalMapType,clearcoatNormalMap:!!t.clearcoatNormalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,sheen:!!t.sheen,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,vertexUvs:!!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||t.displacementMap),uvsVertexOnly:!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||!t.displacementMap),fog:!!p,useFog:t.fog,fogExp2:p&&p.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:a,skinning:t.skinning&&y>0,maxBones:y,useVertexTexture:o,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numDirLightShadows:i.directionalShadowMap.length,numPointLightShadows:i.pointShadowMap.length,numSpotLightShadows:i.spotShadowMap.length,numClippingPlanes:f,numClipIntersection:m,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:t.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCacheKey=function(t,n){var i=[];if(n.shaderID?i.push(n.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)i.push(r),i.push(t.defines[r]);for(var a=0;a<u.length;a++)i.push(n[u[a]]);return i.push(t.onBeforeCompile.toString()),i.push(e.gammaOutput),i.push(e.gammaFactor),i.join()},this.acquireProgram=function(n,r,a,o){for(var s,c=0,l=i.length;c<l;c++){var h=i[c];if(h.cacheKey===o){++(s=h).usedTimes;break}}return void 0===s&&(s=new Sr(e,t,o,n,r,a),i.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=i.indexOf(e);i[t]=i[i.length-1],i.pop(),e.destroy()}},this.programs=i}function Tr(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function Ar(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 Lr(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 Pr(){var e=[],t=0,n=[],i=[],r={id:-1};function a(n,i,a,o,s,c){var l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:a,program:a.program||r,groupOrder:o,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=a,l.program=a.program||r,l.groupOrder=o,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}return{opaque:n,transparent:i,init:function(){t=0,n.length=0,i.length=0},push:function(e,t,r,o,s,c){var l=a(e,t,r,o,s,c);(!0===r.transparent?i:n).push(l)},unshift:function(e,t,r,o,s,c){var l=a(e,t,r,o,s,c);(!0===r.transparent?i:n).unshift(l)},sort:function(){n.length>1&&n.sort(Ar),i.length>1&&i.sort(Lr)}}}function Rr(){var e=new WeakMap;function t(n){var i=n.target;i.removeEventListener("dispose",t),e.delete(i)}return{get:function(n,i){var r,a=e.get(n);return void 0===a?(r=new Pr,e.set(n,new WeakMap),e.get(n).set(i,r),n.addEventListener("dispose",t)):void 0===(r=a.get(i))&&(r=new Pr,a.set(i,r)),r},dispose:function(){e=new WeakMap}}}function Cr(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new re,color:new Rt,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new ee};break;case"SpotLight":n={position:new re,direction:new re,color:new Rt,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new ee};break;case"PointLight":n={position:new re,color:new Rt,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new ee,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new re,skyColor:new Rt,groundColor:new Rt};break;case"RectAreaLight":n={color:new Rt,position:new re,halfWidth:new re,halfHeight:new re}}return e[t.id]=n,n}}}var Nr=0;function Dr(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Ir(){for(var e=new Cr,t={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:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)t.probe.push(new re);var i=new re,r=new be,a=new be;return{setup:function(n,o,s){for(var c=0,l=0,h=0,u=0;u<9;u++)t.probe[u].set(0,0,0);var d=0,p=0,f=0,m=0,g=0,v=0,y=0,x=0,_=s.matrixWorldInverse;n.sort(Dr),u=0;for(var b=n.length;u<b;u++){var w=n[u],M=w.color,S=w.intensity,E=w.distance,T=w.shadow&&w.shadow.map?w.shadow.map.texture:null;if(w.isAmbientLight)c+=M.r*S,l+=M.g*S,h+=M.b*S;else if(w.isLightProbe)for(var A=0;A<9;A++)t.probe[A].addScaledVector(w.sh.coefficients[A],S);else if(w.isDirectionalLight){if((P=e.get(w)).color.copy(w.color).multiplyScalar(w.intensity),P.direction.setFromMatrixPosition(w.matrixWorld),i.setFromMatrixPosition(w.target.matrixWorld),P.direction.sub(i),P.direction.transformDirection(_),P.shadow=w.castShadow,w.castShadow){var L=w.shadow;P.shadowBias=L.bias,P.shadowRadius=L.radius,P.shadowMapSize=L.mapSize,t.directionalShadowMap[d]=T,t.directionalShadowMatrix[d]=w.shadow.matrix,v++}t.directional[d]=P,d++}else if(w.isSpotLight)(P=e.get(w)).position.setFromMatrixPosition(w.matrixWorld),P.position.applyMatrix4(_),P.color.copy(M).multiplyScalar(S),P.distance=E,P.direction.setFromMatrixPosition(w.matrixWorld),i.setFromMatrixPosition(w.target.matrixWorld),P.direction.sub(i),P.direction.transformDirection(_),P.coneCos=Math.cos(w.angle),P.penumbraCos=Math.cos(w.angle*(1-w.penumbra)),P.decay=w.decay,P.shadow=w.castShadow,w.castShadow&&(L=w.shadow,P.shadowBias=L.bias,P.shadowRadius=L.radius,P.shadowMapSize=L.mapSize,t.spotShadowMap[f]=T,t.spotShadowMatrix[f]=w.shadow.matrix,x++),t.spot[f]=P,f++;else if(w.isRectAreaLight)(P=e.get(w)).color.copy(M).multiplyScalar(S),P.position.setFromMatrixPosition(w.matrixWorld),P.position.applyMatrix4(_),a.identity(),r.copy(w.matrixWorld),r.premultiply(_),a.extractRotation(r),P.halfWidth.set(.5*w.width,0,0),P.halfHeight.set(0,.5*w.height,0),P.halfWidth.applyMatrix4(a),P.halfHeight.applyMatrix4(a),t.rectArea[m]=P,m++;else if(w.isPointLight)(P=e.get(w)).position.setFromMatrixPosition(w.matrixWorld),P.position.applyMatrix4(_),P.color.copy(w.color).multiplyScalar(w.intensity),P.distance=w.distance,P.decay=w.decay,P.shadow=w.castShadow,w.castShadow&&(L=w.shadow,P.shadowBias=L.bias,P.shadowRadius=L.radius,P.shadowMapSize=L.mapSize,P.shadowCameraNear=L.camera.near,P.shadowCameraFar=L.camera.far,t.pointShadowMap[p]=T,t.pointShadowMatrix[p]=w.shadow.matrix,y++),t.point[p]=P,p++;else if(w.isHemisphereLight){var P;(P=e.get(w)).direction.setFromMatrixPosition(w.matrixWorld),P.direction.transformDirection(_),P.direction.normalize(),P.skyColor.copy(w.color).multiplyScalar(S),P.groundColor.copy(w.groundColor).multiplyScalar(S),t.hemi[g]=P,g++}}t.ambient[0]=c,t.ambient[1]=l,t.ambient[2]=h;var R=t.hash;R.directionalLength===d&&R.pointLength===p&&R.spotLength===f&&R.rectAreaLength===m&&R.hemiLength===g&&R.numDirectionalShadows===v&&R.numPointShadows===y&&R.numSpotShadows===x||(t.directional.length=d,t.spot.length=f,t.rectArea.length=m,t.point.length=p,t.hemi.length=g,t.directionalShadowMap.length=v,t.pointShadowMap.length=y,t.spotShadowMap.length=x,t.directionalShadowMatrix.length=v,t.pointShadowMatrix.length=y,t.spotShadowMatrix.length=x,R.directionalLength=d,R.pointLength=p,R.spotLength=f,R.rectAreaLength=m,R.hemiLength=g,R.numDirectionalShadows=v,R.numPointShadows=y,R.numSpotShadows=x,t.version=Nr++)},state:t}}function Or(){var e=new Ir,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(i){e.setup(t,n,i)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function Ur(){var e=new WeakMap;function t(n){var i=n.target;i.removeEventListener("dispose",t),e.delete(i)}return{get:function(n,i){var r;return!1===e.has(n)?(r=new Or,e.set(n,new WeakMap),e.get(n).set(i,r),n.addEventListener("dispose",t)):!1===e.get(n).has(i)?(r=new Or,e.get(n).set(i,r)):r=e.get(n).get(i),r},dispose:function(){e=new WeakMap}}}function zr(e){Ut.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function Fr(e){Ut.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new re,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}function Br(e,t,n){var i=new qn,r=new ee,a=new ee,o=new ue,s=[],c=[],l={},h={0:1,1:p,2:2},u=new zn({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new ee},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpack2HalfToRGBA ( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=u.clone();d.defines.HORIZONAL_PASS=1;var f=new rn;f.setAttribute("position",new Ft(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var m=new wn(f,u),g=this;function v(n,i){var r=t.update(m);u.uniforms.shadow_pass.value=n.map.texture,u.uniforms.resolution.value=n.mapSize,u.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,u,m,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,d,m,null)}function y(e,t,n){var i=e|t<<1|n<<2,r=s[i];return void 0===r&&(r=new zr({depthPacking:3201,morphTargets:e,skinning:t}),s[i]=r),r}function x(e,t,n){var i=e|t<<1|n<<2,r=c[i];return void 0===r&&(r=new Fr({morphTargets:e,skinning:t}),c[i]=r),r}function _(t,n,i,r,a,o){var s=t.geometry,c=null,u=y,d=t.customDepthMaterial;if(!0===i.isPointLight&&(u=x,d=t.customDistanceMaterial),void 0===d){var p=!1;!0===n.morphTargets&&(!0===s.isBufferGeometry?p=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:!0===s.isGeometry&&(p=s.morphTargets&&s.morphTargets.length>0));var f=!1;!0===t.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c=u(p,f,!0===t.isInstancedMesh)}else c=d;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var m=c.uuid,g=n.uuid,v=l[m];void 0===v&&(v={},l[m]=v);var _=v[g];void 0===_&&(_=c.clone(),v[g]=_),c=_}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=3===o?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=r,c.farDistance=a),c}function b(n,r,a,o,s){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var c=t.update(n),l=n.material;if(Array.isArray(l))for(var h=c.groups,u=0,d=h.length;u<d;u++){var p=h[u],f=l[p.materialIndex];if(f&&f.visible){var m=_(n,f,o,a.near,a.far,s);e.renderBufferDirect(a,null,c,m,n,p)}}else l.visible&&(m=_(n,l,o,a.near,a.far,s),e.renderBufferDirect(a,null,c,m,n,null))}for(var g=n.children,v=0,y=g.length;v<y;v++)b(g[v],r,a,o,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,s,c){if(!1!==g.enabled&&(!1!==g.autoUpdate||!1!==g.needsUpdate)&&0!==t.length){var l=e.getRenderTarget(),h=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),d=e.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var p=0,f=t.length;p<f;p++){var m=t[p],y=m.shadow;if(void 0!==y){r.copy(y.mapSize);var x=y.getFrameExtents();if(r.multiply(x),a.copy(y.mapSize),(r.x>n||r.y>n)&&(console.warn("THREE.WebGLShadowMap:",m,"has shadow exceeding max texture size, reducing"),r.x>n&&(a.x=Math.floor(n/x.x),r.x=a.x*x.x,y.mapSize.x=a.x),r.y>n&&(a.y=Math.floor(n/x.y),r.y=a.y*x.y,y.mapSize.y=a.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var _={minFilter:A,magFilter:A,format:O};y.map=new de(r.x,r.y,_),y.map.texture.name=m.name+".shadowMap",y.mapPass=new de(r.x,r.y,_),y.camera.updateProjectionMatrix()}null===y.map&&(_={minFilter:S,magFilter:S,format:O},y.map=new de(r.x,r.y,_),y.map.texture.name=m.name+".shadowMap",y.camera.updateProjectionMatrix()),e.setRenderTarget(y.map),e.clear();for(var w=y.getViewportCount(),M=0;M<w;M++){var E=y.getViewport(M);o.set(a.x*E.x,a.y*E.y,a.x*E.z,a.y*E.w),d.viewport(o),y.updateMatrices(m,M),i=y.getFrustum(),b(s,c,y.camera,m,this.type)}y.isPointLightShadow||3!==this.type||v(y,c)}else console.warn("THREE.WebGLShadowMap:",m,"has no shadow.")}g.needsUpdate=!1,e.setRenderTarget(l,h,u)}}}function Gr(e,t,n){var i,a=n.isWebGL2,o=new function(){var t=!1,n=new ue,i=null,r=new ue(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,o,s){!0===s&&(t*=o,i*=o,a*=o),n.set(t,i,a,o),!1===r.equals(n)&&(e.clearColor(t,i,a,o),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},s=new function(){var t=!1,n=null,i=null,r=null;return{setTest:function(e){e?j(2929):q(2929)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case x:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);i=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,i=null,r=null}}},c=new function(){var t=!1,n=null,i=null,r=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(e){t||(e?j(2960):q(2960))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&r===n&&a===o||(e.stencilFunc(t,n,o),i=t,r=n,a=o)},setOp:function(t,n,i){o===t&&s===n&&c===i||(e.stencilOp(t,n,i),o=t,s=n,c=i)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,o=null,s=null,c=null,l=null}}},l=e.getParameter(34921),h=new Uint8Array(l),u=new Uint8Array(l),d=new Uint8Array(l),p={},f=null,_=null,b=null,w=null,M=null,S=null,E=null,T=null,A=null,L=!1,P=null,R=null,C=null,N=null,D=null,I=e.getParameter(35661),O=!1,U=0,z=e.getParameter(7938);-1!==z.indexOf("WebGL")?(U=parseFloat(/^WebGL\ ([0-9])/.exec(z)[1]),O=U>=1):-1!==z.indexOf("OpenGL ES")&&(U=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(z)[1]),O=U>=2);var F=null,B={},G=new ue,V=new ue;function H(t,n,i){var r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<i;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,r);return a}var k={};function W(n,i){h[n]=1,0===u[n]&&(e.enableVertexAttribArray(n),u[n]=1),d[n]!==i&&((a?e:t.get("ANGLE_instanced_arrays"))[a?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),d[n]=i)}function j(t){!0!==p[t]&&(e.enable(t),p[t]=!0)}function q(t){!1!==p[t]&&(e.disable(t),p[t]=!1)}k[3553]=H(3553,3553,1),k[34067]=H(34067,34069,6),o.setClear(0,0,0,1),s.setClear(1),c.setClear(0),j(2929),s.setFunc(x),Q(!1),K(1),j(2884),J(0);var X=r(r(r({},g,32774),101,32778),102,32779);if(a)X[103]=32775,X[104]=32776;else{var Y=t.get("EXT_blend_minmax");null!==Y&&(X[103]=Y.MIN_EXT,X[104]=Y.MAX_EXT)}var Z=(r(r(r(r(r(r(r(r(r(r(i={},200,0),201,1),202,768),v,770),210,776),208,774),206,772),203,769),y,771),209,775),r(i,207,773));function J(t,n,i,r,a,o,s,c){if(0!==t){if(_||(j(3042),_=!0),5===t)a=a||n,o=o||i,s=s||r,n===w&&a===E||(e.blendEquationSeparate(X[n],X[a]),w=n,E=a),i===M&&r===S&&o===T&&s===A||(e.blendFuncSeparate(Z[i],Z[r],Z[o],Z[s]),M=i,S=r,T=o,A=s),b=t,L=null;else if(t!==b||c!==L){if(w===g&&E===g||(e.blendEquation(32774),w=g,E=g),c)switch(t){case m:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,0,769,771);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case m:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFunc(0,769);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}M=null,S=null,T=null,A=null,b=t,L=c}}else _&&(q(3042),_=!1)}function Q(t){P!==t&&(t?e.frontFace(2304):e.frontFace(2305),P=t)}function K(t){0!==t?(j(2884),t!==R&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):q(2884),R=t}function $(t,n,i){t?(j(32823),N===n&&D===i||(e.polygonOffset(n,i),N=n,D=i)):q(32823)}function ee(t){void 0===t&&(t=33984+I-1),F!==t&&(e.activeTexture(t),F=t)}return{buffers:{color:o,depth:s,stencil:c},initAttributes:function(){for(var e=0,t=h.length;e<t;e++)h[e]=0},enableAttribute:function(e){W(e,0)},enableAttributeAndDivisor:W,disableUnusedAttributes:function(){for(var t=0,n=u.length;t!==n;++t)u[t]!==h[t]&&(e.disableVertexAttribArray(t),u[t]=0)},enable:j,disable:q,useProgram:function(t){return f!==t&&(e.useProgram(t),f=t,!0)},setBlending:J,setMaterial:function(e,t){2===e.side?q(2884):j(2884);var n=1===e.side;t&&(n=!n),Q(n),e.blending===m&&!1===e.transparent?J(0):J(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),s.setFunc(e.depthFunc),s.setTest(e.depthTest),s.setMask(e.depthWrite),o.setMask(e.colorWrite);var i=e.stencilWrite;c.setTest(i),i&&(c.setMask(e.stencilWriteMask),c.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),c.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),$(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:Q,setCullFace:K,setLineWidth:function(t){t!==C&&(O&&e.lineWidth(t),C=t)},setPolygonOffset:$,setScissorTest:function(e){e?j(3089):q(3089)},activeTexture:ee,bindTexture:function(t,n){null===F&&ee();var i=B[F];void 0===i&&(i={type:void 0,texture:void 0},B[F]=i),i.type===t&&i.texture===n||(e.bindTexture(t,n||k[t]),i.type=t,i.texture=n)},unbindTexture:function(){var t=B[F];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===G.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),G.copy(t))},viewport:function(t){!1===V.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),V.copy(t))},reset:function(){for(var t=0;t<u.length;t++)1===u[t]&&(e.disableVertexAttribArray(t),u[t]=0);p={},F=null,B={},f=null,b=null,P=null,R=null,o.reset(),s.reset(),c.reset()}}}function Vr(e,t,n,i,a,o,s){var c,l=a.isWebGL2,h=a.maxTextures,u=a.maxCubemapSize,d=a.maxTextureSize,p=a.maxSamples,f=new WeakMap,m="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d");function g(e,t){return m?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function v(e,t,n,i){var r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<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?$.floorPowerOfTwo:Math.floor,o=a(r*e.width),s=a(r*e.height);void 0===c&&(c=g(o,s));var l=n?g(o,s):c;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 y(e){return $.isPowerOfTwo(e.width)&&$.isPowerOfTwo(e.height)}function x(e,t){return e.generateMipmaps&&t&&e.minFilter!==S&&e.minFilter!==A}function _(t,n,r,a){e.generateMipmap(t),i.get(n).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function P(e,n){if(!1===l)return e;var i=e;return 6403===e&&(5126===n&&(i=33326),5131===n&&(i=33325),5121===n&&(i=33321)),6407===e&&(5126===n&&(i=34837),5131===n&&(i=34843),5121===n&&(i=32849)),6408===e&&(5126===n&&(i=34836),5131===n&&(i=34842),5121===n&&(i=32856)),33325===i||33326===i||34842===i||34836===i?t.get("EXT_color_buffer_float"):34843!==i&&34837!==i||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),i}function F(e){return e===S||e===E||e===T?9728:9729}function B(t){var n=t.target;n.removeEventListener("dispose",B),function(t){var n=i.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),i.remove(t))}(n),n.isVideoTexture&&f.delete(n),s.memory.textures--}function G(t){var n=t.target;n.removeEventListener("dispose",G),function(t){var n=i.get(t),r=i.get(t.texture);if(t){if(void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget){e.deleteTexture(n.__webglColorTexture),e.deleteTexture(n.__webglDepthStencilTexture),s.memory.textures-=2,a=0;for(var o=n.__webglViewFramebuffers.length;a<o;a++)e.deleteFramebuffer(n.__webglViewFramebuffers[a])}i.remove(t.texture),i.remove(t)}}(n),s.memory.textures--}var V=0;function H(e,t){var r=i.get(e);if(e.isVideoTexture&&function(e){var t=s.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}(e),e.version>0&&r.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void Z(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,r.__webglTexture)}function k(t,r){if(6===t.image.length){var a=i.get(t);if(t.version>0&&a.__version!==t.version){Y(a,t),n.activeTexture(33984+r),n.bindTexture(34067,a.__webglTexture),e.pixelStorei(37440,t.flipY);for(var s=t&&t.isCompressedTexture,c=t.image[0]&&t.image[0].isDataTexture,h=[],d=0;d<6;d++)h[d]=s||c?c?t.image[d].image:t.image[d]:v(t.image[d],!1,!0,u);var p,f=h[0],m=y(f)||l,g=o.convert(t.format),b=o.convert(t.type),w=P(g,b);if(X(34067,t,m),s){for(d=0;d<6;d++){p=h[d].mipmaps;for(var M=0;M<p.length;M++){var S=p[M];t.format!==O&&t.format!==I?null!==g?n.compressedTexImage2D(34069+d,M,w,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+d,M,w,S.width,S.height,0,g,b,S.data)}}a.__maxMipLevel=p.length-1}else{for(p=t.mipmaps,d=0;d<6;d++)if(c)for(n.texImage2D(34069+d,0,w,h[d].width,h[d].height,0,g,b,h[d].data),M=0;M<p.length;M++){var E=(S=p[M]).image[d].image;n.texImage2D(34069+d,M+1,w,E.width,E.height,0,g,b,E.data)}else for(n.texImage2D(34069+d,0,w,g,b,h[d]),M=0;M<p.length;M++)S=p[M],n.texImage2D(34069+d,M+1,w,g,b,S.image[d]);a.__maxMipLevel=p.length}x(t,m)&&_(34067,t,f.width,f.height),a.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+r),n.bindTexture(34067,a.__webglTexture)}}function W(e,t){n.activeTexture(33984+t),n.bindTexture(34067,i.get(e).__webglTexture)}var j=r(r(r({},b,10497),w,33071),M,33648),q=r(r(r(r(r(r({},S,9728),E,9984),T,9986),A,9729),1007,9985),L,9987);function X(n,r,o){o?(e.texParameteri(n,10242,j[r.wrapS]),e.texParameteri(n,10243,j[r.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,j[r.wrapR]),e.texParameteri(n,10240,q[r.magFilter]),e.texParameteri(n,10241,q[r.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),r.wrapS===w&&r.wrapT===w||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,F(r.magFilter)),e.texParameteri(n,10241,F(r.minFilter)),r.minFilter!==S&&r.minFilter!==A&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(r.type===C&&null===t.get("OES_texture_float_linear"))return;if(r.type===N&&null===(l||t.get("OES_texture_half_float_linear")))return;(r.anisotropy>1||i.get(r).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r.anisotropy,a.getMaxAnisotropy())),i.get(r).__currentAnisotropy=r.anisotropy)}}function Y(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",B),t.__webglTexture=e.createTexture(),s.memory.textures++)}function Z(t,i,r){var a=3553;i.isDataTexture2DArray&&(a=35866),i.isDataTexture3D&&(a=32879),Y(t,i),n.activeTexture(33984+r),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment);var s=function(e){return!l&&(e.wrapS!==w||e.wrapT!==w||e.minFilter!==S&&e.minFilter!==A)}(i)&&!1===y(i.image),c=v(i.image,s,!1,d),h=y(c)||l,u=o.convert(i.format),p=o.convert(i.type),f=P(u,p);X(a,i,h);var m,g=i.mipmaps;if(i.isDepthTexture){if(f=6402,i.type===C){if(!1===l)throw new Error("Float Depth Texture only supported in WebGL2.0");f=36012}else l&&(f=33189);i.format===U&&6402===f&&i.type!==R&&1014!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=R,p=o.convert(i.type)),i.format===z&&(f=34041,i.type!==D&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=D,p=o.convert(i.type))),n.texImage2D(3553,0,f,c.width,c.height,0,u,p,null)}else if(i.isDataTexture)if(g.length>0&&h){for(var b=0,M=g.length;b<M;b++)m=g[b],n.texImage2D(3553,b,f,m.width,m.height,0,u,p,m.data);i.generateMipmaps=!1,t.__maxMipLevel=g.length-1}else n.texImage2D(3553,0,f,c.width,c.height,0,u,p,c.data),t.__maxMipLevel=0;else if(i.isCompressedTexture){for(b=0,M=g.length;b<M;b++)m=g[b],i.format!==O&&i.format!==I?null!==u?n.compressedTexImage2D(3553,b,f,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,b,f,m.width,m.height,0,u,p,m.data);t.__maxMipLevel=g.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,f,c.width,c.height,c.depth,0,u,p,c.data),t.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,f,c.width,c.height,c.depth,0,u,p,c.data),t.__maxMipLevel=0;else if(g.length>0&&h){for(b=0,M=g.length;b<M;b++)m=g[b],n.texImage2D(3553,b,f,u,p,m);i.generateMipmaps=!1,t.__maxMipLevel=g.length-1}else n.texImage2D(3553,0,f,u,p,c),t.__maxMipLevel=0;x(i,h)&&_(3553,i,c.width,c.height),t.__version=i.version,i.onUpdate&&i.onUpdate(i)}function J(t,r,a,s){var c=o.convert(r.texture.format),l=o.convert(r.texture.type),h=P(c,l);n.texImage2D(s,0,h,r.width,r.height,0,c,l,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,a,s,i.get(r.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function Q(t,n,i){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){if(i){var r=K(n);e.renderbufferStorageMultisample(36161,r,33189,n.width,n.height)}else e.renderbufferStorage(36161,33189,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer)i?(r=K(n),e.renderbufferStorageMultisample(36161,r,35056,n.width,n.height)):e.renderbufferStorage(36161,34041,n.width,n.height),e.framebufferRenderbuffer(36160,33306,36161,t);else{var a=P(o.convert(n.texture.format),o.convert(n.texture.type));i?(r=K(n),e.renderbufferStorageMultisample(36161,r,a,n.width,n.height)):e.renderbufferStorage(36161,a,n.width,n.height)}e.bindRenderbuffer(36161,null)}function K(e){return l&&e.isWebGLMultisampleRenderTarget?Math.min(p,e.samples):0}var ee=!1,te=!1;this.allocateTextureUnit=function(){var e=V;return e>=h&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+h),V+=1,e},this.resetTextureUnits=function(){V=0},this.setTexture2D=H,this.setTexture2DArray=function(e,t){var r=i.get(e);e.version>0&&r.__version!==e.version?Z(r,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(e,t){var r=i.get(e);e.version>0&&r.__version!==e.version?Z(r,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=k,this.setTextureCubeDynamic=W,this.setupRenderTarget=function(r){var a=i.get(r),c=i.get(r.texture);r.addEventListener("dispose",G),c.__webglTexture=e.createTexture(),s.memory.textures++;var h=!0===r.isWebGLRenderTargetCube,u=!0===r.isWebGLMultisampleRenderTarget,d=!0===r.isWebGLMultiviewRenderTarget,p=y(r)||l;if(h){a.__webglFramebuffer=[];for(var f=0;f<6;f++)a.__webglFramebuffer[f]=e.createFramebuffer()}else if(a.__webglFramebuffer=e.createFramebuffer(),u)if(l){a.__webglMultisampledFramebuffer=e.createFramebuffer(),a.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,a.__webglColorRenderbuffer);var m=P(o.convert(r.texture.format),o.convert(r.texture.type)),g=K(r);e.renderbufferStorageMultisample(36161,g,m,r.width,r.height),e.bindFramebuffer(36160,a.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,a.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),r.depthBuffer&&(a.__webglDepthRenderbuffer=e.createRenderbuffer(),Q(a.__webglDepthRenderbuffer,r,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(d){var v=r.width,b=r.height,w=r.numViews;e.bindFramebuffer(36160,a.__webglFramebuffer);var M=t.get("OVR_multiview2");s.memory.textures+=2;var S=e.createTexture();e.bindTexture(35866,S),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,32856,v,b,w,0,6408,5121,null),M.framebufferTextureMultiviewOVR(36160,36064,S,0,0,w);var E=e.createTexture();e.bindTexture(35866,E),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,35056,v,b,w,0,34041,34042,null),M.framebufferTextureMultiviewOVR(36160,33306,E,0,0,w);var T=new Array(w);for(f=0;f<w;++f)T[f]=e.createFramebuffer(),e.bindFramebuffer(36160,T[f]),e.framebufferTextureLayer(36160,36064,S,0,f);a.__webglColorTexture=S,a.__webglDepthStencilTexture=E,a.__webglViewFramebuffers=T,e.bindFramebuffer(36160,null),e.bindTexture(35866,null)}if(h){for(n.bindTexture(34067,c.__webglTexture),X(34067,r.texture,p),f=0;f<6;f++)J(a.__webglFramebuffer[f],r,36064,34069+f);x(r.texture,p)&&_(34067,r.texture,r.width,r.height),n.bindTexture(34067,null)}else d||(n.bindTexture(3553,c.__webglTexture),X(3553,r.texture,p),J(a.__webglFramebuffer,r,36064,3553),x(r.texture,p)&&_(3553,r.texture,r.width,r.height),n.bindTexture(3553,null));r.depthBuffer&&function(t){var n=i.get(t),r=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),H(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===U)e.framebufferTexture2D(36160,36096,3553,r,0);else{if(n.depthTexture.format!==z)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,r,0)}}(n.__webglFramebuffer,t)}else if(r){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),Q(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),Q(n.__webglDepthbuffer,t);e.bindFramebuffer(36160,null)}(r)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(x(t,y(e)||l)){var r=e.isWebGLRenderTargetCube?34067:3553,a=i.get(t).__webglTexture;n.bindTexture(r,a),_(r,t,e.width,e.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(l){var n=i.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var r=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,r,a,0,0,r,a,o,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===ee&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ee=!0),e=e.texture),H(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLRenderTargetCube&&(!1===te&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),te=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?k(e,t):W(e,t)}}function Hr(e,t,n){var i=n.isWebGL2;return{convert:function(e){var n;if(e===P)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(e===R)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(e===C)return 5126;if(e===N)return i?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===e)return 6406;if(e===I)return 6407;if(e===O)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(e===U)return 6402;if(e===z)return 34041;if(1028===e)return 6403;if(33776===e||33777===e||33778===e||33779===e){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return 36196===e?null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null:37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:e===D?i?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function kr(e,t,n,i){de.call(this,e,t,i),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function Wr(e,t){var n,i,r,a,o,s,c,l=e.extensions,h=e.properties,u=0;function d(e){return e.isArrayCamera?e.cameras:(o[0]=e,o)}this.isAvailable=function(){if(void 0===c){var e=l.get("OVR_multiview2");if(c=null!==e&&!1===t.getContextAttributes().antialias){u=t.getParameter(e.MAX_VIEWS_OVR),n=new kr(0,0,2),s=new ee,a=[],r=[],o=[];for(var i=0;i<u;i++)a[i]=new be,r[i]=new se}}return c},this.attachCamera=function(t){!1!==function(e){if(void 0===e.isArrayCamera)return!0;var t=e.cameras;if(t.length>u)return!1;for(var n=1,i=t.length;n<i;n++)if(t[0].viewport.z!==t[n].viewport.z||t[0].viewport.w!==t[n].viewport.w)return!1;return!0}(t)&&(i=e.getRenderTarget(),function(t){if(i?s.set(i.width,i.height):e.getDrawingBufferSize(s),t.isArrayCamera){var r=t.cameras[0].viewport;n.setSize(r.z,r.w),n.setNumViews(t.cameras.length)}else n.setSize(s.x,s.y),n.setNumViews(2)}(t),e.setRenderTarget(n))},this.detachCamera=function(r){n===e.getRenderTarget()&&(e.setRenderTarget(i),function(e){var i=n,r=i.numViews,a=h.get(i).__webglViewFramebuffers,o=i.width,c=i.height;if(e.isArrayCamera)for(var l=0;l<r;l++){var u=e.cameras[l].viewport,d=u.x,p=u.y,f=d+u.z,m=p+u.w;t.bindFramebuffer(36008,a[l]),t.blitFramebuffer(0,0,o,c,d,p,f,m,16384,9728)}else t.bindFramebuffer(36008,a[0]),t.blitFramebuffer(0,0,o,c,0,0,s.x,s.y,16384,9728)}(r))},this.updateCameraProjectionMatricesUniform=function(e,n){for(var i=d(e),r=0;r<i.length;r++)a[r].copy(i[r].projectionMatrix);n.setValue(t,"projectionMatrices",a)},this.updateCameraViewMatricesUniform=function(e,n){for(var i=d(e),r=0;r<i.length;r++)a[r].copy(i[r].matrixWorldInverse);n.setValue(t,"viewMatrices",a)},this.updateObjectMatricesUniforms=function(e,n,i){for(var o=d(n),s=0;s<o.length;s++)a[s].multiplyMatrices(o[s].matrixWorldInverse,e.matrixWorld),r[s].getNormalMatrix(a[s]);i.setValue(t,"modelViewMatrices",a),i.setValue(t,"normalMatrices",r)}}function jr(){Be.call(this),this.type="Group"}function qr(e){Bn.call(this),this.cameras=e||[]}zr.prototype=Object.create(Ut.prototype),zr.prototype.constructor=zr,zr.prototype.isMeshDepthMaterial=!0,zr.prototype.copy=function(e){return Ut.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Fr.prototype=Object.create(Ut.prototype),Fr.prototype.constructor=Fr,Fr.prototype.isMeshDistanceMaterial=!0,Fr.prototype.copy=function(e){return Ut.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},kr.prototype=Object.assign(Object.create(de.prototype),{constructor:kr,isWebGLMultiviewRenderTarget:!0,copy:function(e){return de.prototype.copy.call(this,e),this.numViews=e.numViews,this},setNumViews:function(e){return this.numViews!==e&&(this.numViews=e,this.dispose()),this}}),jr.prototype=Object.assign(Object.create(Be.prototype),{constructor:jr,isGroup:!0}),qr.prototype=Object.assign(Object.create(Bn.prototype),{constructor:qr,isArrayCamera:!0});var Xr,Yr=new re,Zr=new re;function Jr(e,t,n){Yr.setFromMatrixPosition(t.matrixWorld),Zr.setFromMatrixPosition(n.matrixWorld);var i=Yr.distanceTo(Zr),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),c=(r[9]+1)/r[5],l=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(a[8]+1)/a[0],d=o*h,p=o*u,f=i/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var g=o+f,v=s+f,y=d-m,x=p+(i-m),_=c*s/v*g,b=l*s/v*g;e.projectionMatrix.makePerspective(y,x,_,b,g,v)}function Qr(e){var t,n,i=this,r=null,a=null,o=[],s=new be,c=new be,l=1,h="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(a=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",b,!1));var u=new be,d=new te,p=new re,f=new Bn,m=new Bn;m.viewport=new ue,m.layers.enable(1);var g=new Bn;g.viewport=new ue,g.layers.enable(2);var v=new qr([m,g]);function y(){return null!==r&&!0===r.isPresenting}v.layers.enable(1),v.layers.enable(2);var x,_=new ee;function b(){if(y()){var a=r.getEyeParameters("left");t=2*a.renderWidth*l,n=a.renderHeight*l,x=e.getPixelRatio(),e.getSize(_),e.setDrawingBufferSize(t,n,1),m.viewport.set(0,0,t/2,n),g.viewport.set(t/2,0,t/2,n),T.start(),i.dispatchEvent({type:"sessionstart"})}else i.enabled&&e.setDrawingBufferSize(_.width,_.height,x),T.stop(),i.dispatchEvent({type:"sessionend"})}var w=[],M=[];function S(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),n=0,i=t.length;n<i;n++){var r=t[n];if(r&&("Daydream Controller"===r.id||"Gear VR Controller"===r.id||"Oculus Go Controller"===r.id||"OpenVR Gamepad"===r.id||r.id.startsWith("Oculus Touch")||r.id.startsWith("HTC Vive Focus")||r.id.startsWith("Spatial Controller"))){var a=r.hand;if(0===e&&(""===a||"right"===a))return r;if(1===e&&"left"===a)return r}}}function E(e,i){null!==i&&4===i.length&&e.set(i[0]*t,i[1]*n,i[2]*t,i[3]*n)}this.enabled=!1,this.getController=function(e){var t=o[e];return void 0===t&&((t=new jr).matrixAutoUpdate=!1,t.visible=!1,o[e]=t),t},this.getDevice=function(){return r},this.setDevice=function(e){void 0!==e&&(r=e),T.setContext(e)},this.setFramebufferScaleFactor=function(e){l=e},this.setReferenceSpaceType=function(e){h=e},this.getCamera=function(e){var t="local-floor"===h?1.6:0;if(r.depthNear=e.near,r.depthFar=e.far,r.getFrameData(a),"local-floor"===h){var n=r.stageParameters;n?s.fromArray(n.sittingToStandingTransform):s.makeTranslation(0,t,0)}var i=a.pose;f.matrix.copy(s),f.matrix.decompose(f.position,f.quaternion,f.scale),null!==i.orientation&&(d.fromArray(i.orientation),f.quaternion.multiply(d)),null!==i.position&&(d.setFromRotationMatrix(s),p.fromArray(i.position),p.applyQuaternion(d),f.position.add(p)),f.updateMatrixWorld(),e.matrixWorld.copy(f.matrixWorld);for(var l=e.children,y=0,x=l.length;y<x;y++)l[y].updateMatrixWorld(!0);m.near=e.near,g.near=e.near,m.far=e.far,g.far=e.far,m.matrixWorldInverse.fromArray(a.leftViewMatrix),g.matrixWorldInverse.fromArray(a.rightViewMatrix),c.getInverse(s),"local-floor"===h&&(m.matrixWorldInverse.multiply(c),g.matrixWorldInverse.multiply(c));var _=e.parent;null!==_&&(u.getInverse(_.matrixWorld),m.matrixWorldInverse.multiply(u),g.matrixWorldInverse.multiply(u)),m.matrixWorld.getInverse(m.matrixWorldInverse),g.matrixWorld.getInverse(g.matrixWorldInverse),m.projectionMatrix.fromArray(a.leftProjectionMatrix),g.projectionMatrix.fromArray(a.rightProjectionMatrix),Jr(v,m,g);var b=r.getLayers();if(b.length){var T=b[0];E(m.viewport,T.leftBounds),E(g.viewport,T.rightBounds)}return function(){for(var e=0;e<o.length;e++){var t=o[e],n=S(e);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&t.position.set(.2,-.6,-.05),null!==i.position&&t.position.fromArray(i.position),null!==i.orientation&&t.quaternion.fromArray(i.orientation),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrix.premultiply(s),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixWorldNeedsUpdate=!0,t.visible=!0;var r="Daydream Controller"===n.id?0:1;void 0===w[e]&&(w[e]=!1),w[e]!==n.buttons[r].pressed&&(w[e]=n.buttons[r].pressed,!0===w[e]?t.dispatchEvent({type:"selectstart"}):(t.dispatchEvent({type:"selectend"}),t.dispatchEvent({type:"select"}))),r=2,void 0===M[e]&&(M[e]=!1),void 0!==n.buttons[r]&&M[e]!==n.buttons[r].pressed&&(M[e]=n.buttons[r].pressed,!0===M[e]?t.dispatchEvent({type:"squeezestart"}):(t.dispatchEvent({type:"squeezeend"}),t.dispatchEvent({type:"squeeze"})))}else t.visible=!1}}(),v},this.getStandingMatrix=function(){return s},this.isPresenting=y;var T=new Jn;this.setAnimationLoop=function(e){T.setAnimationLoop(e),y()&&T.start()},this.submitFrame=function(){y()&&r.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",b)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function Kr(e,t){var n=this,i=null,r=null,a="local-floor",o=null,s=[],c=[],l=new Bn;l.layers.enable(1),l.viewport=new ue;var h=new Bn;h.layers.enable(2),h.viewport=new ue;var u=new qr([l,h]);function d(e){for(var t=0;t<s.length;t++)c[t]===e.inputSource&&s[t].dispatchEvent({type:e.type})}function p(){e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),x.stop(),n.dispatchEvent({type:"sessionend"})}function f(e){r=e,x.setContext(i),x.start(),n.dispatchEvent({type:"sessionstart"})}function m(){for(var e=0;e<s.length;e++)c[e]=g(e)}function g(e){for(var t=i.inputSources,n=0;n<t.length;n++){var r=t[n],a=r.handedness;if(0===e&&("none"===a||"right"===a))return r;if(1===e&&"left"===a)return r}}function v(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}u.layers.enable(1),u.layers.enable(2),this.enabled=!1,this.getController=function(e){var t=s[e];return void 0===t&&((t=new jr).matrixAutoUpdate=!1,t.visible=!1,s[e]=t),t},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(e){a=e},this.getSession=function(){return i},this.setSession=function(e){null!==(i=e)&&(i.addEventListener("select",d),i.addEventListener("selectstart",d),i.addEventListener("selectend",d),i.addEventListener("squeeze",d),i.addEventListener("squeezestart",d),i.addEventListener("squeezeend",d),i.addEventListener("end",p),i.updateRenderState({baseLayer:new XRWebGLLayer(i,t)}),i.requestReferenceSpace(a).then(f),i.addEventListener("inputsourceschange",m),m())},this.getCamera=function(e){var t=e.parent,n=u.cameras;v(u,t);for(var i=0;i<n.length;i++)v(n[i],t);e.matrixWorld.copy(u.matrixWorld);for(var r=e.children,a=(i=0,r.length);i<a;i++)r[i].updateMatrixWorld(!0);return Jr(u,l,h),u},this.isPresenting=function(){return null!==i&&null!==r};var y=null,x=new Jn;x.setAnimationLoop((function(t,n){if(null!==(o=n.getViewerPose(r))){var a=o.views,l=i.renderState.baseLayer;e.setFramebuffer(l.framebuffer);for(var h=0;h<a.length;h++){var d=a[h],p=l.getViewport(d),f=d.transform.inverse.matrix,m=u.cameras[h];m.matrix.fromArray(f).getInverse(m.matrix),m.projectionMatrix.fromArray(d.projectionMatrix),m.viewport.set(p.x,p.y,p.width,p.height),0===h&&u.matrix.copy(m.matrix)}}for(h=0;h<s.length;h++){var g=s[h],v=c[h];if(v){var x=n.getPose(v.targetRaySpace,r);if(null!==x){g.matrix.fromArray(x.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.visible=!0;continue}}g.visible=!1}y&&y(t)})),this.setAnimationLoop=function(e){y=e},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new be},this.getDevice=function(){console.warn("THREE.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("THREE.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function $r(e){var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,i=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",h=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,u=null,d=null;this.domElement=t,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.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p,f,m,g,v,y,x,_,b,w,M,S,E,T,A,L,R,D,I=this,U=!1,z=null,F=0,B=0,G=null,V=null,H=-1,k={geometry:null,program:null,wireframe:!1},j=null,q=null,X=new ue,Y=new ue,Z=null,J=t.width,Q=t.height,K=1,te=new ue(0,0,J,Q),ne=new ue(0,0,J,Q),ie=!1,ae=new qn,oe=new ii,se=!1,ce=!1,le=new be,he=new re;function de(){return null===G?K:1}try{var pe={alpha:i,depth:r,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:h,xrCompatible:!0};if(t.addEventListener("webglcontextlost",ye,!1),t.addEventListener("webglcontextrestored",xe,!1),null===(p=n||t.getContext("webgl",pe)||t.getContext("experimental-webgl",pe)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===p.getShaderPrecisionFormat&&(p.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function fe(){f=new ri(p),!1===(m=new ni(p,f,e)).isWebGL2&&(f.get("WEBGL_depth_texture"),f.get("OES_texture_float"),f.get("OES_texture_half_float"),f.get("OES_texture_half_float_linear"),f.get("OES_standard_derivatives"),f.get("OES_element_index_uint"),f.get("ANGLE_instanced_arrays")),f.get("OES_texture_float_linear"),D=new Hr(p,f,m),(g=new Gr(p,f,m)).scissor(Y.copy(ne).multiplyScalar(K).floor()),g.viewport(X.copy(te).multiplyScalar(K).floor()),v=new si(p),y=new Tr,x=new Vr(p,f,g,y,m,D,v),_=new Qn(p),b=new ai(p,_,v),w=new hi(p,b,_,v),A=new li(p),M=new Er(I,f,m),S=new Rr,E=new Ur,T=new ei(I,g,w,s),L=new ti(p,f,v,m),R=new oi(p,f,v,m),v.programs=M.programs,I.capabilities=m,I.extensions=f,I.properties=y,I.renderLists=S,I.state=g,I.info=v}fe();var me="undefined"!=typeof navigator&&"xr"in navigator?new Kr(I,p):new Qr(I);this.vr=me;var ge=new Wr(I,p),ve=new Br(I,w,m.maxTextureSize);function ye(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function xe(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1,fe()}function _e(e){var t=e.target;t.removeEventListener("dispose",_e),function(e){we(e),y.remove(e)}(t)}function we(e){var t=y.get(e).program;e.program=void 0,void 0!==t&&M.releaseProgram(t)}this.shadowMap=ve,this.getContext=function(){return p},this.getContextAttributes=function(){return p.getContextAttributes()},this.forceContextLoss=function(){var e=f.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=f.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return K},this.setPixelRatio=function(e){void 0!==e&&(K=e,this.setSize(J,Q,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new ee),e.set(J,Q)},this.setSize=function(e,n,i){me.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(J=e,Q=n,t.width=Math.floor(e*K),t.height=Math.floor(n*K),!1!==i&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new ee),e.set(J*K,Q*K).floor()},this.setDrawingBufferSize=function(e,n,i){J=e,Q=n,K=i,t.width=Math.floor(e*i),t.height=Math.floor(n*i),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new ue),e.copy(X)},this.getViewport=function(e){return e.copy(te)},this.setViewport=function(e,t,n,i){e.isVector4?te.set(e.x,e.y,e.z,e.w):te.set(e,t,n,i),g.viewport(X.copy(te).multiplyScalar(K).floor())},this.getScissor=function(e){return e.copy(ne)},this.setScissor=function(e,t,n,i){e.isVector4?ne.set(e.x,e.y,e.z,e.w):ne.set(e,t,n,i),g.scissor(Y.copy(ne).multiplyScalar(K).floor())},this.getScissorTest=function(){return ie},this.setScissorTest=function(e){g.setScissorTest(ie=e)},this.getClearColor=function(){return T.getClearColor()},this.setClearColor=function(){T.setClearColor.apply(T,arguments)},this.getClearAlpha=function(){return T.getClearAlpha()},this.setClearAlpha=function(){T.setClearAlpha.apply(T,arguments)},this.clear=function(e,t,n){var i=0;(void 0===e||e)&&(i|=16384),(void 0===t||t)&&(i|=256),(void 0===n||n)&&(i|=1024),p.clear(i)},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(){t.removeEventListener("webglcontextlost",ye,!1),t.removeEventListener("webglcontextrestored",xe,!1),S.dispose(),E.dispose(),y.dispose(),w.dispose(),me.dispose(),Se.stop()},this.renderBufferImmediate=function(e,t){g.initAttributes();var n=y.get(e);e.hasPositions&&!n.position&&(n.position=p.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=p.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=p.createBuffer()),e.hasColors&&!n.color&&(n.color=p.createBuffer());var i=t.getAttributes();e.hasPositions&&(p.bindBuffer(34962,n.position),p.bufferData(34962,e.positionArray,35048),g.enableAttribute(i.position),p.vertexAttribPointer(i.position,3,5126,!1,0,0)),e.hasNormals&&(p.bindBuffer(34962,n.normal),p.bufferData(34962,e.normalArray,35048),g.enableAttribute(i.normal),p.vertexAttribPointer(i.normal,3,5126,!1,0,0)),e.hasUvs&&(p.bindBuffer(34962,n.uv),p.bufferData(34962,e.uvArray,35048),g.enableAttribute(i.uv),p.vertexAttribPointer(i.uv,2,5126,!1,0,0)),e.hasColors&&(p.bindBuffer(34962,n.color),p.bufferData(34962,e.colorArray,35048),g.enableAttribute(i.color),p.vertexAttribPointer(i.color,3,5126,!1,0,0)),g.disableUnusedAttributes(),p.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,i,r,a){var o=r.isMesh&&r.matrixWorld.determinant()<0;g.setMaterial(i,o);var s=Pe(e,t,i,r),c=!1;k.geometry===n.id&&k.program===s.id&&k.wireframe===(!0===i.wireframe)||(k.geometry=n.id,k.program=s.id,k.wireframe=!0===i.wireframe,c=!0),r.morphTargetInfluences&&(A.update(r,n,i,s),c=!0);var l=n.index,h=n.attributes.position;if((null===l||0!==l.count)&&void 0!==h&&0!==h.count){var u,d=1;!0===i.wireframe&&(l=b.getWireframeAttribute(n),d=2);var v=L;null!==l&&(u=_.get(l),(v=R).setIndex(u)),c&&(function(e,t,n,i){if(!1!==m.isWebGL2||!e.isInstancedMesh&&!t.isInstancedBufferGeometry||null!==f.get("ANGLE_instanced_arrays")){g.initAttributes();var r=t.attributes,a=i.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=r[s];if(void 0!==l){var h=l.normalized,u=l.itemSize;if(void 0===(M=_.get(l)))continue;var d=M.buffer,v=M.type,y=M.bytesPerElement;if(l.isInterleavedBufferAttribute){var x=l.data,b=x.stride,w=l.offset;x&&x.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(c,x.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=x.meshPerAttribute*x.count)):g.enableAttribute(c),p.bindBuffer(34962,d),p.vertexAttribPointer(c,u,v,h,b*y,w*y)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(c),p.bindBuffer(34962,d),p.vertexAttribPointer(c,u,v,h,0,0)}else if("instanceMatrix"===s){var M;if(void 0===(M=_.get(e.instanceMatrix)))continue;d=M.buffer,v=M.type,g.enableAttributeAndDivisor(c+0,1),g.enableAttributeAndDivisor(c+1,1),g.enableAttributeAndDivisor(c+2,1),g.enableAttributeAndDivisor(c+3,1),p.bindBuffer(34962,d),p.vertexAttribPointer(c+0,4,v,!1,64,0),p.vertexAttribPointer(c+1,4,v,!1,64,16),p.vertexAttribPointer(c+2,4,v,!1,64,32),p.vertexAttribPointer(c+3,4,v,!1,64,48)}else if(void 0!==o){var S=o[s];if(void 0!==S)switch(S.length){case 2:p.vertexAttrib2fv(c,S);break;case 3:p.vertexAttrib3fv(c,S);break;case 4:p.vertexAttrib4fv(c,S);break;default:p.vertexAttrib1fv(c,S)}}}}g.disableUnusedAttributes()}}(r,n,i,s),null!==l&&p.bindBuffer(34963,u.buffer));var y=1/0;null!==l?y=l.count:void 0!==h&&(y=h.count);var x=n.drawRange.start*d,w=n.drawRange.count*d,M=null!==a?a.start*d:0,S=null!==a?a.count*d:1/0,E=Math.max(x,M),T=Math.min(y,x+w,M+S)-1,P=Math.max(0,T-E+1);if(0!==P){if(r.isMesh)if(!0===i.wireframe)g.setLineWidth(i.wireframeLinewidth*de()),v.setMode(1);else switch(r.drawMode){case W:v.setMode(4);break;case 1:v.setMode(5);break;case 2:v.setMode(6)}else if(r.isLine){var C=i.linewidth;void 0===C&&(C=1),g.setLineWidth(C*de()),r.isLineSegments?v.setMode(1):r.isLineLoop?v.setMode(2):v.setMode(3)}else r.isPoints?v.setMode(0):r.isSprite&&v.setMode(4);r.isInstancedMesh?v.renderInstances(n,E,P,r.count):n.isInstancedBufferGeometry?v.renderInstances(n,E,P,n.maxInstancedCount):v.render(E,P)}}},this.compile=function(e,t){(d=E.get(e,t)).init(),e.traverse((function(e){e.isLight&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))})),d.setupLights(t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)Le(t.material[n],e.fog,t);else Le(t.material,e.fog,t)}))};var Me=null,Se=new Jn;function Ee(e,t,n,i){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ae.intersectsSprite(e)){i&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(le);var r=w.update(e);(a=e.material).visible&&u.push(e,r,a,n,he.z,null)}}else if(e.isImmediateRenderObject)i&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(le),u.push(e,null,e.material,n,he.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==v.render.frame&&(e.skeleton.update(),e.skeleton.frame=v.render.frame),!e.frustumCulled||ae.intersectsObject(e))){i&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(le),r=w.update(e);var a=e.material;if(Array.isArray(a))for(var o=r.groups,s=0,c=o.length;s<c;s++){var l=o[s],h=a[l.materialIndex];h&&h.visible&&u.push(e,r,h,n,he.z,l)}else a.visible&&u.push(e,r,a,n,he.z,null)}var p=e.children;for(s=0,c=p.length;s<c;s++)Ee(p[s],t,n,i)}}function Te(e,t,n,i){for(var r=0,a=e.length;r<a;r++){var o=e[r],s=o.object,c=o.geometry,l=void 0===i?o.material:i,h=o.group;if(n.isArrayCamera)if(q=n,me.enabled&&ge.isAvailable())Ae(s,t,n,c,l,h);else for(var u=n.cameras,p=0,f=u.length;p<f;p++){var m=u[p];s.layers.test(m.layers)&&(g.viewport(X.copy(m.viewport)),d.setupLights(m),Ae(s,t,m,c,l,h))}else q=null,Ae(s,t,n,c,l,h)}}function Ae(e,t,n,i,r,a){if(e.onBeforeRender(I,t,n,i,r,a),d=E.get(t,q||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){g.setMaterial(r);var o=Pe(n,t.fog,r,e);k.geometry=null,k.program=null,k.wireframe=!1,function(e,t){e.render((function(e){I.renderBufferImmediate(e,t)}))}(e,o)}else I.renderBufferDirect(n,t.fog,i,r,e,a);e.onAfterRender(I,t,n,i,r,a),d=E.get(t,q||n)}function Le(e,t,n){var i=y.get(e),r=d.state.lights,a=d.state.shadowsArray,o=r.state.version,s=M.getParameters(e,r.state,a,t,oe.numPlanes,oe.numIntersection,n),c=M.getProgramCacheKey(e,s),l=i.program,h=!0;if(void 0===l)e.addEventListener("dispose",_e);else if(l.cacheKey!==c)we(e);else if(i.lightsStateVersion!==o)i.lightsStateVersion=o,h=!1;else{if(void 0!==s.shaderID)return;h=!1}if(h){if(s.shaderID){var u=Zn[s.shaderID];i.shader={name:e.type,uniforms:Nn(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else i.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(i.shader,I),c=M.getProgramCacheKey(e,s),l=M.acquireProgram(e,i.shader,s,c),i.program=l,e.program=l}var p=l.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var f=0;f<I.maxMorphTargets;f++)p["morphTarget"+f]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals)for(e.numSupportedMorphNormals=0,f=0;f<I.maxMorphNormals;f++)p["morphNormal"+f]>=0&&e.numSupportedMorphNormals++;var m=i.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(i.numClippingPlanes=oe.numPlanes,i.numIntersection=oe.numIntersection,m.clippingPlanes=oe.uniform),i.fog=t,i.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),i.lightsStateVersion=o,i.needsLights&&(m.ambientLightColor.value=r.state.ambient,m.lightProbe.value=r.state.probe,m.directionalLights.value=r.state.directional,m.spotLights.value=r.state.spot,m.rectAreaLights.value=r.state.rectArea,m.pointLights.value=r.state.point,m.hemisphereLights.value=r.state.hemi,m.directionalShadowMap.value=r.state.directionalShadowMap,m.directionalShadowMatrix.value=r.state.directionalShadowMatrix,m.spotShadowMap.value=r.state.spotShadowMap,m.spotShadowMatrix.value=r.state.spotShadowMatrix,m.pointShadowMap.value=r.state.pointShadowMap,m.pointShadowMatrix.value=r.state.pointShadowMatrix);var g=i.program.getUniforms(),v=sr.seqWithValue(g.seq,m);i.uniformsList=v}function Pe(e,t,n,i){x.resetTextureUnits();var r=y.get(n),a=d.state.lights;if(se&&(ce||e!==j)){var o=e===j&&n.id===H;oe.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,r,o)}n.version===r.__version&&(void 0===r.program||n.fog&&r.fog!==t||r.needsLights&&r.lightsStateVersion!==a.state.version?n.needsUpdate=!0:void 0===r.numClippingPlanes||r.numClippingPlanes===oe.numPlanes&&r.numIntersection===oe.numIntersection||(n.needsUpdate=!0)),n.version!==r.__version&&(Le(n,t,i),r.__version=n.version);var s,c,l=!1,h=!1,u=!1,f=r.program,v=f.getUniforms(),_=r.shader.uniforms;if(g.useProgram(f.program)&&(l=!0,h=!0,u=!0),n.id!==H&&(H=n.id,h=!0),l||j!==e){if(f.numMultiviewViews>0?ge.updateCameraProjectionMatricesUniform(e,v):v.setValue(p,"projectionMatrix",e.projectionMatrix),m.logarithmicDepthBuffer&&v.setValue(p,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),j!==e&&(j=e,h=!0,u=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var b=v.map.cameraPosition;void 0!==b&&b.setValue(p,he.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&v.setValue(p,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(f.numMultiviewViews>0?ge.updateCameraViewMatricesUniform(e,v):v.setValue(p,"viewMatrix",e.matrixWorldInverse))}if(n.skinning){v.setOptional(p,i,"bindMatrix"),v.setOptional(p,i,"bindMatrixInverse");var w=i.skeleton;if(w){var M=w.bones;if(m.floatVertexTextures){if(void 0===w.boneTexture){var S=Math.sqrt(4*M.length);S=$.ceilPowerOfTwo(S),S=Math.max(S,4);var E=new Float32Array(S*S*4);E.set(w.boneMatrices);var T=new kn(E,S,S,O,C);w.boneMatrices=E,w.boneTexture=T,w.boneTextureSize=S}v.setValue(p,"boneTexture",w.boneTexture,x),v.setValue(p,"boneTextureSize",w.boneTextureSize)}else v.setOptional(p,w,"boneMatrices")}}return(h||r.receiveShadow!==i.receiveShadow)&&(r.receiveShadow=i.receiveShadow,v.setValue(p,"receiveShadow",i.receiveShadow)),h&&(v.setValue(p,"toneMappingExposure",I.toneMappingExposure),v.setValue(p,"toneMappingWhitePoint",I.toneMappingWhitePoint),r.needsLights&&(c=u,(s=_).ambientLightColor.needsUpdate=c,s.lightProbe.needsUpdate=c,s.directionalLights.needsUpdate=c,s.pointLights.needsUpdate=c,s.spotLights.needsUpdate=c,s.rectAreaLights.needsUpdate=c,s.hemisphereLights.needsUpdate=c),t&&n.fog&&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)}(_,t),n.isMeshBasicMaterial?Re(_,n):n.isMeshLambertMaterial?(Re(_,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(_,n)):n.isMeshPhongMaterial?(Re(_,n),n.isMeshToonMaterial?function(e,t){Ce(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(_,n):Ce(_,n)):n.isMeshStandardMaterial?(Re(_,n),n.isMeshPhysicalMaterial?function(e,t){Ne(e,t),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate()),e.transparency.value=t.transparency}(_,n):Ne(_,n)):n.isMeshMatcapMaterial?(Re(_,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(_,n)):n.isMeshDepthMaterial?(Re(_,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(_,n)):n.isMeshDistanceMaterial?(Re(_,n),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}(_,n)):n.isMeshNormalMaterial?(Re(_,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(_,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(_,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(_,n)):n.isPointsMaterial?function(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*K,e.scale.value=.5*Q,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(_,n):n.isSpriteMaterial?function(e,t){var n;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),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(_,n):n.isShadowMaterial&&(_.color.value.copy(n.color),_.opacity.value=n.opacity),void 0!==_.ltc_1&&(_.ltc_1.value=Yn.LTC_1),void 0!==_.ltc_2&&(_.ltc_2.value=Yn.LTC_2),sr.upload(p,r.uniformsList,_,x),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(sr.upload(p,r.uniformsList,_,x),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&v.setValue(p,"center",i.center),f.numMultiviewViews>0?ge.updateObjectMatricesUniforms(i,e,v):(v.setValue(p,"modelViewMatrix",i.modelViewMatrix),v.setValue(p,"normalMatrix",i.normalMatrix)),v.setValue(p,"modelMatrix",i.matrixWorld),f}function Re(e,t){var n;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),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=y.get(t.envMap).__maxMipLevel),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),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function Ce(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,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Ne(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,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}Se.setAnimationLoop((function(e){me.isPresenting()||Me&&Me(e)})),"undefined"!=typeof window&&Se.setContext(window),this.setAnimationLoop=function(e){Me=e,me.setAnimationLoop(e),Se.start()},this.render=function(e,t){var n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),t&&t.isCamera){if(!U){k.geometry=null,k.program=null,k.wireframe=!1,H=-1,j=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),me.enabled&&me.isPresenting()&&(t=me.getCamera(t)),(d=E.get(e,t)).init(),e.onBeforeRender(I,e,t,n||G),le.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ae.setFromMatrix(le),ce=this.localClippingEnabled,se=oe.init(this.clippingPlanes,ce,t),(u=S.get(e,t)).init(),Ee(e,t,0,I.sortObjects),!0===I.sortObjects&&u.sort(),se&&oe.beginShadows();var r=d.state.shadowsArray;ve.render(r,e,t),d.setupLights(t),se&&oe.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),me.enabled&&ge.isAvailable()&&ge.attachCamera(t),T.render(u,e,t,i);var a=u.opaque,o=u.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&Te(a,e,t,s),o.length&&Te(o,e,t,s)}else a.length&&Te(a,e,t),o.length&&Te(o,e,t);e.onAfterRender(I,e,t),null!==G&&(x.updateRenderTargetMipmap(G),x.updateMultisampleRenderTarget(G)),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),me.enabled&&(ge.isAvailable()&&ge.detachCamera(t),me.submitFrame()),u=null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){z!==e&&null===G&&p.bindFramebuffer(36160,e),z=e},this.getActiveCubeFace=function(){return F},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return G},this.setRenderTarget=function(e,t,n){G=e,F=t,B=n,e&&void 0===y.get(e).__webglFramebuffer&&x.setupRenderTarget(e);var i=z,r=!1;if(e){var a=y.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(i=a[t||0],r=!0):i=e.isWebGLMultisampleRenderTarget?y.get(e).__webglMultisampledFramebuffer:a,X.copy(e.viewport),Y.copy(e.scissor),Z=e.scissorTest}else X.copy(te).multiplyScalar(K).floor(),Y.copy(ne).multiplyScalar(K).floor(),Z=ie;if(V!==i&&(p.bindFramebuffer(36160,i),V=i),g.viewport(X),g.scissor(Y),g.setScissorTest(Z),r){var o=y.get(e.texture);p.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,i,r,a,o){if(e&&e.isWebGLRenderTarget){var s=y.get(e).__webglFramebuffer;if(e.isWebGLRenderTargetCube&&void 0!==o&&(s=s[o]),s){var c=!1;s!==V&&(p.bindFramebuffer(36160,s),c=!0);try{var l=e.texture,h=l.format,u=l.type;if(h!==O&&D.convert(h)!==p.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u===P||D.convert(u)===p.getParameter(35738)||u===C&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||u===N&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===p.checkFramebufferStatus(36160)?t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&p.readPixels(t,n,i,r,D.convert(h),D.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&p.bindFramebuffer(36160,V)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(t.image.width*i),a=Math.floor(t.image.height*i),o=D.convert(t.format);x.setTexture2D(t,0),p.copyTexImage2D(3553,n,o,e.x,e.y,r,a,0),g.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i){var r=t.image.width,a=t.image.height,o=D.convert(n.format),s=D.convert(n.type);x.setTexture2D(n,0),t.isDataTexture?p.texSubImage2D(3553,i||0,e.x,e.y,r,a,o,s,t.image.data):p.texSubImage2D(3553,i||0,e.x,e.y,o,s,t.image),g.unbindTexture()},this.initTexture=function(e){x.setTexture2D(e,0),g.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function ea(e,t){this.name="",this.color=new Rt(e),this.density=void 0!==t?t:25e-5}function ta(e,t,n){this.name="",this.color=new Rt(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function na(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Y,this.updateRange={offset:0,count:-1},this.version=0}function ia(e,t,n,i){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===i}function ra(e){Ut.call(this),this.type="SpriteMaterial",this.color=new Rt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.assign(Qr.prototype,J.prototype),Object.assign(Kr.prototype,J.prototype),Object.assign(ea.prototype,{isFogExp2:!0,clone:function(){return new ea(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(ta.prototype,{isFog:!0,clone:function(){return new ta(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(na.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(na.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),Object.defineProperties(ia.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(ia.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}}),ra.prototype=Object.create(Ut.prototype),ra.prototype.constructor=ra,ra.prototype.isSpriteMaterial=!0,ra.prototype.copy=function(e){return Ut.prototype.copy.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};var aa=new re,oa=new re,sa=new re,ca=new ee,la=new ee,ha=new be,ua=new re,da=new re,pa=new re,fa=new ee,ma=new ee,ga=new ee;function va(e){if(Be.call(this),this.type="Sprite",void 0===Xr){Xr=new rn;var t=new na(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Xr.setIndex([0,1,2,0,2,3]),Xr.setAttribute("position",new ia(t,3,0,!1)),Xr.setAttribute("uv",new ia(t,2,3,!1))}this.geometry=Xr,this.material=void 0!==e?e:new ra,this.center=new ee(.5,.5)}function ya(e,t,n,i,r,a){ca.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(la.x=a*ca.x-r*ca.y,la.y=r*ca.x+a*ca.y):la.copy(ca),e.copy(t),e.x+=la.x,e.y+=la.y,e.applyMatrix4(ha)}va.prototype=Object.assign(Object.create(Be.prototype),{constructor:va,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),oa.setFromMatrixScale(this.matrixWorld),ha.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),sa.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&oa.multiplyScalar(-sa.z);var n,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),n=Math.sin(r));var a=this.center;ya(ua.set(-.5,-.5,0),sa,a,oa,n,i),ya(da.set(.5,-.5,0),sa,a,oa,n,i),ya(pa.set(.5,.5,0),sa,a,oa,n,i),fa.set(0,0),ma.set(1,0),ga.set(1,1);var o=e.ray.intersectTriangle(ua,da,pa,!1,aa);if(null!==o||(ya(da.set(-.5,.5,0),sa,a,oa,n,i),ma.set(0,1),null!==(o=e.ray.intersectTriangle(ua,pa,da,!1,aa)))){var s=e.ray.origin.distanceTo(aa);s<e.near||s>e.far||t.push({distance:s,point:aa.clone(),uv:Tt.getUV(aa,ua,da,pa,fa,ma,ga,new ee),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return Be.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var xa=new re,_a=new re;function ba(){Be.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function wa(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),wn.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new be,this.bindMatrixInverse=new be}ba.prototype=Object.assign(Object.create(Be.prototype),{constructor:ba,isLOD:!0,copy:function(e){Be.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,i=t.length;n<i;n++){var r=t[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){for(var n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(this.levels.length>0){xa.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(xa);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){xa.setFromMatrixPosition(e.matrixWorld),_a.setFromMatrixPosition(this.matrixWorld);var n=xa.distanceTo(_a);t[0].object.visible=!0;for(var i=1,r=t.length;i<r&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(;i<r;i++)t[i].object.visible=!1}},toJSON:function(e){var t=Be.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),wa.prototype=Object.assign(Object.create(wn.prototype),{constructor:wa,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new ue,t=this.geometry.attributes.skinWeight,n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){wn.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ma=new be,Sa=new be;function Ea(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new be)}}function Ta(){Be.call(this),this.type="Bone"}Object.assign(Ea.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new be;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=e.length;r<a;r++){var o=e[r]?e[r].matrixWorld:Sa;Ma.multiplyMatrices(o,t[r]),Ma.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new Ea(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var i=this.bones[t];if(i.name===e)return i}}}),Ta.prototype=Object.assign(Object.create(Be.prototype),{constructor:Ta,isBone:!0});var Aa=new be,La=new be,Pa=[],Ra=new wn;function Ca(e,t,n){wn.call(this,e,t),this.instanceMatrix=new Ft(new Float32Array(16*n),16),this.count=n}function Na(e){Ut.call(this),this.type="LineBasicMaterial",this.color=new Rt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}Ca.prototype=Object.assign(Object.create(wn.prototype),{constructor:Ca,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,i=this.count;if(Ra.geometry=this.geometry,Ra.material=this.material,void 0!==Ra.material)for(var r=0;r<i;r++)this.getMatrixAt(r,Aa),La.multiplyMatrices(n,Aa),Ra.matrixWorld=La,Ra.raycast(e,Pa),Pa.length>0&&(Pa[0].instanceId=r,Pa[0].object=this,t.push(Pa[0]),Pa.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),Na.prototype=Object.create(Ut.prototype),Na.prototype.constructor=Na,Na.prototype.isLineBasicMaterial=!0,Na.prototype.copy=function(e){return Ut.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var Da=new re,Ia=new re,Oa=new be,Ua=new ut,za=new it;function Fa(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Be.call(this),this.type="Line",this.geometry=void 0!==e?e:new rn,this.material=void 0!==t?t:new Na({color:16777215*Math.random()})}Fa.prototype=Object.assign(Object.create(Be.prototype),{constructor:Fa,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],i=1,r=t.count;i<r;i++)Da.fromBufferAttribute(t,i-1),Ia.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Da.distanceTo(Ia);e.setAttribute("lineDistance",new qt(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((n=e.lineDistances)[0]=0,i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this},raycast:function(e,t){var n=e.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),za.copy(i.boundingSphere),za.applyMatrix4(r),za.radius+=n,!1!==e.ray.intersectsSphere(za)){Oa.getInverse(r),Ua.copy(e.ray).applyMatrix4(Oa);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new re,c=new re,l=new re,h=new re,u=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var d=i.index,p=i.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length-1;m<g;m+=u){var v=f[m],y=f[m+1];s.fromArray(p,3*v),c.fromArray(p,3*y),Ua.distanceSqToSegment(s,c,h,l)>o||(h.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(h))<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else for(m=0,g=p.length/3-1;m<g;m+=u)s.fromArray(p,3*m),c.fromArray(p,3*m+3),Ua.distanceSqToSegment(s,c,h,l)>o||(h.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(h))<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else if(i.isGeometry){var x=i.vertices,_=x.length;for(m=0;m<_-1;m+=u){var b;Ua.distanceSqToSegment(x[m],x[m+1],h,l)>o||(h.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(h))<e.near||b>e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ba=new re,Ga=new re;function Va(e,t){Fa.call(this,e,t),this.type="LineSegments"}function Ha(e,t){Fa.call(this,e,t),this.type="LineLoop"}function ka(e){Ut.call(this),this.type="PointsMaterial",this.color=new Rt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Va.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Va,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],i=0,r=t.count;i<r;i+=2)Ba.fromBufferAttribute(t,i),Ga.fromBufferAttribute(t,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+Ba.distanceTo(Ga);e.setAttribute("lineDistance",new qt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,i=0,r=a.length;i<r;i+=2)Ba.copy(a[i]),Ga.copy(a[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+Ba.distanceTo(Ga)}return this}}),Ha.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Ha,isLineLoop:!0}),ka.prototype=Object.create(Ut.prototype),ka.prototype.constructor=ka,ka.prototype.isPointsMaterial=!0,ka.prototype.copy=function(e){return Ut.prototype.copy.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.morphTargets=e.morphTargets,this};var Wa=new be,ja=new ut,qa=new it,Xa=new re;function Ya(e,t){Be.call(this),this.type="Points",this.geometry=void 0!==e?e:new rn,this.material=void 0!==t?t:new ka({color:16777215*Math.random()}),this.updateMorphTargets()}function Za(e,t,n,i,r,a,o){var s=ja.distanceSqToPoint(e);if(s<n){var c=new re;ja.closestPointToPoint(e,c),c.applyMatrix4(i);var l=r.ray.origin.distanceTo(c);if(l<r.near||l>r.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:c,index:t,face:null,object:o})}}function Ja(e,t,n,i,r,a,o,s,c){he.call(this,e,t,n,i,r,a,o,s,c),this.format=void 0!==o?o:I,this.minFilter=void 0!==a?a:A,this.magFilter=void 0!==r?r:A,this.generateMipmaps=!1}function Qa(e,t,n,i,r,a,o,s,c,l,h,u){he.call(this,null,a,o,s,c,l,i,r,h,u),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Ka(e,t,n,i,r,a,o,s,c){he.call(this,e,t,n,i,r,a,o,s,c),this.needsUpdate=!0}function $a(e,t,n,i,r,a,o,s,c,l){if((l=void 0!==l?l:U)!==U&&l!==z)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===U&&(n=R),void 0===n&&l===z&&(n=D),he.call(this,null,i,r,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=void 0!==o?o:S,this.minFilter=void 0!==s?s:S,this.flipY=!1,this.generateMipmaps=!1}function eo(e){rn.call(this),this.type="WireframeGeometry";var t,n,i,r,a,o,s,c,l,h,u=[],d=[0,0],p={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,i=m.length;t<i;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]})}for(l in p)o=p[l],h=e.vertices[o.index1],u.push(h.x,h.y,h.z),h=e.vertices[o.index2],u.push(h.x,h.y,h.z)}else if(e&&e.isBufferGeometry){var v,y,x,_,b,w,M;if(h=new re,null!==e.index){for(v=e.attributes.position,y=e.index,0===(x=e.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),r=0,a=x.length;r<a;++r)for(t=b=(_=x[r]).start,i=b+_.count;t<i;t+=3)for(n=0;n<3;n++)s=y.getX(t+n),c=y.getX(t+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]});for(l in p)o=p[l],h.fromBufferAttribute(v,o.index1),u.push(h.x,h.y,h.z),h.fromBufferAttribute(v,o.index2),u.push(h.x,h.y,h.z)}else for(t=0,i=(v=e.attributes.position).count/3;t<i;t++)for(n=0;n<3;n++)w=3*t+n,h.fromBufferAttribute(v,w),u.push(h.x,h.y,h.z),M=3*t+(n+1)%3,h.fromBufferAttribute(v,M),u.push(h.x,h.y,h.z)}this.setAttribute("position",new qt(u,3))}function to(e,t,n){Pn.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new no(e,t,n)),this.mergeVertices()}function no(e,t,n){rn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var i,r,a=[],o=[],s=[],c=[],l=1e-5,h=new re,u=new re,d=new re,p=new re,f=new re;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=t+1;for(i=0;i<=n;i++){var g=i/n;for(r=0;r<=t;r++){var v=r/t;e(v,g,u),o.push(u.x,u.y,u.z),v-l>=0?(e(v-l,g,d),p.subVectors(u,d)):(e(v+l,g,d),p.subVectors(d,u)),g-l>=0?(e(v,g-l,d),f.subVectors(u,d)):(e(v,g+l,d),f.subVectors(d,u)),h.crossVectors(p,f).normalize(),s.push(h.x,h.y,h.z),c.push(v,g)}}for(i=0;i<n;i++)for(r=0;r<t;r++){var y=i*m+r,x=i*m+r+1,_=(i+1)*m+r+1,b=(i+1)*m+r;a.push(y,x,b),a.push(x,_,b)}this.setIndex(a),this.setAttribute("position",new qt(o,3)),this.setAttribute("normal",new qt(s,3)),this.setAttribute("uv",new qt(c,2))}function io(e,t,n,i){Pn.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},this.fromBufferGeometry(new ro(e,t,n,i)),this.mergeVertices()}function ro(e,t,n,i){rn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},n=n||1;var r=[],a=[];function o(e,t,n,i){var r,a,o=Math.pow(2,i),c=[];for(r=0;r<=o;r++){c[r]=[];var l=e.clone().lerp(n,r/o),h=t.clone().lerp(n,r/o),u=o-r;for(a=0;a<=u;a++)c[r][a]=0===a&&r===o?l:l.clone().lerp(h,a/u)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var d=Math.floor(a/2);a%2==0?(s(c[r][d+1]),s(c[r+1][d]),s(c[r][d])):(s(c[r][d+1]),s(c[r+1][d+1]),s(c[r+1][d]))}}function s(e){r.push(e.x,e.y,e.z)}function c(t,n){var i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function l(e,t,n,i){i<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=i/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}!function(e){for(var n=new re,i=new re,r=new re,a=0;a<t.length;a+=3)c(t[a+0],n),c(t[a+1],i),c(t[a+2],r),o(n,i,r,e)}(i=i||0),function(e){for(var t=new re,n=0;n<r.length;n+=3)t.x=r[n+0],t.y=r[n+1],t.z=r[n+2],t.normalize().multiplyScalar(e),r[n+0]=t.x,r[n+1]=t.y,r[n+2]=t.z}(n),function(){for(var e=new re,t=0;t<r.length;t+=3){e.x=r[t+0],e.y=r[t+1],e.z=r[t+2];var n=h(e)/2/Math.PI+.5,i=(o=e,Math.atan2(-o.y,Math.sqrt(o.x*o.x+o.z*o.z))/Math.PI+.5);a.push(n,1-i)}var o;(function(){for(var e=new re,t=new re,n=new re,i=new re,o=new ee,s=new ee,c=new ee,u=0,d=0;u<r.length;u+=9,d+=6){e.set(r[u+0],r[u+1],r[u+2]),t.set(r[u+3],r[u+4],r[u+5]),n.set(r[u+6],r[u+7],r[u+8]),o.set(a[d+0],a[d+1]),s.set(a[d+2],a[d+3]),c.set(a[d+4],a[d+5]),i.copy(e).add(t).add(n).divideScalar(3);var p=h(i);l(o,d+0,e,p),l(s,d+2,t,p),l(c,d+4,n,p)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],i=a[e+4],r=Math.max(t,n,i),o=Math.min(t,n,i);r>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),i<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new qt(r,3)),this.setAttribute("normal",new qt(r.slice(),3)),this.setAttribute("uv",new qt(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function ao(e,t){Pn.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new oo(e,t)),this.mergeVertices()}function oo(e,t){ro.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function so(e,t){Pn.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new co(e,t)),this.mergeVertices()}function co(e,t){ro.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function lo(e,t){Pn.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ho(e,t)),this.mergeVertices()}function ho(e,t){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];ro.call(this,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function uo(e,t){Pn.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new po(e,t)),this.mergeVertices()}function po(e,t){var n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];ro.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function fo(e,t,n,i,r,a){Pn.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new mo(e,t,n,i,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function mo(e,t,n,i,r){rn.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},t=t||64,n=n||1,i=i||8,r=r||!1;var a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,c=new re,l=new re,h=new ee,u=new re,d=[],p=[],f=[],m=[];function g(r){u=e.getPointAt(r/t,u);var o=a.normals[r],h=a.binormals[r];for(s=0;s<=i;s++){var f=s/i*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);l.x=g*o.x+m*h.x,l.y=g*o.y+m*h.y,l.z=g*o.z+m*h.z,l.normalize(),p.push(l.x,l.y,l.z),c.x=u.x+n*l.x,c.y=u.y+n*l.y,c.z=u.z+n*l.z,d.push(c.x,c.y,c.z)}}!function(){for(o=0;o<t;o++)g(o);g(!1===r?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=i;s++)h.x=o/t,h.y=s/i,f.push(h.x,h.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=i;o++){var e=(i+1)*(s-1)+(o-1),n=(i+1)*s+(o-1),r=(i+1)*s+o,a=(i+1)*(s-1)+o;m.push(e,n,a),m.push(n,r,a)}}()}(),this.setIndex(m),this.setAttribute("position",new qt(d,3)),this.setAttribute("normal",new qt(p,3)),this.setAttribute("uv",new qt(f,2))}function go(e,t,n,i,r,a,o){Pn.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new vo(e,t,n,i,r,a)),this.mergeVertices()}function vo(e,t,n,i,r,a){rn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;var o,s,c=[],l=[],h=[],u=[],d=new re,p=new re,f=new re,m=new re,g=new re,v=new re,y=new re;for(o=0;o<=n;++o){var x=o/n*r*Math.PI*2;for(A(x,r,a,e,f),A(x+.01,r,a,e,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=i;++s){var _=s/i*Math.PI*2,b=-t*Math.cos(_),w=t*Math.sin(_);d.x=f.x+(b*y.x+w*g.x),d.y=f.y+(b*y.y+w*g.y),d.z=f.z+(b*y.z+w*g.z),l.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),h.push(p.x,p.y,p.z),u.push(o/n),u.push(s/i)}}for(s=1;s<=n;s++)for(o=1;o<=i;o++){var M=(i+1)*(s-1)+(o-1),S=(i+1)*s+(o-1),E=(i+1)*s+o,T=(i+1)*(s-1)+o;c.push(M,S,T),c.push(S,E,T)}function A(e,t,n,i,r){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);r.x=i*(2+c)*.5*a,r.y=i*(2+c)*o*.5,r.z=i*Math.sin(s)*.5}this.setIndex(c),this.setAttribute("position",new qt(l,3)),this.setAttribute("normal",new qt(h,3)),this.setAttribute("uv",new qt(u,2))}function yo(e,t,n,i,r){Pn.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new xo(e,t,n,i,r)),this.mergeVertices()}function xo(e,t,n,i,r){rn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},e=e||1,t=t||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var a,o,s=[],c=[],l=[],h=[],u=new re,d=new re,p=new re;for(a=0;a<=n;a++)for(o=0;o<=i;o++){var f=o/i*r,m=a/n*Math.PI*2;d.x=(e+t*Math.cos(m))*Math.cos(f),d.y=(e+t*Math.cos(m))*Math.sin(f),d.z=t*Math.sin(m),c.push(d.x,d.y,d.z),u.x=e*Math.cos(f),u.y=e*Math.sin(f),p.subVectors(d,u).normalize(),l.push(p.x,p.y,p.z),h.push(o/i),h.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=i;o++){var g=(i+1)*a+o-1,v=(i+1)*(a-1)+o-1,y=(i+1)*(a-1)+o,x=(i+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.setAttribute("position",new qt(c,3)),this.setAttribute("normal",new qt(l,3)),this.setAttribute("uv",new qt(h,2))}Ya.prototype=Object.assign(Object.create(Be.prototype),{constructor:Ya,isPoints:!0,raycast:function(e,t){var n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),qa.copy(n.boundingSphere),qa.applyMatrix4(i),qa.radius+=r,!1!==e.ray.intersectsSphere(qa)){Wa.getInverse(i),ja.copy(e.ray).applyMatrix4(Wa);var a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,c=n.attributes.position.array;if(null!==s)for(var l=s.array,h=0,u=l.length;h<u;h++){var d=l[h];Xa.fromArray(c,3*d),Za(Xa,d,o,i,e,t,this)}else{h=0;for(var p=c.length/3;h<p;h++)Xa.fromArray(c,3*h),Za(Xa,h,o,i,e,t,this)}}else{var f=n.vertices;for(h=0,p=f.length;h<p;h++)Za(f[h],h,o,i,e,t,this)}}},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ja.prototype=Object.assign(Object.create(he.prototype),{constructor:Ja,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Qa.prototype=Object.create(he.prototype),Qa.prototype.constructor=Qa,Qa.prototype.isCompressedTexture=!0,Ka.prototype=Object.create(he.prototype),Ka.prototype.constructor=Ka,Ka.prototype.isCanvasTexture=!0,$a.prototype=Object.create(he.prototype),$a.prototype.constructor=$a,$a.prototype.isDepthTexture=!0,eo.prototype=Object.create(rn.prototype),eo.prototype.constructor=eo,to.prototype=Object.create(Pn.prototype),to.prototype.constructor=to,no.prototype=Object.create(rn.prototype),no.prototype.constructor=no,io.prototype=Object.create(Pn.prototype),io.prototype.constructor=io,ro.prototype=Object.create(rn.prototype),ro.prototype.constructor=ro,ao.prototype=Object.create(Pn.prototype),ao.prototype.constructor=ao,oo.prototype=Object.create(ro.prototype),oo.prototype.constructor=oo,so.prototype=Object.create(Pn.prototype),so.prototype.constructor=so,co.prototype=Object.create(ro.prototype),co.prototype.constructor=co,lo.prototype=Object.create(Pn.prototype),lo.prototype.constructor=lo,ho.prototype=Object.create(ro.prototype),ho.prototype.constructor=ho,uo.prototype=Object.create(Pn.prototype),uo.prototype.constructor=uo,po.prototype=Object.create(ro.prototype),po.prototype.constructor=po,fo.prototype=Object.create(Pn.prototype),fo.prototype.constructor=fo,mo.prototype=Object.create(rn.prototype),mo.prototype.constructor=mo,mo.prototype.toJSON=function(){var e=rn.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},go.prototype=Object.create(Pn.prototype),go.prototype.constructor=go,vo.prototype=Object.create(rn.prototype),vo.prototype.constructor=vo,yo.prototype=Object.create(Pn.prototype),yo.prototype.constructor=yo,xo.prototype=Object.create(rn.prototype),xo.prototype.constructor=xo;function _o(e,t,n,i,r){var a,o;if(r===function(e,t,n,i){for(var r=0,a=t,o=n-i;a<n;a+=i)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}(e,t,n,i)>0)for(a=t;a<n;a+=i)o=Fo(a,e[a],e[a+1],o);else for(a=n-i;a>=t;a-=i)o=Fo(a,e[a],e[a+1],o);return o&&Io(o,o.next)&&(Bo(o),o=o.next),o}function bo(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!Io(i,i.next)&&0!==Do(i.prev,i,i.next))i=i.next;else{if(Bo(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function wo(e,t,n,i,r,a,o){if(e){!o&&a&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=Po(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t<l&&(s++,i=i.nextZ);t++);for(c=l;s>0||c>0&&i;)0!==s&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,c--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,l*=2}while(o>1)}(r)}(e,i,r,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?So(e,i,r,a):Mo(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),Bo(e),e=c.next,l=c.next;else if((e=c)===l){o?1===o?wo(e=Eo(e,t,n),t,n,i,r,a,2):2===o&&To(e,t,n,i,r,a):wo(bo(e),t,n,i,r,a,1);break}}}function Mo(e){var t=e.prev,n=e,i=e.next;if(Do(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(Co(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&Do(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function So(e,t,n,i){var r=e.prev,a=e,o=e.next;if(Do(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,c=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,l=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,h=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,u=Po(s,c,t,n,i),d=Po(l,h,t,n,i),p=e.prevZ,f=e.nextZ;p&&p.z>=u&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Co(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Do(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Co(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Do(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&Co(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Do(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Co(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Do(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Eo(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!Io(r,a)&&Oo(r,i,i.next,a)&&Uo(r,a)&&Uo(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),Bo(i),Bo(i.next),i=e=a),i=i.next}while(i!==e);return i}function To(e,t,n,i,r,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&No(o,s)){var c=zo(o,s);return o=bo(o,o.next),c=bo(c,c.next),wo(o,t,n,i,r,a),void wo(c,t,n,i,r,a)}s=s.next}o=o.next}while(o!==e)}function Ao(e,t){return e.x-t.x}function Lo(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!n)return null;if(r===o)return n.prev;var c,l=n,h=n.x,u=n.y,d=1/0;for(i=n.next;i!==l;)r>=i.x&&i.x>=h&&r!==i.x&&Co(a<u?r:o,a,h,u,a<u?o:r,a,i.x,i.y)&&((c=Math.abs(a-i.y)/(r-i.x))<d||c===d&&i.x>n.x)&&Uo(i,e)&&(n=i,d=c),i=i.next;return n}(e,t),t){var n=zo(t,e);bo(n,n.next)}}function Po(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Ro(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Co(e,t,n,i,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function No(e,t){return e.next.i!==t.i&&e.prev.i!==t.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&&Oo(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&Uo(e,t)&&Uo(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function Do(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Io(e,t){return e.x===t.x&&e.y===t.y}function Oo(e,t,n,i){return!!(Io(e,n)&&Io(t,i)||Io(e,i)&&Io(n,t))||Do(e,t,n)>0!=Do(e,t,i)>0&&Do(n,i,e)>0!=Do(n,i,t)>0}function Uo(e,t){return Do(e.prev,e,e.next)<0?Do(e,t,e.next)>=0&&Do(e,e.prev,t)>=0:Do(e,t,e.prev)<0||Do(e,e.next,t)<0}function zo(e,t){var n=new Go(e.i,e.x,e.y),i=new Go(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function Fo(e,t,n,i){var r=new Go(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Bo(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 Go(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 Vo={area:function(e){for(var t=e.length,n=0,i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n},isClockWise:function(e){return Vo.area(e)<0},triangulateShape:function(e,t){var n=[],i=[],r=[];Ho(e),ko(n,e);var a=e.length;t.forEach(Ho);for(var o=0;o<t.length;o++)i.push(a),a+=t[o].length,ko(n,t[o]);var s=function(e,t,n){n=n||2;var i,r,a,o,s,c,l,h=t&&t.length,u=h?t[0]*n:e.length,d=_o(e,0,u,n,!0),p=[];if(!d||d.next===d.prev)return p;if(h&&(d=function(e,t,n,i){var r,a,o,s=[];for(r=0,a=t.length;r<a;r++)(o=_o(e,t[r]*i,r<a-1?t[r+1]*i:e.length,i,!1))===o.next&&(o.steiner=!0),s.push(Ro(o));for(s.sort(Ao),r=0;r<s.length;r++)Lo(s[r],n),n=bo(n,n.next);return n}(e,t,d,n)),e.length>80*n){i=a=e[0],r=o=e[1];for(var f=n;f<u;f+=n)(s=e[f])<i&&(i=s),(c=e[f+1])<r&&(r=c),s>a&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-i,o-r))?1/l:0}return wo(d,p,n,i,r,l),p}(n,i);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function Ho(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ko(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Wo(e,t){Pn.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new jo(e,t)),this.mergeVertices()}function jo(e,t){rn.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var n=this,i=[],r=[],a=0,o=e.length;a<o;a++)s(e[a]);function s(e){var a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,c=void 0!==t.depth?t.depth:100,l=void 0===t.bevelEnabled||t.bevelEnabled,h=void 0!==t.bevelThickness?t.bevelThickness:6,u=void 0!==t.bevelSize?t.bevelSize:h-2,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3,f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:qo;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=t.amount);var g,v,y,x,_,b,w,M,S=!1;f&&(g=f.getSpacedPoints(s),S=!0,l=!1,v=f.computeFrenetFrames(s,!1),y=new re,x=new re,_=new re),l||(p=0,h=0,u=0,d=0);var E=e.extractPoints(o),T=E.shape,A=E.holes;if(!Vo.isClockWise(T))for(T=T.reverse(),w=0,M=A.length;w<M;w++)b=A[w],Vo.isClockWise(b)&&(A[w]=b.reverse());var L=Vo.triangulateShape(T,A),P=T;for(w=0,M=A.length;w<M;w++)b=A[w],T=T.concat(b);function R(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var C,N,D,I,O,U,z=T.length,F=L.length;function B(e,t,n){var i,r,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,h=o*o+s*s,u=o*l-s*c;if(Math.abs(u)>Number.EPSILON){var d=Math.sqrt(h),p=Math.sqrt(c*c+l*l),f=t.x-s/d,m=t.y+o/d,g=((n.x-l/p-f)*l-(n.y+c/p-m)*c)/(o*l-s*c),v=(i=f+o*g-e.x)*i+(r=m+s*g-e.y)*r;if(v<=2)return new ee(i,r);a=Math.sqrt(v/2)}else{var y=!1;o>Number.EPSILON?c>Number.EPSILON&&(y=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(i=-s,r=o,a=Math.sqrt(h)):(i=o,r=s,a=Math.sqrt(h/2))}return new ee(i/a,r/a)}for(var G=[],V=0,H=P.length,k=H-1,W=V+1;V<H;V++,k++,W++)k===H&&(k=0),W===H&&(W=0),G[V]=B(P[V],P[k],P[W]);var j,q,X=[],Y=G.concat();for(w=0,M=A.length;w<M;w++){for(b=A[w],j=[],V=0,k=(H=b.length)-1,W=V+1;V<H;V++,k++,W++)k===H&&(k=0),W===H&&(W=0),j[V]=B(b[V],b[k],b[W]);X.push(j),Y=Y.concat(j)}for(C=0;C<p;C++){for(D=C/p,I=h*Math.cos(D*Math.PI/2),N=u*Math.sin(D*Math.PI/2)+d,V=0,H=P.length;V<H;V++)J((O=R(P[V],G[V],N)).x,O.y,-I);for(w=0,M=A.length;w<M;w++)for(b=A[w],j=X[w],V=0,H=b.length;V<H;V++)J((O=R(b[V],j[V],N)).x,O.y,-I)}for(N=u+d,V=0;V<z;V++)O=l?R(T[V],Y[V],N):T[V],S?(x.copy(v.normals[0]).multiplyScalar(O.x),y.copy(v.binormals[0]).multiplyScalar(O.y),_.copy(g[0]).add(x).add(y),J(_.x,_.y,_.z)):J(O.x,O.y,0);for(q=1;q<=s;q++)for(V=0;V<z;V++)O=l?R(T[V],Y[V],N):T[V],S?(x.copy(v.normals[q]).multiplyScalar(O.x),y.copy(v.binormals[q]).multiplyScalar(O.y),_.copy(g[q]).add(x).add(y),J(_.x,_.y,_.z)):J(O.x,O.y,c/s*q);for(C=p-1;C>=0;C--){for(D=C/p,I=h*Math.cos(D*Math.PI/2),N=u*Math.sin(D*Math.PI/2)+d,V=0,H=P.length;V<H;V++)J((O=R(P[V],G[V],N)).x,O.y,c+I);for(w=0,M=A.length;w<M;w++)for(b=A[w],j=X[w],V=0,H=b.length;V<H;V++)O=R(b[V],j[V],N),S?J(O.x,O.y+g[s-1].y,g[s-1].x+I):J(O.x,O.y,c+I)}function Z(e,t){var n,i;for(V=e.length;--V>=0;){n=V,(i=V-1)<0&&(i=e.length-1);var r=0,a=s+2*p;for(r=0;r<a;r++){var o=z*r,c=z*(r+1);K(t+n+o,t+i+o,t+i+c,t+n+c)}}}function J(e,t,n){a.push(e),a.push(t),a.push(n)}function Q(e,t,r){$(e),$(t),$(r);var a=i.length/3,o=m.generateTopUV(n,i,a-3,a-2,a-1);te(o[0]),te(o[1]),te(o[2])}function K(e,t,r,a){$(e),$(t),$(a),$(t),$(r),$(a);var o=i.length/3,s=m.generateSideWallUV(n,i,o-6,o-3,o-2,o-1);te(s[0]),te(s[1]),te(s[3]),te(s[1]),te(s[2]),te(s[3])}function $(e){i.push(a[3*e+0]),i.push(a[3*e+1]),i.push(a[3*e+2])}function te(e){r.push(e.x),r.push(e.y)}!function(){var e=i.length/3;if(l){var t=0,r=z*t;for(V=0;V<F;V++)Q((U=L[V])[2]+r,U[1]+r,U[0]+r);for(r=z*(t=s+2*p),V=0;V<F;V++)Q((U=L[V])[0]+r,U[1]+r,U[2]+r)}else{for(V=0;V<F;V++)Q((U=L[V])[2],U[1],U[0]);for(V=0;V<F;V++)Q((U=L[V])[0]+z*s,U[1]+z*s,U[2]+z*s)}n.addGroup(e,i.length/3-e,0)}(),function(){var e=i.length/3,t=0;for(Z(P,t),t+=P.length,w=0,M=A.length;w<M;w++)Z(b=A[w],t),t+=b.length;n.addGroup(e,i.length/3-e,1)}()}this.setAttribute("position",new qt(i,3)),this.setAttribute("uv",new qt(r,2)),this.computeVertexNormals()}Wo.prototype=Object.create(Pn.prototype),Wo.prototype.constructor=Wo,Wo.prototype.toJSON=function(){var e=Pn.prototype.toJSON.call(this);return Xo(this.parameters.shapes,this.parameters.options,e)},jo.prototype=Object.create(rn.prototype),jo.prototype.constructor=jo,jo.prototype.toJSON=function(){var e=rn.prototype.toJSON.call(this);return Xo(this.parameters.shapes,this.parameters.options,e)};var qo={generateTopUV:function(e,t,n,i,r){var a=t[3*n],o=t[3*n+1],s=t[3*i],c=t[3*i+1],l=t[3*r],h=t[3*r+1];return[new ee(a,o),new ee(s,c),new ee(l,h)]},generateSideWallUV:function(e,t,n,i,r,a){var o=t[3*n],s=t[3*n+1],c=t[3*n+2],l=t[3*i],h=t[3*i+1],u=t[3*i+2],d=t[3*r],p=t[3*r+1],f=t[3*r+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(s-h)<.01?[new ee(o,1-c),new ee(l,1-u),new ee(d,1-f),new ee(m,1-v)]:[new ee(s,1-c),new ee(h,1-u),new ee(p,1-f),new ee(g,1-v)]}};function Xo(e,t,n){if(n.shapes=[],Array.isArray(e))for(var i=0,r=e.length;i<r;i++){var a=e[i];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function Yo(e,t){Pn.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Zo(e,t)),this.mergeVertices()}function Zo(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Pn;var i=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),jo.call(this,i,t),this.type="TextBufferGeometry"}function Jo(e,t,n,i,r,a,o){Pn.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Qo(e,t,n,i,r,a,o)),this.mergeVertices()}function Qo(e,t,n,i,r,a,o){rn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,c,l=Math.min(a+o,Math.PI),h=0,u=[],d=new re,p=new re,f=[],m=[],g=[],v=[];for(c=0;c<=n;c++){var y=[],x=c/n,_=0;for(0==c&&0==a?_=.5/t:c==n&&l==Math.PI&&(_=-.5/t),s=0;s<=t;s++){var b=s/t;d.x=-e*Math.cos(i+b*r)*Math.sin(a+x*o),d.y=e*Math.cos(a+x*o),d.z=e*Math.sin(i+b*r)*Math.sin(a+x*o),m.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),v.push(b+_,1-x),y.push(h++)}u.push(y)}for(c=0;c<n;c++)for(s=0;s<t;s++){var w=u[c][s+1],M=u[c][s],S=u[c+1][s],E=u[c+1][s+1];(0!==c||a>0)&&f.push(w,M,E),(c!==n-1||l<Math.PI)&&f.push(M,S,E)}this.setIndex(f),this.setAttribute("position",new qt(m,3)),this.setAttribute("normal",new qt(g,3)),this.setAttribute("uv",new qt(v,2))}function Ko(e,t,n,i,r,a){Pn.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new $o(e,t,n,i,r,a)),this.mergeVertices()}function $o(e,t,n,i,r,a){rn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},e=e||.5,t=t||1,r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,c,l=[],h=[],u=[],d=[],p=e,f=(t-e)/(i=void 0!==i?Math.max(1,i):1),m=new re,g=new ee;for(s=0;s<=i;s++){for(c=0;c<=n;c++)o=r+c/n*a,m.x=p*Math.cos(o),m.y=p*Math.sin(o),h.push(m.x,m.y,m.z),u.push(0,0,1),g.x=(m.x/t+1)/2,g.y=(m.y/t+1)/2,d.push(g.x,g.y);p+=f}for(s=0;s<i;s++){var v=s*(n+1);for(c=0;c<n;c++){var y=o=c+v,x=o+n+1,_=o+n+2,b=o+1;l.push(y,x,b),l.push(x,_,b)}}this.setIndex(l),this.setAttribute("position",new qt(h,3)),this.setAttribute("normal",new qt(u,3)),this.setAttribute("uv",new qt(d,2))}function es(e,t,n,i){Pn.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},this.fromBufferGeometry(new ts(e,t,n,i)),this.mergeVertices()}function ts(e,t,n,i){rn.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t)||12,n=n||0,i=i||2*Math.PI,i=$.clamp(i,0,2*Math.PI);var r,a,o,s=[],c=[],l=[],h=1/t,u=new re,d=new ee;for(a=0;a<=t;a++){var p=n+a*h*i,f=Math.sin(p),m=Math.cos(p);for(o=0;o<=e.length-1;o++)u.x=e[o].x*f,u.y=e[o].y,u.z=e[o].x*m,c.push(u.x,u.y,u.z),d.x=a/t,d.y=o/(e.length-1),l.push(d.x,d.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var g=r=o+a*e.length,v=r+e.length,y=r+e.length+1,x=r+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.setAttribute("position",new qt(c,3)),this.setAttribute("uv",new qt(l,2)),this.computeVertexNormals(),i===2*Math.PI){var _=this.attributes.normal.array,b=new re,w=new re,M=new re;for(r=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)b.x=_[o+0],b.y=_[o+1],b.z=_[o+2],w.x=_[r+o+0],w.y=_[r+o+1],w.z=_[r+o+2],M.addVectors(b,w).normalize(),_[o+0]=_[r+o+0]=M.x,_[o+1]=_[r+o+1]=M.y,_[o+2]=_[r+o+2]=M.z}}function ns(e,t){Pn.call(this),this.type="ShapeGeometry","object"===i(t)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new is(e,t)),this.mergeVertices()}function is(e,t){rn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],i=[],r=[],a=[],o=0,s=0;if(!1===Array.isArray(e))l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(o,s,c),o+=s,s=0;function l(e){var o,c,l,h=i.length/3,u=e.extractPoints(t),d=u.shape,p=u.holes;for(!1===Vo.isClockWise(d)&&(d=d.reverse()),o=0,c=p.length;o<c;o++)l=p[o],!0===Vo.isClockWise(l)&&(p[o]=l.reverse());var f=Vo.triangulateShape(d,p);for(o=0,c=p.length;o<c;o++)l=p[o],d=d.concat(l);for(o=0,c=d.length;o<c;o++){var m=d[o];i.push(m.x,m.y,0),r.push(0,0,1),a.push(m.x,m.y)}for(o=0,c=f.length;o<c;o++){var g=f[o],v=g[0]+h,y=g[1]+h,x=g[2]+h;n.push(v,y,x),s+=3}}this.setIndex(n),this.setAttribute("position",new qt(i,3)),this.setAttribute("normal",new qt(r,3)),this.setAttribute("uv",new qt(a,2))}function rs(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,i=e.length;n<i;n++){var r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}function as(e,t){rn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,i,r,a,o=[],s=Math.cos($.DEG2RAD*t),c=[0,0],l={},h=["a","b","c"];e.isBufferGeometry?(a=new Pn).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var u=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)n=m[h[g]],i=m[h[(g+1)%3]],c[0]=Math.min(n,i),c[1]=Math.max(n,i),void 0===l[r=c[0]+","+c[1]]?l[r]={index1:c[0],index2:c[1],face1:p,face2:void 0}:l[r].face2=p;for(r in l){var v=l[r];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var y=u[v.index1];o.push(y.x,y.y,y.z),y=u[v.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new qt(o,3))}function os(e,t,n,i,r,a,o,s){Pn.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new ss(e,t,n,i,r,a,o,s)),this.mergeVertices()}function ss(e,t,n,i,r,a,o,s){rn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s};var c=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var l=[],h=[],u=[],d=[],p=0,f=[],m=n/2,g=0;function v(n){var r,a,f,v=new ee,y=new re,x=0,_=!0===n?e:t,b=!0===n?1:-1;for(a=p,r=1;r<=i;r++)h.push(0,m*b,0),u.push(0,b,0),d.push(.5,.5),p++;for(f=p,r=0;r<=i;r++){var w=r/i*s+o,M=Math.cos(w),S=Math.sin(w);y.x=_*S,y.y=m*b,y.z=_*M,h.push(y.x,y.y,y.z),u.push(0,b,0),v.x=.5*M+.5,v.y=.5*S*b+.5,d.push(v.x,v.y),p++}for(r=0;r<i;r++){var E=a+r,T=f+r;!0===n?l.push(T,T+1,E):l.push(T+1,T,E),x+=3}c.addGroup(g,x,!0===n?1:2),g+=x}!function(){var a,v,y=new re,x=new re,_=0,b=(t-e)/n;for(v=0;v<=r;v++){var w=[],M=v/r,S=M*(t-e)+e;for(a=0;a<=i;a++){var E=a/i,T=E*s+o,A=Math.sin(T),L=Math.cos(T);x.x=S*A,x.y=-M*n+m,x.z=S*L,h.push(x.x,x.y,x.z),y.set(A,b,L).normalize(),u.push(y.x,y.y,y.z),d.push(E,1-M),w.push(p++)}f.push(w)}for(a=0;a<i;a++)for(v=0;v<r;v++){var P=f[v][a],R=f[v+1][a],C=f[v+1][a+1],N=f[v][a+1];l.push(P,R,N),l.push(R,C,N),_+=6}c.addGroup(g,_,0),g+=_}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute("position",new qt(h,3)),this.setAttribute("normal",new qt(u,3)),this.setAttribute("uv",new qt(d,2))}function cs(e,t,n,i,r,a,o){os.call(this,0,e,t,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function ls(e,t,n,i,r,a,o){ss.call(this,0,e,t,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function hs(e,t,n,i){Pn.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new us(e,t,n,i)),this.mergeVertices()}function us(e,t,n,i){rn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,a,o=[],s=[],c=[],l=[],h=new re,u=new ee;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),a=0,r=3;a<=t;a++,r+=3){var d=n+a/t*i;h.x=e*Math.cos(d),h.y=e*Math.sin(d),s.push(h.x,h.y,h.z),c.push(0,0,1),u.x=(s[r]/e+1)/2,u.y=(s[r+1]/e+1)/2,l.push(u.x,u.y)}for(r=1;r<=t;r++)o.push(r,r+1,0);this.setIndex(o),this.setAttribute("position",new qt(s,3)),this.setAttribute("normal",new qt(c,3)),this.setAttribute("uv",new qt(l,2))}Yo.prototype=Object.create(Pn.prototype),Yo.prototype.constructor=Yo,Zo.prototype=Object.create(jo.prototype),Zo.prototype.constructor=Zo,Jo.prototype=Object.create(Pn.prototype),Jo.prototype.constructor=Jo,Qo.prototype=Object.create(rn.prototype),Qo.prototype.constructor=Qo,Ko.prototype=Object.create(Pn.prototype),Ko.prototype.constructor=Ko,$o.prototype=Object.create(rn.prototype),$o.prototype.constructor=$o,es.prototype=Object.create(Pn.prototype),es.prototype.constructor=es,ts.prototype=Object.create(rn.prototype),ts.prototype.constructor=ts,ns.prototype=Object.create(Pn.prototype),ns.prototype.constructor=ns,ns.prototype.toJSON=function(){var e=Pn.prototype.toJSON.call(this);return rs(this.parameters.shapes,e)},is.prototype=Object.create(rn.prototype),is.prototype.constructor=is,is.prototype.toJSON=function(){var e=rn.prototype.toJSON.call(this);return rs(this.parameters.shapes,e)},as.prototype=Object.create(rn.prototype),as.prototype.constructor=as,os.prototype=Object.create(Pn.prototype),os.prototype.constructor=os,ss.prototype=Object.create(rn.prototype),ss.prototype.constructor=ss,cs.prototype=Object.create(os.prototype),cs.prototype.constructor=cs,ls.prototype=Object.create(ss.prototype),ls.prototype.constructor=ls,hs.prototype=Object.create(Pn.prototype),hs.prototype.constructor=hs,us.prototype=Object.create(rn.prototype),us.prototype.constructor=us;var ds=Object.freeze({__proto__:null,WireframeGeometry:eo,ParametricGeometry:to,ParametricBufferGeometry:no,TetrahedronGeometry:ao,TetrahedronBufferGeometry:oo,OctahedronGeometry:so,OctahedronBufferGeometry:co,IcosahedronGeometry:lo,IcosahedronBufferGeometry:ho,DodecahedronGeometry:uo,DodecahedronBufferGeometry:po,PolyhedronGeometry:io,PolyhedronBufferGeometry:ro,TubeGeometry:fo,TubeBufferGeometry:mo,TorusKnotGeometry:go,TorusKnotBufferGeometry:vo,TorusGeometry:yo,TorusBufferGeometry:xo,TextGeometry:Yo,TextBufferGeometry:Zo,SphereGeometry:Jo,SphereBufferGeometry:Qo,RingGeometry:Ko,RingBufferGeometry:$o,PlaneGeometry:Kn,PlaneBufferGeometry:$n,LatheGeometry:es,LatheBufferGeometry:ts,ShapeGeometry:ns,ShapeBufferGeometry:is,ExtrudeGeometry:Wo,ExtrudeBufferGeometry:jo,EdgesGeometry:as,ConeGeometry:cs,ConeBufferGeometry:ls,CylinderGeometry:os,CylinderBufferGeometry:ss,CircleGeometry:hs,CircleBufferGeometry:us,BoxGeometry:Rn,BoxBufferGeometry:Cn});function ps(e){Ut.call(this),this.type="ShadowMaterial",this.color=new Rt(0),this.transparent=!0,this.setValues(e)}function fs(e){zn.call(this,e),this.type="RawShaderMaterial"}function ms(e){Ut.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Rt(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function gs(e){ms.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new ee(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(e)}function vs(e){Ut.call(this),this.type="MeshPhongMaterial",this.color=new Rt(16777215),this.specular=new Rt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ys(e){vs.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function xs(e){Ut.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function _s(e){Ut.call(this),this.type="MeshLambertMaterial",this.color=new Rt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function bs(e){Ut.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Rt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ws(e){Na.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}ps.prototype=Object.create(Ut.prototype),ps.prototype.constructor=ps,ps.prototype.isShadowMaterial=!0,ps.prototype.copy=function(e){return Ut.prototype.copy.call(this,e),this.color.copy(e.color),this},fs.prototype=Object.create(zn.prototype),fs.prototype.constructor=fs,fs.prototype.isRawShaderMaterial=!0,ms.prototype=Object.create(Ut.prototype),ms.prototype.constructor=ms,ms.prototype.isMeshStandardMaterial=!0,ms.prototype.copy=function(e){return Ut.prototype.copy.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},gs.prototype=Object.create(ms.prototype),gs.prototype.constructor=gs,gs.prototype.isMeshPhysicalMaterial=!0,gs.prototype.copy=function(e){return ms.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearcoat=e.clearcoat,this.clearcoatRoughness=e.clearcoatRoughness,e.sheen?this.sheen=(this.sheen||new Rt).copy(e.sheen):this.sheen=null,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.transparency=e.transparency,this},vs.prototype=Object.create(Ut.prototype),vs.prototype.constructor=vs,vs.prototype.isMeshPhongMaterial=!0,vs.prototype.copy=function(e){return Ut.prototype.copy.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ys.prototype=Object.create(vs.prototype),ys.prototype.constructor=ys,ys.prototype.isMeshToonMaterial=!0,ys.prototype.copy=function(e){return vs.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},xs.prototype=Object.create(Ut.prototype),xs.prototype.constructor=xs,xs.prototype.isMeshNormalMaterial=!0,xs.prototype.copy=function(e){return Ut.prototype.copy.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},_s.prototype=Object.create(Ut.prototype),_s.prototype.constructor=_s,_s.prototype.isMeshLambertMaterial=!0,_s.prototype.copy=function(e){return Ut.prototype.copy.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},bs.prototype=Object.create(Ut.prototype),bs.prototype.constructor=bs,bs.prototype.isMeshMatcapMaterial=!0,bs.prototype.copy=function(e){return Ut.prototype.copy.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ws.prototype=Object.create(Na.prototype),ws.prototype.constructor=ws,ws.prototype.isLineDashedMaterial=!0,ws.prototype.copy=function(e){return Na.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Ms=Object.freeze({__proto__:null,ShadowMaterial:ps,SpriteMaterial:ra,RawShaderMaterial:fs,ShaderMaterial:zn,PointsMaterial:ka,MeshPhysicalMaterial:gs,MeshStandardMaterial:ms,MeshPhongMaterial:vs,MeshToonMaterial:ys,MeshNormalMaterial:xs,MeshLambertMaterial:_s,MeshDepthMaterial:zr,MeshDistanceMaterial:Fr,MeshBasicMaterial:zt,MeshMatcapMaterial:bs,LineDashedMaterial:ws,LineBasicMaterial:Na,Material:Ut}),Ss={arraySlice:function(e,t,n){return Ss.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(e){for(var t=e.length,n=new Array(t),i=0;i!==t;++i)n[i]=i;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var i=e.length,r=new e.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*t,c=0;c!==t;++c)r[o++]=e[s+c];return r},flattenJSON:function(e,t,n,i){for(var r=1,a=e[0];void 0!==a&&void 0===a[i];)a=e[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[i])&&(t.push(a.time),n.push.apply(n,o)),a=e[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[i])&&(t.push(a.time),o.toArray(n,n.length)),a=e[r++]}while(void 0!==a);else do{void 0!==(o=a[i])&&(t.push(a.time),n.push(o)),a=e[r++]}while(void 0!==a)}},subclip:function(e,t,n,i,r){r=r||30;var a=e.clone();a.name=t;for(var o=[],s=0;s<a.tracks.length;++s){for(var c=a.tracks[s],l=c.getValueSize(),h=[],u=[],d=0;d<c.times.length;++d){var p=c.times[d]*r;if(!(p<n||p>=i)){h.push(c.times[d]);for(var f=0;f<l;++f)u.push(c.values[d*l+f])}}0!==h.length&&(c.times=Ss.convertArray(h,c.times.constructor),c.values=Ss.convertArray(u,c.values.constructor),o.push(c))}a.tracks=o;var m=1/0;for(s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a}};function Es(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Ts(e,t,n,i){Es.call(this,e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function As(e,t,n,i){Es.call(this,e,t,n,i)}function Ls(e,t,n,i){Es.call(this,e,t,n,i)}function Ps(e,t,n,i){if(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=Ss.convertArray(t,this.TimeBufferType),this.values=Ss.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Rs(e,t,n){Ps.call(this,e,t,n)}function Cs(e,t,n,i){Ps.call(this,e,t,n,i)}function Ns(e,t,n,i){Ps.call(this,e,t,n,i)}function Ds(e,t,n,i){Es.call(this,e,t,n,i)}function Is(e,t,n,i){Ps.call(this,e,t,n,i)}function Os(e,t,n,i){Ps.call(this,e,t,n,i)}function Us(e,t,n,i){Ps.call(this,e,t,n,i)}function zs(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=$.generateUUID(),this.duration<0&&this.resetDuration()}function Fs(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ns;case"vector":case"vector2":case"vector3":case"vector4":return Us;case"color":return Cs;case"quaternion":return Is;case"bool":case"boolean":return Rs;case"string":return Os}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],i=[];Ss.flattenJSON(e.keys,n,i,"value"),e.times=n,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(Es.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{var a;n:{i:if(!(e<i)){for(var o=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,r)}if(n===o)break;if(r=i,e<(i=t[++n]))break t}a=t.length;break n}if(e>=r)break e;var s=t[1];for(e<s&&(n=2,r=s),o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===o)break;if(i=r,e>=(r=t[--n-1]))break t}a=n,n=0}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(i=t[n],void 0===(r=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,i);if(void 0===i)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i,a=0;a!==i;++a)t[a]=n[r+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Es.prototype,{beforeStart_:Es.prototype.copySampleValue_,afterEnd_:Es.prototype.copySampleValue_}),Ts.prototype=Object.assign(Object.create(Es.prototype),{constructor:Ts,DefaultSettings_:{endingStart:V,endingEnd:V},intervalChanged_:function(e,t,n){var i=this.parameterPositions,r=e-2,a=e+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case H:r=e,o=2*t-n;break;case k:o=t+i[r=i.length-2]-i[r+1];break;default:r=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case H:a=e,s=2*n-t;break;case k:a=1,s=n+i[1]-i[0];break;default:a=e-1,s=t}var c=.5*(n-t),l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=r*l,this._offsetNext=a*l},interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(n-t)/(i-t),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,_=0;_!==o;++_)r[_]=g*a[l+_]+v*a[c+_]+y*a[s+_]+x*a[h+_];return r}}),As.prototype=Object.assign(Object.create(Es.prototype),{constructor:As,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(i-t),h=1-l,u=0;u!==o;++u)r[u]=a[c+u]*h+a[s+u]*l;return r}}),Ls.prototype=Object.assign(Object.create(Es.prototype),{constructor:Ls,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(Ps,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Ss.convertArray(e.times,Array),values:Ss.convertArray(e.values,Array)};var i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}}),Object.assign(Ps.prototype,{constructor:Ps,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:B,InterpolantFactoryMethodDiscrete:function(e){return new Ls(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new As(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Ts(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case F:t=this.InterpolantFactoryMethodDiscrete;break;case B:t=this.InterpolantFactoryMethodLinear;break;case G:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){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}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return F;case this.InterpolantFactoryMethodLinear:return B;case this.InterpolantFactoryMethodSmooth:return G}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Ss.arraySlice(n,r,a),this.values=Ss.arraySlice(this.values,r*o,a*o)}return this},validate: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,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==r;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&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==i&&Ss.isTypedArray(i)){o=0;for(var c=i.length;o!==c;++o){var l=i[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),i=this.getInterpolation()===G,r=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(1!==o||c!==c[0]))if(i)s=!0;else for(var l=o*n,h=l-n,u=l+n,d=0;d!==n;++d){var p=t[l+d];if(p!==t[h+d]||p!==t[u+d]){s=!0;break}}if(s){if(o!==r){e[r]=e[o];var f=o*n,m=r*n;for(d=0;d!==n;++d)t[m+d]=t[f+d]}++r}}if(a>0){for(e[r]=e[a],f=a*n,m=r*n,d=0;d!==n;++d)t[m+d]=t[f+d];++r}return r!==e.length&&(this.times=Ss.arraySlice(e,0,r),this.values=Ss.arraySlice(t,0,r*n)),this},clone:function(){var e=Ss.arraySlice(this.times,0),t=Ss.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),Rs.prototype=Object.assign(Object.create(Ps.prototype),{constructor:Rs,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:F,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Cs.prototype=Object.assign(Object.create(Ps.prototype),{constructor:Cs,ValueTypeName:"color"}),Ns.prototype=Object.assign(Object.create(Ps.prototype),{constructor:Ns,ValueTypeName:"number"}),Ds.prototype=Object.assign(Object.create(Es.prototype),{constructor:Ds,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=(n-t)/(i-t),l=s+o;s!==l;s+=4)te.slerpFlat(r,0,a,s-o,a,s,c);return r}}),Is.prototype=Object.assign(Object.create(Ps.prototype),{constructor:Is,ValueTypeName:"quaternion",DefaultInterpolation:B,InterpolantFactoryMethodLinear:function(e){return new Ds(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Os.prototype=Object.assign(Object.create(Ps.prototype),{constructor:Os,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:F,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Us.prototype=Object.assign(Object.create(Ps.prototype),{constructor:Us,ValueTypeName:"vector"}),Object.assign(zs,{parse:function(e){for(var t=[],n=e.tracks,i=1/(e.fps||1),r=0,a=n.length;r!==a;++r)t.push(Fs(n[r]).scale(i));return new zs(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},r=0,a=n.length;r!==a;++r)t.push(Ps.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(e,t,n,i){for(var r=t.length,a=[],o=0;o<r;o++){var s=[],c=[];s.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);var l=Ss.getKeyframeOrder(s);s=Ss.sortedArray(s,1,l),c=Ss.sortedArray(c,1,l),i||0!==s[0]||(s.push(r),c.push(c[0])),a.push(new Ns(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new zs(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var i=e;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(r);if(c&&c.length>1){var l=i[u=c[1]];l||(i[u]=l=[]),l.push(s)}}var h=[];for(var u in i)h.push(zs.CreateFromMorphTargetSequence(u,i[u],t,n));return h},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,i,r){if(0!==n.length){var a=[],o=[];Ss.flattenJSON(n,a,o,i),0!==a.length&&r.push(new e(t,a,o))}},i=[],r=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var h={},u=0;u<l.length;u++)if(l[u].morphTargets)for(var d=0;d<l[u].morphTargets.length;d++)h[l[u].morphTargets[d]]=-1;for(var p in h){var f=[],m=[];for(d=0;d!==l[u].morphTargets.length;++d){var g=l[u];f.push(g.time),m.push(g.morphTarget===p?1:0)}i.push(new Ns(".morphTargetInfluence["+p+"]",f,m))}a=h.length*(o||1)}else{var v=".bones["+t[c].name+"]";n(Us,v+".position",l,"pos",i),n(Is,v+".quaternion",l,"rot",i),n(Us,v+".scale",l,"scl",i)}}return 0===i.length?null:new zs(r,a,i)}}),Object.assign(zs.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new zs(this.name,this.duration,e)}});var Bs={enabled:!1,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={}}};function Gs(e,t,n){var i=this,r=!1,a=0,o=0,s=void 0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===r&&void 0!==i.onStart&&i.onStart(e,a,o),r=!0},this.itemEnd=function(e){a++,void 0!==i.onProgress&&i.onProgress(e,a,o),a===o&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){var t=c.indexOf(e);return-1!==t&&c.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=c.length;t<n;t+=2){var i=c[t],r=c[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return r}return null}}var Vs=new Gs;function Hs(e){this.manager=void 0!==e?e:Vs,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(Hs.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this}});var ks={};function Ws(e){Hs.call(this,e)}function js(e){Hs.call(this,e)}function qs(e){Hs.call(this,e)}function Xs(e){Hs.call(this,e)}function Ys(e){Hs.call(this,e)}function Zs(e){Hs.call(this,e)}function Js(e){Hs.call(this,e)}function Qs(){this.type="Curve",this.arcLengthDivisions=200}function Ks(e,t,n,i,r,a,o,s){Qs.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function $s(e,t,n,i,r,a){Ks.call(this,e,t,n,n,i,r,a),this.type="ArcCurve"}function ec(){var e=0,t=0,n=0,i=0;function r(r,a,o,s){e=r,t=o,n=-3*r+3*a-2*o-s,i=2*r-2*a+o+s}return{initCatmullRom:function(e,t,n,i,a){r(t,n,a*(n-e),a*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(i-t)/(o+s)+(i-n)/s;r(t,n,c*=o,l*=o)},calc:function(r){var a=r*r;return e+t*r+n*a+i*(a*r)}}}Ws.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Ws,load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Bs.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;if(void 0===ks[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],l=o[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var h,u=(this.responseType||"").toLowerCase();switch(u){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);h="blob"===u?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;h=f.parseFromString(l,s);break;case"json":h=JSON.parse(l);break;default:h=l}setTimeout((function(){t&&t(h),r.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}),0)}}else{ks[e]=[],ks[e].push({onLoad:t,onProgress:n,onError:i});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",(function(t){var n=this.response,i=ks[e];if(delete ks[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Bs.add(e,n);for(var a=0,o=i.length;a<o;a++)(s=i[a]).onLoad&&s.onLoad(n);r.manager.itemEnd(e)}else{for(a=0,o=i.length;a<o;a++){var s;(s=i[a]).onError&&s.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}}),!1),m.addEventListener("progress",(function(t){for(var n=ks[e],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(t)}}),!1),m.addEventListener("error",(function(t){var n=ks[e];delete ks[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}),!1),m.addEventListener("abort",(function(t){var n=ks[e];delete ks[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return r.manager.itemStart(e),m}ks[e].push({onLoad:t,onProgress:n,onError:i})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),js.prototype=Object.assign(Object.create(Hs.prototype),{constructor:js,load:function(e,t,n,i){var r=this,a=new Ws(r.manager);a.setPath(r.path),a.load(e,(function(e){t(r.parse(JSON.parse(e)))}),n,i)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var i=zs.parse(e[n]);t.push(i)}return t}}),qs.prototype=Object.assign(Object.create(Hs.prototype),{constructor:qs,load:function(e,t,n,i){var r=this,a=[],o=new Qa;o.image=a;var s=new Ws(this.manager);function c(c){s.load(e[c],(function(e){var n=r.parse(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(o.minFilter=A),o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,i)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,h=0,u=e.length;h<u;++h)c(h);else s.load(e,(function(e){var n=r.parse(e,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;s++){a[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=A),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,i);return o}}),Xs.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Xs,load:function(e,t,n,i){var r=this,a=new kn,o=new Ws(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,(function(e){var n=r.parse(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:w,a.wrapT=void 0!==n.wrapT?n.wrapT:w,a.magFilter=void 0!==n.magFilter?n.magFilter:A,a.minFilter=void 0!==n.minFilter?n.minFilter:A,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=L),1===n.mipmapCount&&(a.minFilter=A),a.needsUpdate=!0,t&&t(a,n))}),n,i),a}}),Ys.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Ys,load:function(e,t,n,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Bs.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),Bs.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",c,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}),Zs.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Zs,load:function(e,t,n,i){var r=new ui,a=new Ys(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],(function(e){r.images[n]=e,6==++o&&(r.needsUpdate=!0,t&&t(r))}),void 0,i)}for(var c=0;c<e.length;++c)s(c);return r}}),Js.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Js,load:function(e,t,n,i){var r=new he,a=new Ys(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(n){r.image=n;var i=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);r.format=i?I:O,r.needsUpdate=!0,void 0!==t&&t(r)}),n,i),r}}),Object.assign(Qs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,i=[],r=this.getPoint(0),a=0;for(i.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(r),i.push(a),r=t;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,i=this.getLengths(),r=0,a=i.length;n=t||e*i[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=i[r=Math.floor(s+(c-s)/2)]-n)<0)s=r+1;else{if(!(o>0)){c=r;break}c=r-1}if(i[r=c]===n)return r/(a-1);var l=i[r];return(r+(n-l)/(i[r+1]-l))/(a-1)},getTangent:function(e){var t=1e-4,n=e-t,i=e+t;n<0&&(n=0),i>1&&(i=1);var r=this.getPoint(n);return this.getPoint(i).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,i,r,a=new re,o=[],s=[],c=[],l=new re,h=new be;for(n=0;n<=e;n++)i=n/e,o[n]=this.getTangentAt(i),o[n].normalize();s[0]=new re,c[0]=new re;var u=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=u&&(u=d,a.set(1,0,0)),p<=u&&(u=p,a.set(0,1,0)),f<=u&&a.set(0,0,1),l.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],l),c[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(o[n-1],o[n]),l.length()>Number.EPSILON&&(l.normalize(),r=Math.acos($.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(h.makeRotationAxis(l,r))),c[n].crossVectors(o[n],s[n]);if(!0===t)for(r=Math.acos($.clamp(s[0].dot(s[e]),-1,1)),r/=e,o[0].dot(l.crossVectors(s[0],s[e]))>0&&(r=-r),n=1;n<=e;n++)s[n].applyMatrix4(h.makeRotationAxis(o[n],r*n)),c[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Ks.prototype=Object.create(Qs.prototype),Ks.prototype.constructor=Ks,Ks.prototype.isEllipseCurve=!0,Ks.prototype.getPoint=function(e,t){for(var n=t||new ee,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=a?0:i),!0!==this.aClockwise||a||(r===i?r=-i:r-=i);var o=this.aStartAngle+e*r,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var l=Math.cos(this.aRotation),h=Math.sin(this.aRotation),u=s-this.aX,d=c-this.aY;s=u*l-d*h+this.aX,c=u*h+d*l+this.aY}return n.set(s,c)},Ks.prototype.copy=function(e){return Qs.prototype.copy.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},Ks.prototype.toJSON=function(){var e=Qs.prototype.toJSON.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},Ks.prototype.fromJSON=function(e){return Qs.prototype.fromJSON.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},$s.prototype=Object.create(Ks.prototype),$s.prototype.constructor=$s,$s.prototype.isArcCurve=!0;var tc=new re,nc=new ec,ic=new ec,rc=new ec;function ac(e,t,n,i){Qs.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}function oc(e,t,n,i,r){var a=.5*(i-t),o=.5*(r-n),s=e*e;return(2*n-2*i+a+o)*(e*s)+(-3*n+3*i-2*a-o)*s+a*e+n}function sc(e,t,n,i){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,i)}function cc(e,t,n,i,r){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,i)+function(e,t){return e*e*e*t}(e,r)}function lc(e,t,n,i){Qs.call(this),this.type="CubicBezierCurve",this.v0=e||new ee,this.v1=t||new ee,this.v2=n||new ee,this.v3=i||new ee}function hc(e,t,n,i){Qs.call(this),this.type="CubicBezierCurve3",this.v0=e||new re,this.v1=t||new re,this.v2=n||new re,this.v3=i||new re}function uc(e,t){Qs.call(this),this.type="LineCurve",this.v1=e||new ee,this.v2=t||new ee}function dc(e,t){Qs.call(this),this.type="LineCurve3",this.v1=e||new re,this.v2=t||new re}function pc(e,t,n){Qs.call(this),this.type="QuadraticBezierCurve",this.v0=e||new ee,this.v1=t||new ee,this.v2=n||new ee}function fc(e,t,n){Qs.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new re,this.v1=t||new re,this.v2=n||new re}function mc(e){Qs.call(this),this.type="SplineCurve",this.points=e||[]}ac.prototype=Object.create(Qs.prototype),ac.prototype.constructor=ac,ac.prototype.isCatmullRomCurve3=!0,ac.prototype.getPoint=function(e,t){var n,i,r,a,o=t||new re,s=this.points,c=s.length,l=(c-(this.closed?0:1))*e,h=Math.floor(l),u=l-h;if(this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/c)+1)*c:0===u&&h===c-1&&(h=c-2,u=1),this.closed||h>0?n=s[(h-1)%c]:(tc.subVectors(s[0],s[1]).add(s[0]),n=tc),i=s[h%c],r=s[(h+1)%c],this.closed||h+2<c?a=s[(h+2)%c]:(tc.subVectors(s[c-1],s[c-2]).add(s[c-1]),a=tc),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(i),d),f=Math.pow(i.distanceToSquared(r),d),m=Math.pow(r.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),nc.initNonuniformCatmullRom(n.x,i.x,r.x,a.x,p,f,m),ic.initNonuniformCatmullRom(n.y,i.y,r.y,a.y,p,f,m),rc.initNonuniformCatmullRom(n.z,i.z,r.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(nc.initCatmullRom(n.x,i.x,r.x,a.x,this.tension),ic.initCatmullRom(n.y,i.y,r.y,a.y,this.tension),rc.initCatmullRom(n.z,i.z,r.z,a.z,this.tension));return o.set(nc.calc(u),ic.calc(u),rc.calc(u)),o},ac.prototype.copy=function(e){Qs.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},ac.prototype.toJSON=function(){var e=Qs.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},ac.prototype.fromJSON=function(e){Qs.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new re).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},lc.prototype=Object.create(Qs.prototype),lc.prototype.constructor=lc,lc.prototype.isCubicBezierCurve=!0,lc.prototype.getPoint=function(e,t){var n=t||new ee,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(cc(e,i.x,r.x,a.x,o.x),cc(e,i.y,r.y,a.y,o.y)),n},lc.prototype.copy=function(e){return Qs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},lc.prototype.toJSON=function(){var e=Qs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},lc.prototype.fromJSON=function(e){return Qs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},hc.prototype=Object.create(Qs.prototype),hc.prototype.constructor=hc,hc.prototype.isCubicBezierCurve3=!0,hc.prototype.getPoint=function(e,t){var n=t||new re,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(cc(e,i.x,r.x,a.x,o.x),cc(e,i.y,r.y,a.y,o.y),cc(e,i.z,r.z,a.z,o.z)),n},hc.prototype.copy=function(e){return Qs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},hc.prototype.toJSON=function(){var e=Qs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},hc.prototype.fromJSON=function(e){return Qs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},uc.prototype=Object.create(Qs.prototype),uc.prototype.constructor=uc,uc.prototype.isLineCurve=!0,uc.prototype.getPoint=function(e,t){var n=t||new ee;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},uc.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},uc.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},uc.prototype.copy=function(e){return Qs.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},uc.prototype.toJSON=function(){var e=Qs.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},uc.prototype.fromJSON=function(e){return Qs.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},dc.prototype=Object.create(Qs.prototype),dc.prototype.constructor=dc,dc.prototype.isLineCurve3=!0,dc.prototype.getPoint=function(e,t){var n=t||new re;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},dc.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},dc.prototype.copy=function(e){return Qs.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},dc.prototype.toJSON=function(){var e=Qs.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},dc.prototype.fromJSON=function(e){return Qs.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},pc.prototype=Object.create(Qs.prototype),pc.prototype.constructor=pc,pc.prototype.isQuadraticBezierCurve=!0,pc.prototype.getPoint=function(e,t){var n=t||new ee,i=this.v0,r=this.v1,a=this.v2;return n.set(sc(e,i.x,r.x,a.x),sc(e,i.y,r.y,a.y)),n},pc.prototype.copy=function(e){return Qs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},pc.prototype.toJSON=function(){var e=Qs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},pc.prototype.fromJSON=function(e){return Qs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},fc.prototype=Object.create(Qs.prototype),fc.prototype.constructor=fc,fc.prototype.isQuadraticBezierCurve3=!0,fc.prototype.getPoint=function(e,t){var n=t||new re,i=this.v0,r=this.v1,a=this.v2;return n.set(sc(e,i.x,r.x,a.x),sc(e,i.y,r.y,a.y),sc(e,i.z,r.z,a.z)),n},fc.prototype.copy=function(e){return Qs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},fc.prototype.toJSON=function(){var e=Qs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},fc.prototype.fromJSON=function(e){return Qs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},mc.prototype=Object.create(Qs.prototype),mc.prototype.constructor=mc,mc.prototype.isSplineCurve=!0,mc.prototype.getPoint=function(e,t){var n=t||new ee,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,s=i[0===a?a:a-1],c=i[a],l=i[a>i.length-2?i.length-1:a+1],h=i[a>i.length-3?i.length-1:a+2];return n.set(oc(o,s.x,c.x,l.x,h.x),oc(o,s.y,c.y,l.y,h.y)),n},mc.prototype.copy=function(e){Qs.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this},mc.prototype.toJSON=function(){var e=Qs.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e},mc.prototype.fromJSON=function(e){Qs.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new ee).fromArray(i))}return this};var gc=Object.freeze({__proto__:null,ArcCurve:$s,CatmullRomCurve3:ac,CubicBezierCurve:lc,CubicBezierCurve3:hc,EllipseCurve:Ks,LineCurve:uc,LineCurve3:dc,QuadraticBezierCurve:pc,QuadraticBezierCurve3:fc,SplineCurve:mc});function vc(){Qs.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function yc(e){vc.call(this),this.type="Path",this.currentPoint=new ee,e&&this.setFromPoints(e)}function xc(e){yc.call(this,e),this.uuid=$.generateUUID(),this.type="Shape",this.holes=[]}function _c(e,t){Be.call(this),this.type="Light",this.color=new Rt(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function bc(e,t,n){_c.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Be.DefaultUp),this.updateMatrix(),this.groundColor=new Rt(t)}function wc(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new ee(512,512),this.map=null,this.mapPass=null,this.matrix=new be,this._frustum=new qn,this._frameExtents=new ee(1,1),this._viewportCount=1,this._viewports=[new ue(0,0,1,1)]}function Mc(){wc.call(this,new Bn(50,1,.5,500))}function Sc(e,t,n,i,r,a){_c.call(this,e,t),this.type="SpotLight",this.position.copy(Be.DefaultUp),this.updateMatrix(),this.target=new Be,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new Mc}function Ec(){wc.call(this,new Bn(90,1,.5,500)),this._frameExtents=new ee(4,2),this._viewportCount=6,this._viewports=[new ue(2,1,1,1),new ue(0,1,1,1),new ue(3,1,1,1),new ue(1,1,1,1),new ue(3,0,1,1),new ue(1,0,1,1)],this._cubeDirections=[new re(1,0,0),new re(-1,0,0),new re(0,0,1),new re(0,0,-1),new re(0,1,0),new re(0,-1,0)],this._cubeUps=[new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,0,1),new re(0,0,-1)]}function Tc(e,t,n,i){_c.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new Ec}function Ac(e,t,n,i,r,a){Fn.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Lc(){wc.call(this,new Ac(-5,5,5,-5,.5,500))}function Pc(e,t){_c.call(this,e,t),this.type="DirectionalLight",this.position.copy(Be.DefaultUp),this.updateMatrix(),this.target=new Be,this.shadow=new Lc}function Rc(e,t){_c.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Cc(e,t,n,i){_c.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function Nc(e){Hs.call(this,e),this.textures={}}vc.prototype=Object.assign(Object.create(Qs.prototype),{constructor:vc,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new uc(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=t){var r=n[i]-t,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}i++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],i=0,r=this.curves;i<r.length;i++)for(var a=r[i],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Qs.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Qs.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var i=this.curves[t];e.curves.push(i.toJSON())}return e},fromJSON:function(e){Qs.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push((new gc[i.type]).fromJSON(i))}return this}}),yc.prototype=Object.assign(Object.create(vc.prototype),{constructor:yc,setFromPoints: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},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new uc(this.currentPoint.clone(),new ee(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,i){var r=new pc(this.currentPoint.clone(),new ee(e,t),new ee(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this},bezierCurveTo:function(e,t,n,i,r,a){var o=new lc(this.currentPoint.clone(),new ee(e,t),new ee(n,i),new ee(r,a));return this.curves.push(o),this.currentPoint.set(r,a),this},splineThru:function(e){var t=new mc([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,i,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,i,r,a),this},absarc:function(e,t,n,i,r,a){return this.absellipse(e,t,n,n,i,r,a),this},ellipse:function(e,t,n,i,r,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,i,r,a,o,s),this},absellipse:function(e,t,n,i,r,a,o,s){var c=new Ks(e,t,n,i,r,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var h=c.getPoint(1);return this.currentPoint.copy(h),this},copy:function(e){return vc.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=vc.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return vc.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),xc.prototype=Object.assign(Object.create(yc.prototype),{constructor:xc,getPointsHoles:function(e){for(var t=[],n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){yc.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push(i.clone())}return this},toJSON:function(){var e=yc.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var i=this.holes[t];e.holes.push(i.toJSON())}return e},fromJSON:function(e){yc.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push((new yc).fromJSON(i))}return this}}),_c.prototype=Object.assign(Object.create(Be.prototype),{constructor:_c,isLight:!0,copy:function(e){return Be.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=Be.prototype.toJSON.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}}),bc.prototype=Object.assign(Object.create(_c.prototype),{constructor:bc,isHemisphereLight:!0,copy:function(e){return _c.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(wc.prototype,{_projScreenMatrix:new be,_lightPositionWorld:new re,_lookTarget:new re,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),r.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(r),t.updateMatrixWorld(),i.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),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}}),Mc.prototype=Object.assign(Object.create(wc.prototype),{constructor:Mc,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*$.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;n===t.fov&&i===t.aspect&&r===t.far||(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),wc.prototype.updateMatrices.call(this,e)}}),Sc.prototype=Object.assign(Object.create(_c.prototype),{constructor:Sc,isSpotLight:!0,copy:function(e){return _c.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Ec.prototype=Object.assign(Object.create(wc.prototype),{constructor:Ec,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,i=this.matrix,r=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(e.matrixWorld),n.position.copy(r),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromMatrix(o)}}),Tc.prototype=Object.assign(Object.create(_c.prototype),{constructor:Tc,isPointLight:!0,copy:function(e){return _c.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Ac.prototype=Object.assign(Object.create(Fn.prototype),{constructor:Ac,isOrthographicCamera:!0,copy:function(e,t){return Fn.prototype.copy.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},setViewOffset:function(e,t,n,i,r,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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e,a=n+e,o=i+t,s=i-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;a=(r+=h*(this.view.offsetX/c))+h*(this.view.width/c),s=(o-=u*(this.view.offsetY/l))-u*(this.view.height/l)}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Be.prototype.toJSON.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}}),Lc.prototype=Object.assign(Object.create(wc.prototype),{constructor:Lc,isDirectionalLightShadow:!0,updateMatrices:function(e){wc.prototype.updateMatrices.call(this,e)}}),Pc.prototype=Object.assign(Object.create(_c.prototype),{constructor:Pc,isDirectionalLight:!0,copy:function(e){return _c.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Rc.prototype=Object.assign(Object.create(_c.prototype),{constructor:Rc,isAmbientLight:!0}),Cc.prototype=Object.assign(Object.create(_c.prototype),{constructor:Cc,isRectAreaLight:!0,copy:function(e){return _c.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=_c.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Nc.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Nc,load:function(e,t,n,i){var r=this,a=new Ws(r.manager);a.setPath(r.path),a.load(e,(function(e){t(r.parse(JSON.parse(e)))}),n,i)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var i=new Ms[e.type];if(void 0!==e.uuid&&(i.uuid=e.uuid),void 0!==e.name&&(i.name=e.name),void 0!==e.color&&i.color.setHex(e.color),void 0!==e.roughness&&(i.roughness=e.roughness),void 0!==e.metalness&&(i.metalness=e.metalness),void 0!==e.sheen&&(i.sheen=(new Rt).setHex(e.sheen)),void 0!==e.emissive&&i.emissive.setHex(e.emissive),void 0!==e.specular&&i.specular.setHex(e.specular),void 0!==e.shininess&&(i.shininess=e.shininess),void 0!==e.clearcoat&&(i.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(i.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.vertexColors&&(i.vertexColors=e.vertexColors),void 0!==e.fog&&(i.fog=e.fog),void 0!==e.flatShading&&(i.flatShading=e.flatShading),void 0!==e.blending&&(i.blending=e.blending),void 0!==e.combine&&(i.combine=e.combine),void 0!==e.side&&(i.side=e.side),void 0!==e.opacity&&(i.opacity=e.opacity),void 0!==e.transparent&&(i.transparent=e.transparent),void 0!==e.alphaTest&&(i.alphaTest=e.alphaTest),void 0!==e.depthTest&&(i.depthTest=e.depthTest),void 0!==e.depthWrite&&(i.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(i.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(i.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(i.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(i.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(i.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(i.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(i.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(i.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(i.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(i.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(i.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(i.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(i.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(i.rotation=e.rotation),1!==e.linewidth&&(i.linewidth=e.linewidth),void 0!==e.dashSize&&(i.dashSize=e.dashSize),void 0!==e.gapSize&&(i.gapSize=e.gapSize),void 0!==e.scale&&(i.scale=e.scale),void 0!==e.polygonOffset&&(i.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(i.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(i.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(i.skinning=e.skinning),void 0!==e.morphTargets&&(i.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(i.morphNormals=e.morphNormals),void 0!==e.dithering&&(i.dithering=e.dithering),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.toneMapped&&(i.toneMapped=e.toneMapped),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.uniforms)for(var r in e.uniforms){var a=e.uniforms[r];switch(i.uniforms[r]={},a.type){case"t":i.uniforms[r].value=n(a.value);break;case"c":i.uniforms[r].value=(new Rt).setHex(a.value);break;case"v2":i.uniforms[r].value=(new ee).fromArray(a.value);break;case"v3":i.uniforms[r].value=(new re).fromArray(a.value);break;case"v4":i.uniforms[r].value=(new ue).fromArray(a.value);break;case"m3":i.uniforms[r].value=(new se).fromArray(a.value);case"m4":i.uniforms[r].value=(new be).fromArray(a.value);break;default:i.uniforms[r].value=a.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)i.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(i.flatShading=1===e.shading),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap),i.transparent=!0),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),i.normalScale=(new ee).fromArray(s)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=(new ee).fromArray(e.clearcoatNormalScale)),i},setTextures:function(e){return this.textures=e,this}});var Dc=function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)};function Ic(){rn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Oc(e,t,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Ft.call(this,e,t,n),this.meshPerAttribute=i||1}function Uc(e){Hs.call(this,e)}Ic.prototype=Object.assign(Object.create(rn.prototype),{constructor:Ic,isInstancedBufferGeometry:!0,copy:function(e){return rn.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=rn.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),Oc.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Oc,isInstancedBufferAttribute:!0,copy:function(e){return Ft.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=Ft.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),Uc.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Uc,load:function(e,t,n,i){var r=this,a=new Ws(r.manager);a.setPath(r.path),a.load(e,(function(e){t(r.parse(JSON.parse(e)))}),n,i)},parse:function(e){var t=e.isInstancedBufferGeometry?new Ic:new rn,n=e.data.index;if(void 0!==n){var i=new zc[n.type](n.array);t.setIndex(new Ft(i,1))}var r=e.data.attributes;for(var a in r){var o=r[a],s=(i=new zc[o.type](o.array),new(o.isInstancedBufferAttribute?Oc:Ft)(i,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),t.setAttribute(a,s)}var c=e.data.morphAttributes;if(c)for(var a in c){for(var l=c[a],h=[],u=0,d=l.length;u<d;u++)o=l[u],s=new Ft(i=new zc[o.type](o.array),o.itemSize,o.normalized),void 0!==o.name&&(s.name=o.name),h.push(s);t.morphAttributes[a]=h}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var p=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==p){u=0;for(var f=p.length;u!==f;++u){var m=p[u];t.addGroup(m.start,m.count,m.materialIndex)}}var g=e.data.boundingSphere;if(void 0!==g){var v=new re;void 0!==g.center&&v.fromArray(g.center),t.boundingSphere=new it(v,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var zc={Int8Array,Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Fc(e){Hs.call(this,e)}Fc.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Fc,load:function(e,t,n,i){var r=this,a=""===this.path?Dc(e):this.path;this.resourcePath=this.resourcePath||a;var o=new Ws(r.manager);o.setPath(this.path),o.load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==i&&i(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?r.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,i)},parse:function(e,t){var n=this.parseShape(e.shapes),i=this.parseGeometries(e.geometries,n),r=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),a=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,i,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,i=e.length;n<i;n++){var r=(new xc).fromJSON(e[n]);t[r.uuid]=r}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var i=new Uc,r=0,a=e.length;r<a;r++){var o,s=e[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new ds[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new ds[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new ds[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new ds[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new ds[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new ds[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new ds[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new ds[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new ds[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new ds[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new ds[s.type]((new gc[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new ds[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new ds[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],l=0,h=s.shapes.length;l<h;l++){var u=t[s.shapes[l]];c.push(u)}o=new ds[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],l=0,h=s.shapes.length;l<h;l++)u=t[s.shapes[l]],c.push(u);var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new gc[d.type]).fromJSON(d)),o=new ds[s.type](c,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;case"Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},i={};if(void 0!==e){var r=new Nc;r.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var c=[],l=0;l<s.materials.length;l++){var h=s.materials[l];void 0===n[h.uuid]&&(n[h.uuid]=r.parse(h)),c.push(n[h.uuid])}i[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=zs.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),t.push(r)}return t},parseImages:function(e,t){var n=this,i={};function r(e){return n.manager.itemStart(e),a.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}if(void 0!==e&&e.length>0){var a=new Ys(new Gs(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var c=e[o],l=c.url;if(Array.isArray(l)){i[c.uuid]=[];for(var h=0,u=l.length;h<u;h++){var d=l[h],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;i[c.uuid].push(r(p))}}else p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.resourcePath+c.url,i[c.uuid]=r(p)}}return i},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var i={};if(void 0!==e)for(var r=0,a=e.length;r<a;r++){var o,s=e[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=Array.isArray(t[s.image])?new ui(t[s.image]):new he(t[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,Gc)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],Vc),o.wrapT=n(s.wrap[1],Vc)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,Hc)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,Hc)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),i[s.uuid]=o}return i},parseObject:function(e,t,n){var i;function r(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],i=0,r=e.length;i<r;i++){var a=e[i];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":i=new Ge,void 0!==e.background&&Number.isInteger(e.background)&&(i.background=new Rt(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?i.fog=new ta(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(i.fog=new ea(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":i=new Bn(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(i.focus=e.focus),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.filmGauge&&(i.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(i.filmOffset=e.filmOffset),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"OrthographicCamera":i=new Ac(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"AmbientLight":i=new Rc(e.color,e.intensity);break;case"DirectionalLight":i=new Pc(e.color,e.intensity);break;case"PointLight":i=new Tc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":i=new Cc(e.color,e.intensity,e.width,e.height);break;case"SpotLight":i=new Sc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":i=new bc(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=r(e.geometry),s=a(e.material);i=o.bones&&o.bones.length>0?new wa(o,s):new wn(o,s);break;case"InstancedMesh":o=r(e.geometry),s=a(e.material);var c=e.count,l=e.instanceMatrix;(i=new Ca(o,s,c)).instanceMatrix=new Ft(new Float32Array(l.array),16);break;case"LOD":i=new ba;break;case"Line":i=new Fa(r(e.geometry),a(e.material),e.mode);break;case"LineLoop":i=new Ha(r(e.geometry),a(e.material));break;case"LineSegments":i=new Va(r(e.geometry),a(e.material));break;case"PointCloud":case"Points":i=new Ya(r(e.geometry),a(e.material));break;case"Sprite":i=new va(a(e.material));break;case"Group":i=new jr;break;default:i=new Be}if(i.uuid=e.uuid,void 0!==e.name&&(i.name=e.name),void 0!==e.matrix?(i.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(i.matrixAutoUpdate=e.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==e.position&&i.position.fromArray(e.position),void 0!==e.rotation&&i.rotation.fromArray(e.rotation),void 0!==e.quaternion&&i.quaternion.fromArray(e.quaternion),void 0!==e.scale&&i.scale.fromArray(e.scale)),void 0!==e.castShadow&&(i.castShadow=e.castShadow),void 0!==e.receiveShadow&&(i.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(i.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(i.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&i.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(i.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.frustumCulled&&(i.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(i.renderOrder=e.renderOrder),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.layers&&(i.layers.mask=e.layers),void 0!==e.drawMode&&i.setDrawMode(e.drawMode),void 0!==e.children)for(var h=e.children,u=0;u<h.length;u++)i.add(this.parseObject(h[u],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(i.autoUpdate=e.autoUpdate);for(var d=e.levels,p=0;p<d.length;p++){var f=d[p],m=i.getObjectByProperty("uuid",f.object);void 0!==m&&i.addLevel(m,f.distance)}}return i}});var Bc,Gc={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Vc={RepeatWrapping:b,ClampToEdgeWrapping:w,MirroredRepeatWrapping:M},Hc={NearestFilter:S,NearestMipmapNearestFilter:E,NearestMipmapLinearFilter:T,LinearFilter:A,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:L};function kc(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),Hs.call(this,e),this.options=void 0}function Wc(){this.type="ShapePath",this.color=new Rt,this.subPaths=[],this.currentPath=null}function jc(e){this.type="Font",this.data=e}function qc(e,t,n,i,r){var a=r.glyphs[e]||r.glyphs["?"];if(a){var o,s,c,l,h,u,d,p,f=new Wc;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;)switch(m[g++]){case"m":o=m[g++]*t+n,s=m[g++]*t+i,f.moveTo(o,s);break;case"l":o=m[g++]*t+n,s=m[g++]*t+i,f.lineTo(o,s);break;case"q":c=m[g++]*t+n,l=m[g++]*t+i,h=m[g++]*t+n,u=m[g++]*t+i,f.quadraticCurveTo(h,u,c,l);break;case"b":c=m[g++]*t+n,l=m[g++]*t+i,h=m[g++]*t+n,u=m[g++]*t+i,d=m[g++]*t+n,p=m[g++]*t+i,f.bezierCurveTo(h,u,d,p,c,l)}return{offsetX:a.ha*t,path:f}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+r.familyName+".")}function Xc(e){Hs.call(this,e)}kc.prototype=Object.assign(Object.create(Hs.prototype),{constructor:kc,setOptions:function(e){return this.options=e,this},load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Bs.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;fetch(e).then((function(e){return e.blob()})).then((function(e){return void 0===r.options?createImageBitmap(e):createImageBitmap(e,r.options)})).then((function(n){Bs.add(e,n),t&&t(n),r.manager.itemEnd(e)})).catch((function(t){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)})),r.manager.itemStart(e)}}),Object.assign(Wc.prototype,{moveTo:function(e,t){return this.currentPath=new yc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this},bezierCurveTo:function(e,t,n,i,r,a){return this.currentPath.bezierCurveTo(e,t,n,i,r,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n],a=new xc;a.curves=r.curves,t.push(a)}return t}function i(e,t){for(var n=t.length,i=!1,r=n-1,a=0;a<n;r=a++){var o=t[r],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[r],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var h=l*(e.x-o.x)-c*(e.y-o.y);if(0===h)return!0;if(h<0)continue;i=!i}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return i}var r=Vo.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,c,l=[];if(1===a.length)return s=a[0],(c=new xc).curves=s.curves,l.push(c),l;var h=!r(a[0].getPoints());h=e?!h:h;var u,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=r(u=(s=a[v]).getPoints()),(o=e?!o:o)?(!h&&f[g]&&g++,f[g]={s:new xc,p:u},f[g].s.curves=s.curves,h&&g++,m[g]=[]):m[g].push({h:s,p:u[0]});if(!f[0])return n(a);if(f.length>1){for(var x=!1,_=[],b=0,w=f.length;b<w;b++)p[b]=[];for(b=0,w=f.length;b<w;b++)for(var M=m[b],S=0;S<M.length;S++){for(var E=M[S],T=!0,A=0;A<f.length;A++)i(E.p,f[A].p)&&(b!==A&&_.push({froms:b,tos:A,hole:S}),T?(T=!1,p[A].push(E)):x=!0);T&&p[b].push(E)}_.length>0&&(x||(m=p))}v=0;for(var L=f.length;v<L;v++){c=f[v].s,l.push(c);for(var P=0,R=(d=m[v]).length;P<R;P++)c.holes.push(d[P].h)}return l}}),Object.assign(jc.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],i=function(e,t,n){for(var i=Array.from?Array.from(e):String(e).split(""),r=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,o=[],s=0,c=0,l=0;l<i.length;l++){var h=i[l];if("\n"===h)s=0,c-=a;else{var u=qc(h,r,s,c,n);s+=u.offsetX,o.push(u.path)}}return o}(e,t,this.data),r=0,a=i.length;r<a;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Xc.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Xc,load:function(e,t,n,i){var r=this,a=new Ws(this.manager);a.setPath(this.path),a.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var i=r.parse(n);t&&t(i)}),n,i)},parse:function(e){return new jc(e)}});var Yc=function(){return void 0===Bc&&(Bc=new(window.AudioContext||window.webkitAudioContext)),Bc};function Zc(e){Hs.call(this,e)}function Jc(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new re)}function Qc(e,t){_c.call(this,void 0,t),this.sh=void 0!==e?e:new Jc}function Kc(e,t,n){Qc.call(this,void 0,n);var i=(new Rt).set(e),r=(new Rt).set(t),a=new re(i.r,i.g,i.b),o=new re(r.r,r.g,r.b),s=Math.sqrt(Math.PI),c=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(c)}function $c(e,t){Qc.call(this,void 0,t);var n=(new Rt).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}Zc.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Zc,load:function(e,t,n,i){var r=new Ws(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(e,(function(e){var n=e.slice(0);Yc().decodeAudioData(n,(function(e){t(e)}))}),n,i)}}),Object.assign(Jc.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScale(a[1],.488603*i),t.addScale(a[2],.488603*r),t.addScale(a[3],.488603*n),t.addScale(a[4],n*i*1.092548),t.addScale(a[5],i*r*1.092548),t.addScale(a[6],.315392*(3*r*r-1)),t.addScale(a[7],n*r*1.092548),t.addScale(a[8],.546274*(n*n-i*i)),t},getIrradianceAt:function(e,t){var n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScale(a[1],1.023328*i),t.addScale(a[2],1.023328*r),t.addScale(a[3],1.023328*n),t.addScale(a[4],.858086*n*i),t.addScale(a[5],.858086*i*r),t.addScale(a[6],.743125*r*r-.247708),t.addScale(a[7],.858086*n*r),t.addScale(a[8],.429043*(n*n-i*i)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}}),Object.assign(Jc,{getBasisAt:function(e,t){var n=e.x,i=e.y,r=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-i*i)}}),Qc.prototype=Object.assign(Object.create(_c.prototype),{constructor:Qc,isLightProbe:!0,copy:function(e){return _c.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return _c.prototype.toJSON.call(this,e)}}),Kc.prototype=Object.assign(Object.create(Qc.prototype),{constructor:Kc,isHemisphereLightProbe:!0,copy:function(e){return Qc.prototype.copy.call(this,e),this},toJSON:function(e){return Qc.prototype.toJSON.call(this,e)}}),$c.prototype=Object.assign(Object.create(Qc.prototype),{constructor:$c,isAmbientLightProbe:!0,copy:function(e){return Qc.prototype.copy.call(this,e),this},toJSON:function(e){return Qc.prototype.toJSON.call(this,e)}});var el=new be,tl=new be;function nl(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Bn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Bn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,i,r=e.projectionMatrix.clone(),a=t.eyeSep/2,o=a*t.near/t.focus,s=t.near*Math.tan($.DEG2RAD*t.fov*.5)/t.zoom;tl.elements[12]=-a,el.elements[12]=a,n=-s*t.aspect+o,i=s*t.aspect+o,r.elements[0]=2*t.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(r),n=-s*t.aspect-o,i=s*t.aspect-o,r.elements[0]=2*t.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(tl),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(el)}}),Object.assign(nl.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var il=new re,rl=new te,al=new re,ol=new re;function sl(){Be.call(this),this.type="AudioListener",this.context=Yc(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new nl}function cl(e){Be.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}sl.prototype=Object.assign(Object.create(Be.prototype),{constructor:sl,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){Be.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(il,rl,al),ol.set(0,0,-1).applyQuaternion(rl),t.positionX){var i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(il.x,i),t.positionY.linearRampToValueAtTime(il.y,i),t.positionZ.linearRampToValueAtTime(il.z,i),t.forwardX.linearRampToValueAtTime(ol.x,i),t.forwardY.linearRampToValueAtTime(ol.y,i),t.forwardZ.linearRampToValueAtTime(ol.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(il.x,il.y,il.z),t.setOrientation(ol.x,ol.y,ol.z,n.x,n.y,n.z)}}),cl.prototype=Object.assign(Object.create(Be.prototype),{constructor:cl,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=t,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.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){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},disconnect:function(){if(this.filters.length>0){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},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune: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},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate: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.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop: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.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var ll=new re,hl=new te,ul=new re,dl=new re;function pl(e){cl.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function fl(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function ml(e,t,n){this.binding=e,this.valueSize=n;var i,r=Float64Array;switch(t){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}pl.prototype=Object.assign(Object.create(cl.prototype),{constructor:pl,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(Be.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(ll,hl,ul),dl.set(0,0,1).applyQuaternion(hl);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(ll.x,n),t.positionY.linearRampToValueAtTime(ll.y,n),t.positionZ.linearRampToValueAtTime(ll.z,n),t.orientationX.linearRampToValueAtTime(dl.x,n),t.orientationY.linearRampToValueAtTime(dl.y,n),t.orientationZ.linearRampToValueAtTime(dl.z,n)}else t.setPosition(ll.x,ll.y,ll.z),t.setOrientation(dl.x,dl.y,dl.z)}}}),Object.assign(fl.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(ml.prototype,{accumulate:function(e,t){var n=this.buffer,i=this.valueSize,r=e*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)n[r+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*t;this._mixBufferRegion(n,i,o,1-r,t)}for(var s=t,c=t+t;s!==c;++s)if(n[s]!==n[s+t]){a.setValue(n,i);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,i=3*n;e.getValue(t,i);for(var r=n,a=i;r!==a;++r)t[r]=t[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,i,r){if(i>=.5)for(var a=0;a!==r;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,i){te.slerpFlat(e,t,e,t,e,n,i)},_lerp:function(e,t,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*i}}});var gl="\\[\\]\\.:\\/",vl=new RegExp("["+gl+"]","g"),yl="[^"+gl+"]",xl="[^"+gl.replace("\\.","")+"]",_l=/((?:WC+[\/:])*)/.source.replace("WC",yl),bl=/(WCOD+)?/.source.replace("WCOD",xl),wl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",yl),Ml=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",yl),Sl=new RegExp("^"+_l+bl+wl+Ml+"$"),El=["material","materials","bones"];function Tl(e,t,n){var i=n||Al.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function Al(e,t,n){this.path=t,this.parsedPath=n||Al.parseTrackName(t),this.node=Al.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Ll(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var i=t.tracks,r=i.length,a=new Array(r),o={endingStart:V,endingEnd:V},s=0;s!==r;++s){var c=i[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Pl(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Rl(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function Cl(e,t,n){na.call(this,e,t),this.meshPerAttribute=n||1}function Nl(e,t){return e.distance-t.distance}function Dl(e,t,n,i){if(!1!==e.visible&&(e.raycast(t,n),!0===i))for(var r=e.children,a=0,o=r.length;a<o;a++)Dl(r[a],t,n,!0)}Object.assign(Tl.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Al,{Composite:Tl,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Al.Composite(e,t,n):new Al(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(vl,"")},parseTrackName:function(e){var t=Sl.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==El.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var i=function e(n){for(var i=0;i<n.length;i++){var r=n[i];if(r.name===t||r.uuid===t)return r;var a=e(r.children);if(a)return a}return null}(e.children);if(i)return i}return null}}),Object.assign(Al.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)e[t++]=n[i]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=Al.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[i];if(void 0!==s){var c=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var l=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===r){r=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===r){r=o;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Al.prototype,{_getValue_unbound:Al.prototype.getValue,_setValue_unbound:Al.prototype.setValue}),Object.assign(function(){this.uuid=$.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,l=0,h=arguments.length;l!==h;++l){var u=arguments[l],d=u.uuid,p=i[d];if(void 0===p){p=t++,i[d]=p,e.push(u);for(var f=0,m=s;f!==m;++f)o[f].push(new Al(u,r[f],a[f]))}else if(p<n){c=e[p];var g=--n,v=e[g];for(i[v.uuid]=p,e[p]=v,i[d]=g,e[g]=u,f=0,m=s;f!==m;++f){var y=o[f],x=y[g],_=y[p];y[p]=x,void 0===_&&(_=new Al(u,r[f],a[f])),y[g]=_}}else e[p]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=n[c];if(void 0!==l&&l>=t){var h=t++,u=e[h];n[u.uuid]=l,e[l]=u,n[c]=h,e[h]=s;for(var d=0,p=r;d!==p;++d){var f=i[d],m=f[h],g=f[l];f[l]=m,f[h]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o].uuid,l=i[c];if(void 0!==l)if(delete i[c],l<n){var h=--n,u=e[h],d=e[v=--t];i[u.uuid]=l,e[l]=u,i[d.uuid]=h,e[h]=d,e.pop();for(var p=0,f=a;p!==f;++p){var m=(y=r[p])[h],g=y[v];y[l]=m,y[h]=g,y.pop()}}else{var v;for(i[(d=e[v=--t]).uuid]=l,e[l]=d,e.pop(),p=0,f=a;p!==f;++p){var y;(y=r[p])[l]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,i=n[e],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,h=new Array(c);i=r.length,n[e]=i,a.push(e),o.push(t),r.push(h);for(var u=l,d=s.length;u!==d;++u){var p=s[u];h[u]=new Al(p,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),Object.assign(Ll.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var i=this._clip.duration,r=e._clip.duration,a=r/i,o=i/r;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var i=this._mixer,r=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=r,s[1]=r+n,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var a=(e-r)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,h=0,u=c.length;h!==u;++h)c[h].evaluate(o),l[h].accumulate(i,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,i=this.loop,r=this._loopCount,a=2202===i;if(0===e)return-1===r||!a||1&~r?t:n-t;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&!(1&~r))return n-t}return t},_setEndings:function(e,t,n){var i=this._interpolantSettings;n?(i.endingStart=H,i.endingEnd=H):(i.endingStart=e?this.zeroSlopeAtStart?H:V:k,i.endingEnd=t?this.zeroSlopeAtEnd?H:V:k)},_scheduleFading:function(e,t,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=t,o[1]=r+e,s[1]=n,this}}),Pl.prototype=Object.assign(Object.create(J.prototype),{constructor:Pl,_bindAction:function(e,t){var n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var h=0;h!==r;++h){var u=i[h],d=u.name,p=l[d];if(void 0!==p)a[h]=p;else{if(void 0!==(p=a[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[h].binding.parsedPath;++(p=new ml(Al.create(n,d,f),u.ValueTypeName,u.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[h]=p}o[h].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}for(var r=e._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var i=this._actions,r=this._actionsByClip,a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=i.length,i.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;var r=e._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_addInactiveBinding:function(e,t,n){var i=this._bindingsByRootAndName,r=i[t],a=this._bindings;void 0===r&&(r={},i[t]=r),r[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[i],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[r],0===Object.keys(o).length&&delete a[i]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new As(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?zs.findByName(n,e):e,a=null!==r?r.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[i];if(void 0!==c)return c;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var l=new Ll(this,r,t);return this._bindAction(l,s),this._addInactiveAction(l,a,i),l},existingAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?zs.findByName(n,e):e,a=r?r.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[i]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==t;++r)e[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o)t[o]._update(i,e,r,a);var s=this._bindings,c=this._nActiveBindings;for(o=0;o!==c;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=l,t[l]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete i[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[t];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Rl.prototype.clone=function(){return new Rl(void 0===this.value.clone?this.value:this.value.clone())},Cl.prototype=Object.assign(Object.create(na.prototype),{constructor:Cl,isInstancedInterleavedBuffer:!0,copy:function(e){return na.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(function(e,t,n,i){this.ray=new ut(e,t),this.near=n||0,this.far=i||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var i=n||[];return Dl(e,this,i,t),i.sort(Nl),i},intersectObjects:function(e,t,n){var i=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,a=e.length;r<a;r++)Dl(e[r],this,i,t);return i.sort(Nl),i}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos($.clamp(t/this.radius,-1,1))),this}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var Il=new ee;function Ol(e,t){this.min=void 0!==e?e:new ee(1/0,1/0),this.max=void 0!==t?t:new ee(-1/0,-1/0)}Object.assign(Ol.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=Il.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new ee),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new ee),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox: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},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new ee),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox: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)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new ee),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return Il.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Ul=new re,zl=new re;function Fl(e,t){this.start=void 0!==e?e:new re,this.end=void 0!==t?t:new re}function Bl(e){Be.call(this),this.material=e,this.render=function(){}}Object.assign(Fl.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new re),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new re),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new re),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){Ul.subVectors(e,this.start),zl.subVectors(this.end,this.start);var n=zl.dot(zl),i=zl.dot(Ul)/n;return t&&(i=$.clamp(i,0,1)),i},closestPointToPoint:function(e,t,n){var i=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new re),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Bl.prototype=Object.create(Be.prototype),Bl.prototype.constructor=Bl,Bl.prototype.isImmediateRenderObject=!0;var Gl=new re,Vl=new re,Hl=new se,kl=["a","b","c"];function Wl(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==n?n:16711680,a=void 0!==i?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var c=new rn,l=new qt(2*o*3,3);c.setAttribute("position",l),Va.call(this,c,new Na({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}Wl.prototype=Object.create(Va.prototype),Wl.prototype.constructor=Wl,Wl.prototype.update=function(){this.object.updateMatrixWorld(!0),Hl.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n&&n.isGeometry)for(var i=n.vertices,r=n.faces,a=0,o=0,s=r.length;o<s;o++)for(var c=r[o],l=0,h=c.vertexNormals.length;l<h;l++){var u=i[c[kl[l]]],d=c.vertexNormals[l];Gl.copy(u).applyMatrix4(e),Vl.copy(d).applyMatrix3(Hl).normalize().multiplyScalar(this.size).add(Gl),t.setXYZ(a,Gl.x,Gl.y,Gl.z),a+=1,t.setXYZ(a,Vl.x,Vl.y,Vl.z),a+=1}else if(n&&n.isBufferGeometry){var p=n.attributes.position,f=n.attributes.normal;for(a=0,l=0,h=p.count;l<h;l++)Gl.set(p.getX(l),p.getY(l),p.getZ(l)).applyMatrix4(e),Vl.set(f.getX(l),f.getY(l),f.getZ(l)),Vl.applyMatrix3(Hl).normalize().multiplyScalar(this.size).add(Gl),t.setXYZ(a,Gl.x,Gl.y,Gl.z),a+=1,t.setXYZ(a,Vl.x,Vl.y,Vl.z),a+=1}t.needsUpdate=!0};var jl=new re;function ql(e,t){Be.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new rn,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,a=1;r<32;r++,a++){var o=r/32*Math.PI*2,s=a/32*Math.PI*2;i.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new qt(i,3));var c=new Na({fog:!1});this.cone=new Va(n,c),this.add(this.cone),this.update()}ql.prototype=Object.create(Be.prototype),ql.prototype.constructor=ql,ql.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},ql.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),jl.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(jl),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Xl=new re,Yl=new be,Zl=new be;function Jl(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,Jl(e.children[n]));return t}function Ql(e){for(var t=Jl(e),n=new rn,i=[],r=[],a=new Rt(0,0,1),o=new Rt(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new qt(i,3)),n.setAttribute("color",new qt(r,3));var l=new Na({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Va.call(this,n,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function Kl(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var i=new Qo(t,4,2),r=new zt({wireframe:!0,fog:!1});wn.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function $l(e,t){this.type="RectAreaLightHelper",this.light=e,this.color=t;var n=new rn;n.setAttribute("position",new qt([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere();var i=new Na({fog:!1});Fa.call(this,n,i);var r=new rn;r.setAttribute("position",new qt([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),r.computeBoundingSphere(),this.add(new wn(r,new zt({side:1,fog:!1}))),this.update()}Ql.prototype=Object.create(Va.prototype),Ql.prototype.constructor=Ql,Ql.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,i=n.getAttribute("position");Zl.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<t.length;r++){var o=t[r];o.parent&&o.parent.isBone&&(Yl.multiplyMatrices(Zl,o.matrixWorld),Xl.setFromMatrixPosition(Yl),i.setXYZ(a,Xl.x,Xl.y,Xl.z),Yl.multiplyMatrices(Zl,o.parent.matrixWorld),Xl.setFromMatrixPosition(Yl),i.setXYZ(a+1,Xl.x,Xl.y,Xl.z),a+=2)}n.getAttribute("position").needsUpdate=!0,Be.prototype.updateMatrixWorld.call(this,e)},Kl.prototype=Object.create(wn.prototype),Kl.prototype.constructor=Kl,Kl.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Kl.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},$l.prototype=Object.create(Fa.prototype),$l.prototype.constructor=$l,$l.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}},$l.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()};var eh=new re,th=new Rt,nh=new Rt;function ih(e,t,n){Be.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new co(t);i.rotateY(.5*Math.PI),this.material=new zt({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.setAttribute("color",new Ft(a,3)),this.add(new wn(i,this.material)),this.update()}function rh(e,t){this.lightProbe=e,this.size=t;var n=new zn({defines:{GAMMA_OUTPUT:""},uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","vec3 linearToOutput( in vec3 a ) {","\t#ifdef GAMMA_OUTPUT","\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );","\t#else","\t\treturn a;","\t#endif","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\toutgoingLight = linearToOutput( outgoingLight );","\tgl_FragColor = vec4( outgoingLight, 1.0 );","}"].join("\n")}),i=new Qo(1,32,16);wn.call(this,i,n),this.onBeforeRender()}function ah(e,t,n,i){e=e||10,t=t||10,n=new Rt(void 0!==n?n:4473924),i=new Rt(void 0!==i?i:8947848);for(var r=t/2,a=e/t,o=e/2,s=[],c=[],l=0,h=0,u=-o;l<=t;l++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);var d=l===r?n:i;d.toArray(c,h),h+=3,d.toArray(c,h),h+=3,d.toArray(c,h),h+=3,d.toArray(c,h),h+=3}var p=new rn;p.setAttribute("position",new qt(s,3)),p.setAttribute("color",new qt(c,3));var f=new Na({vertexColors:2});Va.call(this,p,f)}function oh(e,t,n,i,r,a){e=e||10,t=t||16,n=n||8,i=i||64,r=new Rt(void 0!==r?r:4473924),a=new Rt(void 0!==a?a:8947848);var o,s,c,l,h,u,d,p=[],f=[];for(l=0;l<=t;l++)c=l/t*(2*Math.PI),o=Math.sin(c)*e,s=Math.cos(c)*e,p.push(0,0,0),p.push(o,0,s),d=1&l?r:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(l=0;l<=n;l++)for(d=1&l?r:a,u=e-e/n*l,h=0;h<i;h++)c=h/i*(2*Math.PI),o=Math.sin(c)*u,s=Math.cos(c)*u,p.push(o,0,s),f.push(d.r,d.g,d.b),c=(h+1)/i*(2*Math.PI),o=Math.sin(c)*u,s=Math.cos(c)*u,p.push(o,0,s),f.push(d.r,d.g,d.b);var m=new rn;m.setAttribute("position",new qt(p,3)),m.setAttribute("color",new qt(f,3));var g=new Na({vertexColors:2});Va.call(this,m,g)}function sh(e,t,n,i){this.audio=e,this.range=t||1,this.divisionsInnerAngle=n||16,this.divisionsOuterAngle=i||2;var r=new rn,a=this.divisionsInnerAngle+2*this.divisionsOuterAngle,o=new Float32Array(3*(3*a+3));r.setAttribute("position",new Ft(o,3));var s=new Na({color:65280}),c=new Na({color:16776960});Fa.call(this,r,[c,s]),this.update()}ih.prototype=Object.create(Be.prototype),ih.prototype.constructor=ih,ih.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},ih.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");th.copy(this.light.color),nh.copy(this.light.groundColor);for(var n=0,i=t.count;n<i;n++){var r=n<i/2?th:nh;t.setXYZ(n,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(eh.setFromMatrixPosition(this.light.matrixWorld).negate())},rh.prototype=Object.create(wn.prototype),rh.prototype.constructor=rh,rh.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},rh.prototype.onBeforeRender=function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity},ah.prototype=Object.assign(Object.create(Va.prototype),{constructor:ah,copy:function(e){return Va.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),oh.prototype=Object.create(Va.prototype),oh.prototype.constructor=oh,sh.prototype=Object.create(Fa.prototype),sh.prototype.constructor=sh,sh.prototype.update=function(){var e,t,n=this.audio,i=this.range,r=this.divisionsInnerAngle,a=this.divisionsOuterAngle,o=$.degToRad(n.panner.coneInnerAngle),s=$.degToRad(n.panner.coneOuterAngle),c=o/2,l=s/2,h=0,u=0,d=this.geometry,p=d.attributes.position;function f(n,r,a,o){var s=(r-n)/a;for(p.setXYZ(h,0,0,0),u++,e=n;e<r;e+=s)t=h+u,p.setXYZ(t,Math.sin(e)*i,0,Math.cos(e)*i),p.setXYZ(t+1,Math.sin(Math.min(e+s,r))*i,0,Math.cos(Math.min(e+s,r))*i),p.setXYZ(t+2,0,0,0),u+=3;d.addGroup(h,u,o),h+=u,u=0}d.clearGroups(),f(-l,-c,a,0),f(-c,c,r,1),f(c,l,a,0),p.needsUpdate=!0,o===s&&(this.material[0].visible=!1)},sh.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()};var ch=new re,lh=new re,hh=new se;function uh(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==n?n:16776960,a=void 0!==i?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new rn,l=new qt(2*o*3,3);c.setAttribute("position",l),Va.call(this,c,new Na({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}uh.prototype=Object.create(Va.prototype),uh.prototype.constructor=uh,uh.prototype.update=function(){this.object.updateMatrixWorld(!0),hh.getNormalMatrix(this.object.matrixWorld);for(var e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry,i=n.vertices,r=n.faces,a=0,o=0,s=r.length;o<s;o++){var c=r[o],l=c.normal;ch.copy(i[c.a]).add(i[c.b]).add(i[c.c]).divideScalar(3).applyMatrix4(e),lh.copy(l).applyMatrix3(hh).normalize().multiplyScalar(this.size).add(ch),t.setXYZ(a,ch.x,ch.y,ch.z),a+=1,t.setXYZ(a,lh.x,lh.y,lh.z),a+=1}t.needsUpdate=!0};var dh=new re,ph=new re,fh=new re;function mh(e,t,n){Be.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var i=new rn;i.setAttribute("position",new qt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var r=new Na({fog:!1});this.lightPlane=new Fa(i,r),this.add(this.lightPlane),(i=new rn).setAttribute("position",new qt([0,0,0,0,0,1],3)),this.targetLine=new Fa(i,r),this.add(this.targetLine),this.update()}mh.prototype=Object.create(Be.prototype),mh.prototype.constructor=mh,mh.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},mh.prototype.update=function(){dh.setFromMatrixPosition(this.light.matrixWorld),ph.setFromMatrixPosition(this.light.target.matrixWorld),fh.subVectors(ph,dh),this.lightPlane.lookAt(ph),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(ph),this.targetLine.scale.z=fh.length()};var gh=new re,vh=new Fn;function yh(e){var t=new rn,n=new Na({color:16777215,vertexColors:1}),i=[],r=[],a={},o=new Rt(16755200),s=new Rt(16711680),c=new Rt(43775),l=new Rt(16777215),h=new Rt(3355443);function u(e,t,n){d(e,n),d(t,n)}function d(e,t){i.push(0,0,0),r.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(i.length/3-1)}u("n1","n2",o),u("n2","n4",o),u("n4","n3",o),u("n3","n1",o),u("f1","f2",o),u("f2","f4",o),u("f4","f3",o),u("f3","f1",o),u("n1","f1",o),u("n2","f2",o),u("n3","f3",o),u("n4","f4",o),u("p","n1",s),u("p","n2",s),u("p","n3",s),u("p","n4",s),u("u1","u2",c),u("u2","u3",c),u("u3","u1",c),u("c","t",l),u("p","c",h),u("cn1","cn2",h),u("cn3","cn4",h),u("cf1","cf2",h),u("cf3","cf4",h),t.setAttribute("position",new qt(i,3)),t.setAttribute("color",new qt(r,3)),Va.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function xh(e,t,n,i,r,a,o){gh.set(r,a,o).unproject(i);var s=t[e];if(void 0!==s)for(var c=n.getAttribute("position"),l=0,h=s.length;l<h;l++)c.setXYZ(s[l],gh.x,gh.y,gh.z)}yh.prototype=Object.create(Va.prototype),yh.prototype.constructor=yh,yh.prototype.update=function(){var e=this.geometry,t=this.pointMap;vh.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),xh("c",t,e,vh,0,0,-1),xh("t",t,e,vh,0,0,1),xh("n1",t,e,vh,-1,-1,-1),xh("n2",t,e,vh,1,-1,-1),xh("n3",t,e,vh,-1,1,-1),xh("n4",t,e,vh,1,1,-1),xh("f1",t,e,vh,-1,-1,1),xh("f2",t,e,vh,1,-1,1),xh("f3",t,e,vh,-1,1,1),xh("f4",t,e,vh,1,1,1),xh("u1",t,e,vh,.7,1.1,-1),xh("u2",t,e,vh,-.7,1.1,-1),xh("u3",t,e,vh,0,2,-1),xh("cf1",t,e,vh,-1,0,1),xh("cf2",t,e,vh,1,0,1),xh("cf3",t,e,vh,0,-1,1),xh("cf4",t,e,vh,0,1,1),xh("cn1",t,e,vh,-1,0,-1),xh("cn2",t,e,vh,1,0,-1),xh("cn3",t,e,vh,0,-1,-1),xh("cn4",t,e,vh,0,1,-1),e.getAttribute("position").needsUpdate=!0};var _h=new et;function bh(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new rn;r.setIndex(new Ft(n,1)),r.setAttribute("position",new Ft(i,3)),Va.call(this,r,new Na({color:t})),this.matrixAutoUpdate=!1,this.update()}function wh(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new rn;i.setIndex(new Ft(n,1)),i.setAttribute("position",new qt([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Va.call(this,i,new Na({color:t})),this.geometry.computeBoundingSphere()}function Mh(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var i=void 0!==n?n:16776960,r=new rn;r.setAttribute("position",new qt([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),Fa.call(this,r,new Na({color:i}));var a=new rn;a.setAttribute("position",new qt([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new wn(a,new zt({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}bh.prototype=Object.create(Va.prototype),bh.prototype.constructor=bh,bh.prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&_h.setFromObject(this.object),!_h.isEmpty()){var t=_h.min,n=_h.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=t.x,r[4]=n.y,r[5]=n.z,r[6]=t.x,r[7]=t.y,r[8]=n.z,r[9]=n.x,r[10]=t.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=t.z,r[15]=t.x,r[16]=n.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=n.x,r[22]=t.y,r[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}},bh.prototype.setFromObject=function(e){return this.object=e,this.update(),this},bh.prototype.copy=function(e){return Va.prototype.copy.call(this,e),this.object=e.object,this},bh.prototype.clone=function(){return(new this.constructor).copy(this)},wh.prototype=Object.create(Va.prototype),wh.prototype.constructor=wh,wh.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Be.prototype.updateMatrixWorld.call(this,e))},Mh.prototype=Object.create(Fa.prototype),Mh.prototype.constructor=Mh,Mh.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?1:p,this.lookAt(this.plane.normal),Be.prototype.updateMatrixWorld.call(this,e)};var Sh,Eh,Th=new re;function Ah(e,t,n,i,r,a){Be.call(this),void 0===e&&(e=new re(0,0,1)),void 0===t&&(t=new re(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===Sh&&((Sh=new rn).setAttribute("position",new qt([0,0,0,0,1,0],3)),(Eh=new ss(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Fa(Sh,new Na({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new wn(Eh,new zt({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,a)}function Lh(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new rn;n.setAttribute("position",new qt(t,3)),n.setAttribute("color",new qt([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new Na({vertexColors:2});Va.call(this,n,i)}function Ph(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ac.call(this,e),this.type="catmullrom"}Ah.prototype=Object.create(Be.prototype),Ah.prototype.constructor=Ah,Ah.prototype.setDirection=function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Th.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Th,t)}},Ah.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Ah.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Ah.prototype.copy=function(e){return Be.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Ah.prototype.clone=function(){return(new this.constructor).copy(this)},Lh.prototype=Object.create(Va.prototype),Lh.prototype.constructor=Lh,Qs.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Qs.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(vc.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Pn,n=0,i=e.length;n<i;n++){var r=e[n];t.vertices.push(new re(r.x,r.y,r.z||0))}return t}}),Object.assign(yc.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(ac.prototype),Object.create(ac.prototype),Ph.prototype=Object.create(ac.prototype),Object.assign(Ph.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),ah.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ql.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Hs.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Dc(e)}}),Hs.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.")}},Object.assign(Fc.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(Ol.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(et.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Fl.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign($,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),$.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),$.ceilPowerOfTwo(e)}}),Object.assign(se.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(be.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new re).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,r,a)}}),mt.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},te.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(ut.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Tt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Tt,{barycoordFromPoint:function(e,t,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Tt.getBarycoord(e,t,n,i,r)},normal:function(e,t,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Tt.getNormal(e,t,n,i)}}),Object.assign(xc.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Wo(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ns(this,e)}}),Object.assign(ee.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(re.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ue.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Pn.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(Be.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(Be.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.")}}}),Object.defineProperties(ba.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Ea.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),wa.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Qs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Bn.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(_c.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(Ft.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===Z},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Z)}}}),Object.assign(Ft.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Z:Y),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(rn.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},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 Ft(arguments[1],arguments[2])))},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)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)}}),Object.defineProperties(rn.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}}}),Object.defineProperties(na.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Z},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(na.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Z:Y),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(jo.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Rl.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Ut.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 Rt}},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}}}),Object.defineProperties(vs.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(zn.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}}}),Object.assign($r.prototype,{clearTarget:function(e,t,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties($r.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()}}}),Object.defineProperties(Br.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(Hn.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),Object.defineProperties(de.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}}}),Object.defineProperties(Qr.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),Object.defineProperties(cl.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Zc).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),fl.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Vn.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},ce.crossOrigin=void 0,ce.loadTexture=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Js;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},ce.loadTextureCube=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Zs;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},ce.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ce.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:"111"}}))},8093:(e,t,n)=>{n.d(t,{s:()=>s});var i=n(9882),r=n(3893),a=n(7022),o=n(6055),s=function(e,t){if(this.renderer=e,void 0===t){var n={minFilter:i.k6q,magFilter:i.k6q,format:i.GWd,stencilBuffer:!1},o=e.getSize(new i.I9Y);this._pixelRatio=e.getPixelRatio(),this._width=o.width,this._height=o.height,(t=new i.nWS(this._width*this._pixelRatio,this._height*this._pixelRatio,n)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===r.Z&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===a.p&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new a.p(r.Z),this.clock=new i.zD7};Object.assign(s.prototype,{swapBuffers:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e},addPass:function(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},insertPass:function(e,t){this.passes.splice(t,0,e)},isLastEnabledPass:function(e){for(var t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0},render:function(e){void 0===e&&(e=this.clock.getDelta());var t,n,i=this.renderer.getRenderTarget(),r=!1,a=this.passes.length;for(n=0;n<a;n++)if(!1!==(t=this.passes[n]).enabled){if(t.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(n),t.render(this.renderer,this.writeBuffer,this.readBuffer,e,r),t.needsSwap){if(r){var s=this.renderer.getContext(),c=this.renderer.state.buffers.stencil;c.setFunc(s.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),c.setFunc(s.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==o.e&&(t instanceof o.e?r=!0:t instanceof o.t&&(r=!1))}this.renderer.setRenderTarget(i)},reset:function(e){if(void 0===e){var t=this.renderer.getSize(new i.I9Y);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(e,t){this._width=e,this._height=t;var n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(var r=0;r<this.passes.length;r++)this.passes[r].setSize(n,i)},setPixelRatio:function(e){this._pixelRatio=e,this.setSize(this._width,this._height)}});var c,l,h,u=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(u.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),u.FullScreenQuad=(c=new i.qUd(-1,1,1,-1,0,1),l=new i.pxj(2,2),h=function(e){this._mesh=new i.eaF(l,e)},Object.defineProperty(h.prototype,"material",{get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}),Object.assign(h.prototype,{render:function(e){e.render(this._mesh,c)}}),h)},6055:(e,t,n)=>{n.d(t,{e:()=>r,t:()=>a});var i=n(8299),r=function(e,t){i.o.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1};r.prototype=Object.assign(Object.create(i.o.prototype),{constructor:r,render:function(e,t,n){var i,r,a=e.getContext(),o=e.state;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(i=0,r=1):(i=1,r=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),o.buffers.stencil.setFunc(a.ALWAYS,i,4294967295),o.buffers.stencil.setClear(r),o.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(a.EQUAL,1,4294967295),o.buffers.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),o.buffers.stencil.setLocked(!0)}});var a=function(){i.o.call(this),this.needsSwap=!1};a.prototype=Object.create(i.o.prototype),Object.assign(a.prototype,{render:function(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}})},8299:(e,t,n)=>{n.d(t,{o:()=>s});var i,r,a,o=n(9882);function s(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign(s.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),s.FullScreenQuad=(i=new o.qUd(-1,1,1,-1,0,1),r=new o.pxj(2,2),a=function(e){this._mesh=new o.eaF(r,e)},Object.defineProperty(a.prototype,"material",{get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}),Object.assign(a.prototype,{render:function(e){e.render(this._mesh,i)}}),a)},7022:(e,t,n)=>{n.d(t,{p:()=>a});var i=n(9882),r=n(8299),a=function(e,t){r.o.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof i.BKk?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=i.LlO.clone(e.uniforms),this.material=new i.BKk({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new r.o.FullScreenQuad(this.material)};a.prototype=Object.assign(Object.create(r.o.prototype),{constructor:a,render:function(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}})},3893:(e,t,n)=>{n.d(t,{Z:()=>i});var i={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")}},7449:(e,t,n)=>{n.d(t,{n:()=>r});var i=n(178);function r(e){i.u.call(this),this.cameras=e||[]}r.prototype=Object.assign(Object.create(i.u.prototype),{constructor:r,isArrayCamera:!0})},1180:(e,t,n)=>{n.d(t,{i:()=>o});var i=n(2612),r=n(892),a=n(2547);function o(){r.B.call(this),this.type="Camera",this.matrixWorldInverse=new i.k,this.projectionMatrix=new i.k,this.projectionMatrixInverse=new i.k}o.prototype=Object.assign(Object.create(r.B.prototype),{constructor:o,isCamera:!0,copy:function(e,t){return r.B.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new a.P),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){r.B.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}})},5358:(e,t,n)=>{n.d(t,{q:()=>a});var i=n(1180),r=n(892);function a(e,t,n,r,a,o){i.i.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==a?a:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}a.prototype=Object.assign(Object.create(i.i.prototype),{constructor:a,isOrthographicCamera:!0,copy:function(e,t){return i.i.prototype.copy.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},setViewOffset:function(e,t,n,i,r,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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e,a=n+e,o=i+t,s=i-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;a=(r+=h*(this.view.offsetX/c))+h*(this.view.width/c),s=(o-=u*(this.view.offsetY/l))-u*(this.view.height/l)}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=r.B.prototype.toJSON.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}})},178:(e,t,n)=>{n.d(t,{u:()=>o});var i=n(1180),r=n(892),a=n(5369);function o(e,t,n,r){i.i.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}o.prototype=Object.assign(Object.create(i.i.prototype),{constructor:o,isPerspectiveCamera:!0,copy:function(e,t){return i.i.prototype.copy.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},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*a.q.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*a.q.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*a.q.RAD2DEG*Math.atan(Math.tan(.5*a.q.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,i,r,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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*a.q.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){var s=o.fullWidth,c=o.fullHeight;r+=o.offsetX*i/s,t-=o.offsetY*n/c,i*=o.width/s,n*=o.height/c}var l=this.filmOffset;0!==l&&(r+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=r.B.prototype.toJSON.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}})},2709:(e,t,n)=>{n.d(t,{$EB:()=>d,$_I:()=>ye,$ei:()=>A,BXX:()=>He,B_h:()=>Ze,CMB:()=>Oe,CVz:()=>Xe,Cfg:()=>me,EZo:()=>x,EdD:()=>b,FQJ:()=>gt,FV:()=>te,FXf:()=>S,GFA:()=>le,GJx:()=>he,GWd:()=>De,Gwm:()=>W,HIg:()=>Ne,HXV:()=>je,IE4:()=>Be,IV1:()=>p,JcV:()=>yt,Jnc:()=>o,K52:()=>j,KRh:()=>Y,Kwu:()=>_,Kzv:()=>Ie,LiQ:()=>C,MC9:()=>ft,Mjd:()=>K,N5j:()=>_t,NTi:()=>y,Nt7:()=>O,Nz6:()=>Ge,O49:()=>lt,OUM:()=>xe,Om:()=>ce,OuU:()=>D,QP0:()=>s,Qrf:()=>Ke,RJ4:()=>ct,RQf:()=>Ee,Rkk:()=>xt,RyA:()=>l,S$4:()=>st,S2Q:()=>dt,TdS:()=>se,U3G:()=>k,UTZ:()=>ne,V3x:()=>Re,VT0:()=>Fe,VVr:()=>Mt,Vb5:()=>a,WNZ:()=>r,Wew:()=>Ae,Wk7:()=>c,XIg:()=>v,XrR:()=>Z,Yuy:()=>Me,_QJ:()=>tt,a5J:()=>et,a9W:()=>f,aEY:()=>z,agE:()=>Et,bC7:()=>rt,bCz:()=>w,bI3:()=>bt,bbI:()=>mt,big:()=>pt,bkx:()=>Se,brA:()=>V,bw0:()=>q,cHt:()=>we,caT:()=>X,czI:()=>Je,dcC:()=>ze,eHc:()=>B,f4X:()=>R,fBL:()=>be,gJ2:()=>Le,gO9:()=>M,ghU:()=>ue,h9m:()=>$,hB5:()=>h,hdd:()=>I,hgQ:()=>F,hsX:()=>u,hxR:()=>pe,hy7:()=>ie,ie2:()=>N,ix0:()=>Te,jR7:()=>Ve,k6Q:()=>ke,k6q:()=>ge,kBv:()=>i,kRr:()=>ve,kTW:()=>de,kTp:()=>We,kyO:()=>Q,lGu:()=>G,lyL:()=>it,mop:()=>m,nNL:()=>ee,nST:()=>E,ojh:()=>L,ojs:()=>ot,pBf:()=>qe,pHI:()=>fe,psI:()=>$e,qa3:()=>Ye,qad:()=>P,rSH:()=>Qe,rYR:()=>ht,sKt:()=>St,tJf:()=>_e,tgE:()=>ut,uB5:()=>nt,uV5:()=>oe,upd:()=>Pe,vCm:()=>g,vyJ:()=>wt,wfO:()=>ae,wn6:()=>U,wrO:()=>Ce,xFO:()=>re,xSv:()=>H,y3Z:()=>at,y_p:()=>J,z9p:()=>vt,zdS:()=>Ue,znC:()=>T});var i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},r=0,a=1,o=2,s=1,c=2,l=3,h=0,u=1,d=2,p=1,f=0,m=1,g=2,v=0,y=1,x=2,_=3,b=4,w=5,M=100,S=101,E=102,T=103,A=104,L=200,P=201,R=202,C=203,N=204,D=205,I=206,O=207,U=208,z=209,F=210,B=0,G=1,V=2,H=3,k=4,W=5,j=6,q=7,X=0,Y=1,Z=2,J=0,Q=1,K=2,$=3,ee=4,te=5,ne=300,ie=301,re=302,ae=303,oe=304,se=305,ce=306,le=307,he=1e3,ue=1001,de=1002,pe=1003,fe=1004,me=1005,ge=1006,ve=1007,ye=1008,xe=1009,_e=1010,be=1011,we=1012,Me=1013,Se=1014,Ee=1015,Te=1016,Ae=1017,Le=1018,Pe=1019,Re=1020,Ce=1021,Ne=1022,De=1023,Ie=1024,Oe=1025,Ue=1026,ze=1027,Fe=1028,Be=33776,Ge=33777,Ve=33778,He=33779,ke=35840,We=35841,je=35842,qe=35843,Xe=36196,Ye=37808,Ze=37809,Je=37810,Qe=37811,Ke=37812,$e=37813,et=37814,tt=37815,nt=37816,it=37817,rt=37818,at=37819,ot=37820,st=37821,ct=0,lt=1,ht=2,ut=3e3,dt=3001,pt=3007,ft=3002,mt=3003,gt=3004,vt=3005,yt=3006,xt=3200,_t=3201,bt=0,wt=1,Mt=7680,St=519,Et=35044},2120:(e,t,n)=>{n.d(t,{A$:()=>p,MW:()=>m,TH:()=>c,qt:()=>g});var i=n(2506),r=n(2547),a=n(6460),o=n(4036),s=n(2709);function c(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=s.agE,this.updateRange={offset:0,count:-1},this.version=0}function l(e,t,n){c.call(this,new Int8Array(e),t,n)}function h(e,t,n){c.call(this,new Uint8Array(e),t,n)}function u(e,t,n){c.call(this,new Uint8ClampedArray(e),t,n)}function d(e,t,n){c.call(this,new Int16Array(e),t,n)}function p(e,t,n){c.call(this,new Uint16Array(e),t,n)}function f(e,t,n){c.call(this,new Int32Array(e),t,n)}function m(e,t,n){c.call(this,new Uint32Array(e),t,n)}function g(e,t,n){c.call(this,new Float32Array(e),t,n)}function v(e,t,n){c.call(this,new Float64Array(e),t,n)}Object.defineProperty(c.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(c.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy: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},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new o.Q),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var o=e[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new a.I),t[n++]=o.x,t[n++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,i=0,a=e.length;i<a;i++){var o=e[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new r.P),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,a=e.length;r<a;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new i.I),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n++]=o.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),l.prototype=Object.create(c.prototype),l.prototype.constructor=l,h.prototype=Object.create(c.prototype),h.prototype.constructor=h,u.prototype=Object.create(c.prototype),u.prototype.constructor=u,d.prototype=Object.create(c.prototype),d.prototype.constructor=d,p.prototype=Object.create(c.prototype),p.prototype.constructor=p,f.prototype=Object.create(c.prototype),f.prototype.constructor=f,m.prototype=Object.create(c.prototype),m.prototype.constructor=m,g.prototype=Object.create(c.prototype),g.prototype.constructor=g,v.prototype=Object.create(c.prototype),v.prototype.constructor=v},4918:(e,t,n)=>{n.d(t,{L:()=>b});var i=n(2547),r=n(2225),a=n(6491),o=n(2120),s=n(2486),c=n(1209),l=n(892),h=n(2612),u=n(7681),d=n(5369),p=n(2521),f=1,m=new h.k,g=new l.B,v=new i.P,y=new r.N,x=new r.N,_=new i.P;function b(){Object.defineProperty(this,"id",{value:f+=2}),this.uuid=d.q.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}b.prototype=Object.assign(Object.create(a.Q.prototype),{constructor:b,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new((0,p._)(e)>65535?o.MW:o.A$)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new u.d).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);var i=this.attributes.tangent;return void 0!==i&&((new u.d).getNormalMatrix(e).applyToBufferAttribute(i),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return m.makeRotationX(e),this.applyMatrix(m),this},rotateY:function(e){return m.makeRotationY(e),this.applyMatrix(m),this},rotateZ:function(e){return m.makeRotationZ(e),this.applyMatrix(m),this},translate:function(e,t,n){return m.makeTranslation(e,t,n),this.applyMatrix(m),this},scale:function(e,t,n){return m.makeScale(e,t,n),this.applyMatrix(m),this},lookAt:function(e){return g.lookAt(e),g.updateMatrix(),this.applyMatrix(g.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(v).negate(),this.translate(v.x,v.y,v.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new o.qt(3*t.vertices.length,3),i=new o.qt(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",i.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var r=new o.qt(t.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new o.qt(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new c.k).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new o.TH(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new o.TH(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(3*e.colors.length);this.setAttribute("color",new o.TH(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var r=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new o.TH(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new o.TH(a,2).copyVector2sArray(e.uvs2))}for(var s in this.groups=e.groups,e.morphTargets){for(var c=[],l=e.morphTargets[s],h=0,u=l.length;h<u;h++){var d=l[h],p=new o.qt(3*d.data.length,3);p.name=d.name,c.push(p.copyVector3sArray(d.data))}this.morphAttributes[s]=c}if(e.skinIndices.length>0){var f=new o.qt(4*e.skinIndices.length,4);this.setAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new o.qt(4*e.skinWeights.length,4);this.setAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new r.N);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,i=t.length;n<i;n++){var a=t[n];y.setFromBufferAttribute(a),this.morphTargetsRelative?(_.addVectors(this.boundingBox.min,y.min),this.boundingBox.expandByPoint(_),_.addVectors(this.boundingBox.max,y.max),this.boundingBox.expandByPoint(_)):(this.boundingBox.expandByPoint(y.min),this.boundingBox.expandByPoint(y.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new s.i);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(y.setFromBufferAttribute(e),t)for(var i=0,r=t.length;i<r;i++){var a=t[i];x.setFromBufferAttribute(a),this.morphTargetsRelative?(_.addVectors(y.min,x.min),y.expandByPoint(_),_.addVectors(y.max,x.max),y.expandByPoint(_)):(y.expandByPoint(x.min),y.expandByPoint(x.max))}y.getCenter(n);var o=0;for(i=0,r=e.count;i<r;i++)_.fromBufferAttribute(e,i),o=Math.max(o,n.distanceToSquared(_));if(t)for(i=0,r=t.length;i<r;i++){a=t[i];for(var c=this.morphTargetsRelative,l=0,h=a.count;l<h;l++)_.fromBufferAttribute(a,l),c&&(v.fromBufferAttribute(e,l),_.add(v)),o=Math.max(o,n.distanceToSquared(_))}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)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new o.TH(new Float32Array(n.length),3));else for(var r=t.normal.array,a=0,s=r.length;a<s;a++)r[a]=0;var c,l,h,u=t.normal.array,d=new i.P,p=new i.P,f=new i.P,m=new i.P,g=new i.P;if(e){var v=e.array;for(a=0,s=e.count;a<s;a+=3)c=3*v[a+0],l=3*v[a+1],h=3*v[a+2],d.fromArray(n,c),p.fromArray(n,l),f.fromArray(n,h),m.subVectors(f,p),g.subVectors(d,p),m.cross(g),u[c]+=m.x,u[c+1]+=m.y,u[c+2]+=m.z,u[l]+=m.x,u[l+1]+=m.y,u[l+2]+=m.z,u[h]+=m.x,u[h+1]+=m.y,u[h+2]+=m.z}else for(a=0,s=n.length;a<s;a+=9)d.fromArray(n,a),p.fromArray(n,a+3),f.fromArray(n,a+6),m.subVectors(f,p),g.subVectors(d,p),m.cross(g),u[a]=m.x,u[a+1]=m.y,u[a+2]=m.z,u[a+3]=m.x,u[a+4]=m.y,u[a+5]=m.z,u[a+6]=m.x,u[a+7]=m.y,u[a+8]=m.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge: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 i in n)if(void 0!==e.attributes[i])for(var r=n[i].array,a=e.attributes[i],o=a.array,s=a.itemSize*t,c=Math.min(o.length,r.length-s),l=0,h=s;l<c;l++,h++)r[h]=o[l];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)_.x=e.getX(t),_.y=e.getY(t),_.z=e.getZ(t),_.normalize(),e.setXYZ(t,_.x,_.y,_.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,i=e.itemSize,r=new n.constructor(t.length*i),a=0,s=0,c=0,l=t.length;c<l;c++){a=t[c]*i;for(var h=0;h<i;h++)r[s++]=n[a++]}return new o.TH(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new b,n=this.index.array,i=this.attributes;for(var r in i){var a=e(i[r],n);t.setAttribute(r,a)}var s=this.morphAttributes;for(r in s){for(var c=[],l=s[r],h=0,u=l.length;h<u;h++)a=e(l[h],n),c.push(a);t.morphAttributes[r]=c}t.morphTargetsRelative=this.morphTargetsRelative;for(var d=this.groups,p=(h=0,d.length);h<p;h++){var f=d[h];t.addGroup(f.start,f.count,f.materialIndex)}return t},toJSON: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),Object.keys(this.userData).length>0&&(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 i=this.index;null!==i&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a=(d=r[n]).toJSON();""!==d.name&&(a.name=d.name),e.data.attributes[n]=a}var o={},s=!1;for(var n in this.morphAttributes){for(var c=this.morphAttributes[n],l=[],h=0,u=c.length;h<u;h++){var d;a=(d=c[h]).toJSON(),""!==d.name&&(a.name=d.name),l.push(a)}l.length>0&&(o[n]=l,s=!0)}s&&(e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative);var p=this.groups;p.length>0&&(e.data.groups=JSON.parse(JSON.stringify(p)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new b).copy(this)},copy:function(e){var t,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone());var a=e.attributes;for(t in a){var o=a[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,i=l.length;n<i;n++)c.push(l[n].clone());this.morphAttributes[t]=c}this.morphTargetsRelative=e.morphTargetsRelative;var h=e.groups;for(n=0,i=h.length;n<i;n++){var u=h[n];this.addGroup(u.start,u.count,u.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=e.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}})},1420:(e,t,n)=>{function i(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}n.d(t,{z:()=>i}),Object.assign(i.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}})},1209:(e,t,n)=>{n.d(t,{k:()=>r});var i=n(6460);function r(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}Object.assign(r.prototype,{computeGroups:function(e){for(var t,n=[],i=void 0,r=e.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==i&&(i=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:i})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,a=e.faceVertexUvs,o=a[0]&&a[0].length>0,s=a[1]&&a[1].length>0,c=e.morphTargets,l=c.length;if(l>0){t=[];for(var h=0;h<l;h++)t[h]={name:c[h].name,data:[]};this.morphTargets.position=t}var u,d=e.morphNormals,p=d.length;if(p>0){for(u=[],h=0;h<p;h++)u[h]={name:d[h].name,data:[]};this.morphTargets.normal=u}var f=e.skinIndices,m=e.skinWeights,g=f.length===r.length,v=m.length===r.length;for(r.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),h=0;h<n.length;h++){var y=n[h];this.vertices.push(r[y.a],r[y.b],r[y.c]);var x=y.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var _=y.normal;this.normals.push(_,_,_)}var b,w=y.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var M=y.color;this.colors.push(M,M,M)}!0===o&&(void 0!==(b=a[0][h])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new i.I,new i.I,new i.I))),!0===s&&(void 0!==(b=a[1][h])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new i.I,new i.I,new i.I)));for(var S=0;S<l;S++){var E=c[S].vertices;t[S].data.push(E[y.a],E[y.b],E[y.c])}for(S=0;S<p;S++){var T=d[S].vertexNormals[h];u[S].data.push(T.a,T.b,T.c)}g&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),v&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}})},6491:(e,t,n)=>{function i(){}n.d(t,{Q:()=>i}),Object.assign(i.prototype,{addEventListener: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)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}},dispatchEvent: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),i=0,r=n.length;i<r;i++)n[i].call(this,e)}}}})},4632:(e,t,n)=>{n.d(t,{n:()=>a});var i=n(4036),r=n(2547);function a(e,t,n,a,o,s){this.a=e,this.b=t,this.c=n,this.normal=a&&a.isVector3?a:new r.P,this.vertexNormals=Array.isArray(a)?a:[],this.color=o&&o.isColor?o:new i.Q,this.vertexColors=Array.isArray(o)?o:[],this.materialIndex=void 0!==s?s:0}Object.assign(a.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}})},432:(e,t,n)=>{n.d(t,{V:()=>y});var i=n(6491),r=n(4632),a=n(7681),o=n(2486),s=n(2225),c=n(2547),l=n(2612),h=n(6460),u=n(4036),d=n(892),p=n(5369),f=0,m=new l.k,g=new d.B,v=new c.P;function y(){Object.defineProperty(this,"id",{value:f+=2}),this.uuid=p.q.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}y.prototype=Object.assign(Object.create(i.Q.prototype),{constructor:y,isGeometry:!0,applyMatrix:function(e){for(var t=(new a.d).getNormalMatrix(e),n=0,i=this.vertices.length;n<i;n++)this.vertices[n].applyMatrix4(e);for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(t).normalize();for(var o=0,s=r.vertexNormals.length;o<s;o++)r.vertexNormals[o].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return m.makeRotationX(e),this.applyMatrix(m),this},rotateY:function(e){return m.makeRotationY(e),this.applyMatrix(m),this},rotateZ:function(e){return m.makeRotationZ(e),this.applyMatrix(m),this},translate:function(e,t,n){return m.makeTranslation(e,t,n),this.applyMatrix(m),this},scale:function(e,t,n){return m.makeScale(e,t,n),this.applyMatrix(m),this},lookAt:function(e){return g.lookAt(e),g.updateMatrix(),this.applyMatrix(g.matrix),this},fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,i=e.attributes;if(void 0===i.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var a=i.position.array,o=void 0!==i.normal?i.normal.array:void 0,s=void 0!==i.color?i.color.array:void 0,l=void 0!==i.uv?i.uv.array:void 0,d=void 0!==i.uv2?i.uv2.array:void 0;void 0!==d&&(this.faceVertexUvs[1]=[]);for(var p=0;p<a.length;p+=3)t.vertices.push((new c.P).fromArray(a,p)),void 0!==s&&t.colors.push((new u.Q).fromArray(s,p));function f(e,n,i,a){var u=void 0===s?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[i].clone()],p=void 0===o?[]:[(new c.P).fromArray(o,3*e),(new c.P).fromArray(o,3*n),(new c.P).fromArray(o,3*i)],f=new r.n(e,n,i,p,u,a);t.faces.push(f),void 0!==l&&t.faceVertexUvs[0].push([(new h.I).fromArray(l,2*e),(new h.I).fromArray(l,2*n),(new h.I).fromArray(l,2*i)]),void 0!==d&&t.faceVertexUvs[1].push([(new h.I).fromArray(d,2*e),(new h.I).fromArray(d,2*n),(new h.I).fromArray(d,2*i)])}var m=e.groups;if(m.length>0)for(p=0;p<m.length;p++)for(var g=m[p],v=g.start,y=v,x=v+g.count;y<x;y+=3)void 0!==n?f(n[y],n[y+1],n[y+2],g.materialIndex):f(y,y+1,y+2,g.materialIndex);else if(void 0!==n)for(p=0;p<n.length;p+=3)f(n[p],n[p+1],n[p+2]);else for(p=0;p<a.length/3;p+=3)f(p,p+1,p+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(v).negate(),this.translate(v.x,v.y,v.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,i=new l.k;return i.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var e=new c.P,t=new c.P,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){var t,n,i,r,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new c.P;if(e){var s,l,h,u=new c.P,d=new c.P;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],s=this.vertices[a.a],l=this.vertices[a.b],h=this.vertices[a.c],u.subVectors(h,l),d.subVectors(s,l),u.cross(d),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)o[(a=this.faces[i]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(i=0,r=this.faces.length;i<r;i++){var p=(a=this.faces[i]).vertexNormals;3===p.length?(p[0].copy(o[a.a]),p[1].copy(o[a.b]),p[2].copy(o[a.c])):(p[0]=o[a.a].clone(),p[1]=o[a.b].clone(),p[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var i=(n=this.faces[e]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;e<t;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var a=new y;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)l=new c.P,h={a:new c.P,b:new c.P,c:new c.P},o.push(l),s.push(h)}var l,h,u=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],l=u.faceNormals[n],h=u.vertexNormals[n],l.copy(r.normal),h.a.copy(r.vertexNormals[0]),h.b.copy(r.vertexNormals[1]),h.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new s.N),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new o.i),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var i,o=this.vertices.length,s=this.vertices,c=e.vertices,l=this.faces,h=e.faces,u=this.colors,d=e.colors;void 0===n&&(n=0),void 0!==t&&(i=(new a.d).getNormalMatrix(t));for(var p=0,f=c.length;p<f;p++){var m=c[p].clone();void 0!==t&&m.applyMatrix4(t),s.push(m)}for(p=0,f=d.length;p<f;p++)u.push(d[p].clone());for(p=0,f=h.length;p<f;p++){var g,v,y,x=h[p],_=x.vertexNormals,b=x.vertexColors;(g=new r.n(x.a+o,x.b+o,x.c+o)).normal.copy(x.normal),void 0!==i&&g.normal.applyMatrix3(i).normalize();for(var w=0,M=_.length;w<M;w++)v=_[w].clone(),void 0!==i&&v.applyMatrix3(i).normalize(),g.vertexNormals.push(v);for(g.color.copy(x.color),w=0,M=b.length;w<M;w++)y=b[w],g.vertexColors.push(y.clone());g.materialIndex=x.materialIndex+n,l.push(g)}for(p=0,f=e.faceVertexUvs.length;p<f;p++){var S=e.faceVertexUvs[p];for(void 0===this.faceVertexUvs[p]&&(this.faceVertexUvs[p]=[]),w=0,M=S.length;w<M;w++){for(var E=S[w],T=[],A=0,L=E.length;A<L;A++)T.push(E[A].clone());this.faceVertexUvs[p].push(T)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,i,r,a,o,s,c={},l=[],h=[],u=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)e=this.vertices[n],void 0===c[t=Math.round(e.x*u)+"_"+Math.round(e.y*u)+"_"+Math.round(e.z*u)]?(c[t]=n,l.push(this.vertices[n]),h[n]=l.length-1):h[n]=h[c[t]];var d=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=h[r.a],r.b=h[r.b],r.c=h[r.c],a=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var i=e[t];this.vertices.push(new c.P(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var i,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];for(a&&a.length===t&&(i=[]),o&&o.length===t&&(r=[]),n=0;n<t;n++){var s=e[n]._id;i&&i.push(a[s]),r&&r.push(o[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var i=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];i.push(a.x,a.y,a.z)}var o=[],s=[],c={},l=[],h={},u=[],d={};for(r=0;r<this.faces.length;r++){var p=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=p.normal.length()>0,g=p.vertexNormals.length>0,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,f),x=M(x,4,m),x=M(x,5,g),x=M(x,6,v),x=M(x,7,y),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var _=this.faceVertexUvs[0][r];o.push(T(_[0]),T(_[1]),T(_[2]))}if(m&&o.push(S(p.normal)),g){var b=p.vertexNormals;o.push(S(b[0]),S(b[1]),S(b[2]))}if(v&&o.push(E(p.color)),y){var w=p.vertexColors;o.push(E(w[0]),E(w[1]),E(w[2]))}}function M(e,t,n){return n?e|1<<t:e&~(1<<t)}function S(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]||(c[t]=s.length/3,s.push(e.x,e.y,e.z)),c[t]}function E(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]||(h[t]=l.length,l.push(e.getHex())),h[t]}function T(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=u.length/2,u.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=i,e.data.normals=s,l.length>0&&(e.data.colors=l),u.length>0&&(e.data.uvs=[u]),e.data.faces=o,e},clone:function(){return(new y).copy(this)},copy:function(e){var t,n,i,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var h=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),i=0,r=h.length;i<r;i++){var u=h[i],d=[];for(a=0,o=u.length;a<o;a++){var p=u[a];d.push(p.clone())}this.faceVertexUvs[t].push(d)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],i=0,r=f[t].vertices.length;i<r;i++)m.vertices.push(f[t].vertices[i].clone());if(void 0!==f[t].normals)for(m.normals=[],i=0,r=f[t].normals.length;i<r;i++)m.normals.push(f[t].normals[i].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var v={};if(void 0!==g[t].vertexNormals)for(v.vertexNormals=[],i=0,r=g[t].vertexNormals.length;i<r;i++){var y=g[t].vertexNormals[i],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[t].faceNormals)for(v.faceNormals=[],i=0,r=g[t].faceNormals.length;i<r;i++)v.faceNormals.push(g[t].faceNormals[i].clone());this.morphNormals.push(v)}var _=e.skinWeights;for(t=0,n=_.length;t<n;t++)this.skinWeights.push(_[t].clone());var b=e.skinIndices;for(t=0,n=b.length;t<n;t++)this.skinIndices.push(b[t].clone());var w=e.lineDistances;for(t=0,n=w.length;t<n;t++)this.lineDistances.push(w[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=e.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}})},3646:(e,t,n)=>{function i(){this.mask=1}n.d(t,{z:()=>i}),Object.assign(i.prototype,{set:function(e){this.mask=1<<e},enable:function(e){this.mask|=1<<e},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e},disable:function(e){this.mask&=~(1<<e)},disableAll:function(){this.mask=0},test:function(e){return!!(this.mask&e.mask)}})},892:(e,t,n)=>{n.d(t,{B:()=>E});var i=n(5543),r=n(2547),a=n(2612),o=n(6491),s=n(4930),c=n(3646),l=n(7681),h=n(5369),u=n(2709),d=0,p=new r.P,f=new i.P,m=new a.k,g=new r.P,v=new r.P,y=new r.P,x=new i.P,_=new r.P(1,0,0),b=new r.P(0,1,0),w=new r.P(0,0,1),M={type:"added"},S={type:"removed"};function E(){Object.defineProperty(this,"id",{value:d++}),this.uuid=h.q.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=E.DefaultUp.clone();var e=new r.P,t=new s.O,n=new i.P,o=new r.P(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:o},modelViewMatrix:{value:new a.k},normalMatrix:{value:new l.d}}),this.matrix=new a.k,this.matrixWorld=new a.k,this.matrixAutoUpdate=E.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new c.z,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}E.DefaultUp=new r.P(0,1,0),E.DefaultMatrixAutoUpdate=!0,E.prototype=Object.assign(Object.create(o.Q.prototype),{constructor:E,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return f.setFromAxisAngle(e,t),this.quaternion.multiply(f),this},rotateOnWorldAxis:function(e,t){return f.setFromAxisAngle(e,t),this.quaternion.premultiply(f),this},rotateX:function(e){return this.rotateOnAxis(_,e)},rotateY:function(e){return this.rotateOnAxis(b,e)},rotateZ:function(e){return this.rotateOnAxis(w,e)},translateOnAxis:function(e,t){return p.copy(e).applyQuaternion(this.quaternion),this.position.add(p.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(_,e)},translateY:function(e){return this.translateOnAxis(b,e)},translateZ:function(e){return this.translateOnAxis(w,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(m.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?g.copy(e):g.set(e,t,n);var i=this.parent;this.updateWorldMatrix(!0,!1),v.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?m.lookAt(v,g,this.up):m.lookAt(g,v,this.up),this.quaternion.setFromRotationMatrix(m),i&&(m.extractRotation(i.matrixWorld),f.setFromRotationMatrix(m),this.quaternion.premultiply(f.inverse()))},add:function(e){if(arguments.length>1){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),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(M)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){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(S)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),m.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),m.multiply(e.parent.matrixWorld)),e.applyMatrix(m),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new r.P),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new i.P),this.updateMatrixWorld(!0),this.matrixWorld.decompose(v,e,y),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new r.P),this.updateMatrixWorld(!0),this.matrixWorld.decompose(v,x,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new r.P),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld: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),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix: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 i=this.children,r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh&&this.drawMode!==u.RJ4&&(i.drawMode=this.drawMode),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.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,c=o.length;s<c;s++){var l=o[s];r(e.shapes,l)}else r(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var h=[];for(s=0,c=this.material.length;s<c;s++)h.push(r(e.materials,this.material[s]));i.material=h}else i.material=r(e.materials,this.material);if(this.children.length>0)for(i.children=[],s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(e).object);if(t){var d=g(e.geometries),p=g(e.materials),f=g(e.textures),m=g(e.images);o=g(e.shapes),d.length>0&&(n.geometries=d),p.length>0&&(n.materials=p),f.length>0&&(n.textures=f),m.length>0&&(n.images=m),o.length>0&&(n.shapes=o)}return n.object=i,n;function g(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),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===t)for(var n=0;n<e.children.length;n++){var i=e.children[n];this.add(i.clone())}return this}})},2914:(e,t,n)=>{n.d(t,{t:()=>r});var i=n(8051);function r(e,t,n,r){this.ray=new i.R(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function a(e,t){return e.distance-t.distance}function o(e,t,n,i){if(!1!==e.visible&&(e.raycast(t,n),!0===i))for(var r=e.children,a=0,s=r.length;a<s;a++)o(r[a],t,n,!0)}Object.assign(r.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var i=n||[];return o(e,this,i,t),i.sort(a),i},intersectObjects:function(e,t,n){var i=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,s=e.length;r<s;r++)o(e[r],this,i,t);return i.sort(a),i}})},918:(e,t,n)=>{var i;n.d(t,{H:()=>r});var r={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===i&&(i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),i.width=e.width,i.height=e.height;var n=i.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=i}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}}},1752:(e,t,n)=>{n.d(t,{i:()=>m,w:()=>g});var i=n(432),r=n(4918),a=n(2120),o=n(2547);function s(e){return s="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},s(e)}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(void 0,r=function(e){if("object"!==s(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===s(r)?r:String(r)),i)}var r}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,n){return t=d(t),function(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){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(){})))}catch(e){return!1}}()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var m=function(e){function t(e,n,i,r,a,o){var s;return h(this,t),(s=u(this,t)).type="BoxGeometry",s.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o},s.fromBufferGeometry(new g(e,n,i,r,a,o)),s.mergeVertices(),s}return p(t,e),l(t)}(i.V),g=function(e){function t(e,n,i,r,s,c){var l;h(this,t),(l=u(this,t)).type="BoxBufferGeometry",l.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:c};var d=l;e=e||1,n=n||1,i=i||1,r=Math.floor(r)||1,s=Math.floor(s)||1,c=Math.floor(c)||1;var p=[],f=[],m=[],g=[],v=0,y=0;function x(e,t,n,i,r,a,s,c,l,h,u){var x,_,b=a/l,w=s/h,M=a/2,S=s/2,E=c/2,T=l+1,A=h+1,L=0,P=0,R=new o.P;for(_=0;_<A;_++){var C=_*w-S;for(x=0;x<T;x++){var N=x*b-M;R[e]=N*i,R[t]=C*r,R[n]=E,f.push(R.x,R.y,R.z),R[e]=0,R[t]=0,R[n]=c>0?1:-1,m.push(R.x,R.y,R.z),g.push(x/l),g.push(1-_/h),L+=1}}for(_=0;_<h;_++)for(x=0;x<l;x++){var D=v+x+T*_,I=v+x+T*(_+1),O=v+(x+1)+T*(_+1),U=v+(x+1)+T*_;p.push(D,I,U),p.push(I,O,U),P+=6}d.addGroup(y,P,u),y+=P,v+=L}return x("z","y","x",-1,-1,i,n,e,c,s,0),x("z","y","x",1,-1,i,n,-e,c,s,1),x("x","z","y",1,1,e,i,n,r,c,2),x("x","z","y",1,-1,e,i,-n,r,c,3),x("x","y","z",1,-1,e,n,i,r,s,4),x("x","y","z",-1,-1,e,n,-i,r,s,5),l.setIndex(p),l.setAttribute("position",new a.qt(f,3)),l.setAttribute("normal",new a.qt(m,3)),l.setAttribute("uv",new a.qt(g,2)),l}return p(t,e),l(t)}(r.L)},2283:(e,t,n)=>{n.d(t,{T:()=>s});var i=n(4918),r=n(2120),a=n(432),o=n(5369);function s(e,t){i.L.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,s,c,l,h=[],u=Math.cos(o.q.DEG2RAD*t),d=[0,0],p={},f=["a","b","c"];e.isBufferGeometry?(l=new a.V).fromBufferGeometry(e):l=e.clone(),l.mergeVertices(),l.computeFaceNormals();for(var m=l.vertices,g=l.faces,v=0,y=g.length;v<y;v++)for(var x=g[v],_=0;_<3;_++)n=x[f[_]],s=x[f[(_+1)%3]],d[0]=Math.min(n,s),d[1]=Math.max(n,s),void 0===p[c=d[0]+","+d[1]]?p[c]={index1:d[0],index2:d[1],face1:v,face2:void 0}:p[c].face2=v;for(c in p){var b=p[c];if(void 0===b.face2||g[b.face1].normal.dot(g[b.face2].normal)<=u){var w=m[b.index1];h.push(w.x,w.y,w.z),w=m[b.index2],h.push(w.x,w.y,w.z)}}this.setAttribute("position",new r.qt(h,3))}s.prototype=Object.create(i.L.prototype),s.prototype.constructor=s},1727:(e,t,n)=>{n.d(t,{b:()=>o,p:()=>s});var i=n(432),r=n(4918),a=n(2120);function o(e,t,n,r){i.V.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new s(e,t,n,r)),this.mergeVertices()}function s(e,t,n,i){r.L.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};var o,s,c=(e=e||1)/2,l=(t=t||1)/2,h=Math.floor(n)||1,u=Math.floor(i)||1,d=h+1,p=u+1,f=e/h,m=t/u,g=[],v=[],y=[],x=[];for(s=0;s<p;s++){var _=s*m-l;for(o=0;o<d;o++){var b=o*f-c;v.push(b,-_,0),y.push(0,0,1),x.push(o/h),x.push(1-s/u)}}for(s=0;s<u;s++)for(o=0;o<h;o++){var w=o+d*s,M=o+d*(s+1),S=o+1+d*(s+1),E=o+1+d*s;g.push(w,M,E),g.push(M,S,E)}this.setIndex(g),this.setAttribute("position",new a.qt(v,3)),this.setAttribute("normal",new a.qt(y,3)),this.setAttribute("uv",new a.qt(x,2))}o.prototype=Object.create(i.V.prototype),o.prototype.constructor=o,s.prototype=Object.create(r.L.prototype),s.prototype.constructor=s},7986:(e,t,n)=>{n.d(t,{$:()=>r});var i=n(9080);function r(e,t){i.v.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}r.prototype=Object.assign(Object.create(i.v.prototype),{constructor:r,isAmbientLight:!0})},870:(e,t,n)=>{n.d(t,{Z:()=>o});var i=n(9080),r=n(7154),a=n(892);function o(e,t){i.v.call(this,e,t),this.type="DirectionalLight",this.position.copy(a.B.DefaultUp),this.updateMatrix(),this.target=new a.B,this.shadow=new r.z}o.prototype=Object.assign(Object.create(i.v.prototype),{constructor:o,isDirectionalLight:!0,copy:function(e){return i.v.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}})},7154:(e,t,n)=>{n.d(t,{z:()=>a});var i=n(2064),r=n(5358);function a(){i.X.call(this,new r.q(-5,5,5,-5,.5,500))}a.prototype=Object.assign(Object.create(i.X.prototype),{constructor:a,isDirectionalLightShadow:!0,updateMatrices:function(e){i.X.prototype.updateMatrices.call(this,e)}})},9080:(e,t,n)=>{n.d(t,{v:()=>a});var i=n(892),r=n(4036);function a(e,t){i.B.call(this),this.type="Light",this.color=new r.Q(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}a.prototype=Object.assign(Object.create(i.B.prototype),{constructor:a,isLight:!0,copy:function(e){return i.B.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=i.B.prototype.toJSON.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}})},2064:(e,t,n)=>{n.d(t,{X:()=>c});var i=n(2612),r=n(6460),a=n(2547),o=n(2506),s=n(2033);function c(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new r.I(512,512),this.map=null,this.mapPass=null,this.matrix=new i.k,this._frustum=new s.P,this._frameExtents=new r.I(1,1),this._viewportCount=1,this._viewports=[new o.I(0,0,1,1)]}Object.assign(c.prototype,{_projScreenMatrix:new i.k,_lightPositionWorld:new a.P,_lookTarget:new a.P,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),r.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(r),t.updateMatrixWorld(),i.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),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}})},7544:(e,t,n)=>{n.d(t,{m:()=>a});var i=n(9228),r=n(4036);function a(e){i.i.call(this),this.type="LineBasicMaterial",this.color=new r.Q(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}a.prototype=Object.create(i.i.prototype),a.prototype.constructor=a,a.prototype.isLineBasicMaterial=!0,a.prototype.copy=function(e){return i.i.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}},9228:(e,t,n)=>{n.d(t,{i:()=>s});var i=n(6491),r=n(2709),a=n(5369),o=0;function s(){Object.defineProperty(this,"id",{value:o++}),this.uuid=a.q.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=r.NTi,this.side=r.hB5,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=r.a9W,this.opacity=1,this.transparent=!1,this.blendSrc=r.ie2,this.blendDst=r.OuU,this.blendEquation=r.gO9,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=r.xSv,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=r.sKt,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=r.VVr,this.stencilZFail=r.VVr,this.stencilZPass=r.VVr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}s.prototype=Object.assign(Object.create(i.Q.prototype),{constructor:s,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===r.IV1;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON: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 i(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}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),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),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.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),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),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==r.NTi&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==r.hB5&&(n.side=this.side),this.vertexColors!==r.a9W&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,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),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var a=i(e.textures),o=i(e.images);a.length>0&&(n.textures=a),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var i=t.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=t[r].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.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(s.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}})},4773:(e,t,n)=>{n.d(t,{V:()=>o});var i=n(9228),r=n(2709),a=n(4036);function o(e){i.i.call(this),this.type="MeshBasicMaterial",this.color=new a.Q(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=r.caT,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}o.prototype=Object.create(i.i.prototype),o.prototype.constructor=o,o.prototype.isMeshBasicMaterial=!0,o.prototype.copy=function(e){return i.i.prototype.copy.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this}},3878:(e,t,n)=>{n.d(t,{C:()=>a});var i=n(9228),r=n(2709);function a(e){i.i.call(this),this.type="MeshDepthMaterial",this.depthPacking=r.Rkk,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}a.prototype=Object.create(i.i.prototype),a.prototype.constructor=a,a.prototype.isMeshDepthMaterial=!0,a.prototype.copy=function(e){return i.i.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},8454:(e,t,n)=>{n.d(t,{a:()=>a});var i=n(9228),r=n(2547);function a(e){i.i.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new r.P,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}a.prototype=Object.create(i.i.prototype),a.prototype.constructor=a,a.prototype.isMeshDistanceMaterial=!0,a.prototype.copy=function(e){return i.i.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},8646:(e,t,n)=>{n.d(t,{G:()=>o});var i=n(9228),r=n(2709),a=n(4036);function o(e){i.i.call(this),this.type="MeshLambertMaterial",this.color=new a.Q(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new a.Q(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=r.caT,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}o.prototype=Object.create(i.i.prototype),o.prototype.constructor=o,o.prototype.isMeshLambertMaterial=!0,o.prototype.copy=function(e){return i.i.prototype.copy.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}},8479:(e,t,n)=>{n.d(t,{D:()=>r});var i=n(7757);function r(e){i.B.call(this,e),this.type="RawShaderMaterial"}r.prototype=Object.create(i.B.prototype),r.prototype.constructor=r,r.prototype.isRawShaderMaterial=!0},7757:(e,t,n)=>{n.d(t,{B:()=>s});var i=n(9228),r=n(5572),a=n(3697),o=n(6511);function s(e){i.i.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=a.A,this.fragmentShader=o.A,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}s.prototype=Object.create(i.i.prototype),s.prototype.constructor=s,s.prototype.isShaderMaterial=!0,s.prototype.copy=function(e){return i.i.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=(0,r.lx)(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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},s.prototype.toJSON=function(e){var t=i.i.prototype.toJSON.call(this,e);for(var n in 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}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var a={};for(var o in this.extensions)!0===this.extensions[o]&&(a[o]=!0);return Object.keys(a).length>0&&(t.extensions=a),t}},2225:(e,t,n)=>{n.d(t,{N:()=>v});var i=n(2547),r=[new i.P,new i.P,new i.P,new i.P,new i.P,new i.P,new i.P,new i.P],a=new i.P,o=new v,s=new i.P,c=new i.P,l=new i.P,h=new i.P,u=new i.P,d=new i.P,p=new i.P,f=new i.P,m=new i.P,g=new i.P;function v(e,t){this.min=void 0!==e?e:new i.P(1/0,1/0,1/0),this.max=void 0!==t?t:new i.P(-1/0,-1/0,-1/0)}function y(e,t,n,i,r){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){g.fromArray(e,a);var s=r.x*Math.abs(g.x)+r.y*Math.abs(g.y)+r.z*Math.abs(g.z),c=t.dot(g),l=n.dot(g),h=i.dot(g);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>s)return!1}return!0}Object.assign(v.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],h=e[s+1],u=e[s+2];l<t&&(t=l),h<n&&(n=h),u<i&&(i=u),l>r&&(r=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),h=e.getY(s),u=e.getZ(s);l<t&&(t=l),h<n&&(n=h),u<i&&(i=u),l>r&&(r=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=a.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty: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},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new i.P),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new i.P),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),o.copy(t.boundingBox),o.applyMatrix4(e.matrixWorld),this.expandByPoint(o.min),this.expandByPoint(o.max));for(var n=e.children,i=0,r=n.length;i<r;i++)this.expandByObject(n[i]);return this},containsPoint: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)},containsBox: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},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new i.P),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox: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)},intersectsSphere:function(e){return this.clampPoint(e.center,a),a.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(p),f.subVectors(this.max,p),s.subVectors(e.a,p),c.subVectors(e.b,p),l.subVectors(e.c,p),h.subVectors(c,s),u.subVectors(l,c),d.subVectors(s,l);var t=[0,-h.z,h.y,0,-u.z,u.y,0,-d.z,d.y,h.z,0,-h.x,u.z,0,-u.x,d.z,0,-d.x,-h.y,h.x,0,-u.y,u.x,0,-d.y,d.x,0];return!!y(t,s,c,l,f)&&!!y(t=[1,0,0,0,1,0,0,0,1],s,c,l,f)&&(m.crossVectors(h,u),y(t=[m.x,m.y,m.z],s,c,l,f))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new i.P),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return a.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(a).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()||(r[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),r[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),r[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),r[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),r[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),r[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),r[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),r[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(r)),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}})},4036:(e,t,n)=>{n.d(t,{Q:()=>s});var i=n(5369),r={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},a={h:0,s:0,l:0},o={h:0,s:0,l:0};function s(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function c(e,t,n){return n<0&&(n+=1),n>1&&(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 l(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function h(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}Object.assign(s.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex: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},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=i.q.euclideanModulo(e,1),t=i.q.clamp(t,0,1),n=i.q.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=c(a,r,e+1/3),this.g=c(a,r,e),this.b=c(a,r,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=n[1],h=l.length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=r[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=l(e.r),this.g=l(e.g),this.b=l(e.b),this},copyLinearToSRGB:function(e){return this.r=h(e.r),this.g=h(e.g),this.b=h(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),c=(s+o)/2;if(s===o)t=0,n=0;else{var l=o-s;switch(n=c<=.5?l/(o+s):l/(2-o-s),o){case i:t=(r-a)/l+(r<a?6:0);break;case r:t=(a-i)/l+2;break;case a:t=(i-r)/l+4}t/=6}return e.h=t,e.s=n,e.l=c,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(a),a.h+=e,a.s+=t,a.l+=n,this.setHSL(a.h,a.s,a.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub: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},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp: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},lerpHSL:function(e,t){this.getHSL(a),e.getHSL(o);var n=i.q.lerp(a.h,o.h,t),r=i.q.lerp(a.s,o.s,t),s=i.q.lerp(a.l,o.l,t);return this.setHSL(n,r,s),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),s.NAMES=r},8463:(e,t,n)=>{function i(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}n.d(t,{h:()=>i}),Object.assign(i.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}})},4930:(e,t,n)=>{n.d(t,{O:()=>l});var i=n(5543),r=n(2547),a=n(2612),o=n(5369),s=new a.k,c=new i.P;function l(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||l.DefaultOrder}l.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],l.DefaultOrder="XYZ",Object.defineProperties(l.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(l.prototype,{isEuler:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=o.q.clamp,r=e.elements,a=r[0],s=r[4],c=r[8],l=r[1],h=r[5],u=r[9],d=r[2],p=r[6],f=r[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(i(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(p,h),this._z=0)):"YXZ"===t?(this._x=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(c,f),this._z=Math.atan2(l,h)):(this._y=Math.atan2(-d,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===t?(this._y=Math.asin(-i(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,f),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,h))):"YZX"===t?(this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,h),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(c,f))):"XZY"===t?(this._z=Math.asin(-i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,h),this._y=Math.atan2(c,a)):(this._x=Math.atan2(-u,f),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return s.makeRotationFromQuaternion(e),this.setFromRotationMatrix(s,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return c.setFromEuler(this),this.setFromQuaternion(c,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray: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},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new r.P(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}})},2033:(e,t,n)=>{n.d(t,{P:()=>c});var i=n(2547),r=n(2486),a=n(6181),o=new r.i,s=new i.P;function c(e,t,n,i,r,o){this.planes=[void 0!==e?e:new a.Z,void 0!==t?t:new a.Z,void 0!==n?n:new a.Z,void 0!==i?i:new a.Z,void 0!==r?r:new a.Z,void 0!==o?o:new a.Z]}Object.assign(c.prototype,{set:function(e,t,n,i,r,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-i,h-s,f-u,y-m).normalize(),t[1].setComponents(o+i,h+s,f+u,y+m).normalize(),t[2].setComponents(o+r,h+c,f+d,y+g).normalize(),t[3].setComponents(o-r,h-c,f-d,y-g).normalize(),t[4].setComponents(o-a,h-l,f-p,y-v).normalize(),t[5].setComponents(o+a,h+l,f+p,y+v).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),o.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(o)},intersectsSprite:function(e){return o.center.set(0,0,0),o.radius=.7071067811865476,o.applyMatrix4(e.matrixWorld),this.intersectsSphere(o)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,i=-e.radius,r=0;r<6;r++)if(t[r].distanceToPoint(n)<i)return!1;return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var i=t[n];if(s.x=i.normal.x>0?e.max.x:e.min.x,s.y=i.normal.y>0?e.max.y:e.min.y,s.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(s)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}})},6096:(e,t,n)=>{n.d(t,{c:()=>s});var i=n(2547),r=n(5369),a=new i.P,o=new i.P;function s(e,t){this.start=void 0!==e?e:new i.P,this.end=void 0!==t?t:new i.P}Object.assign(s.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new i.P),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new i.P),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new i.P),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){a.subVectors(e,this.start),o.subVectors(this.end,this.start);var n=o.dot(o),i=o.dot(a)/n;return t&&(i=r.q.clamp(i,0,1)),i},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new i.P),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}})},5369:(e,t,n)=>{n.d(t,{q:()=>a});for(var i=[],r=0;r<256;r++)i[r]=(r<16?"0":"")+r.toString(16);var a={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(i[255&e]+i[e>>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&r]+i[r>>8&255]+i[r>>16&255]+i[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*a.DEG2RAD},radToDeg:function(e){return e*a.RAD2DEG},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}}},7681:(e,t,n)=>{n.d(t,{d:()=>r});var i=new(n(2547).P);function r(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.assign(r.prototype,{isMatrix3:!0,set:function(e,t,n,i,r,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=i,l[2]=o,l[3]=t,l[4]=r,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy: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},setFromMatrix4: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},applyToBufferAttribute:function(e){for(var t=0,n=e.count;t<n;t++)i.x=e.getX(t),i.y=e.getY(t),i.z=e.getZ(t),i.applyMatrix3(this),e.setXYZ(t,i.x,i.y,i.z);return e},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return r[0]=a*f+o*v+s*_,r[3]=a*m+o*y+s*b,r[6]=a*g+o*x+s*w,r[1]=c*f+l*v+h*_,r[4]=c*m+l*y+h*b,r[7]=c*g+l*x+h*w,r[2]=u*f+d*v+p*_,r[5]=u*m+d*y+p*b,r[8]=u*g+d*x+p*w,this},multiplyScalar: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},determinant:function(){var e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*r*l+n*o*s+i*r*c-i*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,i=this.elements,r=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],h=n[6],u=n[7],d=n[8],p=d*c-l*u,f=l*h-d*s,m=u*s-c*h,g=r*p+a*f+o*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return i[0]=p*y,i[1]=(o*u-d*a)*y,i[2]=(l*a-o*c)*y,i[3]=f*y,i[4]=(d*r-o*h)*y,i[5]=(o*s-l*r)*y,i[6]=m*y,i[7]=(a*h-u*r)*y,i[8]=(c*r-a*s)*y,this},transpose: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},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray: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},setUvTransform:function(e,t,n,i,r,a,o){var s=Math.cos(r),c=Math.sin(r);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-i*c,i*s,-i*(-c*a+s*o)+o+t,0,0,1)},scale: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},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],c=i[4],l=i[7];return i[0]=t*r+n*s,i[3]=t*a+n*c,i[6]=t*o+n*l,i[1]=-n*r+t*s,i[4]=-n*a+t*c,i[7]=-n*o+t*l,this},translate: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},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}})},2612:(e,t,n)=>{n.d(t,{k:()=>u});var i=n(2547),r=new i.P,a=new u,o=new i.P(0,0,0),s=new i.P(1,1,1),c=new i.P,l=new i.P,h=new i.P;function u(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(u.prototype,{isMatrix4:!0,set:function(e,t,n,i,r,a,o,s,c,l,h,u,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new u).fromArray(this.elements)},copy: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},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis: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},extractRotation:function(e){var t=this.elements,n=e.elements,i=1/r.setFromMatrixColumn(e,0).length(),a=1/r.setFromMatrixColumn(e,1).length(),o=1/r.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler: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,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){var u=a*l,d=a*h,p=o*l,f=o*h;t[0]=s*l,t[4]=-s*h,t[8]=c,t[1]=d+p*c,t[5]=u-f*c,t[9]=-o*s,t[2]=f-u*c,t[6]=p+d*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,g=s*h,v=c*l,y=c*h;t[0]=m+y*o,t[4]=v*o-g,t[8]=a*c,t[1]=a*h,t[5]=a*l,t[9]=-o,t[2]=g*o-v,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order)m=s*l,g=s*h,v=c*l,y=c*h,t[0]=m-y*o,t[4]=-a*h,t[8]=v+g*o,t[1]=g+v*o,t[5]=a*l,t[9]=y-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s;else if("ZYX"===e.order)u=a*l,d=a*h,p=o*l,f=o*h,t[0]=s*l,t[4]=p*c-d,t[8]=u*c+f,t[1]=s*h,t[5]=f*c+u,t[9]=d*c-p,t[2]=-c,t[6]=o*s,t[10]=a*s;else if("YZX"===e.order){var x=a*s,_=a*c,b=o*s,w=o*c;t[0]=s*l,t[4]=w-x*h,t[8]=b*h+_,t[1]=h,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=_*h+b,t[10]=x-w*h}else"XZY"===e.order&&(x=a*s,_=a*c,b=o*s,w=o*c,t[0]=s*l,t[4]=-h,t[8]=c*l,t[1]=x*h+w,t[5]=a*l,t[9]=_*h-b,t[2]=b*h-_,t[6]=o*l,t[10]=w*h+x);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(o,e,s)},lookAt:function(e,t,n){var i=this.elements;return h.subVectors(e,t),0===h.lengthSq()&&(h.z=1),h.normalize(),c.crossVectors(n,h),0===c.lengthSq()&&(1===Math.abs(n.z)?h.x+=1e-4:h.z+=1e-4,h.normalize(),c.crossVectors(n,h)),c.normalize(),l.crossVectors(h,c),i[0]=c.x,i[4]=l.x,i[8]=h.x,i[1]=c.y,i[5]=l.y,i[9]=h.y,i[2]=c.z,i[6]=l.z,i[10]=h.z,this},multiply: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)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],w=i[4],M=i[8],S=i[12],E=i[1],T=i[5],A=i[9],L=i[13],P=i[2],R=i[6],C=i[10],N=i[14],D=i[3],I=i[7],O=i[11],U=i[15];return r[0]=a*b+o*E+s*P+c*D,r[4]=a*w+o*T+s*R+c*I,r[8]=a*M+o*A+s*C+c*O,r[12]=a*S+o*L+s*N+c*U,r[1]=l*b+h*E+u*P+d*D,r[5]=l*w+h*T+u*R+d*I,r[9]=l*M+h*A+u*C+d*O,r[13]=l*S+h*L+u*N+d*U,r[2]=p*b+f*E+m*P+g*D,r[6]=p*w+f*T+m*R+g*I,r[10]=p*M+f*A+m*C+g*O,r[14]=p*S+f*L+m*N+g*U,r[3]=v*b+y*E+x*P+_*D,r[7]=v*w+y*T+x*R+_*I,r[11]=v*M+y*A+x*C+_*O,r[15]=v*S+y*L+x*N+_*U,this},multiplyScalar: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},applyToBufferAttribute:function(e){for(var t=0,n=e.count;t<n;t++)r.x=e.getX(t),r.y=e.getY(t),r.z=e.getZ(t),r.applyMatrix4(this),e.setXYZ(t,r.x,r.y,r.z);return e},determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*s*h-i*c*h-r*o*u+n*c*u+i*o*d-n*s*d)+e[7]*(+t*s*d-t*c*u+r*a*u-i*a*d+i*c*l-r*s*l)+e[11]*(+t*c*h-t*o*d-r*a*h+n*a*d+r*o*l-n*c*l)+e[15]*(-i*o*l-t*s*h+t*o*u+i*a*h-n*a*u+n*s*l)},transpose: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},setPosition:function(e,t,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this},getInverse:function(e,t){var n=this.elements,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],_=p*y*u-v*f*u+v*h*m-l*y*m-p*h*x+l*f*x,b=g*f*u-d*y*u-g*h*m+c*y*m+d*h*x-c*f*x,w=d*v*u-g*p*u+g*l*m-c*v*m-d*l*x+c*p*x,M=g*p*h-d*v*h-g*l*f+c*v*f+d*l*y-c*p*y,S=r*_+a*b+o*w+s*M;if(0===S){var E="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(E);return console.warn(E),this.identity()}var T=1/S;return n[0]=_*T,n[1]=(v*f*s-p*y*s-v*o*m+a*y*m+p*o*x-a*f*x)*T,n[2]=(l*y*s-v*h*s+v*o*u-a*y*u-l*o*x+a*h*x)*T,n[3]=(p*h*s-l*f*s-p*o*u+a*f*u+l*o*m-a*h*m)*T,n[4]=b*T,n[5]=(d*y*s-g*f*s+g*o*m-r*y*m-d*o*x+r*f*x)*T,n[6]=(g*h*s-c*y*s-g*o*u+r*y*u+c*o*x-r*h*x)*T,n[7]=(c*f*s-d*h*s+d*o*u-r*f*u-c*o*m+r*h*m)*T,n[8]=w*T,n[9]=(g*p*s-d*v*s-g*a*m+r*v*m+d*a*x-r*p*x)*T,n[10]=(c*v*s-g*l*s+g*a*u-r*v*u-c*a*x+r*l*x)*T,n[11]=(d*l*s-c*p*s-d*a*u+r*p*u+c*a*m-r*l*m)*T,n[12]=M*T,n[13]=(d*v*o-g*p*o+g*a*f-r*v*f-d*a*y+r*p*y)*T,n[14]=(g*l*o-c*v*o-g*a*h+r*v*h+c*a*y-r*l*y)*T,n[15]=(c*p*o-d*l*o+d*a*h-r*p*h-c*a*f+r*l*f)*T,this},scale:function(e){var t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this},getMaxScaleOnAxis: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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX: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},makeRotationY: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},makeRotationZ: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},makeRotationAxis:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,c=r*a,l=r*o;return this.set(c*a+n,c*o-i*s,c*s+i*o,0,c*o+i*s,l*o+n,l*s-i*a,0,c*s-i*o,l*s+i*a,r*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,c=r+r,l=a+a,h=o+o,u=r*c,d=r*l,p=r*h,f=a*l,m=a*h,g=o*h,v=s*c,y=s*l,x=s*h,_=n.x,b=n.y,w=n.z;return i[0]=(1-(f+g))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(u+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+y)*w,i[9]=(m-v)*w,i[10]=(1-(u+f))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:function(e,t,n){var i=this.elements,o=r.set(i[0],i[1],i[2]).length(),s=r.set(i[4],i[5],i[6]).length(),c=r.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],a.copy(this);var l=1/o,h=1/s,u=1/c;return a.elements[0]*=l,a.elements[1]*=l,a.elements[2]*=l,a.elements[4]*=h,a.elements[5]*=h,a.elements[6]*=h,a.elements[8]*=u,a.elements[9]*=u,a.elements[10]*=u,t.setFromRotationMatrix(a),n.x=o,n.y=s,n.z=c,this},makePerspective:function(e,t,n,i,r,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*r/(t-e),c=2*r/(n-i),l=(t+e)/(t-e),h=(n+i)/(n-i),u=-(a+r)/(a-r),d=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,i,r,a){var o=this.elements,s=1/(t-e),c=1/(n-i),l=1/(a-r),h=(t+e)*s,u=(n+i)*c,d=(a+r)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}})},6181:(e,t,n)=>{n.d(t,{Z:()=>c});var i=n(7681),r=n(2547),a=new r.P,o=new r.P,s=new i.d;function c(e,t){this.normal=void 0!==e?e:new r.P(1,0,0),this.constant=void 0!==t?t:0}Object.assign(c.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var i=a.subVectors(n,t).cross(o.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new r.P),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new r.P);var n=e.delta(a),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?void 0:t.copy(n).multiplyScalar(o).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new r.P),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||s.getNormalMatrix(e),i=this.coplanarPoint(a).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}})},5543:(e,t,n)=>{n.d(t,{P:()=>r});var i=n(5369);function r(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==i?i:1}Object.assign(r,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,r,a,o){var s=n[i+0],c=n[i+1],l=n[i+2],h=n[i+3],u=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(h!==f||s!==u||c!==d||l!==p){var m=1-o,g=s*u+c*d+l*p+h*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,g*v);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*v;if(s=s*m+u*b,c=c*m+d*b,l=l*m+p*b,h=h*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+c*c+l*l+h*h);s*=w,c*=w,l*=w,h*=w}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=h}}),Object.defineProperties(r.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(r.prototype,{isQuaternion:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler: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,i=e._y,r=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(i/2),h=o(r/2),u=s(n/2),d=s(i/2),p=s(r/2);return"XYZ"===a?(this._x=u*l*h+c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h-u*d*p):"YXZ"===a?(this._x=u*l*h+c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h+u*d*p):"ZXY"===a?(this._x=u*l*h-c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h-u*d*p):"ZYX"===a?(this._x=u*l*h-c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h+u*d*p):"YZX"===a?(this._x=u*l*h+c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h-u*d*p):"XZY"===a&&(this._x=u*l*h-c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h+u*d*p),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],h=n[6],u=n[10],d=i+s+u;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(h-c)*t,this._y=(a-l)*t,this._z=(o-r)*t):i>s&&i>u?(t=2*Math.sqrt(1+i-s-u),this._w=(h-c)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(a+l)/t):s>u?(t=2*Math.sqrt(1+s-i-u),this._w=(a-l)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(c+h)/t):(t=2*Math.sqrt(1+u-i-s),this._w=(o-r)/t,this._x=(a+l)/t,this._y=(c+h)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(i.q.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var i=Math.min(1,t/n);return this.slerp(e,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize: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},multiply: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)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+i*c-r*s,this._y=i*l+a*s+r*o-n*c,this._z=r*l+a*c+n*s-i*o,this._w=a*l-n*o-i*s-r*c,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*e._w+n*e._x+i*e._y+r*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),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-t;return this._w=c*a+t*this._w,this._x=c*n+t*this._x,this._y=c*i+t*this._y,this._z=c*r+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),h=Math.atan2(l,o),u=Math.sin((1-t)*h)/l,d=Math.sin(t*h)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}})},8051:(e,t,n)=>{n.d(t,{R:()=>u});var i=n(2547),r=new i.P,a=new i.P,o=new i.P,s=new i.P,c=new i.P,l=new i.P,h=new i.P;function u(e,t){this.origin=void 0!==e?e:new i.P,this.direction=void 0!==t?t:new i.P(0,0,-1)}Object.assign(u.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new i.P),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,r)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new i.P),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)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=r.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(r.copy(this.direction).multiplyScalar(t).add(this.origin),r.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,i){a.copy(e).add(t).multiplyScalar(.5),o.copy(t).sub(e).normalize(),s.copy(this.origin).sub(a);var r,c,l,h,u=.5*e.distanceTo(t),d=-this.direction.dot(o),p=s.dot(this.direction),f=-s.dot(o),m=s.lengthSq(),g=Math.abs(1-d*d);if(g>0)if(c=d*p-f,h=u*g,(r=d*f-p)>=0)if(c>=-h)if(c<=h){var v=1/g;l=(r*=v)*(r+d*(c*=v)+2*p)+c*(d*r+c+2*f)+m}else c=u,l=-(r=Math.max(0,-(d*c+p)))*r+c*(c+2*f)+m;else c=-u,l=-(r=Math.max(0,-(d*c+p)))*r+c*(c+2*f)+m;else c<=-h?l=-(r=Math.max(0,-(-d*u+p)))*r+(c=r>0?-u:Math.min(Math.max(-u,-f),u))*(c+2*f)+m:c<=h?(r=0,l=(c=Math.min(Math.max(-u,-f),u))*(c+2*f)+m):l=-(r=Math.max(0,-(d*u+p)))*r+(c=r>0?u:Math.min(Math.max(-u,-f),u))*(c+2*f)+m;else c=d>0?-u:u,l=-(r=Math.max(0,-(d*c+p)))*r+c*(c+2*f)+m;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(o).multiplyScalar(c).add(a),l},intersectSphere:function(e,t){r.subVectors(e.center,this.origin);var n=r.dot(this.direction),i=r.dot(r)-n*n,a=e.radius*e.radius;if(i>a)return null;var o=Math.sqrt(a-i),s=n-o,c=n+o;return s<0&&c<0?null:s<0?this.at(c,t):this.at(s,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane: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 n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,i,r,a,o,s,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(n=(e.min.x-u.x)*c,i=(e.max.x-u.x)*c):(n=(e.max.x-u.x)*c,i=(e.min.x-u.x)*c),l>=0?(r=(e.min.y-u.y)*l,a=(e.max.y-u.y)*l):(r=(e.max.y-u.y)*l,a=(e.min.y-u.y)*l),n>a||r>i?null:((r>n||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),h>=0?(o=(e.min.z-u.z)*h,s=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,s=(e.min.z-u.z)*h),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,r)},intersectTriangle:function(e,t,n,i,r){c.subVectors(t,e),l.subVectors(n,e),h.crossVectors(c,l);var a,o=this.direction.dot(h);if(o>0){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}s.subVectors(this.origin,e);var u=a*this.direction.dot(l.crossVectors(s,l));if(u<0)return null;var d=a*this.direction.dot(c.cross(s));if(d<0)return null;if(u+d>o)return null;var p=-a*s.dot(h);return p<0?null:this.at(p/o,r)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}})},2486:(e,t,n)=>{n.d(t,{i:()=>o});var i=n(2225),r=n(2547),a=new i.N;function o(e,t){this.center=void 0!==e?e:new r.P,this.radius=void 0!==t?t:0}Object.assign(o.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):a.setFromPoints(e).getCenter(n);for(var i=0,r=0,o=e.length;r<o;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new r.P),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new i.N),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}})},4520:(e,t,n)=>{n.d(t,{Y:()=>r});var i=n(5369);function r(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}Object.assign(r.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(i.q.clamp(t/this.radius,-1,1))),this}})},1827:(e,t,n)=>{n.d(t,{l:()=>m});var i=n(2547),r=n(6181),a=new i.P,o=new i.P,s=new i.P,c=new i.P,l=new i.P,h=new i.P,u=new i.P,d=new i.P,p=new i.P,f=new i.P;function m(e,t,n){this.a=void 0!==e?e:new i.P,this.b=void 0!==t?t:new i.P,this.c=void 0!==n?n:new i.P}Object.assign(m,{getNormal:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new i.P),r.subVectors(n,t),a.subVectors(e,t),r.cross(a);var o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,c){a.subVectors(r,t),o.subVectors(n,t),s.subVectors(e,t);var l=a.dot(a),h=a.dot(o),u=a.dot(s),d=o.dot(o),p=o.dot(s),f=l*d-h*h;if(void 0===c&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),c=new i.P),0===f)return c.set(-2,-1,-1);var m=1/f,g=(d*u-h*p)*m,v=(l*p-h*u)*m;return c.set(1-g-v,v,g)},containsPoint:function(e,t,n,i){return m.getBarycoord(e,t,n,i,c),c.x>=0&&c.y>=0&&c.x+c.y<=1},getUV:function(e,t,n,i,r,a,o,s){return this.getBarycoord(e,t,n,i,c),s.set(0,0),s.addScaledVector(r,c.x),s.addScaledVector(a,c.y),s.addScaledVector(o,c.z),s},isFrontFacing:function(e,t,n,i){return a.subVectors(n,t),o.subVectors(e,t),a.cross(o).dot(i)<0}}),Object.assign(m.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return a.subVectors(this.c,this.b),o.subVectors(this.a,this.b),.5*a.cross(o).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new i.P),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return m.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new r.Z),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return m.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,i,r){return m.getUV(e,this.a,this.b,this.c,t,n,i,r)},containsPoint:function(e){return m.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return m.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new i.P);var n,r,a=this.a,o=this.b,s=this.c;l.subVectors(o,a),h.subVectors(s,a),d.subVectors(e,a);var c=l.dot(d),m=h.dot(d);if(c<=0&&m<=0)return t.copy(a);p.subVectors(e,o);var g=l.dot(p),v=h.dot(p);if(g>=0&&v<=g)return t.copy(o);var y=c*v-g*m;if(y<=0&&c>=0&&g<=0)return n=c/(c-g),t.copy(a).addScaledVector(l,n);f.subVectors(e,s);var x=l.dot(f),_=h.dot(f);if(_>=0&&x<=_)return t.copy(s);var b=x*m-c*_;if(b<=0&&m>=0&&_<=0)return r=m/(m-_),t.copy(a).addScaledVector(h,r);var w=g*_-x*v;if(w<=0&&v-g>=0&&x-_>=0)return u.subVectors(s,o),r=(v-g)/(v-g+(x-_)),t.copy(o).addScaledVector(u,r);var M=1/(w+b+y);return n=b*M,r=y*M,t.copy(a).addScaledVector(l,n).addScaledVector(h,r)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}})},6460:(e,t,n)=>{function i(e,t){this.x=e||0,this.y=t||0}n.d(t,{I:()=>i}),Object.defineProperties(i.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(i.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent: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},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add: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)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub: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)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp: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},clampScalar: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},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero: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},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute: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},rotateAround:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}})},2547:(e,t,n)=>{n.d(t,{P:()=>s});var i=n(5369),r=n(5543),a=new s,o=new r.P;function s(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(s.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent: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},getComponent: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)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add: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)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub: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)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply: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)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(o.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(o.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*i-o*n,l=s*n+o*t-r*i,h=s*i+r*n-a*t,u=-r*t-a*n-o*i;return this.x=c*s+u*-r+l*-o-h*-a,this.y=l*s+u*-a+h*-r-c*-o,this.z=h*s+u*-o+c*-a-l*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min: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},max: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},clamp: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},clampScalar: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},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero: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},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp: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},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross: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)},crossVectors:function(e,t){var n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(e){return a.copy(this).projectOnVector(e),this.sub(a)},reflect:function(e){return this.sub(a.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());0===t&&console.error("THREE.Vector3: angleTo() can't handle zero length vectors.");var n=this.dot(e)/t;return Math.acos(i.q.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute: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}})},2506:(e,t,n)=>{function i(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==i?i:1}n.d(t,{I:()=>i}),Object.defineProperties(i.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(i.prototype,{isVector4:!0,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent: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},getComponent: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)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy: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},add: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)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors: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},addScaledVector: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},sub: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)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors: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},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion: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},setAxisAngleFromRotationMatrix:function(e){var t,n,i,r,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],h=s[8],u=s[1],d=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(l-u)<a&&Math.abs(h-f)<a&&Math.abs(p-m)<a){if(Math.abs(l+u)<o&&Math.abs(h+f)<o&&Math.abs(p+m)<o&&Math.abs(c+d+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var v=(c+1)/2,y=(d+1)/2,x=(g+1)/2,_=(l+u)/4,b=(h+f)/4,w=(p+m)/4;return v>y&&v>x?v<a?(n=0,i=.707106781,r=.707106781):(i=_/(n=Math.sqrt(v)),r=b/n):y>x?y<a?(n=.707106781,i=0,r=.707106781):(n=_/(i=Math.sqrt(y)),r=w/i):x<a?(n=.707106781,i=.707106781,r=0):(n=b/(r=Math.sqrt(x)),i=w/r),this.set(n,i,r,t),this}var M=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-l)*(u-l));return Math.abs(M)<.001&&(M=1),this.x=(m-p)/M,this.y=(h-f)/M,this.z=(u-l)/M,this.w=Math.acos((c+d+g-1)/2),this},min: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},max: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},clamp: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},clampScalar: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},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor: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},ceil: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},round: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},roundToZero: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},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp: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},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute: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}})},9452:(e,t,n)=>{n.d(t,{Y:()=>r});var i=n(892);function r(){i.B.call(this),this.type="Group"}r.prototype=Object.assign(Object.create(i.B.prototype),{constructor:r,isGroup:!0})},4913:(e,t,n)=>{n.d(t,{N:()=>g});var i=n(2486),r=n(8051),a=n(2612),o=n(892),s=n(2547),c=n(7544),l=n(4918),h=n(2120),u=new s.P,d=new s.P,p=new a.k,f=new r.R,m=new i.i;function g(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),o.B.call(this),this.type="Line",this.geometry=void 0!==e?e:new l.L,this.material=void 0!==t?t:new c.m({color:16777215*Math.random()})}g.prototype=Object.assign(Object.create(o.B.prototype),{constructor:g,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],i=1,r=t.count;i<r;i++)u.fromBufferAttribute(t,i-1),d.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=u.distanceTo(d);e.setAttribute("lineDistance",new h.qt(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((n=e.lineDistances)[0]=0,i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this},raycast:function(e,t){var n=e.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),m.copy(i.boundingSphere),m.applyMatrix4(r),m.radius+=n,!1!==e.ray.intersectsSphere(m)){p.getInverse(r),f.copy(e.ray).applyMatrix4(p);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,c=new s.P,l=new s.P,h=new s.P,u=new s.P,d=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var g=i.index,v=i.attributes.position.array;if(null!==g)for(var y=g.array,x=0,_=y.length-1;x<_;x+=d){var b=y[x],w=y[x+1];c.fromArray(v,3*b),l.fromArray(v,3*w),f.distanceSqToSegment(c,l,u,h)>o||(u.applyMatrix4(this.matrixWorld),(E=e.ray.origin.distanceTo(u))<e.near||E>e.far||t.push({distance:E,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this}))}else for(x=0,_=v.length/3-1;x<_;x+=d)c.fromArray(v,3*x),l.fromArray(v,3*x+3),f.distanceSqToSegment(c,l,u,h)>o||(u.applyMatrix4(this.matrixWorld),(E=e.ray.origin.distanceTo(u))<e.near||E>e.far||t.push({distance:E,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this}))}else if(i.isGeometry){var M=i.vertices,S=M.length;for(x=0;x<S-1;x+=d){var E;f.distanceSqToSegment(M[x],M[x+1],u,h)>o||(u.applyMatrix4(this.matrixWorld),(E=e.ray.origin.distanceTo(u))<e.near||E>e.far||t.push({distance:E,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this}))}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}})},4251:(e,t,n)=>{n.d(t,{D:()=>c});var i=n(4913),r=n(2547),a=n(2120),o=new r.P,s=new r.P;function c(e,t){i.N.call(this,e,t),this.type="LineSegments"}c.prototype=Object.assign(Object.create(i.N.prototype),{constructor:c,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],i=0,r=t.count;i<r;i+=2)o.fromBufferAttribute(t,i),s.fromBufferAttribute(t,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+o.distanceTo(s);e.setAttribute("lineDistance",new a.qt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var c=e.vertices;for(n=e.lineDistances,i=0,r=c.length;i<r;i+=2)o.copy(c[i]),s.copy(c[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+o.distanceTo(s)}return this}})},2842:(e,t,n)=>{n.d(t,{e:()=>C});var i=n(2547),r=n(6460),a=n(2486),o=n(8051),s=n(2612),c=n(892),l=n(1827),h=n(4632),u=n(2709),d=n(4773),p=n(4918),f=new s.k,m=new o.R,g=new a.i,v=new i.P,y=new i.P,x=new i.P,_=new i.P,b=new i.P,w=new i.P,M=new i.P,S=new i.P,E=new i.P,T=new r.I,A=new r.I,L=new r.I,P=new i.P,R=new i.P;function C(e,t){c.B.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new p.L,this.material=void 0!==t?t:new d.V({color:16777215*Math.random()}),this.drawMode=u.RJ4,this.updateMorphTargets()}function N(e,t,n,i,r,a,o,s){if(null===(t.side===u.hsX?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,t.side!==u.$EB,s)))return null;R.copy(s),R.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(R);return c<n.near||c>n.far?null:{distance:c,point:R.clone(),object:e}}function D(e,t,n,i,a,o,s,c,u,d,p,f){v.fromBufferAttribute(a,d),y.fromBufferAttribute(a,p),x.fromBufferAttribute(a,f);var m=e.morphTargetInfluences;if(t.morphTargets&&o&&m){M.set(0,0,0),S.set(0,0,0),E.set(0,0,0);for(var g=0,R=o.length;g<R;g++){var C=m[g],D=o[g];0!==C&&(_.fromBufferAttribute(D,d),b.fromBufferAttribute(D,p),w.fromBufferAttribute(D,f),s?(M.addScaledVector(_,C),S.addScaledVector(b,C),E.addScaledVector(w,C)):(M.addScaledVector(_.sub(v),C),S.addScaledVector(b.sub(y),C),E.addScaledVector(w.sub(x),C)))}v.add(M),y.add(S),x.add(E)}var I=N(e,t,n,i,v,y,x,P);if(I){c&&(T.fromBufferAttribute(c,d),A.fromBufferAttribute(c,p),L.fromBufferAttribute(c,f),I.uv=l.l.getUV(P,v,y,x,T,A,L,new r.I)),u&&(T.fromBufferAttribute(u,d),A.fromBufferAttribute(u,p),L.fromBufferAttribute(u,f),I.uv2=l.l.getUV(P,v,y,x,T,A,L,new r.I));var O=new h.n(d,p,f);l.l.getNormal(v,y,x,O.normal),I.face=O}return I}C.prototype=Object.assign(Object.create(c.B.prototype),{constructor:C,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return c.B.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,i=this.geometry,a=this.material,o=this.matrixWorld;if(void 0!==a&&(null===i.boundingSphere&&i.computeBoundingSphere(),g.copy(i.boundingSphere),g.applyMatrix4(o),!1!==e.ray.intersectsSphere(g)&&(f.getInverse(o),m.copy(e.ray).applyMatrix4(f),null===i.boundingBox||!1!==m.intersectsBox(i.boundingBox))))if(this.drawMode===u.RJ4){if(i.isBufferGeometry){var s,c,h,d,p,v,y,x,_,b=i.index,w=i.attributes.position,M=i.morphAttributes.position,S=i.morphTargetsRelative,E=i.attributes.uv,R=i.attributes.uv2,C=i.groups,I=i.drawRange;if(null!==b)if(Array.isArray(a))for(d=0,v=C.length;d<v;d++)for(_=a[(x=C[d]).materialIndex],p=Math.max(x.start,I.start),y=Math.min(x.start+x.count,I.start+I.count);p<y;p+=3)s=b.getX(p),c=b.getX(p+1),h=b.getX(p+2),(n=D(this,_,e,m,w,M,S,E,R,s,c,h))&&(n.faceIndex=Math.floor(p/3),n.face.materialIndex=x.materialIndex,t.push(n));else for(d=Math.max(0,I.start),v=Math.min(b.count,I.start+I.count);d<v;d+=3)s=b.getX(d),c=b.getX(d+1),h=b.getX(d+2),(n=D(this,a,e,m,w,M,S,E,R,s,c,h))&&(n.faceIndex=Math.floor(d/3),t.push(n));else if(void 0!==w)if(Array.isArray(a))for(d=0,v=C.length;d<v;d++)for(_=a[(x=C[d]).materialIndex],p=Math.max(x.start,I.start),y=Math.min(x.start+x.count,I.start+I.count);p<y;p+=3)(n=D(this,_,e,m,w,M,S,E,R,s=p,c=p+1,h=p+2))&&(n.faceIndex=Math.floor(p/3),n.face.materialIndex=x.materialIndex,t.push(n));else for(d=Math.max(0,I.start),v=Math.min(w.count,I.start+I.count);d<v;d+=3)(n=D(this,a,e,m,w,M,S,E,R,s=d,c=d+1,h=d+2))&&(n.faceIndex=Math.floor(d/3),t.push(n))}else if(i.isGeometry){var O,U,z,F,B=Array.isArray(a),G=i.vertices,V=i.faces,H=i.faceVertexUvs[0];H.length>0&&(F=H);for(var k=0,W=V.length;k<W;k++){var j=V[k],q=B?a[j.materialIndex]:a;if(void 0!==q&&(O=G[j.a],U=G[j.b],z=G[j.c],n=N(this,q,e,m,O,U,z,P))){if(F&&F[k]){var X=F[k];T.copy(X[0]),A.copy(X[1]),L.copy(X[2]),n.uv=l.l.getUV(P,O,U,z,T,A,L,new r.I)}n.face=j,n.faceIndex=k,t.push(n)}}}}else console.warn("THREE.Mesh: TriangleStripDrawMode and TriangleFanDrawMode are not supported by .raycast().")},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}})},8605:(e,t,n)=>{n.d(t,{D:()=>r});var i=n(6295);function r(e,t,n,r){i.n.call(this,e,t,r),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}r.prototype=Object.assign(Object.create(i.n.prototype),{constructor:r,isWebGLMultiviewRenderTarget:!0,copy:function(e){return i.n.prototype.copy.call(this,e),this.numViews=e.numViews,this},setNumViews:function(e){return this.numViews!==e&&(this.numViews=e,this.dispose()),this}})},6295:(e,t,n)=>{n.d(t,{n:()=>s});var i=n(6491),r=n(4306),a=n(2709),o=n(2506);function s(e,t,n){this.width=e,this.height=t,this.scissor=new o.I(0,0,e,t),this.scissorTest=!1,this.viewport=new o.I(0,0,e,t),n=n||{},this.texture=new r.g(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:a.k6q,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}s.prototype=Object.assign(Object.create(i.Q.prototype),{constructor:s,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}})},969:(e,t,n)=>{n.d(t,{J:()=>F});var i=n(2709),r=n(5369),a=n(7426),o=n(2033),s=n(2612),c=n(1334),l=n(2994),h=n(5572),u=n(6460),d=n(2547),p=n(2506),f=n(8144),m=n(5649),g=n(8916),v=n(5525),y=n(8914),x=n(8618),_=n(7814),b=n(6424),w=n(6746),M=n(5868),S=n(9187),E=n(3722),T=n(8925),A=n(973),L=n(6995),P=n(2482),R=n(768),C=n(5787),N=n(9680),D=n(9829),I=n(8403),O=n(9598),U=n(905),z=n(2607);function F(e){var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,F=void 0!==e.alpha&&e.alpha,B=void 0===e.depth||e.depth,G=void 0===e.stencil||e.stencil,V=void 0!==e.antialias&&e.antialias,H=void 0===e.premultipliedAlpha||e.premultipliedAlpha,k=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,W=void 0!==e.powerPreference?e.powerPreference:"default",j=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,q=null,X=null;this.domElement=t,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.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=i.kyO,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var Y,Z,J,Q,K,$,ee,te,ne,ie,re,ae,oe,se,ce,le,he,ue,de=this,pe=!1,fe=null,me=0,ge=0,ve=null,ye=null,xe=-1,_e={geometry:null,program:null,wireframe:!1},be=null,we=null,Me=new p.I,Se=new p.I,Ee=null,Te=t.width,Ae=t.height,Le=1,Pe=new p.I(0,0,Te,Ae),Re=new p.I(0,0,Te,Ae),Ce=!1,Ne=new o.P,De=new x.u,Ie=!1,Oe=!1,Ue=new s.k,ze=new d.P;function Fe(){return null===ve?Le:1}try{var Be={alpha:F,depth:B,stencil:G,antialias:V,premultipliedAlpha:H,preserveDrawingBuffer:k,powerPreference:W,failIfMajorPerformanceCaveat:j,xrCompatible:!0};if(t.addEventListener("webglcontextlost",We,!1),t.addEventListener("webglcontextrestored",je,!1),null===(Y=n||t.getContext("webgl",Be)||t.getContext("experimental-webgl",Be)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===Y.getShaderPrecisionFormat&&(Y.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function Ge(){Z=new _.C(Y),!1===(J=new y.E(Y,Z,e)).isWebGL2&&(Z.get("WEBGL_depth_texture"),Z.get("OES_texture_float"),Z.get("OES_texture_half_float"),Z.get("OES_texture_half_float_linear"),Z.get("OES_standard_derivatives"),Z.get("OES_element_index_uint"),Z.get("ANGLE_instanced_arrays")),Z.get("OES_texture_float_linear"),ue=new I.h(Y,Z,J),(Q=new C.f(Y,Z,J)).scissor(Se.copy(Re).multiplyScalar(Le).floor()),Q.viewport(Me.copy(Pe).multiplyScalar(Le).floor()),K=new M.i(Y),$=new A.R,ee=new N.a(Y,Z,Q,$,J,ue,K),te=new m.B(Y),ne=new b.G(Y,te,K),ie=new E.C(Y,ne,te,K),ce=new S.u(Y),re=new T.t(de,Z,J),ae=new L.$,oe=new P.o,se=new g.q(de,Q,ie,H),le=new v.b(Y,Z,K,J),he=new w.W(Y,Z,K,J),K.programs=re.programs,de.capabilities=J,de.extensions=Z,de.properties=$,de.renderLists=ae,de.state=Q,de.info=K}Ge();var Ve="undefined"!=typeof navigator&&"xr"in navigator?new z.i(de,Y):new U.i(de);this.vr=Ve;var He=new O.W(de,Y),ke=new R.S(de,ie,J.maxTextureSize);function We(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),pe=!0}function je(){console.log("THREE.WebGLRenderer: Context Restored."),pe=!1,Ge()}function qe(e){var t=e.target;t.removeEventListener("dispose",qe),function(e){Xe(e),$.remove(e)}(t)}function Xe(e){var t=$.get(e).program;e.program=void 0,void 0!==t&&re.releaseProgram(t)}this.shadowMap=ke,this.getContext=function(){return Y},this.getContextAttributes=function(){return Y.getContextAttributes()},this.forceContextLoss=function(){var e=Z.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=Z.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return Le},this.setPixelRatio=function(e){void 0!==e&&(Le=e,this.setSize(Te,Ae,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new u.I),e.set(Te,Ae)},this.setSize=function(e,n,i){Ve.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(Te=e,Ae=n,t.width=Math.floor(e*Le),t.height=Math.floor(n*Le),!1!==i&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new u.I),e.set(Te*Le,Ae*Le).floor()},this.setDrawingBufferSize=function(e,n,i){Te=e,Ae=n,Le=i,t.width=Math.floor(e*i),t.height=Math.floor(n*i),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new p.I),e.copy(Me)},this.getViewport=function(e){return e.copy(Pe)},this.setViewport=function(e,t,n,i){e.isVector4?Pe.set(e.x,e.y,e.z,e.w):Pe.set(e,t,n,i),Q.viewport(Me.copy(Pe).multiplyScalar(Le).floor())},this.getScissor=function(e){return e.copy(Re)},this.setScissor=function(e,t,n,i){e.isVector4?Re.set(e.x,e.y,e.z,e.w):Re.set(e,t,n,i),Q.scissor(Se.copy(Re).multiplyScalar(Le).floor())},this.getScissorTest=function(){return Ce},this.setScissorTest=function(e){Q.setScissorTest(Ce=e)},this.getClearColor=function(){return se.getClearColor()},this.setClearColor=function(){se.setClearColor.apply(se,arguments)},this.getClearAlpha=function(){return se.getClearAlpha()},this.setClearAlpha=function(){se.setClearAlpha.apply(se,arguments)},this.clear=function(e,t,n){var i=0;(void 0===e||e)&&(i|=Y.COLOR_BUFFER_BIT),(void 0===t||t)&&(i|=Y.DEPTH_BUFFER_BIT),(void 0===n||n)&&(i|=Y.STENCIL_BUFFER_BIT),Y.clear(i)},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(){t.removeEventListener("webglcontextlost",We,!1),t.removeEventListener("webglcontextrestored",je,!1),ae.dispose(),oe.dispose(),$.dispose(),ie.dispose(),Ve.dispose(),Ze.stop()},this.renderBufferImmediate=function(e,t){Q.initAttributes();var n=$.get(e);e.hasPositions&&!n.position&&(n.position=Y.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=Y.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=Y.createBuffer()),e.hasColors&&!n.color&&(n.color=Y.createBuffer());var i=t.getAttributes();e.hasPositions&&(Y.bindBuffer(Y.ARRAY_BUFFER,n.position),Y.bufferData(Y.ARRAY_BUFFER,e.positionArray,Y.DYNAMIC_DRAW),Q.enableAttribute(i.position),Y.vertexAttribPointer(i.position,3,Y.FLOAT,!1,0,0)),e.hasNormals&&(Y.bindBuffer(Y.ARRAY_BUFFER,n.normal),Y.bufferData(Y.ARRAY_BUFFER,e.normalArray,Y.DYNAMIC_DRAW),Q.enableAttribute(i.normal),Y.vertexAttribPointer(i.normal,3,Y.FLOAT,!1,0,0)),e.hasUvs&&(Y.bindBuffer(Y.ARRAY_BUFFER,n.uv),Y.bufferData(Y.ARRAY_BUFFER,e.uvArray,Y.DYNAMIC_DRAW),Q.enableAttribute(i.uv),Y.vertexAttribPointer(i.uv,2,Y.FLOAT,!1,0,0)),e.hasColors&&(Y.bindBuffer(Y.ARRAY_BUFFER,n.color),Y.bufferData(Y.ARRAY_BUFFER,e.colorArray,Y.DYNAMIC_DRAW),Q.enableAttribute(i.color),Y.vertexAttribPointer(i.color,3,Y.FLOAT,!1,0,0)),Q.disableUnusedAttributes(),Y.drawArrays(Y.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,a,o){var s=a.isMesh&&a.matrixWorld.determinant()<0;Q.setMaterial(r,s);var c=et(e,t,r,a),l=!1;_e.geometry===n.id&&_e.program===c.id&&_e.wireframe===(!0===r.wireframe)||(_e.geometry=n.id,_e.program=c.id,_e.wireframe=!0===r.wireframe,l=!0),a.morphTargetInfluences&&(ce.update(a,n,r,c),l=!0);var h=n.index,u=n.attributes.position;if((null===h||0!==h.count)&&void 0!==u&&0!==u.count){var d,p=1;!0===r.wireframe&&(h=ne.getWireframeAttribute(n),p=2);var f=le;null!==h&&(d=te.get(h),(f=he).setIndex(d)),l&&(function(e,t,n,i){if(!1!==J.isWebGL2||!e.isInstancedMesh&&!t.isInstancedBufferGeometry||null!==Z.get("ANGLE_instanced_arrays")){Q.initAttributes();var r=t.attributes,a=i.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=r[s];if(void 0!==l){var h=l.normalized,u=l.itemSize;if(void 0===(y=te.get(l)))continue;var d=y.buffer,p=y.type,f=y.bytesPerElement;if(l.isInterleavedBufferAttribute){var m=l.data,g=m.stride,v=l.offset;m&&m.isInstancedInterleavedBuffer?(Q.enableAttributeAndDivisor(c,m.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=m.meshPerAttribute*m.count)):Q.enableAttribute(c),Y.bindBuffer(Y.ARRAY_BUFFER,d),Y.vertexAttribPointer(c,u,p,h,g*f,v*f)}else l.isInstancedBufferAttribute?(Q.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=l.meshPerAttribute*l.count)):Q.enableAttribute(c),Y.bindBuffer(Y.ARRAY_BUFFER,d),Y.vertexAttribPointer(c,u,p,h,0,0)}else if("instanceMatrix"===s){var y;if(void 0===(y=te.get(e.instanceMatrix)))continue;d=y.buffer,p=y.type,Q.enableAttributeAndDivisor(c+0,1),Q.enableAttributeAndDivisor(c+1,1),Q.enableAttributeAndDivisor(c+2,1),Q.enableAttributeAndDivisor(c+3,1),Y.bindBuffer(Y.ARRAY_BUFFER,d),Y.vertexAttribPointer(c+0,4,p,!1,64,0),Y.vertexAttribPointer(c+1,4,p,!1,64,16),Y.vertexAttribPointer(c+2,4,p,!1,64,32),Y.vertexAttribPointer(c+3,4,p,!1,64,48)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:Y.vertexAttrib2fv(c,x);break;case 3:Y.vertexAttrib3fv(c,x);break;case 4:Y.vertexAttrib4fv(c,x);break;default:Y.vertexAttrib1fv(c,x)}}}}Q.disableUnusedAttributes()}}(a,n,r,c),null!==h&&Y.bindBuffer(Y.ELEMENT_ARRAY_BUFFER,d.buffer));var m=1/0;null!==h?m=h.count:void 0!==u&&(m=u.count);var g=n.drawRange.start*p,v=n.drawRange.count*p,y=null!==o?o.start*p:0,x=null!==o?o.count*p:1/0,_=Math.max(g,y),b=Math.min(m,g+v,y+x)-1,w=Math.max(0,b-_+1);if(0!==w){if(a.isMesh)if(!0===r.wireframe)Q.setLineWidth(r.wireframeLinewidth*Fe()),f.setMode(Y.LINES);else switch(a.drawMode){case i.RJ4:f.setMode(Y.TRIANGLES);break;case i.O49:f.setMode(Y.TRIANGLE_STRIP);break;case i.rYR:f.setMode(Y.TRIANGLE_FAN)}else if(a.isLine){var M=r.linewidth;void 0===M&&(M=1),Q.setLineWidth(M*Fe()),a.isLineSegments?f.setMode(Y.LINES):a.isLineLoop?f.setMode(Y.LINE_LOOP):f.setMode(Y.LINE_STRIP)}else a.isPoints?f.setMode(Y.POINTS):a.isSprite&&f.setMode(Y.TRIANGLES);a.isInstancedMesh?f.renderInstances(n,_,w,a.count):n.isInstancedBufferGeometry?f.renderInstances(n,_,w,n.maxInstancedCount):f.render(_,w)}}},this.compile=function(e,t){(X=oe.get(e,t)).init(),e.traverse((function(e){e.isLight&&(X.pushLight(e),e.castShadow&&X.pushShadow(e))})),X.setupLights(t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)$e(t.material[n],e.fog,t);else $e(t.material,e.fog,t)}))};var Ye=null,Ze=new f.O;function Je(e,t,n,i){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)X.pushLight(e),e.castShadow&&X.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Ne.intersectsSprite(e)){i&&ze.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Ue);var r=ie.update(e);(a=e.material).visible&&q.push(e,r,a,n,ze.z,null)}}else if(e.isImmediateRenderObject)i&&ze.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Ue),q.push(e,null,e.material,n,ze.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==K.render.frame&&(e.skeleton.update(),e.skeleton.frame=K.render.frame),!e.frustumCulled||Ne.intersectsObject(e))){i&&ze.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Ue),r=ie.update(e);var a=e.material;if(Array.isArray(a))for(var o=r.groups,s=0,c=o.length;s<c;s++){var l=o[s],h=a[l.materialIndex];h&&h.visible&&q.push(e,r,h,n,ze.z,l)}else a.visible&&q.push(e,r,a,n,ze.z,null)}var u=e.children;for(s=0,c=u.length;s<c;s++)Je(u[s],t,n,i)}}function Qe(e,t,n,i){for(var r=0,a=e.length;r<a;r++){var o=e[r],s=o.object,c=o.geometry,l=void 0===i?o.material:i,h=o.group;if(n.isArrayCamera)if(we=n,Ve.enabled&&He.isAvailable())Ke(s,t,n,c,l,h);else for(var u=n.cameras,d=0,p=u.length;d<p;d++){var f=u[d];s.layers.test(f.layers)&&(Q.viewport(Me.copy(f.viewport)),X.setupLights(f),Ke(s,t,f,c,l,h))}else we=null,Ke(s,t,n,c,l,h)}}function Ke(e,t,n,i,r,a){if(e.onBeforeRender(de,t,n,i,r,a),X=oe.get(t,we||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){Q.setMaterial(r);var o=et(n,t.fog,r,e);_e.geometry=null,_e.program=null,_e.wireframe=!1,function(e,t){e.render((function(e){de.renderBufferImmediate(e,t)}))}(e,o)}else de.renderBufferDirect(n,t.fog,i,r,e,a);e.onAfterRender(de,t,n,i,r,a),X=oe.get(t,we||n)}function $e(e,t,n){var i=$.get(e),r=X.state.lights,a=X.state.shadowsArray,o=r.state.version,s=re.getParameters(e,r.state,a,t,De.numPlanes,De.numIntersection,n),l=re.getProgramCacheKey(e,s),u=i.program,d=!0;if(void 0===u)e.addEventListener("dispose",qe);else if(u.cacheKey!==l)Xe(e);else if(i.lightsStateVersion!==o)i.lightsStateVersion=o,d=!1;else{if(void 0!==s.shaderID)return;d=!1}if(d){if(s.shaderID){var p=c.z[s.shaderID];i.shader={name:e.type,uniforms:(0,h.lx)(p.uniforms),vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}else i.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(i.shader,de),l=re.getProgramCacheKey(e,s),u=re.acquireProgram(e,i.shader,s,l),i.program=u,e.program=u}var f=u.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var m=0;m<de.maxMorphTargets;m++)f["morphTarget"+m]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals)for(e.numSupportedMorphNormals=0,m=0;m<de.maxMorphNormals;m++)f["morphNormal"+m]>=0&&e.numSupportedMorphNormals++;var g=i.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(i.numClippingPlanes=De.numPlanes,i.numIntersection=De.numIntersection,g.clippingPlanes=De.uniform),i.fog=t,i.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),i.lightsStateVersion=o,i.needsLights&&(g.ambientLightColor.value=r.state.ambient,g.lightProbe.value=r.state.probe,g.directionalLights.value=r.state.directional,g.spotLights.value=r.state.spot,g.rectAreaLights.value=r.state.rectArea,g.pointLights.value=r.state.point,g.hemisphereLights.value=r.state.hemi,g.directionalShadowMap.value=r.state.directionalShadowMap,g.directionalShadowMatrix.value=r.state.directionalShadowMatrix,g.spotShadowMap.value=r.state.spotShadowMap,g.spotShadowMatrix.value=r.state.spotShadowMatrix,g.pointShadowMap.value=r.state.pointShadowMap,g.pointShadowMatrix.value=r.state.pointShadowMatrix);var v=i.program.getUniforms(),y=D.H.seqWithValue(v.seq,g);i.uniformsList=y}function et(e,t,n,o){ee.resetTextureUnits();var s=$.get(n),c=X.state.lights;if(Ie&&(Oe||e!==be)){var h=e===be&&n.id===xe;De.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,s,h)}n.version===s.__version&&(void 0===s.program||n.fog&&s.fog!==t||s.needsLights&&s.lightsStateVersion!==c.state.version?n.needsUpdate=!0:void 0===s.numClippingPlanes||s.numClippingPlanes===De.numPlanes&&s.numIntersection===De.numIntersection||(n.needsUpdate=!0)),n.version!==s.__version&&($e(n,t,o),s.__version=n.version);var u,d,p=!1,f=!1,m=!1,g=s.program,v=g.getUniforms(),y=s.shader.uniforms;if(Q.useProgram(g.program)&&(p=!0,f=!0,m=!0),n.id!==xe&&(xe=n.id,f=!0),p||be!==e){if(g.numMultiviewViews>0?He.updateCameraProjectionMatricesUniform(e,v):v.setValue(Y,"projectionMatrix",e.projectionMatrix),J.logarithmicDepthBuffer&&v.setValue(Y,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),be!==e&&(be=e,f=!0,m=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var x=v.map.cameraPosition;void 0!==x&&x.setValue(Y,ze.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&v.setValue(Y,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(g.numMultiviewViews>0?He.updateCameraViewMatricesUniform(e,v):v.setValue(Y,"viewMatrix",e.matrixWorldInverse))}if(n.skinning){v.setOptional(Y,o,"bindMatrix"),v.setOptional(Y,o,"bindMatrixInverse");var _=o.skeleton;if(_){var b=_.bones;if(J.floatVertexTextures){if(void 0===_.boneTexture){var w=Math.sqrt(4*b.length);w=r.q.ceilPowerOfTwo(w),w=Math.max(w,4);var M=new Float32Array(w*w*4);M.set(_.boneMatrices);var S=new a.G(M,w,w,i.GWd,i.RQf);_.boneMatrices=M,_.boneTexture=S,_.boneTextureSize=w}v.setValue(Y,"boneTexture",_.boneTexture,ee),v.setValue(Y,"boneTextureSize",_.boneTextureSize)}else v.setOptional(Y,_,"boneMatrices")}}return(f||s.receiveShadow!==o.receiveShadow)&&(s.receiveShadow=o.receiveShadow,v.setValue(Y,"receiveShadow",o.receiveShadow)),f&&(v.setValue(Y,"toneMappingExposure",de.toneMappingExposure),v.setValue(Y,"toneMappingWhitePoint",de.toneMappingWhitePoint),s.needsLights&&(d=m,(u=y).ambientLightColor.needsUpdate=d,u.lightProbe.needsUpdate=d,u.directionalLights.needsUpdate=d,u.pointLights.needsUpdate=d,u.spotLights.needsUpdate=d,u.rectAreaLights.needsUpdate=d,u.hemisphereLights.needsUpdate=d),t&&n.fog&&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)}(y,t),n.isMeshBasicMaterial?tt(y,n):n.isMeshLambertMaterial?(tt(y,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(y,n)):n.isMeshPhongMaterial?(tt(y,n),n.isMeshToonMaterial?function(e,t){nt(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(y,n):nt(y,n)):n.isMeshStandardMaterial?(tt(y,n),n.isMeshPhysicalMaterial?function(e,t){it(e,t),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===i.hsX&&e.clearcoatNormalScale.value.negate()),e.transparency.value=t.transparency}(y,n):it(y,n)):n.isMeshMatcapMaterial?(tt(y,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===i.hsX&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===i.hsX&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(y,n)):n.isMeshDepthMaterial?(tt(y,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(y,n)):n.isMeshDistanceMaterial?(tt(y,n),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}(y,n)):n.isMeshNormalMaterial?(tt(y,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===i.hsX&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===i.hsX&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(y,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(y,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(y,n)):n.isPointsMaterial?function(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*Le,e.scale.value=.5*Ae,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(y,n):n.isSpriteMaterial?function(e,t){var n;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),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(y,n):n.isShadowMaterial&&(y.color.value.copy(n.color),y.opacity.value=n.opacity),void 0!==y.ltc_1&&(y.ltc_1.value=l.f.LTC_1),void 0!==y.ltc_2&&(y.ltc_2.value=l.f.LTC_2),D.H.upload(Y,s.uniformsList,y,ee),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(D.H.upload(Y,s.uniformsList,y,ee),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&v.setValue(Y,"center",o.center),g.numMultiviewViews>0?He.updateObjectMatricesUniforms(o,e,v):(v.setValue(Y,"modelViewMatrix",o.modelViewMatrix),v.setValue(Y,"normalMatrix",o.normalMatrix)),v.setValue(Y,"modelMatrix",o.matrixWorld),g}function tt(e,t){var n;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),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=$.get(t.envMap).__maxMipLevel),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),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function nt(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===i.hsX&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===i.hsX&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function it(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===i.hsX&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===i.hsX&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}Ze.setAnimationLoop((function(e){Ve.isPresenting()||Ye&&Ye(e)})),"undefined"!=typeof window&&Ze.setContext(window),this.setAnimationLoop=function(e){Ye=e,Ve.setAnimationLoop(e),Ze.start()},this.render=function(e,t){var n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),t&&t.isCamera){if(!pe){_e.geometry=null,_e.program=null,_e.wireframe=!1,xe=-1,be=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),Ve.enabled&&Ve.isPresenting()&&(t=Ve.getCamera(t)),(X=oe.get(e,t)).init(),e.onBeforeRender(de,e,t,n||ve),Ue.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Ne.setFromMatrix(Ue),Oe=this.localClippingEnabled,Ie=De.init(this.clippingPlanes,Oe,t),(q=ae.get(e,t)).init(),Je(e,t,0,de.sortObjects),!0===de.sortObjects&&q.sort(),Ie&&De.beginShadows();var r=X.state.shadowsArray;ke.render(r,e,t),X.setupLights(t),Ie&&De.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),Ve.enabled&&He.isAvailable()&&He.attachCamera(t),se.render(q,e,t,i);var a=q.opaque,o=q.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&Qe(a,e,t,s),o.length&&Qe(o,e,t,s)}else a.length&&Qe(a,e,t),o.length&&Qe(o,e,t);e.onAfterRender(de,e,t),null!==ve&&(ee.updateRenderTargetMipmap(ve),ee.updateMultisampleRenderTarget(ve)),Q.buffers.depth.setTest(!0),Q.buffers.depth.setMask(!0),Q.buffers.color.setMask(!0),Q.setPolygonOffset(!1),Ve.enabled&&(He.isAvailable()&&He.detachCamera(t),Ve.submitFrame()),q=null,X=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){fe!==e&&null===ve&&Y.bindFramebuffer(Y.FRAMEBUFFER,e),fe=e},this.getActiveCubeFace=function(){return me},this.getActiveMipmapLevel=function(){return ge},this.getRenderTarget=function(){return ve},this.setRenderTarget=function(e,t,n){ve=e,me=t,ge=n,e&&void 0===$.get(e).__webglFramebuffer&&ee.setupRenderTarget(e);var i=fe,r=!1;if(e){var a=$.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(i=a[t||0],r=!0):i=e.isWebGLMultisampleRenderTarget?$.get(e).__webglMultisampledFramebuffer:a,Me.copy(e.viewport),Se.copy(e.scissor),Ee=e.scissorTest}else Me.copy(Pe).multiplyScalar(Le).floor(),Se.copy(Re).multiplyScalar(Le).floor(),Ee=Ce;if(ye!==i&&(Y.bindFramebuffer(Y.FRAMEBUFFER,i),ye=i),Q.viewport(Me),Q.scissor(Se),Q.setScissorTest(Ee),r){var o=$.get(e.texture);Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_CUBE_MAP_POSITIVE_X+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,r,a,o,s){if(e&&e.isWebGLRenderTarget){var c=$.get(e).__webglFramebuffer;if(e.isWebGLRenderTargetCube&&void 0!==s&&(c=c[s]),c){var l=!1;c!==ye&&(Y.bindFramebuffer(Y.FRAMEBUFFER,c),l=!0);try{var h=e.texture,u=h.format,d=h.type;if(u!==i.GWd&&ue.convert(u)!==Y.getParameter(Y.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(d===i.OUM||ue.convert(d)===Y.getParameter(Y.IMPLEMENTATION_COLOR_READ_TYPE)||d===i.RQf&&(J.isWebGL2||Z.get("OES_texture_float")||Z.get("WEBGL_color_buffer_float"))||d===i.ix0&&(J.isWebGL2?Z.get("EXT_color_buffer_float"):Z.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Y.checkFramebufferStatus(Y.FRAMEBUFFER)===Y.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-a&&Y.readPixels(t,n,r,a,ue.convert(u),ue.convert(d),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&Y.bindFramebuffer(Y.FRAMEBUFFER,ye)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(t.image.width*i),a=Math.floor(t.image.height*i),o=ue.convert(t.format);ee.setTexture2D(t,0),Y.copyTexImage2D(Y.TEXTURE_2D,n,o,e.x,e.y,r,a,0),Q.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i){var r=t.image.width,a=t.image.height,o=ue.convert(n.format),s=ue.convert(n.type);ee.setTexture2D(n,0),t.isDataTexture?Y.texSubImage2D(Y.TEXTURE_2D,i||0,e.x,e.y,r,a,o,s,t.image.data):Y.texSubImage2D(Y.TEXTURE_2D,i||0,e.x,e.y,o,s,t.image),Q.unbindTexture()},this.initTexture=function(e){ee.setTexture2D(e,0),Q.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}},8576:(e,t,n)=>{n.d(t,{v:()=>yt});var i=n(3936),r=n(3089),a=n(4890),o=n(9696),s=n(1969),c=n(4649),l=n(6222),h=n(4555),u=n(5345),d=n(1778),p=n(8611),f=n(4517),m=n(648),g=n(9941),v=n(7330),y=n(5272),x=n(8543),_=n(286),b=n(869),w=n(8134),M=n(8804),S=n(4747),E=n(589),T=n(682),A=n(6784),L=n(8321),P=n(877),R=n(1112),C=n(8554),N=n(928),D=n(3159),I=n(7200),O=n(9677),U=n(4618),z=n(3755),F=n(1197),B=n(9776),G=n(4113),V=n(6927),H=n(3857),k=n(4132),W=n(242),j=n(6067),q=n(641),X=n(9310),Y=n(1569),Z=n(2013),J=n(2285),Q=n(6142),K=n(1695),$=n(8529),ee=n(5220),te=n(8812),ne=n(1341),ie=n(8823),re=n(6423),ae=n(6699),oe=n(1945),se=n(3145),ce=n(3464),le=n(9503),he=n(9219),ue=n(3651),de=n(2446),pe=n(9500),fe=n(462),me=n(2661),ge=n(1680),ve=n(41),ye=n(217),xe=n(8378),_e=n(1051),be=n(518),we=n(2567),Me=n(7553),Se=n(2811),Ee=n(854),Te=n(8223),Ae=n(9700),Le=n(6444),Pe=n(6435),Re=n(5074),Ce=n(1663),Ne=n(1324),De=n(4932),Ie=n(8581),Oe=n(2694),Ue=n(2172),ze=n(4771),Fe=n(2422),Be=n(3196),Ge=n(387),Ve=n(4474),He=n(3252),ke=n(7577),We=n(3625),je=n(3940),qe=n(6533),Xe=n(9544),Ye=n(9005),Ze=n(1616),Je=n(6857),Qe=n(1103),Ke=n(860),$e=n(334),et=n(7861),tt=n(8152),nt=n(4078),it=n(9863),rt=n(9575),at=n(5350),ot=n(2218),st=n(8672),ct=n(8400),lt=n(5133),ht=n(7267),ut=n(7866),dt=n(4711),pt=n(7910),ft=n(4828),mt=n(9425),gt=n(3741),vt=n(6544),yt={alphamap_fragment:i.A,alphamap_pars_fragment:r.A,alphatest_fragment:a.A,aomap_fragment:o.A,aomap_pars_fragment:s.A,begin_vertex:c.A,beginnormal_vertex:l.A,bsdfs:h.A,bumpmap_pars_fragment:u.A,clipping_planes_fragment:d.A,clipping_planes_pars_fragment:p.A,clipping_planes_pars_vertex:f.A,clipping_planes_vertex:m.A,color_fragment:g.A,color_pars_fragment:v.A,color_pars_vertex:y.A,color_vertex:x.A,common:_.A,cube_uv_reflection_fragment:b.A,defaultnormal_vertex:w.A,displacementmap_pars_vertex:M.A,displacementmap_vertex:S.A,emissivemap_fragment:E.A,emissivemap_pars_fragment:T.A,encodings_fragment:A.A,encodings_pars_fragment:L.A,envmap_fragment:P.A,envmap_common_pars_fragment:R.A,envmap_pars_fragment:C.A,envmap_pars_vertex:N.A,envmap_physical_pars_fragment:k.A,envmap_vertex:D.A,fog_vertex:I.A,fog_pars_vertex:O.A,fog_fragment:U.A,fog_pars_fragment:z.A,gradientmap_pars_fragment:F.A,lightmap_fragment:B.A,lightmap_pars_fragment:G.A,lights_lambert_vertex:V.A,lights_pars_begin:H.A,lights_phong_fragment:W.A,lights_phong_pars_fragment:j.A,lights_physical_fragment:q.A,lights_physical_pars_fragment:X.A,lights_fragment_begin:Y.A,lights_fragment_maps:Z.A,lights_fragment_end:J.A,logdepthbuf_fragment:Q.A,logdepthbuf_pars_fragment:K.A,logdepthbuf_pars_vertex:$.A,logdepthbuf_vertex:ee.A,map_fragment:te.A,map_pars_fragment:ne.A,map_particle_fragment:ie.A,map_particle_pars_fragment:re.A,metalnessmap_fragment:ae.A,metalnessmap_pars_fragment:oe.A,morphnormal_vertex:se.A,morphtarget_pars_vertex:ce.A,morphtarget_vertex:le.A,normal_fragment_begin:he.A,normal_fragment_maps:ue.A,normalmap_pars_fragment:de.A,clearcoat_normal_fragment_begin:pe.A,clearcoat_normal_fragment_maps:fe.A,clearcoat_normalmap_pars_fragment:me.A,packing:ge.A,premultiplied_alpha_fragment:ve.A,project_vertex:ye.A,dithering_fragment:xe.A,dithering_pars_fragment:_e.A,roughnessmap_fragment:be.A,roughnessmap_pars_fragment:we.A,shadowmap_pars_fragment:Me.A,shadowmap_pars_vertex:Se.A,shadowmap_vertex:Ee.A,shadowmask_pars_fragment:Te.A,skinbase_vertex:Ae.A,skinning_pars_vertex:Le.A,skinning_vertex:Pe.A,skinnormal_vertex:Re.A,specularmap_fragment:Ce.A,specularmap_pars_fragment:Ne.A,tonemapping_fragment:De.A,tonemapping_pars_fragment:Ie.A,uv_pars_fragment:Oe.A,uv_pars_vertex:Ue.A,uv_vertex:ze.A,uv2_pars_fragment:Fe.A,uv2_pars_vertex:Be.A,uv2_vertex:Ge.A,worldpos_vertex:Ve.A,background_frag:He.A,background_vert:ke.A,cube_frag:We.A,cube_vert:je.A,depth_frag:qe.A,depth_vert:Xe.A,distanceRGBA_frag:Ye.A,distanceRGBA_vert:Ze.A,equirect_frag:Je.A,equirect_vert:Qe.A,linedashed_frag:Ke.A,linedashed_vert:$e.A,meshbasic_frag:et.A,meshbasic_vert:tt.A,meshlambert_frag:nt.A,meshlambert_vert:it.A,meshmatcap_frag:rt.A,meshmatcap_vert:at.A,meshphong_frag:ot.A,meshphong_vert:st.A,meshphysical_frag:ct.A,meshphysical_vert:lt.A,normal_frag:ht.A,normal_vert:ut.A,points_frag:dt.A,points_vert:pt.A,shadow_frag:ft.A,shadow_vert:mt.A,sprite_frag:gt.A,sprite_vert:vt.A}},3936:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n"},3089:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n"},4890:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n"},9696:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\n\t#endif\n\n#endif\n"},1969:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n"},4649:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvec3 transformed = vec3( position );\n"},6222:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n"},4555:(e,t,n)=>{n.d(t,{A:()=>i});const i='\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n}\n\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\n\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t// page 32, equation 26: E[window1]\n\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t// this is intended to be used on spot and point lights who are represented as luminous intensity\n\t// but who must be converted to luminous irradiance for surface lighting calculation\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\tif( cutoffDistance > 0.0 ) {\n\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t}\n\n\treturn distanceFalloff;\n\n#else\n\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t}\n\n\treturn 1.0;\n\n#endif\n\n}\n\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\n\t// Original approximation by Christophe Schlick \'94\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n} // validated\n\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\n\t// See F_Schlick\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\n\treturn Fr * fresnel + F0;\n\n}\n\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\n\t// also see #12151\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\n\treturn 1.0 / ( gl * gv );\n\n} // validated\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\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\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\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\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\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\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\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\n\t// project rect onto sphere\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\n\t// calculate vector form factor\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\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\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\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\n\treturn specularColor * brdf.x + brdf.y;\n\n} // validated\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\n\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L94\nfloat D_Charlie(float roughness, float NoH) {\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L136\nfloat V_Neubelt(float NoV, float NoL) {\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\n\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n\n}\n\n#endif\n'},5345:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\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\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\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;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n"},9500:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef CLEARCOAT\n\n\tvec3 clearcoatNormal = geometryNormal;\n\n#endif\n"},462:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\n\t#else\n\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\n\t#endif\n\n#endif\n"},2661:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n"},1778:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n"},8611:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if NUM_CLIPPING_PLANES > 0\n\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n"},4517:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif\n"},648:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n"},9941:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n"},7330:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n"},5272:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n"},8543:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_COLOR\n\n\tvColor.xyz = color.xyz;\n\n#endif\n"},286:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\n#ifndef saturate\n// <tonemapping_pars_fragment> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\n\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 average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\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\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\n\treturn - distance * planeNormal + point;\n\n}\n\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n\n}\n\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\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\n\treturn tmp;\n\n}\n\n// https://en.wikipedia.org/wiki/Relative_luminance\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\n\treturn dot( weights, color.rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n return m[ 2 ][ 3 ] == - 1.0;\n\n}\n"},869:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n#define cubeUV_textureSize (1024.0)\n\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\n\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\t// Clamp the value to the max mip level counts. hard coded to 6 mips\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\n\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\t// float powScale = exp2(roughnessLevel + mipLevel);\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\t// float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel);\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\t// float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel);\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\n\tfloat rcpPowScale = 1.0 / powScale;\n\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\n\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\n\t// round to nearest mipmap if we are not interpolating.\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\n\t// Tri linear interpolation.\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\n\tvec4 result = mix(color10, color20, t);\n\n\treturn vec4(result.rgb, 1.0);\n}\n\n#endif\n"},6511:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n"},3697:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},8134:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n"},8804:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n"},4747:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n\n#endif\n"},8378:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n"},1051:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift acording to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n"},589:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n"},682:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n"},6784:(e,t,n)=>{n.d(t,{A:()=>i});const i="\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n"},8321:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\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}\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}\n\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\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// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\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}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\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 = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\n\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\n\n// M matrix, for encoding\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}\n\n// Inverse M matrix, for decoding\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}\n"},1112:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\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\n"},877:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\tvec2 sampleUV;\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\tenvColor = envMapTexelToLinear( envColor );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n"},8554:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n"},928:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n"},4132:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_ENVMAP )\n\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\n\tvec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {\n\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#else\n\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\n\t\t#else\n\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\n\t\t#endif\n\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t}\n\n\t// Trowbridge-Reitz distribution to Mip level, following the logic of http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\n\t\t// clamp to allowable LOD ranges.\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\n\t}\n\n\tvec3 getLightProbeIndirectRadiance( /*const in SpecularLightProbe specularLightProbe,*/ const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\n\t\t // Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t#else\n\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\n\t\t#endif\n\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, roughness );\n\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#endif\n\n\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t}\n\n#endif\n"},3159:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) { \n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n"},4618:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n"},3755:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n"},9677:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_FOG\n\n\tvarying float fogDepth;\n\n#endif\n"},7200:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_FOG\n\n\tfogDepth = -mvPosition.z;\n\n#endif\n"},1197:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef TOON\n\n\tuniform sampler2D gradientMap;\n\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t\t// dotNL will be from -1.0 to 1.0\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t\t#ifdef USE_GRADIENTMAP\n\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\n\t\t#else\n\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\n\t\t#endif\n\n\n\t}\n\n#endif\n"},9776:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_LIGHTMAP\n\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\n\n#endif\n"},4113:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n"},1569:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - If you have defined an RE_IndirectSpecular, you need to also provide a Material_LightProbeLOD. <---- ???\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t}\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n"},2285:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n\n#endif\n"},2013:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\n\t#ifdef CLEARCOAT\n\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\n\t#endif\n\n#endif\n"},6927:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvec3 diffuse = vec3( 1.0 );\n\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\n\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\n\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\n\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n\n#if NUM_POINT_LIGHTS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if NUM_SPOT_LIGHTS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\t}\n\n#endif\n\n/*\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\t// TODO (abelnation): implement\n\n\t}\n\n#endif\n*/\n\n#if NUM_DIR_LIGHTS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if NUM_HEMI_LIGHTS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\n\t\t#endif\n\n\t}\n\n#endif\n"},3857:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\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\n\t// band 2\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\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI;\n\n\t#endif\n\n\treturn irradiance;\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\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\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\n\t\tif ( angleCos > spotLight.coneCos ) {\n\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\n\t\t} else {\n\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\n\t\t}\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tirradiance *= PI;\n\n\t\t#endif\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n"},242:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n"},6067:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct BlinnPhongMaterial {\n\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\t#ifdef TOON\n\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\n\t#else\n\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\n\t#endif\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n\n#define Material_LightProbeLOD( material )\t(0)\n"},641:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n\n#ifdef REFLECTIVITY\n\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n\n#endif\n\n#ifdef CLEARCOAT\n\n\tmaterial.clearcoat = saturate( clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );\n\n#endif\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheen;\n\n#endif\n"},9310:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nstruct PhysicalMaterial {\n\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n\n};\n\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\n\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\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.specularRoughness;\n\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\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\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tccIrradiance *= PI; // punctual light\n\n\t\t#endif\n\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\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\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\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\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n"},6142:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n"},1695:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n"},8529:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n"},5220:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n"},8812:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n\n#endif\n"},1341:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n"},8823:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_MAP\n\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n"},6423:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tuniform mat3 uvTransform;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n"},6699:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n"},1945:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n"},3145:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n#endif\n"},3464:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif\n"},9503:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n#endif\n"},9219:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef FLAT_SHADED\n\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\n\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\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\t#ifdef USE_TANGENT\n\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\t#endif\n\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 geometryNormal = normal;\n\n"},3651:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( TANGENTSPACE_NORMALMAP )\n\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tnormal = normalize( vTBN * mapN );\n\n\t#else\n\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\n\t#endif\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n"},2446:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\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\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude\n\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tmat3 tsn = mat3( S, T, N );\n\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n"},1680:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\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 unpack2HalfToRGBA( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\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}\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}\n"},41:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n"},217:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n"},518:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n"},2567:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n"},7553:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpack2HalfToRGBA( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\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 ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = ( floor( uv * size - 0.5 ) + 0.5 ) * texelSize;\n\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\n\t\tvec2 f = fract( uv * size + 0.5 );\n\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\n\t\treturn c;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t// if ( all( something, something ) ) using this instead\n\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\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\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\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\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\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\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t// y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim := ( 4 , 2 )\n\t\t// # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\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\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\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\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n"},2811:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n"},854:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n"},8223:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLight directionalLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLight spotLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\n\t}\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLight pointLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\n\t}\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n"},9700:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_SKINNING\n\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\n#endif\n"},6444:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\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\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\t\ty = dy * ( y + 0.5 );\n\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\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n"},6435:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\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\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n"},5074:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_SKINNING\n\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\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n"},1663:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n"},1324:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n"},4932:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n"},8581:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifndef saturate\n// <common> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn toneMappingExposure * color;\n\n}\n\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\n\t// John Hable's filmic operator from Uncharted 2 video game\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\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\n}\n\n// source: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n\n}\n"},2422:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvarying vec2 vUv2;\n\n#endif\n"},3196:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n#endif\n"},387:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = uv2;\n\n#endif\n"},2694:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\n\tvarying vec2 vUv;\n\n#endif\n"},2172:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_UV\n\n\t#ifdef UVS_VERTEX_ONLY\n\n\t\tvec2 vUv;\n\n\t#else\n\n\t\tvarying vec2 vUv;\n\n\t#endif\n\n\tuniform mat3 uvTransform;\n\n#endif\n"},4771:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#ifdef USE_UV\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n"},4474:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n"},1334:(e,t,n)=>{n.d(t,{z:()=>h});var i=n(8576),r=n(5572),a=n(6460),o=n(2547),s=n(2994),c=n(4036),l=n(7681),h={basic:{uniforms:(0,r.Ii)([s.f.common,s.f.specularmap,s.f.envmap,s.f.aomap,s.f.lightmap,s.f.fog]),vertexShader:i.v.meshbasic_vert,fragmentShader:i.v.meshbasic_frag},lambert:{uniforms:(0,r.Ii)([s.f.common,s.f.specularmap,s.f.envmap,s.f.aomap,s.f.lightmap,s.f.emissivemap,s.f.fog,s.f.lights,{emissive:{value:new c.Q(0)}}]),vertexShader:i.v.meshlambert_vert,fragmentShader:i.v.meshlambert_frag},phong:{uniforms:(0,r.Ii)([s.f.common,s.f.specularmap,s.f.envmap,s.f.aomap,s.f.lightmap,s.f.emissivemap,s.f.bumpmap,s.f.normalmap,s.f.displacementmap,s.f.gradientmap,s.f.fog,s.f.lights,{emissive:{value:new c.Q(0)},specular:{value:new c.Q(1118481)},shininess:{value:30}}]),vertexShader:i.v.meshphong_vert,fragmentShader:i.v.meshphong_frag},standard:{uniforms:(0,r.Ii)([s.f.common,s.f.envmap,s.f.aomap,s.f.lightmap,s.f.emissivemap,s.f.bumpmap,s.f.normalmap,s.f.displacementmap,s.f.roughnessmap,s.f.metalnessmap,s.f.fog,s.f.lights,{emissive:{value:new c.Q(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:i.v.meshphysical_vert,fragmentShader:i.v.meshphysical_frag},matcap:{uniforms:(0,r.Ii)([s.f.common,s.f.bumpmap,s.f.normalmap,s.f.displacementmap,s.f.fog,{matcap:{value:null}}]),vertexShader:i.v.meshmatcap_vert,fragmentShader:i.v.meshmatcap_frag},points:{uniforms:(0,r.Ii)([s.f.points,s.f.fog]),vertexShader:i.v.points_vert,fragmentShader:i.v.points_frag},dashed:{uniforms:(0,r.Ii)([s.f.common,s.f.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:i.v.linedashed_vert,fragmentShader:i.v.linedashed_frag},depth:{uniforms:(0,r.Ii)([s.f.common,s.f.displacementmap]),vertexShader:i.v.depth_vert,fragmentShader:i.v.depth_frag},normal:{uniforms:(0,r.Ii)([s.f.common,s.f.bumpmap,s.f.normalmap,s.f.displacementmap,{opacity:{value:1}}]),vertexShader:i.v.normal_vert,fragmentShader:i.v.normal_frag},sprite:{uniforms:(0,r.Ii)([s.f.sprite,s.f.fog]),vertexShader:i.v.sprite_vert,fragmentShader:i.v.sprite_frag},background:{uniforms:{uvTransform:{value:new l.d},t2D:{value:null}},vertexShader:i.v.background_vert,fragmentShader:i.v.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:i.v.cube_vert,fragmentShader:i.v.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:i.v.equirect_vert,fragmentShader:i.v.equirect_frag},distanceRGBA:{uniforms:(0,r.Ii)([s.f.common,s.f.displacementmap,{referencePosition:{value:new o.P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:i.v.distanceRGBA_vert,fragmentShader:i.v.distanceRGBA_frag},shadow:{uniforms:(0,r.Ii)([s.f.lights,s.f.fog,{color:{value:new c.Q(0)},opacity:{value:1}}]),vertexShader:i.v.shadow_vert,fragmentShader:i.v.shadow_frag}};h.physical={uniforms:(0,r.Ii)([h.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new c.Q(0)},clearcoatNormalScale:{value:new a.I(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:i.v.meshphysical_vert,fragmentShader:i.v.meshphysical_frag}},3252:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform sampler2D t2D;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n"},7577:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n"},3625:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\nvoid main() {\n\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n"},3940:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n"},6533:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\n\t#endif\n\n}\n"},9544:(e,t,n)=>{n.d(t,{A:()=>i});const i="\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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\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\n}\n"},9005:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n"},1616:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\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\n\tvWorldPosition = worldPosition.xyz;\n\n}\n"},6857:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV;\n\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n"},1103:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n}\n"},860:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n"},334:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <color_vertex>\n\n\tvLineDistance = scale * lineDistance;\n\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n"},7861:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\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 <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\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\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n"},8152:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\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\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n"},4078:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\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 <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 <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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\t#include <lightmap_fragment>\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\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}\n"},9863:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\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\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}\n"},9575:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\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; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( 1.0 );\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n"},5350:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\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\n\t#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\t\tvNormal = normalize( transformedNormal );\n\n\t#endif\n\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\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n"},2218:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\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 <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 <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\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\n}\n"},8672:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\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 <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n"},8400:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\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 <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 <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t// this is a stub for the transparency model\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\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\n}\n"},5133:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\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 <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n"},7267:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n}\n"},7866:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\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\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n"},4711:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n"},7910:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform float size;\nuniform float scale;\n\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>\n\nvoid main() {\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n"},4828:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform vec3 color;\nuniform float opacity;\n\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>\n\nvoid main() {\n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include <fog_fragment>\n\n}\n"},9425:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n\nvoid main() {\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n"},3741:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n"},6544:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform float rotation;\nuniform vec2 center;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\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\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\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\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n"},4514:(e,t,n)=>{n.d(t,{A:()=>i});const i="\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include <packing>\n\nvoid main() {\n\n float mean = 0.0;\n float squared_mean = 0.0;\n\n\t// This seems totally useless but it's a crazy work around for a Adreno compiler bug\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\n #ifdef HORIZONAL_PASS\n\n vec2 distribution = unpack2HalfToRGBA ( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n #else\n\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n\n #endif\n\n }\n\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n\n float std_dev = sqrt( squared_mean - mean * mean );\n\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n"},2883:(e,t,n)=>{n.d(t,{A:()=>i});const i="\n\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n\n"},2994:(e,t,n)=>{n.d(t,{f:()=>o});var i=n(4036),r=n(6460),a=n(7681),o={common:{diffuse:{value:new i.Q(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new a.d},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new r.I(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 i.Q(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new i.Q(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new a.d}},sprite:{diffuse:{value:new i.Q(15658734)},opacity:{value:1},center:{value:new r.I(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new a.d}}}},5572:(e,t,n)=>{function i(e){var t={};for(var n in e)for(var i in t[n]={},e[n]){var r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}return t}function r(e){for(var t={},n=0;n<e.length;n++){var r=i(e[n]);for(var a in r)t[a]=r[a]}return t}n.d(t,{Ii:()=>r,lx:()=>i})},8144:(e,t,n)=>{function i(){var e=null,t=!1,n=null;function i(r,a){!1!==t&&(n(r,a),e.requestAnimationFrame(i))}return{start:function(){!0!==t&&null!==n&&(e.requestAnimationFrame(i),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}n.d(t,{O:()=>i})},5649:(e,t,n)=>{function i(e){var t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){n.isInterleavedBufferAttribute&&(n=n.data);var r=t.get(n);void 0===r?t.set(n,function(t,n){var i=t.array,r=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,i,r),t.onUploadCallback();var o=e.FLOAT;return i instanceof Float32Array?o=e.FLOAT:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?o=e.UNSIGNED_SHORT:i instanceof Int16Array?o=e.SHORT:i instanceof Uint32Array?o=e.UNSIGNED_INT:i instanceof Int32Array?o=e.INT:i instanceof Int8Array?o=e.BYTE:i instanceof Uint8Array&&(o=e.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(n,i)):r.version<n.version&&(function(t,n,i){var r=n.array,a=n.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,r):(e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r.subarray(a.offset,a.offset+a.count)),a.count=-1)}(r.buffer,n,i),r.version=n.version)}}}n.d(t,{B:()=>i})},8916:(e,t,n)=>{n.d(t,{q:()=>u});var i=n(2709),r=n(1752),a=n(1727),o=n(7757),s=n(4036),c=n(2842),l=n(1334),h=n(5572);function u(e,t,n,u){var d,p,f=new s.Q(0),m=0,g=null,v=0;function y(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,u)}return{getClearColor:function(){return f},setClearColor:function(e,t){f.set(e),y(f,m=void 0!==t?t:1)},getClearAlpha:function(){return m},setClearAlpha:function(e){y(f,m=e)},render:function(t,s,u,x){var _=s.background,b=e.vr,w=b.getSession&&b.getSession();if(w&&"additive"===w.environmentBlendMode&&(_=null),null===_?(y(f,m),g=null,v=0):_&&_.isColor&&(y(_,1),x=!0,g=null,v=0),(e.autoClear||x)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),_&&(_.isCubeTexture||_.isWebGLRenderTargetCube)){void 0===p&&((p=new c.e(new r.w(1,1,1),new o.B({type:"BackgroundCubeMaterial",uniforms:(0,h.lx)(l.z.cube.uniforms),vertexShader:l.z.cube.vertexShader,fragmentShader:l.z.cube.fragmentShader,side:i.hsX,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(p.material,"map",{get:function(){return this.uniforms.tCube.value}}),n.update(p));var M=_.isWebGLRenderTargetCube?_.texture:_;p.material.uniforms.tCube.value=M,p.material.uniforms.tFlip.value=_.isWebGLRenderTargetCube?1:-1,g===_&&v===M.version||(p.material.needsUpdate=!0,g=_,v=M.version),t.unshift(p,p.geometry,p.material,0,0,null)}else _&&_.isTexture&&(void 0===d&&((d=new c.e(new a.p(2,2),new o.B({type:"BackgroundMaterial",uniforms:(0,h.lx)(l.z.background.uniforms),vertexShader:l.z.background.vertexShader,fragmentShader:l.z.background.fragmentShader,side:i.hB5,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(d)),d.material.uniforms.t2D.value=_,!0===_.matrixAutoUpdate&&_.updateMatrix(),d.material.uniforms.uvTransform.value.copy(_.matrix),g===_&&v===_.version||(d.material.needsUpdate=!0,g=_,v=_.version),t.unshift(d,d.geometry,d.material,0,0,null))}}}},5525:(e,t,n)=>{function i(e,t,n,i){var r,a=i.isWebGL2;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r)},this.renderInstances=function(i,o,s,c){if(0!==c){var l,h;if(a)l=e,h="drawArraysInstanced";else if(h="drawArraysInstancedANGLE",null===(l=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[h](r,o,s,c),n.update(s,r,c)}}}n.d(t,{b:()=>i})},8914:(e,t,n)=>{function i(e,t,n){var i;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===n.logarithmicDepthBuffer,l=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),d=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),p=e.getParameter(e.MAX_VERTEX_ATTRIBS),f=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),m=e.getParameter(e.MAX_VARYING_VECTORS),g=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),v=h>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=t.get("EXT_texture_filter_anisotropic");return i=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?e.getParameter(e.MAX_SAMPLES):0}}n.d(t,{E:()=>i})},8618:(e,t,n)=>{n.d(t,{u:()=>a});var i=n(7681),r=n(6181);function a(){var e=this,t=null,n=0,a=!1,o=!1,s=new r.Z,c=new i.d,l={value:null,needsUpdate:!1};function h(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(t,n,i,r){var a=null!==t?t.length:0,o=null;if(0!==a){if(o=l.value,!0!==r||null===o){var h=i+4*a,u=n.matrixWorldInverse;c.getNormalMatrix(u),(null===o||o.length<h)&&(o=new Float32Array(h));for(var d=0,p=i;d!==a;++d,p+=4)s.copy(t[d]).applyMatrix4(u,c),s.normal.toArray(o,p),o[p+3]=s.constant}l.value=o,l.needsUpdate=!0}return e.numPlanes=a,o}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,r){var o=0!==e.length||i||0!==n||a;return a=i,t=u(e,r,0),n=e.length,o},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,h()},this.setState=function(e,i,r,s,c,d){if(!a||null===e||0===e.length||o&&!r)o?u(null):h();else{var p=o?0:n,f=4*p,m=c.clippingState||null;l.value=m,m=u(e,s,f,d);for(var g=0;g!==f;++g)m[g]=t[g];c.clippingState=m,this.numIntersection=i?this.numPlanes:0,this.numPlanes+=p}}}},7814:(e,t,n)=>{function i(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=i,i}}}n.d(t,{C:()=>i})},6424:(e,t,n)=>{n.d(t,{G:()=>o});var i=n(2120),r=n(4918),a=n(2521);function o(e,t,n){var o=new WeakMap,s=new WeakMap;function c(e){var i=e.target,r=o.get(i);for(var a in null!==r.index&&t.remove(r.index),r.attributes)t.remove(r.attributes[a]);i.removeEventListener("dispose",c),o.delete(i);var l=s.get(r);l&&(t.remove(l),s.delete(r)),n.memory.geometries--}function l(n){var r=[],o=n.index,c=n.attributes.position,l=0;if(null!==o){var h=o.array;l=o.version;for(var u=0,d=h.length;u<d;u+=3){var p=h[u+0],f=h[u+1],m=h[u+2];r.push(p,f,f,m,m,p)}}else for(h=c.array,l=c.version,u=0,d=h.length/3-1;u<d;u+=3)p=u+0,f=u+1,m=u+2,r.push(p,f,f,m,m,p);var g=new((0,a._)(r)>65535?i.MW:i.A$)(r,1);g.version=l,t.update(g,e.ELEMENT_ARRAY_BUFFER);var v=s.get(n);v&&t.remove(v),s.set(n,g)}return{get:function(e,t){var i=o.get(t);return i||(t.addEventListener("dispose",c),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new r.L).setFromObject(e)),i=t._bufferGeometry),o.set(t,i),n.memory.geometries++,i)},update:function(n){var i=n.index,r=n.attributes;for(var a in null!==i&&t.update(i,e.ELEMENT_ARRAY_BUFFER),r)t.update(r[a],e.ARRAY_BUFFER);var o=n.morphAttributes;for(var a in o)for(var s=o[a],c=0,l=s.length;c<l;c++)t.update(s[c],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){var t=s.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&l(e)}else l(e);return s.get(e)}}}},6746:(e,t,n)=>{function i(e,t,n,i){var r,a,o,s=i.isWebGL2;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,i){e.drawElements(r,i,a,t*o),n.update(i,r)},this.renderInstances=function(i,c,l,h){if(0!==h){var u,d;if(s)u=e,d="drawElementsInstanced";else if(d="drawElementsInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[d](r,l,a,c*o,h),n.update(l,r,h)}}}n.d(t,{W:()=>i})},5868:(e,t,n)=>{function i(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,i,r){switch(r=r||1,t.calls++,i){case e.TRIANGLES:t.triangles+=r*(n/3);break;case e.TRIANGLE_STRIP:case e.TRIANGLE_FAN:t.triangles+=r*(n-2);break;case e.LINES:t.lines+=r*(n/2);break;case e.LINE_STRIP:t.lines+=r*(n-1);break;case e.LINE_LOOP:t.lines+=r*n;break;case e.POINTS:t.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}n.d(t,{i:()=>i})},6101:(e,t,n)=>{n.d(t,{F:()=>h});var i=n(4036),r=n(2612),a=n(6460),o=n(2547);function s(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new o.P,color:new i.Q,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new a.I};break;case"SpotLight":n={position:new o.P,direction:new o.P,color:new i.Q,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new a.I};break;case"PointLight":n={position:new o.P,color:new i.Q,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new a.I,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new o.P,skyColor:new i.Q,groundColor:new i.Q};break;case"RectAreaLight":n={color:new i.Q,position:new o.P,halfWidth:new o.P,halfHeight:new o.P}}return e[t.id]=n,n}}}var c=0;function l(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function h(){for(var e=new s,t={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:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)t.probe.push(new o.P);var i=new o.P,a=new r.k,h=new r.k;return{setup:function(n,r,o){for(var s=0,u=0,d=0,p=0;p<9;p++)t.probe[p].set(0,0,0);var f=0,m=0,g=0,v=0,y=0,x=0,_=0,b=0,w=o.matrixWorldInverse;n.sort(l),p=0;for(var M=n.length;p<M;p++){var S=n[p],E=S.color,T=S.intensity,A=S.distance,L=S.shadow&&S.shadow.map?S.shadow.map.texture:null;if(S.isAmbientLight)s+=E.r*T,u+=E.g*T,d+=E.b*T;else if(S.isLightProbe)for(var P=0;P<9;P++)t.probe[P].addScaledVector(S.sh.coefficients[P],T);else if(S.isDirectionalLight){if((C=e.get(S)).color.copy(S.color).multiplyScalar(S.intensity),C.direction.setFromMatrixPosition(S.matrixWorld),i.setFromMatrixPosition(S.target.matrixWorld),C.direction.sub(i),C.direction.transformDirection(w),C.shadow=S.castShadow,S.castShadow){var R=S.shadow;C.shadowBias=R.bias,C.shadowRadius=R.radius,C.shadowMapSize=R.mapSize,t.directionalShadowMap[f]=L,t.directionalShadowMatrix[f]=S.shadow.matrix,x++}t.directional[f]=C,f++}else if(S.isSpotLight)(C=e.get(S)).position.setFromMatrixPosition(S.matrixWorld),C.position.applyMatrix4(w),C.color.copy(E).multiplyScalar(T),C.distance=A,C.direction.setFromMatrixPosition(S.matrixWorld),i.setFromMatrixPosition(S.target.matrixWorld),C.direction.sub(i),C.direction.transformDirection(w),C.coneCos=Math.cos(S.angle),C.penumbraCos=Math.cos(S.angle*(1-S.penumbra)),C.decay=S.decay,C.shadow=S.castShadow,S.castShadow&&(R=S.shadow,C.shadowBias=R.bias,C.shadowRadius=R.radius,C.shadowMapSize=R.mapSize,t.spotShadowMap[g]=L,t.spotShadowMatrix[g]=S.shadow.matrix,b++),t.spot[g]=C,g++;else if(S.isRectAreaLight)(C=e.get(S)).color.copy(E).multiplyScalar(T),C.position.setFromMatrixPosition(S.matrixWorld),C.position.applyMatrix4(w),h.identity(),a.copy(S.matrixWorld),a.premultiply(w),h.extractRotation(a),C.halfWidth.set(.5*S.width,0,0),C.halfHeight.set(0,.5*S.height,0),C.halfWidth.applyMatrix4(h),C.halfHeight.applyMatrix4(h),t.rectArea[v]=C,v++;else if(S.isPointLight)(C=e.get(S)).position.setFromMatrixPosition(S.matrixWorld),C.position.applyMatrix4(w),C.color.copy(S.color).multiplyScalar(S.intensity),C.distance=S.distance,C.decay=S.decay,C.shadow=S.castShadow,S.castShadow&&(R=S.shadow,C.shadowBias=R.bias,C.shadowRadius=R.radius,C.shadowMapSize=R.mapSize,C.shadowCameraNear=R.camera.near,C.shadowCameraFar=R.camera.far,t.pointShadowMap[m]=L,t.pointShadowMatrix[m]=S.shadow.matrix,_++),t.point[m]=C,m++;else if(S.isHemisphereLight){var C;(C=e.get(S)).direction.setFromMatrixPosition(S.matrixWorld),C.direction.transformDirection(w),C.direction.normalize(),C.skyColor.copy(S.color).multiplyScalar(T),C.groundColor.copy(S.groundColor).multiplyScalar(T),t.hemi[y]=C,y++}}t.ambient[0]=s,t.ambient[1]=u,t.ambient[2]=d;var N=t.hash;N.directionalLength===f&&N.pointLength===m&&N.spotLength===g&&N.rectAreaLength===v&&N.hemiLength===y&&N.numDirectionalShadows===x&&N.numPointShadows===_&&N.numSpotShadows===b||(t.directional.length=f,t.spot.length=g,t.rectArea.length=v,t.point.length=m,t.hemi.length=y,t.directionalShadowMap.length=x,t.pointShadowMap.length=_,t.spotShadowMap.length=b,t.directionalShadowMatrix.length=x,t.pointShadowMatrix.length=_,t.spotShadowMatrix.length=b,N.directionalLength=f,N.pointLength=m,N.spotLength=g,N.rectAreaLength=v,N.hemiLength=y,N.numDirectionalShadows=x,N.numPointShadows=_,N.numSpotShadows=b,t.version=c++)},state:t}}},9187:(e,t,n)=>{function i(e,t){return Math.abs(t[1])-Math.abs(e[1])}function r(e){var t={},n=new Float32Array(8);return{update:function(r,a,o,s){var c=r.morphTargetInfluences,l=c.length,h=t[a.id];if(void 0===h){h=[];for(var u=0;u<l;u++)h[u]=[u,0];t[a.id]=h}var d=o.morphTargets&&a.morphAttributes.position,p=o.morphNormals&&a.morphAttributes.normal;for(u=0;u<l;u++)0!==(m=h[u])[1]&&(d&&a.deleteAttribute("morphTarget"+u),p&&a.deleteAttribute("morphNormal"+u));for(u=0;u<l;u++)(m=h[u])[0]=u,m[1]=c[u];h.sort(i);var f=0;for(u=0;u<8;u++){var m;if(m=h[u]){var g=m[0],v=m[1];if(v){d&&a.setAttribute("morphTarget"+u,d[g]),p&&a.setAttribute("morphNormal"+u,p[g]),n[u]=v,f+=v;continue}}n[u]=0}var y=a.morphTargetsRelative?1:1-f;s.getUniforms().setValue(e,"morphTargetBaseInfluence",y),s.getUniforms().setValue(e,"morphTargetInfluences",n)}}}n.d(t,{u:()=>r})},9598:(e,t,n)=>{n.d(t,{W:()=>s});var i=n(8605),r=n(7681),a=n(2612),o=n(6460);function s(e,t){var n,s,c,l,h,u,d,p=e.extensions,f=e.properties,m=0;function g(e){return e.isArrayCamera?e.cameras:(h[0]=e,h)}this.isAvailable=function(){if(void 0===d){var e=p.get("OVR_multiview2");if(d=null!==e&&!1===t.getContextAttributes().antialias){m=t.getParameter(e.MAX_VIEWS_OVR),n=new i.D(0,0,2),u=new o.I,l=[],c=[],h=[];for(var s=0;s<m;s++)l[s]=new a.k,c[s]=new r.d}}return d},this.attachCamera=function(t){!1!==function(e){if(void 0===e.isArrayCamera)return!0;var t=e.cameras;if(t.length>m)return!1;for(var n=1,i=t.length;n<i;n++)if(t[0].viewport.z!==t[n].viewport.z||t[0].viewport.w!==t[n].viewport.w)return!1;return!0}(t)&&(s=e.getRenderTarget(),function(t){if(s?u.set(s.width,s.height):e.getDrawingBufferSize(u),t.isArrayCamera){var i=t.cameras[0].viewport;n.setSize(i.z,i.w),n.setNumViews(t.cameras.length)}else n.setSize(u.x,u.y),n.setNumViews(2)}(t),e.setRenderTarget(n))},this.detachCamera=function(i){n===e.getRenderTarget()&&(e.setRenderTarget(s),function(e){var i=n,r=i.numViews,a=f.get(i).__webglViewFramebuffers,o=i.width,s=i.height;if(e.isArrayCamera)for(var c=0;c<r;c++){var l=e.cameras[c].viewport,h=l.x,d=l.y,p=h+l.z,m=d+l.w;t.bindFramebuffer(t.READ_FRAMEBUFFER,a[c]),t.blitFramebuffer(0,0,o,s,h,d,p,m,t.COLOR_BUFFER_BIT,t.NEAREST)}else t.bindFramebuffer(t.READ_FRAMEBUFFER,a[0]),t.blitFramebuffer(0,0,o,s,0,0,u.x,u.y,t.COLOR_BUFFER_BIT,t.NEAREST)}(i))},this.updateCameraProjectionMatricesUniform=function(e,n){for(var i=g(e),r=0;r<i.length;r++)l[r].copy(i[r].projectionMatrix);n.setValue(t,"projectionMatrices",l)},this.updateCameraViewMatricesUniform=function(e,n){for(var i=g(e),r=0;r<i.length;r++)l[r].copy(i[r].matrixWorldInverse);n.setValue(t,"viewMatrices",l)},this.updateObjectMatricesUniforms=function(e,n,i){for(var r=g(n),a=0;a<r.length;a++)l[a].multiplyMatrices(r[a].matrixWorldInverse,e.matrixWorld),c[a].getNormalMatrix(l[a]);i.setValue(t,"modelViewMatrices",l),i.setValue(t,"normalMatrices",c)}}},3722:(e,t,n)=>{function i(e,t,n,i){var r={};return{update:function(a){var o=i.render.frame,s=a.geometry,c=t.get(a,s);return r[c.id]!==o&&(s.isGeometry&&c.updateFromObject(a),t.update(c),r[c.id]=o),a.isInstancedMesh&&n.update(a.instanceMatrix,e.ARRAY_BUFFER),c},dispose:function(){r={}}}}n.d(t,{C:()=>i})},8790:(e,t,n)=>{n.d(t,{_:()=>w});var i=n(9829),r=n(2809),a=n(8576),o=n(2709),s=0;function c(e){switch(e){case o.tgE:return["Linear","( value )"];case o.S2Q:return["sRGB","( value )"];case o.MC9:return["RGBE","( value )"];case o.FQJ:return["RGBM","( value, 7.0 )"];case o.z9p:return["RGBM","( value, 16.0 )"];case o.JcV:return["RGBD","( value, 256.0 )"];case o.big:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case o.bbI:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function l(e,t,n){var i=e.getShaderParameter(t,e.COMPILE_STATUS),r=e.getShaderInfoLog(t).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+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 h(e,t){var n=c(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function u(e,t){var n;switch(t){case o.kyO:n="Linear";break;case o.Mjd:n="Reinhard";break;case o.h9m:n="Uncharted2";break;case o.nNL:n="OptimizedCineon";break;case o.FV:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function d(e){return""!==e}function p(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 f(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var m=/^[ \t]*#include +<([\w\d./]+)>/gm;function g(e){return e.replace(m,v)}function v(e,t){var n=a.v[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return g(n)}var y=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function x(e){return e.replace(y,_)}function _(e,t,n,i){for(var r="",a=parseInt(t);a<parseInt(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function b(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 w(e,t,n,m,v,y){var _,w,M,S,E=e.getContext(),T=m.defines,A=v.vertexShader,L=v.fragmentShader,P=function(e){var t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===o.QP0?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===o.Wk7?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===o.RyA&&(t="SHADOWMAP_TYPE_VSM"),t}(y),R=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case o.hy7:case o.xFO:t="ENVMAP_TYPE_CUBE";break;case o.Om:case o.GFA:t="ENVMAP_TYPE_CUBE_UV";break;case o.wfO:case o.uV5:t="ENVMAP_TYPE_EQUIREC";break;case o.TdS:t="ENVMAP_TYPE_SPHERE"}return t}(y),C=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case o.xFO:case o.uV5:t="ENVMAP_MODE_REFRACTION"}return t}(y),N=function(e){var t="ENVMAP_BLENDING_MULTIPLY";if(e.envMap)switch(e.combine){case o.caT:t="ENVMAP_BLENDING_MULTIPLY";break;case o.KRh:t="ENVMAP_BLENDING_MIX";break;case o.XrR:t="ENVMAP_BLENDING_ADD"}return t}(y),D=e.gammaFactor>0?e.gammaFactor:1,I=y.isWebGL2?"":function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(d).join("\n")}(m.extensions,y,t),O=function(e){var t=[];for(var n in e){var i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(T),U=E.createProgram(),z=y.numMultiviewViews;if(m.isRawShaderMaterial?((_=[O].filter(d).join("\n")).length>0&&(_+="\n"),(w=[I,O].filter(d).join("\n")).length>0&&(w+="\n")):(_=[b(y),"#define SHADER_NAME "+v.name,O,y.instancing?"#define USE_INSTANCING":"",y.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+D,"#define MAX_BONES "+y.maxBones,y.useFog&&y.fog?"#define USE_FOG":"",y.useFog&&y.fogExp2?"#define FOG_EXP2":"",y.map?"#define USE_MAP":"",y.envMap?"#define USE_ENVMAP":"",y.envMap?"#define "+C:"",y.lightMap?"#define USE_LIGHTMAP":"",y.aoMap?"#define USE_AOMAP":"",y.emissiveMap?"#define USE_EMISSIVEMAP":"",y.bumpMap?"#define USE_BUMPMAP":"",y.normalMap?"#define USE_NORMALMAP":"",y.normalMap&&y.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",y.normalMap&&y.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",y.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",y.displacementMap&&y.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",y.specularMap?"#define USE_SPECULARMAP":"",y.roughnessMap?"#define USE_ROUGHNESSMAP":"",y.metalnessMap?"#define USE_METALNESSMAP":"",y.alphaMap?"#define USE_ALPHAMAP":"",y.vertexTangents?"#define USE_TANGENT":"",y.vertexColors?"#define USE_COLOR":"",y.vertexUvs?"#define USE_UV":"",y.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",y.flatShading?"#define FLAT_SHADED":"",y.skinning?"#define USE_SKINNING":"",y.useVertexTexture?"#define BONE_TEXTURE":"",y.morphTargets?"#define USE_MORPHTARGETS":"",y.morphNormals&&!1===y.flatShading?"#define USE_MORPHNORMALS":"",y.doubleSided?"#define DOUBLE_SIDED":"",y.flipSided?"#define FLIP_SIDED":"",y.shadowMapEnabled?"#define USE_SHADOWMAP":"",y.shadowMapEnabled?"#define "+P:"",y.sizeAttenuation?"#define USE_SIZEATTENUATION":"",y.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",y.logarithmicDepthBuffer&&(y.isWebGL2||t.get("EXT_frag_depth"))?"#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"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\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(d).join("\n"),w=[I,b(y),"#define SHADER_NAME "+v.name,O,y.alphaTest?"#define ALPHATEST "+y.alphaTest+(y.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+D,y.useFog&&y.fog?"#define USE_FOG":"",y.useFog&&y.fogExp2?"#define FOG_EXP2":"",y.map?"#define USE_MAP":"",y.matcap?"#define USE_MATCAP":"",y.envMap?"#define USE_ENVMAP":"",y.envMap?"#define "+R:"",y.envMap?"#define "+C:"",y.envMap?"#define "+N:"",y.lightMap?"#define USE_LIGHTMAP":"",y.aoMap?"#define USE_AOMAP":"",y.emissiveMap?"#define USE_EMISSIVEMAP":"",y.bumpMap?"#define USE_BUMPMAP":"",y.normalMap?"#define USE_NORMALMAP":"",y.normalMap&&y.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",y.normalMap&&y.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",y.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",y.specularMap?"#define USE_SPECULARMAP":"",y.roughnessMap?"#define USE_ROUGHNESSMAP":"",y.metalnessMap?"#define USE_METALNESSMAP":"",y.alphaMap?"#define USE_ALPHAMAP":"",y.sheen?"#define USE_SHEEN":"",y.vertexTangents?"#define USE_TANGENT":"",y.vertexColors?"#define USE_COLOR":"",y.vertexUvs?"#define USE_UV":"",y.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",y.gradientMap?"#define USE_GRADIENTMAP":"",y.flatShading?"#define FLAT_SHADED":"",y.doubleSided?"#define DOUBLE_SIDED":"",y.flipSided?"#define FLIP_SIDED":"",y.shadowMapEnabled?"#define USE_SHADOWMAP":"",y.shadowMapEnabled?"#define "+P:"",y.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",y.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",y.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",y.logarithmicDepthBuffer&&(y.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",(m.extensions&&m.extensions.shaderTextureLOD||y.envMap)&&(y.isWebGL2||t.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",y.toneMapping!==o.y_p?"#define TONE_MAPPING":"",y.toneMapping!==o.y_p?a.v.tonemapping_pars_fragment:"",y.toneMapping!==o.y_p?u("toneMapping",y.toneMapping):"",y.dithering?"#define DITHERING":"",y.outputEncoding||y.mapEncoding||y.matcapEncoding||y.envMapEncoding||y.emissiveMapEncoding?a.v.encodings_pars_fragment:"",y.mapEncoding?h("mapTexelToLinear",y.mapEncoding):"",y.matcapEncoding?h("matcapTexelToLinear",y.matcapEncoding):"",y.envMapEncoding?h("envMapTexelToLinear",y.envMapEncoding):"",y.emissiveMapEncoding?h("emissiveMapTexelToLinear",y.emissiveMapEncoding):"",y.outputEncoding?(M=y.outputEncoding,S=c(M),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+S[0]+S[1]+"; }"):"",y.depthPacking?"#define DEPTH_PACKING "+m.depthPacking:"","\n"].filter(d).join("\n")),A=f(A=p(A=g(A),y),y),L=f(L=p(L=g(L),y),y),A=x(A),L=x(L),y.isWebGL2&&!m.isRawShaderMaterial){var F=!1,B=/^\s*#version\s+300\s+es\s*\n/;m.isShaderMaterial&&null!==A.match(B)&&null!==L.match(B)&&(F=!0,A=A.replace(B,""),L=L.replace(B,"")),_=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+_,w=["#version 300 es\n","#define varying in",F?"":"out highp vec4 pc_fragColor;",F?"":"#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"+w,z>0&&(_=(_=_.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+z+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+z+"];","uniform mat4 projectionMatrices["+z+"];","uniform mat4 viewMatrices["+z+"];","uniform mat3 normalMatrices["+z+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),w=(w=w.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+z+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var G,V,H=_+A,k=w+L,W=(0,r.n)(E,E.VERTEX_SHADER,H),j=(0,r.n)(E,E.FRAGMENT_SHADER,k);if(E.attachShader(U,W),E.attachShader(U,j),void 0!==m.index0AttributeName?E.bindAttribLocation(U,0,m.index0AttributeName):!0===y.morphTargets&&E.bindAttribLocation(U,0,"position"),E.linkProgram(U),e.debug.checkShaderErrors){var q=E.getProgramInfoLog(U).trim(),X=E.getShaderInfoLog(W).trim(),Y=E.getShaderInfoLog(j).trim(),Z=!0,J=!0;if(!1===E.getProgramParameter(U,E.LINK_STATUS)){Z=!1;var Q=l(E,W,"vertex"),K=l(E,j,"fragment");console.error("THREE.WebGLProgram: shader error: ",E.getError(),"gl.VALIDATE_STATUS",E.getProgramParameter(U,E.VALIDATE_STATUS),"gl.getProgramInfoLog",q,Q,K)}else""!==q?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",q):""!==X&&""!==Y||(J=!1);J&&(this.diagnostics={runnable:Z,material:m,programLog:q,vertexShader:{log:X,prefix:_},fragmentShader:{log:Y,prefix:w}})}return E.deleteShader(W),E.deleteShader(j),this.getUniforms=function(){return void 0===G&&(G=new i.H(E,U)),G},this.getAttributes=function(){return void 0===V&&(V=function(e,t){for(var n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),r=0;r<i;r++){var a=e.getActiveAttrib(t,r).name;n[a]=e.getAttribLocation(t,a)}return n}(E,U)),V},this.destroy=function(){E.deleteProgram(U),this.program=void 0},this.name=v.name,this.id=s++,this.cacheKey=n,this.usedTimes=1,this.program=U,this.vertexShader=W,this.fragmentShader=j,this.numMultiviewViews=z,this}},8925:(e,t,n)=>{n.d(t,{t:()=>a});var i=n(2709),r=n(8790);function a(e,t,n){var a=[],o=n.isWebGL2,s=n.logarithmicDepthBuffer,c=n.floatVertexTextures,l=n.precision,h=n.maxVertexUniforms,u=n.vertexTextures,d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},p=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function f(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=i.tgE,n===i.tgE&&t&&(n=i.big),n}this.getParameters=function(t,r,a,p,m,g,v){var y=d[t.type],x=v.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(c)return 1024;var n=h,i=Math.floor((n-20)/4),r=Math.min(i,t.length);return r<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+r+"."),0):r}(v):0;null!==t.precision&&(l=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",l,"instead.");var _=e.getRenderTarget(),b=_&&_.isWebGLMultiviewRenderTarget?_.numViews:0;return{isWebGL2:o,shaderID:y,precision:l,instancing:!0===v.isInstancedMesh,supportsVertexTextures:u,numMultiviewViews:b,outputEncoding:f(_?_.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:f(t.map,e.gammaInput),matcap:!!t.matcap,matcapEncoding:f(t.matcap,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:f(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===i.Om||t.envMap.mapping===i.GFA),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:f(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===i.vyJ,tangentSpaceNormalMap:t.normalMapType===i.bI3,clearcoatNormalMap:!!t.clearcoatNormalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,sheen:!!t.sheen,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,vertexUvs:!!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||t.displacementMap),uvsVertexOnly:!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||!t.displacementMap),fog:!!p,useFog:t.fog,fogExp2:p&&p.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:s,skinning:t.skinning&&x>0,maxBones:x,useVertexTexture:c,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:g,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&a.length>0,shadowMapType:e.shadowMap.type,toneMapping:t.toneMapped?e.toneMapping:i.y_p,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===i.$EB,flipSided:t.side===i.hsX,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCacheKey=function(t,n){var i=[];if(n.shaderID?i.push(n.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)i.push(r),i.push(t.defines[r]);for(var a=0;a<p.length;a++)i.push(n[p[a]]);return i.push(t.onBeforeCompile.toString()),i.push(e.gammaOutput),i.push(e.gammaFactor),i.join()},this.acquireProgram=function(n,i,o,s){for(var c,l=0,h=a.length;l<h;l++){var u=a[l];if(u.cacheKey===s){++(c=u).usedTimes;break}}return void 0===c&&(c=new r._(e,t,s,n,i,o),a.push(c)),c},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=a.indexOf(e);a[t]=a[a.length-1],a.pop(),e.destroy()}},this.programs=a}},973:(e,t,n)=>{function i(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}n.d(t,{R:()=>i})},6995:(e,t,n)=>{function i(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 r(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 a(){var e=[],t=0,n=[],a=[],o={id:-1};function s(n,i,r,a,s,c){var l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,program:r.program||o,groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.program=r.program||o,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}return{opaque:n,transparent:a,init:function(){t=0,n.length=0,a.length=0},push:function(e,t,i,r,o,c){var l=s(e,t,i,r,o,c);(!0===i.transparent?a:n).push(l)},unshift:function(e,t,i,r,o,c){var l=s(e,t,i,r,o,c);(!0===i.transparent?a:n).unshift(l)},sort:function(){n.length>1&&n.sort(i),a.length>1&&a.sort(r)}}}function o(){var e=new WeakMap;function t(n){var i=n.target;i.removeEventListener("dispose",t),e.delete(i)}return{get:function(n,i){var r,o=e.get(n);return void 0===o?(r=new a,e.set(n,new WeakMap),e.get(n).set(i,r),n.addEventListener("dispose",t)):void 0===(r=o.get(i))&&(r=new a,o.set(i,r)),r},dispose:function(){e=new WeakMap}}}n.d(t,{$:()=>o})},2482:(e,t,n)=>{n.d(t,{o:()=>a});var i=n(6101);function r(){var e=new i.F,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(i){e.setup(t,n,i)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function a(){var e=new WeakMap;function t(n){var i=n.target;i.removeEventListener("dispose",t),e.delete(i)}return{get:function(n,i){var a;return!1===e.has(n)?(a=new r,e.set(n,new WeakMap),e.get(n).set(i,a),n.addEventListener("dispose",t)):!1===e.get(n).has(i)?(a=new r,e.get(n).set(i,a)):a=e.get(n).get(i),a},dispose:function(){e=new WeakMap}}}},2809:(e,t,n)=>{function i(e,t,n){var i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}n.d(t,{n:()=>i})},768:(e,t,n)=>{n.d(t,{S:()=>g});var i=n(2709),r=n(6295),a=n(3878),o=n(8454),s=n(7757),c=n(2120),l=n(4918),h=n(2842),u=n(2506),d=n(6460),p=n(2033),f=n(4514),m=n(2883);function g(e,t,n){var g=new p.P,v=new d.I,y=new d.I,x=new u.I,_=[],b=[],w={},M={0:i.hsX,1:i.hB5,2:i.$EB},S=new s.B({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new d.I},radius:{value:4}},vertexShader:m.A,fragmentShader:f.A}),E=S.clone();E.defines.HORIZONAL_PASS=1;var T=new l.L;T.setAttribute("position",new c.TH(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var A=new h.e(T,S),L=this;function P(n,i){var r=t.update(A);S.uniforms.shadow_pass.value=n.map.texture,S.uniforms.resolution.value=n.mapSize,S.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,S,A,null),E.uniforms.shadow_pass.value=n.mapPass.texture,E.uniforms.resolution.value=n.mapSize,E.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,E,A,null)}function R(e,t,n){var r=e|t<<1|n<<2,o=_[r];return void 0===o&&(o=new a.C({depthPacking:i.N5j,morphTargets:e,skinning:t}),_[r]=o),o}function C(e,t,n){var i=e|t<<1|n<<2,r=b[i];return void 0===r&&(r=new o.a({morphTargets:e,skinning:t}),b[i]=r),r}function N(t,n,r,a,o,s){var c=t.geometry,l=null,h=R,u=t.customDepthMaterial;if(!0===r.isPointLight&&(h=C,u=t.customDistanceMaterial),void 0===u){var d=!1;!0===n.morphTargets&&(!0===c.isBufferGeometry?d=c.morphAttributes&&c.morphAttributes.position&&c.morphAttributes.position.length>0:!0===c.isGeometry&&(d=c.morphTargets&&c.morphTargets.length>0));var p=!1;!0===t.isSkinnedMesh&&(!0===n.skinning?p=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),l=h(d,p,!0===t.isInstancedMesh)}else l=u;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var f=l.uuid,m=n.uuid,g=w[f];void 0===g&&(g={},w[f]=g);var v=g[m];void 0===v&&(v=l.clone(),g[m]=v),l=v}return l.visible=n.visible,l.wireframe=n.wireframe,s===i.RyA?l.side=null!==n.shadowSide?n.shadowSide:n.side:l.side=null!==n.shadowSide?n.shadowSide:M[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=a,l.farDistance=o),l}function D(n,r,a,o,s){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===i.RyA)&&(!n.frustumCulled||g.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var c=t.update(n),l=n.material;if(Array.isArray(l))for(var h=c.groups,u=0,d=h.length;u<d;u++){var p=h[u],f=l[p.materialIndex];if(f&&f.visible){var m=N(n,f,o,a.near,a.far,s);e.renderBufferDirect(a,null,c,m,n,p)}}else l.visible&&(m=N(n,l,o,a.near,a.far,s),e.renderBufferDirect(a,null,c,m,n,null))}for(var v=n.children,y=0,x=v.length;y<x;y++)D(v[y],r,a,o,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=i.QP0,this.render=function(t,a,o){if(!1!==L.enabled&&(!1!==L.autoUpdate||!1!==L.needsUpdate)&&0!==t.length){var s=e.getRenderTarget(),c=e.getActiveCubeFace(),l=e.getActiveMipmapLevel(),h=e.state;h.setBlending(i.XIg),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);for(var u=0,d=t.length;u<d;u++){var p=t[u],f=p.shadow;if(void 0!==f){v.copy(f.mapSize);var m=f.getFrameExtents();if(v.multiply(m),y.copy(f.mapSize),(v.x>n||v.y>n)&&(console.warn("THREE.WebGLShadowMap:",p,"has shadow exceeding max texture size, reducing"),v.x>n&&(y.x=Math.floor(n/m.x),v.x=y.x*m.x,f.mapSize.x=y.x),v.y>n&&(y.y=Math.floor(n/m.y),v.y=y.y*m.y,f.mapSize.y=y.y)),null===f.map&&!f.isPointLightShadow&&this.type===i.RyA){var _={minFilter:i.k6q,magFilter:i.k6q,format:i.GWd};f.map=new r.n(v.x,v.y,_),f.map.texture.name=p.name+".shadowMap",f.mapPass=new r.n(v.x,v.y,_),f.camera.updateProjectionMatrix()}null===f.map&&(_={minFilter:i.hxR,magFilter:i.hxR,format:i.GWd},f.map=new r.n(v.x,v.y,_),f.map.texture.name=p.name+".shadowMap",f.camera.updateProjectionMatrix()),e.setRenderTarget(f.map),e.clear();for(var b=f.getViewportCount(),w=0;w<b;w++){var M=f.getViewport(w);x.set(y.x*M.x,y.y*M.y,y.x*M.z,y.y*M.w),h.viewport(x),f.updateMatrices(p,w),g=f.getFrustum(),D(a,o,f.camera,p,this.type)}f.isPointLightShadow||this.type!==i.RyA||P(f,o)}else console.warn("THREE.WebGLShadowMap:",p,"has no shadow.")}L.needsUpdate=!1,e.setRenderTarget(s,c,l)}}}},5787:(e,t,n)=>{n.d(t,{f:()=>s});var i=n(2709),r=n(2506);function a(e){return a="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},a(e)}function o(e,t,n){return(t=function(e){var t=function(e){if("object"!==a(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===a(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t,n){var a,s=n.isWebGL2,c=new function(){var t=!1,n=new r.I,i=null,a=new r.I(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,r,o,s){!0===s&&(t*=o,i*=o,r*=o),n.set(t,i,r,o),!1===a.equals(n)&&(e.clearColor(t,i,r,o),a.copy(n))},reset:function(){t=!1,i=null,a.set(-1,0,0,0)}}},l=new function(){var t=!1,n=null,r=null,a=null;return{setTest:function(t){t?H(e.DEPTH_TEST):k(e.DEPTH_TEST)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(r!==t){if(t)switch(t){case i.eHc:e.depthFunc(e.NEVER);break;case i.lGu:e.depthFunc(e.ALWAYS);break;case i.brA:e.depthFunc(e.LESS);break;case i.xSv:e.depthFunc(e.LEQUAL);break;case i.U3G:e.depthFunc(e.EQUAL);break;case i.Gwm:e.depthFunc(e.GEQUAL);break;case i.K52:e.depthFunc(e.GREATER);break;case i.bw0:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);r=t}},setLocked:function(e){t=e},setClear:function(t){a!==t&&(e.clearDepth(t),a=t)},reset:function(){t=!1,n=null,r=null,a=null}}},h=new function(){var t=!1,n=null,i=null,r=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(n){t||(n?H(e.STENCIL_TEST):k(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&r===n&&a===o||(e.stencilFunc(t,n,o),i=t,r=n,a=o)},setOp:function(t,n,i){o===t&&s===n&&c===i||(e.stencilOp(t,n,i),o=t,s=n,c=i)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,o=null,s=null,c=null,l=null}}},u=e.getParameter(e.MAX_VERTEX_ATTRIBS),d=new Uint8Array(u),p=new Uint8Array(u),f=new Uint8Array(u),m={},g=null,v=null,y=null,x=null,_=null,b=null,w=null,M=null,S=null,E=!1,T=null,A=null,L=null,P=null,R=null,C=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),N=!1,D=0,I=e.getParameter(e.VERSION);-1!==I.indexOf("WebGL")?(D=parseFloat(/^WebGL\ ([0-9])/.exec(I)[1]),N=D>=1):-1!==I.indexOf("OpenGL ES")&&(D=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(I)[1]),N=D>=2);var O=null,U={},z=new r.I,F=new r.I;function B(t,n,i){var r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var o=0;o<i;o++)e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,r);return a}var G={};function V(n,i){d[n]=1,0===p[n]&&(e.enableVertexAttribArray(n),p[n]=1),f[n]!==i&&((s?e:t.get("ANGLE_instanced_arrays"))[s?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),f[n]=i)}function H(t){!0!==m[t]&&(e.enable(t),m[t]=!0)}function k(t){!1!==m[t]&&(e.disable(t),m[t]=!1)}G[e.TEXTURE_2D]=B(e.TEXTURE_2D,e.TEXTURE_2D,1),G[e.TEXTURE_CUBE_MAP]=B(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),c.setClear(0,0,0,1),l.setClear(1),h.setClear(0),H(e.DEPTH_TEST),l.setFunc(i.xSv),Y(!1),Z(i.Vb5),H(e.CULL_FACE),X(i.XIg);var W=o(o(o({},i.gO9,e.FUNC_ADD),i.FXf,e.FUNC_SUBTRACT),i.nST,e.FUNC_REVERSE_SUBTRACT);if(s)W[i.znC]=e.MIN,W[i.$ei]=e.MAX;else{var j=t.get("EXT_blend_minmax");null!==j&&(W[i.znC]=j.MIN_EXT,W[i.$ei]=j.MAX_EXT)}var q=(o(o(o(o(o(o(o(o(o(o(a={},i.ojh,e.ZERO),i.qad,e.ONE),i.f4X,e.SRC_COLOR),i.ie2,e.SRC_ALPHA),i.hgQ,e.SRC_ALPHA_SATURATE),i.wn6,e.DST_COLOR),i.hdd,e.DST_ALPHA),i.LiQ,e.ONE_MINUS_SRC_COLOR),i.OuU,e.ONE_MINUS_SRC_ALPHA),i.aEY,e.ONE_MINUS_DST_COLOR),o(a,i.Nt7,e.ONE_MINUS_DST_ALPHA));function X(t,n,r,a,o,s,c,l){if(t!==i.XIg){if(v||(H(e.BLEND),v=!0),t===i.bCz)o=o||n,s=s||r,c=c||a,n===x&&o===w||(e.blendEquationSeparate(W[n],W[o]),x=n,w=o),r===_&&a===b&&s===M&&c===S||(e.blendFuncSeparate(q[r],q[a],q[s],q[c]),_=r,b=a,M=s,S=c),y=t,E=null;else if(t!==y||l!==E){if(x===i.gO9&&w===i.gO9||(e.blendEquation(e.FUNC_ADD),x=i.gO9,w=i.gO9),l)switch(t){case i.NTi:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case i.EZo:e.blendFunc(e.ONE,e.ONE);break;case i.Kwu:e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA);break;case i.EdD:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case i.NTi:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case i.EZo:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case i.Kwu:e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR);break;case i.EdD:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}_=null,b=null,M=null,S=null,y=t,E=l}}else v&&(k(e.BLEND),v=!1)}function Y(t){T!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),T=t)}function Z(t){t!==i.WNZ?(H(e.CULL_FACE),t!==A&&(t===i.Vb5?e.cullFace(e.BACK):t===i.Jnc?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):k(e.CULL_FACE),A=t}function J(t,n,i){t?(H(e.POLYGON_OFFSET_FILL),P===n&&R===i||(e.polygonOffset(n,i),P=n,R=i)):k(e.POLYGON_OFFSET_FILL)}function Q(t){void 0===t&&(t=e.TEXTURE0+C-1),O!==t&&(e.activeTexture(t),O=t)}return{buffers:{color:c,depth:l,stencil:h},initAttributes:function(){for(var e=0,t=d.length;e<t;e++)d[e]=0},enableAttribute:function(e){V(e,0)},enableAttributeAndDivisor:V,disableUnusedAttributes:function(){for(var t=0,n=p.length;t!==n;++t)p[t]!==d[t]&&(e.disableVertexAttribArray(t),p[t]=0)},enable:H,disable:k,useProgram:function(t){return g!==t&&(e.useProgram(t),g=t,!0)},setBlending:X,setMaterial:function(t,n){t.side===i.$EB?k(e.CULL_FACE):H(e.CULL_FACE);var r=t.side===i.hsX;n&&(r=!r),Y(r),t.blending===i.NTi&&!1===t.transparent?X(i.XIg):X(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),l.setFunc(t.depthFunc),l.setTest(t.depthTest),l.setMask(t.depthWrite),c.setMask(t.colorWrite);var a=t.stencilWrite;h.setTest(a),a&&(h.setMask(t.stencilWriteMask),h.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),h.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),J(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:Y,setCullFace:Z,setLineWidth:function(t){t!==L&&(N&&e.lineWidth(t),L=t)},setPolygonOffset:J,setScissorTest:function(t){t?H(e.SCISSOR_TEST):k(e.SCISSOR_TEST)},activeTexture:Q,bindTexture:function(t,n){null===O&&Q();var i=U[O];void 0===i&&(i={type:void 0,texture:void 0},U[O]=i),i.type===t&&i.texture===n||(e.bindTexture(t,n||G[t]),i.type=t,i.texture=n)},unbindTexture:function(){var t=U[O];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===z.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),z.copy(t))},viewport:function(t){!1===F.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),F.copy(t))},reset:function(){for(var t=0;t<p.length;t++)1===p[t]&&(e.disableVertexAttribArray(t),p[t]=0);m={},O=null,U={},g=null,y=null,T=null,A=null,c.reset(),l.reset(),h.reset()}}}},9680:(e,t,n)=>{n.d(t,{a:()=>s});var i=n(2709),r=n(5369);function a(e){return a="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},a(e)}function o(e,t,n){return(t=function(e){var t=function(e){if("object"!==a(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===a(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t,n,a,s,c,l){var h,u=s.isWebGL2,d=s.maxTextures,p=s.maxCubemapSize,f=s.maxTextureSize,m=s.maxSamples,g=new WeakMap,v="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d");function y(e,t){return v?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function x(e,t,n,i){var a=1;if((e.width>i||e.height>i)&&(a=i/Math.max(e.width,e.height)),a<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var o=t?r.q.floorPowerOfTwo:Math.floor,s=o(a*e.width),c=o(a*e.height);void 0===h&&(h=y(s,c));var l=n?y(s,c):h;return l.width=s,l.height=c,l.getContext("2d").drawImage(e,0,0,s,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+c+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function _(e){return r.q.isPowerOfTwo(e.width)&&r.q.isPowerOfTwo(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==i.hxR&&e.minFilter!==i.k6q}function w(t,n,i,r){e.generateMipmap(t),a.get(n).__maxMipLevel=Math.log(Math.max(i,r))*Math.LOG2E}function M(n,i){if(!1===u)return n;var r=n;return n===e.RED&&(i===e.FLOAT&&(r=e.R32F),i===e.HALF_FLOAT&&(r=e.R16F),i===e.UNSIGNED_BYTE&&(r=e.R8)),n===e.RGB&&(i===e.FLOAT&&(r=e.RGB32F),i===e.HALF_FLOAT&&(r=e.RGB16F),i===e.UNSIGNED_BYTE&&(r=e.RGB8)),n===e.RGBA&&(i===e.FLOAT&&(r=e.RGBA32F),i===e.HALF_FLOAT&&(r=e.RGBA16F),i===e.UNSIGNED_BYTE&&(r=e.RGBA8)),r===e.R16F||r===e.R32F||r===e.RGBA16F||r===e.RGBA32F?t.get("EXT_color_buffer_float"):r!==e.RGB16F&&r!==e.RGB32F||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),r}function S(t){return t===i.hxR||t===i.pHI||t===i.Cfg?e.NEAREST:e.LINEAR}function E(t){var n=t.target;n.removeEventListener("dispose",E),function(t){var n=a.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),a.remove(t))}(n),n.isVideoTexture&&g.delete(n),l.memory.textures--}function T(t){var n=t.target;n.removeEventListener("dispose",T),function(t){var n=a.get(t),i=a.get(t.texture);if(t){if(void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(var r=0;r<6;r++)e.deleteFramebuffer(n.__webglFramebuffer[r]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[r]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget){e.deleteTexture(n.__webglColorTexture),e.deleteTexture(n.__webglDepthStencilTexture),l.memory.textures-=2,r=0;for(var o=n.__webglViewFramebuffers.length;r<o;r++)e.deleteFramebuffer(n.__webglViewFramebuffers[r])}a.remove(t.texture),a.remove(t)}}(n),l.memory.textures--}var A=0;function L(t,i){var r=a.get(t);if(t.isVideoTexture&&function(e){var t=l.render.frame;g.get(e)!==t&&(g.set(e,t),e.update())}(t),t.version>0&&r.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void O(r,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_2D,r.__webglTexture)}function P(t,r){if(6===t.image.length){var o=a.get(t);if(t.version>0&&o.__version!==t.version){I(o,t),n.activeTexture(e.TEXTURE0+r),n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var s=t&&t.isCompressedTexture,l=t.image[0]&&t.image[0].isDataTexture,h=[],d=0;d<6;d++)h[d]=s||l?l?t.image[d].image:t.image[d]:x(t.image[d],!1,!0,p);var f,m=h[0],g=_(m)||u,v=c.convert(t.format),y=c.convert(t.type),S=M(v,y);if(D(e.TEXTURE_CUBE_MAP,t,g),s){for(d=0;d<6;d++){f=h[d].mipmaps;for(var E=0;E<f.length;E++){var T=f[E];t.format!==i.GWd&&t.format!==i.HIg?null!==v?n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,E,S,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,E,S,T.width,T.height,0,v,y,T.data)}}o.__maxMipLevel=f.length-1}else{for(f=t.mipmaps,d=0;d<6;d++)if(l)for(n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,S,h[d].width,h[d].height,0,v,y,h[d].data),E=0;E<f.length;E++){var A=(T=f[E]).image[d].image;n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,E+1,S,A.width,A.height,0,v,y,A.data)}else for(n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,S,v,y,h[d]),E=0;E<f.length;E++)T=f[E],n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,E+1,S,v,y,T.image[d]);o.__maxMipLevel=f.length}b(t,g)&&w(e.TEXTURE_CUBE_MAP,t,m.width,m.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(e.TEXTURE0+r),n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture)}}function R(t,i){n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_CUBE_MAP,a.get(t).__webglTexture)}var C=o(o(o({},i.GJx,e.REPEAT),i.ghU,e.CLAMP_TO_EDGE),i.kTW,e.MIRRORED_REPEAT),N=o(o(o(o(o(o({},i.hxR,e.NEAREST),i.pHI,e.NEAREST_MIPMAP_NEAREST),i.Cfg,e.NEAREST_MIPMAP_LINEAR),i.k6q,e.LINEAR),i.kRr,e.LINEAR_MIPMAP_NEAREST),i.$_I,e.LINEAR_MIPMAP_LINEAR);function D(n,r,o){o?(e.texParameteri(n,e.TEXTURE_WRAP_S,C[r.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,C[r.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,C[r.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,N[r.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,N[r.minFilter])):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),r.wrapS===i.ghU&&r.wrapT===i.ghU||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,e.TEXTURE_MAG_FILTER,S(r.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,S(r.minFilter)),r.minFilter!==i.hxR&&r.minFilter!==i.k6q&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var c=t.get("EXT_texture_filter_anisotropic");if(c){if(r.type===i.RQf&&null===t.get("OES_texture_float_linear"))return;if(r.type===i.ix0&&null===(u||t.get("OES_texture_half_float_linear")))return;(r.anisotropy>1||a.get(r).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r.anisotropy,s.getMaxAnisotropy())),a.get(r).__currentAnisotropy=r.anisotropy)}}function I(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",E),t.__webglTexture=e.createTexture(),l.memory.textures++)}function O(t,r,a){var o=e.TEXTURE_2D;r.isDataTexture2DArray&&(o=e.TEXTURE_2D_ARRAY),r.isDataTexture3D&&(o=e.TEXTURE_3D),I(t,r),n.activeTexture(e.TEXTURE0+a),n.bindTexture(o,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment);var s=function(e){return!u&&(e.wrapS!==i.ghU||e.wrapT!==i.ghU||e.minFilter!==i.hxR&&e.minFilter!==i.k6q)}(r)&&!1===_(r.image),l=x(r.image,s,!1,f),h=_(l)||u,d=c.convert(r.format),p=c.convert(r.type),m=M(d,p);D(o,r,h);var g,v=r.mipmaps;if(r.isDepthTexture){if(m=e.DEPTH_COMPONENT,r.type===i.RQf){if(!1===u)throw new Error("Float Depth Texture only supported in WebGL2.0");m=e.DEPTH_COMPONENT32F}else u&&(m=e.DEPTH_COMPONENT16);r.format===i.zdS&&m===e.DEPTH_COMPONENT&&r.type!==i.cHt&&r.type!==i.bkx&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=i.cHt,p=c.convert(r.type)),r.format===i.dcC&&(m=e.DEPTH_STENCIL,r.type!==i.V3x&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=i.V3x,p=c.convert(r.type))),n.texImage2D(e.TEXTURE_2D,0,m,l.width,l.height,0,d,p,null)}else if(r.isDataTexture)if(v.length>0&&h){for(var y=0,S=v.length;y<S;y++)g=v[y],n.texImage2D(e.TEXTURE_2D,y,m,g.width,g.height,0,d,p,g.data);r.generateMipmaps=!1,t.__maxMipLevel=v.length-1}else n.texImage2D(e.TEXTURE_2D,0,m,l.width,l.height,0,d,p,l.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(y=0,S=v.length;y<S;y++)g=v[y],r.format!==i.GWd&&r.format!==i.HIg?null!==d?n.compressedTexImage2D(e.TEXTURE_2D,y,m,g.width,g.height,0,g.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(e.TEXTURE_2D,y,m,g.width,g.height,0,d,p,g.data);t.__maxMipLevel=v.length-1}else if(r.isDataTexture2DArray)n.texImage3D(e.TEXTURE_2D_ARRAY,0,m,l.width,l.height,l.depth,0,d,p,l.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(e.TEXTURE_3D,0,m,l.width,l.height,l.depth,0,d,p,l.data),t.__maxMipLevel=0;else if(v.length>0&&h){for(y=0,S=v.length;y<S;y++)g=v[y],n.texImage2D(e.TEXTURE_2D,y,m,d,p,g);r.generateMipmaps=!1,t.__maxMipLevel=v.length-1}else n.texImage2D(e.TEXTURE_2D,0,m,d,p,l),t.__maxMipLevel=0;b(r,h)&&w(e.TEXTURE_2D,r,l.width,l.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function U(t,i,r,o){var s=c.convert(i.texture.format),l=c.convert(i.texture.type),h=M(s,l);n.texImage2D(o,0,h,i.width,i.height,0,s,l,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,r,o,a.get(i.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function z(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer){if(i){var r=F(n);e.renderbufferStorageMultisample(e.RENDERBUFFER,r,e.DEPTH_COMPONENT16,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(n.depthBuffer&&n.stencilBuffer)i?(r=F(n),e.renderbufferStorageMultisample(e.RENDERBUFFER,r,e.DEPTH24_STENCIL8,n.width,n.height)):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t);else{var a=M(c.convert(n.texture.format),c.convert(n.texture.type));i?(r=F(n),e.renderbufferStorageMultisample(e.RENDERBUFFER,r,a,n.width,n.height)):e.renderbufferStorage(e.RENDERBUFFER,a,n.width,n.height)}e.bindRenderbuffer(e.RENDERBUFFER,null)}function F(e){return u&&e.isWebGLMultisampleRenderTarget?Math.min(m,e.samples):0}var B=!1,G=!1;this.allocateTextureUnit=function(){var e=A;return e>=d&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+d),A+=1,e},this.resetTextureUnits=function(){A=0},this.setTexture2D=L,this.setTexture2DArray=function(t,i){var r=a.get(t);t.version>0&&r.__version!==t.version?O(r,t,i):(n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_2D_ARRAY,r.__webglTexture))},this.setTexture3D=function(t,i){var r=a.get(t);t.version>0&&r.__version!==t.version?O(r,t,i):(n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_3D,r.__webglTexture))},this.setTextureCube=P,this.setTextureCubeDynamic=R,this.setupRenderTarget=function(r){var o=a.get(r),s=a.get(r.texture);r.addEventListener("dispose",T),s.__webglTexture=e.createTexture(),l.memory.textures++;var h=!0===r.isWebGLRenderTargetCube,d=!0===r.isWebGLMultisampleRenderTarget,p=!0===r.isWebGLMultiviewRenderTarget,f=_(r)||u;if(h){o.__webglFramebuffer=[];for(var m=0;m<6;m++)o.__webglFramebuffer[m]=e.createFramebuffer()}else if(o.__webglFramebuffer=e.createFramebuffer(),d)if(u){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o.__webglColorRenderbuffer);var g=M(c.convert(r.texture.format),c.convert(r.texture.type)),v=F(r);e.renderbufferStorageMultisample(e.RENDERBUFFER,v,g,r.width,r.height),e.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,o.__webglColorRenderbuffer),e.bindRenderbuffer(e.RENDERBUFFER,null),r.depthBuffer&&(o.__webglDepthRenderbuffer=e.createRenderbuffer(),z(o.__webglDepthRenderbuffer,r,!0)),e.bindFramebuffer(e.FRAMEBUFFER,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(p){var y=r.width,x=r.height,S=r.numViews;e.bindFramebuffer(e.FRAMEBUFFER,o.__webglFramebuffer);var E=t.get("OVR_multiview2");l.memory.textures+=2;var A=e.createTexture();e.bindTexture(e.TEXTURE_2D_ARRAY,A),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texImage3D(e.TEXTURE_2D_ARRAY,0,e.RGBA8,y,x,S,0,e.RGBA,e.UNSIGNED_BYTE,null),E.framebufferTextureMultiviewOVR(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,A,0,0,S);var P=e.createTexture();e.bindTexture(e.TEXTURE_2D_ARRAY,P),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texImage3D(e.TEXTURE_2D_ARRAY,0,e.DEPTH24_STENCIL8,y,x,S,0,e.DEPTH_STENCIL,e.UNSIGNED_INT_24_8,null),E.framebufferTextureMultiviewOVR(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,P,0,0,S);var R=new Array(S);for(m=0;m<S;++m)R[m]=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,R[m]),e.framebufferTextureLayer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,A,0,m);o.__webglColorTexture=A,o.__webglDepthStencilTexture=P,o.__webglViewFramebuffers=R,e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D_ARRAY,null)}if(h){for(n.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture),D(e.TEXTURE_CUBE_MAP,r.texture,f),m=0;m<6;m++)U(o.__webglFramebuffer[m],r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+m);b(r.texture,f)&&w(e.TEXTURE_CUBE_MAP,r.texture,r.width,r.height),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else p||(n.bindTexture(e.TEXTURE_2D,s.__webglTexture),D(e.TEXTURE_2D,r.texture,f),U(o.__webglFramebuffer,r,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),b(r.texture,f)&&w(e.TEXTURE_2D,r.texture,r.width,r.height),n.bindTexture(e.TEXTURE_2D,null));r.depthBuffer&&function(t){var n=a.get(t),r=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");a.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),L(n.depthTexture,0);var r=a.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===i.zdS)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,r,0);else{if(n.depthTexture.format!==i.dcC)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,r,0)}}(n.__webglFramebuffer,t)}else if(r){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=e.createRenderbuffer(),z(n.__webglDepthbuffer[o],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),z(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}(r)},this.updateRenderTargetMipmap=function(t){var i=t.texture;if(b(i,_(t)||u)){var r=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,o=a.get(i).__webglTexture;n.bindTexture(r,o),w(r,i,t.width,t.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(u){var n=a.get(t);e.bindFramebuffer(e.READ_FRAMEBUFFER,n.__webglMultisampledFramebuffer),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n.__webglFramebuffer);var i=t.width,r=t.height,o=e.COLOR_BUFFER_BIT;t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&(o|=e.STENCIL_BUFFER_BIT),e.blitFramebuffer(0,0,i,r,0,0,i,r,o,e.NEAREST)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),B=!0),e=e.texture),L(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLRenderTargetCube&&(!1===G&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),G=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?P(e,t):R(e,t)}}},9829:(e,t,n)=>{n.d(t,{H:()=>ee});var i=n(7989),r=n(4306),a=n(2035),o=n(5793),s=new r.g,c=new a.n,l=new o.b,h=new i.b,u=[],d=[],p=new Float32Array(16),f=new Float32Array(9),m=new Float32Array(4);function g(e,t,n){var i=e[0];if(i<=0||i>0)return e;var r=t*n,a=u[r];if(void 0===a&&(a=new Float32Array(r),u[r]=a),0!==t){i.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function v(e,t){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function y(e,t){for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}function x(e,t){var n=d[t];void 0===n&&(n=new Int32Array(t),d[t]=n);for(var i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function _(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function b(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(v(n,t))return;e.uniform2fv(this.addr,t),y(n,t)}}function w(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(v(n,t))return;e.uniform3fv(this.addr,t),y(n,t)}}function M(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(v(n,t))return;e.uniform4fv(this.addr,t),y(n,t)}}function S(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(v(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),y(n,t)}else{if(v(n,i))return;m.set(i),e.uniformMatrix2fv(this.addr,!1,m),y(n,i)}}function E(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(v(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),y(n,t)}else{if(v(n,i))return;f.set(i),e.uniformMatrix3fv(this.addr,!1,f),y(n,i)}}function T(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(v(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),y(n,t)}else{if(v(n,i))return;p.set(i),e.uniformMatrix4fv(this.addr,!1,p),y(n,i)}}function A(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(t||s,r)}function L(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||c,r)}function P(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||l,r)}function R(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(t||h,r)}function C(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function N(e,t){var n=this.cache;v(n,t)||(e.uniform2iv(this.addr,t),y(n,t))}function D(e,t){var n=this.cache;v(n,t)||(e.uniform3iv(this.addr,t),y(n,t))}function I(e,t){var n=this.cache;v(n,t)||(e.uniform4iv(this.addr,t),y(n,t))}function O(e,t){e.uniform1fv(this.addr,t)}function U(e,t){e.uniform1iv(this.addr,t)}function z(e,t){e.uniform2iv(this.addr,t)}function F(e,t){e.uniform3iv(this.addr,t)}function B(e,t){e.uniform4iv(this.addr,t)}function G(e,t){var n=g(t,this.size,2);e.uniform2fv(this.addr,n)}function V(e,t){var n=g(t,this.size,3);e.uniform3fv(this.addr,n)}function H(e,t){var n=g(t,this.size,4);e.uniform4fv(this.addr,n)}function k(e,t){var n=g(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function W(e,t){var n=g(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function j(e,t){var n=g(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function q(e,t,n){var i=t.length,r=x(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTexture2D(t[a]||s,r[a])}function X(e,t,n){var i=t.length,r=x(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTextureCube(t[a]||h,r[a])}function Y(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return _;case 35664:return b;case 35665:return w;case 35666:return M;case 35674:return S;case 35675:return E;case 35676:return T;case 35678:case 36198:return A;case 35679:return P;case 35680:return R;case 36289:return L;case 5124:case 35670:return C;case 35667:case 35671:return N;case 35668:case 35672:return D;case 35669:case 35673:return I}}(t.type)}function Z(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return O;case 35664:return G;case 35665:return V;case 35666:return H;case 35674:return k;case 35675:return W;case 35676:return j;case 35678:return q;case 35680:return X;case 5124:case 35670:return U;case 35667:case 35671:return z;case 35668:case 35672:return F;case 35669:case 35673:return B}}(t.type)}function J(e){this.id=e,this.seq=[],this.map={}}Z.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),y(t,e)},J.prototype.setValue=function(e,t,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(e,t[o.id],n)}};var Q=/([\w\d_]+)(\])?(\[|\.)?/g;function K(e,t){e.seq.push(t),e.map[t.id]=t}function $(e,t,n){var i=e.name,r=i.length;for(Q.lastIndex=0;;){var a=Q.exec(i),o=Q.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===r){K(n,void 0===l?new Y(s,e,t):new Z(s,e,t));break}var h=n.map[s];void 0===h&&K(n,h=new J(s)),n=h}}function ee(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i<n;++i){var r=e.getActiveUniform(t,i);$(r,e.getUniformLocation(t,r.name),this)}}ee.prototype.setValue=function(e,t,n,i){var r=this.map[t];void 0!==r&&r.setValue(e,n,i)},ee.prototype.setOptional=function(e,t,n){var i=t[n];void 0!==i&&this.setValue(e,n,i)},ee.upload=function(e,t,n,i){for(var r=0,a=t.length;r!==a;++r){var o=t[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,i)}},ee.seqWithValue=function(e,t){for(var n=[],i=0,r=e.length;i!==r;++i){var a=e[i];a.id in t&&n.push(a)}return n}},8403:(e,t,n)=>{n.d(t,{h:()=>r});var i=n(2709);function r(e,t,n){var r=n.isWebGL2;return{convert:function(n){var a;if(n===i.OUM)return e.UNSIGNED_BYTE;if(n===i.Wew)return e.UNSIGNED_SHORT_4_4_4_4;if(n===i.gJ2)return e.UNSIGNED_SHORT_5_5_5_1;if(n===i.upd)return e.UNSIGNED_SHORT_5_6_5;if(n===i.tJf)return e.BYTE;if(n===i.fBL)return e.SHORT;if(n===i.cHt)return e.UNSIGNED_SHORT;if(n===i.Yuy)return e.INT;if(n===i.bkx)return e.UNSIGNED_INT;if(n===i.RQf)return e.FLOAT;if(n===i.ix0)return r?e.HALF_FLOAT:null!==(a=t.get("OES_texture_half_float"))?a.HALF_FLOAT_OES:null;if(n===i.wrO)return e.ALPHA;if(n===i.HIg)return e.RGB;if(n===i.GWd)return e.RGBA;if(n===i.Kzv)return e.LUMINANCE;if(n===i.CMB)return e.LUMINANCE_ALPHA;if(n===i.zdS)return e.DEPTH_COMPONENT;if(n===i.dcC)return e.DEPTH_STENCIL;if(n===i.VT0)return e.RED;if(n===i.IE4||n===i.Nz6||n===i.jR7||n===i.BXX){if(null===(a=t.get("WEBGL_compressed_texture_s3tc")))return null;if(n===i.IE4)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===i.Nz6)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===i.jR7)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===i.BXX)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===i.k6Q||n===i.kTp||n===i.HXV||n===i.pBf){if(null===(a=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(n===i.k6Q)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===i.kTp)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===i.HXV)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===i.pBf)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return n===i.CVz?null!==(a=t.get("WEBGL_compressed_texture_etc1"))?a.COMPRESSED_RGB_ETC1_WEBGL:null:n===i.qa3||n===i.B_h||n===i.czI||n===i.rSH||n===i.Qrf||n===i.psI||n===i.a5J||n===i._QJ||n===i.uB5||n===i.lyL||n===i.bC7||n===i.y3Z||n===i.ojs||n===i.S$4?null!==(a=t.get("WEBGL_compressed_texture_astc"))?n:null:n===i.V3x?r?e.UNSIGNED_INT_24_8:null!==(a=t.get("WEBGL_depth_texture"))?a.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}},905:(e,t,n)=>{n.d(t,{i:()=>f});var i=n(6491),r=n(9452),a=n(2612),o=n(6460),s=n(2547),c=n(2506),l=n(5543),h=n(7449),u=n(178),d=n(8144),p=n(8503);function f(e){var t,n,i=this,f=null,m=null,g=[],v=new a.k,y=new a.k,x=1,_="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(m=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",C,!1));var b=new a.k,w=new l.P,M=new s.P,S=new u.u,E=new u.u;E.viewport=new c.I,E.layers.enable(1);var T=new u.u;T.viewport=new c.I,T.layers.enable(2);var A=new h.n([E,T]);function L(){return null!==f&&!0===f.isPresenting}A.layers.enable(1),A.layers.enable(2);var P,R=new o.I;function C(){if(L()){var r=f.getEyeParameters("left");t=2*r.renderWidth*x,n=r.renderHeight*x,P=e.getPixelRatio(),e.getSize(R),e.setDrawingBufferSize(t,n,1),E.viewport.set(0,0,t/2,n),T.viewport.set(t/2,0,t/2,n),U.start(),i.dispatchEvent({type:"sessionstart"})}else i.enabled&&e.setDrawingBufferSize(R.width,R.height,P),U.stop(),i.dispatchEvent({type:"sessionend"})}var N=[],D=[];function I(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),n=0,i=t.length;n<i;n++){var r=t[n];if(r&&("Daydream Controller"===r.id||"Gear VR Controller"===r.id||"Oculus Go Controller"===r.id||"OpenVR Gamepad"===r.id||r.id.startsWith("Oculus Touch")||r.id.startsWith("HTC Vive Focus")||r.id.startsWith("Spatial Controller"))){var a=r.hand;if(0===e&&(""===a||"right"===a))return r;if(1===e&&"left"===a)return r}}}function O(e,i){null!==i&&4===i.length&&e.set(i[0]*t,i[1]*n,i[2]*t,i[3]*n)}this.enabled=!1,this.getController=function(e){var t=g[e];return void 0===t&&((t=new r.Y).matrixAutoUpdate=!1,t.visible=!1,g[e]=t),t},this.getDevice=function(){return f},this.setDevice=function(e){void 0!==e&&(f=e),U.setContext(e)},this.setFramebufferScaleFactor=function(e){x=e},this.setReferenceSpaceType=function(e){_=e},this.getCamera=function(e){var t="local-floor"===_?1.6:0;if(f.depthNear=e.near,f.depthFar=e.far,f.getFrameData(m),"local-floor"===_){var n=f.stageParameters;n?v.fromArray(n.sittingToStandingTransform):v.makeTranslation(0,t,0)}var i=m.pose;S.matrix.copy(v),S.matrix.decompose(S.position,S.quaternion,S.scale),null!==i.orientation&&(w.fromArray(i.orientation),S.quaternion.multiply(w)),null!==i.position&&(w.setFromRotationMatrix(v),M.fromArray(i.position),M.applyQuaternion(w),S.position.add(M)),S.updateMatrixWorld(),e.matrixWorld.copy(S.matrixWorld);for(var r=e.children,a=0,o=r.length;a<o;a++)r[a].updateMatrixWorld(!0);E.near=e.near,T.near=e.near,E.far=e.far,T.far=e.far,E.matrixWorldInverse.fromArray(m.leftViewMatrix),T.matrixWorldInverse.fromArray(m.rightViewMatrix),y.getInverse(v),"local-floor"===_&&(E.matrixWorldInverse.multiply(y),T.matrixWorldInverse.multiply(y));var s=e.parent;null!==s&&(b.getInverse(s.matrixWorld),E.matrixWorldInverse.multiply(b),T.matrixWorldInverse.multiply(b)),E.matrixWorld.getInverse(E.matrixWorldInverse),T.matrixWorld.getInverse(T.matrixWorldInverse),E.projectionMatrix.fromArray(m.leftProjectionMatrix),T.projectionMatrix.fromArray(m.rightProjectionMatrix),(0,p.N)(A,E,T);var c=f.getLayers();if(c.length){var l=c[0];O(E.viewport,l.leftBounds),O(T.viewport,l.rightBounds)}return function(){for(var e=0;e<g.length;e++){var t=g[e],n=I(e);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&t.position.set(.2,-.6,-.05),null!==i.position&&t.position.fromArray(i.position),null!==i.orientation&&t.quaternion.fromArray(i.orientation),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrix.premultiply(v),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixWorldNeedsUpdate=!0,t.visible=!0;var r="Daydream Controller"===n.id?0:1;void 0===N[e]&&(N[e]=!1),N[e]!==n.buttons[r].pressed&&(N[e]=n.buttons[r].pressed,!0===N[e]?t.dispatchEvent({type:"selectstart"}):(t.dispatchEvent({type:"selectend"}),t.dispatchEvent({type:"select"}))),r=2,void 0===D[e]&&(D[e]=!1),void 0!==n.buttons[r]&&D[e]!==n.buttons[r].pressed&&(D[e]=n.buttons[r].pressed,!0===D[e]?t.dispatchEvent({type:"squeezestart"}):(t.dispatchEvent({type:"squeezeend"}),t.dispatchEvent({type:"squeeze"})))}else t.visible=!1}}(),A},this.getStandingMatrix=function(){return v},this.isPresenting=L;var U=new d.O;this.setAnimationLoop=function(e){U.setAnimationLoop(e),L()&&U.start()},this.submitFrame=function(){L()&&f.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",C)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}Object.assign(f.prototype,i.Q.prototype)},8503:(e,t,n)=>{n.d(t,{N:()=>o});var i=n(2547),r=new i.P,a=new i.P;function o(e,t,n){r.setFromMatrixPosition(t.matrixWorld),a.setFromMatrixPosition(n.matrixWorld);var i=r.distanceTo(a),o=t.projectionMatrix.elements,s=n.projectionMatrix.elements,c=o[14]/(o[10]-1),l=o[14]/(o[10]+1),h=(o[9]+1)/o[5],u=(o[9]-1)/o[5],d=(o[8]-1)/o[0],p=(s[8]+1)/s[0],f=c*d,m=c*p,g=i/(-d+p),v=g*-d;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(v),e.translateZ(g),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var y=c+g,x=l+g,_=f-v,b=m+(i-v),w=h*l/x*y,M=u*l/x*y;e.projectionMatrix.makePerspective(_,b,w,M,y,x)}},2607:(e,t,n)=>{n.d(t,{i:()=>u});var i=n(6491),r=n(9452),a=n(2612),o=n(2506),s=n(7449),c=n(178),l=n(8144),h=n(8503);function u(e,t){var n=this,i=null,u=null,d="local-floor",p=null,f=[],m=[],g=new c.u;g.layers.enable(1),g.viewport=new o.I;var v=new c.u;v.layers.enable(2),v.viewport=new o.I;var y=new s.n([g,v]);function x(e){for(var t=0;t<f.length;t++)m[t]===e.inputSource&&f[t].dispatchEvent({type:e.type})}function _(){e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),T.stop(),n.dispatchEvent({type:"sessionend"})}function b(e){u=e,T.setContext(i),T.start(),n.dispatchEvent({type:"sessionstart"})}function w(){for(var e=0;e<f.length;e++)m[e]=M(e)}function M(e){for(var t=i.inputSources,n=0;n<t.length;n++){var r=t[n],a=r.handedness;if(0===e&&("none"===a||"right"===a))return r;if(1===e&&"left"===a)return r}}function S(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}y.layers.enable(1),y.layers.enable(2),this.enabled=!1,this.getController=function(e){var t=f[e];return void 0===t&&((t=new r.Y).matrixAutoUpdate=!1,t.visible=!1,f[e]=t),t},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(e){d=e},this.getSession=function(){return i},this.setSession=function(e){null!==(i=e)&&(i.addEventListener("select",x),i.addEventListener("selectstart",x),i.addEventListener("selectend",x),i.addEventListener("squeeze",x),i.addEventListener("squeezestart",x),i.addEventListener("squeezeend",x),i.addEventListener("end",_),i.updateRenderState({baseLayer:new XRWebGLLayer(i,t)}),i.requestReferenceSpace(d).then(b),i.addEventListener("inputsourceschange",w),w())},this.getCamera=function(e){var t=e.parent,n=y.cameras;S(y,t);for(var i=0;i<n.length;i++)S(n[i],t);e.matrixWorld.copy(y.matrixWorld);for(var r=e.children,a=(i=0,r.length);i<a;i++)r[i].updateMatrixWorld(!0);return(0,h.N)(y,g,v),y},this.isPresenting=function(){return null!==i&&null!==u};var E=null,T=new l.O;T.setAnimationLoop((function(t,n){if(null!==(p=n.getViewerPose(u))){var r=p.views,a=i.renderState.baseLayer;e.setFramebuffer(a.framebuffer);for(var o=0;o<r.length;o++){var s=r[o],c=a.getViewport(s),l=s.transform.inverse.matrix,h=y.cameras[o];h.matrix.fromArray(l).getInverse(h.matrix),h.projectionMatrix.fromArray(s.projectionMatrix),h.viewport.set(c.x,c.y,c.width,c.height),0===o&&y.matrix.copy(h.matrix)}}for(o=0;o<f.length;o++){var d=f[o],g=m[o];if(g){var v=n.getPose(g.targetRaySpace,u);if(null!==v){d.matrix.fromArray(v.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.visible=!0;continue}}d.visible=!1}E&&E(t)})),this.setAnimationLoop=function(e){E=e},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new a.k},this.getDevice=function(){console.warn("THREE.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("THREE.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}Object.assign(u.prototype,i.Q.prototype)},7288:(e,t,n)=>{n.d(t,{Z:()=>r});var i=n(892);function r(){i.B.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}r.prototype=Object.assign(Object.create(i.B.prototype),{constructor:r,isScene:!0,copy:function(e,t){return i.B.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.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},toJSON:function(e){var t=i.B.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}})},7989:(e,t,n)=>{n.d(t,{b:()=>a});var i=n(4306),r=n(2709);function a(e,t,n,a,o,s,c,l,h,u){e=void 0!==e?e:[],t=void 0!==t?t:r.hy7,c=void 0!==c?c:r.HIg,i.g.call(this,e,t,n,a,o,s,c,l,h,u),this.flipY=!1}a.prototype=Object.create(i.g.prototype),a.prototype.constructor=a,a.prototype.isCubeTexture=!0,Object.defineProperty(a.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}})},7426:(e,t,n)=>{n.d(t,{G:()=>a});var i=n(4306),r=n(2709);function a(e,t,n,a,o,s,c,l,h,u,d,p){i.g.call(this,null,s,c,l,h,u,a,o,d,p),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==h?h:r.hxR,this.minFilter=void 0!==u?u:r.hxR,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}a.prototype=Object.create(i.g.prototype),a.prototype.constructor=a,a.prototype.isDataTexture=!0},2035:(e,t,n)=>{n.d(t,{n:()=>a});var i=n(4306),r=n(2709);function a(e,t,n,a){i.g.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:a||1},this.magFilter=r.hxR,this.minFilter=r.hxR,this.wrapR=r.ghU,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}a.prototype=Object.create(i.g.prototype),a.prototype.constructor=a,a.prototype.isDataTexture2DArray=!0},5793:(e,t,n)=>{n.d(t,{b:()=>a});var i=n(4306),r=n(2709);function a(e,t,n,a){i.g.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:a||1},this.magFilter=r.hxR,this.minFilter=r.hxR,this.wrapR=r.ghU,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}a.prototype=Object.create(i.g.prototype),a.prototype.constructor=a,a.prototype.isDataTexture3D=!0},4306:(e,t,n)=>{n.d(t,{g:()=>h});var i=n(6491),r=n(2709),a=n(5369),o=n(6460),s=n(7681),c=n(918),l=0;function h(e,t,n,i,c,u,d,p,f,m){Object.defineProperty(this,"id",{value:l++}),this.uuid=a.q.generateUUID(),this.name="",this.image=void 0!==e?e:h.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:h.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:r.ghU,this.wrapT=void 0!==i?i:r.ghU,this.magFilter=void 0!==c?c:r.k6q,this.minFilter=void 0!==u?u:r.$_I,this.anisotropy=void 0!==f?f:1,this.format=void 0!==d?d:r.GWd,this.type=void 0!==p?p:r.OUM,this.offset=new o.I(0,0),this.repeat=new o.I(1,1),this.center=new o.I(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new s.d,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==m?m:r.tgE,this.version=0,this.onUpdate=null}h.DEFAULT_IMAGE=void 0,h.DEFAULT_MAPPING=r.UTZ,h.prototype=Object.assign(Object.create(i.Q.prototype),{constructor:h,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy: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.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON: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 i=this.image;if(void 0===i.uuid&&(i.uuid=a.q.generateUUID()),!t&&void 0===e.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var o=0,s=i.length;o<s;o++)r.push(c.H.getDataURL(i[o]))}else r=c.H.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==r.UTZ)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case r.GJx:e.x=e.x-Math.floor(e.x);break;case r.ghU:e.x=e.x<0?0:1;break;case r.kTW: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||e.y>1)switch(this.wrapT){case r.GJx:e.y=e.y-Math.floor(e.y);break;case r.ghU:e.y=e.y<0?0:1;break;case r.kTW: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}}),Object.defineProperty(h.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}})},2521:(e,t,n)=>{function i(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}n.d(t,{_:()=>i})},9837:(e,t,n)=>{n.d(t,{Ay:()=>l});const i=[[[["deg",1]],[["mm2",1],["cm2",100],["m2",1e6],["km2",1e12]],[["bits",1],["B",8],["KB",8e3],["MB",8e6],["GB",8e9],["TB",8e12],["PB",8e15]],[["J",1],["Wh",3600],["kWh",36e5],["MWh",36e8],["GWh",36e11]],[["N",1]],[["mm",1],["cm",10],["m",1e3],["km",1e6]],[["mg",1],["g",1e3],["kg",1e6]],[["W",1],["kW",1e3],["MW",1e6],["GW",1e9],["TW",1e12],["PW",1e15]],[["Pa",1]],[["C",1]],[["fs",1],["ps",1e3],["ns",1e6],["µs",1e9],["ms",1e12],["s",1e15],["min",6e16],["h",36e17],["d",864e17],["y",31536e18]],[["mL",1],["L",1e3]]],[[["deg",1]],[["sq in",1],["sq ft",144],["sq mi",4014489600],["ac",6272640]],[["bits",1],["B",8],["KiB",8192],["MiB",8388608],["GiB",8589934592],["TiB",8796093022208],["PiB",9007199254740992]],[["J",1],["Wh",3600],["kWh",36e5],["MWh",36e8],["GWh",36e11]],[["lbf",1]],[["in",1],["ft",12],["yd",36],["mi",63360]],[["oz",1],["lb",16]],[["W",1],["kW",1e3],["MW",1e6],["GW",1e9],["TW",1e12],["PW",1e15]],[["psi",1]],[["F",1]],[["fs",1],["ps",1e3],["ns",1e6],["µs",1e9],["ms",1e12],["s",1e15],["min",6e16],["h",36e17],["d",864e17],["y",31536e18]],[["tsp",1],["tbsp",3],["fl oz",6],["cup",48],["pt",96],["qt",192],["gal",768]]]],r={radian:[0,1],radians:[0,1],rad:[0,1],rads:[0,1],r:[0,1],turn:[0,2*Math.PI],turns:[0,2*Math.PI],degree:[0,Math.PI/180],degrees:[0,Math.PI/180],deg:[0,Math.PI/180],degs:[0,Math.PI/180],"°":[0,Math.PI/180],gradian:[0,Math.PI/200],gradians:[0,Math.PI/200],gon:[0,Math.PI/200],gons:[0,Math.PI/200],grad:[0,Math.PI/200],grads:[0,Math.PI/200],grade:[0,Math.PI/200],grades:[0,Math.PI/200],"square meter":[1,1],"square meters":[1,1],"square metre":[1,1],"square metres":[1,1],"m²":[1,1],m2:[1,1],"square petameter":[1,1e30],"square petametre":[1,1e30],"square petameters":[1,1e30],"square petametres":[1,1e30],"Pm²":[1,1e30],Pm2:[1,1e30],"square terameter":[1,1e24],"square terametre":[1,1e24],"square terameters":[1,1e24],"square terametres":[1,1e24],"Tm²":[1,1e24],Tm2:[1,1e24],"square gigameter":[1,1e18],"square gigametre":[1,1e18],"square gigameters":[1,1e18],"square gigametres":[1,1e18],"Gm²":[1,1e18],Gm2:[1,1e18],"square megameter":[1,1e12],"square megametre":[1,1e12],"square megameters":[1,1e12],"square megametres":[1,1e12],"Mm²":[1,1e12],Mm2:[1,1e12],"square kilometer":[1,1e6],"square kilometre":[1,1e6],"square kilometers":[1,1e6],"square kilometres":[1,1e6],"km²":[1,1e6],km2:[1,1e6],"square hectometer":[1,1e4],"square hectometre":[1,1e4],"square hectometers":[1,1e4],"square hectometres":[1,1e4],"hm²":[1,1e4],hm2:[1,1e4],"square decameter":[1,100],"square decametre":[1,100],"square decameters":[1,100],"square decametres":[1,100],"dam²":[1,100],dam2:[1,100],"square decimeter":[1,.1],"square decimetre":[1,.1],"square decimeters":[1,.1],"square decimetres":[1,.1],"dm²":[1,.1],dm2:[1,.1],"square centimeter":[1,1e-4],"square centimetre":[1,1e-4],"square centimeters":[1,1e-4],"square centimetres":[1,1e-4],"cm²":[1,1e-4],cm2:[1,1e-4],"square millimeter":[1,1e-6],"square millimetre":[1,1e-6],"square millimeters":[1,1e-6],"square millimetres":[1,1e-6],"mm²":[1,1e-6],mm2:[1,1e-6],"square micrometer":[1,1e-12],"square micrometre":[1,1e-12],"square micrometers":[1,1e-12],"square micrometres":[1,1e-12],"μm²":[1,1e-12],"µm²":[1,1e-12],μm2:[1,1e-12],µm2:[1,1e-12],"square nanometer":[1,1e-18],"square nanometre":[1,1e-18],"square nanometers":[1,1e-18],"square nanometres":[1,1e-18],"nm²":[1,1e-18],nm2:[1,1e-18],"square picometer":[1,1e-24],"square picometre":[1,1e-24],"square picometers":[1,1e-24],"square picometres":[1,1e-24],"pm²":[1,1e-24],pm2:[1,1e-24],"square femtometer":[1,1e-30],"square femtometre":[1,1e-30],"square femtometers":[1,1e-30],"square femtometres":[1,1e-30],"fm²":[1,1e-30],fm2:[1,1e-30],acre:[1,4046.8564224],acres:[1,4046.8564224],ac:[1,4046.8564224],centiare:[1,1],centiares:[1,1],ca:[1,1],deciare:[1,10],deciares:[1,10],da:[1,10],are:[1,100],ares:[1,100],decare:[1,1e3],decares:[1,1e3],daa:[1,1e3],hectare:[1,1e4],hectares:[1,1e4],ha:[1,1e4],"square foot":[1,.09290304],"square feet":[1,.09290304],"sq ft":[1,.09290304],"ft²":[1,.09290304],ft2:[1,.09290304],"square inch":[1,64516e-8],"square inches":[1,64516e-8],"sq in":[1,64516e-8],"in²":[1,64516e-8],in2:[1,64516e-8],"square yard":[1,.83612736],"square yards":[1,.83612736],"sq yd":[1,.83612736],"yd²":[1,.83612736],yd2:[1,.83612736],"square mile":[1,2589988.110336],"square miles":[1,2589988.110336],"sq mi":[1,2589988.110336],"mi²":[1,2589988.110336],mi2:[1,2589988.110336],bit:[2,1],bits:[2,1],b:[2,1],pebibit:[2,0x4000000000000],pebibits:[2,0x4000000000000],Pib:[2,0x4000000000000],tebibit:[2,1099511627776],tebibits:[2,1099511627776],Tib:[2,1099511627776],gibibit:[2,1073741824],gibibits:[2,1073741824],Gib:[2,1073741824],mebibit:[2,1048576],mebibits:[2,1048576],Mib:[2,1048576],kibibit:[2,1024],kibibits:[2,1024],Kib:[2,1024],Kb:[2,1e3],KB:[2,8e3],petabit:[2,1e15],petabits:[2,1e15],Pb:[2,1e15],terabit:[2,1e12],terabits:[2,1e12],Tb:[2,1e12],gigabit:[2,1e9],gigabits:[2,1e9],Gb:[2,1e9],megabit:[2,1e6],megabits:[2,1e6],Mb:[2,1e6],kilobit:[2,1e3],kilobits:[2,1e3],kb:[2,1e3],hectobit:[2,100],hectobits:[2,100],hb:[2,100],decabit:[2,10],decabits:[2,10],dab:[2,10],decibit:[2,.1],decibits:[2,.1],db:[2,.1],centibit:[2,.01],centibits:[2,.01],cb:[2,.01],millibit:[2,.001],millibits:[2,.001],mb:[2,.001],microbit:[2,1e-6],microbits:[2,1e-6],μb:[2,1e-6],µb:[2,1e-6],nanobit:[2,1e-9],nanobits:[2,1e-9],nb:[2,1e-9],picobit:[2,1e-12],picobits:[2,1e-12],pb:[2,1e-12],femtobit:[2,1e-15],femtobits:[2,1e-15],fb:[2,1e-15],nibble:[2,4],nibbles:[2,4],semioctet:[2,4],semioctets:[2,4],halfbyte:[2,4],halfbytes:[2,4],byte:[2,8],bytes:[2,8],octect:[2,8],octects:[2,8],B:[2,8],pebibyte:[2,9007199254740992],pebibytes:[2,9007199254740992],PiB:[2,9007199254740992],tebibyte:[2,8796093022208],tebibytes:[2,8796093022208],TiB:[2,8796093022208],gibibyte:[2,8589934592],gibibytes:[2,8589934592],GiB:[2,8589934592],mebibyte:[2,8388608],mebibytes:[2,8388608],MiB:[2,8388608],kibibyte:[2,8192],kibibytes:[2,8192],KiB:[2,8192],petabyte:[2,8e15],petabytes:[2,8e15],PB:[2,8e15],terabyte:[2,8e12],terabytes:[2,8e12],TB:[2,8e12],gigabyte:[2,8e9],gigabytes:[2,8e9],GB:[2,8e9],megabyte:[2,8e6],megabytes:[2,8e6],MB:[2,8e6],kilobyte:[2,8e3],kilobytes:[2,8e3],kB:[2,8e3],hectobyte:[2,800],hectobytes:[2,800],hB:[2,800],decabyte:[2,80],decabytes:[2,80],daB:[2,80],decibyte:[2,.8],decibytes:[2,.8],dB:[2,.8],centibyte:[2,.08],centibytes:[2,.08],cB:[2,.08],millibyte:[2,.008],millibytes:[2,.008],mB:[2,.008],microbyte:[2,8e-6],microbytes:[2,8e-6],μB:[2,8e-6],µB:[2,8e-6],nanobyte:[2,8e-9],nanobytes:[2,8e-9],nB:[2,8e-9],picobyte:[2,8e-12],picobytes:[2,8e-12],pB:[2,8e-12],femtobyte:[2,8e-15],femtobytes:[2,8e-15],fB:[2,8e-15],hextet:[2,16],hextets:[2,16],joule:[3,1],joules:[3,1],J:[3,1],petajoule:[3,1e15],petajoules:[3,1e15],PJ:[3,1e15],terajoule:[3,1e12],terajoules:[3,1e12],TJ:[3,1e12],gigajoule:[3,1e9],gigajoules:[3,1e9],GJ:[3,1e9],megajoule:[3,1e6],megajoules:[3,1e6],MJ:[3,1e6],kilojoule:[3,1e3],kilojoules:[3,1e3],kJ:[3,1e3],hectojoule:[3,100],hectojoules:[3,100],hJ:[3,100],decajoule:[3,10],decajoules:[3,10],daJ:[3,10],decijoule:[3,.1],decijoules:[3,.1],dJ:[3,.1],centijoule:[3,.01],centijoules:[3,.01],cJ:[3,.01],millijoule:[3,.001],millijoules:[3,.001],mJ:[3,.001],microjoule:[3,1e-6],microjoules:[3,1e-6],μJ:[3,1e-6],µJ:[3,1e-6],nanojoule:[3,1e-9],nanojoules:[3,1e-9],nJ:[3,1e-9],picojoule:[3,1e-12],picojoules:[3,1e-12],pJ:[3,1e-12],femtojoule:[3,1e-15],femtojoules:[3,1e-15],fJ:[3,1e-15],"watt-hour":[3,3600],"W⋅h":[3,3600],"W h":[3,3600],Wh:[3,3600],"petawatt-hour":[3,36e17],"petawatt-hours":[3,36e17],"PW⋅h":[3,36e17],"PW h":[3,36e17],PWh:[3,36e17],"terawatt-hour":[3,36e14],"terawatt-hours":[3,36e14],"TW⋅h":[3,36e14],"TW h":[3,36e14],TWh:[3,36e14],"gigawatt-hour":[3,36e11],"gigawatt-hours":[3,36e11],"GW⋅h":[3,36e11],"GW h":[3,36e11],GWh:[3,36e11],"megawatt-hour":[3,36e8],"megawatt-hours":[3,36e8],"MW⋅h":[3,36e8],"MW h":[3,36e8],MWh:[3,36e8],"kilowatt-hour":[3,36e5],"kilowatt-hours":[3,36e5],"kW⋅h":[3,36e5],"kW h":[3,36e5],kWh:[3,36e5],"hectowatt-hour":[3,36e4],"hectowatt-hours":[3,36e4],"hW⋅h":[3,36e4],"hW h":[3,36e4],hWh:[3,36e4],"decawatt-hour":[3,36e3],"decawatt-hours":[3,36e3],"daW⋅h":[3,36e3],"daW h":[3,36e3],daWh:[3,36e3],"deciwatt-hour":[3,360],"deciwatt-hours":[3,360],"dW⋅h":[3,360],"dW h":[3,360],dWh:[3,360],"centiwatt-hour":[3,36],"centiwatt-hours":[3,36],"cW⋅h":[3,36],"cW h":[3,36],cWh:[3,36],"milliwatt-hour":[3,3.6],"milliwatt-hours":[3,3.6],"mW⋅h":[3,3.6],"mW h":[3,3.6],mWh:[3,3.6],"microwatt-hour":[3,.0036],"microwatt-hours":[3,.0036],"μW⋅h":[3,.0036],"µW⋅h":[3,.0036],"μW h":[3,.0036],"µW h":[3,.0036],μWh:[3,.0036],µWh:[3,.0036],"nanowatt-hour":[3,36e-7],"nanowatt-hours":[3,36e-7],"nW⋅h":[3,36e-7],"nW h":[3,36e-7],nWh:[3,36e-7],"picowatt-hour":[3,3.6e-9],"picowatt-hours":[3,3.6e-9],"pW⋅h":[3,3.6e-9],"pW h":[3,3.6e-9],pWh:[3,3.6e-9],"femtowatt-hour":[3,36e-13],"femtowatt-hours":[3,36e-13],"fW⋅h":[3,36e-13],"fW h":[3,36e-13],fWh:[3,36e-13],newton:[4,1],newtons:[4,1],N:[4,1],petanewton:[4,1e15],petanewtons:[4,1e15],PN:[4,1e15],teranewton:[4,1e12],teranewtons:[4,1e12],TN:[4,1e12],giganewton:[4,1e9],giganewtons:[4,1e9],GN:[4,1e9],meganewton:[4,1e6],meganewtons:[4,1e6],MN:[4,1e6],kilonewton:[4,1e3],kilonewtons:[4,1e3],kN:[4,1e3],hectonewton:[4,100],hectonewtons:[4,100],hN:[4,100],decanewton:[4,10],decanewtons:[4,10],daN:[4,10],decinewton:[4,.1],decinewtons:[4,.1],dN:[4,.1],centinewton:[4,.01],centinewtons:[4,.01],cN:[4,.01],millinewton:[4,.001],millinewtons:[4,.001],mN:[4,.001],micronewton:[4,1e-6],micronewtons:[4,1e-6],μN:[4,1e-6],µN:[4,1e-6],nanonewton:[4,1e-9],nanonewtons:[4,1e-9],nN:[4,1e-9],piconewton:[4,1e-12],piconewtons:[4,1e-12],pN:[4,1e-12],femtonewton:[4,1e-15],femtonewtons:[4,1e-15],fN:[4,1e-15],dyne:[4,1e-5],dynes:[4,1e-5],dyn:[4,1e-5],"pound of force":[4,4.448222],"pound-force":[4,4.448222],lbf:[4,4.448222],kip:[4,4448.2216],klb:[4,4448.2216],kipf:[4,4448.2216],klbf:[4,4448.2216],poundal:[4,.138255],poundals:[4,.138255],pdl:[4,.138255],"kilogram-force":[4,9.80665],kilopond:[4,9.80665],kiloponds:[4,9.80665],kgf:[4,9.80665],kp:[4,9.80665],"tonne-force":[4,9806.65],"metric ton-force":[4,9806.65],"megagram-force":[4,9806.65],megapond:[4,9806.65],tf:[4,9806.65],Mp:[4,9806.65],meter:[5,1],meters:[5,1],metre:[5,1],metres:[5,1],m:[5,1],petameter:[5,1e15],petametre:[5,1e15],petameters:[5,1e15],petametres:[5,1e15],Pm:[5,1e15],terameter:[5,1e12],terametre:[5,1e12],terameters:[5,1e12],terametres:[5,1e12],Tm:[5,1e12],gigameter:[5,1e9],gigametre:[5,1e9],gigameters:[5,1e9],gigametres:[5,1e9],Gm:[5,1e9],megameter:[5,1e6],megametre:[5,1e6],megameters:[5,1e6],megametres:[5,1e6],Mm:[5,1e6],kilometer:[5,1e3],kilometre:[5,1e3],kilometers:[5,1e3],kilometres:[5,1e3],km:[5,1e3],hectometer:[5,100],hectometre:[5,100],hectometers:[5,100],hectometres:[5,100],hm:[5,100],decameter:[5,10],decametre:[5,10],decameters:[5,10],decametres:[5,10],dam:[5,10],decimeter:[5,.1],decimetre:[5,.1],decimeters:[5,.1],decimetres:[5,.1],dm:[5,.1],centimeter:[5,.01],centimetre:[5,.01],centimeters:[5,.01],centimetres:[5,.01],cm:[5,.01],millimeter:[5,.001],millimetre:[5,.001],millimeters:[5,.001],millimetres:[5,.001],mm:[5,.001],micrometer:[5,1e-6],micrometre:[5,1e-6],micrometers:[5,1e-6],micrometres:[5,1e-6],μm:[5,1e-6],µm:[5,1e-6],nanometer:[5,1e-9],nanometre:[5,1e-9],nanometers:[5,1e-9],nanometres:[5,1e-9],nm:[5,1e-9],picometer:[5,1e-12],picometre:[5,1e-12],picometers:[5,1e-12],picometres:[5,1e-12],pm:[5,1e-12],femtometer:[5,1e-15],femtometre:[5,1e-15],femtometers:[5,1e-15],femtometres:[5,1e-15],fm:[5,1e-15],foot:[5,.3048],feet:[5,.3048],ft:[5,.3048],"'":[5,.3048],"US survey foot":[5,.3048006096012192],"US survey feet":[5,.3048006096012192],"U.S. survey foot":[5,.3048006096012192],"U.S. survey feet":[5,.3048006096012192],inch:[5,.0254],inches:[5,.0254],in:[5,.0254],'"':[5,.0254],yard:[5,.9144],yards:[5,.9144],yd:[5,.9144],mile:[5,1609.344],miles:[5,1609.344],mi:[5,1609.344],"nautical mile":[5,1852],"nautical miles":[5,1852],M:[5,1852],NM:[5,1852],nmi:[5,1852],"light-year":[5,9460730472580800],"light-years":[5,9460730472580800],ly:[5,9460730472580800],pica:[5,.0042333],picas:[5,.0042333],pc:[5,.0042333],point:[5,3528e-7],points:[5,3528e-7],gram:[6,1],grams:[6,1],g:[6,1],petagram:[6,1e15],petagrams:[6,1e15],Pg:[6,1e15],teragram:[6,1e12],teragrams:[6,1e12],Tg:[6,1e12],gigagram:[6,1e9],gigagrams:[6,1e9],Gg:[6,1e9],megagram:[6,1e6],megagrams:[6,1e6],Mg:[6,1e6],kilogram:[6,1e3],kilograms:[6,1e3],kg:[6,1e3],hectogram:[6,100],hectograms:[6,100],hg:[6,100],decagram:[6,10],decagrams:[6,10],dag:[6,10],decigram:[6,.1],decigrams:[6,.1],dg:[6,.1],centigram:[6,.01],centigrams:[6,.01],cg:[6,.01],milligram:[6,.001],milligrams:[6,.001],mg:[6,.001],microgram:[6,1e-6],micrograms:[6,1e-6],μg:[6,1e-6],µg:[6,1e-6],nanogram:[6,1e-9],nanograms:[6,1e-9],ng:[6,1e-9],picogram:[6,1e-12],picograms:[6,1e-12],pg:[6,1e-12],femtogram:[6,1e-15],femtograms:[6,1e-15],fg:[6,1e-15],tonne:[6,1e6],tonnes:[6,1e6],"metric ton":[6,1e6],"metric tons":[6,1e6],t:[6,1e6],kilotonne:[6,1e9],kilotonnes:[6,1e9],kt:[6,1e9],megatonne:[6,1e12],megatonnes:[6,1e12],Mt:[6,1e12],gigatonne:[6,1e15],gigatonnes:[6,1e15],Gt:[6,1e15],pound:[6,453.59237],pounds:[6,453.59237],lb:[6,453.59237],stone:[6,6350.29318],stones:[6,6350.29318],st:[6,6350.29318],ounce:[6,28.349523125],ounces:[6,28.349523125],oz:[6,28.349523125],"short ton":[6,907184.74],"short tons":[6,907184.74],"US ton":[6,907184.74],"US tons":[6,907184.74],"long ton":[6,1016046.9088],"long tons":[6,1016046.9088],"imperial ton":[6,1016046.9088],"imperial tons":[6,1016046.9088],"displacement ton":[6,1016046.9088],"displacement tons":[6,1016046.9088],watt:[7,1],watts:[7,1],W:[7,1],petawatt:[7,1e15],petawatts:[7,1e15],PW:[7,1e15],terawatt:[7,1e12],terawatts:[7,1e12],TW:[7,1e12],gigawatt:[7,1e9],gigawatts:[7,1e9],GW:[7,1e9],megawatt:[7,1e6],megawatts:[7,1e6],MW:[7,1e6],kilowatt:[7,1e3],kilowatts:[7,1e3],kW:[7,1e3],hectowatt:[7,100],hectowatts:[7,100],hW:[7,100],decawatt:[7,10],decawatts:[7,10],daW:[7,10],deciwatt:[7,.1],deciwatts:[7,.1],dW:[7,.1],centiwatt:[7,.01],centiwatts:[7,.01],cW:[7,.01],milliwatt:[7,.001],milliwatts:[7,.001],mW:[7,.001],microwatt:[7,1e-6],microwatts:[7,1e-6],μW:[7,1e-6],µW:[7,1e-6],nanowatt:[7,1e-9],nanowatts:[7,1e-9],nW:[7,1e-9],picowatt:[7,1e-12],picowatts:[7,1e-12],pW:[7,1e-12],femtowatt:[7,1e-15],femtowatts:[7,1e-15],fW:[7,1e-15],horsepower:[7,745.699872],"mechanical horsepower":[7,745.699872],hp:[7,745.699872],pascal:[8,1],pascals:[8,1],Pa:[8,1],petapascal:[8,1e15],petapascals:[8,1e15],PPa:[8,1e15],terapascal:[8,1e12],terapascals:[8,1e12],TPa:[8,1e12],gigapascal:[8,1e9],gigapascals:[8,1e9],GPa:[8,1e9],megapascal:[8,1e6],megapascals:[8,1e6],MPa:[8,1e6],kilopascal:[8,1e3],kilopascals:[8,1e3],kPa:[8,1e3],hectopascal:[8,100],hectopascals:[8,100],hPa:[8,100],decapascal:[8,10],decapascals:[8,10],daPa:[8,10],decipascal:[8,.1],decipascals:[8,.1],dPa:[8,.1],centipascal:[8,.01],centipascals:[8,.01],cPa:[8,.01],millipascal:[8,.001],millipascals:[8,.001],mPa:[8,.001],micropascal:[8,1e-6],micropascals:[8,1e-6],μPa:[8,1e-6],µPa:[8,1e-6],nanopascal:[8,1e-9],nanopascals:[8,1e-9],nPa:[8,1e-9],picopascal:[8,1e-12],picopascals:[8,1e-12],pPa:[8,1e-12],femtopascal:[8,1e-15],femtopascals:[8,1e-15],fPa:[8,1e-15],bar:[8,1e5],bars:[8,1e5],petabar:[8,1e20],petabars:[8,1e20],Pbar:[8,1e20],terabar:[8,1e17],terabars:[8,1e17],Tbar:[8,1e17],gigabar:[8,1e14],gigabars:[8,1e14],Gbar:[8,1e14],megabar:[8,1e11],megabars:[8,1e11],Mbar:[8,1e11],kilobar:[8,1e8],kilobars:[8,1e8],kbar:[8,1e8],hectobar:[8,1e7],hectobars:[8,1e7],hbar:[8,1e7],decabar:[8,1e6],decabars:[8,1e6],dabar:[8,1e6],decibar:[8,1e4],decibars:[8,1e4],dbar:[8,1e4],centibar:[8,1e3],centibars:[8,1e3],cbar:[8,1e3],millibar:[8,100],millibars:[8,100],mbar:[8,100],microbar:[8,.1],microbars:[8,.1],μbar:[8,.1],µbar:[8,.1],nanobar:[8,1e-4],nanobars:[8,1e-4],nbar:[8,1e-4],picobar:[8,1e-7],picobars:[8,1e-7],pbar:[8,1e-7],femtobar:[8,1e-10],femtobars:[8,1e-10],fbar:[8,1e-10],torr:[8,133.32236842105263],torrs:[8,133.32236842105263],Torr:[8,133.32236842105263],millitorr:[8,.13332236842105263],mTorr:[8,.13332236842105263],atmosphere:[8,101325],atmospheres:[8,101325],atm:[8,101325],"pound per square inch":[8,6894.757],"pounds per square inch":[8,6894.757],psi:[8,6894.757],"lbf/in2":[8,6894.757],"lbf/in²":[8,6894.757],kelvin:[9,1],kelvins:[9,1],K:[9,1],petakelvin:[9,1e15],petakelvins:[9,1e15],PK:[9,1e15],terakelvin:[9,1e12],terakelvins:[9,1e12],TK:[9,1e12],gigakelvin:[9,1e9],gigakelvins:[9,1e9],GK:[9,1e9],megakelvin:[9,1e6],megakelvins:[9,1e6],MK:[9,1e6],kilokelvin:[9,1e3],kilokelvins:[9,1e3],kK:[9,1e3],hectokelvin:[9,100],hectokelvins:[9,100],hK:[9,100],decakelvin:[9,10],decakelvins:[9,10],daK:[9,10],decikelvin:[9,.1],decikelvins:[9,.1],dK:[9,.1],centikelvin:[9,.01],centikelvins:[9,.01],cK:[9,.01],millikelvin:[9,.001],millikelvins:[9,.001],mK:[9,.001],microkelvin:[9,1e-6],microkelvins:[9,1e-6],μK:[9,1e-6],µK:[9,1e-6],nanokelvin:[9,1e-9],nanokelvins:[9,1e-9],nK:[9,1e-9],picokelvin:[9,1e-12],picokelvins:[9,1e-12],pK:[9,1e-12],femtokelvin:[9,1e-15],femtokelvins:[9,1e-15],fK:[9,1e-15],fahrenheit:[9,.5555555555555556],F:[9,.5555555555555556],celsius:[9,1],C:[9,1],rankine:[9,.5555555555555556],R:[9,.5555555555555556],second:[10,1],seconds:[10,1],s:[10,1],petasecond:[10,1e15],petaseconds:[10,1e15],Ps:[10,1e15],terasecond:[10,1e12],teraseconds:[10,1e12],Ts:[10,1e12],gigasecond:[10,1e9],gigaseconds:[10,1e9],Gs:[10,1e9],megasecond:[10,1e6],megaseconds:[10,1e6],Ms:[10,1e6],kilosecond:[10,1e3],kiloseconds:[10,1e3],ks:[10,1e3],hectosecond:[10,100],hectoseconds:[10,100],hs:[10,100],decasecond:[10,10],decaseconds:[10,10],das:[10,10],decisecond:[10,.1],deciseconds:[10,.1],ds:[10,.1],centisecond:[10,.01],centiseconds:[10,.01],cs:[10,.01],millisecond:[10,.001],milliseconds:[10,.001],ms:[10,.001],microsecond:[10,1e-6],microseconds:[10,1e-6],μs:[10,1e-6],µs:[10,1e-6],nanosecond:[10,1e-9],nanoseconds:[10,1e-9],ns:[10,1e-9],picosecond:[10,1e-12],picoseconds:[10,1e-12],ps:[10,1e-12],femtosecond:[10,1e-15],femtoseconds:[10,1e-15],fs:[10,1e-15],minute:[10,60],minutes:[10,60],min:[10,60],hour:[10,3600],hours:[10,3600],h:[10,3600],milliday:[10,86.4],millidays:[10,86.4],md:[10,86.4],day:[10,86400],days:[10,86400],d:[10,86400],week:[10,604800],weeks:[10,604800],wk:[10,604800],fortnight:[10,1209600],fortnights:[10,1209600],fn:[10,1209600],month:[10,2592e3],months:[10,2592e3],mo:[10,2592e3],year:[10,31536e3],years:[10,31536e3],a:[10,31536e3],y:[10,31536e3],yr:[10,31536e3],decade:[10,315569520],decades:[10,315569520],dec:[10,315569520],century:[10,3155695200],centuries:[10,3155695200],millennium:[10,31556952e3],millennia:[10,31556952e3],moment:[10,90],moments:[10,90],shake:[10,1e-8],shakes:[10,1e-8],"time unit":[10,.001024],TU:[10,.001024],svedberg:[10,1e-13],svedbergs:[10,1e-13],S:[10,1e-13],"cubic meter":[11,1],"cubic meters":[11,1],"cubic metre":[11,1],"cubic metres":[11,1],stere:[11,1],steres:[11,1],"m³":[11,1],m3:[11,1],"cubic petameter":[11,1e45],"cubic petameters":[11,1e45],Pm3:[11,1e45],"Pm³":[11,1e45],"cubic terameter":[11,1e36],"cubic terameters":[11,1e36],Tm3:[11,1e36],"Tm³":[11,1e36],"cubic gigameter":[11,1e27],"cubic gigameters":[11,1e27],Gm3:[11,1e27],"Gm³":[11,1e27],"cubic megameter":[11,1e18],"cubic megameters":[11,1e18],Mm3:[11,1e18],"Mm³":[11,1e18],"cubic kilometer":[11,1e9],"cubic kilometers":[11,1e9],km3:[11,1e9],"km³":[11,1e9],"cubic hectometer":[11,1e6],"cubic hectometers":[11,1e6],hm3:[11,1e6],"hm³":[11,1e6],"cubic decameter":[11,1e3],"cubic decameters":[11,1e3],dam3:[11,1e3],"dam³":[11,1e3],"cubic decimeter":[11,.001],"cubic decimeters":[11,.001],dm3:[11,.001],"dm³":[11,.001],"cubic centimeter":[11,1e-6],"cubic centimeters":[11,1e-6],cm3:[11,1e-6],"cm³":[11,1e-6],"cubic millimeter":[11,1e-9],"cubic millimeters":[11,1e-9],mm3:[11,1e-9],"mm³":[11,1e-9],"cubic micrometer":[11,1e-18],"cubic micrometers":[11,1e-18],μm3:[11,1e-18],µm3:[11,1e-18],"μm³":[11,1e-18],"µm³":[11,1e-18],"cubic nanometer":[11,1e-27],"cubic nanometers":[11,1e-27],nm3:[11,1e-27],"nm³":[11,1e-27],"cubic picometer":[11,1e-36],"cubic picometers":[11,1e-36],pm3:[11,1e-36],"pm³":[11,1e-36],"cubic femtometer":[11,1e-45],"cubic femtometers":[11,1e-45],fm3:[11,1e-45],"fm³":[11,1e-45],liter:[11,.001],liters:[11,.001],litre:[11,.001],litres:[11,.001],l:[11,.001],L:[11,.001],petaliter:[11,1e12],petaliters:[11,1e12],petalitre:[11,1e12],petalitres:[11,1e12],Pl:[11,1e12],PL:[11,1e12],teraliter:[11,1e9],teraliters:[11,1e9],teralitre:[11,1e9],teralitres:[11,1e9],Tl:[11,1e9],TL:[11,1e9],gigaliter:[11,1e6],gigaliters:[11,1e6],gigalitre:[11,1e6],gigalitres:[11,1e6],Gl:[11,1e6],GL:[11,1e6],megaliter:[11,1e3],megaliters:[11,1e3],megalitre:[11,1e3],megalitres:[11,1e3],Ml:[11,1e3],ML:[11,1e3],kiloliter:[11,1],kiloliters:[11,1],kilolitre:[11,1],kilolitres:[11,1],kl:[11,1],kL:[11,1],hectoliter:[11,.1],hectoliters:[11,.1],hectolitre:[11,.1],hectolitres:[11,.1],hl:[11,.1],hL:[11,.1],decaliter:[11,.01],decaliters:[11,.01],decalitre:[11,.01],decalitres:[11,.01],dal:[11,.01],daL:[11,.01],deciliter:[11,1e-4],deciliters:[11,1e-4],decilitre:[11,1e-4],decilitres:[11,1e-4],dl:[11,1e-4],dL:[11,1e-4],centiliter:[11,1e-5],centiliters:[11,1e-5],centilitre:[11,1e-5],centilitres:[11,1e-5],cl:[11,1e-5],cL:[11,1e-5],milliliter:[11,1e-6],milliliters:[11,1e-6],millilitre:[11,1e-6],millilitres:[11,1e-6],ml:[11,1e-6],mL:[11,1e-6],microliter:[11,1e-9],microliters:[11,1e-9],microlitre:[11,1e-9],microlitres:[11,1e-9],μl:[11,1e-9],µl:[11,1e-9],μL:[11,1e-9],µL:[11,1e-9],nanoliter:[11,1e-12],nanoliters:[11,1e-12],nanolitre:[11,1e-12],nanolitres:[11,1e-12],nl:[11,1e-12],nL:[11,1e-12],picoliter:[11,1e-15],picoliters:[11,1e-15],picolitre:[11,1e-15],picolitres:[11,1e-15],pl:[11,1e-15],pL:[11,1e-15],femtoliter:[11,1e-18],femtoliters:[11,1e-18],femtolitre:[11,1e-18],femtolitres:[11,1e-18],fl:[11,1e-18],fL:[11,1e-18],"cubic mile":[11,4200],"cubic miles":[11,4200],"cu mi":[11,4200],mi3:[11,4200],"mi³":[11,4200],"acre-foot":[11,1233.48183754752],"acre-feet":[11,1233.48183754752],"ac⋅ft":[11,1233.48183754752],"ac ft":[11,1233.48183754752],"cubic yard":[11,.76],"cubic yards":[11,.76],"cu yd":[11,.76],yd3:[11,.76],"yd³":[11,.76],"cubic foot":[11,.028316846592],"cubic feet":[11,.028316846592],"cu ft":[11,.028316846592],ft3:[11,.028316846592],"ft³":[11,.028316846592],"board foot":[11,.002359737],"board feet":[11,.002359737],"cubic inch":[11,16387064e-12],"cubic inches":[11,16387064e-12],"cu in":[11,16387064e-12],in3:[11,16387064e-12],"in³":[11,16387064e-12],"measurement ton":[11,1.133],"measurement tons":[11,1.133],MTON:[11,1.133],"imperial barrel":[11,.16],"imperial barrels":[11,.16],"imp bbl":[11,.16],"imperial bushel":[11,.03636872],"imperial bushels":[11,.03636872],"imp bsh":[11,.03636872],"imp bu":[11,.03636872],"imperial peck":[11,.00909218],"imperial pecks":[11,.00909218],pk:[11,.00909218],"imp pk":[11,.00909218],"imperial gallon":[11,.00454609],"imperial gallons":[11,.00454609],"imp gal":[11,.00454609],"imperial quart":[11,.0011365225],"imperial quarts":[11,.0011365225],"imp qt":[11,.0011365225],"imperial pint":[11,.00056826125],"imperial pints":[11,.00056826125],"imp pt":[11,.00056826125],"imperial fluid ounce":[11,284130625e-13],"imperial fluid ounces":[11,284130625e-13],"imp fl oz":[11,284130625e-13],teaspoon:[11,492892159375e-17],teaspoons:[11,492892159375e-17],"US teaspoon":[11,492892159375e-17],"US teaspoons":[11,492892159375e-17],tsp:[11,492892159375e-17],tablespoon:[11,1478676478125e-17],tablespoons:[11,1478676478125e-17],"US tablespoon":[11,1478676478125e-17],"US tablespoons":[11,1478676478125e-17],tbsp:[11,1478676478125e-17],"US fluid ounce":[11,295735295625e-16],"US fluid ounces":[11,295735295625e-16],"fl oz":[11,295735295625e-16],"fl. oz.":[11,295735295625e-16],"oz. fl.":[11,295735295625e-16],cup:[11,.0002365882365],cups:[11,.0002365882365],c:[11,.0002365882365],"US legal cup":[11,24e-5],"US legal cups":[11,24e-5],"US lc":[11,24e-5],pint:[11,.000473176473],pints:[11,.000473176473],"US liquid pint":[11,.000473176473],"US liquid pints":[11,.000473176473],pt:[11,.000473176473],p:[11,.000473176473],quart:[11,.000946352946],quarts:[11,.000946352946],"US liquid quart":[11,.000946352946],"US liquid quarts":[11,.000946352946],qt:[11,.000946352946],gallon:[11,.003785411784],gallons:[11,.003785411784],"US liquid gallon":[11,.003785411784],"US liquid gallons":[11,.003785411784],gal:[11,.003785411784],"US bushel":[11,.03523907016688],"US bushels":[11,.03523907016688],"US bsh":[11,.03523907016688],"US bu":[11,.03523907016688],"US peck":[11,.00880976754172],"US pk":[11,.00880976754172],"US dry gallon":[11,.00440488377086],"US dry gal":[11,.00440488377086],"US dry barrel":[11,.1156],"US dry barrels":[11,.1156],"US dry bbl":[11,.1156],"US dry quart":[11,.001101220942715],"US dry qt":[11,.001101220942715],"US dry pint":[11,.0005506104713575],"US dry pt":[11,.0005506104713575]},a={fahrenheit:459.67,F:459.67,celsius:273.15,C:273.15},o=10;function s(e,t,n){let i=r[n];if(!i)throw new RangeError(n+" is not a valid unit");let s=r[e];if(s[0]!==i[0])if(s[0]===o&&"m"===n)i=r.min;else{if("m"!==e||i[0]!==o)throw new RangeError(`Cannot convert between different measures: ${e} and ${n}`);s=r.min}const c=s[1],l=i[1];if("bigint"==typeof t){if((e in a||n in a)&&a[e]!==a[n])throw new RangeError(`Conversion for ${e} to ${n} cannot be calculated as one of the units has a conversion difference which cannot be expressed with bigints`);return t*BigInt(c)/BigInt(l)}return e in a?n in a?(t+a[e])*(c/l)-a[n]:(t+a[e])*(c/l):n in a?t*(c/l)-a[n]:t*(c/l)}function c(e,t){return"best"===e?function(e,t,n){const a=i["imperial"===n?1:0][r[t][0]],o=a[0][0];let c=o;const l=s(t,e,o),h=l<0?-l:l;for(let e=0;e<a.length;e++){const t=a[e];if(!(h>=t[1]))break;c=t[0]}const u=s(t,e,c);return{quantity:u,unit:c,toString:e=>`${"bigint"==typeof u||void 0===e?u:u.toFixed(e)} ${c}`}}(this.i,this.o,t??"metric"):s(this.o,this.i,e)}function l(e,t){if(!(t in r))throw new RangeError(t+" is not a valid unit");return{to:c.bind({i:e,o:t})}}},9861:(e,t,n)=>{n.d(t,{di:()=>h});var i=function(e){return function(t,n,i){return e(t,n,i)*i}},r=function(e,t){if(e)throw Error("Invalid sort config: "+t)},a=function(e){var t=e||{},n=t.asc,a=t.desc,o=n?1:-1,s=n||a;return r(!s,"Expected `asc` or `desc` property"),r(n&&a,"Ambiguous object with `asc` and `desc` config properties"),{order:o,sortBy:s,comparer:e.comparer&&i(e.comparer)}};function o(e,t,n){if(void 0===e||!0===e)return function(e,i){return t(e,i,n)};if("string"==typeof e)return r(e.includes("."),"String syntax not allowed for nested properties."),function(i,r){return t(i[e],r[e],n)};if("function"==typeof e)return function(i,r){return t(e(i),e(r),n)};if(Array.isArray(e)){var i=function(e){return function t(n,i,r,o,s,c,l){var h,u;if("string"==typeof n)h=c[n],u=l[n];else{if("function"!=typeof n){var d=a(n);return t(d.sortBy,i,r,d.order,d.comparer||e,c,l)}h=n(c),u=n(l)}var p=s(h,u,o);return(0===p||null==h&&null==u)&&i.length>r?t(i[r],i,r+1,o,s,c,l):p}}(t);return function(r,a){return i(e[0],e,1,n,t,r,a)}}var s=a(e);return o(s.sortBy,s.comparer||t,s.order)}var s=function(e,t,n,i){return Array.isArray(t)?(Array.isArray(n)&&n.length<2&&(n=n[0]),t.sort(o(n,i,e))):t};function c(e){var t=i(e.comparer);return function(n){var i=Array.isArray(n)&&!e.inPlaceSorting?n.slice():n;return{asc:function(e){return s(1,i,e,t)},desc:function(e){return s(-1,i,e,t)},by:function(e){return s(1,i,e,t)}}}}var l=function(e,t,n){return null==e?n:null==t?-n:typeof e!=typeof t?typeof e<typeof t?-1:1:e<t?-1:e>t?1:0},h=c({comparer:l});c({comparer:l,inPlaceSorting:!0})}}]);